ginac-1.7.8.orig/0000755000000000000000000000000013546717365010456 5ustar ginac-1.7.8.orig/AUTHORS0000644000000000000000000000224013457611471011514 0ustar GiNaC was originally written by: Christian Bauer Alexander Frink Richard Kreckel The following people have contributed code to GiNaC: Roberto Bagnara Chris Dams Do Hoang Son Vladimir V. Kisil Vitaly Magerya Markus Nullmeier Pearu Peterson Benedikt Plümper Ben Sapp Alexei Sheplyakov Jens Vollinga Stefan Weinzierl (Please send email if you think you were forgotten.) Contacing the developers ------------------------ If you have found a bug, have a patch or a question, or would like to make a suggestion please send email to one of our public mailing lists instead of to the authors. This avoids both potential duplication of work and delays caused by possible vacations. Mailing list subscription is explained at . ginac-1.7.8.orig/CMakeLists.txt0000644000000000000000000001547613457611471013223 0ustar cmake_minimum_required(VERSION 3.1) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") project(GiNaC) file(STRINGS ${CMAKE_SOURCE_DIR}/ginac/version.h _ginac_vinfo REGEX "^#define[\t ]+GINACLIB_.*_VERSION.*") string(REGEX REPLACE "^.*GINACLIB_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" GINAC_MAJOR_VERSION "${_ginac_vinfo}") string(REGEX REPLACE "^.*GINACLIB_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" GINAC_MINOR_VERSION "${_ginac_vinfo}") string(REGEX REPLACE "^.*GINACLIB_MICRO_VERSION[ \t]+([0-9]+).*" "\\1" GINAC_MICRO_VERSION "${_ginac_vinfo}") set(GINAC_VERSION "${GINAC_MAJOR_VERSION}.${GINAC_MINOR_VERSION}.${GINAC_MICRO_VERSION}") # Library versioning info file(STRINGS ${CMAKE_SOURCE_DIR}/ginac/version.h _ginac_vinfo REGEX "^#define[\t ]+GINAC_LT_.*") string(REGEX REPLACE "^.*GINAC_LT_CURRENT[ \t]+([0-9]+).*" "\\1" ginac_lt_current "${_ginac_vinfo}") string(REGEX REPLACE "^.*GINAC_LT_AGE[ \t]+([0-9]+).*" "\\1" ginac_lt_age "${_ginac_vinfo}") string(REGEX REPLACE "^.*GINAC_LT_REVISION[ \t]+([0-9]+).*" "\\1" ginac_lt_revision "${_ginac_vinfo}") # XXX: it looks like we need to set this for every platform? math(EXPR ginaclib_soversion "${ginac_lt_current} - ${ginac_lt_age}") set(ginaclib_version ${ginaclib_soversion}.${ginac_lt_age}.${ginac_lt_revision}) # make check enable_testing() add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) # make info add_custom_target(info ALL) add_custom_target(html) add_custom_target(pdf) set (CMAKE_CXX_STANDARD 11) find_package(CLN 1.2.2 REQUIRED) include_directories(${CLN_INCLUDE_DIR}) include(CheckIncludeFile) check_include_file("unistd.h" HAVE_UNISTD_H) include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/ginac) # This macro implements some very special logic how to deal with the cache. # By default the various install locations inherit their value from their #"parent" variable, so if you set CMAKE_INSTALL_PREFIX, then # EXEC_INSTALL_PREFIX, BIN_INSTALL_DIR, LIB_INSTALL_DIR, etc will calculate # their value by appending subdirs to CMAKE_INSTALL_PREFIX. # This would work just fine without using the cache. # But if somebody wants e.g. a different EXEC_INSTALL_PREFIX this value # has to go into the cache, otherwise it will be forgotten on the next cmake # run. Once a variable is in the cache, it doesn't depend on its "parent" # variables anymore and you can only change it by editing it directly. # This macro helps in this regard, because as long as you don't set one # of the variables explicitly to some location, the value will be computed # from parents of the variable in question. So modifying CMAKE_INSTALL_PREFIX # later on will have the desired effect. # But once you decide to set e.g. EXEC_INSTALL_PREFIX to some special # location this will go into the cache and it will no longer depend on # CMAKE_INSTALL_PREFIX. macro(_set_fancy _var _value _comment) set(predefinedvalue "${_value}") if ("${CMAKE_INSTALL_PREFIX}" STREQUAL "${GINAC_INSTALL_DIR}" AND DEFINED GINAC_${_var}) set(predefinedvalue "${GINAC_${_var}}") endif() if (NOT DEFINED ${_var}) set(${_var} ${predefinedvalue}) else() set(${_var} "${${_var}}" CACHE PATH "${_comment}") endif() endmacro(_set_fancy) _set_fancy(EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" "Base directory for libraries and executables") _set_fancy(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib" "Libraries installation directory") _set_fancy(BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" "Binaries installation directory") _set_fancy(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share" "Base directory for architecture independent files") _set_fancy(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" "Headers installation directory") if (NOT DEFINED BUILD_SHARED_LIBS) if (NOT MSVC) set(BUILD_SHARED_LIBS true) else() set(BUILD_SHARED_LIBS false) endif() endif() # Set proper rpath so tools will Just Work(TM) after make install. # Also take care to add -Wl,-rpath, stanza into the *.pc file so that # # g++ `pkg-config --cflags --libs ginac` # # will Just Work (TM), too. # Distro packagers should use -DCMAKE_INSTALL_RPATH="" to avoid # setting rpath on installed binaries. # rpath for making binaries/libraries relocatable set(_ginac_rpath_reloc "$ORIGIN/../lib") set(_wl_rpath "${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}") # rpath for the pkg-config meta-data. set(_ginaclib_rpath "${_wl_rpath}${_ginac_rpath_reloc}") list(FIND CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" isSystemDir) if ("${isSystemDir}" STREQUAL "-1") list(APPEND _ginaclib_rpath "${_wl_rpath}\${libdir}") endif() set(GINACLIB_RPATH) if (NOT CMAKE_SKIP_RPATH) if (_wl_rpath) set(GINACLIB_RPATH "${_ginaclib_rpath}") endif() endif() configure_file(${CMAKE_SOURCE_DIR}/ginac.pc.cmake ${CMAKE_BINARY_DIR}/ginac.pc @ONLY) install(FILES ${CMAKE_BINARY_DIR}/ginac.pc DESTINATION "${LIB_INSTALL_DIR}/pkgconfig") # rpath for libginac.so itself, ginsh, and friends set(_ginac_rpath ${_ginac_rpath_reloc}) foreach(_d ${CLN_LIBRARY_DIRS} ${LIB_INSTALL_DIR}) list(FIND CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "${_d}" isSystemDir) if ("${isSystemDir}" STREQUAL "-1") list(APPEND _ginac_rpath "${_d}") endif() endforeach() list(REMOVE_DUPLICATES _ginac_rpath) string(REPLACE ";" ":" ginac_rpath "${_ginac_rpath}") if (NOT DEFINED CMAKE_INSTALL_RPATH_USE_LINK_RPATH) set(CMAKE_INSTALL_RPATH_USE_LINK_RPATH TRUE) endif() if (NOT DEFINED CMAKE_INSTALL_RPATH) set(CMAKE_INSTALL_RPATH ${ginac_rpath}) endif() if (APPLE AND NOT DEFINED CMAKE_INSTALL_NAME_DIR) set(CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR}) endif() list(FIND CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" isSystemDir) if ("${isSystemDir}" STREQUAL "-1") string(REPLACE ":" ";" _install_rpath "${CMAKE_INSTALL_RPATH}") list(FIND _install_rpath "${LIB_INSTALL_DIR}" _is_rpath_consistent) if ("${_is_rpath_consistent}" STREQUAL "-1") message(WARNING "the libginac.so library will be installed into " "a non-standard directory (${LIB_INSTALL_DIR}), " "however, the rpath (${_install_rpath}) " "does not contain that directory. Most likely " "things won't work without extra configuration " "(tweaking LD_LIBRARY_PATH, /etc/ld.so.conf, etc).") endif() endif() include(FindFLEX) include(FindBISON) find_package(BISON) find_package(FLEX) find_package(Readline) if (READLINE_FOUND) set(HAVE_LIBREADLINE 1) set(HAVE_READLINE_READLINE_H 1) set(HAVE_READLINE_HISTORY_H 1) endif() find_package(LibDL) if (LIBDL_FOUND) set(HAVE_LIBDL 1) endif() find_program(MAKEINFO makeinfo) find_program(FIG2DEV fig2dev) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) add_definitions(-DHAVE_CONFIG_H) if (NOT LIBEXECDIR) set (LIBEXECDIR "${CMAKE_INSTALL_PREFIX}/libexec") endif() add_subdirectory(ginac) add_subdirectory(tools) add_subdirectory(check) if (BISON_FOUND AND FLEX_FOUND) add_subdirectory(ginsh) endif() if (MAKEINFO) add_subdirectory(doc) endif() ginac-1.7.8.orig/COPYING0000644000000000000000000004336313457611471011512 0ustar 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 Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to 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. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 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. , 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. ginac-1.7.8.orig/ChangeLog0000644000000000000000000000056113457611471012222 0ustar This file is not yet operational. Eventually it should record all changes. Till then, you are advised to resort to our git server where all changes are logged. This is how to get anonymous read-only access: $ git clone git://www.ginac.de/ginac.git ginac $ cd ginac; git whatchanged Alternatively you can browse the repository on-line at http://www.ginac.de/ginac.git ginac-1.7.8.orig/GiNaC.spec0000644000000000000000000000676213546714022012251 0ustar %define name ginac %define version 1.7.8 %define release 1 Summary: C++ library for symbolic calculations Name: %{name} Version: %{version} Release: %{release} License: GPL Group: System Environment/Libraries Source0: http://www.ginac.de/%{name}-%{version}.tar.bz2 URL: http://www.ginac.de/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Prefix: %{_prefix} Requires(post): /sbin/install-info Requires(preun): /sbin/install-info Requires: cln >= 1.1 BuildRequires: cln-devel >= 1.1 gcc-c++ readline-devel Obsoletes: GiNaC %description GiNaC (which stands for "GiNaC is Not a CAS (Computer Algebra System)") is an open framework for symbolic computation within the C++ programming language. %package devel Summary: GiNaC development libraries and header files Group: Development/Libraries Requires: %{name} = %{version}-%{release} cln-devel Obsoletes: GiNaC-devel %description devel GiNaC (which stands for "GiNaC is Not a CAS (Computer Algebra System)") is an open framework for symbolic computation within the C++ programming language. This package contains the libraries, include files and other resources you use to develop GiNaC applications. %package utils Summary: GiNaC-related utilities Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} Obsoletes: GiNaC-utils %description utils GiNaC (which stands for "GiNaC is Not a CAS (Computer Algebra System)") is an open framework for symbolic computation within the C++ programming language. This package includes the ginsh ("GiNaC interactive shell") which provides a simple and easy-to-use CAS-like interface to GiNaC for non-programmers, and the tool "viewgar" which displays the contents of GiNaC archives. %prep %setup -q %build %configure make %install rm -rf ${RPM_BUILD_ROOT} %makeinstall %clean rm -rf ${RPM_BUILD_ROOT} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %post devel /sbin/install-info --info-dir=%{_infodir} %{_infodir}/ginac.info.gz 2>/dev/null || : %preun devel if [ "$1" = 0 ]; then /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ginac.info.gz 2>/dev/null || : fi %files %defattr(-,root,root) %doc AUTHORS COPYING ChangeLog NEWS README %{_libdir}/*.so.* %files devel %defattr(-,root,root) %{_libdir}/*.a %{_libdir}/*.la %{_libdir}/*.so %{_libdir}/pkgconfig/ginac.pc %{_includedir}/ginac %{_infodir}/*.info* %files utils %defattr(-,root,root) %{_bindir}/ginsh %{_bindir}/viewgar %{_mandir}/man1/ginsh.1* %{_mandir}/man1/viewgar.1* %changelog * Mon Jul 11 2005 Christian Bauer - name of package changed from "GiNaC" to "ginac"; added "Obsoletes:" directives * Thu Jun 30 2005 Christian Bauer - included some updates from the Fedora Extras spec file: - "Copyright:" -> "License:" - Fixed broken install-info command - Added missing BuildRequires - Added release to Requires for devel and utils - Remove processing of info files (this is supposed to be automatic) - Added cln-devel as dependency of GiNaC-devel * Thu Nov 20 2003 Christian Bauer - added pkg-config metadata file to devel package * Thu Nov 1 2001 Christian Bauer - moved ginsh and viewgar to "utils" package * Thu Oct 5 2000 Christian Bauer - cleaned up a bit * Wed Jan 26 2000 Christian Bauer - split into user and devel packages * Wed Dec 1 1999 Christian Bauer - aclocal macros get installed ginac-1.7.8.orig/GiNaC.spec.in0000644000000000000000000000677213457611471012664 0ustar %define name @PACKAGE@ %define version @VERSION@ %define release 1 Summary: C++ library for symbolic calculations Name: %{name} Version: %{version} Release: %{release} License: GPL Group: System Environment/Libraries Source0: http://www.ginac.de/%{name}-%{version}.tar.bz2 URL: http://www.ginac.de/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Prefix: %{_prefix} Requires(post): /sbin/install-info Requires(preun): /sbin/install-info Requires: cln >= 1.1 BuildRequires: cln-devel >= 1.1 gcc-c++ readline-devel Obsoletes: GiNaC %description GiNaC (which stands for "GiNaC is Not a CAS (Computer Algebra System)") is an open framework for symbolic computation within the C++ programming language. %package devel Summary: GiNaC development libraries and header files Group: Development/Libraries Requires: %{name} = %{version}-%{release} cln-devel Obsoletes: GiNaC-devel %description devel GiNaC (which stands for "GiNaC is Not a CAS (Computer Algebra System)") is an open framework for symbolic computation within the C++ programming language. This package contains the libraries, include files and other resources you use to develop GiNaC applications. %package utils Summary: GiNaC-related utilities Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} Obsoletes: GiNaC-utils %description utils GiNaC (which stands for "GiNaC is Not a CAS (Computer Algebra System)") is an open framework for symbolic computation within the C++ programming language. This package includes the ginsh ("GiNaC interactive shell") which provides a simple and easy-to-use CAS-like interface to GiNaC for non-programmers, and the tool "viewgar" which displays the contents of GiNaC archives. %prep %setup -q %build %configure make %install rm -rf ${RPM_BUILD_ROOT} %makeinstall %clean rm -rf ${RPM_BUILD_ROOT} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %post devel /sbin/install-info --info-dir=%{_infodir} %{_infodir}/ginac.info.gz 2>/dev/null || : %preun devel if [ "$1" = 0 ]; then /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ginac.info.gz 2>/dev/null || : fi %files %defattr(-,root,root) %doc AUTHORS COPYING ChangeLog NEWS README %{_libdir}/*.so.* %files devel %defattr(-,root,root) %{_libdir}/*.a %{_libdir}/*.la %{_libdir}/*.so %{_libdir}/pkgconfig/ginac.pc %{_includedir}/ginac %{_infodir}/*.info* %files utils %defattr(-,root,root) %{_bindir}/ginsh %{_bindir}/viewgar %{_mandir}/man1/ginsh.1* %{_mandir}/man1/viewgar.1* %changelog * Mon Jul 11 2005 Christian Bauer - name of package changed from "GiNaC" to "ginac"; added "Obsoletes:" directives * Thu Jun 30 2005 Christian Bauer - included some updates from the Fedora Extras spec file: - "Copyright:" -> "License:" - Fixed broken install-info command - Added missing BuildRequires - Added release to Requires for devel and utils - Remove processing of info files (this is supposed to be automatic) - Added cln-devel as dependency of GiNaC-devel * Thu Nov 20 2003 Christian Bauer - added pkg-config metadata file to devel package * Thu Nov 1 2001 Christian Bauer - moved ginsh and viewgar to "utils" package * Thu Oct 5 2000 Christian Bauer - cleaned up a bit * Wed Jan 26 2000 Christian Bauer - split into user and devel packages * Wed Dec 1 1999 Christian Bauer - aclocal macros get installed ginac-1.7.8.orig/INSTALL0000644000000000000000000001120613540235235011470 0ustar PREREQUISITES ============= GiNaC requires the CLN library by Bruno Haible installed on your system. It is available from . You will also need a decent ISO C++-11 compiler. We recommend the C++ compiler from the GNU compiler collection, GCC >= 4.8. If you have a different or older compiler you are on your own. Note that you may have to use the same compiler you compiled CLN with because of differing name-mangling schemes. The pkg-config utility is required for configuration, it can be downloaded from . Also, Python 3 is required. To build the GiNaC tutorial and reference manual the doxygen utility (it can be downloaded from http://www.stack.nl/~dimitri/doxygen) and TeX are necessary. Known to work with: - Linux on x86 and x86_64 using - GCC 4.8, 4.9, 5.1, 5.2, 5.3, and 6.1 - Clang 3.5, 3.6, 3.7, 3.8 Known not to work with: - Clang 2.7 and earlier due to poor C++ support. - GCC < 4.6.0 due to missing C++-11 support If you install from git, you also need GNU autoconf (>=2.59), automake (>=1.8), libtool (>= 1.5), python3, bison (>= 2.3), flex (>= 2.5.33) to be installed. INSTALLATION ============ To install from an unpacked source .tar.bz2 distribution: $ ./configure $ make [become root if necessary] # make install To build the GiNaC tutorial and reference manual in HTML, DVI, PostScript, or PDF formats, use one of $ make html $ make dvi $ make ps $ make pdf To compile and run GiNaC's test and benchmark suite and check whether the library works correctly you can use $ make check The "configure" script can be given a number of options to enable and disable various features. For a complete list, type: $ ./configure --help A few of the more important ones: --prefix=PREFIX install architecture-independent files in PREFIX [defaults to /usr/local] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [defaults to the value given to --prefix] --disable-shared suppress the creation of a shared version of libginac --disable-static suppress the creation of a static version of libginac More detailed installation instructions can be found in the documentation, in the doc/ directory. The time to build the library depends to a large degree on optimization levels. Using the default high optimization, 'make' takes a few minutes on a fast machine and 'make check' takes some more minutes. You can speed this up with a parallel build with 'make -j2' or higher, depending on the number of available CPU cores. To install from git =================== First, download the code: $ git clone git://www.ginac.de/ginac.git ginac $ cd ginac Secondly, make sure all required software is installed. This is *really* important step. If some package is missing, the `configure' script might be misgenerated, see e.g. this discussion: Finally, run $ autoreconf -i to generate the `configure' script, and proceed in a standard way, i.e. $ ./configure $ make [become root if necessary] # make install COMMON PROBLEMS =============== Problems with CLN ----------------- You should use at least CLN-1.2.2, since during the development of GiNaC various bugs have been discovered and fixed in earlier versions. Please install CLN properly on your system before continuing with GiNaC. Problems building ginsh ----------------------- The GiNaC interactive shell, ginsh, makes use of GNU readline to provide command line editing and history. If readline library and/or headers are missing on your system, the configure script will issue a warning. In this case you have two options: 1) (the easiest) If you don't intend to use ginsh (i.e. if you need GiNaC library to compile some piece of software), ignore it. ginsh builds just fine without readline (obviously, it won't support the command line history and editing). 2) Install GNU readline and run the configure script once again. Depending on what your system/distribution is, you will have to install a package called libreadline and libreadline-dev (or readline-devel). If your system's vendor doesn't supply such packages, go to and compile it yourself. Note that non-GNU versions of libreadline (in particular one shipped with Mac OS X) are not supported at the moment. Problems with missing standard header files ------------------------------------------- Building GiNaC requires many standard header files. If you get a configure error complaining about such missing files your compiler and library are probably not up to date enough and it's no worth continuing. ginac-1.7.8.orig/INSTALL.CMake0000644000000000000000000000307313540235235012452 0ustar PREREQUISITES ============= 1. A decent ISO C++-11 compiler. GCC (version >= 4.9) is recommended. 2. CLN library (http://www.ginac.de/CLN), version >= 1.2.2 3. CMake, version >= 2.8 (version 2.6.x might work too). 4. Python 3 5. (optional) pkg-config utility (http://pkg-config.freedesktop.org) 6. (optional) bison (>= 2.3), flex (2.5.33), GNU readline (>= 4.3). These are necessary to build ginsh, the GiNaC interactive shell, and can be skipped if you don't intend to use ginsh (i.e. you need the GiNaC library for compiling another piece of a software). 7. (optional) To build the GiNaC tutorial and reference manual the doxygen utility (it can be downloaded from http://www.stack.nl/~dimitri/doxygen) and TeX are necessary. INSTALLATION ============ To install from a source distribution: -------------------------------------- 1) Unpack the tarball $ tar xaf ginac-x.y.z.tar.bz2 2) Create a build directory $ mkdir ginac_build 3) Run CMake to generate Makefile's $ cd ginac_build $ cmake ../ginac-x.y.z 4) Actually build GiNaC $ make 5) Run the test and benchmark suite (not mandatory, but strongly recommended) $ make check 6) Install GiNaC [become root if necessary] # make install To install from git: -------------------- The steps are essentially the same as compiling from the tarball, the only difference is using git to get the code. 1) Download the code: $ git clone git://www.ginac.de/ginac.git ginac or, if you have already cloned the repository, $ git pull Subsequent steps are the same as compiling from a source tarball. ginac-1.7.8.orig/Makefile.am0000644000000000000000000000162013457611471012501 0ustar ## Process this file with automake to produce Makefile.in SUBDIRS = ginac check ginsh tools doc DIST_SUBDIRS = ginac check ginsh tools doc # pkg-config metadata pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = ginac.pc $(pkgconfig_DATA): config.status CMAKE_FILES = CMakeLists.txt \ ginac.pc.cmake \ config.cmake.in \ INSTALL.CMake \ cmake/modules/FindCLN.cmake \ cmake/modules/FindReadline.cmake \ cmake/modules/FindGiNaC.cmake \ cmake/modules/FindLibDL.cmake BUILD_HELPERS = scripts/yaptu.py scripts/fixupind.py # All the rest of the distributed files EXTRA_DIST = ginac.pc GiNaC.spec $(BUILD_HELPERS) $(CMAKE_FILES) # Rule to build tar-bzipped distribution package $(PACKAGE)-$(VERSION).tar.gz: dist # Rule to build RPM distribution package rpm: $(PACKAGE)-$(VERSION).tar.gz rpmbuild -ta --clean $(PACKAGE)-$(VERSION).tar.gz ACLOCAL_AMFLAGS = -I m4 ginac-1.7.8.orig/Makefile.in0000644000000000000000000007273513541765075012535 0ustar # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = GiNaC.spec ginac.pc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope am__DIST_COMMON = $(srcdir)/GiNaC.spec.in $(srcdir)/Makefile.in \ $(srcdir)/ginac.pc.in $(top_srcdir)/config/compile \ $(top_srcdir)/config/config.guess \ $(top_srcdir)/config/config.h.in \ $(top_srcdir)/config/config.rpath \ $(top_srcdir)/config/config.sub \ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ $(top_srcdir)/config/missing AUTHORS COPYING ChangeLog INSTALL \ NEWS README config/compile config/config.guess \ config/config.rpath config/config.sub config/depcomp \ config/install-sh config/ltmain.sh config/mdate-sh \ config/missing config/texinfo.tex config/ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best DIST_TARGETS = dist-bzip2 dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLN_CFLAGS = @CLN_CFLAGS@ CLN_LIBS = @CLN_LIBS@ CLN_RPATH = @CLN_RPATH@ CONFIG_EXCOMPILER = @CONFIG_EXCOMPILER@ CONFIG_RUSAGE = @CONFIG_RUSAGE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVIPS = @DVIPS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FIG2DEV = @FIG2DEV@ GINACLIB_RPATH = @GINACLIB_RPATH@ GINSH_LIBS = @GINSH_LIBS@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LATEX = @LATEX@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAKEINDEX = @MAKEINDEX@ 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@ PDFLATEX = @PDFLATEX@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YACCEXE = @YACCEXE@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = ginac check ginsh tools doc DIST_SUBDIRS = ginac check ginsh tools doc # pkg-config metadata pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = ginac.pc CMAKE_FILES = CMakeLists.txt \ ginac.pc.cmake \ config.cmake.in \ INSTALL.CMake \ cmake/modules/FindCLN.cmake \ cmake/modules/FindReadline.cmake \ cmake/modules/FindGiNaC.cmake \ cmake/modules/FindLibDL.cmake BUILD_HELPERS = scripts/yaptu.py scripts/fixupind.py # All the rest of the distributed files EXTRA_DIST = ginac.pc GiNaC.spec $(BUILD_HELPERS) $(CMAKE_FILES) ACLOCAL_AMFLAGS = -I m4 all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config/config.h: config/stamp-h1 @test -f $@ || rm -f config/stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) config/stamp-h1 config/stamp-h1: $(top_srcdir)/config/config.h.in $(top_builddir)/config.status @rm -f config/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config/config.h $(top_srcdir)/config/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f config/stamp-h1 touch $@ distclean-hdr: -rm -f config/config.h config/stamp-h1 GiNaC.spec: $(top_builddir)/config.status $(srcdir)/GiNaC.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ ginac.pc: $(top_builddir)/config.status $(srcdir)/ginac.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-pkgconfigDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkgconfigDATA .PRECIOUS: Makefile $(pkgconfig_DATA): config.status # Rule to build tar-bzipped distribution package $(PACKAGE)-$(VERSION).tar.gz: dist # Rule to build RPM distribution package rpm: $(PACKAGE)-$(VERSION).tar.gz rpmbuild -ta --clean $(PACKAGE)-$(VERSION).tar.gz # 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: ginac-1.7.8.orig/NEWS0000644000000000000000000012404113546713747011157 0ustar This file records noteworthy changes. 1.7.8 (7 October 2019) * Fix pseries::evalf(), broken since 1.7.0. * Fix a corner-case bug in H_evalf(). 1.7.7 (22 September 2019) * Fix unarchiving empty containers. * Remove obsolete exhashmap implementation. * Fix issues with zeta computation. * Build with Python3. 1.7.6 (22 April 2019) * Fix a bug in mul::series() about asymptotic order term. * Fix cl_N code generation for small negative integers. * Fix multiple polylog computation related to trailing zeros and user-specified signs for small imaginary parts. * Fix CMake build with Python3. 1.7.5 (17 February 2019) * Add Markowitz-ordered Gaussian eliminatin. * Avoid un-normal zeros in matrix::solve(). * Accept exprseq arguments in lsolve(eqns, vars). * Add overload of matrix::rank(solve_algo). * Fix case in G_do_hoelder with real x values which are not cl_R. * Fix an elusive bug in expairseq/add ctor, introduced in 1.7.0. 1.7.4 (19 February 2018) * Fix ABI compatibility with 1.7.[0-2] (broken unintentionally in 1.7.3). 1.7.3 (1 February 2018) * Speed up some corner cases of polynomial factorization. * Speed up some corner cases of gcd computation. * Speed up factorization of pre-factored polynomials. * Make matrix::solve() work with hidden (non-normal) zeros. * Fix bug in evaluation of real and imaginary parts of powers. * Fix some LaTeX output, add new function symbol::get_TeX_name(). 1.7.2 (10 January 2017) * Fix memory leak in operators returning relationals, introduced in 1.7.0. * Make macro GINAC_DECLARE_REGISTERED_CLASS() work outside namespace GiNaC. * Fix some build issues. 1.7.1 (2 October 2016) * Fix crash in basic::subs(), visible in classes which don't override it. * Fix convergence failure in Li_projection. * Fix cliffor_bar() and clifford_star(). * Improve performance of clifford_to_lst(). * Fix compilation issues, reduce compiler warnings. 1.7.0 (30 April 2016) * Make use of C++11 features: - Use new language features 'auto', 'nullptr', 'constexpr', range-based for loops, the contextual keyword 'override', static 'noexcept' operator, etc. - Add initializer list ctors for container<>, lst and nested initializer lists ctor for class matrix. - Add many rvalue reference overloads for ctors from std containers. (Note that whether they really speed up things depends on whether evaluation leaves the container unchanged or not.) - Rvalue reference overloads for ctors from std containers made it possible to remove the manual 'discardable' hack and std::auto_ptr for good. - New dynallocate(args...) helper functions obsolete manual allocation on the heap and setting the dynallocated status flag. - Got rid of C++98ish algorithm features (bind2nd, etc.) and replaced them with lambdas. * Make add::eval(), mul::eval() more careful so they return an evaluated, canonical expression without compromise. * Remove 'level' argument of all .eval() methods. This has become possible by ensuring that add::eval() and mul::eval() evaluate their own structure without compromise (this was not guaranteed before). If all ex are evaluated, any object which is an aggregate of such ex will only ever have to evaluate itself, obsoleting the need for recursing. * Remove 'level' arguments of all .evalf() and .normal() methods. They were modeled after the .eval() methods. * Make relational::rhs() and lhs() nonvirtual. * Add support for power::info(info_flags::real). * Add fderivative::derivatives() method. * Remove broken info_flags::algebraic. * Remove unmaintained support for Cint. * Remove unfinished andcode for hash table-based expairseq. * Remove deprecated ex::to_rational(lst) and ex::to_polynomial(lst). * ginac-excompiler installs in $LIBEXECDIR now, not in $BINDIR. * Many minor performance enhancements. 1.6.7 (29 February 2016) * Fix elusive bug in sqrfree(), normal(), numer(), and denom(). 1.6.6 (20 December 2015) * Fix elusive bug in add::eval(). * Several minor performance enhancements. 1.6.5 (27 July 2015) * Fix pow(+(...),2).expand() where the sum contained roots of expressions. * Speed-up pow(+(...),n).expand() where n > 3. * Fix a crash in PolyLogs of rational numbers. 1.6.4 (8 May 2015) * Fix pow(+(...),2).expand() where the sum contained roots of rationals. * Various improvements for info(info_flags::nonnegative). * Make power::expand() (x*p)^c -> x^c * p^c, if p>0. * Fix normal() where nested functions occur multiple times. * Add optional explicit derivatives to functions and use it in abs(), imag_part(), real_part(). * Evaluate abs(z)^(2n) -> z^n * conjugate(z)^n. 1.6.3 (27 November 2014) * New expand_options::expand_transcendental. GiNaC will apply additional rules when expanding expressions if this option is specified, i.e. log(a*b) -> log(a) + log(b) exp(a + b) -> exp(a)*exp(b) * Functions can define a custom expand() and info() now. * Automatically rewrite (x^{-1})^c -> x^{-c} for positive c. * Transform abs(x)^n -> x^n if x is real and n is even. * Improved power::info(): power with a real base and even exponent reports that it's non-negative. * Fixed spurious match failure due to expairseq::match() bug: > match(sin(y)*exp(b)+sin(x)*exp(a), sin($0)*exp(a)+exp(b)*sin($1)) FAIL * Fixed power::is_polynomial() and mul::is_polynomial() computation. * factor_univariate correctly handles polynomials over rationals (no segfaults any more). * Fixed an infinite loop in factor_multivariate due to incorrect handling of polynomials having a leading coefficient being a sum with a non-trivial integer content. * Fixed numeric evaluation of generalized multiple polylogarithms for real and negative argument. * Avoid calling log(1-x) in numeric evaluation of classical polylogarithm. * Fixed numeric evaluation of multiple polylogarithms (correctly set the signs of the imaginary parts in the intermediate expression). * Fixed numeric evaluation of Nielsen polylogs for arguments close to the 6th root of unity or its conjugate. * Avoid infinite recursion in series expansion of logarithm. * numeric::info(info_flags::nonnegative) correctly handles complex numbers with non-zero imaginary part. * Fixed several build issues: - libreadline and dlopen() misdetection. - multiple definition of symbol on MinGW. - auto* tools and texinfo being unhappy in various ways. * GiNaC can be built with CMake now. 1.6.2 (6 November 2011) * Fixed the parser to read GiNaC::lst again. * Fixed a compile warning (relevant to openSUSE build). * Fixed a bug concerning the subsitutions in indexed expressions (subs_options::no_index_renaming was ignored). 1.6.1 (18 July 2011) * Fixed several internal assertions for the debug version of GiNaC. * More verbose report of (auto-)configuration problems. * Fixed a compile problem with ginsh using gcc 4.6. 1.6.0 (22 May 2011) * Fixed compilation issues with clang. * Fixed compilation issues with VC++. * Fixed a segfault in fsolve() and improved its numerical algorithm. * Fixed several memory leaks in power::eval(). * Fixed the substitution algorithm that led to wrong results (exp(log(x))->x). * Fixed a bug in add:eval() (real_part() had returned wrong results). * Fixed infinite loop bug when unarchiving realsymbol and possymbol. * Fixed bugs in the GCD code. * Fixed empty string bug in symbol::get_name(). * Fixed bugs concerning STL vector sizes that can potentially cause segfaults. * Fixed a bug in is_polynomial(). * Removed autogen dependencies. * Improved simplify_indexed() algorithm. * Changed the connection between library version and package version. * power::series() can handle now more expressions with singularities in the exponent. * Added conjugate() methods to functions cosh, sinh, tanh. 1.5.8 (06 July 2010) * Changed default behaviour of conjugate() for user-defined functions to avoid wrong evaluations. A user-defined conjugate_func must now be explicitly registered. * Fixed: Parser now handles abbreviations as advertized in the manual. * Fixed two bugs in the GCD code (one infinite loop, one miscalculation). * Fixed dangerous iterator use. * Fixed a memory leak in excompiler. * Fixed several syntax issues wrt to gcc 4.5 and wrt to compile option -std=cxx0x. * Fixed a wrong URL and a texinfo problem in the manual. * Added degree_vector() utility function. 1.5.7 (29 March 2010) * Fixed a bug in the GCD code (infinite loop in pgcd()). * Fixed a bug in atan2() (division by zero error for atan2(x,0) if x is a negative and composite term). * Products now correctly set info_flags::negative and info_flags::negint. 1.5.6 (28 January 2010) * Fixed compile problem with gcc 3.4. * Improved excompiler: The ginac-excompiler script will only be installed if excompiler is supported and enabled. 1.5.5 (04 November 2009) * Correct libtool versioning. 1.5.4 (02 November 2009) * Default parser now can again read in user defined classes. * Add mul::info() and add::info() support for numeric info_flags (GiNaC now can detect that the sum or product of a number of positive expressions is again a positive expression). * Fixed cast that caused compile error on 64bit machines. * Fixed incorrect uses of STL iterators. * Removed subdirectory debian. * Output LaTeX-symbols using \mathrm, instead of \mbox. 1.5.3 (30 July 2009) * The parser now understands user-defined functions by default. The identifier names can now contain underscores. 1.5.2 (10 July 2009) * Fixed documentation of return_type_info() * Fixed cstdio include issue. * GiNaC now requires at least version 1.2.2 of cln. 1.5.1 (25 February 2009) * Fixed compiling problems with GNU g++ 3.4. * Work around weird C++ RTTI behaviour on woe32 so GiNaC works on MinGW again. 1.5.0 (17 February 2009) * Added polynomial factorization. * New, faster (recursive descent) expression parser. * Faster GCD computation. * gcd() now allows the user to override (some of the) heuristics. * Writing extensions classes is simpler now: - Replaced custom RTTI by standard C++ RTTI. - Definition of archiving methods now optional when declaring a new GiNaC class. * Fixed recursion in polynomial divide that caused a significant slowdown in sqrfree(). * Improved lsolve() of systems containing non-numeric coefficients. * Removed implicit conversions from cl_N to numeric. * Improved configuration and compatibility. 1.4.4 (7 Nov 2008) * Fixed a bug in the multiple polylogarithms Li/G that caused imaginary parts of the arguments to be ignored. * Fixed archiving of complex numbers. * Made the behaviour of class function more consistent with respect to ncmul::eval(). * Fixed bug in power::is_polynomial. * Improved heur_gcd() so it can handle rational polynomials. * Improved build scripts. 1.4.3 (04 April 2008) * Fixed bug in numerical evaluation of multiple polylogarithms and alternating multiple zeta values introduced in version 1.4.2. * Nielsen polylog now invalidates its lookup tables in case the precision (Digits) has been changed. * Added new checks for recent bugs in the numerical evaluation of Li and zeta. 1.4.2 (03 April 2008) * Fixed VPATH building of documentation. * Fixed bug in numerical evaluation of multiple polylogarithms for arguments equal to certain roots of unity (thanks to Jianqiang Zhao). * Fixed check for memory leakage in parser. * Made internal function coerce() standard compliant. * Improved lsolve() of systems containing non-numeric coefficients. * Improved automatic test programs. Now they work on MinGW and Cygwin as well. 1.4.1 (21 November 2007) * Fixed memory leak in ginac_yylex(). * Fixed memory leaks in mul::eval() and power::eval(). * Fixed macro checking for version of libreadline (Mac OS X). * Fixed broken preprocessor instruction in excompiler.cpp. * Fixed broken module loading in excompiler.cpp. * info(info_flags::has_indices) now works for sums and products. * Improved mul::expand(). * Improved CLN output. 1.4.0 (31 August 2007) * New tinfo mechanism. * Removed rtt from class symbol. * Faster archiving by adding a map from strings to indices in the atoms vector. * Improved unarchiving: algorithms order N instead of order N^2. * Added compile function, excompiler class. * Added exset type. * Added step function to GiNaCs built-in functions. * Added is_polynomial() method. * Added real_part() and imag_part() methods. * Added matrix::is_zero_matrix() method. * Added evalm() method to pseries class. * Improved dummy index renaming. * Many improvements for class clifford. * New flag for positive symbols/numbers, added possymbol class. * Added programming examples in doc/examples 1.3.8 (28 August 2007) * Drop support of ginac-config and ginac.m4. Please use pkg-config instead. * atan2(y,x) branch cut correction. * Fixed bug in series expansion. * Additional transformations for mul and power. * Clifford units now honor representation labels. * Correct csrc output for idx and fderivative. * Improved handling of convergence transformationis for Li/G. * Fix compilation issues with prereleases of GCC 4.3. * info_flags::expanded added. * input_parser also accepts pow(). * texinfo.tex removed from package. 1.3.7 (05 February 2007) * Fixed bug in expansion of power. * Fixed bugs in functions S() (infinite loop), H() and zeta() (wrong results). * Rebuilt bison related files with bison version 2.3 (fixes parse error bugs). * Improved power::eval(). * Improved libreadline detection. 1.3.6 (13 December 2006) * Better worst case behavior in heuristic gcd. * Improved collecting for sparse multivariate polynomials. * Improved collect_common_factors. * Fixed bug in numerical evaluation of multiple polylogs. * Fixed numerical integration of complex functions. * Fixed bug in tensor::replace_contr_index(). 1.3.5 (17 August 2006) * Re-built bison related files that caused bugs with gcc 4. * Fixed bugs in fderivative::match_same_type(), expairseq::match(), expand_dummy_sum(), and expairseq::map(). * Fixed template specialization for class container to be gcc 4.2 compliant. * Output in csrc mode is now -x instead of -1.0*x. * Fixed tutorial and reference generation in html/pdf/ps format. * Modified autotool configuration to allow for compilation on MinGW. * Debian packaging files updated. 1.3.4 (12 April 2006) * More general index dimensions are now possible. * Improved algebraic substitutions. * Fixed wrong matching in .has(). * Fixed bug in differentiation of a power. * collect_common_factors also works with negative powers of common factors now. * Code clean-up and preparations for upcoming cln 1.2. 1.3.3 (24 October 2005) * Fixed bug occuring in algebraic substitutions with expressions involving indices. * Fixed bug that selected the wrong algorithm for determinants of purely numeric matrices with at least one floating point element. * Fixed bug in function H that caused an infinite recursion for arguments around +-I. * Fixed const-correctness in printing handler for GCC 4.0.2. * Made lookup in adaptivesimpson precision-aware. * Added series expansion for functions (classical) Li and S around x==0. * Added fsolve() numerical univariate real-valued function solver. * Added functions sub_matrix() and reduced_matrix(). * Small cleanups. Less warnings with latest GCC. 1.3.2 (10 July 2005) * GCD avoids to produce expanded expressions. * Fixed bug in expanding expressions containing dummy indices. * Fixed static initialization order bug. * collect_common_factors now works with powers. * Modernized configuration scripts. 1.3.1 (04 May 2005) * integral() and eval_integ() can be used from ginsh. * Integrals can be series-expanded. * Fixed a library initialization problem. * GiNaC compiles from tarball even if lex/flex is missing. * Fixed bugs in canonicalize_clifford(), clifford_prime() and clifford_to_lst(). * clifford_moebius_map(), remove_dirac_ONE() and LaTeX output of Clifford objects now care about representation labels. * Fixed bug in gcd. * Better output for slashed expressions 1.3.0 (19 October 2004) * The Clifford classes have been generalized to allow working with Clifford algebras generated by arbitrary symmetric tensors or matrices. Also, a lot of new functions for Clifford algebras have been added, including automorphisms and Moebius transformations. [V. Kisil] * Added some basic symbolic and numeric integration facilities. [C. Dams] * The multiple polylogarithm Li() now evaluates numerically for arbitrary arguments. * New functions G(a,y) and G(a,s,y) added (another notation for multiple polylogarithms). 1.2.4 (12 October 2004) * Added ex::unitcontprim() to compute the unit, content, and primitive parts of a polynomial in one go. * binomial(n, k) evaluates for non-integer arguments n. * Li(2,x) now evaluates for +-I. * Optimized Li(2,x). * Fixed bug in Li(n,x) (if Li(2,x) was calculated with high precision the enlargement of the look-up table caused a segmentation fault). * Fixed another bug in the series expansion of powers, and a bug in power::info(). 1.2.3 (13 August 2004) * Added variants of dirac_trace() and color_trace() that take the trace over more than one representation label by specifying a set or list of labels. * diracgamma::contract_with() uses Chisholm identities in 4 dimensions to produce more compact results. * Fixed a bug in the series expansion of powers. * The --enable-html-doc and --enable-ps-doc configure options are gone. Documentation in HTML, DVI, PostScript, and PDF formats is now built with "make html", "make dvi", "make ps", and "make pdf", respectively. The only documentation that gets built by default are the tutorial in .info format and the manpages. 1.2.2 (3 August 2004) * Added const_preorder_iterator and const_postorder_iterator classes (and associated methods ex::pre/postorder_begin/end()) providing tree traversal with iterators. * Fixed the LaTeX output of the varidx class. * Fixed bugs in series expansion and complex conjugation. * (p.i*p.i).get_free_indices() returns the correct result () instead of (.i). * Symbolic functions without any eval(), evalf() etc. functions now work properly. * integer_content(), content(), and primpart() now also work for polynomials with rational coefficients (calculating the LCM of coefficients' denominators). * Added method matrix::rank(). * Added function resultant(). * Added integer_content() function to ginsh. 1.2.1 (23 April 2004) * Fixed infinite recursion in atan2_evalf() and improved atan2_eval(). * Added automatic evaluations for trigonometric functions with negative arguments (e.g. sin(-2) -> -sin(2)). * Fixed a static initialization order goof-up. * Fixed various bugs in series expansion. 1.2.0 (19 March 2004) * Added a structure template class for the easy creation of user-defined algebraic classes. * Added support for (acyclic) visitors, to allow cleaner implementations of algebraic algorithms. * Added a const_iterator class that can be used instead of op()/nops(). * Completely revamped the implementation of expression output. It is now possible to add new output formats, to change the behavior of predefined formats at run-time, and to have different output styles for algebraic functions. * Symbols can be made non-commutative. * Added a method ex::conjugate() and a function conjugate() for complex conjugation. Symbols can be declared as real or complex-valued. * Improved the speed of subs(), normal(), to_rational() and to_polynomial() by the use of maps instead of lists. The old forms subs(const lst & ls, const lst & lr, unsigned options) to_rational/to_polynomial(lst & repl) are still available for compatibility, but using the new forms subs(const exmap & m, unsigned options) to_rational/to_polynomial(exmap & repl) is more efficient, especially when the number of replacements is large. * quo(), rem(), prem(), sprem(), decomp_rational(), unit(), content(), primpart() and matrix::charpoly() now take a "const ex &" instead of a "const symbol &". * Redundant expressions (two ex pointing to different objects are found to be equal in compare()) are now actively deleted/fused to conserve memory and speed up subsequent comparisons. This behavior can be suppressed on a per-object level with status_flags::not_shareable. Lists and matrices are not shareable by default. * Lots of internal streamlining and optimizations. * Caveats for class implementors: - basic::copy() and basic::destroy() are gone; classes derived from basic can use the defaults for the assignment operator and copy constructor. - basic::subs(), basic::normal(), basic::to_rational() and basic::to_polynomial() take 'exmap' objects instead of lists. - basic::subs() now descends into subexpressions (if accessible via nops()/op()/let_op()). If you have a custom implementation of subs() that calls basic::subs() after substituting subexpressions, this needs to be changed to a call to subs_one_level(). - lst::thislst() and exprseq::thisexprseq() renamed to thiscontainer(). - thiscontainer() and associated constructors now take a std::auto_ptr. - Overloading basic::print() is now deprecated. You should use print_func<>() class options instead. 1.1.7 (11 March 2004) * Fixed a bug in canonicalize_clifford(). * Series expansion now works predictably. All terms with the exponent of the expansion variable smaller than the given order are calculated exactly. If the series is not terminating, the Order function is (at least) of the given order. 1.1.6 (22 January 2004) * Added a function option "dummy()" which means "no options". This simplifies the implementation of symbolic functions which are not to be further evaluated. * Removed a bug in the numerical evaluation of Li() that caused the system to hang for certain parameter combinations. * Fixed a bug in the calculation of hash values for indices that could lead to wrong results or bogus error messages from simplify_indexed(). * Fixed a bug in the evaluation of harmonic polylogarithms for complex arguments with positive imaginary part. 1.1.5 (5 November 2003) * Harmonic polylogarithms now numerically evaluate for arbitrary arguments (parameter must still be positive integers). * The zeta function now can also be given a lst as a parameter in which case it becomes a multiple zeta value. The use of mZeta is deprecated. * The order of parameters for the multiple polylogarithm has been corrected. * Documentation for the nested sums functions zeta, harmonic polylog, multiple polylog, etc. has been added. 1.1.4 (17 October 2003) * Lists and matrices can now be initialized from comma-separated lists of expressions, like this: lst l; l = x, 2, y, x+y; matrix M(3, 3); M = x, y, 0, -y, x, 0, 0, 0, 1; This is both faster and produces much smaller code than the old constructors lst(ex, ex, ...) and matrix(unsigned, unsigned, lst), especially in the case of matrices, and is now the recommended way to create these objects. * The function mZeta now evaluates much faster for arbitrary parameters. The harmonic and multiple polylogarithms evaluate considerably faster and check for convergence. The order of parameters for the harmonic polylogarithm has been corrected. 1.1.3 (22 August 2003) * Added new symbolic functions for better integration with nestedsums: (multiple) polylogarithm Li(), Nielsen's generalized polylogarithm S(), harmonic polylogarithm H(), and multiple zeta value mZeta(). * New exhashmap template intended as a drop-in replacement for std::map using GiNaC's hashing algorithms. 1.1.2 (11 August 2003) * Fixed a bug in the unarchiving of sums and products: terms were not reordered in a canonical way. * Fixed a bug in normal()/numer_denom(): denominator was not made unit normal if it was a simple number. * Improved the speed of subs() in some cases. 1.1.1 (18 June 2003) * lst (and exprseq) provide iterators for read-only element access. For sequential access this is one order faster than using op(). * Implemented relational::subs() (this was done in 1.0.9 but inadvertently omitted from the 1.1 branch). * pole_error and do_taylor are available to library users. * Added on-line help and Tab-completion for print(), iprint(), print_latex() and print_csrc() in ginsh. 1.1.0 (3 April 2003) * Removed deprecated macros is_ex_a, is_ex_exactly_a and friends for good. * The scalar_products mechanism allows the specification of an index dimension. * Removed dirac_gamma6/7(). * Added ex::to_polynomial(). * subs() accepts an optional "options" argument. The option subs_option::subs_algebraic enables "smart" substitutions in products and powers. * Added stream manipulators "dflt", "latex", "python", "python_repr", "tree", "csrc", "csrc_float", "csrc_double", "csrc_cl_N", "index_dimensions" and "no_index_dimensions" to control the output format. Calling basic::print() directly is now deprecated. * Made the hashing more simple and efficient. * Caveats for class implementors: - basic::subs(): third argument changed from "bool" to "unsigned" - unarchiving constructor and basic::unarchive(): "const" removed from second argument - basic::let_op() should only be implemented if write access to subexpressions is desired - simplify_ncmul() renamed to eval_ncmul() - simplified_ncmul() renamed to hold_ncmul() - nonsimplified_ncmul() renamed to reeval_ncmul() 1.0.14 (1 March 2003) * Improved the C-source output: complex numbers are printed correctly (using the STL complex<> template or cln::complex()), rational numbers use cl_RA() in the CLN output, and small integers are printed in a more compact format (e.g. "2.0" instead of "2.0000000e+00"). * function_options::set_return_type() and function_options::do_not_evalf_params() now actually work. 1.0.13 (27 January 2003) * Contracting epsilon tensors with Euclidean indices now works. * Improved dummy index symmetrization in sums. * Added dirac_gammaL/R(), which can be used instead of dirac_gamma6/7() but are single objects, to allow for a more compact notation of Dirac strings. * Powers with negative numeric exponents are printed as fractions in the LaTeX output. * Added symbolic_matrix() for the convenient creation of matrices filled with symbols. * Added collect_common_factors() which collects common factors from the terms of sums. * simplify_indexed() converts "gamma~mu*p.mu" to "p\". 1.0.12 (30 October 2002) * Fixed a bug in power::expand() that could produce invalid expressions. * The input parser no longer ignores extra data following accepted input. * Improved the CLN C-source output (integers are printed as integers, and floating point numbers include the precision). * Fixed a problem in the LaTeX-output of negative fractions. * Added print_latex() and print_csrc() to ginsh. * The sprem() function is now public. 1.0.11 (18 September 2002) * Fixed a possible memory corruption in contractions of indexed objects with delta or metric tensors. * Computing the derivative of a power series object with respect to a symbol that is not the expansion variable now works correctly. * Several bugfixes in code generation. 1.0.10 (24 July 2002) * Powers of indexed objects are now parenthesized correctly in LaTeX output. * Input parser handles indices (they have to be specified in the same list as the symbols). * Added some limited support for subspaces in the idx and tensor classes. * Fixed a bug in canonicalize() (antisymmetric canonicalization of an already sorted list containing two or more equal objects failed to return 0). 1.0.9 (11 June 2002) * simplify_indexed() now raises/lowers dummy indices to canonicalize the index variance. This allows some simplifications that weren't possible before, like eps~a.b~c~d*X.a*X~b -> 0 and X.a~a-X~a.a -> 0. * Implemented relational::subs(). * Fixed bug in simplify_ncmul() for clifford objects. 1.0.8 (31 March 2002) * Improvements in memory usage of the expand() methods. 1.0.7 (18 March 2002) * Fixed LaTeX output of indexed and matrix objects. * Fixed matrix::pow(n) for n==0 and added helper functions to create unit matrices "ex unit_matrix(unsigned, unsigned)". 1.0.6 (4 March 2002) * "(x+1).subs(x==x-1)" now returns the correct result "x" instead of "x-1". 1.0.5 (27 January 2002) * (l)degree(s), coeff(s, n) and collect(s) were extended to accept expressions of any class (except add/mul/ncmul/numeric) for "s". They should even work if "s" is a "power" object, as long as the exponent is non-integer, but with some limitations. For example, you can "collect(a*2^x+b*2^x, 2^x)" to get "(a+b)*2^x", but "degree(2^(3*x), 2^x)" yields 0 instead of 3). * Fixed a small output bug. 1.0.4 (24 January 2002) * Speedup in expand(). * Faster Bernoulli numbers (Markus Nullmeier). * Some minor bugfixes and documentation updates. 1.0.3 (21 December 2001) * Fixed a bug where quo() would call vector::reserve() with a negative argument. * Fix several bugs in code generation. 1.0.2 (19 December 2001) * Input parser recognizes "sqrt()", which is also used in the output. * divide(a,b,q) only modifies q if the division succeeds; also, divide(a,b,a) works now. * Fixed small bug in dummy index renaming which could cause it to not recognize renamable indices in some cases. * power::degree() and power::ldegree() throw an exception when encountering a non-integer exponent. * Add output-support for Python bindings. 1.0.1 (22 November 2001) * Function sqrfree() handles a few more cases now. * Class relational has real canonical ordering now. * Handle obscene libreadline version numbers when building ginsh. 1.0.0 (6 November 2001) * Some internal reorganization resulting in a general speed-up. * The last 3 evaluated expressions in ginsh are now referred to with the tokens '%', '%%' and '%%%'. The old '"', '""' and '"""' remain for compatibility but may be removed in a future version of GiNaC. 0.9.4 (20 September 2001) * Functions have better support for external scripting languages. * Interface cleanups and bugfixes. * Fix silly bug in evalf() that prevented things like 2^Pi being computed. 0.9.3 (16 August 2001) * series expansion now much more consistent for small order expansion. * lsolve() accepts algorithmic hint as parameter. 0.9.2 (31 July 2001) * Epsilon tensor is more functional. * simplify_indexed() is better at detecting expressions that vanish for symmetry reasons. * Several little bugfixes and consistency enhancements. 0.9.1 (27 June 2001) * Ctors of class numeric are not explicit any more. All built-in callers for pseudofunctions are now templated and default to ex arguments which relaxes the need for explicit ctors. * New functions/methods: - find() - remove_first(), remove_last(), sort() and unique() for lists - symmetrize_cyclic() - decomp_rational() * Instead of just totally symmetric or antisymmetric, complex symmetries can now be defined for indexed objects. Symmetries are described by a tree of "symmetry" objects that is constructed with the sy_none(), sy_symm(), sy_anti() and sy_cycl() functions. The symmetry of a function with respect to its arguments can also be defined (this is currently only used for the Beta function). * Generalized map() to take a function object instead of a function pointer. This allows passing an arbitrary number of additional state to the function being called. * color_trace(), dirac_trace(), diff(), expand(), evalf() and normal() work better with container classes, e.g. using color_trace() on a relation will take the trace on both sides, using diff() on a matrix differentiates every element etc. * diff() works properly with non-commutative products and indexed objects. * New option flag "expand_function_args" for expand(). * Supplement some (now deprecated) macros by inlined template functions: - is_of_type(foo, type) -> is_a(foo) - is_ex_of_type(foo, type) -> is_a(foo) - is_exactly_of_type(foo, type) -> is_exactly_a(foo) - is_ex_exactly_of_type(foo, type) -> is_exactly_a(foo) - ex_to_foobar(baz) -> ex_to(baz) * rem(c, p[x], x) (c: numeric, p[x]: polynomial) erroneously returned p[x] instead of c. * Small bugfixes in pattern matching. * Updated libtool to version 1.4. 0.9.0 (7 June 2001) * In the output and in ginsh, lists are now delimited by { } braces, and matrices are delimited by single [ ] brackets. * simplify_indexed() renames dummy indices so, e.g., "a.i*a.i+a.j*a.j" gets simplified to "2*a.i*a.i" (or "2*a.j*a.j"). * New functions/methods: - canonicalize_clifford() (helpful when comparing expressions containing Dirac matrices) - symmetrize() and antisymmetrize() - numer_denom() (return numerator and denominator in one call) - map() (apply function to subexpressions) - evalm() (evaluate sums, products and integer powers of matrices) * Added a new function match() for performing pattern matching. subs() and has() also accept patterns as arguments. A pattern can be any expression, optionally containing wildcard objects. These are constructed with the call "wild()" and are denoted as "$0", "$1" etc. in the output and in ginsh. * Positive integer powers of non-commutative expressions (except matrices) are automatically expanded. * Removed cint subdirectory, ginaccint is a separate package now due to packaging considerations. * Several little bugfixes. 0.8.3 (11 May 2001) * color and clifford classes are functional and documented. * New "spinidx" class for dotted/undotted indices. * Predefined spinor metric tensor (created by spinor_metric()). * Symbols can have a LaTeX name, e.g. symbol s("s", "\\sigma"); * LaTeX output of indexed objects is much nicer. * Fixed some build problems (with recent libreadline). * Semantics of arithmetic operators now follows the C++ rules more strictly. 0.8.2 (24 April 2001) * degree(), ldegree(), coeff(), lcoeff(), tcoeff() and collect() work with non-symbols as the second argument in ginsh. * the argument to collect() can be a list of objects in which case the result is either a recursively collected polynomial, or a polynomial in a distributed form with terms like coeff*x1^e1*...*xn^en, as specified by the second argument to collect(). * Several bugfixes (including a nasty memory leak in .normal()). * class matrix: solve() doesn't call algorithms redundantly any more and inverse() falls back to solve() which works in more general cases. 0.8.1 (16 April 2001) * degree(), ldegree(), coeff(), lcoeff(), tcoeff() and collect() can now be used with constants, functions and indexed expressions as well, so you can use it to collect by powers of Pi or sin(x), or to find the coefficient of gamma~0. Limitations: - it only works with symbols, constants, functions and indexed expressions, trying to find the coefficient of, e.g., "x^2" or "x+y" won't work; - it does not know about dummy index summations; the coefficient of gamma~0 in p.mu*gamma~mu should be p.0 but is returned as 0; - using coeff(), tcoeff(), lcoeff() or collect() on elements of noncommutative products might return wrong or surprising results. * subs() no longer only substitutes symbols and indices but performs a more general "syntactic substitution", i.e. it substitutes whole objects in sub- expressions. You can subs((a+b)^2,a+b==3) and get 9, but subs(a+b+c,a+b==3) doesn't do anything. Limitations: - substituting numerics (subs(expr, 2==4)) will not replace then in all occurences; in general, you shouldn't substitute numerics, though. * Added preliminary (re)implementations of color and clifford classes. * simplify_indexed(): contraction of symmetric and antisymmetric tensors is zero. * Replaced the various print*() member functions by a single print() that takes a print_context object that determines the output formatting. This should make it easier to add more output types, such as LaTeX output, which is based on work by Stefan Weinzierl. * Added functions to retrieve the properties stored in archive objects outside of unarchive() (for printing or debugging purposes). * Some bugfixes (indexed objects, archive writing). * .collect() on non-polynomials is now algebraically correct. 0.8.0 (24 March 2001) * Complete revamp of indexed objects. Instead of multiple classes for indexed things and their indices there is now only one "indexed" class and two types of indices: "idx" for simple indices and "varidx" for indices with variance. There are predefined delta, epsilon and metric tensors, and a function simplify_indexed() that performs canonicalization and dummy index summations. Matrix objects can be indexed for doing simple linear algebra. * Added an option "expand_indexed" to expand() to perform expansion of indexed objects like (a+b).i -> a.i + b.i * Renamed get_indices() to get_free_indices(), which no longer returns dummy indices and checks the consistency of indices in sums. * sqrfree() factorization fixed and improved syntactically. * subs() works on matrices. * Matrices can be constructed from flat list of elements; diagonal matrices can be constructed from list of diagonal elements with diag_matrix(). * Fixed memory leak in expand(). * Operator% for objects of class ncmul has gone. Use operator* now for that case too, which is much more natural. 0.7.3 (28 February 2001) * Several bugfixes and minor performance tunings. * Added a section to the tutorial about adding new algebraic classes to GiNaC. * Closed many in-source documentation gaps. 0.7.2 (17 February 2001) * Several bugfixes in power series expansion, one of them critical. 0.7.1 (7 February 2001) * Fix problems with Cint that were caused by CLN's overloaded operator new. * Fix compilation errors with GCC3. * normal() handles large sums of fractions better and normalizes the exponent of power expressions. * expand() always expands the exponent and transforms x^(a+b) -> x^a*x^b. * Some bugfixes of series expansion around branch cuts of special functions. 0.7.0 (15 December 2000) * Requires CLN 1.1 now. Class numeric doesn't use an indirect pointer to the actual representation any more. This is a speedup. * mul::expand() was reengineered to not allocate excess temporary memory. * Non-integer powers of a symbol are treated as constants by (l)degree() and coeff(). Using these functions on an expression containing such powers used to fail with an internal error message. The side-effect is that collect() can be used on expressions which are not polynomials. * Added a man page for the ginac-config script. * Ctor of numeric from char* honors Digits. 0.6.4 (10 August 2000) * Complete revamp of methods in class matrix. Some redundant (and poor) implementations of elimination schemes were thrown out. The code is now highly orthogonal, more flexible and much more efficient. * Some long standing and quite nasty bugs were discovered and fixed in the following functions: add::normal(), heur_gcd(), sr_gcd() and Order_eval(). 0.6.3 (25 July 2000) * Derivatives are now assembled in a slightly different manner (i.e. they might 'look' different on first sight). Under certain circumstances this can result in a dramatic speedup because it gives hashing a better chance, especially when computing higher derivatives. * Some series expansions of built-in functions have been reengineered. * The algorithm for computing determinants can be chosen by the user. See ginac/flags.h and ginac/matrix.h. * The Dilogarithm (Li2) now has floating point evaluation, derivative and a proper series expansion. * Namespace 'std' cleanly disentangled, as demanded by ISO/EIC 14882-1998(E). * Some minor bugfixes, one major lsolve()-bugfix and documentation updates. 0.6.2 (21 June 2000) * ginaccint.bin is now launched by a binary program instead of by a scripts. This allows us to write #!-scripts. A small test suite for GiNaC-cint was added. * Several minor bugfixes. 0.6.1 (18 May 2000) * Cleanup in the interface to Cint. The required version is now Cint 5.14.38. * Several bugfixes in target install. 0.6.0 (11 May 2000) * IMPORTANT: Several interface changes make programs written with GiNaC much clearer but break compatibility with older versions: - f(x).series(x,p[,o]) -> f(x).series(x==p,o) - series(f(x),x,p[,o]) -> series(f(x),x==p,o) - gamma() -> tgamma() (The true Gamma function, there is now also log(tgamma()), called lgamma(), in accord with ISO/IEC 9899:1999.) - EulerGamma -> Euler * #include'ing ginac.h defines the preprocessor symbols GINACLIB_MAJOR_VERSION, GINACLIB_MINOR_VERSION, and GINACLIB_MICRO_VERSION with the respective GiNaC library version numbers. * Expressions can be constructed from strings like this: ex e("2*x+y", lst(x, y)); * ex::to_rational() provides a way to extend the domain of functions like gcd() and divide() that only work on polynomials or rational functions (the good old ex::subs() method reverses this process) * Calling diff() on a function that has no derivative defined returns the inert derivative function "Derivative". * Several new timings in the check target. Some of them may be rather rude at your machine, feel free to interrupt them. 0.5.4 (15 March 2000) * Some algorithms in class matrix (notably determinant) were replaced by less brain-dead ones and should now have much better performance. * Checks were completely reorganized and split up into three parts: a) exams (small regression tests with predefined input) b) checks (lenghty coherence checks with random input) c) timings (for coherence and crude benchmarking) * Behaviour of .evalf() was changed: it doesn't .evalf() any exponents. * Expanded expressions now remember they are expanded to prevent superfluous expansions. * Small bugfixes and improvements in the series expansion. 0.5.3 (23 February 2000) * A more flexible scheme for registering functions was implemented, allowing for remembering, too. * Some Bugfixes. 0.5.2 (16 February 2000) * Mainly fixes a bug in the packaging of release 0.5.1. 0.5.1 (14 February 2000) * Fixes a small number of bugs. 0.5.0 (7 February 2000) * Expressions can be written ("archived") to files and read therefrom. * Addition of GiNaC-cint, which lets you write complete programs in an interactive shell-like manner in your favoured programming language (i.e. C++). 0.4.1 (13 December 1999) * Series Expansion of Gamma function and some other trigonometric functions at their poles works now. * Many more evaluations of special functions at points where exact results exist. * info_flags::rational doesn't return true for complex extensions any more---use info_flags::crational for the old behaviour. info_flags::integer and -::cinteger work similarly, the same holds for types like info_flags::rational_polynomial. 0.4.0 (26 November 1999) * First public release. ginac-1.7.8.orig/README0000644000000000000000000000317013457611471011327 0ustar General Information =================== GiNaC (which stands for "GiNaC is Not a CAS" (computer algebra system)) is a C++ library for symbolic mathematical calculations. It is designed to allow the creation of integrated systems that embed symbolic manipulations together with more established areas of computer science (like computation-intense numeric applications, graphical interfaces, etc.) under one roof. The official web site is: http://www.ginac.de/ A mailing list is located at: ginac-list@ginac.de You need to be subscribed to be able to post to the list. To subscribe, please follow the instructions on https://www.cebix.net/mailman/listinfo/ginac-list See http://www.ginac.de/Lists.html for the list policy. Installation ============ See the file "INSTALL". How to report bugs ================== If you have identified a bug in GiNaC you are welcome to send a detailed bug report to . Please think about your bug! This means that you should include * Information about your system - Which operating system and version (uname -a) - Which C compiler and version (gcc --version) - For Linux, which version of the C library And anything else you think is relevant. * Information about your version of GiNaC - Version and release number - Which options GiNaC was configured with * How to reproduce the bug - If it is a systematical bug in the library, a short test program together with the output you get and the output you expect will help us to reproduce it quickly. Patches are most welcome. If possible please make them with diff -c and include ChangeLog entries. ginac-1.7.8.orig/acinclude.m40000644000000000000000000001752313457611471012647 0ustar dnl =========================================================================== dnl Additional macros used to configure GiNaC. We don't start our own dnl additions' names with AC_ but with GINAC_ in order to steer clear of dnl future trouble. dnl =========================================================================== dnl GINAC_HEADER_GETVAL(NAME,FILE) dnl ---------------------------- dnl Expand at autoconf time to the value of a "#define NAME" from the given dnl FILE. The regexps here aren't very rugged, but are enough for us. dnl /dev/null as a parameter prevents a hang if $2 is accidentally omitted. dnl (shamelessly ripped from GMP, and changed prefix to GINAC_). define(GINAC_HEADER_GETVAL, [patsubst(patsubst( esyscmd([grep "^#define $1 " $2 /dev/null 2>/dev/null]), [^.*$1[ ]+],[]), [[ ]*$],[])]) define(GINAC_GET_VERSION, [GINAC_HEADER_GETVAL(GINACLIB_$1_VERSION,[ginac/version.h])]) define(GINAC_GET_LTVERSION, [GINAC_HEADER_GETVAL(GINAC_LT_$1,[ginac/version.h])]) dnl Usage: GINAC_STD_CXX_HEADERS dnl Check for standard C++ headers, bail out if something is missing. AC_DEFUN([GINAC_STD_CXX_HEADERS], [ AC_CACHE_CHECK([for standard C++ header files], [ginac_cv_std_cxx_headers], [ ginac_cv_std_cxx_headers="no" AC_LANG_PUSH([C++]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include ]])], [ginac_cv_std_cxx_headers="yes"]) AC_LANG_POP([C++])]) if test "${ginac_cv_std_cxx_headers}" != "yes"; then AC_MSG_ERROR([Standard ISO C++ headers are missing]) fi ]) dnl Usage: GINAC_LIBREADLINE dnl dnl Check if GNU readline library and headers are avialable. dnl Defines GINSH_LIBS variable, and HAVE_LIBREADLINE, dnl HAVE_READLINE_READLINE_H, HAVE_READLINE_HISTORY_H preprocessor macros. dnl dnl Note: this macro rejects readline versions <= 4.2 and non-GNU dnl implementations. dnl AC_DEFUN([GINAC_READLINE],[ AC_REQUIRE([GINAC_TERMCAP]) GINSH_LIBS="" AC_CHECK_HEADERS(readline/readline.h readline/history.h) if test "x${ac_cv_header_readline_readline_h}" != "xyes" -o "x${ac_cv_header_readline_history_h}" != "xyes"; then GINAC_WARNING([ginsh will not compile, because readline headers could not be found.]) else AC_CACHE_CHECK([for version of libreadline], [ginac_cv_rl_supported], [ ginac_cv_rl_supported="no" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #if !defined(RL_VERSION_MAJOR) || !defined(RL_VERSION_MINOR) #error "Ancient/unsupported version of readline" #endif]])], [ginac_cv_rl_supported="yes"])]) if test "x${ginac_cv_rl_supported}" != "xyes"; then GINAC_WARNING([ginsh will not compile, because of an unsupported version of readline (<= 4.2 or non-GNU).]) else save_LIBS="$LIBS" LIBS="$LIBTERMCAP $LIBS" AC_CHECK_LIB(readline, readline) if test "x${ac_cv_lib_readline_readline}" != "xyes"; then GINAC_WARNING([ginsh will not compile, because libreadline could not be found.]) fi GINSH_LIBS="$LIBS" LIBS="$save_LIBS" fi fi AC_SUBST(GINSH_LIBS)]) dnl Usage: GINAC_TERMCAP dnl libreadline is based on the termcap functions. dnl Some systems have tgetent(), tgetnum(), tgetstr(), tgetflag(), tputs(), dnl tgoto() in libc, some have it in libtermcap, some have it in libncurses. dnl When both libtermcap and libncurses exist, we prefer the latter, because dnl libtermcap is being phased out. AC_DEFUN([GINAC_TERMCAP], [LIBTERMCAP= case $host_os in *mingw32*) ;; dnl no termcap libraries are necessary (need hacked libreadline) *) AC_CHECK_FUNCS(tgetent) if test "x$ac_cv_func_tgetent" = "xyes"; then : else AC_CHECK_LIB(ncurses, tgetent, LIBTERMCAP="-lncurses") if test -z "$LIBTERMCAP"; then AC_CHECK_LIB(termcap, tgetent, LIBTERMCAP="-ltermcap") fi fi ;; esac AC_SUBST(LIBTERMCAP) ]) dnl Usage: GINAC_ERROR(message) dnl This macro displays the warning "message" and sets the flag ginac_error dnl to yes. AC_DEFUN([GINAC_ERROR],[ ginac_error_txt="$ginac_error_txt ** $1 " ginac_error=yes]) dnl Usage: GINAC_WARNING(message) dnl This macro displays the warning "message" and sets the flag ginac_warning dnl to yes. AC_DEFUN([GINAC_WARNING],[ ginac_warning_txt="$ginac_warning_txt == $1 " ginac_warning=yes]) dnl Usage: GINAC_CHECK_ERRORS dnl (must be put at end of configure.in, because it exits on error) dnl This macro displays a warning message if GINAC_ERROR or GINAC_WARNING dnl has occured previously. AC_DEFUN([GINAC_CHECK_ERRORS],[ if test "x${ginac_error}" = "xyes"; then echo echo "**** The following problems have been detected by configure." echo "**** Please check the messages below before running \"make\"." echo "**** (see the section 'Common Problems' in the INSTALL file)" echo "$ginac_error_txt" if test "x${ginac_warning_txt}" != "x"; then echo "${ginac_warning_txt}" fi if test "x$cache_file" != "x/dev/null"; then echo "deleting cache ${cache_file}" rm -f $cache_file fi exit 1 else if test "x${ginac_warning}" = "xyes"; then echo echo "=== The following minor problems have been detected by configure." echo "=== Please check the messages below before running \"make\"." echo "=== (see the section 'Common Problems' in the INSTALL file)" echo "$ginac_warning_txt" fi echo "Configuration of GiNaC $VERSION done. Now type \"make\"." fi]) AC_DEFUN([GINAC_HAVE_RUSAGE], [AC_CACHE_CHECK([whether struct rusage is declared in ], ac_cv_have_rusage, [AC_TRY_COMPILE([#include #include ], [struct rusage resUsage; getrusage(RUSAGE_SELF, &resUsage); return 0;], [ac_cv_have_rusage=yes], [ac_cv_have_rusage=no]) ]) CONFIG_RUSAGE="no" if test "$ac_cv_have_rusage" = yes; then CONFIG_RUSAGE="yes" AC_DEFINE(HAVE_RUSAGE,,[define if struct rusage declared in ]) fi AC_SUBST(CONFIG_RUSAGE) ]) dnl Usage: GINAC_EXCOMPILER dnl - Checks if dlopen is available dnl - Allows user to disable GiNaC::compile_ex (e.g. for security reasons) dnl Defines HAVE_LIBDL preprocessor macro, sets DL_LIBS and CONFIG_EXCOMPILER dnl variables. AC_DEFUN([GINAC_EXCOMPILER], [ CONFIG_EXCOMPILER=yes DL_LIBS="" AC_ARG_ENABLE([excompiler], [AS_HELP_STRING([--enable-excompiler], [Enable GiNaC::compile_ex (default: yes)])], [if test "$enableval" = "no"; then CONFIG_EXCOMPILER="no" fi], [CONFIG_EXCOMPILER="yes"]) case $host_os in *mingw32*) CONFIG_EXCOMPILER="notsupported" ;; *) ;; esac if test "$CONFIG_EXCOMPILER" = "yes"; then AC_CHECK_HEADER([dlfcn.h], [CONFIG_EXCOMPILER="yes"], [CONFIG_EXCOMPILER="no"]) elif test "$CONFIG_EXCOMPILER" = "no"; then AC_MSG_NOTICE([GiNaC::compile_ex disabled at user request.]) else AC_MSG_NOTICE([GiNaC::compile_ex is not supported on $host_os.]) fi if test "$CONFIG_EXCOMPILER" = "yes"; then dnl Some systems (GNU/Linux, Solaris) have dlopen in -ldl, some dnl others (OpenBSD) -- in libc found_dlopen_lib="no" DL_LIBS="-ldl" AC_CHECK_LIB(dl, dlopen, [found_dlopen_lib="yes"]) if test "$found_dlopen_lib" = "no"; then DL_LIBS="" AC_CHECK_FUNC(dlopen, [found_dlopen_lib="yes"]) fi if test "$found_dlopen_lib" = "no"; then CONFIG_EXCOMPILER="no" AC_MSG_WARN([Could not found working dlopen(). GiNaC::compile_ex will be disabled.]) else AC_DEFINE(HAVE_LIBDL, 1, [set to 1 if dlopen() works.]) fi fi AC_SUBST(DL_LIBS) AC_SUBST(CONFIG_EXCOMPILER)]) ginac-1.7.8.orig/aclocal.m40000644000000000000000000014632613541765074012325 0ustar # generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- dnl serial 11 (pkg-config-0.29) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR # Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' 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.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2018 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. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf 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. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2018 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. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ax_cxx_compile_stdcxx.m4]) m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([acinclude.m4]) ginac-1.7.8.orig/check/0000755000000000000000000000000013546717365011533 5ustar ginac-1.7.8.orig/check/CMakeLists.txt0000644000000000000000000000347613541673420014271 0ustar include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../ginac) add_definitions(-DIN_GINAC) set(ginac_tests check_numeric check_inifcns check_matrices check_lsolve check_mul_info heur_gcd_bug exam_paranoia exam_heur_gcd match_bug parser_bugs exam_numeric_archive exam_numeric exam_powerlaws exam_inifcns exam_inifcns_nstdsums exam_differentiation exam_polygcd exam_normalization exam_factor exam_pseries exam_matrices exam_lsolve exam_indexed exam_color exam_clifford exam_archive exam_structure exam_misc exam_mod_gcd exam_cra exam_real_imag bugme_chinrem_gcd factor_univariate_bug pgcd_relatively_prime_bug pgcd_infinite_loop) set(ginac_timings time_dennyfliegner time_gammaseries time_vandermonde time_toeplitz time_lw_A time_lw_B time_lw_C time_lw_D time_lw_E time_lw_F time_lw_G time_lw_H time_lw_IJKL time_lw_M1 time_lw_M2 time_lw_N time_lw_O time_lw_P time_lw_Pprime time_lw_Q time_lw_Qprime time_antipode time_fateman_expand time_uvar_gcd time_parser) macro(add_ginac_test thename) if ("${${thename}_sources}" STREQUAL "") set(${thename}_sources ${thename}.cpp ${${thename}_extra_src}) endif() add_executable(${thename} EXCLUDE_FROM_ALL ${${thename}_sources}) target_link_libraries(${thename} ginac ${LIBDL_LIBRARIES}) add_dependencies(check ${thename}) add_test(NAME ${thename} COMMAND ${thename}${CMAKE_EXECUTABLE_SUFFIX}) endmacro() macro(add_ginac_timing thename) set(${thename}_extra_src timer.cpp randomize_serials.cpp) add_ginac_test(${thename}) endmacro() set(check_matrices_extra_src genex.cpp) set(check_lsolve_extra_src genex.cpp) set(exam_heur_gcd_sources heur_gcd_bug.cpp) set(exam_numeric_archive_sources numeric_archive.cpp) foreach(tst ${ginac_tests}) add_ginac_test(${tst}) endforeach() foreach(tmr ${ginac_timings}) add_ginac_timing(${tmr}) endforeach() ginac-1.7.8.orig/check/Makefile.am0000644000000000000000000001663613541673420013567 0ustar ## Process this file with automake to produce Makefile.in CHECKS = check_numeric \ check_inifcns \ check_matrices \ check_lsolve EXAMS = exam_paranoia \ exam_heur_gcd \ match_bug \ parser_bugs \ exam_numeric_archive \ exam_numeric \ exam_powerlaws \ exam_inifcns \ exam_inifcns_nstdsums \ exam_differentiation \ exam_polygcd \ exam_normalization \ exam_factor \ exam_pseries \ exam_matrices \ exam_lsolve \ exam_indexed \ exam_color \ exam_clifford \ exam_archive \ exam_structure \ exam_misc \ exam_mod_gcd \ check_mul_info \ bugme_chinrem_gcd \ factor_univariate_bug \ pgcd_relatively_prime_bug \ pgcd_infinite_loop \ exam_cra \ exam_real_imag TIMES = time_dennyfliegner \ time_gammaseries \ time_vandermonde \ time_toeplitz \ time_lw_A \ time_lw_B \ time_lw_C \ time_lw_D \ time_lw_E \ time_lw_F \ time_lw_G \ time_lw_H \ time_lw_IJKL \ time_lw_M1 \ time_lw_M2 \ time_lw_N \ time_lw_O \ time_lw_P \ time_lw_Pprime \ time_lw_Q \ time_lw_Qprime \ time_antipode \ time_fateman_expand \ time_uvar_gcd \ time_parser TESTS = $(CHECKS) $(EXAMS) $(TIMES) check_PROGRAMS = $(CHECKS) $(EXAMS) $(TIMES) check_numeric_SOURCES = check_numeric.cpp check_numeric_LDADD = ../ginac/libginac.la check_inifcns_SOURCES = check_inifcns.cpp check_inifcns_LDADD = ../ginac/libginac.la check_matrices_SOURCES = check_matrices.cpp genex.cpp check_matrices_LDADD = ../ginac/libginac.la check_lsolve_SOURCES = check_lsolve.cpp genex.cpp check_lsolve_LDADD = ../ginac/libginac.la check_mul_info_SOURCES = check_mul_info.cpp check_mul_info_LDADD = ../ginac/libginac.la exam_paranoia_SOURCES = exam_paranoia.cpp exam_paranoia_LDADD = ../ginac/libginac.la exam_heur_gcd_SOURCES = heur_gcd_bug.cpp exam_heur_gcd_LDADD = ../ginac/libginac.la match_bug_SOURCES = match_bug.cpp error_report.h match_bug_LDADD = ../ginac/libginac.la parser_bugs_SOURCES = parser_bugs.cpp parser_bugs_LDADD = ../ginac/libginac.la exam_numeric_archive_SOURCES = numeric_archive.cpp exam_numeric_archive_LDADD = ../ginac/libginac.la exam_numeric_SOURCES = exam_numeric.cpp exam_numeric_LDADD = ../ginac/libginac.la exam_powerlaws_SOURCES = exam_powerlaws.cpp exam_powerlaws_LDADD = ../ginac/libginac.la exam_inifcns_SOURCES = exam_inifcns.cpp exam_inifcns_LDADD = ../ginac/libginac.la exam_inifcns_nstdsums_SOURCES = exam_inifcns_nstdsums.cpp \ exam_inifcns_nstdsums.h exam_inifcns_nstdsums_LDADD = ../ginac/libginac.la exam_differentiation_SOURCES = exam_differentiation.cpp exam_differentiation_LDADD = ../ginac/libginac.la exam_polygcd_SOURCES = exam_polygcd.cpp exam_polygcd_LDADD = ../ginac/libginac.la exam_normalization_SOURCES = exam_normalization.cpp exam_normalization_LDADD = ../ginac/libginac.la exam_factor_SOURCES = exam_factor.cpp exam_factor_LDADD = ../ginac/libginac.la exam_pseries_SOURCES = exam_pseries.cpp exam_pseries_LDADD = ../ginac/libginac.la exam_matrices_SOURCES = exam_matrices.cpp exam_matrices_LDADD = ../ginac/libginac.la exam_lsolve_SOURCES = exam_lsolve.cpp exam_lsolve_LDADD = ../ginac/libginac.la exam_indexed_SOURCES = exam_indexed.cpp exam_indexed_LDADD = ../ginac/libginac.la exam_color_SOURCES = exam_color.cpp exam_color_LDADD = ../ginac/libginac.la exam_clifford_SOURCES = exam_clifford.cpp exam_clifford_LDADD = ../ginac/libginac.la exam_archive_SOURCES = exam_archive.cpp exam_archive_LDADD = ../ginac/libginac.la exam_structure_SOURCES = exam_structure.cpp exam_structure_LDADD = ../ginac/libginac.la exam_misc_SOURCES = exam_misc.cpp exam_misc_LDADD = ../ginac/libginac.la exam_mod_gcd_SOURCES = exam_mod_gcd.cpp exam_mod_gcd_LDADD = ../ginac/libginac.la exam_cra_SOURCES = exam_cra.cpp exam_cra_LDADD = ../ginac/libginac.la exam_real_imag_SOURCES = exam_real_imag.cpp exam_real_imag_LDADD = ../ginac/libginac.la time_dennyfliegner_SOURCES = time_dennyfliegner.cpp \ randomize_serials.cpp timer.cpp timer.h time_dennyfliegner_LDADD = ../ginac/libginac.la time_gammaseries_SOURCES = time_gammaseries.cpp \ randomize_serials.cpp timer.cpp timer.h time_gammaseries_LDADD = ../ginac/libginac.la time_vandermonde_SOURCES = time_vandermonde.cpp \ randomize_serials.cpp timer.cpp timer.h time_vandermonde_LDADD = ../ginac/libginac.la time_toeplitz_SOURCES = time_toeplitz.cpp \ randomize_serials.cpp timer.cpp timer.h time_toeplitz_LDADD = ../ginac/libginac.la time_lw_A_SOURCES = time_lw_A.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_A_LDADD = ../ginac/libginac.la time_lw_B_SOURCES = time_lw_B.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_B_LDADD = ../ginac/libginac.la time_lw_C_SOURCES = time_lw_C.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_C_LDADD = ../ginac/libginac.la time_lw_D_SOURCES = time_lw_D.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_D_LDADD = ../ginac/libginac.la time_lw_E_SOURCES = time_lw_E.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_E_LDADD = ../ginac/libginac.la time_lw_F_SOURCES = time_lw_F.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_F_LDADD = ../ginac/libginac.la time_lw_G_SOURCES = time_lw_G.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_G_LDADD = ../ginac/libginac.la time_lw_H_SOURCES = time_lw_H.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_H_LDADD = ../ginac/libginac.la time_lw_IJKL_SOURCES = time_lw_IJKL.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_IJKL_LDADD = ../ginac/libginac.la time_lw_M1_SOURCES = time_lw_M1.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_M1_LDADD = ../ginac/libginac.la time_lw_M2_SOURCES = time_lw_M2.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_M2_LDADD = ../ginac/libginac.la time_lw_N_SOURCES = time_lw_N.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_N_LDADD = ../ginac/libginac.la time_lw_O_SOURCES = time_lw_O.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_O_LDADD = ../ginac/libginac.la time_lw_P_SOURCES = time_lw_P.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_P_LDADD = ../ginac/libginac.la time_lw_Pprime_SOURCES = time_lw_Pprime.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_Pprime_LDADD = ../ginac/libginac.la time_lw_Q_SOURCES = time_lw_Q.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_Q_LDADD = ../ginac/libginac.la time_lw_Qprime_SOURCES = time_lw_Qprime.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_Qprime_LDADD = ../ginac/libginac.la time_antipode_SOURCES = time_antipode.cpp \ randomize_serials.cpp timer.cpp timer.h time_antipode_LDADD = ../ginac/libginac.la time_fateman_expand_SOURCES = time_fateman_expand.cpp \ randomize_serials.cpp timer.cpp timer.h time_fateman_expand_LDADD = ../ginac/libginac.la time_uvar_gcd_SOURCES = time_uvar_gcd.cpp test_runner.h timer.cpp timer.h time_uvar_gcd_LDADD = ../ginac/libginac.la time_parser_SOURCES = time_parser.cpp \ randomize_serials.cpp timer.cpp timer.h time_parser_LDADD = ../ginac/libginac.la bugme_chinrem_gcd_SOURCES = bugme_chinrem_gcd.cpp bugme_chinrem_gcd_LDADD = ../ginac/libginac.la factor_univariate_bug_SOURCES = factor_univariate_bug.cpp factor_univariate_bug_LDADD = ../ginac/libginac.la pgcd_relatively_prime_bug_SOURCES = pgcd_relatively_prime_bug.cpp pgcd_relatively_prime_bug_LDADD = ../ginac/libginac.la pgcd_infinite_loop_SOURCES = pgcd_infinite_loop.cpp pgcd_infinite_loop_LDADD = ../ginac/libginac.la AM_CPPFLAGS = -I$(srcdir)/../ginac -I../ginac -DIN_GINAC CLEANFILES = exam.gar EXTRA_DIST = CMakeLists.txt ginac-1.7.8.orig/check/Makefile.in0000644000000000000000000030167113541765075013604 0ustar # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) subdir = check ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = check_numeric$(EXEEXT) check_inifcns$(EXEEXT) \ check_matrices$(EXEEXT) check_lsolve$(EXEEXT) am__EXEEXT_2 = exam_paranoia$(EXEEXT) exam_heur_gcd$(EXEEXT) \ match_bug$(EXEEXT) parser_bugs$(EXEEXT) \ exam_numeric_archive$(EXEEXT) exam_numeric$(EXEEXT) \ exam_powerlaws$(EXEEXT) exam_inifcns$(EXEEXT) \ exam_inifcns_nstdsums$(EXEEXT) exam_differentiation$(EXEEXT) \ exam_polygcd$(EXEEXT) exam_normalization$(EXEEXT) \ exam_factor$(EXEEXT) exam_pseries$(EXEEXT) \ exam_matrices$(EXEEXT) exam_lsolve$(EXEEXT) \ exam_indexed$(EXEEXT) exam_color$(EXEEXT) \ exam_clifford$(EXEEXT) exam_archive$(EXEEXT) \ exam_structure$(EXEEXT) exam_misc$(EXEEXT) \ exam_mod_gcd$(EXEEXT) check_mul_info$(EXEEXT) \ bugme_chinrem_gcd$(EXEEXT) factor_univariate_bug$(EXEEXT) \ pgcd_relatively_prime_bug$(EXEEXT) pgcd_infinite_loop$(EXEEXT) \ exam_cra$(EXEEXT) exam_real_imag$(EXEEXT) am__EXEEXT_3 = time_dennyfliegner$(EXEEXT) time_gammaseries$(EXEEXT) \ time_vandermonde$(EXEEXT) time_toeplitz$(EXEEXT) \ time_lw_A$(EXEEXT) time_lw_B$(EXEEXT) time_lw_C$(EXEEXT) \ time_lw_D$(EXEEXT) time_lw_E$(EXEEXT) time_lw_F$(EXEEXT) \ time_lw_G$(EXEEXT) time_lw_H$(EXEEXT) time_lw_IJKL$(EXEEXT) \ time_lw_M1$(EXEEXT) time_lw_M2$(EXEEXT) time_lw_N$(EXEEXT) \ time_lw_O$(EXEEXT) time_lw_P$(EXEEXT) time_lw_Pprime$(EXEEXT) \ time_lw_Q$(EXEEXT) time_lw_Qprime$(EXEEXT) \ time_antipode$(EXEEXT) time_fateman_expand$(EXEEXT) \ time_uvar_gcd$(EXEEXT) time_parser$(EXEEXT) am_bugme_chinrem_gcd_OBJECTS = bugme_chinrem_gcd.$(OBJEXT) bugme_chinrem_gcd_OBJECTS = $(am_bugme_chinrem_gcd_OBJECTS) bugme_chinrem_gcd_DEPENDENCIES = ../ginac/libginac.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_check_inifcns_OBJECTS = check_inifcns.$(OBJEXT) check_inifcns_OBJECTS = $(am_check_inifcns_OBJECTS) check_inifcns_DEPENDENCIES = ../ginac/libginac.la am_check_lsolve_OBJECTS = check_lsolve.$(OBJEXT) genex.$(OBJEXT) check_lsolve_OBJECTS = $(am_check_lsolve_OBJECTS) check_lsolve_DEPENDENCIES = ../ginac/libginac.la am_check_matrices_OBJECTS = check_matrices.$(OBJEXT) genex.$(OBJEXT) check_matrices_OBJECTS = $(am_check_matrices_OBJECTS) check_matrices_DEPENDENCIES = ../ginac/libginac.la am_check_mul_info_OBJECTS = check_mul_info.$(OBJEXT) check_mul_info_OBJECTS = $(am_check_mul_info_OBJECTS) check_mul_info_DEPENDENCIES = ../ginac/libginac.la am_check_numeric_OBJECTS = check_numeric.$(OBJEXT) check_numeric_OBJECTS = $(am_check_numeric_OBJECTS) check_numeric_DEPENDENCIES = ../ginac/libginac.la am_exam_archive_OBJECTS = exam_archive.$(OBJEXT) exam_archive_OBJECTS = $(am_exam_archive_OBJECTS) exam_archive_DEPENDENCIES = ../ginac/libginac.la am_exam_clifford_OBJECTS = exam_clifford.$(OBJEXT) exam_clifford_OBJECTS = $(am_exam_clifford_OBJECTS) exam_clifford_DEPENDENCIES = ../ginac/libginac.la am_exam_color_OBJECTS = exam_color.$(OBJEXT) exam_color_OBJECTS = $(am_exam_color_OBJECTS) exam_color_DEPENDENCIES = ../ginac/libginac.la am_exam_cra_OBJECTS = exam_cra.$(OBJEXT) exam_cra_OBJECTS = $(am_exam_cra_OBJECTS) exam_cra_DEPENDENCIES = ../ginac/libginac.la am_exam_differentiation_OBJECTS = exam_differentiation.$(OBJEXT) exam_differentiation_OBJECTS = $(am_exam_differentiation_OBJECTS) exam_differentiation_DEPENDENCIES = ../ginac/libginac.la am_exam_factor_OBJECTS = exam_factor.$(OBJEXT) exam_factor_OBJECTS = $(am_exam_factor_OBJECTS) exam_factor_DEPENDENCIES = ../ginac/libginac.la am_exam_heur_gcd_OBJECTS = heur_gcd_bug.$(OBJEXT) exam_heur_gcd_OBJECTS = $(am_exam_heur_gcd_OBJECTS) exam_heur_gcd_DEPENDENCIES = ../ginac/libginac.la am_exam_indexed_OBJECTS = exam_indexed.$(OBJEXT) exam_indexed_OBJECTS = $(am_exam_indexed_OBJECTS) exam_indexed_DEPENDENCIES = ../ginac/libginac.la am_exam_inifcns_OBJECTS = exam_inifcns.$(OBJEXT) exam_inifcns_OBJECTS = $(am_exam_inifcns_OBJECTS) exam_inifcns_DEPENDENCIES = ../ginac/libginac.la am_exam_inifcns_nstdsums_OBJECTS = exam_inifcns_nstdsums.$(OBJEXT) exam_inifcns_nstdsums_OBJECTS = $(am_exam_inifcns_nstdsums_OBJECTS) exam_inifcns_nstdsums_DEPENDENCIES = ../ginac/libginac.la am_exam_lsolve_OBJECTS = exam_lsolve.$(OBJEXT) exam_lsolve_OBJECTS = $(am_exam_lsolve_OBJECTS) exam_lsolve_DEPENDENCIES = ../ginac/libginac.la am_exam_matrices_OBJECTS = exam_matrices.$(OBJEXT) exam_matrices_OBJECTS = $(am_exam_matrices_OBJECTS) exam_matrices_DEPENDENCIES = ../ginac/libginac.la am_exam_misc_OBJECTS = exam_misc.$(OBJEXT) exam_misc_OBJECTS = $(am_exam_misc_OBJECTS) exam_misc_DEPENDENCIES = ../ginac/libginac.la am_exam_mod_gcd_OBJECTS = exam_mod_gcd.$(OBJEXT) exam_mod_gcd_OBJECTS = $(am_exam_mod_gcd_OBJECTS) exam_mod_gcd_DEPENDENCIES = ../ginac/libginac.la am_exam_normalization_OBJECTS = exam_normalization.$(OBJEXT) exam_normalization_OBJECTS = $(am_exam_normalization_OBJECTS) exam_normalization_DEPENDENCIES = ../ginac/libginac.la am_exam_numeric_OBJECTS = exam_numeric.$(OBJEXT) exam_numeric_OBJECTS = $(am_exam_numeric_OBJECTS) exam_numeric_DEPENDENCIES = ../ginac/libginac.la am_exam_numeric_archive_OBJECTS = numeric_archive.$(OBJEXT) exam_numeric_archive_OBJECTS = $(am_exam_numeric_archive_OBJECTS) exam_numeric_archive_DEPENDENCIES = ../ginac/libginac.la am_exam_paranoia_OBJECTS = exam_paranoia.$(OBJEXT) exam_paranoia_OBJECTS = $(am_exam_paranoia_OBJECTS) exam_paranoia_DEPENDENCIES = ../ginac/libginac.la am_exam_polygcd_OBJECTS = exam_polygcd.$(OBJEXT) exam_polygcd_OBJECTS = $(am_exam_polygcd_OBJECTS) exam_polygcd_DEPENDENCIES = ../ginac/libginac.la am_exam_powerlaws_OBJECTS = exam_powerlaws.$(OBJEXT) exam_powerlaws_OBJECTS = $(am_exam_powerlaws_OBJECTS) exam_powerlaws_DEPENDENCIES = ../ginac/libginac.la am_exam_pseries_OBJECTS = exam_pseries.$(OBJEXT) exam_pseries_OBJECTS = $(am_exam_pseries_OBJECTS) exam_pseries_DEPENDENCIES = ../ginac/libginac.la am_exam_real_imag_OBJECTS = exam_real_imag.$(OBJEXT) exam_real_imag_OBJECTS = $(am_exam_real_imag_OBJECTS) exam_real_imag_DEPENDENCIES = ../ginac/libginac.la am_exam_structure_OBJECTS = exam_structure.$(OBJEXT) exam_structure_OBJECTS = $(am_exam_structure_OBJECTS) exam_structure_DEPENDENCIES = ../ginac/libginac.la am_factor_univariate_bug_OBJECTS = factor_univariate_bug.$(OBJEXT) factor_univariate_bug_OBJECTS = $(am_factor_univariate_bug_OBJECTS) factor_univariate_bug_DEPENDENCIES = ../ginac/libginac.la am_match_bug_OBJECTS = match_bug.$(OBJEXT) match_bug_OBJECTS = $(am_match_bug_OBJECTS) match_bug_DEPENDENCIES = ../ginac/libginac.la am_parser_bugs_OBJECTS = parser_bugs.$(OBJEXT) parser_bugs_OBJECTS = $(am_parser_bugs_OBJECTS) parser_bugs_DEPENDENCIES = ../ginac/libginac.la am_pgcd_infinite_loop_OBJECTS = pgcd_infinite_loop.$(OBJEXT) pgcd_infinite_loop_OBJECTS = $(am_pgcd_infinite_loop_OBJECTS) pgcd_infinite_loop_DEPENDENCIES = ../ginac/libginac.la am_pgcd_relatively_prime_bug_OBJECTS = \ pgcd_relatively_prime_bug.$(OBJEXT) pgcd_relatively_prime_bug_OBJECTS = \ $(am_pgcd_relatively_prime_bug_OBJECTS) pgcd_relatively_prime_bug_DEPENDENCIES = ../ginac/libginac.la am_time_antipode_OBJECTS = time_antipode.$(OBJEXT) \ randomize_serials.$(OBJEXT) timer.$(OBJEXT) time_antipode_OBJECTS = $(am_time_antipode_OBJECTS) time_antipode_DEPENDENCIES = ../ginac/libginac.la am_time_dennyfliegner_OBJECTS = time_dennyfliegner.$(OBJEXT) \ randomize_serials.$(OBJEXT) timer.$(OBJEXT) time_dennyfliegner_OBJECTS = $(am_time_dennyfliegner_OBJECTS) time_dennyfliegner_DEPENDENCIES = ../ginac/libginac.la am_time_fateman_expand_OBJECTS = time_fateman_expand.$(OBJEXT) \ randomize_serials.$(OBJEXT) timer.$(OBJEXT) time_fateman_expand_OBJECTS = $(am_time_fateman_expand_OBJECTS) time_fateman_expand_DEPENDENCIES = ../ginac/libginac.la am_time_gammaseries_OBJECTS = time_gammaseries.$(OBJEXT) \ randomize_serials.$(OBJEXT) timer.$(OBJEXT) time_gammaseries_OBJECTS = $(am_time_gammaseries_OBJECTS) time_gammaseries_DEPENDENCIES = ../ginac/libginac.la am_time_lw_A_OBJECTS = time_lw_A.$(OBJEXT) randomize_serials.$(OBJEXT) \ timer.$(OBJEXT) time_lw_A_OBJECTS = $(am_time_lw_A_OBJECTS) time_lw_A_DEPENDENCIES = ../ginac/libginac.la am_time_lw_B_OBJECTS = time_lw_B.$(OBJEXT) randomize_serials.$(OBJEXT) \ timer.$(OBJEXT) time_lw_B_OBJECTS = $(am_time_lw_B_OBJECTS) time_lw_B_DEPENDENCIES = ../ginac/libginac.la am_time_lw_C_OBJECTS = time_lw_C.$(OBJEXT) randomize_serials.$(OBJEXT) \ timer.$(OBJEXT) time_lw_C_OBJECTS = $(am_time_lw_C_OBJECTS) time_lw_C_DEPENDENCIES = ../ginac/libginac.la am_time_lw_D_OBJECTS = time_lw_D.$(OBJEXT) randomize_serials.$(OBJEXT) \ timer.$(OBJEXT) time_lw_D_OBJECTS = $(am_time_lw_D_OBJECTS) time_lw_D_DEPENDENCIES = ../ginac/libginac.la am_time_lw_E_OBJECTS = time_lw_E.$(OBJEXT) randomize_serials.$(OBJEXT) \ timer.$(OBJEXT) time_lw_E_OBJECTS = $(am_time_lw_E_OBJECTS) time_lw_E_DEPENDENCIES = ../ginac/libginac.la am_time_lw_F_OBJECTS = time_lw_F.$(OBJEXT) randomize_serials.$(OBJEXT) \ timer.$(OBJEXT) time_lw_F_OBJECTS = $(am_time_lw_F_OBJECTS) time_lw_F_DEPENDENCIES = ../ginac/libginac.la am_time_lw_G_OBJECTS = time_lw_G.$(OBJEXT) randomize_serials.$(OBJEXT) \ timer.$(OBJEXT) time_lw_G_OBJECTS = $(am_time_lw_G_OBJECTS) time_lw_G_DEPENDENCIES = ../ginac/libginac.la am_time_lw_H_OBJECTS = time_lw_H.$(OBJEXT) randomize_serials.$(OBJEXT) \ timer.$(OBJEXT) time_lw_H_OBJECTS = $(am_time_lw_H_OBJECTS) time_lw_H_DEPENDENCIES = ../ginac/libginac.la am_time_lw_IJKL_OBJECTS = time_lw_IJKL.$(OBJEXT) \ randomize_serials.$(OBJEXT) timer.$(OBJEXT) time_lw_IJKL_OBJECTS = $(am_time_lw_IJKL_OBJECTS) time_lw_IJKL_DEPENDENCIES = ../ginac/libginac.la am_time_lw_M1_OBJECTS = time_lw_M1.$(OBJEXT) \ randomize_serials.$(OBJEXT) timer.$(OBJEXT) time_lw_M1_OBJECTS = $(am_time_lw_M1_OBJECTS) time_lw_M1_DEPENDENCIES = ../ginac/libginac.la am_time_lw_M2_OBJECTS = time_lw_M2.$(OBJEXT) \ randomize_serials.$(OBJEXT) timer.$(OBJEXT) time_lw_M2_OBJECTS = $(am_time_lw_M2_OBJECTS) time_lw_M2_DEPENDENCIES = ../ginac/libginac.la am_time_lw_N_OBJECTS = time_lw_N.$(OBJEXT) randomize_serials.$(OBJEXT) \ timer.$(OBJEXT) time_lw_N_OBJECTS = $(am_time_lw_N_OBJECTS) time_lw_N_DEPENDENCIES = ../ginac/libginac.la am_time_lw_O_OBJECTS = time_lw_O.$(OBJEXT) randomize_serials.$(OBJEXT) \ timer.$(OBJEXT) time_lw_O_OBJECTS = $(am_time_lw_O_OBJECTS) time_lw_O_DEPENDENCIES = ../ginac/libginac.la am_time_lw_P_OBJECTS = time_lw_P.$(OBJEXT) randomize_serials.$(OBJEXT) \ timer.$(OBJEXT) time_lw_P_OBJECTS = $(am_time_lw_P_OBJECTS) time_lw_P_DEPENDENCIES = ../ginac/libginac.la am_time_lw_Pprime_OBJECTS = time_lw_Pprime.$(OBJEXT) \ randomize_serials.$(OBJEXT) timer.$(OBJEXT) time_lw_Pprime_OBJECTS = $(am_time_lw_Pprime_OBJECTS) time_lw_Pprime_DEPENDENCIES = ../ginac/libginac.la am_time_lw_Q_OBJECTS = time_lw_Q.$(OBJEXT) randomize_serials.$(OBJEXT) \ timer.$(OBJEXT) time_lw_Q_OBJECTS = $(am_time_lw_Q_OBJECTS) time_lw_Q_DEPENDENCIES = ../ginac/libginac.la am_time_lw_Qprime_OBJECTS = time_lw_Qprime.$(OBJEXT) \ randomize_serials.$(OBJEXT) timer.$(OBJEXT) time_lw_Qprime_OBJECTS = $(am_time_lw_Qprime_OBJECTS) time_lw_Qprime_DEPENDENCIES = ../ginac/libginac.la am_time_parser_OBJECTS = time_parser.$(OBJEXT) \ randomize_serials.$(OBJEXT) timer.$(OBJEXT) time_parser_OBJECTS = $(am_time_parser_OBJECTS) time_parser_DEPENDENCIES = ../ginac/libginac.la am_time_toeplitz_OBJECTS = time_toeplitz.$(OBJEXT) \ randomize_serials.$(OBJEXT) timer.$(OBJEXT) time_toeplitz_OBJECTS = $(am_time_toeplitz_OBJECTS) time_toeplitz_DEPENDENCIES = ../ginac/libginac.la am_time_uvar_gcd_OBJECTS = time_uvar_gcd.$(OBJEXT) timer.$(OBJEXT) time_uvar_gcd_OBJECTS = $(am_time_uvar_gcd_OBJECTS) time_uvar_gcd_DEPENDENCIES = ../ginac/libginac.la am_time_vandermonde_OBJECTS = time_vandermonde.$(OBJEXT) \ randomize_serials.$(OBJEXT) timer.$(OBJEXT) time_vandermonde_OBJECTS = $(am_time_vandermonde_OBJECTS) time_vandermonde_DEPENDENCIES = ../ginac/libginac.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/bugme_chinrem_gcd.Po \ ./$(DEPDIR)/check_inifcns.Po ./$(DEPDIR)/check_lsolve.Po \ ./$(DEPDIR)/check_matrices.Po ./$(DEPDIR)/check_mul_info.Po \ ./$(DEPDIR)/check_numeric.Po ./$(DEPDIR)/exam_archive.Po \ ./$(DEPDIR)/exam_clifford.Po ./$(DEPDIR)/exam_color.Po \ ./$(DEPDIR)/exam_cra.Po ./$(DEPDIR)/exam_differentiation.Po \ ./$(DEPDIR)/exam_factor.Po ./$(DEPDIR)/exam_indexed.Po \ ./$(DEPDIR)/exam_inifcns.Po \ ./$(DEPDIR)/exam_inifcns_nstdsums.Po \ ./$(DEPDIR)/exam_lsolve.Po ./$(DEPDIR)/exam_matrices.Po \ ./$(DEPDIR)/exam_misc.Po ./$(DEPDIR)/exam_mod_gcd.Po \ ./$(DEPDIR)/exam_normalization.Po ./$(DEPDIR)/exam_numeric.Po \ ./$(DEPDIR)/exam_paranoia.Po ./$(DEPDIR)/exam_polygcd.Po \ ./$(DEPDIR)/exam_powerlaws.Po ./$(DEPDIR)/exam_pseries.Po \ ./$(DEPDIR)/exam_real_imag.Po ./$(DEPDIR)/exam_structure.Po \ ./$(DEPDIR)/factor_univariate_bug.Po ./$(DEPDIR)/genex.Po \ ./$(DEPDIR)/heur_gcd_bug.Po ./$(DEPDIR)/match_bug.Po \ ./$(DEPDIR)/numeric_archive.Po ./$(DEPDIR)/parser_bugs.Po \ ./$(DEPDIR)/pgcd_infinite_loop.Po \ ./$(DEPDIR)/pgcd_relatively_prime_bug.Po \ ./$(DEPDIR)/randomize_serials.Po ./$(DEPDIR)/time_antipode.Po \ ./$(DEPDIR)/time_dennyfliegner.Po \ ./$(DEPDIR)/time_fateman_expand.Po \ ./$(DEPDIR)/time_gammaseries.Po ./$(DEPDIR)/time_lw_A.Po \ ./$(DEPDIR)/time_lw_B.Po ./$(DEPDIR)/time_lw_C.Po \ ./$(DEPDIR)/time_lw_D.Po ./$(DEPDIR)/time_lw_E.Po \ ./$(DEPDIR)/time_lw_F.Po ./$(DEPDIR)/time_lw_G.Po \ ./$(DEPDIR)/time_lw_H.Po ./$(DEPDIR)/time_lw_IJKL.Po \ ./$(DEPDIR)/time_lw_M1.Po ./$(DEPDIR)/time_lw_M2.Po \ ./$(DEPDIR)/time_lw_N.Po ./$(DEPDIR)/time_lw_O.Po \ ./$(DEPDIR)/time_lw_P.Po ./$(DEPDIR)/time_lw_Pprime.Po \ ./$(DEPDIR)/time_lw_Q.Po ./$(DEPDIR)/time_lw_Qprime.Po \ ./$(DEPDIR)/time_parser.Po ./$(DEPDIR)/time_toeplitz.Po \ ./$(DEPDIR)/time_uvar_gcd.Po ./$(DEPDIR)/time_vandermonde.Po \ ./$(DEPDIR)/timer.Po am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(bugme_chinrem_gcd_SOURCES) $(check_inifcns_SOURCES) \ $(check_lsolve_SOURCES) $(check_matrices_SOURCES) \ $(check_mul_info_SOURCES) $(check_numeric_SOURCES) \ $(exam_archive_SOURCES) $(exam_clifford_SOURCES) \ $(exam_color_SOURCES) $(exam_cra_SOURCES) \ $(exam_differentiation_SOURCES) $(exam_factor_SOURCES) \ $(exam_heur_gcd_SOURCES) $(exam_indexed_SOURCES) \ $(exam_inifcns_SOURCES) $(exam_inifcns_nstdsums_SOURCES) \ $(exam_lsolve_SOURCES) $(exam_matrices_SOURCES) \ $(exam_misc_SOURCES) $(exam_mod_gcd_SOURCES) \ $(exam_normalization_SOURCES) $(exam_numeric_SOURCES) \ $(exam_numeric_archive_SOURCES) $(exam_paranoia_SOURCES) \ $(exam_polygcd_SOURCES) $(exam_powerlaws_SOURCES) \ $(exam_pseries_SOURCES) $(exam_real_imag_SOURCES) \ $(exam_structure_SOURCES) $(factor_univariate_bug_SOURCES) \ $(match_bug_SOURCES) $(parser_bugs_SOURCES) \ $(pgcd_infinite_loop_SOURCES) \ $(pgcd_relatively_prime_bug_SOURCES) $(time_antipode_SOURCES) \ $(time_dennyfliegner_SOURCES) $(time_fateman_expand_SOURCES) \ $(time_gammaseries_SOURCES) $(time_lw_A_SOURCES) \ $(time_lw_B_SOURCES) $(time_lw_C_SOURCES) $(time_lw_D_SOURCES) \ $(time_lw_E_SOURCES) $(time_lw_F_SOURCES) $(time_lw_G_SOURCES) \ $(time_lw_H_SOURCES) $(time_lw_IJKL_SOURCES) \ $(time_lw_M1_SOURCES) $(time_lw_M2_SOURCES) \ $(time_lw_N_SOURCES) $(time_lw_O_SOURCES) $(time_lw_P_SOURCES) \ $(time_lw_Pprime_SOURCES) $(time_lw_Q_SOURCES) \ $(time_lw_Qprime_SOURCES) $(time_parser_SOURCES) \ $(time_toeplitz_SOURCES) $(time_uvar_gcd_SOURCES) \ $(time_vandermonde_SOURCES) DIST_SOURCES = $(bugme_chinrem_gcd_SOURCES) $(check_inifcns_SOURCES) \ $(check_lsolve_SOURCES) $(check_matrices_SOURCES) \ $(check_mul_info_SOURCES) $(check_numeric_SOURCES) \ $(exam_archive_SOURCES) $(exam_clifford_SOURCES) \ $(exam_color_SOURCES) $(exam_cra_SOURCES) \ $(exam_differentiation_SOURCES) $(exam_factor_SOURCES) \ $(exam_heur_gcd_SOURCES) $(exam_indexed_SOURCES) \ $(exam_inifcns_SOURCES) $(exam_inifcns_nstdsums_SOURCES) \ $(exam_lsolve_SOURCES) $(exam_matrices_SOURCES) \ $(exam_misc_SOURCES) $(exam_mod_gcd_SOURCES) \ $(exam_normalization_SOURCES) $(exam_numeric_SOURCES) \ $(exam_numeric_archive_SOURCES) $(exam_paranoia_SOURCES) \ $(exam_polygcd_SOURCES) $(exam_powerlaws_SOURCES) \ $(exam_pseries_SOURCES) $(exam_real_imag_SOURCES) \ $(exam_structure_SOURCES) $(factor_univariate_bug_SOURCES) \ $(match_bug_SOURCES) $(parser_bugs_SOURCES) \ $(pgcd_infinite_loop_SOURCES) \ $(pgcd_relatively_prime_bug_SOURCES) $(time_antipode_SOURCES) \ $(time_dennyfliegner_SOURCES) $(time_fateman_expand_SOURCES) \ $(time_gammaseries_SOURCES) $(time_lw_A_SOURCES) \ $(time_lw_B_SOURCES) $(time_lw_C_SOURCES) $(time_lw_D_SOURCES) \ $(time_lw_E_SOURCES) $(time_lw_F_SOURCES) $(time_lw_G_SOURCES) \ $(time_lw_H_SOURCES) $(time_lw_IJKL_SOURCES) \ $(time_lw_M1_SOURCES) $(time_lw_M2_SOURCES) \ $(time_lw_N_SOURCES) $(time_lw_O_SOURCES) $(time_lw_P_SOURCES) \ $(time_lw_Pprime_SOURCES) $(time_lw_Q_SOURCES) \ $(time_lw_Qprime_SOURCES) $(time_parser_SOURCES) \ $(time_toeplitz_SOURCES) $(time_uvar_gcd_SOURCES) \ $(time_vandermonde_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ $(top_srcdir)/config/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLN_CFLAGS = @CLN_CFLAGS@ CLN_LIBS = @CLN_LIBS@ CLN_RPATH = @CLN_RPATH@ CONFIG_EXCOMPILER = @CONFIG_EXCOMPILER@ CONFIG_RUSAGE = @CONFIG_RUSAGE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVIPS = @DVIPS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FIG2DEV = @FIG2DEV@ GINACLIB_RPATH = @GINACLIB_RPATH@ GINSH_LIBS = @GINSH_LIBS@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LATEX = @LATEX@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAKEINDEX = @MAKEINDEX@ 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@ PDFLATEX = @PDFLATEX@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YACCEXE = @YACCEXE@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ CHECKS = check_numeric \ check_inifcns \ check_matrices \ check_lsolve EXAMS = exam_paranoia \ exam_heur_gcd \ match_bug \ parser_bugs \ exam_numeric_archive \ exam_numeric \ exam_powerlaws \ exam_inifcns \ exam_inifcns_nstdsums \ exam_differentiation \ exam_polygcd \ exam_normalization \ exam_factor \ exam_pseries \ exam_matrices \ exam_lsolve \ exam_indexed \ exam_color \ exam_clifford \ exam_archive \ exam_structure \ exam_misc \ exam_mod_gcd \ check_mul_info \ bugme_chinrem_gcd \ factor_univariate_bug \ pgcd_relatively_prime_bug \ pgcd_infinite_loop \ exam_cra \ exam_real_imag TIMES = time_dennyfliegner \ time_gammaseries \ time_vandermonde \ time_toeplitz \ time_lw_A \ time_lw_B \ time_lw_C \ time_lw_D \ time_lw_E \ time_lw_F \ time_lw_G \ time_lw_H \ time_lw_IJKL \ time_lw_M1 \ time_lw_M2 \ time_lw_N \ time_lw_O \ time_lw_P \ time_lw_Pprime \ time_lw_Q \ time_lw_Qprime \ time_antipode \ time_fateman_expand \ time_uvar_gcd \ time_parser check_numeric_SOURCES = check_numeric.cpp check_numeric_LDADD = ../ginac/libginac.la check_inifcns_SOURCES = check_inifcns.cpp check_inifcns_LDADD = ../ginac/libginac.la check_matrices_SOURCES = check_matrices.cpp genex.cpp check_matrices_LDADD = ../ginac/libginac.la check_lsolve_SOURCES = check_lsolve.cpp genex.cpp check_lsolve_LDADD = ../ginac/libginac.la check_mul_info_SOURCES = check_mul_info.cpp check_mul_info_LDADD = ../ginac/libginac.la exam_paranoia_SOURCES = exam_paranoia.cpp exam_paranoia_LDADD = ../ginac/libginac.la exam_heur_gcd_SOURCES = heur_gcd_bug.cpp exam_heur_gcd_LDADD = ../ginac/libginac.la match_bug_SOURCES = match_bug.cpp error_report.h match_bug_LDADD = ../ginac/libginac.la parser_bugs_SOURCES = parser_bugs.cpp parser_bugs_LDADD = ../ginac/libginac.la exam_numeric_archive_SOURCES = numeric_archive.cpp exam_numeric_archive_LDADD = ../ginac/libginac.la exam_numeric_SOURCES = exam_numeric.cpp exam_numeric_LDADD = ../ginac/libginac.la exam_powerlaws_SOURCES = exam_powerlaws.cpp exam_powerlaws_LDADD = ../ginac/libginac.la exam_inifcns_SOURCES = exam_inifcns.cpp exam_inifcns_LDADD = ../ginac/libginac.la exam_inifcns_nstdsums_SOURCES = exam_inifcns_nstdsums.cpp \ exam_inifcns_nstdsums.h exam_inifcns_nstdsums_LDADD = ../ginac/libginac.la exam_differentiation_SOURCES = exam_differentiation.cpp exam_differentiation_LDADD = ../ginac/libginac.la exam_polygcd_SOURCES = exam_polygcd.cpp exam_polygcd_LDADD = ../ginac/libginac.la exam_normalization_SOURCES = exam_normalization.cpp exam_normalization_LDADD = ../ginac/libginac.la exam_factor_SOURCES = exam_factor.cpp exam_factor_LDADD = ../ginac/libginac.la exam_pseries_SOURCES = exam_pseries.cpp exam_pseries_LDADD = ../ginac/libginac.la exam_matrices_SOURCES = exam_matrices.cpp exam_matrices_LDADD = ../ginac/libginac.la exam_lsolve_SOURCES = exam_lsolve.cpp exam_lsolve_LDADD = ../ginac/libginac.la exam_indexed_SOURCES = exam_indexed.cpp exam_indexed_LDADD = ../ginac/libginac.la exam_color_SOURCES = exam_color.cpp exam_color_LDADD = ../ginac/libginac.la exam_clifford_SOURCES = exam_clifford.cpp exam_clifford_LDADD = ../ginac/libginac.la exam_archive_SOURCES = exam_archive.cpp exam_archive_LDADD = ../ginac/libginac.la exam_structure_SOURCES = exam_structure.cpp exam_structure_LDADD = ../ginac/libginac.la exam_misc_SOURCES = exam_misc.cpp exam_misc_LDADD = ../ginac/libginac.la exam_mod_gcd_SOURCES = exam_mod_gcd.cpp exam_mod_gcd_LDADD = ../ginac/libginac.la exam_cra_SOURCES = exam_cra.cpp exam_cra_LDADD = ../ginac/libginac.la exam_real_imag_SOURCES = exam_real_imag.cpp exam_real_imag_LDADD = ../ginac/libginac.la time_dennyfliegner_SOURCES = time_dennyfliegner.cpp \ randomize_serials.cpp timer.cpp timer.h time_dennyfliegner_LDADD = ../ginac/libginac.la time_gammaseries_SOURCES = time_gammaseries.cpp \ randomize_serials.cpp timer.cpp timer.h time_gammaseries_LDADD = ../ginac/libginac.la time_vandermonde_SOURCES = time_vandermonde.cpp \ randomize_serials.cpp timer.cpp timer.h time_vandermonde_LDADD = ../ginac/libginac.la time_toeplitz_SOURCES = time_toeplitz.cpp \ randomize_serials.cpp timer.cpp timer.h time_toeplitz_LDADD = ../ginac/libginac.la time_lw_A_SOURCES = time_lw_A.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_A_LDADD = ../ginac/libginac.la time_lw_B_SOURCES = time_lw_B.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_B_LDADD = ../ginac/libginac.la time_lw_C_SOURCES = time_lw_C.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_C_LDADD = ../ginac/libginac.la time_lw_D_SOURCES = time_lw_D.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_D_LDADD = ../ginac/libginac.la time_lw_E_SOURCES = time_lw_E.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_E_LDADD = ../ginac/libginac.la time_lw_F_SOURCES = time_lw_F.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_F_LDADD = ../ginac/libginac.la time_lw_G_SOURCES = time_lw_G.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_G_LDADD = ../ginac/libginac.la time_lw_H_SOURCES = time_lw_H.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_H_LDADD = ../ginac/libginac.la time_lw_IJKL_SOURCES = time_lw_IJKL.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_IJKL_LDADD = ../ginac/libginac.la time_lw_M1_SOURCES = time_lw_M1.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_M1_LDADD = ../ginac/libginac.la time_lw_M2_SOURCES = time_lw_M2.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_M2_LDADD = ../ginac/libginac.la time_lw_N_SOURCES = time_lw_N.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_N_LDADD = ../ginac/libginac.la time_lw_O_SOURCES = time_lw_O.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_O_LDADD = ../ginac/libginac.la time_lw_P_SOURCES = time_lw_P.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_P_LDADD = ../ginac/libginac.la time_lw_Pprime_SOURCES = time_lw_Pprime.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_Pprime_LDADD = ../ginac/libginac.la time_lw_Q_SOURCES = time_lw_Q.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_Q_LDADD = ../ginac/libginac.la time_lw_Qprime_SOURCES = time_lw_Qprime.cpp \ randomize_serials.cpp timer.cpp timer.h time_lw_Qprime_LDADD = ../ginac/libginac.la time_antipode_SOURCES = time_antipode.cpp \ randomize_serials.cpp timer.cpp timer.h time_antipode_LDADD = ../ginac/libginac.la time_fateman_expand_SOURCES = time_fateman_expand.cpp \ randomize_serials.cpp timer.cpp timer.h time_fateman_expand_LDADD = ../ginac/libginac.la time_uvar_gcd_SOURCES = time_uvar_gcd.cpp test_runner.h timer.cpp timer.h time_uvar_gcd_LDADD = ../ginac/libginac.la time_parser_SOURCES = time_parser.cpp \ randomize_serials.cpp timer.cpp timer.h time_parser_LDADD = ../ginac/libginac.la bugme_chinrem_gcd_SOURCES = bugme_chinrem_gcd.cpp bugme_chinrem_gcd_LDADD = ../ginac/libginac.la factor_univariate_bug_SOURCES = factor_univariate_bug.cpp factor_univariate_bug_LDADD = ../ginac/libginac.la pgcd_relatively_prime_bug_SOURCES = pgcd_relatively_prime_bug.cpp pgcd_relatively_prime_bug_LDADD = ../ginac/libginac.la pgcd_infinite_loop_SOURCES = pgcd_infinite_loop.cpp pgcd_infinite_loop_LDADD = ../ginac/libginac.la AM_CPPFLAGS = -I$(srcdir)/../ginac -I../ginac -DIN_GINAC CLEANFILES = exam.gar EXTRA_DIST = CMakeLists.txt all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu check/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu check/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list bugme_chinrem_gcd$(EXEEXT): $(bugme_chinrem_gcd_OBJECTS) $(bugme_chinrem_gcd_DEPENDENCIES) $(EXTRA_bugme_chinrem_gcd_DEPENDENCIES) @rm -f bugme_chinrem_gcd$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(bugme_chinrem_gcd_OBJECTS) $(bugme_chinrem_gcd_LDADD) $(LIBS) check_inifcns$(EXEEXT): $(check_inifcns_OBJECTS) $(check_inifcns_DEPENDENCIES) $(EXTRA_check_inifcns_DEPENDENCIES) @rm -f check_inifcns$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(check_inifcns_OBJECTS) $(check_inifcns_LDADD) $(LIBS) check_lsolve$(EXEEXT): $(check_lsolve_OBJECTS) $(check_lsolve_DEPENDENCIES) $(EXTRA_check_lsolve_DEPENDENCIES) @rm -f check_lsolve$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(check_lsolve_OBJECTS) $(check_lsolve_LDADD) $(LIBS) check_matrices$(EXEEXT): $(check_matrices_OBJECTS) $(check_matrices_DEPENDENCIES) $(EXTRA_check_matrices_DEPENDENCIES) @rm -f check_matrices$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(check_matrices_OBJECTS) $(check_matrices_LDADD) $(LIBS) check_mul_info$(EXEEXT): $(check_mul_info_OBJECTS) $(check_mul_info_DEPENDENCIES) $(EXTRA_check_mul_info_DEPENDENCIES) @rm -f check_mul_info$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(check_mul_info_OBJECTS) $(check_mul_info_LDADD) $(LIBS) check_numeric$(EXEEXT): $(check_numeric_OBJECTS) $(check_numeric_DEPENDENCIES) $(EXTRA_check_numeric_DEPENDENCIES) @rm -f check_numeric$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(check_numeric_OBJECTS) $(check_numeric_LDADD) $(LIBS) exam_archive$(EXEEXT): $(exam_archive_OBJECTS) $(exam_archive_DEPENDENCIES) $(EXTRA_exam_archive_DEPENDENCIES) @rm -f exam_archive$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_archive_OBJECTS) $(exam_archive_LDADD) $(LIBS) exam_clifford$(EXEEXT): $(exam_clifford_OBJECTS) $(exam_clifford_DEPENDENCIES) $(EXTRA_exam_clifford_DEPENDENCIES) @rm -f exam_clifford$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_clifford_OBJECTS) $(exam_clifford_LDADD) $(LIBS) exam_color$(EXEEXT): $(exam_color_OBJECTS) $(exam_color_DEPENDENCIES) $(EXTRA_exam_color_DEPENDENCIES) @rm -f exam_color$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_color_OBJECTS) $(exam_color_LDADD) $(LIBS) exam_cra$(EXEEXT): $(exam_cra_OBJECTS) $(exam_cra_DEPENDENCIES) $(EXTRA_exam_cra_DEPENDENCIES) @rm -f exam_cra$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_cra_OBJECTS) $(exam_cra_LDADD) $(LIBS) exam_differentiation$(EXEEXT): $(exam_differentiation_OBJECTS) $(exam_differentiation_DEPENDENCIES) $(EXTRA_exam_differentiation_DEPENDENCIES) @rm -f exam_differentiation$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_differentiation_OBJECTS) $(exam_differentiation_LDADD) $(LIBS) exam_factor$(EXEEXT): $(exam_factor_OBJECTS) $(exam_factor_DEPENDENCIES) $(EXTRA_exam_factor_DEPENDENCIES) @rm -f exam_factor$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_factor_OBJECTS) $(exam_factor_LDADD) $(LIBS) exam_heur_gcd$(EXEEXT): $(exam_heur_gcd_OBJECTS) $(exam_heur_gcd_DEPENDENCIES) $(EXTRA_exam_heur_gcd_DEPENDENCIES) @rm -f exam_heur_gcd$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_heur_gcd_OBJECTS) $(exam_heur_gcd_LDADD) $(LIBS) exam_indexed$(EXEEXT): $(exam_indexed_OBJECTS) $(exam_indexed_DEPENDENCIES) $(EXTRA_exam_indexed_DEPENDENCIES) @rm -f exam_indexed$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_indexed_OBJECTS) $(exam_indexed_LDADD) $(LIBS) exam_inifcns$(EXEEXT): $(exam_inifcns_OBJECTS) $(exam_inifcns_DEPENDENCIES) $(EXTRA_exam_inifcns_DEPENDENCIES) @rm -f exam_inifcns$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_inifcns_OBJECTS) $(exam_inifcns_LDADD) $(LIBS) exam_inifcns_nstdsums$(EXEEXT): $(exam_inifcns_nstdsums_OBJECTS) $(exam_inifcns_nstdsums_DEPENDENCIES) $(EXTRA_exam_inifcns_nstdsums_DEPENDENCIES) @rm -f exam_inifcns_nstdsums$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_inifcns_nstdsums_OBJECTS) $(exam_inifcns_nstdsums_LDADD) $(LIBS) exam_lsolve$(EXEEXT): $(exam_lsolve_OBJECTS) $(exam_lsolve_DEPENDENCIES) $(EXTRA_exam_lsolve_DEPENDENCIES) @rm -f exam_lsolve$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_lsolve_OBJECTS) $(exam_lsolve_LDADD) $(LIBS) exam_matrices$(EXEEXT): $(exam_matrices_OBJECTS) $(exam_matrices_DEPENDENCIES) $(EXTRA_exam_matrices_DEPENDENCIES) @rm -f exam_matrices$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_matrices_OBJECTS) $(exam_matrices_LDADD) $(LIBS) exam_misc$(EXEEXT): $(exam_misc_OBJECTS) $(exam_misc_DEPENDENCIES) $(EXTRA_exam_misc_DEPENDENCIES) @rm -f exam_misc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_misc_OBJECTS) $(exam_misc_LDADD) $(LIBS) exam_mod_gcd$(EXEEXT): $(exam_mod_gcd_OBJECTS) $(exam_mod_gcd_DEPENDENCIES) $(EXTRA_exam_mod_gcd_DEPENDENCIES) @rm -f exam_mod_gcd$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_mod_gcd_OBJECTS) $(exam_mod_gcd_LDADD) $(LIBS) exam_normalization$(EXEEXT): $(exam_normalization_OBJECTS) $(exam_normalization_DEPENDENCIES) $(EXTRA_exam_normalization_DEPENDENCIES) @rm -f exam_normalization$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_normalization_OBJECTS) $(exam_normalization_LDADD) $(LIBS) exam_numeric$(EXEEXT): $(exam_numeric_OBJECTS) $(exam_numeric_DEPENDENCIES) $(EXTRA_exam_numeric_DEPENDENCIES) @rm -f exam_numeric$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_numeric_OBJECTS) $(exam_numeric_LDADD) $(LIBS) exam_numeric_archive$(EXEEXT): $(exam_numeric_archive_OBJECTS) $(exam_numeric_archive_DEPENDENCIES) $(EXTRA_exam_numeric_archive_DEPENDENCIES) @rm -f exam_numeric_archive$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_numeric_archive_OBJECTS) $(exam_numeric_archive_LDADD) $(LIBS) exam_paranoia$(EXEEXT): $(exam_paranoia_OBJECTS) $(exam_paranoia_DEPENDENCIES) $(EXTRA_exam_paranoia_DEPENDENCIES) @rm -f exam_paranoia$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_paranoia_OBJECTS) $(exam_paranoia_LDADD) $(LIBS) exam_polygcd$(EXEEXT): $(exam_polygcd_OBJECTS) $(exam_polygcd_DEPENDENCIES) $(EXTRA_exam_polygcd_DEPENDENCIES) @rm -f exam_polygcd$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_polygcd_OBJECTS) $(exam_polygcd_LDADD) $(LIBS) exam_powerlaws$(EXEEXT): $(exam_powerlaws_OBJECTS) $(exam_powerlaws_DEPENDENCIES) $(EXTRA_exam_powerlaws_DEPENDENCIES) @rm -f exam_powerlaws$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_powerlaws_OBJECTS) $(exam_powerlaws_LDADD) $(LIBS) exam_pseries$(EXEEXT): $(exam_pseries_OBJECTS) $(exam_pseries_DEPENDENCIES) $(EXTRA_exam_pseries_DEPENDENCIES) @rm -f exam_pseries$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_pseries_OBJECTS) $(exam_pseries_LDADD) $(LIBS) exam_real_imag$(EXEEXT): $(exam_real_imag_OBJECTS) $(exam_real_imag_DEPENDENCIES) $(EXTRA_exam_real_imag_DEPENDENCIES) @rm -f exam_real_imag$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_real_imag_OBJECTS) $(exam_real_imag_LDADD) $(LIBS) exam_structure$(EXEEXT): $(exam_structure_OBJECTS) $(exam_structure_DEPENDENCIES) $(EXTRA_exam_structure_DEPENDENCIES) @rm -f exam_structure$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(exam_structure_OBJECTS) $(exam_structure_LDADD) $(LIBS) factor_univariate_bug$(EXEEXT): $(factor_univariate_bug_OBJECTS) $(factor_univariate_bug_DEPENDENCIES) $(EXTRA_factor_univariate_bug_DEPENDENCIES) @rm -f factor_univariate_bug$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(factor_univariate_bug_OBJECTS) $(factor_univariate_bug_LDADD) $(LIBS) match_bug$(EXEEXT): $(match_bug_OBJECTS) $(match_bug_DEPENDENCIES) $(EXTRA_match_bug_DEPENDENCIES) @rm -f match_bug$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(match_bug_OBJECTS) $(match_bug_LDADD) $(LIBS) parser_bugs$(EXEEXT): $(parser_bugs_OBJECTS) $(parser_bugs_DEPENDENCIES) $(EXTRA_parser_bugs_DEPENDENCIES) @rm -f parser_bugs$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(parser_bugs_OBJECTS) $(parser_bugs_LDADD) $(LIBS) pgcd_infinite_loop$(EXEEXT): $(pgcd_infinite_loop_OBJECTS) $(pgcd_infinite_loop_DEPENDENCIES) $(EXTRA_pgcd_infinite_loop_DEPENDENCIES) @rm -f pgcd_infinite_loop$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(pgcd_infinite_loop_OBJECTS) $(pgcd_infinite_loop_LDADD) $(LIBS) pgcd_relatively_prime_bug$(EXEEXT): $(pgcd_relatively_prime_bug_OBJECTS) $(pgcd_relatively_prime_bug_DEPENDENCIES) $(EXTRA_pgcd_relatively_prime_bug_DEPENDENCIES) @rm -f pgcd_relatively_prime_bug$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(pgcd_relatively_prime_bug_OBJECTS) $(pgcd_relatively_prime_bug_LDADD) $(LIBS) time_antipode$(EXEEXT): $(time_antipode_OBJECTS) $(time_antipode_DEPENDENCIES) $(EXTRA_time_antipode_DEPENDENCIES) @rm -f time_antipode$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_antipode_OBJECTS) $(time_antipode_LDADD) $(LIBS) time_dennyfliegner$(EXEEXT): $(time_dennyfliegner_OBJECTS) $(time_dennyfliegner_DEPENDENCIES) $(EXTRA_time_dennyfliegner_DEPENDENCIES) @rm -f time_dennyfliegner$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_dennyfliegner_OBJECTS) $(time_dennyfliegner_LDADD) $(LIBS) time_fateman_expand$(EXEEXT): $(time_fateman_expand_OBJECTS) $(time_fateman_expand_DEPENDENCIES) $(EXTRA_time_fateman_expand_DEPENDENCIES) @rm -f time_fateman_expand$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_fateman_expand_OBJECTS) $(time_fateman_expand_LDADD) $(LIBS) time_gammaseries$(EXEEXT): $(time_gammaseries_OBJECTS) $(time_gammaseries_DEPENDENCIES) $(EXTRA_time_gammaseries_DEPENDENCIES) @rm -f time_gammaseries$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_gammaseries_OBJECTS) $(time_gammaseries_LDADD) $(LIBS) time_lw_A$(EXEEXT): $(time_lw_A_OBJECTS) $(time_lw_A_DEPENDENCIES) $(EXTRA_time_lw_A_DEPENDENCIES) @rm -f time_lw_A$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_A_OBJECTS) $(time_lw_A_LDADD) $(LIBS) time_lw_B$(EXEEXT): $(time_lw_B_OBJECTS) $(time_lw_B_DEPENDENCIES) $(EXTRA_time_lw_B_DEPENDENCIES) @rm -f time_lw_B$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_B_OBJECTS) $(time_lw_B_LDADD) $(LIBS) time_lw_C$(EXEEXT): $(time_lw_C_OBJECTS) $(time_lw_C_DEPENDENCIES) $(EXTRA_time_lw_C_DEPENDENCIES) @rm -f time_lw_C$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_C_OBJECTS) $(time_lw_C_LDADD) $(LIBS) time_lw_D$(EXEEXT): $(time_lw_D_OBJECTS) $(time_lw_D_DEPENDENCIES) $(EXTRA_time_lw_D_DEPENDENCIES) @rm -f time_lw_D$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_D_OBJECTS) $(time_lw_D_LDADD) $(LIBS) time_lw_E$(EXEEXT): $(time_lw_E_OBJECTS) $(time_lw_E_DEPENDENCIES) $(EXTRA_time_lw_E_DEPENDENCIES) @rm -f time_lw_E$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_E_OBJECTS) $(time_lw_E_LDADD) $(LIBS) time_lw_F$(EXEEXT): $(time_lw_F_OBJECTS) $(time_lw_F_DEPENDENCIES) $(EXTRA_time_lw_F_DEPENDENCIES) @rm -f time_lw_F$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_F_OBJECTS) $(time_lw_F_LDADD) $(LIBS) time_lw_G$(EXEEXT): $(time_lw_G_OBJECTS) $(time_lw_G_DEPENDENCIES) $(EXTRA_time_lw_G_DEPENDENCIES) @rm -f time_lw_G$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_G_OBJECTS) $(time_lw_G_LDADD) $(LIBS) time_lw_H$(EXEEXT): $(time_lw_H_OBJECTS) $(time_lw_H_DEPENDENCIES) $(EXTRA_time_lw_H_DEPENDENCIES) @rm -f time_lw_H$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_H_OBJECTS) $(time_lw_H_LDADD) $(LIBS) time_lw_IJKL$(EXEEXT): $(time_lw_IJKL_OBJECTS) $(time_lw_IJKL_DEPENDENCIES) $(EXTRA_time_lw_IJKL_DEPENDENCIES) @rm -f time_lw_IJKL$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_IJKL_OBJECTS) $(time_lw_IJKL_LDADD) $(LIBS) time_lw_M1$(EXEEXT): $(time_lw_M1_OBJECTS) $(time_lw_M1_DEPENDENCIES) $(EXTRA_time_lw_M1_DEPENDENCIES) @rm -f time_lw_M1$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_M1_OBJECTS) $(time_lw_M1_LDADD) $(LIBS) time_lw_M2$(EXEEXT): $(time_lw_M2_OBJECTS) $(time_lw_M2_DEPENDENCIES) $(EXTRA_time_lw_M2_DEPENDENCIES) @rm -f time_lw_M2$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_M2_OBJECTS) $(time_lw_M2_LDADD) $(LIBS) time_lw_N$(EXEEXT): $(time_lw_N_OBJECTS) $(time_lw_N_DEPENDENCIES) $(EXTRA_time_lw_N_DEPENDENCIES) @rm -f time_lw_N$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_N_OBJECTS) $(time_lw_N_LDADD) $(LIBS) time_lw_O$(EXEEXT): $(time_lw_O_OBJECTS) $(time_lw_O_DEPENDENCIES) $(EXTRA_time_lw_O_DEPENDENCIES) @rm -f time_lw_O$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_O_OBJECTS) $(time_lw_O_LDADD) $(LIBS) time_lw_P$(EXEEXT): $(time_lw_P_OBJECTS) $(time_lw_P_DEPENDENCIES) $(EXTRA_time_lw_P_DEPENDENCIES) @rm -f time_lw_P$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_P_OBJECTS) $(time_lw_P_LDADD) $(LIBS) time_lw_Pprime$(EXEEXT): $(time_lw_Pprime_OBJECTS) $(time_lw_Pprime_DEPENDENCIES) $(EXTRA_time_lw_Pprime_DEPENDENCIES) @rm -f time_lw_Pprime$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_Pprime_OBJECTS) $(time_lw_Pprime_LDADD) $(LIBS) time_lw_Q$(EXEEXT): $(time_lw_Q_OBJECTS) $(time_lw_Q_DEPENDENCIES) $(EXTRA_time_lw_Q_DEPENDENCIES) @rm -f time_lw_Q$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_Q_OBJECTS) $(time_lw_Q_LDADD) $(LIBS) time_lw_Qprime$(EXEEXT): $(time_lw_Qprime_OBJECTS) $(time_lw_Qprime_DEPENDENCIES) $(EXTRA_time_lw_Qprime_DEPENDENCIES) @rm -f time_lw_Qprime$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_lw_Qprime_OBJECTS) $(time_lw_Qprime_LDADD) $(LIBS) time_parser$(EXEEXT): $(time_parser_OBJECTS) $(time_parser_DEPENDENCIES) $(EXTRA_time_parser_DEPENDENCIES) @rm -f time_parser$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_parser_OBJECTS) $(time_parser_LDADD) $(LIBS) time_toeplitz$(EXEEXT): $(time_toeplitz_OBJECTS) $(time_toeplitz_DEPENDENCIES) $(EXTRA_time_toeplitz_DEPENDENCIES) @rm -f time_toeplitz$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_toeplitz_OBJECTS) $(time_toeplitz_LDADD) $(LIBS) time_uvar_gcd$(EXEEXT): $(time_uvar_gcd_OBJECTS) $(time_uvar_gcd_DEPENDENCIES) $(EXTRA_time_uvar_gcd_DEPENDENCIES) @rm -f time_uvar_gcd$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_uvar_gcd_OBJECTS) $(time_uvar_gcd_LDADD) $(LIBS) time_vandermonde$(EXEEXT): $(time_vandermonde_OBJECTS) $(time_vandermonde_DEPENDENCIES) $(EXTRA_time_vandermonde_DEPENDENCIES) @rm -f time_vandermonde$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(time_vandermonde_OBJECTS) $(time_vandermonde_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bugme_chinrem_gcd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_inifcns.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_lsolve.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_matrices.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_mul_info.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_numeric.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_archive.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_clifford.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_color.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_cra.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_differentiation.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_factor.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_indexed.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_inifcns.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_inifcns_nstdsums.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_lsolve.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_matrices.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_misc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_mod_gcd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_normalization.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_numeric.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_paranoia.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_polygcd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_powerlaws.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_pseries.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_real_imag.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exam_structure.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/factor_univariate_bug.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genex.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/heur_gcd_bug.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/match_bug.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numeric_archive.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser_bugs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgcd_infinite_loop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgcd_relatively_prime_bug.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/randomize_serials.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_antipode.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_dennyfliegner.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_fateman_expand.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_gammaseries.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_A.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_B.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_C.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_D.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_E.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_F.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_G.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_H.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_IJKL.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_M1.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_M2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_N.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_O.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_P.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_Pprime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_Q.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_lw_Qprime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_parser.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_toeplitz.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_uvar_gcd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_vandermonde.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? check_numeric.log: check_numeric$(EXEEXT) @p='check_numeric$(EXEEXT)'; \ b='check_numeric'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) check_inifcns.log: check_inifcns$(EXEEXT) @p='check_inifcns$(EXEEXT)'; \ b='check_inifcns'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) check_matrices.log: check_matrices$(EXEEXT) @p='check_matrices$(EXEEXT)'; \ b='check_matrices'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) check_lsolve.log: check_lsolve$(EXEEXT) @p='check_lsolve$(EXEEXT)'; \ b='check_lsolve'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_paranoia.log: exam_paranoia$(EXEEXT) @p='exam_paranoia$(EXEEXT)'; \ b='exam_paranoia'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_heur_gcd.log: exam_heur_gcd$(EXEEXT) @p='exam_heur_gcd$(EXEEXT)'; \ b='exam_heur_gcd'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) match_bug.log: match_bug$(EXEEXT) @p='match_bug$(EXEEXT)'; \ b='match_bug'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) parser_bugs.log: parser_bugs$(EXEEXT) @p='parser_bugs$(EXEEXT)'; \ b='parser_bugs'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_numeric_archive.log: exam_numeric_archive$(EXEEXT) @p='exam_numeric_archive$(EXEEXT)'; \ b='exam_numeric_archive'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_numeric.log: exam_numeric$(EXEEXT) @p='exam_numeric$(EXEEXT)'; \ b='exam_numeric'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_powerlaws.log: exam_powerlaws$(EXEEXT) @p='exam_powerlaws$(EXEEXT)'; \ b='exam_powerlaws'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_inifcns.log: exam_inifcns$(EXEEXT) @p='exam_inifcns$(EXEEXT)'; \ b='exam_inifcns'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_inifcns_nstdsums.log: exam_inifcns_nstdsums$(EXEEXT) @p='exam_inifcns_nstdsums$(EXEEXT)'; \ b='exam_inifcns_nstdsums'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_differentiation.log: exam_differentiation$(EXEEXT) @p='exam_differentiation$(EXEEXT)'; \ b='exam_differentiation'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_polygcd.log: exam_polygcd$(EXEEXT) @p='exam_polygcd$(EXEEXT)'; \ b='exam_polygcd'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_normalization.log: exam_normalization$(EXEEXT) @p='exam_normalization$(EXEEXT)'; \ b='exam_normalization'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_factor.log: exam_factor$(EXEEXT) @p='exam_factor$(EXEEXT)'; \ b='exam_factor'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_pseries.log: exam_pseries$(EXEEXT) @p='exam_pseries$(EXEEXT)'; \ b='exam_pseries'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_matrices.log: exam_matrices$(EXEEXT) @p='exam_matrices$(EXEEXT)'; \ b='exam_matrices'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_lsolve.log: exam_lsolve$(EXEEXT) @p='exam_lsolve$(EXEEXT)'; \ b='exam_lsolve'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_indexed.log: exam_indexed$(EXEEXT) @p='exam_indexed$(EXEEXT)'; \ b='exam_indexed'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_color.log: exam_color$(EXEEXT) @p='exam_color$(EXEEXT)'; \ b='exam_color'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_clifford.log: exam_clifford$(EXEEXT) @p='exam_clifford$(EXEEXT)'; \ b='exam_clifford'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_archive.log: exam_archive$(EXEEXT) @p='exam_archive$(EXEEXT)'; \ b='exam_archive'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_structure.log: exam_structure$(EXEEXT) @p='exam_structure$(EXEEXT)'; \ b='exam_structure'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_misc.log: exam_misc$(EXEEXT) @p='exam_misc$(EXEEXT)'; \ b='exam_misc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_mod_gcd.log: exam_mod_gcd$(EXEEXT) @p='exam_mod_gcd$(EXEEXT)'; \ b='exam_mod_gcd'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) check_mul_info.log: check_mul_info$(EXEEXT) @p='check_mul_info$(EXEEXT)'; \ b='check_mul_info'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) bugme_chinrem_gcd.log: bugme_chinrem_gcd$(EXEEXT) @p='bugme_chinrem_gcd$(EXEEXT)'; \ b='bugme_chinrem_gcd'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) factor_univariate_bug.log: factor_univariate_bug$(EXEEXT) @p='factor_univariate_bug$(EXEEXT)'; \ b='factor_univariate_bug'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) pgcd_relatively_prime_bug.log: pgcd_relatively_prime_bug$(EXEEXT) @p='pgcd_relatively_prime_bug$(EXEEXT)'; \ b='pgcd_relatively_prime_bug'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) pgcd_infinite_loop.log: pgcd_infinite_loop$(EXEEXT) @p='pgcd_infinite_loop$(EXEEXT)'; \ b='pgcd_infinite_loop'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_cra.log: exam_cra$(EXEEXT) @p='exam_cra$(EXEEXT)'; \ b='exam_cra'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) exam_real_imag.log: exam_real_imag$(EXEEXT) @p='exam_real_imag$(EXEEXT)'; \ b='exam_real_imag'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_dennyfliegner.log: time_dennyfliegner$(EXEEXT) @p='time_dennyfliegner$(EXEEXT)'; \ b='time_dennyfliegner'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_gammaseries.log: time_gammaseries$(EXEEXT) @p='time_gammaseries$(EXEEXT)'; \ b='time_gammaseries'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_vandermonde.log: time_vandermonde$(EXEEXT) @p='time_vandermonde$(EXEEXT)'; \ b='time_vandermonde'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_toeplitz.log: time_toeplitz$(EXEEXT) @p='time_toeplitz$(EXEEXT)'; \ b='time_toeplitz'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_A.log: time_lw_A$(EXEEXT) @p='time_lw_A$(EXEEXT)'; \ b='time_lw_A'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_B.log: time_lw_B$(EXEEXT) @p='time_lw_B$(EXEEXT)'; \ b='time_lw_B'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_C.log: time_lw_C$(EXEEXT) @p='time_lw_C$(EXEEXT)'; \ b='time_lw_C'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_D.log: time_lw_D$(EXEEXT) @p='time_lw_D$(EXEEXT)'; \ b='time_lw_D'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_E.log: time_lw_E$(EXEEXT) @p='time_lw_E$(EXEEXT)'; \ b='time_lw_E'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_F.log: time_lw_F$(EXEEXT) @p='time_lw_F$(EXEEXT)'; \ b='time_lw_F'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_G.log: time_lw_G$(EXEEXT) @p='time_lw_G$(EXEEXT)'; \ b='time_lw_G'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_H.log: time_lw_H$(EXEEXT) @p='time_lw_H$(EXEEXT)'; \ b='time_lw_H'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_IJKL.log: time_lw_IJKL$(EXEEXT) @p='time_lw_IJKL$(EXEEXT)'; \ b='time_lw_IJKL'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_M1.log: time_lw_M1$(EXEEXT) @p='time_lw_M1$(EXEEXT)'; \ b='time_lw_M1'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_M2.log: time_lw_M2$(EXEEXT) @p='time_lw_M2$(EXEEXT)'; \ b='time_lw_M2'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_N.log: time_lw_N$(EXEEXT) @p='time_lw_N$(EXEEXT)'; \ b='time_lw_N'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_O.log: time_lw_O$(EXEEXT) @p='time_lw_O$(EXEEXT)'; \ b='time_lw_O'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_P.log: time_lw_P$(EXEEXT) @p='time_lw_P$(EXEEXT)'; \ b='time_lw_P'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_Pprime.log: time_lw_Pprime$(EXEEXT) @p='time_lw_Pprime$(EXEEXT)'; \ b='time_lw_Pprime'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_Q.log: time_lw_Q$(EXEEXT) @p='time_lw_Q$(EXEEXT)'; \ b='time_lw_Q'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_lw_Qprime.log: time_lw_Qprime$(EXEEXT) @p='time_lw_Qprime$(EXEEXT)'; \ b='time_lw_Qprime'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_antipode.log: time_antipode$(EXEEXT) @p='time_antipode$(EXEEXT)'; \ b='time_antipode'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_fateman_expand.log: time_fateman_expand$(EXEEXT) @p='time_fateman_expand$(EXEEXT)'; \ b='time_fateman_expand'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_uvar_gcd.log: time_uvar_gcd$(EXEEXT) @p='time_uvar_gcd$(EXEEXT)'; \ b='time_uvar_gcd'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) time_parser.log: time_parser$(EXEEXT) @p='time_parser$(EXEEXT)'; \ b='time_parser'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/bugme_chinrem_gcd.Po -rm -f ./$(DEPDIR)/check_inifcns.Po -rm -f ./$(DEPDIR)/check_lsolve.Po -rm -f ./$(DEPDIR)/check_matrices.Po -rm -f ./$(DEPDIR)/check_mul_info.Po -rm -f ./$(DEPDIR)/check_numeric.Po -rm -f ./$(DEPDIR)/exam_archive.Po -rm -f ./$(DEPDIR)/exam_clifford.Po -rm -f ./$(DEPDIR)/exam_color.Po -rm -f ./$(DEPDIR)/exam_cra.Po -rm -f ./$(DEPDIR)/exam_differentiation.Po -rm -f ./$(DEPDIR)/exam_factor.Po -rm -f ./$(DEPDIR)/exam_indexed.Po -rm -f ./$(DEPDIR)/exam_inifcns.Po -rm -f ./$(DEPDIR)/exam_inifcns_nstdsums.Po -rm -f ./$(DEPDIR)/exam_lsolve.Po -rm -f ./$(DEPDIR)/exam_matrices.Po -rm -f ./$(DEPDIR)/exam_misc.Po -rm -f ./$(DEPDIR)/exam_mod_gcd.Po -rm -f ./$(DEPDIR)/exam_normalization.Po -rm -f ./$(DEPDIR)/exam_numeric.Po -rm -f ./$(DEPDIR)/exam_paranoia.Po -rm -f ./$(DEPDIR)/exam_polygcd.Po -rm -f ./$(DEPDIR)/exam_powerlaws.Po -rm -f ./$(DEPDIR)/exam_pseries.Po -rm -f ./$(DEPDIR)/exam_real_imag.Po -rm -f ./$(DEPDIR)/exam_structure.Po -rm -f ./$(DEPDIR)/factor_univariate_bug.Po -rm -f ./$(DEPDIR)/genex.Po -rm -f ./$(DEPDIR)/heur_gcd_bug.Po -rm -f ./$(DEPDIR)/match_bug.Po -rm -f ./$(DEPDIR)/numeric_archive.Po -rm -f ./$(DEPDIR)/parser_bugs.Po -rm -f ./$(DEPDIR)/pgcd_infinite_loop.Po -rm -f ./$(DEPDIR)/pgcd_relatively_prime_bug.Po -rm -f ./$(DEPDIR)/randomize_serials.Po -rm -f ./$(DEPDIR)/time_antipode.Po -rm -f ./$(DEPDIR)/time_dennyfliegner.Po -rm -f ./$(DEPDIR)/time_fateman_expand.Po -rm -f ./$(DEPDIR)/time_gammaseries.Po -rm -f ./$(DEPDIR)/time_lw_A.Po -rm -f ./$(DEPDIR)/time_lw_B.Po -rm -f ./$(DEPDIR)/time_lw_C.Po -rm -f ./$(DEPDIR)/time_lw_D.Po -rm -f ./$(DEPDIR)/time_lw_E.Po -rm -f ./$(DEPDIR)/time_lw_F.Po -rm -f ./$(DEPDIR)/time_lw_G.Po -rm -f ./$(DEPDIR)/time_lw_H.Po -rm -f ./$(DEPDIR)/time_lw_IJKL.Po -rm -f ./$(DEPDIR)/time_lw_M1.Po -rm -f ./$(DEPDIR)/time_lw_M2.Po -rm -f ./$(DEPDIR)/time_lw_N.Po -rm -f ./$(DEPDIR)/time_lw_O.Po -rm -f ./$(DEPDIR)/time_lw_P.Po -rm -f ./$(DEPDIR)/time_lw_Pprime.Po -rm -f ./$(DEPDIR)/time_lw_Q.Po -rm -f ./$(DEPDIR)/time_lw_Qprime.Po -rm -f ./$(DEPDIR)/time_parser.Po -rm -f ./$(DEPDIR)/time_toeplitz.Po -rm -f ./$(DEPDIR)/time_uvar_gcd.Po -rm -f ./$(DEPDIR)/time_vandermonde.Po -rm -f ./$(DEPDIR)/timer.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-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 -f ./$(DEPDIR)/bugme_chinrem_gcd.Po -rm -f ./$(DEPDIR)/check_inifcns.Po -rm -f ./$(DEPDIR)/check_lsolve.Po -rm -f ./$(DEPDIR)/check_matrices.Po -rm -f ./$(DEPDIR)/check_mul_info.Po -rm -f ./$(DEPDIR)/check_numeric.Po -rm -f ./$(DEPDIR)/exam_archive.Po -rm -f ./$(DEPDIR)/exam_clifford.Po -rm -f ./$(DEPDIR)/exam_color.Po -rm -f ./$(DEPDIR)/exam_cra.Po -rm -f ./$(DEPDIR)/exam_differentiation.Po -rm -f ./$(DEPDIR)/exam_factor.Po -rm -f ./$(DEPDIR)/exam_indexed.Po -rm -f ./$(DEPDIR)/exam_inifcns.Po -rm -f ./$(DEPDIR)/exam_inifcns_nstdsums.Po -rm -f ./$(DEPDIR)/exam_lsolve.Po -rm -f ./$(DEPDIR)/exam_matrices.Po -rm -f ./$(DEPDIR)/exam_misc.Po -rm -f ./$(DEPDIR)/exam_mod_gcd.Po -rm -f ./$(DEPDIR)/exam_normalization.Po -rm -f ./$(DEPDIR)/exam_numeric.Po -rm -f ./$(DEPDIR)/exam_paranoia.Po -rm -f ./$(DEPDIR)/exam_polygcd.Po -rm -f ./$(DEPDIR)/exam_powerlaws.Po -rm -f ./$(DEPDIR)/exam_pseries.Po -rm -f ./$(DEPDIR)/exam_real_imag.Po -rm -f ./$(DEPDIR)/exam_structure.Po -rm -f ./$(DEPDIR)/factor_univariate_bug.Po -rm -f ./$(DEPDIR)/genex.Po -rm -f ./$(DEPDIR)/heur_gcd_bug.Po -rm -f ./$(DEPDIR)/match_bug.Po -rm -f ./$(DEPDIR)/numeric_archive.Po -rm -f ./$(DEPDIR)/parser_bugs.Po -rm -f ./$(DEPDIR)/pgcd_infinite_loop.Po -rm -f ./$(DEPDIR)/pgcd_relatively_prime_bug.Po -rm -f ./$(DEPDIR)/randomize_serials.Po -rm -f ./$(DEPDIR)/time_antipode.Po -rm -f ./$(DEPDIR)/time_dennyfliegner.Po -rm -f ./$(DEPDIR)/time_fateman_expand.Po -rm -f ./$(DEPDIR)/time_gammaseries.Po -rm -f ./$(DEPDIR)/time_lw_A.Po -rm -f ./$(DEPDIR)/time_lw_B.Po -rm -f ./$(DEPDIR)/time_lw_C.Po -rm -f ./$(DEPDIR)/time_lw_D.Po -rm -f ./$(DEPDIR)/time_lw_E.Po -rm -f ./$(DEPDIR)/time_lw_F.Po -rm -f ./$(DEPDIR)/time_lw_G.Po -rm -f ./$(DEPDIR)/time_lw_H.Po -rm -f ./$(DEPDIR)/time_lw_IJKL.Po -rm -f ./$(DEPDIR)/time_lw_M1.Po -rm -f ./$(DEPDIR)/time_lw_M2.Po -rm -f ./$(DEPDIR)/time_lw_N.Po -rm -f ./$(DEPDIR)/time_lw_O.Po -rm -f ./$(DEPDIR)/time_lw_P.Po -rm -f ./$(DEPDIR)/time_lw_Pprime.Po -rm -f ./$(DEPDIR)/time_lw_Q.Po -rm -f ./$(DEPDIR)/time_lw_Qprime.Po -rm -f ./$(DEPDIR)/time_parser.Po -rm -f ./$(DEPDIR)/time_toeplitz.Po -rm -f ./$(DEPDIR)/time_uvar_gcd.Po -rm -f ./$(DEPDIR)/time_vandermonde.Po -rm -f ./$(DEPDIR)/timer.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am 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 maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: ginac-1.7.8.orig/check/bugme_chinrem_gcd.cpp0000644000000000000000000001227213457611471015654 0ustar /** @file bugme_chinrem_gcd.cpp * * A small program exposing historical bug in poly_cra function. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include #include using namespace std; namespace GiNaC { extern ex chinrem_gcd(const ex& A, const ex& B); } using namespace GiNaC; static const std::string p1_srep("\ -936639990-14679334842*x^9-6214147095*x^35+22219362387*x^69-31276301429*x^25+1199649580*x^98+2134905268*x^56+25591410149*x^72+5507703343*x^11+18467021749*x^43+11196778577*x^85+26050790733*x^29-178435747*x^2+1890708440*x^88-561107347*x^13-31038290506*x^51-1330154020*x^15+23467669465*x^59-3966988360*x^16+26794929142*x^38+11598735101*x^75-8608995580*x^3-30174373832*x^46+3580061526*x^91+7814495607*x^20+6624766926*x^78-11990574398*x^54-6863205889*x^33-319408644*x^65-11580405260*x^41-9654281719*x^81+23532819511*x^24-3890383043*x^94+27682281779*x^62+1363904895*x^68-272899085*x^49-933592128*x^97-2954269379*x^28+8432066353*x^36+14038262112*x^71-5474416933*x^84+741141010*x^100+38375274669*x^57-19509035058*x^44-1029159530*x^87+17276957972*x^8+23471621465*x^19-4745283802*x^74-15331409214*x^23-1261023993*x^90+17469329915*x^52-7544450778*x^64+12293848678*x^10-12162845828*x^39+11912265375*x^77-35110566664*x^27-5872201799*x^60+16636451249*x^80-6663332709*x^12+26248623452*x^47+2292551912*x^93-13410537172*x^14+4255578378*x^55+11614165303*x^31-6270990007*x^34-6744628155*x^67+3692350529*x^96-17204774085*x^63-11157075535*x^18+4275663006*x^70+18517327396*x^42+2030662033*x^83-3435911855*x^50-227816977*x^99+4507833875*x-41046742100*x^37+9385606040*x^73-5892518210*x^22+512268187*x^86+9183261708*x^58-2542140060*x^4-19627087954*x^45+142491112*x^89-4846605217*x^26-4503859503*x^30-38388107386*x^32+2123912816*x^5-2508504600*x^76-15282350857*x^53-12217636980*x^40-4828562936*x^79+1788729074*x^6-967823912*x^92+6436149609*x^7+44704228721*x^61+21474090980*x^17+36034512058*x^66+10918084347*x^21+1913801599*x^82+1530941050*x^48-7104898913*x^95"); static const std::string p2_srep("\ 1882371920+29943249139*x^9-21558061051*x^35+24497174109*x^69+3363043648*x^25+5186524611*x^98-17753230977*x^56+16461882236*x^72+11039962159*x^11-85814533599*x^43-12986831645*x^85+4813620791*x^29-2133682609*x^2+9141433582*x^88-14841292646*x^13+19494168654*x^51-426278523*x^15-18246235652*x^59-12424469513*x^16-14414308862*x^38-16262001424*x^75+1584505491*x^3+6616907060*x^46+9411879011*x^91+7056872613*x^20+29675566382*x^78-48441925739*x^54+12038293769*x^33-22463329638*x^65+21957440404*x^41+26252749471*x^81-28689993421*x^24+1190623161*x^94-3323333429*x^62+778770195*x^68-23673866858*x^49+10263027507*x^97+29115114125*x^28-34230002076*x^36-217623403*x^71-6344703601*x^84+2789684836*x^100-44973929094*x^57-6061422988*x^44+18964048763*x^87+3160532878*x^8-8039690791*x^19-5750277357*x^74+5544486596*x^23+1800283356*x^90-8174921854*x^52+2577247520*x^64-1088265300*x^10+18566882873*x^39+12678193001*x^77-7204610489*x^27+9980611956*x^60+12672890141*x^80+4463462090*x^12-30937311949*x^47-3883570155*x^93+7561875663*x^14-3850452489*x^55+20714527103*x^31-9973372012*x^34+440594870*x^67+10385086102*x^96-20693764726*x^63+11049483001*x^18-11578701274*x^70-5548876327*x^42+20393397488*x^83+20531692560*x^50+1309311388*x^99-7521320830*x-2750892631*x^37-6001481047*x^73+7149046134*x^22+10287410396*x^86+7332053562*x^58-1135211878*x^4-7420079075*x^45+9742202475*x^89-214559874*x^26+29530802947*x^30-2280622009*x^32-4237029618*x^5+13760397067*x^76+18073788685*x^53+2485463829*x^40+1889202286*x^79+8841198971*x^6+13562767020*x^92+110919258*x^7+6961020716*x^61+11700952246*x^17-13528331424*x^66-19801882818*x^21+25061328813*x^82+1553111326*x^48+4638169279*x^95"); static void check_poly_cra() { parser the_parser; ex p1 = the_parser(p1_srep); ex p2 = the_parser(p2_srep); ex g = chinrem_gcd(p1, p2); } static void check_extract_integer_content() { parser readme; ex A = readme("1/282901891126422365*(x + y)"); ex B = readme("165888/282901891126422365*(x - y)"); ex g = chinrem_gcd(A, B); } static void integer_coeff_braindamage() { parser readme; ex A = readme("3*x^2 + 1"); ex B = readme("9*x^2 + 1"); ex g = chinrem_gcd(A, B); if (!g.is_equal(ex(1))) { std::cerr << "expected 1, got " << g << std::endl; throw std::logic_error("chinrem_gcd miscomputed integer content"); } } int main(int argc, char** argv) { cout << "checking for bugs in poly_cra() and friends " << flush; check_poly_cra(); check_extract_integer_content(); integer_coeff_braindamage(); cout << "not found."; return 0; } ginac-1.7.8.orig/check/check_inifcns.cpp0000644000000000000000000001353013457611471015017 0ustar /** @file check_inifcns.cpp * * This test routine applies assorted tests on initially known higher level * functions. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include // for rand() #include using namespace std; /* Some tests on the sine trigonometric function. */ static unsigned inifcns_check_sin() { unsigned result = 0; bool errorflag = false; // sin(n*Pi) == 0? errorflag = false; for (int n=-10; n<=10; ++n) { if (sin(n*Pi).eval() != numeric(0) || !sin(n*Pi).eval().info(info_flags::integer)) errorflag = true; } if (errorflag) { // we don't count each of those errors clog << "sin(n*Pi) with integer n does not always return exact 0" << endl; ++result; } // sin((n+1/2)*Pi) == {+|-}1? errorflag = false; for (int n=-10; n<=10; ++n) { if (!sin((n+numeric(1,2))*Pi).eval().info(info_flags::integer) || !(sin((n+numeric(1,2))*Pi).eval() == numeric(1) || sin((n+numeric(1,2))*Pi).eval() == numeric(-1))) errorflag = true; } if (errorflag) { clog << "sin((n+1/2)*Pi) with integer n does not always return exact {+|-}1" << endl; ++result; } // compare sin((q*Pi).evalf()) with sin(q*Pi).eval().evalf() at various // points. E.g. if sin(Pi/10) returns something symbolic this should be // equal to sqrt(5)/4-1/4. This routine will spot programming mistakes // of this kind: errorflag = false; ex argument; numeric epsilon(double(1e-8)); for (int n=-340; n<=340; ++n) { argument = n*Pi/60; if (abs(sin(evalf(argument))-evalf(sin(argument)))>epsilon) { clog << "sin(" << argument << ") returns " << sin(argument) << endl; errorflag = true; } } if (errorflag) ++result; return result; } /* Simple tests on the cosine trigonometric function. */ static unsigned inifcns_check_cos() { unsigned result = 0; bool errorflag; // cos((n+1/2)*Pi) == 0? errorflag = false; for (int n=-10; n<=10; ++n) { if (cos((n+numeric(1,2))*Pi).eval() != numeric(0) || !cos((n+numeric(1,2))*Pi).eval().info(info_flags::integer)) errorflag = true; } if (errorflag) { clog << "cos((n+1/2)*Pi) with integer n does not always return exact 0" << endl; ++result; } // cos(n*Pi) == 0? errorflag = false; for (int n=-10; n<=10; ++n) { if (!cos(n*Pi).eval().info(info_flags::integer) || !(cos(n*Pi).eval() == numeric(1) || cos(n*Pi).eval() == numeric(-1))) errorflag = true; } if (errorflag) { clog << "cos(n*Pi) with integer n does not always return exact {+|-}1" << endl; ++result; } // compare cos((q*Pi).evalf()) with cos(q*Pi).eval().evalf() at various // points. E.g. if cos(Pi/12) returns something symbolic this should be // equal to 1/4*(1+1/3*sqrt(3))*sqrt(6). This routine will spot // programming mistakes of this kind: errorflag = false; ex argument; numeric epsilon(double(1e-8)); for (int n=-340; n<=340; ++n) { argument = n*Pi/60; if (abs(cos(evalf(argument))-evalf(cos(argument)))>epsilon) { clog << "cos(" << argument << ") returns " << cos(argument) << endl; errorflag = true; } } if (errorflag) ++result; return result; } /* Simple tests on the tangent trigonometric function. */ static unsigned inifcns_check_tan() { unsigned result = 0; bool errorflag; // compare tan((q*Pi).evalf()) with tan(q*Pi).eval().evalf() at various // points. E.g. if tan(Pi/12) returns something symbolic this should be // equal to 2-sqrt(3). This routine will spot programming mistakes of // this kind: errorflag = false; ex argument; numeric epsilon(double(1e-8)); for (int n=-340; n<=340; ++n) { if (!(n%30) && (n%60)) // skip poles ++n; argument = n*Pi/60; if (abs(tan(evalf(argument))-evalf(tan(argument)))>epsilon) { clog << "tan(" << argument << ") returns " << tan(argument) << endl; errorflag = true; } } if (errorflag) ++result; return result; } /* Simple tests on the dilogarithm function. */ static unsigned inifcns_check_Li2() { // NOTE: this can safely be removed once CLN supports dilogarithms and // checks them itself. unsigned result = 0; bool errorflag; // check the relation Li2(z^2) == 2 * (Li2(z) + Li2(-z)) numerically, which // should hold in the entire complex plane: errorflag = false; ex argument; numeric epsilon(double(1e-16)); for (int n=0; n<200; ++n) { argument = numeric(20.0*rand()/(RAND_MAX+1.0)-10.0) + numeric(20.0*rand()/(RAND_MAX+1.0)-10.0)*I; if (abs(Li2(pow(argument,2))-2*Li2(argument)-2*Li2(-argument)) > epsilon) { clog << "Li2(z) at z==" << argument << " failed to satisfy Li2(z^2)==2*(Li2(z)+Li2(-z))" << endl; errorflag = true; } } if (errorflag) ++result; return result; } unsigned check_inifcns() { unsigned result = 0; cout << "checking consistency of symbolic functions" << flush; result += inifcns_check_sin(); cout << '.' << flush; result += inifcns_check_cos(); cout << '.' << flush; result += inifcns_check_tan(); cout << '.' << flush; result += inifcns_check_Li2(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return check_inifcns(); } ginac-1.7.8.orig/check/check_lsolve.cpp0000644000000000000000000001431613457611471014675 0ustar /** @file check_lsolve.cpp * * These test routines do some simple checks on solving linear systems of * symbolic equations. They are a well-tried resource for cross-checking * the underlying symbolic manipulations. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include // for rand() #include #include using namespace std; extern const ex dense_univariate_poly(const symbol & x, unsigned degree); static unsigned check_matrix_solve(unsigned m, unsigned n, unsigned p, unsigned degree) { const symbol a("a"); matrix A(m,n); matrix B(m,p); // set the first min(m,n) rows of A and B for (unsigned ro=0; (ro x; matrix X(n,p); for (unsigned i=0; i a; vector x; for (unsigned i=0; i // for rand(), RAND_MAX #include using namespace std; extern const ex sparse_tree(const symbol & x, const symbol & y, const symbol & z, int level, bool trig = false, bool rational = true, bool complex = false); extern const ex dense_univariate_poly(const symbol & x, unsigned degree); /* determinants of some sparse symbolic matrices with coefficients in * an integral domain. */ static unsigned integdom_matrix_determinants() { unsigned result = 0; symbol a("a"); for (unsigned size=3; size<22; ++size) { matrix A(size,size); // populate one element in each row: for (unsigned r=0; r using namespace GiNaC; int main(int argc, char** argv) { symbol x("x"), y("y"); ex e = x*y; if (!e.info(info_flags::indefinite)) { std::cerr << "eek, product of two symbols is NOT indefinite"; return 1; } return 0; } ginac-1.7.8.orig/check/check_numeric.cpp0000644000000000000000000000676313457611471015042 0ustar /** @file check_numeric.cpp * * These exams creates some numbers and check the result of several Boolean * tests on these numbers like is_integer() etc... */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include // for rand() #include using namespace std; /* Simple and maybe somewhat pointless consistency tests of assorted tests and * conversions. */ static unsigned check_numeric1() { unsigned result = 0; bool errorflag = false; int re_q, im_q; // Check some numerator and denominator calculations: for (int rep=0; rep<200; ++rep) { do { re_q = rand(); } while (re_q == 0); do { im_q = rand(); } while (im_q == 0); numeric r(rand()-RAND_MAX/2, re_q); numeric i(rand()-RAND_MAX/2, im_q); numeric z = r + I*i; numeric p = numer(z); numeric q = denom(z); numeric res = p/q; if (res != z) { clog << z << " erroneously transformed into " << p << "/" << q << " by numer() and denom()" << endl; errorflag = true; } } if (errorflag) ++result; return result; } static unsigned check_numeric2() { unsigned result = 0; bool errorflag = false; int i_num, i_den; // Check non-nested radicals (n/d)^(m/n) in ex wrapper class: for (int i=0; i<200; ++i) { for (int j=2; j<13; ++j) { // construct an exponent 1/j... numeric nm(1,j); nm += numeric(int(20.0*rand()/(RAND_MAX+1.0))-10); // ...a numerator... do { i_num = rand(); } while (i_num<=0); numeric num(i_num); // ...and a denominator. do { i_den = (rand())/100; } while (i_den<=0); numeric den(i_den); // construct the radicals: ex radical = pow(ex(num)/ex(den),ex(nm)); numeric floating = pow(num/den,nm); // test the result: if (is_a(radical)) { // This is very improbable with decent random numbers but it // still can happen, so we better check if it is correct: if (pow(radical,inverse(nm))==num/den) { // Aha! We drew some lucky numbers. Nothing to see here... } else { clog << "(" << num << "/" << den << ")^(" << nm << ") should have been a product, instead it's " << radical << endl; errorflag = true; } } numeric ratio = abs(ex_to(evalf(radical))/floating); if (ratio>1.0001 && ratio<0.9999) { clog << "(" << num << "/" << den << ")^(" << nm << ") erroneously evaluated to " << radical; errorflag = true; } } } if (errorflag) ++result; return result; } unsigned check_numeric() { unsigned result = 0; cout << "checking consistency of numeric types" << flush; result += check_numeric1(); cout << '.' << flush; result += check_numeric2(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return check_numeric(); } ginac-1.7.8.orig/check/error_report.h0000644000000000000000000000240213457611471014416 0ustar /** @file error_report.h * * Macro for additional debugging output. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #ifndef GINAC_CHECK_ERROR_REPORT_H #define GINAC_CHECK_ERROR_REPORT_H #include #include #define cbug_on(cond, what) \ do { \ if (cond) { \ std::ostringstream err_stream; \ err_stream << __FILE__ << ':' << __LINE__ \ << what; \ throw std::logic_error(err_stream.str()); \ } \ } while (0) #endif // ndef GINAC_CHECK_ERROR_REPORT_H ginac-1.7.8.orig/check/exam_archive.cpp0000644000000000000000000000471713457611471014673 0ustar /** @file exam_archive.cpp * * Here we test GiNaC's archiving system. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include #include using namespace std; unsigned exam_archive() { unsigned result = 0; cout << "examining archiving system" << flush; symbol x("x"), y("y"), mu("mu"), dim("dim", "\\Delta"); ex e, f; // This expression is complete nonsense but it contains every type of // GiNaC object e = -42 * x * pow(y, sin(y*Catalan)) * dirac_ONE() * epsilon_tensor(idx(fail(), 3), idx(0, 3), idx(y/2, 3)) + lorentz_g( varidx(lst{x, -11*y, acos(2*x).series(x==3-5*I, 3)} * color_ONE() * metric_tensor(varidx(log(cos(128.0/(x*y))), 5), varidx(2, 5)), zeta(3)), varidx(diag_matrix({-1, Euler, atan(x/y==-15*I/17)}) * delta_tensor(idx(x, 2), idx(wild(7), 3)), zeta(3), true), true ) + dirac_gamma(varidx(mu, dim)) * dirac_gamma(varidx(mu, 4-dim, true)) * color_T(idx(x, 8), 1) * color_h(idx(x, 8), idx(y, 8), idx(2, 8)) * indexed(x, sy_anti(), idx(2*y+1, x), varidx(-mu, 5)) - 2.4275 * spinor_metric(spinidx(0, 2, false, true), spinidx(y)) + abs(x).series(x == y, 4); archive ar; ar.archive_ex(e, "expr 1"); { std::ofstream fout("exam.gar", std::ios_base::binary); fout << ar; } ar.clear(); { std::ifstream fin("exam.gar", std::ios_base::binary); fin >> ar; } f = ar.unarchive_ex(lst{x, y, mu, dim}, "expr 1"); ex difference = (f - e).expand(); if (!difference.is_zero()) { clog << "archiving/unarchiving " << e << endl << "erroneously returned " << f << endl; ++result; } return result; } int main(int argc, char** argv) { return exam_archive(); } ginac-1.7.8.orig/check/exam_clifford.cpp0000644000000000000000000006463313457611471015045 0ustar /** @file exam_clifford.cpp * * Here we test GiNaC's Clifford algebra objects. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; const numeric half(1, 2); static unsigned check_equal(const ex &e1, const ex &e2) { ex e = normal(e1 - e2); if (!e.is_zero()) { clog << "(" << e1 << ") - (" << e2 << ") erroneously returned " << e << " instead of 0" << endl; return 1; } return 0; } static unsigned check_equal_simplify(const ex &e1, const ex &e2) { ex e = normal(simplify_indexed(e1) - e2); if (!e.is_zero()) { clog << "simplify_indexed(" << e1 << ") - (" << e2 << ") erroneously returned " << e << " instead of 0" << endl; return 1; } return 0; } static unsigned check_equal_lst(const ex & e1, const ex & e2) { for (unsigned int i = 0; i < e1.nops(); i++) { ex e = e1.op(i) - e2.op(i); if (!e.normal().is_zero()) { clog << "(" << e1 << ") - (" << e2 << ") erroneously returned " << e << " instead of 0 (in the entry " << i << ")" << endl; return 1; } } return 0; } static unsigned check_equal_simplify_term(const ex & e1, const ex & e2, idx & mu) { ex e = expand_dummy_sum(normal(simplify_indexed(e1) - e2), true); for (int j=0; j<4; j++) { ex esub = e.subs( is_a(mu) ? lst { mu == idx(j, mu.get_dim()), ex_to(mu).toggle_variance() == idx(j, mu.get_dim()) } : lst{mu == idx(j, mu.get_dim())} ); if (!(canonicalize_clifford(esub).is_zero())) { clog << "simplify_indexed(" << e1 << ") - (" << e2 << ") erroneously returned " << canonicalize_clifford(esub) << " instead of 0 for mu=" << j << endl; return 1; } } return 0; } static unsigned check_equal_simplify_term2(const ex & e1, const ex & e2) { ex e = expand_dummy_sum(normal(simplify_indexed(e1) - e2), true); if (!(canonicalize_clifford(e).is_zero())) { clog << "simplify_indexed(" << e1 << ") - (" << e2 << ") erroneously returned " << canonicalize_clifford(e) << " instead of 0" << endl; return 1; } return 0; } static unsigned clifford_check1() { // checks general identities and contractions unsigned result = 0; symbol dim("D"); varidx mu(symbol("mu"), dim), nu(symbol("nu"), dim), rho(symbol("rho"), dim); ex e; e = dirac_ONE() * dirac_ONE(); result += check_equal(e, dirac_ONE()); e = dirac_ONE() * dirac_gamma(mu) * dirac_ONE(); result += check_equal(e, dirac_gamma(mu)); e = dirac_gamma(varidx(2, dim)) * dirac_gamma(varidx(1, dim)) * dirac_gamma(varidx(1, dim)) * dirac_gamma(varidx(2, dim)); result += check_equal(e, dirac_ONE()); e = dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(nu.toggle_variance()) * dirac_gamma(mu.toggle_variance()); result += check_equal_simplify(e, pow(dim, 2) * dirac_ONE()); e = dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(mu.toggle_variance()) * dirac_gamma(nu.toggle_variance()); result += check_equal_simplify(e, 2*dim*dirac_ONE()-pow(dim, 2)*dirac_ONE()); e = dirac_gamma(nu.toggle_variance()) * dirac_gamma(rho.toggle_variance()) * dirac_gamma(mu) * dirac_gamma(rho) * dirac_gamma(nu); e = e.simplify_indexed().collect(dirac_gamma(mu)); result += check_equal(e, pow(2 - dim, 2).expand() * dirac_gamma(mu)); return result; } static unsigned clifford_check2() { // checks identities relating to gamma5 unsigned result = 0; symbol dim("D"); varidx mu(symbol("mu"), dim), nu(symbol("nu"), dim); ex e; e = dirac_gamma(mu) * dirac_gamma5() + dirac_gamma5() * dirac_gamma(mu); result += check_equal(e, 0); e = dirac_gamma5() * dirac_gamma(mu) * dirac_gamma5() + dirac_gamma(mu); result += check_equal(e, 0); return result; } static unsigned clifford_check3() { // checks traces unsigned result = 0; symbol dim("D"), m("m"), q("q"), l("l"), ldotq("ldotq"); varidx mu(symbol("mu"), dim), nu(symbol("nu"), dim), rho(symbol("rho"), dim), sig(symbol("sig"), dim), kap(symbol("kap"), dim), lam(symbol("lam"), dim); ex e; e = dirac_gamma(mu); result += check_equal(dirac_trace(e), 0); e = dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(rho); result += check_equal(dirac_trace(e), 0); e = dirac_gamma5() * dirac_gamma(mu); result += check_equal(dirac_trace(e), 0); e = dirac_gamma5() * dirac_gamma(mu) * dirac_gamma(nu); result += check_equal(dirac_trace(e), 0); e = dirac_gamma5() * dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(rho); result += check_equal(dirac_trace(e), 0); scalar_products sp; sp.add(q, q, pow(q, 2)); sp.add(l, l, pow(l, 2)); sp.add(l, q, ldotq); e = pow(m, 2) * dirac_slash(q, dim) * dirac_slash(q, dim); e = dirac_trace(e).simplify_indexed(sp); result += check_equal(e, 4*pow(m, 2)*pow(q, 2)); // cyclicity without gamma5 e = dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(rho) * dirac_gamma(sig) - dirac_gamma(nu) * dirac_gamma(rho) * dirac_gamma(sig) * dirac_gamma(mu); e = dirac_trace(e); result += check_equal(e, 0); e = dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(rho) * dirac_gamma(sig) * dirac_gamma(kap) * dirac_gamma(lam) - dirac_gamma(nu) * dirac_gamma(rho) * dirac_gamma(sig) * dirac_gamma(kap) * dirac_gamma(lam) * dirac_gamma(mu); e = dirac_trace(e).expand(); result += check_equal(e, 0); // cyclicity of gamma5 * S_4 e = dirac_gamma5() * dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(rho) * dirac_gamma(sig) - dirac_gamma(sig) * dirac_gamma5() * dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(rho); e = dirac_trace(e); result += check_equal(e, 0); // non-cyclicity of order D-4 of gamma5 * S_6 e = dirac_gamma5() * dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(rho) * dirac_gamma(sig) * dirac_gamma(kap) * dirac_gamma(mu.toggle_variance()) + dim * dirac_gamma5() * dirac_gamma(nu) * dirac_gamma(rho) * dirac_gamma(sig) * dirac_gamma(kap); e = dirac_trace(e).simplify_indexed(); e = (e / (dim - 4)).normal(); result += check_equal(e, 8 * I * lorentz_eps(nu.replace_dim(4), rho.replace_dim(4), sig.replace_dim(4), kap.replace_dim(4))); // one-loop vacuum polarization in QED e = dirac_gamma(mu) * (dirac_slash(l, dim) + dirac_slash(q, 4) + m * dirac_ONE()) * dirac_gamma(mu.toggle_variance()) * (dirac_slash(l, dim) + m * dirac_ONE()); e = dirac_trace(e).simplify_indexed(sp); result += check_equal(e, 4*((2-dim)*l*l + (2-dim)*ldotq + dim*m*m).expand()); e = dirac_slash(q, 4) * (dirac_slash(l, dim) + dirac_slash(q, 4) + m * dirac_ONE()) * dirac_slash(q, 4) * (dirac_slash(l, dim) + m * dirac_ONE()); e = dirac_trace(e).simplify_indexed(sp); result += check_equal(e, 4*(2*ldotq*ldotq + q*q*ldotq - q*q*l*l + q*q*m*m).expand()); // stuff that had problems in the past ex prop = dirac_slash(q, dim) - m * dirac_ONE(); e = dirac_slash(l, dim) * dirac_gamma5() * dirac_slash(l, dim) * prop; e = dirac_trace(dirac_slash(q, dim) * e) - dirac_trace(m * e) - dirac_trace(prop * e); result += check_equal(e, 0); e = (dirac_gamma5() + dirac_ONE()) * dirac_gamma5(); e = dirac_trace(e); result += check_equal(e, 4); // traces with multiple representation labels e = dirac_ONE(0) * dirac_ONE(1) / 16; result += check_equal(dirac_trace(e, 0), dirac_ONE(1) / 4); result += check_equal(dirac_trace(e, 1), dirac_ONE(0) / 4); result += check_equal(dirac_trace(e, 2), e); result += check_equal(dirac_trace(e, lst{0, 1}), 1); e = dirac_gamma(mu, 0) * dirac_gamma(mu.toggle_variance(), 1) * dirac_gamma(nu, 0) * dirac_gamma(nu.toggle_variance(), 1); result += check_equal_simplify(dirac_trace(e, 0), 4 * dim * dirac_ONE(1)); result += check_equal_simplify(dirac_trace(e, 1), 4 * dim * dirac_ONE(0)); // Fails with new tinfo mechanism because the order of gamma matrices with different rl depends on luck. // TODO: better check. //result += check_equal_simplify(dirac_trace(e, 2), canonicalize_clifford(e)); // e will be canonicalized by the calculation of the trace result += check_equal_simplify(dirac_trace(e, lst{0, 1}), 16 * dim); return result; } static unsigned clifford_check4() { // simplify_indexed()/dirac_trace() cross-checks unsigned result = 0; symbol dim("D"); varidx mu(symbol("mu"), dim), nu(symbol("nu"), dim), rho(symbol("rho"), dim), sig(symbol("sig"), dim), lam(symbol("lam"), dim); ex e, t1, t2; e = dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(rho) * dirac_gamma(mu.toggle_variance()); t1 = dirac_trace(e).simplify_indexed(); t2 = dirac_trace(e.simplify_indexed()); result += check_equal((t1 - t2).expand(), 0); e = dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(rho) * dirac_gamma(sig) * dirac_gamma(mu.toggle_variance()) * dirac_gamma(lam); t1 = dirac_trace(e).simplify_indexed(); t2 = dirac_trace(e.simplify_indexed()); result += check_equal((t1 - t2).expand(), 0); e = dirac_gamma(sig) * dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(rho) * dirac_gamma(nu.toggle_variance()) * dirac_gamma(mu.toggle_variance()); t1 = dirac_trace(e).simplify_indexed(); t2 = dirac_trace(e.simplify_indexed()); result += check_equal((t1 - t2).expand(), 0); e = dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(rho) * dirac_gamma(mu.toggle_variance()) * dirac_gamma(sig) * dirac_gamma(nu.toggle_variance()); t1 = dirac_trace(e).simplify_indexed(); t2 = dirac_trace(e.simplify_indexed()); result += check_equal((t1 - t2).expand(), 0); return result; } static unsigned clifford_check5() { // canonicalize_clifford() checks unsigned result = 0; symbol dim("D"); varidx mu(symbol("mu"), dim), nu(symbol("nu"), dim), lam(symbol("lam"), dim); ex e; e = dirac_gamma(mu) * dirac_gamma(nu) + dirac_gamma(nu) * dirac_gamma(mu); result += check_equal(canonicalize_clifford(e), 2*dirac_ONE()*lorentz_g(mu, nu)); e = (dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(lam) + dirac_gamma(nu) * dirac_gamma(lam) * dirac_gamma(mu) + dirac_gamma(lam) * dirac_gamma(mu) * dirac_gamma(nu) - dirac_gamma(nu) * dirac_gamma(mu) * dirac_gamma(lam) - dirac_gamma(lam) * dirac_gamma(nu) * dirac_gamma(mu) - dirac_gamma(mu) * dirac_gamma(lam) * dirac_gamma(nu)) / 6 + lorentz_g(mu, nu) * dirac_gamma(lam) - lorentz_g(mu, lam) * dirac_gamma(nu) + lorentz_g(nu, lam) * dirac_gamma(mu) - dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(lam); result += check_equal(canonicalize_clifford(e), 0); return result; } /* We make two identical checks with metrics defined through a matrix in * the cases when used indexes have or have not variance. * To this end we recycle the code through the following macros */ template unsigned clifford_check6(const matrix &A) { unsigned result = 0; matrix A_symm(4,4), A2(4, 4); A_symm = A.add(A.transpose()).mul(half); A2 = A_symm.mul(A_symm); IDX v(symbol("v"), 4), nu(symbol("nu"), 4), mu(symbol("mu"), 4), psi(symbol("psi"),4), lam(symbol("lambda"), 4), xi(symbol("xi"), 4), rho(symbol("rho"),4); ex mu_TOGGLE = is_a(mu) ? ex_to(mu).toggle_variance() : mu; ex nu_TOGGLE = is_a(nu) ? ex_to(nu).toggle_variance() : nu; ex rho_TOGGLE = is_a(rho) ? ex_to(rho).toggle_variance() : rho; ex e, e1; /* checks general identities and contractions for clifford_unit*/ e = dirac_ONE(2) * clifford_unit(mu, A, 2) * dirac_ONE(2); result += check_equal(e, clifford_unit(mu, A, 2)); e = clifford_unit(IDX(2, 4), A) * clifford_unit(IDX(1, 4), A) * clifford_unit(IDX(1, 4), A) * clifford_unit(IDX(2, 4), A); result += check_equal(e, A(1, 1) * A(2, 2) * dirac_ONE()); e = clifford_unit(IDX(2, 4), A) * clifford_unit(IDX(1, 4), A) * clifford_unit(IDX(1, 4), A) * clifford_unit(IDX(2, 4), A); result += check_equal(e, A(1, 1) * A(2, 2) * dirac_ONE()); e = clifford_unit(nu, A) * clifford_unit(nu_TOGGLE, A); result += check_equal_simplify(e, A.trace() * dirac_ONE()); e = clifford_unit(nu, A) * clifford_unit(nu, A); result += check_equal_simplify(e, indexed(A_symm, sy_symm(), nu, nu) * dirac_ONE()); e = clifford_unit(nu, A) * clifford_unit(nu_TOGGLE, A) * clifford_unit(mu, A); result += check_equal_simplify(e, A.trace() * clifford_unit(mu, A)); e = clifford_unit(nu, A) * clifford_unit(mu, A) * clifford_unit(nu_TOGGLE, A); result += check_equal_simplify_term(e, 2 * indexed(A_symm, sy_symm(), nu_TOGGLE, mu) *clifford_unit(nu, A)-A.trace()*clifford_unit(mu, A), mu); e = clifford_unit(nu, A) * clifford_unit(nu_TOGGLE, A) * clifford_unit(mu, A) * clifford_unit(mu_TOGGLE, A); result += check_equal_simplify(e, pow(A.trace(), 2) * dirac_ONE()); e = clifford_unit(mu, A) * clifford_unit(nu, A) * clifford_unit(nu_TOGGLE, A) * clifford_unit(mu_TOGGLE, A); result += check_equal_simplify(e, pow(A.trace(), 2) * dirac_ONE()); e = clifford_unit(mu, A) * clifford_unit(nu, A) * clifford_unit(mu_TOGGLE, A) * clifford_unit(nu_TOGGLE, A); result += check_equal_simplify_term2(e, 2*indexed(A_symm, sy_symm(), nu_TOGGLE, mu_TOGGLE) * clifford_unit(mu, A) * clifford_unit(nu, A) - pow(A.trace(), 2)*dirac_ONE()); e = clifford_unit(mu_TOGGLE, A) * clifford_unit(nu, A) * clifford_unit(mu, A) * clifford_unit(nu_TOGGLE, A); result += check_equal_simplify_term2(e, 2*indexed(A_symm, nu, mu) * clifford_unit(mu_TOGGLE, A) * clifford_unit(nu_TOGGLE, A) - pow(A.trace(), 2)*dirac_ONE()); e = clifford_unit(nu_TOGGLE, A) * clifford_unit(rho_TOGGLE, A) * clifford_unit(mu, A) * clifford_unit(rho, A) * clifford_unit(nu, A); e = e.simplify_indexed().collect(clifford_unit(mu, A)); result += check_equal_simplify_term(e, 4* indexed(A_symm, sy_symm(), nu_TOGGLE, rho)*indexed(A_symm, sy_symm(), rho_TOGGLE, mu) *clifford_unit(nu, A) - 2*A.trace() * (clifford_unit(rho, A) * indexed(A_symm, sy_symm(), rho_TOGGLE, mu) + clifford_unit(nu, A) * indexed(A_symm, sy_symm(), nu_TOGGLE, mu)) + pow(A.trace(),2)* clifford_unit(mu, A), mu); e = clifford_unit(nu_TOGGLE, A) * clifford_unit(rho, A) * clifford_unit(mu, A) * clifford_unit(rho_TOGGLE, A) * clifford_unit(nu, A); e = e.simplify_indexed().collect(clifford_unit(mu, A)); result += check_equal_simplify_term(e, 4* indexed(A_symm, sy_symm(), nu_TOGGLE, rho)*indexed(A_symm, sy_symm(), rho_TOGGLE, mu) *clifford_unit(nu, A) - 2*A.trace() * (clifford_unit(rho, A) * indexed(A_symm, sy_symm(), rho_TOGGLE, mu) + clifford_unit(nu, A) * indexed(A_symm, sy_symm(), nu_TOGGLE, mu)) + pow(A.trace(),2)* clifford_unit(mu, A), mu); e = clifford_unit(mu, A) * clifford_unit(nu, A) + clifford_unit(nu, A) * clifford_unit(mu, A); result += check_equal(canonicalize_clifford(e), 2*dirac_ONE()*indexed(A_symm, sy_symm(), mu, nu)); e = (clifford_unit(mu, A) * clifford_unit(nu, A) * clifford_unit(lam, A) + clifford_unit(nu, A) * clifford_unit(lam, A) * clifford_unit(mu, A) + clifford_unit(lam, A) * clifford_unit(mu, A) * clifford_unit(nu, A) - clifford_unit(nu, A) * clifford_unit(mu, A) * clifford_unit(lam, A) - clifford_unit(lam, A) * clifford_unit(nu, A) * clifford_unit(mu, A) - clifford_unit(mu, A) * clifford_unit(lam, A) * clifford_unit(nu, A)) / 6 + indexed(A_symm, sy_symm(), mu, nu) * clifford_unit(lam, A) - indexed(A_symm, sy_symm(), mu, lam) * clifford_unit(nu, A) + indexed(A_symm, sy_symm(), nu, lam) * clifford_unit(mu, A) - clifford_unit(mu, A) * clifford_unit(nu, A) * clifford_unit(lam, A); result += check_equal(canonicalize_clifford(e), 0); /* lst_to_clifford() and clifford_inverse() check*/ realsymbol s("s"), t("t"), x("x"), y("y"), z("z"); ex c = clifford_unit(nu, A, 1); e = lst_to_clifford(lst{t, x, y, z}, mu, A, 1) * lst_to_clifford(lst{1, 2, 3, 4}, c); e1 = clifford_inverse(e); result += check_equal_simplify_term2((e*e1).simplify_indexed(), dirac_ONE(1)); /* lst_to_clifford() and clifford_to_lst() check for vectors*/ e = lst{t, x, y, z}; result += check_equal_lst(clifford_to_lst(lst_to_clifford(e, c), c, false), e); result += check_equal_lst(clifford_to_lst(lst_to_clifford(e, c), c, true), e); /* lst_to_clifford() and clifford_to_lst() check for pseudovectors*/ e = lst{s, t, x, y, z}; result += check_equal_lst(clifford_to_lst(lst_to_clifford(e, c), c, false), e); result += check_equal_lst(clifford_to_lst(lst_to_clifford(e, c), c, true), e); /* Moebius map (both forms) checks for symmetric metrics only */ c = clifford_unit(nu, A); e = clifford_moebius_map(0, dirac_ONE(), dirac_ONE(), 0, lst{t, x, y, z}, A); /* this is just the inversion*/ matrix M1 = {{0, dirac_ONE()}, {dirac_ONE(), 0}}; e1 = clifford_moebius_map(M1, lst{t, x, y, z}, A); /* the inversion again*/ result += check_equal_lst(e, e1); e1 = clifford_to_lst(clifford_inverse(lst_to_clifford(lst{t, x, y, z}, mu, A)), c); result += check_equal_lst(e, e1); e = clifford_moebius_map(dirac_ONE(), lst_to_clifford(lst{1, 2, 3, 4}, nu, A), 0, dirac_ONE(), lst{t, x, y, z}, A); /*this is just a shift*/ matrix M2 = {{dirac_ONE(), lst_to_clifford(lst{1, 2, 3, 4}, c),}, {0, dirac_ONE()}}; e1 = clifford_moebius_map(M2, lst{t, x, y, z}, c); /* the same shift*/ result += check_equal_lst(e, e1); result += check_equal(e, lst{t+1, x+2, y+3, z+4}); /* Check the group law for Moebius maps */ e = clifford_moebius_map(M1, ex_to(e1), c); /*composition of M1 and M2*/ e1 = clifford_moebius_map(M1.mul(M2), lst{t, x, y, z}, c); /* the product M1*M2*/ result += check_equal_lst(e, e1); return result; } static unsigned clifford_check7(const ex & G, const symbol & dim) { // checks general identities and contractions unsigned result = 0; varidx mu(symbol("mu"), dim), nu(symbol("nu"), dim), rho(symbol("rho"), dim), psi(symbol("psi"),dim), lam(symbol("lambda"), dim), xi(symbol("xi"), dim); ex e; clifford unit = ex_to(clifford_unit(mu, G)); ex scalar = unit.get_metric(varidx(0, dim), varidx(0, dim)); e = dirac_ONE() * dirac_ONE(); result += check_equal(e, dirac_ONE()); e = dirac_ONE() * clifford_unit(mu, G) * dirac_ONE(); result += check_equal(e, clifford_unit(mu, G)); e = clifford_unit(varidx(2, dim), G) * clifford_unit(varidx(1, dim), G) * clifford_unit(varidx(1, dim), G) * clifford_unit(varidx(2, dim), G); result += check_equal(e, dirac_ONE()*pow(scalar, 2)); e = clifford_unit(mu, G) * clifford_unit(nu, G) * clifford_unit(nu.toggle_variance(), G) * clifford_unit(mu.toggle_variance(), G); result += check_equal_simplify(e, pow(dim*scalar, 2) * dirac_ONE()); e = clifford_unit(mu, G) * clifford_unit(nu, G) * clifford_unit(mu.toggle_variance(), G) * clifford_unit(nu.toggle_variance(), G); result += check_equal_simplify(e, (2*dim - pow(dim, 2))*pow(scalar,2)*dirac_ONE()); e = clifford_unit(nu.toggle_variance(), G) * clifford_unit(rho.toggle_variance(), G) * clifford_unit(mu, G) * clifford_unit(rho, G) * clifford_unit(nu, G); e = e.simplify_indexed().collect(clifford_unit(mu, G)); result += check_equal(e, pow(scalar*(dim-2), 2).expand() * clifford_unit(mu, G)); // canonicalize_clifford() checks, only for symmetric metrics if (is_a(ex_to(clifford_unit(mu, G)).get_metric()) && ex_to(ex_to(ex_to(clifford_unit(mu, G)).get_metric()).get_symmetry()).has_symmetry()) { e = clifford_unit(mu, G) * clifford_unit(nu, G) + clifford_unit(nu, G) * clifford_unit(mu, G); result += check_equal(canonicalize_clifford(e), 2*dirac_ONE()*unit.get_metric(nu, mu)); e = (clifford_unit(mu, G) * clifford_unit(nu, G) * clifford_unit(lam, G) + clifford_unit(nu, G) * clifford_unit(lam, G) * clifford_unit(mu, G) + clifford_unit(lam, G) * clifford_unit(mu, G) * clifford_unit(nu, G) - clifford_unit(nu, G) * clifford_unit(mu, G) * clifford_unit(lam, G) - clifford_unit(lam, G) * clifford_unit(nu, G) * clifford_unit(mu, G) - clifford_unit(mu, G) * clifford_unit(lam, G) * clifford_unit(nu, G)) / 6 + unit.get_metric(mu, nu) * clifford_unit(lam, G) - unit.get_metric(mu, lam) * clifford_unit(nu, G) + unit.get_metric(nu, lam) * clifford_unit(mu, G) - clifford_unit(mu, G) * clifford_unit(nu, G) * clifford_unit(lam, G); result += check_equal(canonicalize_clifford(e), 0); } else { e = clifford_unit(mu, G) * clifford_unit(nu, G) + clifford_unit(nu, G) * clifford_unit(mu, G); result += check_equal(canonicalize_clifford(e), dirac_ONE()*(unit.get_metric(mu, nu) + unit.get_metric(nu, mu))); e = (clifford_unit(mu, G) * clifford_unit(nu, G) * clifford_unit(lam, G) + clifford_unit(nu, G) * clifford_unit(lam, G) * clifford_unit(mu, G) + clifford_unit(lam, G) * clifford_unit(mu, G) * clifford_unit(nu, G) - clifford_unit(nu, G) * clifford_unit(mu, G) * clifford_unit(lam, G) - clifford_unit(lam, G) * clifford_unit(nu, G) * clifford_unit(mu, G) - clifford_unit(mu, G) * clifford_unit(lam, G) * clifford_unit(nu, G)) / 6 + half * (unit.get_metric(mu, nu) + unit.get_metric(nu, mu)) * clifford_unit(lam, G) - half * (unit.get_metric(mu, lam) + unit.get_metric(lam, mu)) * clifford_unit(nu, G) + half * (unit.get_metric(nu, lam) + unit.get_metric(lam, nu)) * clifford_unit(mu, G) - clifford_unit(mu, G) * clifford_unit(nu, G) * clifford_unit(lam, G); result += check_equal(canonicalize_clifford(e), 0); } return result; } static unsigned clifford_check8() { unsigned result = 0; realsymbol a("a"), b("b"), x("x"); varidx mu(symbol("mu", "\\mu"), 1); ex e = clifford_unit(mu, diag_matrix({-1})), e0 = e.subs(mu==0); result += ( exp(a*e0)*e0*e0 == -exp(e0*a) ) ? 0 : 1; ex P = color_T(idx(a,8))*color_T(idx(b,8))*(x*dirac_ONE()+sqrt(x-1)*e0); ex P_prime = color_T(idx(a,8))*color_T(idx(b,8))*(x*dirac_ONE()-sqrt(x-1)*e0); result += check_equal(clifford_prime(P), P_prime); result += check_equal(clifford_star(P), P); result += check_equal(clifford_bar(P), P_prime); return result; } static unsigned clifford_check9() { unsigned result = 0; realsymbol a("a"), b("b"), x("x");; varidx mu(symbol("mu", "\\mu"), 4), nu(symbol("nu", "\\nu"), 4); ex e = clifford_unit(mu, lorentz_g(mu, nu)); ex e0 = e.subs(mu==0); ex e1 = e.subs(mu==1); ex e2 = e.subs(mu==2); ex e3 = e.subs(mu==3); ex one = dirac_ONE(); ex P = color_T(idx(a,8))*color_T(idx(b,8)) *(x*one+sqrt(x-1)*e0+sqrt(x-2)*e0*e1 +sqrt(x-3)*e0*e1*e2 +sqrt(x-4)*e0*e1*e2*e3); ex P_prime = color_T(idx(a,8))*color_T(idx(b,8)) *(x*one-sqrt(x-1)*e0+sqrt(x-2)*e0*e1 -sqrt(x-3)*e0*e1*e2 +sqrt(x-4)*e0*e1*e2*e3); ex P_star = color_T(idx(a,8))*color_T(idx(b,8)) *(x*one+sqrt(x-1)*e0+sqrt(x-2)*e1*e0 +sqrt(x-3)*e2*e1*e0 +sqrt(x-4)*e3*e2*e1*e0); ex P_bar = color_T(idx(a,8))*color_T(idx(b,8)) *(x*one-sqrt(x-1)*e0+sqrt(x-2)*e1*e0 -sqrt(x-3)*e2*e1*e0 +sqrt(x-4)*e3*e2*e1*e0); result += check_equal(clifford_prime(P), P_prime); result += check_equal(clifford_star(P), P_star); result += check_equal(clifford_bar(P), P_bar); return result; } unsigned exam_clifford() { unsigned result = 0; cout << "examining clifford objects" << flush; result += clifford_check1(); cout << '.' << flush; result += clifford_check2(); cout << '.' << flush; result += clifford_check3(); cout << '.' << flush; result += clifford_check4(); cout << '.' << flush; result += clifford_check5(); cout << '.' << flush; // anticommuting, symmetric examples result += clifford_check6(ex_to(diag_matrix({-1, 1, 1, 1}))); result += clifford_check6(ex_to(diag_matrix({-1, 1, 1, 1})));; cout << '.' << flush; result += clifford_check6(ex_to(diag_matrix({-1, -1, -1, -1})))+clifford_check6(ex_to(diag_matrix({-1, -1, -1, -1})));; cout << '.' << flush; result += clifford_check6(ex_to(diag_matrix({-1, 1, 1, -1})))+clifford_check6(ex_to(diag_matrix({-1, 1, 1, -1})));; cout << '.' << flush; result += clifford_check6(ex_to(diag_matrix({-1, 0, 1, -1})))+clifford_check6(ex_to(diag_matrix({-1, 0, 1, -1})));; cout << '.' << flush; result += clifford_check6(ex_to(diag_matrix({-3, 0, 2, -1})))+clifford_check6(ex_to(diag_matrix({-3, 0, 2, -1})));; cout << '.' << flush; realsymbol s("s"), t("t"); // symbolic entries in matrix result += clifford_check6(ex_to(diag_matrix({-1, 1, s, t})))+clifford_check6(ex_to(diag_matrix({-1, 1, s, t})));; cout << '.' << flush; matrix A(4, 4); A = {{1, 0, 0, 0}, // anticommuting, not symmetric, Tr=0 {0, -1, 0, 0}, {0, 0, 0, -1}, {0, 0, 1, 0}}; result += clifford_check6(A)+clifford_check6(A);; cout << '.' << flush; A = {{1, 0, 0, 0}, // anticommuting, not symmetric, Tr=2 {0, 1, 0, 0}, {0, 0, 0, -1}, {0, 0, 1, 0}}; result += clifford_check6(A)+clifford_check6(A);; cout << '.' << flush; A = {{1, 0, 0, 0}, // not anticommuting, symmetric, Tr=0 {0, -1, 0, 0}, {0, 0, 0, -1}, {0, 0, -1, 0}}; result += clifford_check6(A)+clifford_check6(A);; cout << '.' << flush; A = {{1, 0, 0, 0}, // not anticommuting, symmetric, Tr=2 {0, 1, 0, 0}, {0, 0, 0, -1}, {0, 0, -1, 0}}; result += clifford_check6(A)+clifford_check6(A);; cout << '.' << flush; A = {{1, 1, 0, 0}, // not anticommuting, not symmetric, Tr=4 {0, 1, 1, 0}, {0, 0, 1, 1}, {0, 0, 0, 1}}; result += clifford_check6(A)+clifford_check6(A);; cout << '.' << flush; symbol dim("D"); result += clifford_check7(minkmetric(), dim); cout << '.' << flush; varidx chi(symbol("chi"), dim), xi(symbol("xi"), dim); result += clifford_check7(delta_tensor(xi, chi), dim); cout << '.' << flush; result += clifford_check7(lorentz_g(xi, chi), dim); cout << '.' << flush; result += clifford_check7(indexed(-2*minkmetric(), sy_symm(), xi, chi), dim); cout << '.' << flush; result += clifford_check7(-2*delta_tensor(xi, chi), dim); cout << '.' << flush; result += clifford_check8(); cout << '.' << flush; result += clifford_check9(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return exam_clifford(); } ginac-1.7.8.orig/check/exam_color.cpp0000644000000000000000000001276313457611471014370 0ustar /** @file exam_color.cpp * * Here we test GiNaC's color objects (su(3) Lie algebra). */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; static unsigned check_equal(const ex &e1, const ex &e2) { ex e = e1 - e2; if (!e.is_zero()) { clog << e1 << "-" << e2 << " erroneously returned " << e << " instead of 0" << endl; return 1; } return 0; } static unsigned check_equal_simplify(const ex &e1, const ex &e2) { ex e = simplify_indexed(e1) - e2; if (!e.is_zero()) { clog << "simplify_indexed(" << e1 << ")-" << e2 << " erroneously returned " << e << " instead of 0" << endl; return 1; } return 0; } static unsigned color_check1() { // checks general identities and contractions of the structure constants unsigned result = 0; idx a(symbol("a"), 8), b(symbol("b"), 8), c(symbol("c"), 8), d(symbol("d"), 8); result += check_equal(color_d(a, c, a), 0); result += check_equal_simplify(color_d(a, b, c) * color_d(b, d, c), numeric(5,3) * delta_tensor(a, d)); result += check_equal_simplify(color_d(idx(5, 8), b, c) * color_d(b, idx(5, 8), c), numeric(5,3)); result += check_equal_simplify(color_d(a, b, c) * color_d(b, c, a), numeric(40,3)); result += check_equal_simplify(color_d(a, b, c) * color_f(b, d, c), 0); result += check_equal_simplify(color_d(a, b, c) * color_f(b, c, a), 0); result += check_equal_simplify(color_f(a, b, c) * color_f(b, c, a), 24); result += check_equal_simplify(color_f(a, b, c) * color_f(b, d, c), -3 * delta_tensor(a, d)); result += check_equal_simplify(color_h(a, b, c) * color_h(a, b, c), numeric(-32,3)); result += check_equal_simplify(color_h(a, b, c) * color_h(b, a, c), numeric(112,3)); ex e = color_h(a, b, c) * color_h(a, b, c); ex sum = 0; for (int i=1; i<9; i++) for (int j=1; j<9; j++) for (int k=1; k<9; k++) sum += e.subs(lst{a == i, b == j, c == k}); if (!sum.is_equal(numeric(-32,3))) { clog << "numeric contraction of " << e << " erroneously returned " << sum << " instead of -32/3" << endl; result++; } return result; } static unsigned color_check2() { // checks general identities and contractions of the generators unsigned result = 0; idx a(symbol("a"), 8), b(symbol("b"), 8), c(symbol("c"), 8), k(symbol("k"), 8); ex e; e = color_T(k) * color_T(k); result += check_equal_simplify(e, 4 * color_ONE() / 3); e = color_T(k) * color_T(a) * color_T(k); result += check_equal_simplify(e, -color_T(a) / 6); e = color_T(k) * color_T(a) * color_T(b) * color_T(k); result += check_equal_simplify(e, delta_tensor(a, b) * color_ONE() / 4 - color_T(a) * color_T(b) / 6); e = color_T(k) * color_T(a) * color_T(b) * color_T(c) * color_T(k); result += check_equal_simplify(e, (color_h(a, b, c) * color_ONE() / 8).expand() - color_T(a) * color_T(b) * color_T(c) / 6); e = color_T(a) * color_T(b) * color_T(a) * color_T(b); result += check_equal_simplify(e, -2 * color_ONE() / 9); e = color_T(a) * color_T(b) * color_T(b) * color_T(a); result += check_equal_simplify(e, 16 * color_ONE() / 9); e = color_T(a) * color_T(b) * color_T(c) * color_T(c) * color_T(b) * color_T(a); result += check_equal_simplify(e, 64 * color_ONE() / 27); e = color_T(a) * color_T(b) * color_T(c) * color_T(k) * color_T(a) * color_T(k) * color_T(c) * color_T(b); result += check_equal_simplify(e, -color_ONE() / 162); return result; } static unsigned color_check3() { // checks traces unsigned result = 0; idx a(symbol("a"), 8), b(symbol("b"), 8), c(symbol("c"), 8); ex e; e = color_ONE(); result += check_equal(color_trace(e), 3); e = color_T(a); result += check_equal(color_trace(e), 0); e = color_T(a) * color_T(b); result += check_equal(color_trace(e), delta_tensor(a, b) / 2); e = color_T(a) * color_T(b) * color_T(c); result += check_equal(color_trace(e), color_h(a, b, c) / 4); e = color_ONE(0) * color_ONE(1) / 9; result += check_equal(color_trace(e, 0), color_ONE(1) / 3); result += check_equal(color_trace(e, 1), color_ONE(0) / 3); result += check_equal(color_trace(e, 2), e); result += check_equal(color_trace(e, lst{0, 1}), 1); e = color_T(a, 0) * color_T(a, 1) * color_T(b, 0) * color_T(b, 1); result += check_equal_simplify(color_trace(e, 0), 2 * color_ONE(1) / 3); result += check_equal_simplify(color_trace(e, 1), 2 * color_ONE(0) / 3); result += check_equal_simplify(color_trace(e, 2), e); result += check_equal_simplify(color_trace(e, lst{0, 1}), 2); return result; } unsigned exam_color() { unsigned result = 0; cout << "examining color objects" << flush; result += color_check1(); cout << '.' << flush; result += color_check2(); cout << '.' << flush; result += color_check3(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return exam_color(); } ginac-1.7.8.orig/check/exam_cra.cpp0000644000000000000000000001007413457611471014010 0ustar /** @file exam_cra.cpp * * Test of Chinese remainder algorithm. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "polynomial/cra_garner.h" #include #include #include #include using namespace cln; #include #include #include #include #include #include using namespace std; /// Generate a sequences of primes p_i such that \prod_i p_i < limit static std::vector make_random_moduli(const cln::cl_I& limit); static std::vector calc_residues(const cln::cl_I& x, const std::vector& moduli); static void dump(const std::vector& v); /// Make @a n random relatively prime moduli, each < limit, make a /// random number x < \prod_{i=0}{n-1}, calculate residues, and /// compute x' by chinese remainder algorithm. Check if the result /// of computation matches the original value x. static void run_test_once(const cln::cl_I& lim) { std::vector moduli = make_random_moduli(lim); cln::cl_I x = random_I(lim) + 1; if (x > (lim >> 1)) x = x - lim; std::vector residues = calc_residues(x, moduli); cln::cl_I x_test; bool error = false; try { x_test = integer_cra(residues, moduli); } catch (std::exception& oops) { std::cerr << "Oops: " << oops.what() << std::endl; error = true; } if (x != x_test) error = true; if (error) { std::cerr << "Expected x = " << x << ", got " << x_test << " instead" << std::endl; std::cerr << "moduli = "; dump(moduli); std::cerr << std::endl; std::cerr << "residues = "; dump(residues); std::cerr << std::endl; throw std::logic_error("bug in integer_cra?"); } } static void run_test(const cln::cl_I& limit, const std::size_t ntimes) { for (std::size_t i = 0; i < ntimes; ++i) run_test_once(limit); } int main(int argc, char** argv) { typedef std::map map_t; map_t the_map; // Run 1024 tests with native 32-bit numbers the_map[cln::cl_I(std::numeric_limits::max())] = 1024; // Run 512 tests with native 64-bit integers if (sizeof(long) > sizeof(int)) the_map[cln::cl_I(std::numeric_limits::max())] = 512; // Run 32 tests with a bit bigger numbers the_map[cln::cl_I("987654321098765432109876543210")] = 32; std::cout << "examining Garner's integer chinese remainder algorithm " << std::flush; for (map_t::const_iterator i = the_map.begin(); i != the_map.end(); ++i) run_test(i->first, i->second); return 0; } static std::vector calc_residues(const cln::cl_I& x, const std::vector& moduli) { std::vector residues(moduli.size()); for (std::size_t i = moduli.size(); i-- != 0; ) residues[i] = mod(x, moduli[i]); return residues; } static std::vector make_random_moduli(const cln::cl_I& limit) { std::vector moduli; cln::cl_I prod(1); cln::cl_I next = random_I(std::min(limit >> 1, cln::cl_I(128))); unsigned count = 0; do { cln::cl_I tmp = nextprobprime(next); next = tmp + random_I(cln::cl_I(10)) + 1; prod = prod*tmp; moduli.push_back(tmp); ++count; } while (prod < limit || (count < 2)); return moduli; } static void dump(const std::vector& v) { std::cerr << "[ "; for (std::size_t i = 0; i < v.size(); ++i) std::cerr << v[i] << " "; std::cerr << "]"; } ginac-1.7.8.orig/check/exam_differentiation.cpp0000644000000000000000000001761413457611471016424 0ustar /** @file exam_differentiation.cpp * * Tests for symbolic differentiation, including various functions. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; static unsigned check_diff(const ex &e, const symbol &x, const ex &d, unsigned nth=1) { ex ed = e.diff(x, nth); if (!(ed - d).is_zero()) { switch (nth) { case 0: clog << "zeroth "; break; case 1: break; case 2: clog << "second "; break; case 3: clog << "third "; break; default: clog << nth << "th "; } clog << "derivative of " << e << " by " << x << " returned " << ed << " instead of " << d << endl; clog << "returned:" << endl; clog << tree << ed << "instead of\n" << d << dflt; return 1; } return 0; } // Simple (expanded) polynomials static unsigned exam_differentiation1() { unsigned result = 0; symbol x("x"), y("y"); ex e1, e2, e, d; // construct bivariate polynomial e to be diff'ed: e1 = pow(x, -2) * 3 + pow(x, -1) * 5 + 7 + x * 11 + pow(x, 2) * 13; e2 = pow(y, -2) * 5 + pow(y, -1) * 7 + 11 + y * 13 + pow(y, 2) * 17; e = (e1 * e2).expand(); // d e / dx: d = ex("121-55/x^2-66/x^3-30/x^3/y^2-42/x^3/y-78/x^3*y-102/x^3*y^2-25/x^2/y^2-35/x^2/y-65/x^2*y-85/x^2*y^2+77/y+143*y+187*y^2+130*x/y^2+182/y*x+338*x*y+442*x*y^2+55/y^2+286*x",lst{x,y}); result += check_diff(e, x, d); // d e / dy: d = ex("91-30/x^2/y^3-21/x^2/y^2+39/x^2+102/x^2*y-50/x/y^3-35/x/y^2+65/x+170/x*y-77*x/y^2+143*x+374*x*y-130/y^3*x^2-91/y^2*x^2+169*x^2+442*x^2*y-110/y^3*x-70/y^3+238*y-49/y^2",lst{x,y}); result += check_diff(e, y, d); // d^2 e / dx^2: d = ex("286+90/x^4/y^2+126/x^4/y+234/x^4*y+306/x^4*y^2+50/x^3/y^2+70/x^3/y+130/x^3*y+170/x^3*y^2+130/y^2+182/y+338*y+442*y^2+198/x^4+110/x^3",lst{x,y}); result += check_diff(e, x, d, 2); // d^2 e / dy^2: d = ex("238+90/x^2/y^4+42/x^2/y^3+102/x^2+150/x/y^4+70/x/y^3+170/x+330*x/y^4+154*x/y^3+374*x+390*x^2/y^4+182*x^2/y^3+442*x^2+210/y^4+98/y^3",lst{x,y}); result += check_diff(e, y, d, 2); return result; } // Trigonometric functions static unsigned exam_differentiation2() { unsigned result = 0; symbol x("x"), y("y"), a("a"), b("b"); ex e1, e2, e, d; // construct expression e to be diff'ed: e1 = y*pow(x, 2) + a*x + b; e2 = sin(e1); e = b*pow(e2, 2) + y*e2 + a; d = 2*b*e2*cos(e1)*(2*x*y + a) + y*cos(e1)*(2*x*y + a); result += check_diff(e, x, d); d = 2*b*pow(cos(e1),2)*pow(2*x*y + a, 2) + 4*b*y*e2*cos(e1) - 2*b*pow(e2,2)*pow(2*x*y + a, 2) - y*e2*pow(2*x*y + a, 2) + 2*pow(y,2)*cos(e1); result += check_diff(e, x, d, 2); d = 2*b*e2*cos(e1)*pow(x, 2) + e2 + y*cos(e1)*pow(x, 2); result += check_diff(e, y, d); d = 2*b*pow(cos(e1),2)*pow(x,4) - 2*b*pow(e2,2)*pow(x,4) + 2*cos(e1)*pow(x,2) - y*e2*pow(x,4); result += check_diff(e, y, d, 2); // construct expression e to be diff'ed: e2 = cos(e1); e = b*pow(e2, 2) + y*e2 + a; d = -2*b*e2*sin(e1)*(2*x*y + a) - y*sin(e1)*(2*x*y + a); result += check_diff(e, x, d); d = 2*b*pow(sin(e1),2)*pow(2*y*x + a,2) - 4*b*e2*sin(e1)*y - 2*b*pow(e2,2)*pow(2*y*x + a,2) - y*e2*pow(2*y*x + a,2) - 2*pow(y,2)*sin(e1); result += check_diff(e, x, d, 2); d = -2*b*e2*sin(e1)*pow(x,2) + e2 - y*sin(e1)*pow(x, 2); result += check_diff(e, y, d); d = -2*b*pow(e2,2)*pow(x,4) + 2*b*pow(sin(e1),2)*pow(x,4) - 2*sin(e1)*pow(x,2) - y*e2*pow(x,4); result += check_diff(e, y, d, 2); return result; } // exp function static unsigned exam_differentiation3() { unsigned result = 0; symbol x("x"), y("y"), a("a"), b("b"); ex e1, e2, e, d; // construct expression e to be diff'ed: e1 = y*pow(x, 2) + a*x + b; e2 = exp(e1); e = b*pow(e2, 2) + y*e2 + a; d = 2*b*pow(e2, 2)*(2*x*y + a) + y*e2*(2*x*y + a); result += check_diff(e, x, d); d = 4*b*pow(e2,2)*pow(2*y*x + a,2) + 4*b*pow(e2,2)*y + 2*pow(y,2)*e2 + y*e2*pow(2*y*x + a,2); result += check_diff(e, x, d, 2); d = 2*b*pow(e2,2)*pow(x,2) + e2 + y*e2*pow(x,2); result += check_diff(e, y, d); d = 4*b*pow(e2,2)*pow(x,4) + 2*e2*pow(x,2) + y*e2*pow(x,4); result += check_diff(e, y, d, 2); return result; } // log functions static unsigned exam_differentiation4() { unsigned result = 0; symbol x("x"), y("y"), a("a"), b("b"); ex e1, e2, e, d; // construct expression e to be diff'ed: e1 = y*pow(x, 2) + a*x + b; e2 = log(e1); e = b*pow(e2, 2) + y*e2 + a; d = 2*b*e2*(2*x*y + a)/e1 + y*(2*x*y + a)/e1; result += check_diff(e, x, d); d = 2*b*pow((2*x*y + a),2)*pow(e1,-2) + 4*b*y*e2/e1 - 2*b*e2*pow(2*x*y + a,2)*pow(e1,-2) + 2*pow(y,2)/e1 - y*pow(2*x*y + a,2)*pow(e1,-2); result += check_diff(e, x, d, 2); d = 2*b*e2*pow(x,2)/e1 + e2 + y*pow(x,2)/e1; result += check_diff(e, y, d); d = 2*b*pow(x,4)*pow(e1,-2) - 2*b*e2*pow(e1,-2)*pow(x,4) + 2*pow(x,2)/e1 - y*pow(x,4)*pow(e1,-2); result += check_diff(e, y, d, 2); return result; } // Functions with two variables static unsigned exam_differentiation5() { unsigned result = 0; symbol x("x"), y("y"), a("a"), b("b"); ex e1, e2, e, d; // test atan2 e1 = y*pow(x, 2) + a*x + b; e2 = x*pow(y, 2) + b*y + a; e = atan2(e1,e2); d = pow(y,2)*pow(pow(b+y*pow(x,2)+x*a,2)+pow(y*b+pow(y,2)*x+a,2),-1)* (-b-y*pow(x,2)-x*a) +pow(pow(b+y*pow(x,2)+x*a,2)+pow(y*b+pow(y,2)*x+a,2),-1)* (y*b+pow(y,2)*x+a)*(2*y*x+a); result += check_diff(e, x, d); return result; } // Series static unsigned exam_differentiation6() { symbol x("x"); ex e, d, ed; e = sin(x).series(x==0, 8); d = cos(x).series(x==0, 7); ed = e.diff(x); ed = series_to_poly(ed); d = series_to_poly(d); if (!(ed - d).is_zero()) { clog << "derivative of " << e << " by " << x << " returned " << ed << " instead of " << d << ")" << endl; return 1; } return 0; } // Hashing can help a lot, if differentiation is done cleverly static unsigned exam_differentiation7() { symbol x("x"); ex P = x + pow(x,3); ex e = (P.diff(x) / P).diff(x, 2); ex d = 6/P - 18*x/pow(P,2) - 54*pow(x,3)/pow(P,2) + 2/pow(P,3) +18*pow(x,2)/pow(P,3) + 54*pow(x,4)/pow(P,3) + 54*pow(x,6)/pow(P,3); if (!(e-d).expand().is_zero()) { clog << "expanded second derivative of " << (P.diff(x) / P) << " by " << x << " returned " << e.expand() << " instead of " << d << endl; return 1; } if (e.nops() > 3) { clog << "second derivative of " << (P.diff(x) / P) << " by " << x << " has " << e.nops() << " operands. " << "The result is still correct but not optimal: 3 are enough! " << "(Hint: maybe the product rule for objects of class mul should be more careful about assembling the result?)" << endl; return 1; } return 0; } unsigned exam_differentiation() { unsigned result = 0; cout << "examining symbolic differentiation" << flush; result += exam_differentiation1(); cout << '.' << flush; result += exam_differentiation2(); cout << '.' << flush; result += exam_differentiation3(); cout << '.' << flush; result += exam_differentiation4(); cout << '.' << flush; result += exam_differentiation5(); cout << '.' << flush; result += exam_differentiation6(); cout << '.' << flush; result += exam_differentiation7(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return exam_differentiation(); } ginac-1.7.8.orig/check/exam_factor.cpp0000644000000000000000000002150713457611471014524 0ustar /** @file exam_factor.cpp * * Factorization test suite. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; static symbol w("w"), x("x"), y("y"), z("z"); static unsigned check_factor(const ex& e) { ex ee = e.expand(); ex answer = factor(ee); if ( answer.expand() != ee || answer != e ) { clog << "factorization of " << e << " == " << ee << " gave wrong result: " << answer << endl; return 1; } return 0; } static unsigned exam_factor1() { unsigned result = 0; ex e; symbol x("x"); lst syms; syms.append(x); e = ex("1+x-x^3", syms); result += check_factor(e); e = ex("1+x^6+x", syms); result += check_factor(e); e = ex("1-x^6+x", syms); result += check_factor(e); e = ex("(1+x)^3", syms); result += check_factor(e); e = ex("(x+1)*(x+4)", syms); result += check_factor(e); e = ex("x^6-3*x^5+x^4-3*x^3-x^2-3*x+1", syms); result += check_factor(e); e = ex("(-1+x)^3*(1+x)^3*(1+x^2)", syms); result += check_factor(e); e = ex("-(-168+20*x-x^2)*(30+x)", syms); result += check_factor(e); e = ex("x^2*(x-3)^2*(x^3-5*x+7)", syms); result += check_factor(e); e = ex("-6*x^2*(x-3)", syms); result += check_factor(e); e = ex("x^16+11*x^4+121", syms); result += check_factor(e); e = ex("x^8-40*x^6+352*x^4-960*x^2+576", syms); result += check_factor(e); e = ex("x*(2+x^2)*(1+x+x^3+x^2+x^6+x^5+x^4)*(1+x)^2*(1-x+x^2)^2*(-1+x)", syms); result += check_factor(e); e = ex("(x+4+x^2-x^3+43*x^4)*(x+1-x^2-3*x^3+4*x^4)", syms); result += check_factor(e); e = ex("-x^2*(x-1)*(1+x^2)", syms); result += check_factor(e); e = x; result += check_factor(e); // x^37 + 1 e = ex("(1+x)*(1+x^2-x^29-x^11-x^25-x^9-x^35+x^20-x^3+x^16-x^15-x-x^13+x^28+x^24-x^33+x^8-x^19+x^36+x^12-x^27+x^10-x^23+x^18+x^14+x^34-x^31+x^32+x^30-x^5+x^26+x^4+x^22-x^21-x^7-x^17+x^6)", syms); result += check_factor(e); e = ex("(1+4*x)*x^2*(1-4*x+16*x^2)*(3+5*x+92*x^3)", syms); result += check_factor(e); e = ex("(77+11*x^3+25*x^2+27*x+102*x^4)*(85+57*x^3+92*x^2+29*x+66*x^4)", syms); result += check_factor(e); return result; } static unsigned exam_factor2() { unsigned result = 0; ex e; symbol x("x"), y("y"), z("z"); lst syms = {x, y, z}; e = ex("x+y", syms); result += check_factor(e); e = ex("(x^2-y+1)*(x+y)", syms); result += check_factor(e); e = ex("-2*(x+y)*(x-y)", syms); result += check_factor(e); e = ex("(16+x^2*z^3)*(-17+3*x-5*z)*(2*x+3*z)*(x-y^2-z^3)", syms); result += check_factor(e); e = ex("(x-y*z)*(x-y^2-z^3)*(x+y+z)", syms); result += check_factor(e); e = ex("-(y^2-x+z^3)*x*(x+y+z)", syms); result += check_factor(e); e = ex("-316*(3*x-4*z)*(2*x+3*z)*(x+y)*(-1+x)", syms); result += check_factor(e); e = ex("(x+x^3+z^2)*(3*x-4*z)", syms); result += check_factor(e); e = ex("250*(-3+x)*(4*z-3*x)*(x^3+z^2+x)*x", syms); result += check_factor(e); e = ex("327*(x+z^2+x^3)*(3*x-4*z)*(-7+5*x-x^3)*(1+x+x^2)", syms); result += check_factor(e); e = ex("x-y^2-z^3", syms); result += check_factor(e); e = ex("-390*(7+3*x^4)*(2+x^2)*(x-z^3-y^2)", syms); result += check_factor(e); e = ex("55*(1+x)^2*(3*x-4*z)*(1+x+x^2)*(x+x^3+z^2)", syms); result += check_factor(e); e = ex("x+y*x-1", syms); result += check_factor(e); e = ex("390*(-1+x^6-x)*(7+3*x^4)*(2+x^2)*(y+x)*(-1+y-x^2)*(1+x^2+x)^2", syms); result += check_factor(e); e = ex("310*(y+x)*(-1+y-x^2)", syms); result += check_factor(e); return result; } static unsigned exam_factor3() { unsigned result = 0; ex e; symbol k("k"), n("n"); lst syms = {k, n}; e = ex("1/2*(-3+3*k-n)*(-2+3*k-n)*(-1+3*k-n)", syms); result += check_factor(e); e = ex("1/4*(2*k-n)*(-1+2*k-n)", syms); result += check_factor(e); return result; } static unsigned check_factor_expanded(const ex& e) { ex ee = e.expand(); ex answer = factor(ee); if ( answer.expand() != ee || (!is_a(answer) && !is_a(answer)) ) { clog << "factorization of " << e << " == " << ee << " gave wrong result: " << answer << endl; return 1; } return 0; } static unsigned exam_factor_wang() { // these 15 polynomials are from the appendix of P.S.Wang, // "An Improved Multivariate Polynomial Factoring Algorithm" unsigned result = 0; ex e; symbol x("x"), y("y"), z("z"), u("u"); e = ex("(z+x*y+10)*(x*z+y+30)*(y*z+x+20)", lst{x, y, z}); result += check_factor_expanded(e); e = ex("(x^3*(z+y)+y-11)*(x^2*(z^2+y^2)+y+90)", lst{x, y, z}); result += check_factor_expanded(e); e = ex("(y*z^3+x*y*z+y^2+x^3)*(x*(z^4+1)+z+x^3*y^2)", lst{x, y, z}); result += check_factor_expanded(e); e = ex("(z^2-x^3*y+3)*(z^2+x*y^3)*(z^2+x^3*y^4)*(y^4*z^2+x^2*z+5)", lst{x, y, z}); result += check_factor_expanded(e); e = ex("(z^2+x^3*y^4+u^2)*((y^2+x)*z^2+3*u^2*x^3*y^4*z+19*y^2)*(u^2*y^4*z^2+x^2*z+5)", lst{u, x, y, z}); result += check_factor_expanded(e); e = ex("(w^4*z^3-x*y^2*z^2-w^4*x^5*y^6-w^2*x^3*y)*(-x^5*z^3+y*z+x^2*y^3)" "*(w^4*z^6+y^2*z^3-w^2*x^2*y^2*z^2+x^5*z-x^4*y^2-w^3*x^3*y)", lst{w, x, y, z}); result += check_factor_expanded(e); e = ex("(z+y+x-3)^3*(z+y+x-2)^2", lst{x, y, z}); result += check_factor_expanded(e); e = ex("(-15*y^2*z^16+29*w^4*x^12*y^12*z^3+21*x^3*z^2+3*w^15*y^20)" "*(-z^31-w^12*z^20+y^18-y^14+x^2*y^2+x^21+w^2)", lst{w, x, y, z}); result += check_factor_expanded(e); e = ex("u^4*x*z^2*(6*w^2*y^3*z^2+18*u^2*w^3*x*z^2+15*u*z^2+10*u^2*w*x*y^3)" "*(-44*u*w*x*y^4*z^4-25*u^2*w^3*y*z^4+8*u*w*x^3*z^4-32*u^2*w^4*y^4*z^3" "+48*u^2*x^2*y^3*z^3-12*y^3*z^2+2*u^2*w*x^2*y^2-11*u*w^2*x^3*y-4*w^2*x)", lst{u, w, x, y, z}); result += check_factor_expanded(e); e = ex("(31*u^2*x*z+35*w^2*y^2+6*x*y+40*w*x^2)*(u^2*w^2*x*y^2*z^2+24*u^2*w*x*y^2*z^2" "+12*u^2*x*y^2*z^2+24*u^2*x^2*y*z^2+43*w*x*y*z^2+31*w^2*y*z^2+8*u^2*w^2*z^2" "+44*u*w^2*z^2+37*u^2*y^2*z+41*y^2*z+12*w*x^2*y*z+21*u^2*w*x*y*z+23*x*y*z" "+47*u^2*w^2*z+13*u*w^2*x^2*y^2+22*x*y^2+42*u^2*w^2*y^2+29*w^2*y^2+27*u*w^2*x^2*y" "+37*w^2*x*z+39*u*w*x*z+43*u*x^2*y+24*x*y+9*u^2*w*x^2+22*u^2*w^2)", lst{u, w, x, y, z}); result += check_factor_expanded(e); e = ex("x*y*(-13*u^3*w^2*x*y*z^3+w^3*z^3+4*u*x*y^2+47*x*y)" "*(43*u*x^3*y^3*z^3+36*u^2*w^3*x*y*z^3+14*w^3*x^3*y^3*z^2-29*w^3*x*y^3*z^2" "-20*u^2*w^2*x^2*y^2*z^2+36*u^2*w*x*y^3*z-48*u*x^3*y^2*z+5*u*w*x^2*y^3" "+36*u*w^2*y^3-9*u*w*y^3-23*u*w*x^3*y^2+46*u*x^3*y^2+8*x*y^2+31*u^2*w^3*y^2" "-9*u^2*y^2+45*x^3-46*u^2*w*x)", lst{u, w, x, y, z}); result += check_factor_expanded(e); e = ex("(z+y+x-3)^3", lst{x, y, z}); result += check_factor_expanded(e); e = ex("(3*z^3+2*w*z-9*y^3-y^2+45*x^3)*(w^2*z^3+47*x*y-w^2)", lst{w, x, y, z}); result += check_factor_expanded(e); e = ex("(-18*x^4*y^5+22*y^5-26*x^3*y^4-38*x^2*y^4+29*x^2*y^3-41*x^4*y^2+37*x^4)" "*(33*x^5*y^6+11*y^2+35*x^3*y-22*x^4)", lst{x, y, z}); result += check_factor_expanded(e); e = ex("x^6*y^3*z^2*(3*z^3+2*w*z-8*x*y^2+14*w^2*y^2-y^2+18*x^3*y)" "*(-12*w^2*x*y*z^3+w^2*z^3+3*x*y^2+29*x-w^2)", lst{w, x, y, z}); result += check_factor_expanded(e); return result; } static unsigned check_factorization(const exvector& factors) { ex e = dynallocate(factors); ex ef = factor(e.expand()); if (ef.nops() != factors.size()) { clog << "wrong number of factors, expected " << factors.size() << ", got " << ef.nops(); return 1; } for (size_t i = 0; i < ef.nops(); ++i) { if (find(factors.begin(), factors.end(), ef.op(i)) == factors.end()) { clog << "wrong factorization: term not found: " << ef.op(i); return 1; } } return 0; } static unsigned factor_integer_content_bug() { parser reader; exvector factors; factors.push_back(reader("x+y+x*y")); factors.push_back(reader("3*x+2*y")); return check_factorization(factors); } unsigned exam_factor() { unsigned result = 0; cout << "examining polynomial factorization" << flush; result += exam_factor1(); cout << '.' << flush; result += exam_factor2(); cout << '.' << flush; result += exam_factor3(); cout << '.' << flush; result += exam_factor_wang(); cout << '.' << flush; result += factor_integer_content_bug(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return exam_factor(); } ginac-1.7.8.orig/check/exam_indexed.cpp0000644000000000000000000003620013457611471014662 0ustar /** @file exam_indexed.cpp * * Here we test manipulations on GiNaC's indexed objects. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; static unsigned check_equal(const ex &e1, const ex &e2) { ex e = e1 - e2; if (!e.is_zero()) { clog << e1 << "-" << e2 << " erroneously returned " << e << " instead of 0" << endl; return 1; } return 0; } static unsigned check_equal_simplify(const ex &e1, const ex &e2) { ex e = simplify_indexed(e1) - e2; if (!e.is_zero()) { clog << "simplify_indexed(" << e1 << ")-" << e2 << " erroneously returned " << e << " instead of 0" << endl; return 1; } return 0; } static unsigned check_equal_simplify(const ex &e1, const ex &e2, const scalar_products &sp) { ex e = simplify_indexed(e1, sp) - e2; if (!e.is_zero()) { clog << "simplify_indexed(" << e1 << ")-" << e2 << " erroneously returned " << e << " instead of 0" << endl; return 1; } return 0; } static unsigned delta_check() { // checks identities of the delta tensor unsigned result = 0; symbol s_i("i"), s_j("j"), s_k("k"); idx i(s_i, 3), j(s_j, 3), k(s_k, 3); symbol A("A"); // symmetry result += check_equal(delta_tensor(i, j), delta_tensor(j, i)); // trace = dimension of index space result += check_equal(delta_tensor(i, i), 3); result += check_equal_simplify(delta_tensor(i, j) * delta_tensor(i, j), 3); // contraction with delta tensor result += check_equal_simplify(delta_tensor(i, j) * indexed(A, k), delta_tensor(i, j) * indexed(A, k)); result += check_equal_simplify(delta_tensor(i, j) * indexed(A, j), indexed(A, i)); result += check_equal_simplify(delta_tensor(i, j) * indexed(A, i), indexed(A, j)); result += check_equal_simplify(delta_tensor(i, j) * delta_tensor(j, k) * indexed(A, i), indexed(A, k)); return result; } static unsigned metric_check() { // checks identities of the metric tensor unsigned result = 0; symbol s_mu("mu"), s_nu("nu"), s_rho("rho"), s_sigma("sigma"); varidx mu(s_mu, 4), nu(s_nu, 4), rho(s_rho, 4), sigma(s_sigma, 4); symbol A("A"); // becomes delta tensor if indices have opposite variance result += check_equal(metric_tensor(mu, nu.toggle_variance()), delta_tensor(mu, nu.toggle_variance())); // scalar contraction = dimension of index space result += check_equal(metric_tensor(mu, mu.toggle_variance()), 4); result += check_equal_simplify(metric_tensor(mu, nu) * metric_tensor(mu.toggle_variance(), nu.toggle_variance()), 4); // contraction with metric tensor result += check_equal_simplify(metric_tensor(mu, nu) * indexed(A, nu), metric_tensor(mu, nu) * indexed(A, nu)); result += check_equal_simplify(metric_tensor(mu, nu) * indexed(A, nu.toggle_variance()), indexed(A, mu)); result += check_equal_simplify(metric_tensor(mu, nu) * indexed(A, mu.toggle_variance()), indexed(A, nu)); result += check_equal_simplify(metric_tensor(mu, nu) * metric_tensor(mu.toggle_variance(), rho.toggle_variance()) * indexed(A, nu.toggle_variance()), indexed(A, rho.toggle_variance())); result += check_equal_simplify(metric_tensor(mu, rho) * metric_tensor(nu, sigma) * indexed(A, rho.toggle_variance(), sigma.toggle_variance()), indexed(A, mu, nu)); result += check_equal_simplify(indexed(A, mu.toggle_variance()) * metric_tensor(mu, nu) - indexed(A, mu.toggle_variance()) * metric_tensor(nu, mu), 0); result += check_equal_simplify(indexed(A, mu.toggle_variance(), nu.toggle_variance()) * metric_tensor(nu, rho), indexed(A, mu.toggle_variance(), rho)); // contraction with delta tensor yields a metric tensor result += check_equal_simplify(delta_tensor(mu, nu.toggle_variance()) * metric_tensor(nu, rho), metric_tensor(mu, rho)); result += check_equal_simplify(metric_tensor(mu, nu) * indexed(A, nu.toggle_variance()) * delta_tensor(mu.toggle_variance(), rho), indexed(A, rho)); return result; } static unsigned epsilon_check() { // checks identities of the epsilon tensor unsigned result = 0; symbol s_mu("mu"), s_nu("nu"), s_rho("rho"), s_sigma("sigma"), s_tau("tau"); symbol d("d"); varidx mu(s_mu, 4), nu(s_nu, 4), rho(s_rho, 4), sigma(s_sigma, 4), tau(s_tau, 4); varidx mu_co(s_mu, 4, true), nu_co(s_nu, 4, true), rho_co(s_rho, 4, true), sigma_co(s_sigma, 4, true), tau_co(s_tau, 4, true); // antisymmetry result += check_equal(lorentz_eps(mu, nu, rho, sigma) + lorentz_eps(sigma, rho, mu, nu), 0); // convolution is zero result += check_equal(lorentz_eps(mu, nu, rho, nu_co), 0); result += check_equal(lorentz_eps(mu, nu, mu_co, nu_co), 0); result += check_equal_simplify(lorentz_g(mu_co, nu_co) * lorentz_eps(mu, nu, rho, sigma), 0); // contraction with symmetric tensor is zero result += check_equal_simplify(lorentz_eps(mu, nu, rho, sigma) * indexed(d, sy_symm(), mu_co, nu_co), 0); result += check_equal_simplify(lorentz_eps(mu, nu, rho, sigma) * indexed(d, sy_symm(), nu_co, sigma_co, rho_co), 0); result += check_equal_simplify(lorentz_eps(mu, nu, rho, sigma) * indexed(d, mu_co) * indexed(d, nu_co), 0); result += check_equal_simplify(lorentz_eps(mu_co, nu, rho, sigma) * indexed(d, mu) * indexed(d, nu_co), 0); ex e = lorentz_eps(mu, nu, rho, sigma) * indexed(d, mu_co) - lorentz_eps(mu_co, nu, rho, sigma) * indexed(d, mu); result += check_equal_simplify(e, 0); // contractions of epsilon tensors result += check_equal_simplify(lorentz_eps(mu, nu, rho, sigma) * lorentz_eps(mu_co, nu_co, rho_co, sigma_co), -24); result += check_equal_simplify(lorentz_eps(tau, nu, rho, sigma) * lorentz_eps(mu_co, nu_co, rho_co, sigma_co), -6 * delta_tensor(tau, mu_co)); return result; } DECLARE_FUNCTION_2P(symm_fcn) REGISTER_FUNCTION(symm_fcn, set_symmetry(sy_symm(0, 1))); DECLARE_FUNCTION_2P(anti_fcn) REGISTER_FUNCTION(anti_fcn, set_symmetry(sy_anti(0, 1))); static unsigned symmetry_check() { // check symmetric/antisymmetric objects unsigned result = 0; idx i(symbol("i"), 3), j(symbol("j"), 3), k(symbol("k"), 3), l(symbol("l"), 3); symbol A("A"), B("B"), C("C"); ex e; result += check_equal(indexed(A, sy_symm(), i, j), indexed(A, sy_symm(), j, i)); result += check_equal(indexed(A, sy_anti(), i, j) + indexed(A, sy_anti(), j, i), 0); result += check_equal(indexed(A, sy_anti(), i, j, k) - indexed(A, sy_anti(), j, k, i), 0); e = indexed(A, sy_symm(), i, j, k) * indexed(B, sy_anti(), l, k, i); result += check_equal_simplify(e, 0); e = indexed(A, sy_symm(), i, i, j, j) * indexed(B, sy_anti(), k, l); // GiNaC 0.8.0 had a bug here result += check_equal_simplify(e, e); symmetry R = sy_symm(sy_anti(0, 1), sy_anti(2, 3)); e = indexed(A, R, i, j, k, l) + indexed(A, R, j, i, k, l); result += check_equal(e, 0); e = indexed(A, R, i, j, k, l) + indexed(A, R, i, j, l, k); result += check_equal(e, 0); e = indexed(A, R, i, j, k, l) - indexed(A, R, j, i, l, k); result += check_equal(e, 0); e = indexed(A, R, i, j, k, l) + indexed(A, R, k, l, j, i); result += check_equal(e, 0); e = indexed(A, i, j); result += check_equal(symmetrize(e) + antisymmetrize(e), e); e = indexed(A, sy_symm(), i, j, k, l); result += check_equal(symmetrize(e), e); result += check_equal(antisymmetrize(e), 0); e = indexed(A, sy_anti(), i, j, k, l); result += check_equal(symmetrize(e), 0); result += check_equal(antisymmetrize(e), e); e = (indexed(A, sy_anti(), i, j, k, l) * (indexed(B, j) * indexed(C, k) + indexed(B, k) * indexed(C, j)) + indexed(B, i, l)).expand(); result += check_equal_simplify(e, indexed(B, i, l)); result += check_equal(symm_fcn(0, 1) + symm_fcn(1, 0), 2*symm_fcn(0, 1)); result += check_equal(anti_fcn(0, 1) + anti_fcn(1, 0), 0); result += check_equal(anti_fcn(0, 0), 0); return result; } static unsigned scalar_product_check() { // check scalar product replacement unsigned result = 0; idx i(symbol("i"), 3), j(symbol("j"), 3); symbol A("A"), B("B"), C("C"); ex e; scalar_products sp; sp.add(A, B, 0); // A and B are orthogonal sp.add(A, C, 0); // A and C are orthogonal sp.add(A, A, 4); // A^2 = 4 (A has length 2) e = (indexed(A + B, i) * indexed(A + C, i)).expand(expand_options::expand_indexed); result += check_equal_simplify(e, indexed(B, i) * indexed(C, i) + 4, sp); e = indexed(A, i, i) * indexed(B, j, j); // GiNaC 0.8.0 had a bug here result += check_equal_simplify(e, e, sp); return result; } static unsigned edyn_check() { // Relativistic electrodynamics // Test 1: check transformation laws of electric and magnetic fields by // applying a Lorentz boost to the field tensor unsigned result = 0; symbol beta("beta"); ex gamma = 1 / sqrt(1 - pow(beta, 2)); symbol Ex("Ex"), Ey("Ey"), Ez("Ez"); symbol Bx("Bx"), By("By"), Bz("Bz"); // Lorentz transformation matrix (boost along x axis) matrix L = {{ gamma, -beta*gamma, 0, 0}, {-beta*gamma, gamma, 0, 0}, { 0, 0, 1, 0}, { 0, 0, 0, 1}}; // Electromagnetic field tensor matrix F = {{ 0, -Ex, -Ey, -Ez}, {Ex, 0, -Bz, By}, {Ey, Bz, 0, -Bx}, {Ez, -By, Bx, 0}}; // Indices symbol s_mu("mu"), s_nu("nu"), s_rho("rho"), s_sigma("sigma"); varidx mu(s_mu, 4), nu(s_nu, 4), rho(s_rho, 4), sigma(s_sigma, 4); // Apply transformation law of second rank tensor ex e = (indexed(L, mu, rho.toggle_variance()) * indexed(L, nu, sigma.toggle_variance()) * indexed(F, rho, sigma)).simplify_indexed(); // Extract transformed electric and magnetic fields ex Ex_p = e.subs(lst{mu == 1, nu == 0}).normal(); ex Ey_p = e.subs(lst{mu == 2, nu == 0}).normal(); ex Ez_p = e.subs(lst{mu == 3, nu == 0}).normal(); ex Bx_p = e.subs(lst{mu == 3, nu == 2}).normal(); ex By_p = e.subs(lst{mu == 1, nu == 3}).normal(); ex Bz_p = e.subs(lst{mu == 2, nu == 1}).normal(); // Check results result += check_equal(Ex_p, Ex); result += check_equal(Ey_p, gamma * (Ey - beta * Bz)); result += check_equal(Ez_p, gamma * (Ez + beta * By)); result += check_equal(Bx_p, Bx); result += check_equal(By_p, gamma * (By + beta * Ez)); result += check_equal(Bz_p, gamma * (Bz - beta * Ey)); // Test 2: check energy density and Poynting vector of electromagnetic field // Minkowski metric ex eta = diag_matrix(lst{1, -1, -1, -1}); // Covariant field tensor ex F_mu_nu = (indexed(eta, mu.toggle_variance(), rho.toggle_variance()) * indexed(eta, nu.toggle_variance(), sigma.toggle_variance()) * indexed(F, rho, sigma)).simplify_indexed(); // Energy-momentum tensor ex T = (-indexed(eta, rho, sigma) * F_mu_nu.subs(s_nu == s_rho) * F_mu_nu.subs(lst{s_mu == s_nu, s_nu == s_sigma}) + indexed(eta, mu.toggle_variance(), nu.toggle_variance()) * F_mu_nu.subs(lst{s_mu == s_rho, s_nu == s_sigma}) * indexed(F, rho, sigma) / 4).simplify_indexed() / (4 * Pi); // Extract energy density and Poynting vector ex E = T.subs(lst{s_mu == 0, s_nu == 0}).normal(); ex Px = T.subs(lst{s_mu == 0, s_nu == 1}); ex Py = T.subs(lst{s_mu == 0, s_nu == 2}); ex Pz = T.subs(lst{s_mu == 0, s_nu == 3}); // Check results result += check_equal(E, (Ex*Ex+Ey*Ey+Ez*Ez+Bx*Bx+By*By+Bz*Bz) / (8 * Pi)); result += check_equal(Px, (Ez*By-Ey*Bz) / (4 * Pi)); result += check_equal(Py, (Ex*Bz-Ez*Bx) / (4 * Pi)); result += check_equal(Pz, (Ey*Bx-Ex*By) / (4 * Pi)); return result; } static unsigned spinor_check() { // check identities of the spinor metric unsigned result = 0; symbol psi("psi"); spinidx A(symbol("A")), B(symbol("B")), C(symbol("C")), D(symbol("D")); ex A_co = A.toggle_variance(), B_co = B.toggle_variance(); ex e; e = spinor_metric(A_co, B_co) * spinor_metric(A, B); result += check_equal_simplify(e, 2); e = spinor_metric(A_co, B_co) * spinor_metric(B, A); result += check_equal_simplify(e, -2); e = spinor_metric(A_co, B_co) * spinor_metric(A, C); result += check_equal_simplify(e, delta_tensor(B_co, C)); e = spinor_metric(A_co, B_co) * spinor_metric(B, C); result += check_equal_simplify(e, -delta_tensor(A_co, C)); e = spinor_metric(A_co, B_co) * spinor_metric(C, A); result += check_equal_simplify(e, -delta_tensor(B_co, C)); e = spinor_metric(A, B) * indexed(psi, B_co); result += check_equal_simplify(e, indexed(psi, A)); e = spinor_metric(A, B) * indexed(psi, A_co); result += check_equal_simplify(e, -indexed(psi, B)); e = spinor_metric(A_co, B_co) * indexed(psi, B); result += check_equal_simplify(e, -indexed(psi, A_co)); e = spinor_metric(A_co, B_co) * indexed(psi, A); result += check_equal_simplify(e, indexed(psi, B_co)); e = spinor_metric(D, A) * spinor_metric(A_co, B_co) * spinor_metric(B, C) - spinor_metric(D, A_co) * spinor_metric(A, B_co) * spinor_metric(B, C); result += check_equal_simplify(e, 0); return result; } static unsigned dummy_check() { // check dummy index renaming/repositioning unsigned result = 0; symbol p("p"), q("q"); idx i(symbol("i"), 3), j(symbol("j"), 3), n(symbol("n"), 3); varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4); ex e; e = indexed(p, i) * indexed(q, i) - indexed(p, j) * indexed(q, j); result += check_equal_simplify(e, 0); e = indexed(p, i) * indexed(p, i) * indexed(q, j) * indexed(q, j) - indexed(p, n) * indexed(p, n) * indexed(q, j) * indexed(q, j); result += check_equal_simplify(e, 0); e = indexed(p, mu, mu.toggle_variance()) - indexed(p, nu, nu.toggle_variance()); result += check_equal_simplify(e, 0); e = indexed(p, mu.toggle_variance(), nu, mu) * indexed(q, i) - indexed(p, mu, nu, mu.toggle_variance()) * indexed(q, i); result += check_equal_simplify(e, 0); e = indexed(p, mu, mu.toggle_variance()) - indexed(p, nu.toggle_variance(), nu); result += check_equal_simplify(e, 0); e = indexed(p, mu.toggle_variance(), mu) - indexed(p, nu, nu.toggle_variance()); result += check_equal_simplify(e, 0); // GiNaC 1.2.1 had a bug here because p.i*p.i -> (p.i)^2 e = indexed(p, i) * indexed(p, i) * indexed(p, j) + indexed(p, j); ex fi = exprseq(e.get_free_indices()); if (!fi.is_equal(exprseq{j})) { clog << "get_free_indices(" << e << ") erroneously returned " << fi << " instead of (.j)" << endl; ++result; } return result; } unsigned exam_indexed() { unsigned result = 0; cout << "examining indexed objects" << flush; result += delta_check(); cout << '.' << flush; result += metric_check(); cout << '.' << flush; result += epsilon_check(); cout << '.' << flush; result += symmetry_check(); cout << '.' << flush; result += scalar_product_check(); cout << '.' << flush; result += edyn_check(); cout << '.' << flush; result += spinor_check(); cout << '.' << flush; result += dummy_check(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return exam_indexed(); } ginac-1.7.8.orig/check/exam_inifcns.cpp0000644000000000000000000002730113457611471014675 0ustar /** @file exam_inifcns.cpp * * This test routine applies assorted tests on initially known higher level * functions. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; /* Assorted tests on other transcendental functions. */ static unsigned inifcns_consist_trans() { using GiNaC::asin; using GiNaC::acos; using GiNaC::asinh; using GiNaC::acosh; using GiNaC::atanh; unsigned result = 0; symbol x("x"); ex chk; chk = asin(1)-acos(0); if (!chk.is_zero()) { clog << "asin(1)-acos(0) erroneously returned " << chk << " instead of 0" << endl; ++result; } // arbitrary check of type sin(f(x)): chk = pow(sin(acos(x)),2) + pow(sin(asin(x)),2) - (1+pow(x,2))*pow(sin(atan(x)),2); if (chk != 1-pow(x,2)) { clog << "sin(acos(x))^2 + sin(asin(x))^2 - (1+x^2)*sin(atan(x))^2 " << "erroneously returned " << chk << " instead of 1-x^2" << endl; ++result; } // arbitrary check of type cos(f(x)): chk = pow(cos(acos(x)),2) + pow(cos(asin(x)),2) - (1+pow(x,2))*pow(cos(atan(x)),2); if (!chk.is_zero()) { clog << "cos(acos(x))^2 + cos(asin(x))^2 - (1+x^2)*cos(atan(x))^2 " << "erroneously returned " << chk << " instead of 0" << endl; ++result; } // arbitrary check of type tan(f(x)): chk = tan(acos(x))*tan(asin(x)) - tan(atan(x)); if (chk != 1-x) { clog << "tan(acos(x))*tan(asin(x)) - tan(atan(x)) " << "erroneously returned " << chk << " instead of -x+1" << endl; ++result; } // arbitrary check of type sinh(f(x)): chk = -pow(sinh(acosh(x)),2).expand()*pow(sinh(atanh(x)),2) - pow(sinh(asinh(x)),2); if (!chk.is_zero()) { clog << "expand(-(sinh(acosh(x)))^2)*(sinh(atanh(x))^2) - sinh(asinh(x))^2 " << "erroneously returned " << chk << " instead of 0" << endl; ++result; } // arbitrary check of type cosh(f(x)): chk = (pow(cosh(asinh(x)),2) - 2*pow(cosh(acosh(x)),2)) * pow(cosh(atanh(x)),2); if (chk != 1) { clog << "(cosh(asinh(x))^2 - 2*cosh(acosh(x))^2) * cosh(atanh(x))^2 " << "erroneously returned " << chk << " instead of 1" << endl; ++result; } // arbitrary check of type tanh(f(x)): chk = (pow(tanh(asinh(x)),-2) - pow(tanh(acosh(x)),2)).expand() * pow(tanh(atanh(x)),2); if (chk != 2) { clog << "expand(tanh(acosh(x))^2 - tanh(asinh(x))^(-2)) * tanh(atanh(x))^2 " << "erroneously returned " << chk << " instead of 2" << endl; ++result; } // check consistency of log and eta phases: for (int r1=-1; r1<=1; ++r1) { for (int i1=-1; i1<=1; ++i1) { ex x1 = r1+I*i1; if (x1.is_zero()) continue; for (int r2=-1; r2<=1; ++r2) { for (int i2=-1; i2<=1; ++i2) { ex x2 = r2+I*i2; if (x2.is_zero()) continue; if (abs(evalf(eta(x1,x2)-log(x1*x2)+log(x1)+log(x2)))>.1e-12) { clog << "either eta(x,y), log(x), log(y) or log(x*y) is wrong" << " at x==" << x1 << ", y==" << x2 << endl; ++result; } } } } } return result; } /* Simple tests on the tgamma function. We stuff in arguments where the results * exists in closed form and check if it's ok. */ static unsigned inifcns_consist_gamma() { using GiNaC::tgamma; unsigned result = 0; ex e; e = tgamma(1); for (int i=2; i<8; ++i) e += tgamma(ex(i)); if (e != numeric(874)) { clog << "tgamma(1)+...+tgamma(7) erroneously returned " << e << " instead of 874" << endl; ++result; } e = tgamma(1); for (int i=2; i<8; ++i) e *= tgamma(ex(i)); if (e != numeric(24883200)) { clog << "tgamma(1)*...*tgamma(7) erroneously returned " << e << " instead of 24883200" << endl; ++result; } e = tgamma(ex(numeric(5, 2)))*tgamma(ex(numeric(9, 2)))*64; if (e != 315*Pi) { clog << "64*tgamma(5/2)*tgamma(9/2) erroneously returned " << e << " instead of 315*Pi" << endl; ++result; } e = tgamma(ex(numeric(-13, 2))); for (int i=-13; i<7; i=i+2) e += tgamma(ex(numeric(i, 2))); e = (e*tgamma(ex(numeric(15, 2)))*numeric(512)); if (e != numeric(633935)*Pi) { clog << "512*(tgamma(-13/2)+...+tgamma(5/2))*tgamma(15/2) erroneously returned " << e << " instead of 633935*Pi" << endl; ++result; } return result; } /* Simple tests on the Psi-function (aka polygamma-function). We stuff in arguments where the result exists in closed form and check if it's ok. */ static unsigned inifcns_consist_psi() { using GiNaC::log; using GiNaC::tgamma; unsigned result = 0; symbol x; ex e, f; // We check psi(1) and psi(1/2) implicitly by calculating the curious // little identity tgamma(1)'/tgamma(1) - tgamma(1/2)'/tgamma(1/2) == 2*log(2). e += (tgamma(x).diff(x)/tgamma(x)).subs(x==numeric(1)); e -= (tgamma(x).diff(x)/tgamma(x)).subs(x==numeric(1,2)); if (e!=2*log(2)) { clog << "tgamma(1)'/tgamma(1) - tgamma(1/2)'/tgamma(1/2) erroneously returned " << e << " instead of 2*log(2)" << endl; ++result; } return result; } /* Simple tests on the Riemann Zeta function. We stuff in arguments where the * result exists in closed form and check if it's ok. Of course, this checks * the Bernoulli numbers as a side effect. */ static unsigned inifcns_consist_zeta() { unsigned result = 0; ex e; for (int i=0; i<13; i+=2) e += zeta(i)/pow(Pi,i); if (e!=numeric(-204992279,638512875)) { clog << "zeta(0) + zeta(2) + ... + zeta(12) erroneously returned " << e << " instead of -204992279/638512875" << endl; ++result; } e = 0; for (int i=-1; i>-16; i--) e += zeta(i); if (e!=numeric(487871,1633632)) { clog << "zeta(-1) + zeta(-2) + ... + zeta(-15) erroneously returned " << e << " instead of 487871/1633632" << endl; ++result; } return result; } static unsigned inifcns_consist_abs() { unsigned result = 0; realsymbol a("a"), b("b"), x("x"), y("y"); possymbol p("p"); symbol z("z"); if (!abs(exp(x+I*y)).eval().is_equal(exp(x))) ++result; if (!abs(pow(p,a+I*b)).eval().is_equal(pow(p,a))) ++result; if (!abs(sqrt(p)).eval().is_equal(sqrt(p))) ++result; if (!abs(-sqrt(p)).eval().is_equal(sqrt(p))) ++result; // also checks that abs(p)=p if (!abs(pow(p,a+I*b)).eval().is_equal(pow(p,a))) ++result; if (!abs(pow(x+I*y,a)).eval().is_equal(pow(abs(x+I*y),a))) ++result; // it is not necessary a simplification if the following is really evaluated if (!abs(pow(x+I*y,a+I*b)).eval().is_equal(abs(pow(x+I*y,a+I*b)))) ++result; // check expansion of abs if (!abs(-7*z*a*p).expand(expand_options::expand_transcendental).is_equal(7*abs(z)*abs(a)*p)) ++result; if (!abs(z.conjugate()).eval().is_equal(abs(z))) ++result; if (!abs(step(z)).eval().is_equal(step(z))) ++result; if (!abs(p).info(info_flags::positive) || !abs(a).info(info_flags::real)) ++result; if (abs(a).info(info_flags::positive) || !abs(a).info(info_flags::real)) ++result; if (abs(z).info(info_flags::positive) || !abs(z).info(info_flags::real)) ++result; return result; } static unsigned inifcns_consist_exp() { unsigned result = 0; symbol a("a"), b("b"); if (!exp(a+b).expand(expand_options::expand_transcendental).is_equal(exp(a)*exp(b))) ++result; // shall not be expanded since the arg is not add if (!exp(pow(a+b,2)).expand(expand_options::expand_transcendental).is_equal(exp(pow(a+b,2)))) ++result; // expand now if (!exp(pow(a+b,2)).expand(expand_options::expand_function_args | expand_options::expand_transcendental) .is_equal(exp(a*a)*exp(b*b)*exp(2*a*b))) ++result; return result; } static unsigned inifcns_consist_log() { using GiNaC::log; unsigned result = 0; symbol z("a"), w("b"); realsymbol a("a"), b("b"); possymbol p("p"), q("q"); // do not expand if (!log(z*w).expand(expand_options::expand_transcendental).is_equal(log(z*w))) ++result; // do not expand if (!log(a*b).expand(expand_options::expand_transcendental).is_equal(log(a*b))) ++result; // shall expand if (!log(p*q).expand(expand_options::expand_transcendental).is_equal(log(p) + log(q))) ++result; // a bit more complicated ex e1 = log(-7*p*pow(q,3)*a*pow(b,2)*z*w).expand(expand_options::expand_transcendental); ex e2 = log(7)+log(p)+log(pow(q,3))+log(-z*a*w*pow(b,2)); if (!e1.is_equal(e2)) ++result; // shall not do for non-real powers if (ex(log(pow(p,z))).is_equal(z*log(p))) ++result; // shall not do for non-positive basis if (ex(log(pow(a,b))).is_equal(b*log(a))) ++result; // infinite recursion log_series ex e(log(-p)); ex ser = ex_to(e.series(z, 1)) .convert_to_poly(/* no_order = */ true); if (!ser.is_equal(e)) { clog << "series(" << e << ", " << z << "): wrong result" << endl; ++result; } return result; } static unsigned inifcns_consist_various() { unsigned result = 0; symbol n; if ( binomial(n, 0) != 1 ) { clog << "ERROR: binomial(n,0) != 1" << endl; ++result; } return result; } /* Several tests for derivatives */ static unsigned inifcns_consist_derivatives() { unsigned result = 0; symbol z, w; realsymbol x; ex e, e1; e=pow(x,z).conjugate().diff(x); e1=pow(x,z).conjugate()*z.conjugate()/x; if (! (e-e1).normal().is_zero() ) { clog << "ERROR: pow(x,z).conjugate().diff(x) " << e << " != " << e1 << endl; ++result; } e=pow(w,z).conjugate().diff(w); e1=pow(w,z).conjugate()*z.conjugate()/w; if ( (e-e1).normal().is_zero() ) { clog << "ERROR: pow(w,z).conjugate().diff(w) " << e << " = " << e1 << endl; ++result; } e=atanh(x).imag_part().diff(x); if (! e.is_zero() ) { clog << "ERROR: atanh(x).imag_part().diff(x) " << e << " != 0" << endl; ++result; } e=atanh(w).imag_part().diff(w); if ( e.is_zero() ) { clog << "ERROR: atanh(w).imag_part().diff(w) " << e << " = 0" << endl; ++result; } e=atanh(x).real_part().diff(x); e1=pow(1-x*x,-1); if (! (e-e1).normal().is_zero() ) { clog << "ERROR: atanh(x).real_part().diff(x) " << e << " != " << e1 << endl; ++result; } e=atanh(w).real_part().diff(w); e1=pow(1-w*w,-1); if ( (e-e1).normal().is_zero() ) { clog << "ERROR: atanh(w).real_part().diff(w) " << e << " = " << e1 << endl; ++result; } e=abs(log(z)).diff(z); e1=(conjugate(log(z))/z+log(z)/conjugate(z))/abs(log(z))/2; if (! (e-e1).normal().is_zero() ) { clog << "ERROR: abs(log(z)).diff(z) " << e << " != " << e1 << endl; ++result; } e=Order(pow(x,4)).diff(x); e1=Order(pow(x,3)); if (! (e-e1).normal().is_zero() ) { clog << "ERROR: Order(pow(x,4)).diff(x) " << e << " != " << e1 << endl; ++result; } return result; } unsigned exam_inifcns() { unsigned result = 0; cout << "examining consistency of symbolic functions" << flush; result += inifcns_consist_trans(); cout << '.' << flush; result += inifcns_consist_gamma(); cout << '.' << flush; result += inifcns_consist_psi(); cout << '.' << flush; result += inifcns_consist_zeta(); cout << '.' << flush; result += inifcns_consist_abs(); cout << '.' << flush; result += inifcns_consist_exp(); cout << '.' << flush; result += inifcns_consist_log(); cout << '.' << flush; result += inifcns_consist_various(); cout << '.' << flush; result += inifcns_consist_derivatives(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return exam_inifcns(); } ginac-1.7.8.orig/check/exam_inifcns_nstdsums.cpp0000644000000000000000000003466513457611471016650 0ustar /** @file exam_inifcns_nstdsums.cpp * * This test routine applies assorted tests on initially known higher level * functions. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include #include using namespace std; //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // S exam //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /* * The data in the following include file has been produced by the following * Mathematica (V4.1) script: * * * x={2/10,1,14/10,30/10} * y={0,3/10,-14/10} * st = OpenAppend["exam_inifcns_nstdsums_data.raw"] * $NumberMarks = False * Do[ * Do[ * Do[Write[st, i]; Write[st,j]; Write[st,x[[k]]+I*y[[l]]]; * Write[st,Chop[N[PolyLog[i,j,x[[k]]+I*y[[l]]],25]]],{i,3},{j,3}], {k,4}],{l,3}] * Do[ * Do[ * Do[Write[st, i]; Write[st,j]; Write[st,-x[[k]]+I*y[[l]]]; * Write[st,Chop[N[PolyLog[i,j,-x[[k]]+I*y[[l]]],25]]],{i,3},{j,3}], {k,4}], {l,3}] * Close[st] * * * and postprocessed by the following shell script * * * #/bin/sh * IFS=$'\n' * cat exam_inifcns_nstdsums_data.raw | sed -e 's/\*\^/E/g' > exam_inifcns_nstdsums_data.raw2 * echo 'constexpr string polylogdata[] = {' > exam_inifcns_nstdsums.h * for i in `cat exam_inifcns_nstdsums_data.raw2`; do echo \"$i\",; done >> exam_inifcns_nstdsums.h * echo '"-999"};' >> exam_inifcns_nstdsums.h * * */ #include "exam_inifcns_nstdsums.h" // signals end of data const int ENDMARK = -999; static unsigned inifcns_test_S() { int digitsbuf = Digits; // precision of data Digits = 22; ex prec = 5 * pow(10, -(ex)Digits); unsigned result = 0; int i = 0; while (true) { ex n(polylogdata[i++],symbol()); if (n == ENDMARK) { break; } ex p(polylogdata[i++],symbol()); ex x(polylogdata[i++],symbol()); ex res(polylogdata[i++],symbol()); ex res2 = S(n, p, x).evalf(); if (abs(res-res2) > prec) { clog << "S(" << n << "," << p << "," << x << ") seems to be wrong:" << endl; clog << "GiNaC : " << res2 << endl; clog << "Reference : " << res << endl; clog << "Abs. Difference : " << res2-res << endl; if (res2 != 0) { ex reldiff = abs((res2-res)/res2); clog << "Rel. Difference : " << reldiff << endl; } result++; } if (i % 80) { cout << "." << flush; } } Digits = digitsbuf; return result; } //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // H/Li exam //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// static unsigned inifcns_test_HLi() { using GiNaC::log; int digitsbuf = Digits; Digits = 17; ex prec = 5 * pow(10, -(ex)Digits); numeric almostone("0.999999999999999999"); unsigned result = 0; lst res; res.append(H(lst{2,1},numeric(1)/2).hold() - (zeta(3)/8 - pow(log(2),3)/6)); res.append(H(lst{2,1,3},numeric(1)/3).hold() - Li(lst{2,1,3},lst{numeric(1)/3,1,1}).hold()); res.append(H(lst{2,1,3},numeric(98)/100).hold() - Li(lst{2,1,3},lst{numeric(98)/100,1,1}).hold()); res.append(H(lst{2,1,3},numeric(245)/100).hold() - Li(lst{2,1,3},lst{numeric(245)/100,1,1}).hold()); res.append(H(lst{4,1,1,1},numeric(1)/3).hold() - S(3,4,numeric(1)/3).hold()); res.append(H(lst{4,1,1,1},numeric(98)/100).hold() - S(3,4,numeric(98)/100).hold()); res.append(H(lst{4,1,1,1},numeric(245)/100).hold() - S(3,4,numeric(245)/100).hold()); res.append(H(lst{2,2,3},almostone).hold() - zeta(lst{2,2,3})); res.append(H(lst{-3,-1,2,1},almostone).hold() - zeta(lst{3,1,2,1},lst{-1,1,-1,1})); res.append(H(lst{-2,1,3},numeric(1)/3).hold() - -Li(lst{2,1,3},lst{-numeric(1)/3,-1,1}).hold()); res.append(H(lst{-2,1,3},numeric(98)/100).hold() - -Li(lst{2,1,3},lst{-numeric(98)/100,-1,1}).hold()); res.append(H(lst{-2,1,3},numeric(245)/100).hold() - -Li(lst{2,1,3},lst{-numeric(245)/100,-1,1}).hold()); res.append(H(lst{-3,1,-2,0,0},numeric(3)/10).hold() - convert_H_to_Li(lst{-3,1,-2,0,0},numeric(3)/10)); for (lst::const_iterator it = res.begin(); it != res.end(); it++) { ex diff = abs((*it).evalf()); if (diff > prec) { clog << *it << " seems to be wrong: " << diff << endl; result++; } cout << "." << flush; } Digits = digitsbuf; // conjugate test numeric cdif = ex_to(H(lst{2,2,1},5.0-5.0*I) - H(lst{2,2,1},5.0+5.0*I)); numeric cadd = ex_to(H(lst{2,2,1},5.0-5.0*I) + H(lst{2,2,1},5.0+5.0*I)); if ((cdif.real() > prec) || (cadd.imag() > prec)) { clog << "complex conjugation test of H({2,2,1},5.0-5.0*I) seems to be wrong: " << cdif << " " << cadd << endl; result++; } return result; } //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // zeta exam //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// static unsigned inifcns_test_zeta() { int digitsbuf = Digits; unsigned result = 0; lst res; res.append(zeta(lst{2,1}) - zeta(3)); res.append(zeta(lst{2,1,1,1,1}) - zeta(6)); res.append(zeta(lst{6,3}) - (zeta(9)*83/2 - zeta(2)*zeta(7)*21 - zeta(2)*zeta(2)*zeta(5)*12/5)); res.append(zeta(lst{4,2,3}) - (-zeta(9)*59 + zeta(2)*zeta(7)*28 + pow(zeta(2),2)*zeta(5)*4 - pow(zeta(3),3)/3 + pow(zeta(2),3)*zeta(3)*8/21)); res.append(zeta(lst{3,1,3,1,3,1,3,1}) - (2*pow(Pi,16)/factorial(18))); res.append(zeta(lst{2},lst{-1}) - -zeta(2)/2); res.append(zeta(lst{1,2},lst{-1,1}) - (-zeta(3)/4 - zeta(lst{1},lst{-1})*zeta(2)/2)); res.append(zeta(lst{2,1,1},lst{-1,-1,1}) - (-pow(zeta(2),2)*23/40 - pow(zeta(lst{1},lst{-1}),2)*zeta(2)*3/4 - zeta(lst{3,1},lst{-1,1})*3/2 - zeta(lst{1},lst{-1})*zeta(3)*21/8)); for (lst::const_iterator it = res.begin(); it != res.end(); it++) { Digits = 17; ex prec = 5 * pow(10, -(ex)Digits); ex diff = abs((*it).evalf()); if (diff > prec) { clog << *it << " seems to be wrong: " << diff << endl; clog << "Digits: " << Digits << endl; result++; } cout << "." << flush; Digits = 40; prec = 5 * pow(10, -(ex)Digits); diff = abs((*it).evalf()); if (diff > prec) { clog << *it << " seems to be wrong: " << diff << endl; clog << "Digits: " << Digits << endl; result++; } cout << "." << flush; } Digits = digitsbuf; return result; } //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // H/Li exam //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// static unsigned inifcns_test_LiG() { int digitsbuf = Digits; Digits = 17; ex prec = 5 * pow(10, -(ex)Digits); numeric almostone("0.99999999999999999999"); unsigned result = 0; lst res; res.append(Li(lst{4}, lst{6}).hold() - Li(4, 6.0)); res.append(G(lst{0,0,5.0,0,2.0,0,0,0,3.0},0.5).hold() + Li(lst{3,2,4}, lst{numeric(1,10), numeric(5,2), numeric(2,3)})); res.append(Li(lst{2,1,1}, lst{almostone, almostone, almostone}) - zeta(lst{2,1,1})); // check Li_{1,1} against known expression symbol x("x"), y("y"); ex eps = 1e-30*I; ex s1 = Li(lst{1,1},lst{x,y}); ex s2 = log(1-1/x/y-eps)*log((1-1/x-eps)/(1/x/y-1/x)) + Li(2,(1-1/x/y-eps)/(1/x-1/x/y)) - log(-1/x/y-eps)*log((-1/x-eps)/(1/x/y-1/x)) - Li(2,(-1/x/y-eps)/(1/x-1/x/y)) - log(-1/x/y-eps)*log(1-1/x-eps) + log(-1/x/y-eps)*log(-1/x-eps); res.append(s1.subs(lst{x==numeric(1)/2, y==3}) - s2.subs(lst{x==numeric(1)/2, y==3})); res.append(s1.subs(lst{x==numeric(3)/2, y==numeric(1)/2}) - s2.subs(lst{x==numeric(3)/2, y==numeric(1)/2})); res.append(s1.subs(lst{x==2, y==numeric(4)/5}) - s2.subs(lst{x==2, y==numeric(4)/5})); // shuffle and quasi-shuffle identities res.append(G(lst{0,0.2},1).hold() * G(lst{0.5},1).hold() - G(lst{0.5,0,0.2},1).hold() - G(lst{0,0.5,0.2},1).hold() - G(lst{0,0.2,0.5},1).hold()); res.append(G(lst{0,0.5},1).hold() * G(lst{0.6},1).hold() - G(lst{0,0.5,0.5*0.6},1).hold() - G(lst{0.6,0,0.5*0.6},1).hold() + G(lst{0,0,0.5*0.6},1).hold()); res.append(Li(lst{2},lst{numeric(1,5)}).hold() * Li(lst{3},lst{7}).hold() - Li(lst{2,3},lst{numeric(1,5),7}).hold() - Li(lst{3,2},lst{7,numeric(1,5)}).hold() - Li(lst{5},lst{numeric(7,5)}).hold()); symbol a1, a2, a3, a4; res.append((G(lst{a1,a2},1) * G(lst{a3,a4},1) - G(lst{a1,a2,a3,a4},1) - G(lst{a1,a3,a2,a4},1) - G(lst{a3,a1,a2,a4},1) - G(lst{a1,a3,a4,a2},1) - G(lst{a3,a1,a4,a2},1) - G(lst{a3,a4,a1,a2},1)) .subs(lst{a1==numeric(1)/10, a2==numeric(3)/10, a3==numeric(7)/10, a4==5})); res.append(G(lst{-0.009},1).hold() * G(lst{-8,1.4999},1).hold() - G(lst{-0.009,-8,1.4999},1).hold() - G(lst{-8,-0.009,1.4999},1).hold() - G(lst{-8,1.4999,-0.009},1).hold()); res.append(G(lst{sqrt(numeric(1)/2)+I*sqrt(numeric(1)/2)},1).hold() * G(lst{1.51,-0.999},1).hold() - G(lst{sqrt(numeric(1)/2)+I*sqrt(numeric(1)/2),1.51,-0.999},1).hold() - G(lst{1.51,sqrt(numeric(1)/2)+I*sqrt(numeric(1)/2),-0.999},1).hold() - G(lst{1.51,-0.999,sqrt(numeric(1)/2)+I*sqrt(numeric(1)/2)},1).hold()); // checks for hoelder convolution which is used if one argument has a distance to one smaller than 0.01 res.append(G(lst{0, 1.2, 1, 1.01}, 1).hold() - G(lst{0, 1.2, 1, numeric("1.009999999999999999")}, 1).hold()); for (lst::const_iterator it = res.begin(); it != res.end(); it++) { ex diff = abs((*it).evalf()); if (diff > prec) { clog << *it << " seems to be wrong: " << diff << endl; result++; } cout << "." << flush; } Digits = digitsbuf; return result; } //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // legacy exam - checking for historical bugs //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// static unsigned inifcns_test_legacy() { int digitsbuf = Digits; Digits = 17; ex prec = 5 * pow(10, -(ex)Digits); unsigned result = 0; ex r1 = zeta(lst{1,1,1,1,1,1}, lst{-1,-1,-1,1,1,1}); if ((r1.evalf() - numeric("-0.0012588769028204890704")) > prec) { clog << "zeta({1,1,1,1,1,1},{-1,-1,-1,1,1,1}) seems to be wrong." << endl; result++; } ex x1 = exp(2*Pi*I/13).evalf(); ex x2 = exp(24*Pi*I/13).evalf(); ex r2 = Li(lst{2},lst{x1}).hold().evalf(); ex r3 = Li(lst{2},lst{x2}).hold().evalf(); if ( abs(r2-conjugate(r3)) > prec ) { clog << "Legacy test 2 seems to be wrong." << endl; result++; } ex x3 = exp(5*Pi*I/3).evalf(); ex r4 = Li(lst{3},lst{x3}).hold().evalf(); if ( abs(r4 - numeric("0.40068563438653142847-0.95698384815740185713*I")) > prec ) { clog << "Legacy test 3 seems to be wrong." << endl; result++; } Digits = 100; prec = 5 * pow(10, -(ex)Digits); ex x0 = 1.; x1 = exp(Pi*I/3).evalf(); x2 = exp(2*Pi*I/3).evalf(); x3 = -1.; ex x4 = exp(4*Pi*I/3).evalf(); ex x5 = exp(5*Pi*I/3).evalf(); ex r5 = Li(lst{1,1,1,1},lst{x2,x4,x3,x0}).hold().evalf(); ex r6 = Li(lst{1,1,1,1},lst{x4,x2,x3,x0}).hold().evalf(); if ( abs(r5-conjugate(r6)) > prec ) { clog << "Legacy test 4 seems to be wrong." << endl; result++; } ex r7 = Li(lst{1,2,1},lst{x3,x2,x4}).hold().evalf() +Li(lst{1,1,2},lst{x3,x2,x4}).hold().evalf() +Li(lst{1,1,1,1},lst{x3,x0,x2,x4}).hold().evalf() +Li(lst{1,1,1,1},lst{x3,x2,x0,x4}).hold().evalf() +Li(lst{1,1,1,1},lst{x3,x2,x4,x0}).hold().evalf() +Li(lst{1,2,1},lst{x2,x1,x0}).hold().evalf() +Li(lst{1,1,2},lst{x2,x3,x4}).hold().evalf() +Li(lst{1,1,1,1},lst{x2,x4,x3,x0}).hold().evalf() +Li(lst{1,1,1,1},lst{x2,x3,x4,x0}).hold().evalf() +Li(lst{1,1,1,1},lst{x2,x3,x0,x4}).hold().evalf() +Li(lst{2,2},lst{x5,x4}).hold().evalf() +Li(lst{2,1,1},lst{x5,x0,x4}).hold().evalf() +Li(lst{2,1,1},lst{x5,x4,x0}).hold().evalf() -Li(lst{1,1},lst{x3,x0}).hold().evalf()*Li(lst{1,1},lst{x2,x4}).hold().evalf(); if ( abs(r7) > prec ) { clog << "Legacy test 5 seems to be wrong." << endl; result++; } Digits = digitsbuf; return result; } static unsigned check_G_y_one_bug() { exvector exprs; exprs.push_back(G(lst{-1,-1, 1,-1, 0}, 1)); exprs.push_back(G(lst{-1, 0, 1,-1, 0}, 1)); exprs.push_back(G(lst{-1, 1,-1,-1, 0}, 1)); exprs.push_back(G(lst{-1, 1,-1, 0, 0}, 1)); exprs.push_back(G(lst{-1, 1,-1, 1, 0}, 1)); exprs.push_back(G(lst{-1, 1, 0,-1, 0}, 1)); exprs.push_back(G(lst{-1, 1, 1,-1, 0}, 1)); exprs.push_back(G(lst{ 0,-1, 1,-1, 0}, 1)); exprs.push_back(G(lst{ 0, 1, 1,-1, 0}, 1)); unsigned err = 0; for (exvector::const_iterator ep = exprs.begin(); ep != exprs.end(); ++ep) { try { ex val = ep->evalf(); if (!is_a(val)) { clog << "evalf(" << *ep << ") is not a number: " << val << endl; ++err; } } catch (std::exception& oops) { clog << "evalf(" << *ep << "): got an exception" << oops.what() << endl; ++err; } } return err; } unsigned exam_inifcns_nstdsums(void) { unsigned result = 0; cout << "examining consistency of nestedsums functions" << flush; result += inifcns_test_zeta(); result += inifcns_test_S(); result += inifcns_test_HLi(); result += inifcns_test_LiG(); result += inifcns_test_legacy(); result += check_G_y_one_bug(); return result; } int main(int argc, char** argv) { return exam_inifcns_nstdsums(); } ginac-1.7.8.orig/check/exam_inifcns_nstdsums.h0000644000000000000000000004325313457611471016306 0ustar /** @file exam_inifcns_nstdsums.h * * Comparison data for the test of polylogarithms. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ string polylogdata[] = { "1", "1", "1/5", "0.2110037754397047726111851", "1", "2", "1/5", "0.01154815698320587834851847", "1", "3", "1/5", "0.0005671604269057464369336278", "2", "1", "1/5", "0.2053241957333103187906279", "2", "2", "1/5", "0.005496394299313416180783147", "2", "3", "1/5", "0.0001775366905181881667796781", "3", "1", "1/5", "0.2026055828608337918073629", "3", "2", "1/5", "0.002660800832970401591293284", "3", "3", "1/5", "0.00005648589591441390456209617", "1", "1", "1", "1.644934066848226436472415", "1", "2", "1", "1.202056903159594285399738", "1", "3", "1", "1.082323233711138191516004", "2", "1", "1", "1.202056903159594285399738", "2", "2", "1", "0.2705808084277845478790009", "2", "3", "1", "0.09655115998944373446564553", "3", "1", "1", "1.082323233711138191516004", "3", "2", "1", "0.09655115998944373446564553", "3", "3", "1", "0.01748985316901140442593445", "1", "1", "7/5", "2.319073036309661140597949 - 1.057058706706129136511424*I", "1", "2", "7/5", "0.400128217350851507240443 - 2.117870033958637239292535*I", "1", "3", "7/5", "-1.306942067751837699697874 - 0.9582504865992154234972912*I", "2", "1", "7/5", "1.89888115124088465887076 - 0.1778354536426690011875291*I", "2", "2", "7/5", "0.6147866145423269326988408 - 0.450346061295973806397063*I", "2", "3", "7/5", "0.02364313457019212818533082 - 0.3957649083518131684924005*I", "3", "1", "7/5", "1.598181449557006942439464 - 0.01994556427923228904747691*I", "3", "2", "7/5", "0.255166723694153893894118 - 0.05744406976402892180206415*I", "3", "3", "7/5", "0.06183658590899077899926822 - 0.06413563191670074072577209*I", "1", "1", "3", "2.320180423313098396406194 - 3.451392295223202661433821*I", "1", "2", "3", "-3.283054973314733671722888 - 2.121348992833316537253189*I", "1", "3", "3", "-1.308956801609585468303169 + 2.735768992719806273982232*I", "2", "1", "3", "3.74212259424073163537853 - 1.8958709942733213939055*I", "2", "2", "3", "-0.480510635231494396450204 - 2.302538950265844976567974*I", "2", "3", "3", "-1.340253408976406939530336 + 0.2712277258998196470831479*I", "3", "1", "3", "3.748509891070099635577777 - 0.6942757240126994329423387*I", "3", "2", "3", "0.4861841788146436502060471 - 1.108719697043548174143929*I", "3", "3", "3", "-0.4434283619758922093239171 - 0.2953184763564641050133537*I", "1", "1", "1/5 + (3*I)/10", "0.1817624136255447449184249 + 0.3300021664312349365005342*I", "1", "2", "1/5 + (3*I)/10", "-0.02127060891668272269977564 + 0.02960990860383052619662807*I", "1", "3", "1/5 + (3*I)/10", "-0.00309623659733713567217526 - 0.0006081451141979055410326925*I", "2", "1", "1/5 + (3*I)/10", "0.1918812948232063923430136 + 0.3150961462895829294435211*I", "2", "2", "1/5 + (3*I)/10", "-0.009100341083225460545023609 + 0.01505275697697292299710076*I", "2", "3", "1/5 + (3*I)/10", "-0.001002045705125824985735953 - 0.0000931525145668252525455795*I", "3", "1", "1/5 + (3*I)/10", "0.1962643925058113082072159 + 0.3075543063564529215440445*I", "3", "2", "1/5 + (3*I)/10", "-0.004053799099843583119296245 + 0.007560021359667667770852211*I", "3", "3", "1/5 + (3*I)/10", "-0.0003240792138489462062797713 - 5.830899924898618321929032E-6*I", "1", "1", "1 + (3*I)/10", "1.261005636400337930308118 + 0.7156828245191393467143763*I", "1", "2", "1 + (3*I)/10", "0.1998831977949975418578584 + 0.6244483919686713779224936*I", "1", "3", "1 + (3*I)/10", "-0.1364622100637802947057075 + 0.2406763129716348319993979*I", "2", "1", "1 + (3*I)/10", "1.139163376813876647799732 + 0.4441977154715400716583975*I", "2", "2", "1 + (3*I)/10", "0.1436177344738862689488375 + 0.1974318055898878411698054*I", "2", "3", "1 + (3*I)/10", "-0.004631384159507411802648499 + 0.0641990837118411118030704*I", "3", "1", "1 + (3*I)/10", "1.066719273153223255872187 + 0.3561898809884808259030033*I", "3", "2", "1 + (3*I)/10", "0.0710206968588785102864562 + 0.06946535138235496111746761*I", "3", "3", "1 + (3*I)/10", "0.003394713278779414104889703 + 0.01572567802823333948945599*I", "1", "1", "7/5 + (3*I)/10", "1.746328220125828463357781 + 1.293912877394488172676492*I", "1", "2", "7/5 + (3*I)/10", "-0.1705237731249613771154105 + 1.410448047723192221781715*I", "1", "3", "7/5 + (3*I)/10", "-0.7993328986491419154562113 + 0.2240473689385119401472374*I", "2", "1", "7/5 + (3*I)/10", "1.695022640104322001454814 + 0.6311207314778676822437355*I", "2", "2", "7/5 + (3*I)/10", "0.2500128026974790456104579 + 0.5085989943285245053960182*I", "2", "3", "7/5 + (3*I)/10", "-0.1148557150224370365078302 + 0.1915495333472110502058456*I", "3", "1", "7/5 + (3*I)/10", "1.551224385087703633744372 + 0.4096736133572680716788505*I", "3", "2", "7/5 + (3*I)/10", "0.1610086739116176049491314 + 0.1573532373869367492158508*I", "3", "3", "7/5 + (3*I)/10", "0.00008355670074290449954321072 + 0.05802311653447669691333529*I", "1", "1", "3 + (3*I)/10", "2.011020920616701077455812 + 3.397072105237087682189828*I", "1", "2", "3 + (3*I)/10", "-3.091859759069532002434627 + 1.666118629453408661739254*I", "1", "3", "3 + (3*I)/10", "-0.8878527778981529594861016 - 2.434364480366253327812887*I", "2", "1", "3 + (3*I)/10", "3.411586707187776500840283 + 2.128627570334239892859671*I", "2", "2", "3 + (3*I)/10", "-0.6847253205832210157136079 + 1.994290299048607560691603*I", "2", "3", "3 + (3*I)/10", "-1.088233543788019837240912 - 0.3929749894500587756908124*I", "3", "1", "3 + (3*I)/10", "3.565487383713819583850992 + 1.060767984969548945285053*I", "3", "2", "3 + (3*I)/10", "0.2692762029815113608515477 + 1.060947988767443679766785*I", "3", "3", "3 + (3*I)/10", "-0.4159967816412745726855725 + 0.172858247942700149618331*I", "1", "1", "1/5 - (7*I)/5", "-0.2168382064320079699732261 - 1.290878454583813741543234*I", "1", "2", "1/5 - (7*I)/5", "-0.3451669563336866625816169 + 0.1957774036164392101927372*I", "1", "3", "1/5 - (7*I)/5", "0.08214427234994582908698386 + 0.06449056709956809894940379*I", "2", "1", "1/5 - (7*I)/5", "-0.03042144217050376321269406 - 1.378042181254097119943019*I", "2", "2", "1/5 - (7*I)/5", "-0.2122053137898958092005104 + 0.06004832979925179307301476*I", "2", "3", "1/5 - (7*I)/5", "0.02299484687792200922486322 + 0.03281780472569582817172184*I", "3", "1", "1/5 - (7*I)/5", "0.07954758404396723589806321 - 1.402590109062933871392952*I", "3", "2", "1/5 - (7*I)/5", "-0.1166624266816937993242638 + 0.01219776187261535273200268*I", "3", "3", "1/5 - (7*I)/5", "0.005446850058125122681940759 + 0.01368445926518218498435562*I", "1", "1", "1 - (7*I)/5", "0.3229223427783080464168482 - 1.740744589472007676760007*I", "1", "2", "1 - (7*I)/5", "-0.7462501471409844475821687 - 0.06809527240892149178849717*I", "1", "3", "1 - (7*I)/5", "0.01726448925633681090502602 + 0.2746453959884960147929753*I", "2", "1", "1 - (7*I)/5", "0.6992465770229889358880579 - 1.66024142746129637527113*I", "2", "2", "1 - (7*I)/5", "-0.360932620346732658930704 - 0.1766337145573970952978008*I", "2", "3", "1 - (7*I)/5", "-0.03837478847084106478326429 + 0.09480468232038559943747127*I", "3", "1", "1 - (7*I)/5", "0.8732997135886229894915555 - 1.555949977360525360725989*I", "3", "2", "1 - (7*I)/5", "-0.1553598469745823402728118 - 0.1341718446987175963404485*I", "3", "3", "1 - (7*I)/5", "-0.02428660616580131371668603 + 0.02676895982537889521216678*I", "1", "1", "7/5 - (7*I)/5", "0.5553932412307858310125187 - 2.038950110146658192024572*I", "1", "2", "7/5 - (7*I)/5", "-1.042554222290367637550906 - 0.21436451215527849991702*I", "1", "3", "7/5 - (7*I)/5", "-0.0314419508370015033194055 + 0.4613268808592085414432077*I", "2", "1", "7/5 - (7*I)/5", "1.071931369421352221757937 - 1.853170643333167599178124*I", "2", "2", "7/5 - (7*I)/5", "-0.4628797620304465221346583 - 0.3422886294340223997935778*I", "2", "3", "7/5 - (7*I)/5", "-0.098587457456488904995548 + 0.144684644948941321119675*I", "3", "1", "7/5 - (7*I)/5", "1.286793410334209264901226 - 1.657513826017920212261891*I", "3", "2", "7/5 - (7*I)/5", "-0.1711141231913325258586839 - 0.2375876206470994404554137*I", "3", "3", "7/5 - (7*I)/5", "-0.05299201267886299861483348 + 0.03258270024606783452944098*I", "1", "1", "3 - (7*I)/5", "1.007938136309594236518511 - 3.386967910892347904114225*I", "1", "2", "3 - (7*I)/5", "-2.682309699233097296322462 - 0.2859940229969369808426482*I", "1", "3", "3 - (7*I)/5", "0.2765591454514408934814353 + 1.697149375282038684500721*I", "2", "1", "3 - (7*I)/5", "2.405733557488370170927602 - 2.951504413417675817858886*I", "2", "2", "3 - (7*I)/5", "-1.272036042194284768991475 - 1.103934330435370660107263*I", "2", "3", "3 - (7*I)/5", "-0.4131756886737842334273695 + 0.6696371310771923308835628*I", "3", "1", "3 - (7*I)/5", "2.972854638910796659727421 - 2.283639962584069752219147*I", "3", "2", "3 - (7*I)/5", "-0.3478855022054033507183165 - 0.861985838577452633146836*I", "3", "3", "3 - (7*I)/5", "-0.2931771313199542816919608 + 0.1294389736359485891156582*I", "1", "1", "-1/5", "-0.1908001377775356190369132", "1", "2", "-1/5", "0.008826841601567502361076978", "1", "3", "-1/5", "-0.0003602784749049460977504445", "2", "1", "-1/5", "-0.1952735929310542759464553", "2", "2", "-1/5", "0.004596651976424285002647089", "2", "3", "-1/5", "-0.0001263988435607805606549976", "3", "1", "-1/5", "-0.1975929828245178964051594", "3", "2", "-1/5", "0.002362344648329100774111073", "3", "3", "-1/5", "-0.00004379738606960102828759222", "1", "1", "-1", "-0.8224670334241132182362076", "1", "2", "-1", "0.1502571128949492856749673", "1", "3", "-1", "-0.02375236632261848595145358", "2", "1", "-1", "-0.9015426773696957140498036", "2", "2", "-1", "0.08778567156865530203659329", "2", "3", "-1", "-0.009601568443129832539131915", "3", "1", "-1", "-0.9470328294972459175765032", "3", "2", "-1", "0.04893639704996906336074275", "3", "3", "-1", "-0.003716769548592781918107256", "1", "1", "-7/5", "-1.08557795634712507555489", "1", "2", "-7/5", "0.2535957124764954803911381", "1", "3", "-7/5", "-0.05093174821838708462957568", "2", "1", "-7/5", "-1.22082452959280891549602", "2", "2", "-7/5", "0.1543815262398468671292177", "2", "3", "-7/5", "-0.02163750431283488956581388", "3", "1", "-7/5", "-1.301610824979171412102903", "3", "2", "-7/5", "0.08870564296364697150488985", "3", "3", "-7/5", "-0.00871772008813535940594319", "1", "1", "-3", "-1.939375420766708953077272", "1", "2", "-3", "0.7401475948629590886006417", "1", "3", "-3", "-0.2388642027836877889744444", "2", "1", "-3", "-2.348790554584076557805871", "2", "2", "-3", "0.5052321953754768909798843", "2", "3", "-3", "-0.1162576824693628931275475", "3", "1", "-3", "-2.620634701909763503399941", "3", "2", "-3", "0.3167617872532832638027071", "3", "3", "-3", "-0.05239918743720934590666285", "1", "1", "-1/5 + (3*I)/10", "-0.2081375660560016691180584 + 0.271539573686964633554782*I", "1", "2", "-1/5 + (3*I)/10", "-0.006200306433802806244546582 - 0.02755725248800315290955911*I", "1", "3", "-1/5 + (3*I)/10", "0.001818502491789777318252704 + 0.0009559436708325564438468345*I", "2", "1", "-1/5 + (3*I)/10", "-0.2047344007413153491087881 + 0.2854777299439535793275641*I", "2", "2", "-1/5 + (3*I)/10", "-0.004038610781088847480082351 - 0.01424503726588138737660998*I", "2", "3", "-1/5 + (3*I)/10", "0.0006652711668165765971408173 + 0.0002934227620804844427033155*I", "3", "1", "-1/5 + (3*I)/10", "-0.2026042284782455939272071 + 0.2926491978893533527001885*I", "3", "2", "-1/5 + (3*I)/10", "-0.002359494267385617865817285 - 0.007265538502225720435935446*I", "3", "3", "-1/5 + (3*I)/10", "0.0002369749599853333168387193 + 0.00008996209578666453955023634*I", "1", "1", "-1 + (3*I)/10", "-0.8311055859228710527021677 + 0.2073360436500721692194286*I", "1", "2", "-1 + (3*I)/10", "0.1455401550055480603645109 - 0.07267193472183533522977989*I", "1", "3", "-1 + (3*I)/10", "-0.02083627378227584305092946 + 0.01672552997230549172122192*I", "2", "1", "-1 + (3*I)/10", "-0.9073419079834184114447723 + 0.2464470365463464571609752*I", "2", "2", "-1 + (3*I)/10", "0.08376539924730892731282976 - 0.045405632659608804479704*I", "2", "3", "-1 + (3*I)/10", "-0.008166356600680041447558106 + 0.007121736557247280229634791*I", "3", "1", "-1 + (3*I)/10", "-0.9505841828121466238694754 + 0.2703335409661860138524939*I", "3", "2", "-1 + (3*I)/10", "0.04613568575261606910948221 - 0.02649226808945891578525802*I", "3", "3", "-1 + (3*I)/10", "-0.003076901614047636533503766 + 0.002865298661915431865476615*I", "1", "1", "-7/5 + (3*I)/10", "-1.092255930565444290873424 + 0.1872027187528210004638889*I", "1", "2", "-7/5 + (3*I)/10", "0.2507030731562681070931293 - 0.08246441686535181031534989*I", "1", "3", "-7/5 + (3*I)/10", "-0.04836674848597030757206477 + 0.02405657879061358055417332*I", "2", "1", "-7/5 + (3*I)/10", "-1.225636208433777830980876 + 0.2324146448166787965024073*I", "2", "2", "-7/5 + (3*I)/10", "0.1514213464117155295505894 - 0.0545567849979022294452559*I", "2", "3", "-7/5 + (3*I)/10", "-0.0202370471983203649736778 + 0.01093086270702111560507259*I", "3", "1", "-7/5 + (3*I)/10", "-1.304711331517666307849045 + 0.2615065000784211344732767*I", "3", "2", "-7/5 + (3*I)/10", "0.08643429001568645798547407 - 0.03319415276445834766819764*I", "3", "3", "-7/5 + (3*I)/10", "-0.008043667164485079944230409 + 0.004632973425413277692348251*I", "1", "1", "-3 + (3*I)/10", "-1.942551546682366732836815 + 0.1385113577988186448308648*I", "1", "2", "-3 + (3*I)/10", "0.7397577908011303261178357 - 0.09615281833074637614887741*I", "1", "3", "-3 + (3*I)/10", "-0.2374827198203849556295063 + 0.0444555740229337148101881*I", "2", "1", "-3 + (3*I)/10", "-2.351553051208418782513253 + 0.1938593564424504357210138*I", "2", "2", "-3 + (3*I)/10", "0.5041313667167973137464733 - 0.07407505829641226394882236*I", "2", "3", "-3 + (3*I)/10", "-0.1152322031792111205458574 + 0.02390870793562240883880077*I", "3", "1", "-3 + (3*I)/10", "-2.622680415628126177913255 + 0.2348348146600913992121239*I", "3", "2", "-3 + (3*I)/10", "0.3155888092146481843947796 - 0.05056466301637635689587639*I", "3", "3", "-3 + (3*I)/10", "-0.05178609922359599756648275 + 0.01163245402672827483911887*I", "1", "1", "-1/5 - (7*I)/5", "-0.4881017391704919698644137 - 1.135412444586148945381494*I", "1", "2", "-1/5 - (7*I)/5", "-0.1971656061670911303773324 + 0.2830489021195984451067474*I", "1", "3", "-1/5 - (7*I)/5", "0.08327801417600615009074186 + 0.001704672880135397041794967*I", "2", "1", "-1/5 - (7*I)/5", "-0.3756042722949367843163278 - 1.276742330773723026583351*I", "2", "2", "-1/5 - (7*I)/5", "-0.1425543292510341605176513 + 0.1371689738219304202869984*I", "2", "3", "-1/5 - (7*I)/5", "0.03200226354857854335390015 + 0.008484129594088192242994194*I", "3", "1", "-1/5 - (7*I)/5", "-0.2989787245379329728481531 - 1.343931693249974927004725*I", "3", "2", "-1/5 - (7*I)/5", "-0.08768206779922630788149317 + 0.06312126273316916646478938*I", "3", "3", "-1/5 - (7*I)/5", "0.0113129385853053859543144 + 0.005457767175425329169967248*I", "1", "1", "-1 - (7*I)/5", "-0.9908545815305659001669631 - 0.9174238158763567154670398*I", "1", "2", "-1 - (7*I)/5", "0.07158866870852659804528872 + 0.3848933976593964916851421*I", "1", "3", "-1 - (7*I)/5", "0.04104500496256023042828098 - 0.08830136129011211863744217*I", "2", "1", "-1 - (7*I)/5", "-1.019925023746657680786921 - 1.124595552357277967090879*I", "2", "2", "-1 - (7*I)/5", "0.01094531629637096576106268 + 0.2391481544336993271405549*I", "2", "3", "-1 - (7*I)/5", "0.02357505184715364176504762 - 0.03439362632057322142473194*I", "3", "1", "-1 - (7*I)/5", "-1.021499207085205316693109 - 1.249910330188513806434707*I", "3", "2", "-1 - (7*I)/5", "-0.007882374362414223985282586 + 0.1373380367744643419880309*I", "3", "3", "-1 - (7*I)/5", "0.01131346671394310166327279 - 0.01249777055577485543723401*I", "1", "1", "-7/5 - (7*I)/5", "-1.219555621006325199438054 - 0.8393745907107140203389614*I", "1", "2", "-7/5 - (7*I)/5", "0.2032677355467648046702975 + 0.4125491216559647513257176*I", "1", "3", "-7/5 - (7*I)/5", "0.004251513439720678915835991 - 0.1220075446358158947006697*I", "2", "1", "-7/5 - (7*I)/5", "-1.320619838306054643300648 - 1.065892704705797834077402*I", "2", "2", "-7/5 - (7*I)/5", "0.09622408133639172555129377 + 0.2731105405145626022369582*I", "2", "3", "-7/5 - (7*I)/5", "0.00951544830063435766599513 - 0.05325436913012775421685466*I", "3", "1", "-7/5 - (7*I)/5", "-1.367189039383852145686536 - 1.211304952533601220820439*I", "3", "2", "-7/5 - (7*I)/5", "0.04191859292832405903506325 + 0.1649890654426153562624566*I", "3", "3", "-7/5 - (7*I)/5", "0.00650742909654574627250664 - 0.02154883251720226822552705*I", "1", "1", "-3 - (7*I)/5", "-2.006259543508918559280738 - 0.6354714738426061956495618*I", "1", "2", "-3 - (7*I)/5", "0.7334357233719708844030849 + 0.4542190668645801440306082*I", "1", "3", "-3 - (7*I)/5", "-0.209564820779042583816149 - 0.2124232415316877464738453*I", "2", "1", "-3 - (7*I)/5", "-2.407691021662430819635011 - 0.8973481314410885673384452*I", "2", "2", "-3 - (7*I)/5", "0.4825248461079058792674081 + 0.3512296398074683129878294*I", "2", "3", "-3 - (7*I)/5", "-0.09410081400094719179439828 - 0.1137427094521510277377264*I", "3", "1", "-3 - (7*I)/5", "-2.664589576762315164690982 - 1.091708967972938645662153*I", "3", "2", "-3 - (7*I)/5", "0.2919106864477335633096292 + 0.2398489133615198556169296*I", "3", "3", "-3 - (7*I)/5", "-0.03903027674986962142416068 - 0.05495539307612344158160473*I", "-999"}; ginac-1.7.8.orig/check/exam_lsolve.cpp0000644000000000000000000001335713457611471014556 0ustar /** @file exam_lsolve.cpp * * These exams test solving small linear systems of symbolic equations. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; static unsigned exam_lsolve1() { // A trivial example. unsigned result = 0; symbol x("x"); ex eq, aux; eq = (3*x+5 == numeric(8)); aux = lsolve(eq, x); if (aux != 1) { ++result; clog << "solution of 3*x+5==8 erroneously returned " << aux << endl; } return result; } static unsigned exam_lsolve2a() { // An example from the Maple online help. unsigned result = 0; symbol a("a"), b("b"), x("x"), y("y"); lst eqns, vars; ex sol; // Create the linear system [a*x+b*y==3,x-y==b]... eqns.append(a*x+b*y==3).append(x-y==b); // ...to be solved for [x,y]... vars.append(x).append(y); // ...and solve it: sol = lsolve(eqns, vars); ex sol_x = sol.op(0).rhs(); // rhs of solution for first variable (x) ex sol_y = sol.op(1).rhs(); // rhs of solution for second variable (y) // It should have returned [x==(3+b^2)/(a+b),y==(3-a*b)/(a+b)] if (!normal(sol_x - (3+pow(b,2))/(a+b)).is_zero() || !normal(sol_y - (3-a*b)/(a+b)).is_zero()) { ++result; clog << "solution of the system " << eqns << " for " << vars << " erroneously returned " << sol << endl; } return result; } static unsigned exam_lsolve2b() { // A boring example from Mathematica's online help. unsigned result = 0; symbol x("x"), y("y"); lst eqns, vars; ex sol; // Create the linear system [3*x+y==7,2*x-5*y==8]... eqns.append(3*x+y==7).append(2*x-5*y==8); // ...to be solved for [x,y]... vars.append(x).append(y); // ...and solve it: sol = lsolve(eqns, vars); ex sol_x = sol.op(0).rhs(); // rhs of solution for first variable (x) ex sol_y = sol.op(1).rhs(); // rhs of solution for second variable (y) // It should have returned [x==43/17,y==-10/17] if ((sol_x != numeric(43,17)) || (sol_y != numeric(-10,17))) { ++result; clog << "solution of the system " << eqns << " for " << vars << " erroneously returned " << sol << endl; } return result; } static unsigned exam_lsolve2c() { // A more interesting example from the Maple online help. unsigned result = 0; symbol x("x"), y("y"); lst eqns, vars; ex sol; // Create the linear system [I*x+y==1,I*x-y==2]... eqns.append(I*x+y==1).append(I*x-y==2); // ...to be solved for [x,y]... vars.append(x).append(y); // ...and solve it: sol = lsolve(eqns, vars); ex sol_x = sol.op(0).rhs(); // rhs of solution for first variable (x) ex sol_y = sol.op(1).rhs(); // rhs of solution for second variable (y) // It should have returned [x==-3/2*I,y==-1/2] if ((sol_x != numeric(-3,2)*I) || (sol_y != numeric(-1,2))) { ++result; clog << "solution of the system " << eqns << " for " << vars << " erroneously returned " << sol << endl; } return result; } static unsigned exam_lsolve2S() { // A degenerate example that went wrong in GiNaC 0.6.2. unsigned result = 0; symbol x("x"), y("y"), t("t"); lst eqns, vars; ex sol; // Create the linear system [0*x+0*y==0,0*x+1*y==t]... eqns.append(0*x+0*y==0).append(0*x+1*y==t); // ...to be solved for [x,y]... vars.append(x).append(y); // ...and solve it: sol = lsolve(eqns, vars); ex sol_x = sol.op(0).rhs(); // rhs of solution for first variable (x) ex sol_y = sol.op(1).rhs(); // rhs of solution for second variable (y) // It should have returned [x==x,y==t] if ((sol_x != x) || (sol_y != t)) { ++result; clog << "solution of the system " << eqns << " for " << vars << " erroneously returned " << sol << endl; } return result; } static unsigned exam_lsolve3S() { // A degenerate example that went wrong while trying to improve elimination unsigned result = 0; symbol b("b"), c("c"); symbol x("x"), y("y"), z("z"); lst eqns, vars; ex sol; // Create the linear system [y+z==b,-y+z==c] with one additional row... eqns.append(ex(0)==ex(0)).append(b==z+y).append(c==z-y); // ...to be solved for [x,y,z]... vars.append(x).append(y).append(z); // ...and solve it: sol = lsolve(eqns, vars); ex sol_x = sol.op(0).rhs(); // rhs of solution for first variable (x) ex sol_y = sol.op(1).rhs(); // rhs of solution for second variable (y) ex sol_z = sol.op(2).rhs(); // rhs of solution for third variable (z) // It should have returned [x==x,y==t,] if ((sol_x != x) || (sol_y != (b-c)/2) || (sol_z != (b+c)/2)) { ++result; clog << "solution of the system " << eqns << " for " << vars << " erroneously returned " << sol << endl; } return result; } unsigned exam_lsolve() { unsigned result = 0; cout << "examining linear solve" << flush; result += exam_lsolve1(); cout << '.' << flush; result += exam_lsolve2a(); cout << '.' << flush; result += exam_lsolve2b(); cout << '.' << flush; result += exam_lsolve2c(); cout << '.' << flush; result += exam_lsolve2S(); cout << '.' << flush; result += exam_lsolve3S(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return exam_lsolve(); } ginac-1.7.8.orig/check/exam_matrices.cpp0000644000000000000000000002430513457611471015054 0ustar /** @file exam_matrices.cpp * * Here we examine manipulations on GiNaC's symbolic matrices. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include #include using namespace std; static unsigned matrix_determinants() { unsigned result = 0; ex det; matrix m1(1,1), m2(2,2), m3(3,3), m4(4,4); symbol a("a"), b("b"), c("c"); symbol d("d"), e("e"), f("f"); symbol g("g"), h("h"), i("i"); // check symbolic trivial matrix determinant m1 = matrix{{a}}; det = m1.determinant(); if (det != a) { clog << "determinant of 1x1 matrix " << m1 << " erroneously returned " << det << endl; ++result; } // check generic dense symbolic 2x2 matrix determinant m2 = matrix{{a, b}, {c, d}}; det = m2.determinant(); if (det != (a*d-b*c)) { clog << "determinant of 2x2 matrix " << m2 << " erroneously returned " << det << endl; ++result; } // check generic dense symbolic 3x3 matrix determinant m3 = matrix{{a, b, c}, {d, e, f}, {g, h, i}}; det = m3.determinant(); if (det != (a*e*i - a*f*h - d*b*i + d*c*h + g*b*f - g*c*e)) { clog << "determinant of 3x3 matrix " << m3 << " erroneously returned " << det << endl; ++result; } // check dense numeric 3x3 matrix determinant m3 = matrix{{0, -1, 3}, {3, -2, 2}, {3, 4, -2}}; det = m3.determinant(); if (det != 42) { clog << "determinant of 3x3 matrix " << m3 << " erroneously returned " << det << endl; ++result; } // check dense symbolic 2x2 matrix determinant m2 = matrix{{a/(a-b), 1}, {b/(a-b), 1}}; det = m2.determinant(); if (det != 1) { if (det.normal() == 1) // only half wrong clog << "determinant of 2x2 matrix " << m2 << " was returned unnormalized as " << det << endl; else // totally wrong clog << "determinant of 2x2 matrix " << m2 << " erroneously returned " << det << endl; ++result; } // check sparse symbolic 4x4 matrix determinant m4.set(0,1,a).set(1,0,b).set(3,2,c).set(2,3,d); det = m4.determinant(); if (det != a*b*c*d) { clog << "determinant of 4x4 matrix " << m4 << " erroneously returned " << det << endl; ++result; } // check characteristic polynomial m3 = matrix{{a, -2, 2}, {3, a-1, 2}, {3, 4, a-3}}; ex p = m3.charpoly(a); if (p != 0) { clog << "charpoly of 3x3 matrix " << m3 << " erroneously returned " << p << endl; ++result; } return result; } static unsigned matrix_invert1() { unsigned result = 0; matrix m(1,1); symbol a("a"); m.set(0,0,a); matrix m_i = m.inverse(); if (m_i(0,0) != pow(a,-1)) { clog << "inversion of 1x1 matrix " << m << " erroneously returned " << m_i << endl; ++result; } return result; } static unsigned matrix_invert2() { unsigned result = 0; symbol a("a"), b("b"), c("c"), d("d"); matrix m = {{a, b}, {c, d}}; matrix m_i = m.inverse(); ex det = m.determinant(); if ((normal(m_i(0,0)*det) != d) || (normal(m_i(0,1)*det) != -b) || (normal(m_i(1,0)*det) != -c) || (normal(m_i(1,1)*det) != a)) { clog << "inversion of 2x2 matrix " << m << " erroneously returned " << m_i << endl; ++result; } return result; } static unsigned matrix_invert3() { unsigned result = 0; symbol a("a"), b("b"), c("c"); symbol d("d"), e("e"), f("f"); symbol g("g"), h("h"), i("i"); matrix m = {{a, b, c}, {d, e, f}, {g, h, i}}; matrix m_i = m.inverse(); ex det = m.determinant(); if ((normal(m_i(0,0)*det) != (e*i-f*h)) || (normal(m_i(0,1)*det) != (c*h-b*i)) || (normal(m_i(0,2)*det) != (b*f-c*e)) || (normal(m_i(1,0)*det) != (f*g-d*i)) || (normal(m_i(1,1)*det) != (a*i-c*g)) || (normal(m_i(1,2)*det) != (c*d-a*f)) || (normal(m_i(2,0)*det) != (d*h-e*g)) || (normal(m_i(2,1)*det) != (b*g-a*h)) || (normal(m_i(2,2)*det) != (a*e-b*d))) { clog << "inversion of 3x3 matrix " << m << " erroneously returned " << m_i << endl; ++result; } return result; } static unsigned matrix_solve2() { // check the solution of the multiple system A*X = B: // [ 1 2 -1 ] [ x0 y0 ] [ 4 0 ] // [ 1 4 -2 ]*[ x1 y1 ] = [ 7 0 ] // [ a -2 2 ] [ x2 y2 ] [ a 4 ] unsigned result = 0; symbol a("a"); symbol x0("x0"), x1("x1"), x2("x2"); symbol y0("y0"), y1("y1"), y2("y2"); matrix A = {{1, 2, -1}, {1, 4, -2}, {a, -2, 2}}; matrix B = {{4, 0}, {7, 0}, {a, 4}}; matrix X = {{x0 ,y0}, {x1, y1}, {x2, y2}}; matrix cmp = {{1, 0}, {3, 2}, {3, 4}}; matrix sol(A.solve(X, B)); if (cmp != sol) { clog << "Solving " << A << " * " << X << " == " << B << endl << "erroneously returned " << sol << endl; result = 1; } return result; } static unsigned matrix_solve3() { unsigned result = 0; symbol x("x"); symbol t1("t1"), t2("t2"), t3("t3"); matrix A = { {3+6*x, 6*(x+x*x)/(2+3*x), 0}, {-(2+7*x+6*x*x)/x, -2-2*x, 0}, {-2*(2+3*x)/(1+2*x), -6*x/(1+2*x), 1+4*x} }; matrix B = {{0}, {0}, {0}}; matrix X = {{t1}, {t2}, {t3}}; for (auto algo : vector({ solve_algo::gauss, solve_algo::divfree, solve_algo::bareiss, solve_algo::markowitz })) { matrix sol(A.solve(X, B, algo)); if (!normal((A*sol - B).evalm()).is_zero_matrix()) { clog << "Solving " << A << " * " << X << " == " << B << " with algo=" << algo << endl << "erroneously returned " << sol << endl; result += 1; } } return result; } static unsigned matrix_evalm() { unsigned result = 0; matrix S {{1, 2}, {3, 4}}; matrix T {{1, 1}, {2, -1}}; matrix R {{27, 14}, {36, 26}}; ex e = ((S + T) * (S + 2*T)); ex f = e.evalm(); if (!f.is_equal(R)) { clog << "Evaluating " << e << " erroneously returned " << f << " instead of " << R << endl; result++; } return result; } static unsigned matrix_rank() { unsigned result = 0; symbol x("x"), y("y"); matrix m(3,3); // the zero matrix always has rank 0 if (m.rank() != 0) { clog << "The rank of " << m << " was not computed correctly." << endl; ++result; } // a trivial rank one example m = {{1, 0, 0}, {2, 0, 0}, {3, 0, 0}}; if (m.rank() != 1) { clog << "The rank of " << m << " was not computed correctly." << endl; ++result; } // an example from Maple's help with rank two m = {{x, 1, 0}, {0, 0, 1}, {x*y, y, 1}}; if (m.rank() != 2) { clog << "The rank of " << m << " was not computed correctly." << endl; ++result; } // the 3x3 unit matrix has rank 3 m = ex_to(unit_matrix(3,3)); if (m.rank() != 3) { clog << "The rank of " << m << " was not computed correctly." << endl; ++result; } return result; } unsigned matrix_solve_nonnormal() { symbol a("a"), b("b"), c("c"), x("x"); // This matrix has a non-normal zero element! matrix mx {{1,0,0}, {0,1/(x+1)-(x-1)/(x*x-1),1}, {0,0,0}}; matrix zero {{0}, {0}, {0}}; matrix vars {{a}, {b}, {c}}; try { matrix sol_gauss = mx.solve(vars, zero, solve_algo::gauss); matrix sol_divfree = mx.solve(vars, zero, solve_algo::divfree); matrix sol_bareiss = mx.solve(vars, zero, solve_algo::bareiss); if (sol_gauss != sol_divfree || sol_gauss != sol_bareiss) { clog << "different solutions while solving " << mx << " * " << vars << " == " << zero << endl << "gauss: " << sol_gauss << endl << "divfree: " << sol_divfree << endl << "bareiss: " << sol_bareiss << endl; return 1; } } catch (const exception & e) { clog << "exception thrown while solving " << mx << " * " << vars << " == " << zero << endl; return 1; } return 0; } static unsigned matrix_misc() { unsigned result = 0; symbol a("a"), b("b"), c("c"), d("d"), e("e"), f("f"); matrix m1 = {{a, b}, {c, d}}; ex tr = trace(m1); // check a simple trace if (tr.compare(a+d)) { clog << "trace of 2x2 matrix " << m1 << " erroneously returned " << tr << endl; ++result; } // and two simple transpositions matrix m2 = transpose(m1); if (m2(0,0) != a || m2(0,1) != c || m2(1,0) != b || m2(1,1) != d) { clog << "transpose of 2x2 matrix " << m1 << " erroneously returned " << m2 << endl; ++result; } matrix m3 = {{a, b}, {c, d}, {e, f}}; if (transpose(transpose(m3)) != m3) { clog << "transposing 3x2 matrix " << m3 << " twice" << " erroneously returned " << transpose(transpose(m3)) << endl; ++result; } // produce a runtime-error by inverting a singular matrix and catch it matrix m4(2,2); matrix m5; bool caught = false; try { m5 = inverse(m4); } catch (std::runtime_error err) { caught = true; } if (!caught) { cerr << "singular 2x2 matrix " << m4 << " erroneously inverted to " << m5 << endl; ++result; } return result; } unsigned exam_matrices() { unsigned result = 0; cout << "examining symbolic matrix manipulations" << flush; result += matrix_determinants(); cout << '.' << flush; result += matrix_invert1(); cout << '.' << flush; result += matrix_invert2(); cout << '.' << flush; result += matrix_invert3(); cout << '.' << flush; result += matrix_solve2(); cout << '.' << flush; result += matrix_solve3(); cout << '.' << flush; result += matrix_evalm(); cout << "." << flush; result += matrix_rank(); cout << "." << flush; result += matrix_solve_nonnormal(); cout << "." << flush; result += matrix_misc(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return exam_matrices(); } ginac-1.7.8.orig/check/exam_misc.cpp0000644000000000000000000002050313457611471014174 0ustar /** @file exam_misc.cpp * */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; #define VECSIZE 30 static unsigned exam_expand_subs() { unsigned result = 0; symbol a[VECSIZE]; ex e, aux; for (unsigned i=0; i(selfprobe)) { clog << "ex (of numeric) after self-assignment became " << selfprobe << endl; ++result; } return result; } /* This checks whether subs() works as intended in some special cases. */ static unsigned exam_subs() { unsigned result = 0; symbol x("x"); ex e1, e2; // This used to fail in GiNaC 1.0.5 because it first substituted // x+1 -> (x-1)+1 -> x, and then substituted again x -> x-1, giving // the wrong result e1 = x+1; e2 = e1.subs(x == x-1); if (!e2.is_equal(x)) { clog << "(x+1).subs(x==x-1) erroneously returned " << e2 << " instead of x" << endl; ++result; } // And this used to fail in GiNaC 1.5.8 because it first substituted // exp(x) -> exp(log(x)) -> x, and then substituted again x -> log(x) e1 = exp(x); e2 = e1.subs(x == log(x)); if (!e2.is_equal(x)) { clog << "exp(x).subs(x==log(x)) erroneously returned " << e2 << " instead of x" << endl; ++result; } e1 = sin(1+sin(x)); e2 = e1.subs(sin(wild()) == cos(wild())); if (!e2.is_equal(cos(1+cos(x)))) { clog << "sin(1+sin(x)).subs(sin($1)==cos($1)) erroneously returned " << e2 << " instead of cos(1+cos(x))" << endl; ++result; } return result; } /* Joris van der Hoeven (he of TeXmacs fame) is a funny guy. He has his own * ideas what a symbolic system should do. Let's make sure we won't disappoint * him some day. Incidentally, this seems to always have worked. */ static unsigned exam_joris() { unsigned result = 0; symbol x("x"); ex e = expand(pow(x, x-1) * x); if (e != pow(x, x)) { clog << "x^(x-1)*x did not expand to x^x. Please call Joris!" << endl; ++result; } return result; } /* Test Chris Dams' algebraic substitutions. */ static unsigned exam_subs_algebraic() { unsigned result = 0; symbol x("x"), y("y"); ex e = ex(x*x*x*y*y).subs(x*y==2, subs_options::algebraic); if (e != 4*x) { clog << "(x^3*y^2).subs(x*y==2,subs_options::algebraic) erroneously returned " << e << endl; ++result; } e = ex(x*x*x*x*x).subs(x*x==y, subs_options::algebraic); if (e != y*y*x) { clog << "x^5.subs(x^2==y,subs_options::algebraic) erroneously returned " << e << endl; ++result; } e=x*x*y; if (!e.has(x*y, has_options::algebraic)) { clog << "(x^2*y).has(x*y, has_options::algebraic) erroneously returned false." << endl; ++result; } if (e.has(x*y*y, has_options::algebraic)) { clog << "(x^2*y).has(x*y*y, has_options::algebraic) erroneously returned true." << endl; ++result; } e=x*x*x*y; if (!e.has(x*x, has_options::algebraic)) { clog << "(x^3*y).has(x*x, has_options::algebraic) erroneously returned false." << endl; ++result; } if (e.has(y*y, has_options::algebraic)) { clog << "(x^3*y).has(y*y, has_options::algebraic) erroneously returned true." << endl; ++result; } return result; } unsigned exam_misc() { unsigned result = 0; cout << "examining miscellaneous other things" << flush; result += exam_expand_subs(); cout << '.' << flush; result += exam_expand_subs2(); cout << '.' << flush; result += exam_expand_power(); cout << '.' << flush; result += exam_sqrfree(); cout << '.' << flush; result += exam_operator_semantics(); cout << '.' << flush; result += exam_subs(); cout << '.' << flush; result += exam_joris(); cout << '.' << flush; result += exam_subs_algebraic(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return exam_misc(); } ginac-1.7.8.orig/check/exam_mod_gcd.cpp0000644000000000000000000000601313457611471014635 0ustar /** @file exam_misc.cpp * * Testing modular GCD. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include #include #include #include #include "polynomial/upoly.h" #include "polynomial/upoly_io.h" #include "polynomial/mod_gcd.h" #include "ginac.h" using namespace GiNaC; static upoly ex_to_upoly(const ex& e, const symbol& x); static ex upoly_to_ex(const upoly& p, const symbol& x); // make a univariate polynomial \in Z[x] of degree deg static upoly make_random_upoly(const std::size_t deg); static void run_test_once(const std::size_t deg) { static const symbol xsym("x"); const upoly a = make_random_upoly(deg); const upoly b = make_random_upoly(deg); upoly g; mod_gcd(g, a, b); ex ea = upoly_to_ex(a, xsym); ex eb = upoly_to_ex(b, xsym); ex eg = gcd(ea, eb); const upoly g_check = ex_to_upoly(eg, xsym); if (g != g_check) { std::cerr << "a = " << a << std::endl; std::cerr << "b = " << b << std::endl; std::cerr << "mod_gcd(a, b) = " << g << std::endl; std::cerr << "sr_gcd(a, b) = " << g_check << std::endl; throw std::logic_error("bug in mod_gcd"); } } int main(int argc, char** argv) { std::cout << "examining modular gcd. "; std::map n_map; // run 256 tests with polynomials of degree 10 n_map[10] = 256; // run 32 tests with polynomials of degree 100 n_map[100] = 32; std::map::const_iterator i = n_map.begin(); for (; i != n_map.end(); ++i) { for (std::size_t k = 0; k < i->second; ++k) run_test_once(i->first); } return 0; } static upoly ex_to_upoly(const ex& e, const symbol& x) { upoly p(e.degree(x) + 1); for (int i = 0; i <= e.degree(x); ++i) p[i] = cln::the(ex_to(e.coeff(x, i)).to_cl_N()); return p; } static ex upoly_to_ex(const upoly& p, const symbol& x) { exvector tv(p.size()); for (std::size_t i = 0; i < p.size(); ++i) tv[i] = pow(x, i)*numeric(p[i]); return dynallocate(tv); } static upoly make_random_upoly(const std::size_t deg) { static const cln::cl_I biggish("98765432109876543210"); upoly p(deg + 1); for (std::size_t i = 0; i <= deg; ++i) p[i] = cln::random_I(biggish); // Make sure the leading coefficient is non-zero while (zerop(p[deg])) p[deg] = cln::random_I(biggish); return p; } ginac-1.7.8.orig/check/exam_normalization.cpp0000644000000000000000000001452113457611471016132 0ustar /** @file exam_normalization.cpp * * Rational function normalization test suite. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; static symbol w("w"), x("x"), y("y"), z("z"); static unsigned check_normal(const ex &e, const ex &d) { ex en = e.normal(); if (!en.is_equal(d)) { clog << "normal form of " << e << " erroneously returned " << en << " (should be " << d << ")" << endl; return 1; } return 0; } static unsigned exam_normal1() { unsigned result = 0; ex e, d; // Expansion e = pow(x, 2) - (x+1)*(x-1) - 1; d = 0; result += check_normal(e, d); // Expansion inside functions e = sin(x*(x+1)-x) + 1; d = sin(pow(x, 2)) + 1; result += check_normal(e, d); // Fraction addition e = 2/x + y/3; d = (x*y + 6) / (x*3); result += check_normal(e, d); e = pow(x, -1) + x/(x+1); d = (pow(x, 2)+x+1)/(x*(x+1)); result += check_normal(e, d); return result; } static unsigned exam_normal2() { unsigned result = 0; ex e, d; // Fraction cancellation e = numeric(1)/2 * z * (2*x + 2*y); d = z * (x + y); result += check_normal(e, d); e = numeric(1)/6 * z * (3*x + 3*y) * (2*x + 2*w); d = z * (x + y) * (x + w); result += check_normal(e, d); e = (3*x + 3*y) * (w/3 + z/3); d = (x + y) * (w + z); result += check_normal(e, d); // Fails stochastically with the new tinfo mechanism, because // sometimes the equivalent answer ... / pow(y - x, 2) is calculated. // TODO: make check for both cases. // e = (pow(x, 2) - pow(y, 2)) / pow(x-y, 3); // d = (x + y) / pow(x - y, 2); // result += check_normal(e, d); e = (pow(x, -1) + x) / (pow(x , 2) * 2 + 2); d = pow(x * 2, -1); result += check_normal(e, d); // Fails stochastically with the new tinfo mechanism, because // sometimes the equivalent answer ... / pow(y - x, 2) is calculated. // TODO: make check for both cases. // Fraction cancellation with rational coefficients // e = (pow(x, 2) - pow(y, 2)) / pow(x/2 - y/2, 3); // d = (8 * x + 8 * y) / pow(x - y, 2); // result += check_normal(e, d); // Fraction cancellation with rational coefficients e = z/5 * (x/7 + y/10) / (x/14 + y/20); d = 2*z/5; result += check_normal(e, d); return result; } static unsigned exam_normal3() { unsigned result = 0; ex e, d; // Distribution of powers e = pow(x/y, 2); d = pow(x, 2) / pow(y, 2); result += check_normal(e, d); // Distribution of powers (integer, distribute) and fraction addition e = pow(pow(x, -1) + x, 2); d = pow(pow(x, 2) + 1, 2) / pow(x, 2); result += check_normal(e, d); // Distribution of powers (non-integer, don't distribute) and fraction addition e = pow(pow(x, -1) + x, numeric(1)/2); d = pow((pow(x, 2) + 1) / x, numeric(1)/2); result += check_normal(e, d); return result; } static unsigned exam_normal4() { unsigned result = 0; ex e, d; // Replacement of functions with temporary symbols and fraction cancellation e = pow(sin(x), 2) - pow(cos(x), 2); e /= sin(x) + cos(x); d = sin(x) - cos(x); result += check_normal(e, d); // Replacement of non-integer powers with temporary symbols e = (pow(numeric(2), numeric(1)/2) * x + x) / x; d = pow(numeric(2), numeric(1)/2) + 1; result += check_normal(e, d); // Replacement of complex numbers with temporary symbols e = (x + y + x*I + y*I) / (x + y); d = 1 + I; result += check_normal(e, d); e = (pow(x, 2) + pow(y, 2)) / (x + y*I); d = e; result += check_normal(e, d); // More complex rational function e = (pow(x-y*2,4)/pow(pow(x,2)-pow(y,2)*4,2)+1)*(x+y*2)*(y+z)/(pow(x,2)+pow(y,2)*4); d = (y*2 + z*2) / (x + y*2); result += check_normal(e, d); // Replacement of nested functions with temporary symbols e = x/(sqrt(sin(z)-1)) + y/(sqrt(sin(z)-1)); d = (x + y)/(sqrt(sin(z)-1)); result += check_normal(e, d); return result; } /* Test content(), integer_content(), primpart(). */ static unsigned check_content(const ex & e, const ex & x, const ex & ic, const ex & c, const ex & pp) { unsigned result = 0; ex r_ic = e.integer_content(); if (!r_ic.is_equal(ic)) { clog << "integer_content(" << e << ") erroneously returned " << r_ic << " instead of " << ic << endl; ++result; } ex r_c = e.content(x); if (!r_c.is_equal(c)) { clog << "content(" << e << ", " << x << ") erroneously returned " << r_c << " instead of " << c << endl; ++result; } ex r_pp = e.primpart(x); if (!r_pp.is_equal(pp)) { clog << "primpart(" << e << ", " << x << ") erroneously returned " << r_pp << " instead of " << pp << endl; ++result; } ex r = r_c*r_pp*e.unit(x); if (!(r - e).expand().is_zero()) { clog << "product of unit, content, and primitive part of " << e << " yielded " << r << " instead of " << e << endl; ++result; } return result; } static unsigned exam_content() { unsigned result = 0; symbol x("x"), y("y"); result += check_content(ex(-3)/4, x, ex(3)/4, ex(3)/4, 1); result += check_content(-x/4, x, ex(1)/4, ex(1)/4, x); result += check_content(5*x-15, x, 5, 5, x-3); result += check_content(5*x*y-15*y*y, x, 5, 5*y, x-3*y); result += check_content(-15*x/2+ex(25)/3, x, ex(5)/6, ex(5)/6, 9*x-10); result += check_content(-x*y, x, 1, y, x); return result; } unsigned exam_normalization() { unsigned result = 0; cout << "examining rational function normalization" << flush; result += exam_normal1(); cout << '.' << flush; result += exam_normal2(); cout << '.' << flush; result += exam_normal3(); cout << '.' << flush; result += exam_normal4(); cout << '.' << flush; result += exam_content(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return exam_normalization(); } ginac-1.7.8.orig/check/exam_numeric.cpp0000644000000000000000000003010313457611471014700 0ustar /** @file exam_numeric.cpp * * These exams creates some numbers and check the result of several Boolean * tests on these numbers like is_integer() etc... */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include #include using namespace std; /* Simple and maybe somewhat pointless consistency tests of assorted tests and * conversions. */ static unsigned exam_numeric1() { unsigned result = 0; numeric test_int1(42); numeric test_int2(5); numeric test_rat1 = test_int1; test_rat1 /= test_int2; test_rat1 = -test_rat1; // -42/5 numeric test_crat = test_rat1+I*test_int2; // 5*I-42/5 symbol a("a"); ex e1, e2; if (!test_int1.is_integer()) { clog << test_int1 << " erroneously not recognized as integer" << endl; ++result; } if (!test_int1.is_rational()) { clog << test_int1 << " erroneously not recognized as rational" << endl; ++result; } if (!test_rat1.is_rational()) { clog << test_rat1 << " erroneously not recognized as rational" << endl; ++result; } if (test_rat1.is_integer()) { clog << test_rat1 << " erroneously recognized as integer" << endl; ++result; } if (!test_crat.is_crational()) { clog << test_crat << " erroneously not recognized as complex rational" << endl; ++result; } if (test_crat.info(info_flags::nonnegative)) { clog << test_crat << " erroneously recognized as non-negative number" << endl; ++result; } int i = numeric(1984).to_int(); if (i-1984) { clog << "conversion of " << i << " from numeric to int failed" << endl; ++result; } e1 = test_int1; if (!e1.info(info_flags::posint)) { clog << "expression " << e1 << " erroneously not recognized as positive integer" << endl; ++result; } e2 = test_int1 + a; if (e2.info(info_flags::integer)) { clog << "expression " << e2 << " erroneously recognized as integer" << endl; ++result; } // The next two were two actual bugs in CLN till June, 12, 1999: test_rat1 = numeric(3)/numeric(2); test_rat1 += test_rat1; if (!test_rat1.is_integer()) { clog << "3/2 + 3/2 erroneously not integer 3 but instead " << test_rat1 << endl; ++result; } test_rat1 = numeric(3)/numeric(2); numeric test_rat2 = test_rat1 + numeric(1); // 5/2 test_rat2 -= test_rat1; // 1 if (!test_rat2.is_integer()) { clog << "5/2 - 3/2 erroneously not integer 1 but instead " << test_rat2 << endl; ++result; } return result; } /* We had some fun with a bug in CLN that caused it to loop forever when * calculating expt(a,b) if b is a rational and a a nonnegative integer. * Implementing a workaround sadly introduced another bug on May 28th 1999 * that was fixed on May 31st. The workaround turned out to be stupid and * the original bug in CLN was finally killed on September 2nd. */ static unsigned exam_numeric2() { unsigned result = 0; ex zero = numeric(0); ex two = numeric(2); ex three = numeric(3); // The hang in this code was the reason for the original workaround if (pow(two,two/three)==42) { clog << "pow(2,2/3) erroneously returned 42" << endl; ++result; // cannot happen } // Actually, this used to raise a FPE after introducing the workaround if (two*zero!=zero) { clog << "2*0 erroneously returned " << two*zero << endl; ++result; } // And this returned a cl_F due to the implicit call of numeric::power() ex six = two*three; if (!six.info(info_flags::integer)) { clog << "2*3 erroneously returned the non-integer " << six << endl; ++result; } // The fix in the workaround left a whole which was fixed hours later... ex another_zero = pow(zero,numeric(1)/numeric(2)); if (!another_zero.is_zero()) { clog << "pow(0,1/2) erroneously returned" << another_zero << endl; ++result; } return result; } /* Assorted tests to ensure some crucial functions behave exactly as specified * in the documentation. */ static unsigned exam_numeric3() { unsigned result = 0; numeric calc_rem, calc_quo; numeric a, b; // check if irem(a, b) and irem(a, b, q) really behave like Maple's // irem(a, b) and irem(a, b, 'q') as advertised in our documentation. // These overloaded routines indeed need to be checked separately since // internally they might be doing something completely different: a = 23; b = 4; calc_rem = irem(a, b); if (calc_rem != 3) { clog << "irem(" << a << "," << b << ") erroneously returned " << calc_rem << endl; ++result; } a = 23; b = -4; calc_rem = irem(a, b); if (calc_rem != 3) { clog << "irem(" << a << "," << b << ") erroneously returned " << calc_rem << endl; ++result; } a = -23; b = 4; calc_rem = irem(a, b); if (calc_rem != -3) { clog << "irem(" << a << "," << b << ") erroneously returned " << calc_rem << endl; ++result; } a = -23; b = -4; calc_rem = irem(a, b); if (calc_rem != -3) { clog << "irem(" << a << "," << b << ") erroneously returned " << calc_rem << endl; ++result; } // and now the overloaded irem(a,b,q): a = 23; b = 4; calc_rem = irem(a, b, calc_quo); if (calc_rem != 3 || calc_quo != 5) { clog << "irem(" << a << "," << b << ",q) erroneously returned " << calc_rem << " with q=" << calc_quo << endl; ++result; } a = 23; b = -4; calc_rem = irem(a, b, calc_quo); if (calc_rem != 3 || calc_quo != -5) { clog << "irem(" << a << "," << b << ",q) erroneously returned " << calc_rem << " with q=" << calc_quo << endl; ++result; } a = -23; b = 4; calc_rem = irem(a, b, calc_quo); if (calc_rem != -3 || calc_quo != -5) { clog << "irem(" << a << "," << b << ",q) erroneously returned " << calc_rem << " with q=" << calc_quo << endl; ++result; } a = -23; b = -4; calc_rem = irem(a, b, calc_quo); if (calc_rem != -3 || calc_quo != 5) { clog << "irem(" << a << "," << b << ",q) erroneously returned " << calc_rem << " with q=" << calc_quo << endl; ++result; } // check if iquo(a, b) and iquo(a, b, r) really behave like Maple's // iquo(a, b) and iquo(a, b, 'r') as advertised in our documentation. // These overloaded routines indeed need to be checked separately since // internally they might be doing something completely different: a = 23; b = 4; calc_quo = iquo(a, b); if (calc_quo != 5) { clog << "iquo(" << a << "," << b << ") erroneously returned " << calc_quo << endl; ++result; } a = 23; b = -4; calc_quo = iquo(a, b); if (calc_quo != -5) { clog << "iquo(" << a << "," << b << ") erroneously returned " << calc_quo << endl; ++result; } a = -23; b = 4; calc_quo = iquo(a, b); if (calc_quo != -5) { clog << "iquo(" << a << "," << b << ") erroneously returned " << calc_quo << endl; ++result; } a = -23; b = -4; calc_quo = iquo(a, b); if (calc_quo != 5) { clog << "iquo(" << a << "," << b << ") erroneously returned " << calc_quo << endl; ++result; } // and now the overloaded iquo(a,b,r): a = 23; b = 4; calc_quo = iquo(a, b, calc_rem); if (calc_quo != 5 || calc_rem != 3) { clog << "iquo(" << a << "," << b << ",r) erroneously returned " << calc_quo << " with r=" << calc_rem << endl; ++result; } a = 23; b = -4; calc_quo = iquo(a, b, calc_rem); if (calc_quo != -5 || calc_rem != 3) { clog << "iquo(" << a << "," << b << ",r) erroneously returned " << calc_quo << " with r=" << calc_rem << endl; ++result; } a = -23; b = 4; calc_quo = iquo(a, b, calc_rem); if (calc_quo != -5 || calc_rem != -3) { clog << "iquo(" << a << "," << b << ",r) erroneously returned " << calc_quo << " with r=" << calc_rem << endl; ++result; } a = -23; b = -4; calc_quo = iquo(a, b, calc_rem); if (calc_quo != 5 || calc_rem != -3) { clog << "iquo(" << a << "," << b << ",r) erroneously returned " << calc_quo << " with r=" << calc_rem << endl; ++result; } return result; } /* Now we perform some less trivial checks about several functions which should * return exact numbers if possible. */ static unsigned exam_numeric4() { unsigned result = 0; bool passed; // square roots of squares of integers: passed = true; for (int i=0; i<42; ++i) if (!sqrt(numeric(i*i)).is_integer()) passed = false; if (!passed) { clog << "One or more square roots of squares of integers did not return exact integers" << endl; ++result; } // square roots of squares of rationals: passed = true; for (int num=0; num<41; ++num) for (int den=1; den<42; ++den) if (!sqrt(numeric(num*num)/numeric(den*den)).is_rational()) passed = false; if (!passed) { clog << "One or more square roots of squares of rationals did not return exact integers" << endl; ++result; } return result; } /* This test examines that simplifications of the form 5^(3/2) -> 5*5^(1/2) * are carried out properly. */ static unsigned exam_numeric5() { unsigned result = 0; // A variation of one of Ramanujan's wonderful identities must be // verifiable with very primitive means: ex e1 = pow(1 + pow(3,numeric(1,5)) - pow(3,numeric(2,5)),3); ex e2 = expand(e1 - 10 + 5*pow(3,numeric(3,5))); if (!e2.is_zero()) { clog << "expand((1+3^(1/5)-3^(2/5))^3-10+5*3^(3/5)) returned " << e2 << " instead of 0." << endl; ++result; } return result; } /* This test checks whether the numeric output/parsing routines are consistent. */ static unsigned exam_numeric6() { unsigned result = 0; symbol sym("sym"); vector test_numbers; test_numbers.push_back(numeric(0)); // zero test_numbers.push_back(numeric(1)); // one test_numbers.push_back(numeric(-1)); // minus one test_numbers.push_back(numeric(42)); // positive integer test_numbers.push_back(numeric(-42)); // negative integer test_numbers.push_back(numeric(14,3)); // positive rational test_numbers.push_back(numeric(-14,3)); // negative rational test_numbers.push_back(numeric(3.141)); // positive decimal test_numbers.push_back(numeric(-3.141)); // negative decimal test_numbers.push_back(numeric(0.1974)); // positive decimal, leading zero test_numbers.push_back(numeric(-0.1974)); // negative decimal, leading zero test_numbers.push_back(sym); // symbol for (vector::const_iterator br=test_numbers.begin(); br::const_iterator bi=test_numbers.begin(); bi::const_iterator er=test_numbers.begin(); er::const_iterator ei=test_numbers.begin(); ei using namespace std; // The very first pair of historic problems had its roots in power.cpp and was // finally resolved on April 27th 1999. (Fixing the first on April 23rd // actually introduced the second.) static unsigned exam_paranoia1() { unsigned result = 0; symbol x("x"), y("y"), z("z"); ex e, f, g; e = x * y * z; f = y * z; g = e / f; // In the first one expand did not do any job at all: if (!g.expand().is_equal(x)) { clog << "e = x*y*z; f = y*z; expand(e/f) erroneously returned " << g.expand() << endl; ++result; } // This one somehow used to return 0: e = pow(x + 1, -1); if (!e.expand().is_equal(e)) { clog << "expand(pow(x + 1, -1)) erroneously returned " << e.expand() << endl; ++result; } return result; } // And here the second oops which showed up until May 17th 1999. It had to do // with lexicographic canonicalization and thus showed up only if the variables // had the names as given here: static unsigned exam_paranoia2() { unsigned result = 0; symbol x("x"), y("y"), z("z"); ex e, f, g; e = x + z*x; f = e*y; g = f - e*y; // After .eval(), g should be zero: if (!g.is_zero()) { clog << "e = (x + z*x); f = e*y; g = (f - e*y) erroneously returned g == " << g << endl; ++result; } return result; } // The third bug was introduced on May 18th 1999, discovered on May 19 and // fixed that same day. It worked when x was substituted by 1 but not with // other numbers: static unsigned exam_paranoia3() { unsigned result = 0; symbol x("x"), y("y"); ex e, f; e = x*y - y; f = e.subs(x == 2); if (!f.is_equal(y)) { clog << "e = x*y - y; f = e.subs(x == 2) erroneously returned " << f << endl; ++result; } return result; } // The fourth bug was also discovered on May 19th 1999 and fixed immediately: static unsigned exam_paranoia4() { unsigned result = 0; symbol x("x"); ex e, f, g; e = pow(x, 2) + x + 1; f = pow(x, 2) + x + 1; g = e - f; if (!g.is_zero()) { clog << "e = pow(x,2) + x + 1; f = pow(x,2) + x + 1; g = e-f; g erroneously returned " << g << endl; ++result; } return result; } // The fifth oops was discovered on May 20th 1999 and fixed a day later: static unsigned exam_paranoia5() { unsigned result = 0; symbol x("x"), y("y"); ex e, f; e = pow(x*y + 1, 2); f = pow(x, 2) * pow(y, 2) + 2*x*y + 1; if (!(e-f).expand().is_zero()) { clog << "e = pow(x*y+1,2); f = pow(x,2)*pow(y,2) + 2*x*y + 1; (e-f).expand() erroneously returned " << (e-f).expand() << endl; ++result; } return result; } // This one was discovered on Jun 1st 1999 and fixed the same day: static unsigned exam_paranoia6() { unsigned result = 0; symbol x("x"); ex e, f; e = pow(x, -5); f = e.denom(); if (!f.is_equal(pow(x, 5))) { clog << "e = pow(x, -5); f = e.denom(); f was " << f << " (should be x^5)" << endl; ++result; } return result; } // This one was introduced on June 1st 1999 by some aggressive manual // optimization. Discovered and fixed on June 2nd. static unsigned exam_paranoia7() { unsigned result = 0; symbol x("x"), y("y"); ex e = y + y*x + 2; ex f = expand(pow(e, 2) - (e*y*(x + 1))); if (f.nops() > 3) { clog << "e=y+y*x+2; f=expand(pow(e,2)-(e*y*(x+1))) has " << f.nops() << " arguments instead of 3 ( f==" << f << " )" << endl; ++result; } return result; } // This one was a result of the rewrite of mul::max_coefficient when we // introduced the overall_coefficient field in expairseq objects on Oct 1st // 1999. Fixed on Oct 4th. static unsigned exam_paranoia8() { unsigned result = 0; symbol x("x"); ex e = -x / (x+1); ex f; try { f = e.normal(); if (!f.is_equal(e)) { clog << "normal(-x/(x+1)) returns " << f << " instead of -x/(x+1)\n"; ++result; } } catch (const exception &err) { clog << "normal(-x/(x+1) throws " << err.what() << endl; ++result; } return result; } // This one was a result of a modification to frac_cancel() & Co. to avoid // expanding the numerator and denominator when bringing them from Q[X] to // Z[X]. multiply_lcm() forgot to multiply the x-linear term with the LCM of // the coefficient's denominators (2 in this case). Introduced on Jan 25th // 2000 and fixed on Jan 31th. static unsigned exam_paranoia9() { unsigned result = 0; symbol x("x"); ex e = (exp(-x)-2*x*exp(-x)+pow(x,2)/2*exp(-x))/exp(-x); ex f = e.normal(); if (!f.is_equal(1-2*x+pow(x,2)/2)) { clog << "normal(" << e << ") returns " << f << " instead of 1-2*x+1/2*x^2\n"; ++result; } return result; } // I have no idea when this broke. It has been working long ago, before 0.4.0 // and on Feb 13th 2000 I found out that things like 2^(3/2) throw an exception // "power::eval(): pow(0,0) is undefined" instead of simplifying to 2*2^(1/2). // It was fixed that same day. static unsigned exam_paranoia10() { unsigned result = 0; ex b = numeric(2); ex e = numeric(3,2); ex r; try { r = pow(b, e); if (!(r-2*sqrt(ex(2))).is_zero()) { clog << "2^(3/2) erroneously returned " << r << " instead of 2*sqrt(2)" << endl; ++result; } } catch (const exception &err) { clog << "2^(3/2) throws " << err.what() << endl; ++result; } return result; } // After the rewriting of basic::normal() & Co. to return {num, den} lists, // add::normal() forgot to multiply the denominator of the overall_coeff of // its expanded and normalized children with the denominator of the expanded // child (did you get this? Well, never mind...). Fixed on Feb 21th 2000. static unsigned exam_paranoia11() { unsigned result = 0; symbol x("x"); ex e = ((-5-2*x)-((2-5*x)/(-2+x))*(3+2*x))/(5-4*x); ex f = e.normal(); ex d = normal((4+10*x+8*pow(x,2))/(x-2)/(5-4*x)); if (!(f - d).expand().is_zero()) { clog << "normal(" << e << ") returns " << f << " instead of " << d << endl; ++result; } return result; } // This one returned 0 because add::normal() incorrectly assumed that if the // common denominator is 1, all the denominators would be 1 (they can in fact // be +/-1). Fixed on Aug 2nd 2000. static unsigned exam_paranoia12() { unsigned result = 0; symbol x("x"); ex e = 2-2*(1+x)/(-1-x); ex f = e.normal(); ex d = 4; if (!(f - d).expand().is_zero()) { clog << "normal(" << e << ") returns " << f << " instead of " << d << endl; ++result; } return result; } // This one caused a division by 0 because heur_gcd() didn't check its // input polynomials against 0. Fixed on Aug 4th 2000. static unsigned exam_paranoia13() { unsigned result = 0; symbol a("a"), b("b"), c("c"); ex e = (b*a-c*a)/(4-a); ex d = (c*a-b*a)/(a-4); try { ex f = e.normal(); if (!(f - d).expand().is_zero()) { clog << "normal(" << e << ") returns " << f << " instead of " << d << endl; ++result; } } catch (const exception &err) { clog << "normal(" << e << ") throws " << err.what() << endl; ++result; } return result; } // A bug introduced on July 19, 2001. quo() and rem() would sometimes call // vector::reserve() with a negative argument. Fixed on Dec 20, 2001. static unsigned exam_paranoia14() { unsigned result = 0; symbol x("x"); ex q = quo(1, pow(x, 3), x); if (!q.is_zero()) { clog << "quo(1,x^3,x) erroneously returned " << q << " instead of 0\n"; ++result; } return result; } // Under certain conditions, power::expand_add_2() could produce non-canonical // numeric expairs. Fixed on Oct 24, 2002. static unsigned exam_paranoia15() { unsigned result = 0; ex q = (pow(pow(2, numeric(1, 2))*2+1, 2)).expand(); // this used to produce "1+4*sqrt(2)+4*2" which would never evaluate // to "9+4*sqrt(2)" if (!(q-9-4*pow(2, numeric(1, 2))).is_zero()) { clog << "expand((sqrt(2)*2+1)^2) erroneously returned " << q << " instead of 9-4*sqrt(2)\n"; ++result; } return result; } // Expanding products containing powers of sums could return results that // were not fully expanded. Fixed on Dec 10, 2003. static unsigned exam_paranoia16() { unsigned result = 0; symbol a("a"), b("b"), c("c"), d("d"), e("e"); ex e1, e2, e3; e1 = pow(1+a*sqrt(b+c), 2); e2 = e1.expand(); if (e2.has(pow(a, 2)*(b+c))) { clog << "expand(" << e1 << ") didn't fully expand\n"; ++result; } e1 = (d*sqrt(a+b)+a*sqrt(c+d))*(b*sqrt(a+b)+a*sqrt(c+d)); e2 = e1.expand(); if (e2.has(pow(a, 2)*(c+d))) { clog << "expand(" << e1 << ") didn't fully expand\n"; ++result; } e1 = (a+sqrt(b+c))*sqrt(b+c)*(d+sqrt(b+c)); e2 = e1.expand(); if (e2.has(a*(b+c))) { clog << "expand(" << e1 << ") didn't fully expand\n"; ++result; } e1 = pow(sqrt(a+b)+sqrt(c+d), 3); e2 = e1.expand(); if (e2.has(3*(a+b)*sqrt(c+d)) || e2.has(3*(c+d)*sqrt(a+b))) { clog << "expand(" << e1 << ") didn't fully expand\n"; ++result; } e1 = a*(b+c*(d+e)); e2 = e1.expand(); if (e2.has(c*(d+e))) { clog << "expand(" << e1 << ") didn't fully expand\n"; ++result; } e1 = 2*pow(1+a, 2)/a; e2 = e1.expand(); if (e2.has(pow(a, 2))) { clog << "expand(" << e1 << ") didn't fully expand\n"; ++result; } e1 = a*(a+b); e2 = pow(pow(e1, -1), -1); if (e2.has(a*b)) { clog << "double reciprocal expanded where it should not\n"; ++result; } return result; } // Bug in reposition_dummy_indices() could result in correct expression // turned into one with inconsistent indices. Fixed on Aug 29, 2006 static unsigned exam_paranoia17() { varidx mu1(symbol("mu1"), 4); varidx mu2(symbol("mu2"), 4); varidx mu3(symbol("mu3"), 4); varidx mu4(symbol("mu4"), 4); varidx mu5(symbol("mu5"), 4); varidx mu6(symbol("mu6"), 4); exvector ev2; ev2.push_back(mu3.toggle_variance()); ev2.push_back(mu6); ev2.push_back(mu5.toggle_variance()); ev2.push_back(mu6.toggle_variance()); ev2.push_back(mu5); ev2.push_back(mu3); // notice: all indices are contracted ... ex test_cycl = indexed(symbol("A"), sy_cycl(), ev2); test_cycl = test_cycl.simplify_indexed(); // ... so there should be zero free indices in the end. return test_cycl.get_free_indices().size(); } // Bug in add::eval() could result in numeric terms not being collected into // the overall coefficient. Fixed first on Sep 22, 2010 and again on Dec 17 2015 static unsigned exam_paranoia18() { unsigned result = 0; ex sqrt2 = sqrt(ex(2)); ex e1 = 1 + 2*(sqrt2+1)*(sqrt2-1); if (e1.real_part() != 3) { clog << "real_part(1+2*(sqrt(2)+1)*(sqrt(2)-1)) failed to evaluate to 3\n"; ++result; } ex sqrt3 = sqrt(ex(3)); ex e2 = 2 + 2*(sqrt2+1)*(sqrt2-1) - 2*(sqrt3+1)*(sqrt3-1); if (e2.real_part() != 0) { clog << "real_part(2+2*(sqrt(2)+1)*(sqrt(2)-1)-3*(sqrt(3)+1)*(sqrt(3)-1)) failed to evaluate to 0\n"; ++result; } return result; } // Bug in mul::conjugate when factors are evaluated at branch cuts, reported as // Sage bug #10964. static unsigned exam_paranoia19() { symbol a("a"); ex e = conjugate(a*sqrt(ex(-2))*sqrt(ex(-3))); ex c = a*conjugate(sqrt(ex(-2)))*conjugate(sqrt(ex(-3))); if (!subs(e-c, a==42).is_zero()) { clog << "subs(a*conjugate(sqrt(-2))*conjugate(sqrt(-3))-conjugate(a*sqrt(-2)*sqrt(-3)),a==42) failed to evaluate to 0\n"; return 1; } return 0; } // Bugs in is_polynomial (fixed 2011-05-20 and 2014-07-26). static unsigned exam_paranoia20() { unsigned result = 0; symbol x("x"), y("y"); ex e1 = sqrt(x*x+1)*sqrt(x+1); if (e1.is_polynomial(x)) { clog << "sqrt(x*x+1)*sqrt(x+1) is wrongly reported to be a polynomial in x\n"; ++result; } ex e2 = sqrt(Pi)*x; if (!e2.is_polynomial(x)) { clog << "sqrt(Pi)*x is wrongly reported to be no polynomial in x\n"; ++result; } ex e3 = sqrt(x); if (!e3.is_polynomial(y)) { clog << "sqrt(x) is wrongly reported to be no polynomial in y\n"; ++result; } ex e4 = (1+y)/(2+x); if (e4.is_polynomial(x)) { clog << "(1+y)/(2+x) is wrongly reported to be a polynomial in x\n"; ++result; } return result; } static unsigned is_polynomial_false_positive() { unsigned result = 0; symbol x("x"), n("n"); exvector nonpoly_exprs; nonpoly_exprs.push_back(1/(1-x)); nonpoly_exprs.push_back(1/(x+1)); nonpoly_exprs.push_back(-1/(x-1)); nonpoly_exprs.push_back(1/(1-x*x)); nonpoly_exprs.push_back(1/(1-pow(x,n))); nonpoly_exprs.push_back(x-1/(x-1)); for (exvector::const_iterator ep = nonpoly_exprs.begin(); ep != nonpoly_exprs.end(); ++ep) { if (ep->is_polynomial(x)) { clog << "(" << *ep << ").is_polynomial(" << x << ") " "erroneously returned true" << endl; ++result; } } return result; } // Bug in power::expand reported by Isuru Fernando (fixed 2015-05-07). static unsigned exam_paranoia21() { symbol x("x"); ex e = pow(x + sqrt(ex(2))*x, 2).expand(); if (e.nops() != 2) { clog << "(x+sqrt(2)*x)^2 was wrongly expanded to " << e << "\n"; return 1; } return 0; } // Bug in power::expand (fixed 2015-07-18). static unsigned exam_paranoia22() { symbol x("x"), y("y"); ex e = pow(sqrt(1+x)+y*sqrt(1+x), 2).expand(); if (e.nops() != 6) { clog << "(sqrt(1+x)+y*sqrt(1+x))^2 was wrongly expanded to " << e << "\n"; return 1; } return 0; } // Bug in expairseq::evalchildren(). static unsigned exam_paranoia23() { unsigned result = 0; symbol x("x"); epvector v1; v1.push_back(expair(1, 1)); v1.push_back(expair(2*x, -1)); ex e1 = add(v1); // Should be e==1-2*x, if (!e1.is_equal(1-2*x)) { clog << "Failure constructing " << e1 << " from add.\n"; ++result; } epvector v2; v2.push_back(expair(x, 1)); v2.push_back(expair(1,-1)); ex e2 = mul(v2); // Should be e==x; if (!e2.is_equal(x)) { clog << "Failure constructing " << e2 << " from mul.\n"; ++result; } return result; } // Bug in sqrfree_yun (fixed 2016-02-02). static unsigned exam_paranoia24() { unsigned result = 0; symbol x("x"); ex e; e = (x-1)*(x+1) - x*x + 1; // an unexpanded 0... try { ex f = sqrfree(e); if (!f.is_zero()) { clog << "sqrfree(" << e << ") returns " << f << " instead of 0\n"; ++result; } } catch (const exception &err) { clog << "sqrfree(" << e << ") throws " << err.what() << endl; ++result; } e = pow(x-1,3) - expand(pow(x-1,3)); // ...still after differentiating... try { ex f = sqrfree(e); if (!f.is_zero()) { clog << "sqrfree(" << e << ") returns " << f << " instead of 0\n"; ++result; } } catch (const exception &err) { clog << "sqrfree(" << e << ") throws " << err.what() << endl; ++result; } e = pow(x-1,4) - expand(pow(x-1,4)); // ...and after differentiating twice. try { ex f = sqrfree(e); if (!f.is_zero()) { clog << "sqrfree(" << e << ") returns " << f << " instead of 0\n"; ++result; } } catch (const exception &err) { clog << "sqrfree(" << e << ") throws " << err.what() << endl; ++result; } return result; } // Bug in add ctor unsigned exam_paranoia25() { symbol a("a"), b("b"), c("c"); ex e = -a + 2*b + c; if (e.diff(c).nops() > 1) { clog << "diff(" << e << ",c) was not fully evaluated.\n"; return 1; } return 0; } unsigned exam_paranoia() { unsigned result = 0; cout << "examining several historic failures just out of paranoia" << flush; result += exam_paranoia1(); cout << '.' << flush; result += exam_paranoia2(); cout << '.' << flush; result += exam_paranoia3(); cout << '.' << flush; result += exam_paranoia4(); cout << '.' << flush; result += exam_paranoia5(); cout << '.' << flush; result += exam_paranoia6(); cout << '.' << flush; result += exam_paranoia7(); cout << '.' << flush; result += exam_paranoia8(); cout << '.' << flush; result += exam_paranoia9(); cout << '.' << flush; result += exam_paranoia10(); cout << '.' << flush; result += exam_paranoia11(); cout << '.' << flush; result += exam_paranoia12(); cout << '.' << flush; result += exam_paranoia13(); cout << '.' << flush; result += exam_paranoia14(); cout << '.' << flush; result += exam_paranoia15(); cout << '.' << flush; result += exam_paranoia16(); cout << '.' << flush; result += exam_paranoia17(); cout << '.' << flush; result += exam_paranoia18(); cout << '.' << flush; result += exam_paranoia19(); cout << '.' << flush; result += exam_paranoia20(); cout << '.' << flush; result += is_polynomial_false_positive(); cout << '.' << flush; result += exam_paranoia21(); cout << '.' << flush; result += exam_paranoia22(); cout << '.' << flush; result += exam_paranoia23(); cout << '.' << flush; result += exam_paranoia24(); cout << '.' << flush; result += exam_paranoia25(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return exam_paranoia(); } ginac-1.7.8.orig/check/exam_polygcd.cpp0000644000000000000000000001443313457611471014707 0ustar /** @file exam_polygcd.cpp * * Some test with polynomial GCD calculations. See also the checks for * rational function normalization in normalization.cpp. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; const int MAX_VARIABLES = 3; static symbol x("x"), z("z"); static symbol y[MAX_VARIABLES]; // GCD = 1 static unsigned poly_gcd1() { for (int v=1; v<=MAX_VARIABLES; v++) { ex e1 = x; ex e2 = pow(x, 2); for (int i=0; i using namespace std; static unsigned exam_powerlaws1() { // (x^a)^b = x^(a*b) symbol x("x"); symbol a("a"); symbol b("b"); ex e1 = power(power(x,a), b); if (!(is_exactly_a(e1) && is_exactly_a(e1.op(0)) && is_exactly_a(e1.op(0).op(0)) && is_exactly_a(e1.op(0).op(1)) && is_exactly_a(e1.op(1)) && e1.is_equal(power(power(x,a),b)) )) { clog << "(x^a)^b, x,a,b symbolic wrong" << endl; clog << "returned: " << e1 << endl; return 1; } ex e2 = e1.subs(a==1); if (!(is_exactly_a(e2) && is_exactly_a(e2.op(0)) && is_exactly_a(e2.op(1)) && e2.is_equal(power(x,b)) )) { clog << "(x^a)^b, x,b symbolic, a==1 wrong" << endl; clog << "returned: " << e2 << endl; return 1; } ex e3 = e1.subs(a==-1); if (!(is_exactly_a(e3) && is_exactly_a(e3.op(0)) && is_exactly_a(e3.op(0).op(0)) && is_exactly_a(e3.op(0).op(1)) && is_exactly_a(e3.op(1)) && e3.is_equal(power(power(x,-1),b)) )) { clog << "(x^a)^b, x,b symbolic, a==-1 wrong" << endl; clog << "returned: " << e3 << endl; return 1; } ex e4 = e1.subs(lst{a==-1, b==-2.5}); if (!(is_exactly_a(e4) && is_exactly_a(e4.op(0)) && is_exactly_a(e4.op(0).op(0)) && is_exactly_a(e4.op(0).op(1)) && is_exactly_a(e4.op(1)) && e4.is_equal(power(power(x,-1),-2.5)) )) { clog << "(x^a)^b, x symbolic, a==-1, b==-2.5 wrong" << endl; clog << "returned: " << e4 << endl; return 1; } ex e5 = e1.subs(lst{a==-0.9, b==2.5}); if (!(is_exactly_a(e5) && is_exactly_a(e5.op(0)) && is_exactly_a(e5.op(1)) && e5.is_equal(power(x,numeric(-0.9)*numeric(2.5))) )) { clog << "(x^a)^b, x symbolic, a==-0.9, b==2.5 wrong" << endl; clog << "returned: " << e5 << endl; return 1; } ex e6 = e1.subs(lst{a==numeric(3)+numeric(5.3)*I, b==-5}); if (!(is_exactly_a(e6) && is_exactly_a(e6.op(0)) && is_exactly_a(e6.op(1)) && e6.is_equal(power(x,numeric(-15)+numeric(5.3)*numeric(-5)*I)) )) { clog << "(x^a)^b, x symbolic, a==3+5.3*I, b==-5 wrong" << endl; clog << "returned: " << e6 << endl; return 1; } return 0; } static unsigned exam_powerlaws2() { // (a*x)^b = a^b * x^b symbol x("x"); symbol a("a"); symbol b("b"); ex e1 = power(a*x,b); if (!(is_exactly_a(e1) && is_exactly_a(e1.op(0)) && (e1.op(0).nops()==2) && is_exactly_a(e1.op(0).op(0)) && is_exactly_a(e1.op(0).op(1)) && is_exactly_a(e1.op(1)) && e1.is_equal(power(a*x,b)) )) { clog << "(a*x)^b, x,a,b symbolic wrong" << endl; clog << "returned: " << e1 << endl; return 1; } ex e2 = e1.subs(a==3); if (!(is_exactly_a(e2) && is_exactly_a(e2.op(0)) && (e2.op(0).nops()==2) && is_exactly_a(e2.op(0).op(0)) && is_exactly_a(e2.op(0).op(1)) && is_exactly_a(e2.op(1)) && e2.is_equal(power(3*x,b)) )) { clog << "(a*x)^b, x,b symbolic, a==3 wrong" << endl; clog << "returned: " << e2 << endl; return 1; } ex e3 = e1.subs(b==-3); if (!(is_exactly_a(e3) && (e3.nops()==2) && is_exactly_a(e3.op(0)) && is_exactly_a(e3.op(1)) && e3.is_equal(power(a,-3)*power(x,-3)) )) { clog << "(a*x)^b, x,a symbolic, b==-3 wrong" << endl; clog << "returned: " << e3 << endl; return 1; } ex e4 = e1.subs(b==4.5); if (!(is_exactly_a(e4) && is_exactly_a(e4.op(0)) && (e4.op(0).nops()==2) && is_exactly_a(e4.op(0).op(0)) && is_exactly_a(e4.op(0).op(1)) && is_exactly_a(e4.op(1)) && e4.is_equal(power(a*x,4.5)) )) { clog << "(a*x)^b, x,a symbolic, b==4.5 wrong" << endl; clog << "returned: " << e4 << endl; return 1; } ex e5 = e1.subs(lst{a==3.2, b==3+numeric(5)*I}); if (!(is_exactly_a(e5) && (e5.nops()==2) && is_exactly_a(e5.op(0)) && is_exactly_a(e5.op(1)) && e5.is_equal(power(x,3+numeric(5)*I)* power(numeric(3.2),3+numeric(5)*I)) )) { clog << "(a*x)^b, x symbolic, a==3.2, b==3+5*I wrong" << endl; clog << "returned: " << e5 << endl; return 1; } ex e6 = e1.subs(lst{a==-3.2, b==3+numeric(5)*I}); if (!(is_exactly_a(e6) && (e6.nops()==2) && is_exactly_a(e6.op(0)) && is_exactly_a(e6.op(1)) && e6.is_equal(power(-x,3+numeric(5)*I)* power(numeric(3.2),3+numeric(5)*I)) )) { clog << "(a*x)^b, x symbolic, a==-3.2, b==3+5*I wrong" << endl; clog << "returned: " << e6 << endl; return 1; } ex e7 = e1.subs(lst{a==3+numeric(5)*I, b==3.2}); if (!(is_exactly_a(e7) && is_exactly_a(e7.op(0)) && (e7.op(0).nops()==2) && is_exactly_a(e7.op(0).op(0)) && is_exactly_a(e7.op(0).op(1)) && is_exactly_a(e7.op(1)) && e7.is_equal(power((3+numeric(5)*I)*x,3.2)) )) { clog << "(a*x)^b, x symbolic, a==3+5*I, b==3.2 wrong" << endl; clog << "returned: " << e7 << endl; return 1; } return 0; } static unsigned exam_powerlaws3() { // numeric evaluation ex e1 = power(numeric(4),numeric(1,2)); if (e1 != 2) { clog << "4^(1/2) wrongly returned " << e1 << endl; return 1; } ex e2 = power(numeric(27),numeric(2,3)); if (e2 != 9) { clog << "27^(2/3) wrongly returned " << e2 << endl; return 1; } ex e3 = power(numeric(5),numeric(1,2)); if (!(is_exactly_a(e3) && e3.op(0).is_equal(numeric(5)) && e3.op(1).is_equal(numeric(1,2)))) { clog << "5^(1/2) wrongly returned " << e3 << endl; return 1; } ex e4 = power(numeric(5),evalf(numeric(1,2))); if (!(is_exactly_a(e4))) { clog << "5^(0.5) wrongly returned " << e4 << endl; return 1; } ex e5 = power(evalf(numeric(5)),numeric(1,2)); if (!(is_exactly_a(e5))) { clog << "5.0^(1/2) wrongly returned " << e5 << endl; return 1; } return 0; } static unsigned exam_powerlaws4() { // test for mul::eval() symbol a("a"); symbol b("b"); symbol c("c"); ex f1 = power(a*b,ex(1)/ex(2)); ex f2 = power(a*b,ex(3)/ex(2)); ex f3 = c; exvector v; v.push_back(f1); v.push_back(f2); v.push_back(f3); ex e1 = mul(v); if (e1!=a*a*b*b*c) { clog << "(a*b)^(1/2)*(a*b)^(3/2)*c wrongly returned " << e1 << endl; return 1; } return 0; } static unsigned exam_powerlaws5() { // cabinet of slightly pathological cases symbol a("a"); ex e1 = pow(1,a); if (e1 != 1) { clog << "1^a wrongly returned " << e1 << endl; return 1; } ex e2 = pow(0,a); if (!(is_exactly_a(e2))) { clog << "0^a was evaluated to " << e2 << " though nothing is known about a." << endl; return 1; } return 0; } static unsigned exam_powerlaws6() { // check expansion rules for positive symbols symbol a("a"); symbol b("b"); symbol c("c"); realsymbol x("x"); realsymbol y("y"); possymbol p("p"); possymbol q("q"); numeric half=numeric(1,2); ex e1 = pow(5*pow(3*a*b*x*y*p*q,2),7*half*c).expand(); ex e2 = pow(p,7*c)*pow(q,7*c)*pow(pow(a*b*x*y,2),numeric(7,2)*c)*pow(45,numeric(7,2)*c); if (!e1.is_equal(e2)) { clog << "Could not expand exponents with positive bases in " << e1 << endl; return 1; } ex e3 = pow(-pow(-a*x*p,3)*pow(b*y*p,3),half*c).expand().normal(); ex e4 = pow(p,3*c)*pow(pow(a*b*x*y,3),half*c); if (!e3.is_equal(e4)) { clog << "Could not expand exponents with positive bases in " << e3 << endl; return 1; } return 0; } unsigned exam_powerlaws() { unsigned result = 0; cout << "examining power laws" << flush; result += exam_powerlaws1(); cout << '.' << flush; result += exam_powerlaws2(); cout << '.' << flush; result += exam_powerlaws3(); cout << '.' << flush; result += exam_powerlaws4(); cout << '.' << flush; result += exam_powerlaws5(); cout << '.' << flush; result += exam_powerlaws6(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return exam_powerlaws(); } ginac-1.7.8.orig/check/exam_pseries.cpp0000644000000000000000000003004513457611471014715 0ustar /** @File exam_pseries.cpp * * Series expansion test (Laurent and Taylor series). */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; static symbol x("x"); static unsigned check_series(const ex &e, const ex &point, const ex &d, int order = 8) { ex es = e.series(x==point, order); ex ep = ex_to(es).convert_to_poly(); if (!(ep - d).expand().is_zero()) { clog << "series expansion of " << e << " at " << point << " erroneously returned " << ep << " (instead of " << d << ")" << endl; clog << tree << (ep-d) << dflt; return 1; } return 0; } // Series expansion static unsigned exam_series1() { using GiNaC::log; symbol a("a"); symbol b("b"); unsigned result = 0; ex e, d; e = pow(a+b, x); d = 1 + Order(pow(x, 1)); result += check_series(e, 0, d, 1); e = sin(x); d = x - pow(x, 3) / 6 + pow(x, 5) / 120 - pow(x, 7) / 5040 + Order(pow(x, 8)); result += check_series(e, 0, d); e = cos(x); d = 1 - pow(x, 2) / 2 + pow(x, 4) / 24 - pow(x, 6) / 720 + Order(pow(x, 8)); result += check_series(e, 0, d); e = exp(x); d = 1 + x + pow(x, 2) / 2 + pow(x, 3) / 6 + pow(x, 4) / 24 + pow(x, 5) / 120 + pow(x, 6) / 720 + pow(x, 7) / 5040 + Order(pow(x, 8)); result += check_series(e, 0, d); e = pow(1 - x, -1); d = 1 + x + pow(x, 2) + pow(x, 3) + pow(x, 4) + pow(x, 5) + pow(x, 6) + pow(x, 7) + Order(pow(x, 8)); result += check_series(e, 0, d); e = x + pow(x, -1); d = x + pow(x, -1); result += check_series(e, 0, d); e = x + pow(x, -1); d = 2 + pow(x-1, 2) - pow(x-1, 3) + pow(x-1, 4) - pow(x-1, 5) + pow(x-1, 6) - pow(x-1, 7) + Order(pow(x-1, 8)); result += check_series(e, 1, d); e = pow(x + pow(x, 3), -1); d = pow(x, -1) - x + pow(x, 3) - pow(x, 5) + pow(x, 7) + Order(pow(x, 8)); result += check_series(e, 0, d); e = pow(pow(x, 2) + pow(x, 4), -1); d = pow(x, -2) - 1 + pow(x, 2) - pow(x, 4) + pow(x, 6) + Order(pow(x, 8)); result += check_series(e, 0, d); e = pow(sin(x), -2); d = pow(x, -2) + numeric(1,3) + pow(x, 2) / 15 + pow(x, 4) * 2/189 + pow(x, 6) / 675 + Order(pow(x, 8)); result += check_series(e, 0, d); e = sin(x) / cos(x); d = x + pow(x, 3) / 3 + pow(x, 5) * 2/15 + pow(x, 7) * 17/315 + Order(pow(x, 8)); result += check_series(e, 0, d); e = cos(x) / sin(x); d = pow(x, -1) - x / 3 - pow(x, 3) / 45 - pow(x, 5) * 2/945 - pow(x, 7) / 4725 + Order(pow(x, 8)); result += check_series(e, 0, d); e = pow(numeric(2), x); ex t = log(2) * x; d = 1 + t + pow(t, 2) / 2 + pow(t, 3) / 6 + pow(t, 4) / 24 + pow(t, 5) / 120 + pow(t, 6) / 720 + pow(t, 7) / 5040 + Order(pow(x, 8)); result += check_series(e, 0, d.expand()); e = pow(Pi, x); t = log(Pi) * x; d = 1 + t + pow(t, 2) / 2 + pow(t, 3) / 6 + pow(t, 4) / 24 + pow(t, 5) / 120 + pow(t, 6) / 720 + pow(t, 7) / 5040 + Order(pow(x, 8)); result += check_series(e, 0, d.expand()); e = log(x); d = e; result += check_series(e, 0, d, 1); result += check_series(e, 0, d, 2); e = pow(x, 8) * pow(pow(x,3)+ pow(x + pow(x,3), 2), -2); d = pow(x, 4) - 2*pow(x, 5) + Order(pow(x, 6)); result += check_series(e, 0, d, 6); e = cos(x) * pow(sin(x)*(pow(x, 5) + 4 * pow(x, 2)), -3); d = pow(x, -9) / 64 - 3 * pow(x, -6) / 256 - pow(x, -5) / 960 + 535 * pow(x, -3) / 96768 + pow(x, -2) / 1280 - pow(x, -1) / 14400 - numeric(283, 129024) - 2143 * x / 5322240 + Order(pow(x, 2)); result += check_series(e, 0, d, 2); e = sqrt(1+x*x) * sqrt(1+2*x*x); d = 1 + Order(pow(x, 2)); result += check_series(e, 0, d, 2); e = pow(x, 4) * sin(a) + pow(x, 2); d = pow(x, 2) + Order(pow(x, 3)); result += check_series(e, 0, d, 3); e = log(a*x + b*x*x*log(x)); d = log(a*x) + b/a*log(x)*x - pow(b/a, 2)/2*pow(log(x)*x, 2) + Order(pow(x, 3)); result += check_series(e, 0, d, 3); e = pow((x+a), b); d = pow(a, b) + (pow(a, b)*b/a)*x + (pow(a, b)*b*b/a/a/2 - pow(a, b)*b/a/a/2)*pow(x, 2) + Order(pow(x, 3)); result += check_series(e, 0, d, 3); e = a * (1 / (x * sin(x)) - sin(x) / x); d = a * pow(x, -2) + Order(pow(x, -1)); result += check_series(e, 0, d, -1); return result; } // Series addition static unsigned exam_series2() { unsigned result = 0; ex e, d; e = pow(sin(x), -1).series(x==0, 8) + pow(sin(-x), -1).series(x==0, 12); d = Order(pow(x, 8)); result += check_series(e, 0, d); return result; } // Series multiplication static unsigned exam_series3() { unsigned result = 0; ex e, d; e = sin(x).series(x==0, 8) * pow(sin(x), -1).series(x==0, 12); d = 1 + Order(pow(x, 7)); result += check_series(e, 0, d); return result; } // Series exponentiation static unsigned exam_series4() { using GiNaC::tgamma; unsigned result = 0; ex e, d; e = pow((2*cos(x)).series(x==0, 5), 2).series(x==0, 5); d = 4 - 4*pow(x, 2) + 4*pow(x, 4)/3 + Order(pow(x, 5)); result += check_series(e, 0, d); e = pow(tgamma(x), 2).series(x==0, 2); d = pow(x,-2) - 2*Euler/x + (pow(Pi,2)/6+2*pow(Euler,2)) + x*(-4*pow(Euler, 3)/3 -pow(Pi,2)*Euler/3 - 2*zeta(3)/3) + Order(pow(x, 2)); result += check_series(e, 0, d); return result; } // Order term handling static unsigned exam_series5() { unsigned result = 0; ex e, d; e = 1 + x + pow(x, 2) + pow(x, 3); d = Order(1); result += check_series(e, 0, d, 0); d = 1 + Order(x); result += check_series(e, 0, d, 1); d = 1 + x + Order(pow(x, 2)); result += check_series(e, 0, d, 2); d = 1 + x + pow(x, 2) + Order(pow(x, 3)); result += check_series(e, 0, d, 3); d = 1 + x + pow(x, 2) + pow(x, 3); result += check_series(e, 0, d, 4); return result; } // Series expansion of tgamma(-1) static unsigned exam_series6() { using GiNaC::tgamma; ex e = tgamma(2*x); ex d = pow(x+1,-1)*numeric(1,4) + pow(x+1,0)*(numeric(3,4) - numeric(1,2)*Euler) + pow(x+1,1)*(numeric(7,4) - numeric(3,2)*Euler + numeric(1,2)*pow(Euler,2) + numeric(1,12)*pow(Pi,2)) + pow(x+1,2)*(numeric(15,4) - numeric(7,2)*Euler - numeric(1,3)*pow(Euler,3) + numeric(1,4)*pow(Pi,2) + numeric(3,2)*pow(Euler,2) - numeric(1,6)*pow(Pi,2)*Euler - numeric(2,3)*zeta(3)) + pow(x+1,3)*(numeric(31,4) - pow(Euler,3) - numeric(15,2)*Euler + numeric(1,6)*pow(Euler,4) + numeric(7,2)*pow(Euler,2) + numeric(7,12)*pow(Pi,2) - numeric(1,2)*pow(Pi,2)*Euler - numeric(2)*zeta(3) + numeric(1,6)*pow(Euler,2)*pow(Pi,2) + numeric(1,40)*pow(Pi,4) + numeric(4,3)*zeta(3)*Euler) + Order(pow(x+1,4)); return check_series(e, -1, d, 4); } // Series expansion of tan(x==Pi/2) static unsigned exam_series7() { ex e = tan(x*Pi/2); ex d = pow(x-1,-1)/Pi*(-2) + pow(x-1,1)*Pi/6 + pow(x-1,3)*pow(Pi,3)/360 +pow(x-1,5)*pow(Pi,5)/15120 + pow(x-1,7)*pow(Pi,7)/604800 +Order(pow(x-1,9)); return check_series(e,1,d,9); } // Series expansion of log(sin(x==0)) static unsigned exam_series8() { ex e = log(sin(x)); ex d = log(x) - pow(x,2)/6 - pow(x,4)/180 - pow(x,6)/2835 - pow(x,8)/37800 + Order(pow(x,9)); return check_series(e,0,d,9); } // Series expansion of Li2(sin(x==0)) static unsigned exam_series9() { ex e = Li2(sin(x)); ex d = x + pow(x,2)/4 - pow(x,3)/18 - pow(x,4)/48 - 13*pow(x,5)/1800 - pow(x,6)/360 - 23*pow(x,7)/21168 + Order(pow(x,8)); return check_series(e,0,d,8); } // Series expansion of Li2((x==2)^2), caring about branch-cut static unsigned exam_series10() { using GiNaC::log; ex e = Li2(pow(x,2)); ex d = Li2(4) + (-log(3) + I*Pi*csgn(I-I*pow(x,2))) * (x-2) + (numeric(-2,3) + log(3)/4 - I*Pi/4*csgn(I-I*pow(x,2))) * pow(x-2,2) + (numeric(11,27) - log(3)/12 + I*Pi/12*csgn(I-I*pow(x,2))) * pow(x-2,3) + (numeric(-155,648) + log(3)/32 - I*Pi/32*csgn(I-I*pow(x,2))) * pow(x-2,4) + Order(pow(x-2,5)); return check_series(e,2,d,5); } // Series expansion of logarithms around branch points static unsigned exam_series11() { using GiNaC::log; unsigned result = 0; ex e, d; symbol a("a"); e = log(x); d = log(x); result += check_series(e,0,d,5); e = log(3/x); d = log(3)-log(x); result += check_series(e,0,d,5); e = log(3*pow(x,2)); d = log(3)+2*log(x); result += check_series(e,0,d,5); // These ones must not be expanded because it would result in a branch cut // running in the wrong direction. (Other systems tend to get this wrong.) e = log(-x); d = e; result += check_series(e,0,d,5); e = log(I*(x-123)); d = e; result += check_series(e,123,d,5); e = log(a*x); d = e; // we don't know anything about a! result += check_series(e,0,d,5); e = log((1-x)/x); d = log(1-x) - (x-1) + pow(x-1,2)/2 - pow(x-1,3)/3 + pow(x-1,4)/4 + Order(pow(x-1,5)); result += check_series(e,1,d,5); return result; } // Series expansion of other functions around branch points static unsigned exam_series12() { using GiNaC::log; using GiNaC::atanh; unsigned result = 0; ex e, d; // NB: Mma and Maple give different results, but they agree if one // takes into account that by assumption |x|<1. e = atan(x); d = (I*log(2)/2-I*log(1+I*x)/2) + (x-I)/4 + I*pow(x-I,2)/16 + Order(pow(x-I,3)); result += check_series(e,I,d,3); // NB: here, at -I, Mathematica disagrees, but it is wrong -- they // pick up a complex phase by incorrectly expanding logarithms. e = atan(x); d = (-I*log(2)/2+I*log(1-I*x)/2) + (x+I)/4 - I*pow(x+I,2)/16 + Order(pow(x+I,3)); result += check_series(e,-I,d,3); // This is basically the same as above, the branch point is at +/-1: e = atanh(x); d = (-log(2)/2+log(x+1)/2) + (x+1)/4 + pow(x+1,2)/16 + Order(pow(x+1,3)); result += check_series(e,-1,d,3); return result; } // Test of the patch of Stefan Weinzierl that prevents an infinite loop if // a factor in a product is a complicated way of writing zero. static unsigned exam_series13() { unsigned result = 0; ex e = (new mul(pow(2,x), (1/x*(-(1+x)/(1-x)) + (1+x)/x/(1-x))) )->setflag(status_flags::evaluated); ex d = Order(x); result += check_series(e,0,d,1); return result; } // Test if (1+x)^(1/x) can be expanded. static unsigned exam_series14() { unsigned result = 0; ex e = pow(1+x, sin(x)/x); ex d = 1 + x - pow(x,3)/6 + Order(pow(x,4)); try { result += check_series(e,0,d,4); } catch (const pole_error& err) { clog << "series expansion of " << e << " at 0 raised an exception." << endl; ++result; } return result; } unsigned exam_pseries() { unsigned result = 0; cout << "examining series expansion" << flush; result += exam_series1(); cout << '.' << flush; result += exam_series2(); cout << '.' << flush; result += exam_series3(); cout << '.' << flush; result += exam_series4(); cout << '.' << flush; result += exam_series5(); cout << '.' << flush; result += exam_series6(); cout << '.' << flush; result += exam_series7(); cout << '.' << flush; result += exam_series8(); cout << '.' << flush; result += exam_series9(); cout << '.' << flush; result += exam_series10(); cout << '.' << flush; result += exam_series11(); cout << '.' << flush; result += exam_series12(); cout << '.' << flush; result += exam_series13(); cout << '.' << flush; result += exam_series14(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return exam_pseries(); } ginac-1.7.8.orig/check/exam_real_imag.cpp0000644000000000000000000000451713457611471015170 0ustar /** @file exam_misc.cpp * */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; /* Exam real/imaginary part of polynomials. */ static unsigned exam_polynomials() { realsymbol a("a"), b("b"); ex e = pow(a + I*b,3).expand() + I; if (e.real_part() != pow(a,3)-3*a*pow(b,2) || e.imag_part() != 1+3*pow(a,2)*b-pow(b,3)) { clog << "real / imaginary part miscomputed" << endl; return 1; } return 0; } /* Exam symbolic expansion of nested expression. */ static unsigned exam_monster() { // This little monster is inspired by Sage's Symbench R1. // It is much more aggressive that the original and covers more code. struct { // C++ doesn't have nested functions... ex operator()(const ex & z) { return sqrt(ex(1)/3) * pow(z, 11) - I / pow(2*z, 3); } } f; ex monster = f(f(f(f(I/2)))); // grows exponentially with number of nestings.. ex r = real_part(monster); ex i = imag_part(monster); // Check with precomputed result double r_eps = ex_to(evalf(r)).to_double() - 0.2000570104163233; double i_eps = ex_to(evalf(i)).to_double() - 0.5284320312415462; if (abs(r_eps) > 1e-9 || abs(i_eps) > 1e-9) { clog << "iterated function was miscomputed" << endl; return 1; } return 0; } unsigned exam_real_imag() { unsigned result = 0; cout << "examining real/imaginary part separation" << flush; result += exam_polynomials(); cout << '.' << flush; result += exam_monster(); cout << '.' << flush; return result; } int main(int argc, char** argv) { return exam_real_imag(); } ginac-1.7.8.orig/check/exam_structure.cpp0000644000000000000000000000465513457611471015313 0ustar /** @file exam_structure.cpp * * Small test for the structure<> template. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; struct sprod_s { ex left, right; sprod_s() {} sprod_s(const ex & l, const ex & r) : left(l), right(r) {} }; inline bool operator==(const sprod_s & lhs, const sprod_s & rhs) { return lhs.left.is_equal(rhs.left) && lhs.right.is_equal(rhs.right); } inline bool operator<(const sprod_s & lhs, const sprod_s & rhs) { return lhs.left.compare(rhs.left) < 0 ? true : lhs.right.compare(rhs.right) < 0; } typedef structure sprod; inline ex make_sprod(const ex & l, const ex & r) { return sprod(sprod_s(l, r)); } namespace GiNaC { template <> void sprod::print(const print_context & c, unsigned level) const { const sprod_s & sp = get_struct(); c.s << "<" << sp.left << "|" << sp.right << ">"; } template <> ex sprod::eval() const { // symmetric scalar product const sprod_s & sp = get_struct(); if (sp.left.compare(sp.right) <= 0) return hold(); else return make_sprod(sp.right, sp.left); } } // namespace GiNaC unsigned exam_structure() { unsigned result = 0; cout << "examining structure template" << flush; symbol x("x"), y("y"); ex e; e = make_sprod(x, y) - make_sprod(y, x); if (!e.is_zero()) { clog << "- erroneously returned " << e << " instead of 0" << endl; ++result; } cout << '.' << flush; e = make_sprod(x, x) - make_sprod(y, y); if (e.is_zero()) { clog << "- erroneously returned 0" << endl; ++result; } return result; } int main(int argc, char** argv) { return exam_structure(); } ginac-1.7.8.orig/check/factor_univariate_bug.cpp0000644000000000000000000000102613457611471016570 0ustar /** * @file factor_upoly_q_bug.cpp Check for a bug in factor_univariate(). * * factor_univariate() didn't check if the argument is an integer polynomial, * the result was a segfault. */ #include "ginac.h" #include using namespace GiNaC; using namespace std; int main(int argc, char** argv) { cout << "checking if factor() handles rational polynomials. "; parser p; ex e = p("174247781*x^2-1989199947807987/200000000000000*x"); ex ef = factor(e); ex diff = (e - ef).expand(); cout << "yes" << endl; return 0; } ginac-1.7.8.orig/check/genex.cpp0000644000000000000000000001010513457611471013332 0ustar /** @file genex.cpp * * Provides some routines for generating expressions that are later used as * input in the consistency checks. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; /* Create a dense univariate random polynomial in x. * (of the form 9 - 22*a - 17*a^2 + 14*a^3 + 7*a^4 + 7a^5 if degree==5) */ const ex dense_univariate_poly(const symbol & x, unsigned degree) { ex unipoly; for (unsigned i=0; i<=degree; ++i) unipoly += numeric((rand()-RAND_MAX/2))*pow(x,i); return unipoly; } /* Create a dense bivariate random polynomial in x1 and x2. * (of the form 9 + 52*x1 - 27*x1^2 + 84*x2 + 7*x2^2 - 12*x1*x2 if degree==2) */ const ex dense_bivariate_poly(const symbol & x1, const symbol & x2, unsigned degree) { ex bipoly; for (unsigned i1=0; i1<=degree; ++i1) for (unsigned i2=0; i2<=degree-i1; ++i2) bipoly += numeric((rand()-RAND_MAX/2))*pow(x1,i1)*pow(x2,i2); return bipoly; } /* Chose a random symbol or number from the argument list. */ const ex random_symbol(const symbol & x, const symbol & y, const symbol & z, bool rational = true, bool complex = false) { ex e; switch (abs(rand()) % 4) { case 0: e = x; break; case 1: e = y; break; case 2: e = z; break; case 3: { int c1; do { c1 = rand()%20 - 10; } while (!c1); int c2; do { c2 = rand()%20 - 10; } while (!c2); if (!rational) c2 = 1; e = numeric(c1, c2); if (complex && !(rand()%5)) e = e*I; break; } } return e; } /* Create a sparse random tree in three symbols. */ const ex sparse_tree(const symbol & x, const symbol & y, const symbol & z, int level, bool trig = false, // true includes trigonometric functions bool rational = true, // false excludes coefficients in Q bool complex = false) // true includes complex numbers { if (level == 0) return random_symbol(x,y,z,rational,complex); switch (abs(rand()) % 10) { case 0: case 1: case 2: case 3: return add(sparse_tree(x,y,z,level-1, trig, rational), sparse_tree(x,y,z,level-1, trig, rational)); case 4: case 5: case 6: return mul(sparse_tree(x,y,z,level-1, trig, rational), sparse_tree(x,y,z,level-1, trig, rational)); case 7: case 8: { ex powbase; do { powbase = sparse_tree(x,y,z,level-1, trig, rational); } while (powbase.is_zero()); return pow(powbase, abs(rand() % 4)); break; } case 9: if (trig) { switch (abs(rand()) % 4) { case 0: return sin(sparse_tree(x,y,z,level-1, trig, rational)); case 1: return cos(sparse_tree(x,y,z,level-1, trig, rational)); case 2: return exp(sparse_tree(x,y,z,level-1, trig, rational)); case 3: { ex logex; do { ex logarg; do { logarg = sparse_tree(x,y,z,level-1, trig, rational); } while (logarg.is_zero()); // Keep the evaluator from accidentally plugging an // unwanted I in the tree: if (!complex && logarg.info(info_flags::negative)) logarg = -logarg; logex = log(logarg); } while (logex.is_zero()); return logex; break; } } } else return random_symbol(x,y,z,rational,complex); } return 0; } ginac-1.7.8.orig/check/heur_gcd_bug.cpp0000644000000000000000000000362013457611471014645 0ustar /** @file heur_gcd_bug.cpp * * heur_gcd_oops.cpp Check for a bug in heur_gcd(). * * heur_gcd() did not check if the arguments are integer polynomials * (and did not convert them to integer polynomials), which lead to * endless loop or (even worse) wrong result. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include using namespace std; int main(int argc, char** argv) { cout << "checking if heur_gcd() can cope with rational polynomials. "; const symbol x("x"); const ex _ex1(1); ex a1 = x + numeric(5, 4); ex a2 = x + numeric(5, 2); ex b = pow(x, 2) + numeric(15, 4)*x + numeric(25, 8); // note: both a1 and a2 divide b // a2 divides b, so cofactor of a2 should be a (rational) number ex ca2, cb2; ex g2 = gcd(a2, b, &ca2, &cb2); if (!is_a(ca2)) { cerr << "gcd(" << a2 << ", " << b << ") was miscomputed" << endl; return 1; } ex ca1, cb1; // a1 divides b, so cofactor of a1 should be a (rational) number ex g1 = gcd(a1, b, &ca1, &cb1); if (!is_a(ca1)) { cerr << "gcd(" << a1 << ", " << b << ") was miscomputed" << endl; return 1; } return 0; } ginac-1.7.8.orig/check/match_bug.cpp0000644000000000000000000001052313457611471014161 0ustar /** @file match_bug.cpp * * Check for bug in GiNaC::ex::match() described here: * http://www.ginac.de/pipermail/ginac-devel/2006-April/000942.html */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "error_report.h" #include using namespace GiNaC; /* * basic::match(lst&) used to have an obscure side effect: repl_lst * could be modified even if the match failed! Although this "feature" * was documented it happened to be very confusing *even for GiNaC * developers*, see * http://www.ginac.de/pipermail/ginac-devel/2006-April/000942.html * * It was fixed in 192ed7390b7b2b705ad100e3db0a92eedd2b20ad. Let's make * sure it will be never re-added: */ static void failed_match_have_side_effects() { symbol x("x"); ex e = pow(x, 5); ex pattern = pow(wild(0), -1); // obviously e does NOT match the pattern exmap repls; bool match_p = e.match(pattern, repls); cbug_on(match_p, "match(" << e << ", " << pattern << ") says \"Yes\""); cbug_on(repls.size() != 0, "failed match have side effects: repls = " << repls); } /* * As a consequence of the bug described above pattern matching can wrongly * fail. In particular, x^5*y^(-1) fails to match ($0)^(-1)*x^($2). * * The first thing that is attempted to match is x^5 with $0^(-1). This match * will fail. However repl_lst will contain $0 == x as a side effect. This * repl_lst will prevent the match of y^(-1) to ($0)^(-1) to succeed. * * This issue was worked around by 73f0ce4cf8d91f073f35a45443f5fbe886921c5c. * Now we have a real fix (192ed7390b7b2b705ad100e3db0a92eedd2b20ad), but * let's add a check. */ static void match_false_negative() { symbol x("x"), y("y"); ex e = pow(x, 5)*pow(y, -1); ex pattern = pow(wild(0), -1)*pow(x, wild(2)); exmap repls; bool match_p = e.match(pattern, repls); cbug_on(!match_p, "false negative: " << e << " did not match " << pattern); } /* * expairseq::match() should not have any side effects if the match failed. */ static void expairseq_failed_match_no_side_effect(int count) { for (int i = 0; i < count; ++i) { exmap repls; symbol t("t"), A("A"); ex e = pow(t, 2)*exp(t*A); ex pattern = pow(t, wild(0))*exp(wild(1))*A; bool matched = e.match(pattern, repls); cbug_on(matched, "unexpected match: " << e << " vs " << pattern); cbug_on(repls.size(), "failed match has side effects"); } } /* * exp(a)*sin(x) + exp(b)*sin(y) used to fail to match * exp(a)*sin($0) + exp(b)*sin($1). The failure was not deterministic. * * The first attempted submatch is sin(y)*exp(b) with sin($0)*exp(a). * It fails but $0 == y gets assigned due to a spurious side effect. * Next submatch is sin(x)*exp(a) with sin($0)*exp(a) (the same pattern * as in the first submatch). This one fails because of (incorrect) * $0 == y assignment. * * Note: due to the unstable term ordering the sequence of submatches * might be different and the match might succeed (as it should), hence * we repeat the test several times. */ static void expairseq_match_false_negative(int count) { for (int i = 0; i < count; ++i) { symbol a("a"), b("b"), x("x"), y("y"); ex e = exp(a)*sin(x) + exp(b)*sin(y); ex pattern = exp(a)*sin(wild(0)) + exp(b)*sin(wild(1)); cbug_on(!e.match(pattern), "match failed: " << e << "did not" "match " << pattern); } } int main(int argc, char** argv) { const int repetitions = 100; std::cout << "checking for historical bugs in match()... " << std::flush; failed_match_have_side_effects(); match_false_negative(); expairseq_failed_match_no_side_effect(repetitions); expairseq_match_false_negative(repetitions); std::cout << "not found. "; return 0; } ginac-1.7.8.orig/check/numeric_archive.cpp0000644000000000000000000000411613457611471015374 0ustar /** @file numeric_archive.cpp * * Check for a bug in numeric::archive * * numeric::archive used to fail if the real part of a complex number * is a rational number and the imaginary part is a floating point one. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include #include #include #include #include #include #include using namespace cln; struct archive_unarchive_check { cl_N operator()(const cl_N& n) const { ex e = numeric(n); archive ar; ar.archive_ex(e, "test"); lst l; ex check = ar.unarchive_ex(l, "test"); if (!check.is_equal(e)) { std::ostringstream s; s << __FILE__ << ':' << __LINE__ << ": expected: " << e << ", got " << check; throw std::logic_error(s.str()); } return n; } }; int main(int argc, char** argv) { const cl_I one(1); std::cout << "checking if numeric::archive handles complex numbers properly" << std::endl; const cl_R three_fp = cl_float(3.0, default_float_format); std::vector numbers; numbers.push_back(complex(one, three_fp)); numbers.push_back(complex(three_fp, one)); numbers.push_back(complex(three_fp, three_fp)); numbers.push_back(complex(one, one)); std::for_each(numbers.begin(), numbers.end(), archive_unarchive_check()); return 0; } ginac-1.7.8.orig/check/parser_bugs.cpp0000644000000000000000000000570213457611471014547 0ustar /** @file parser_bugs.cpp * * Check for some silly bugs in the parser. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include #include #include #include // - a - b was misparsed as -a + b due to a bug in parser::parse_unary_expr() static int check1(std::ostream& err_str) { const std::string srep("-a-b"); parser reader; ex e = reader(srep); ex a = reader.get_syms()["a"]; ex b = reader.get_syms()["b"]; ex g = - a - b; ex d = (e - g).expand(); if (!d.is_zero()) { err_str << "\"" << srep << "\" was misparsed as \"" << e << "\"" << std::endl; return 1; } return 0; } /// Parser was rejecting the valid expression '5 - (3*x)/10'. static int check2(std::ostream& err_str) { const std::string srep("5-(3*x)/10"); parser reader; ex e = reader(srep); ex x = reader.get_syms()["x"]; ex g = 5 - (3*x)/10; ex d = (e - g).expand(); if (!d.is_zero()) { err_str << "\"" << srep << "\" was misparsed as \"" << e << "\"" << std::endl; return 1; } return 0; } /// parse_literal_expr forget to consume the token, so parser get /// very confused. static int check3(std::ostream& err_str) { const std::string srep("5-(2*I)/3"); parser reader; ex e = reader(srep); ex g = numeric(5) - (numeric(2)*I)/3; ex d = (e - g).expand(); if (!d.is_zero()) { err_str << "\"" << srep << "\" was misparsed as \"" << e << "\"" << std::endl; return 1; } return 0; } /// parser happily accepted various junk like 'x^2()+1' static int check4(std::ostream& err_str) { const std::string junk("x^2()+1"); parser reader; ex e; try { e = reader(junk); err_str << "parser accepts junk: \"" << junk << "\"" << std::endl; return 1; } catch (parse_error& err) { // Ok, parser rejects the nonsense. return 0; } } int main(int argc, char** argv) { std::cout << "checking for parser bugs. " << std::flush; std::ostringstream err_str; int errors = 0; errors += check1(err_str); errors += check2(err_str); errors += check3(err_str); errors += check4(err_str); if (errors) { std::cout << "Yes, unfortunately:" << std::endl; std::cout << err_str.str(); } else { std::cout << "Not found. "; } return errors; } ginac-1.7.8.orig/check/pgcd_infinite_loop.cpp0000644000000000000000000000272613457611471016071 0ustar #include #include #include "ginac.h" using namespace GiNaC; using namespace std; static const string srep("\ 792*z^8*w^4*x^3*y^4*u^7 + 24*z^4*w^4*x^2*y^3*u^4 \ + 264*z^8*w^3*x^2*y^7*u^5 + 198*z^4*w^5*x^5*y*u^6 \ + 110*z^2*w^3*x^5*y^4*u^6 - 120*z^8*w*x^4*u^6 \ - 480*z^5*w*x^4*y^6*u^8 - 720*z^7*x^3*y^3*u^7 \ + 165*z^4*w^2*x^4*y*u^5 + 450*z^8*w^6*x^2*y*u^8 \ + 40*z^2*w^3*x^3*y^3*u^6 - 288*z^7*w^2*x^3*y^6*u^6 \ + 250*z^6*w^4*x^2*y^4*u^8 + 576*z^7*w^7*x^2*y^4*u^8 \ - 80*z^6*w^2*x^5*y^3*u^7 - 144*z^8*w^4*x^5*u^7 \ + 120*z^4*w*x^2*y^6*u^6 + 320*z^5*w^5*x^2*y^7*u^8 \ + 192*z^7*w^6*x*y^7*u^6 - 12*z^4*w^3*x^3*y^5*u^6 \ - 36*z^4*w^4*x^4*y^2*u^8 + 72*z^4*w^5*x^3*u^6 \ - 20*z^2*w^2*x^4*y^5*u^8 + 660*z^8*w*x^2*y^4*u^6 \ + 66*z^4*w^4*x^4*y^4*u^4 + 440*z^6*w^2*x^3*y^7*u^7 \ - 30*z^4*w*x^3*y^2*u^7 - 48*z^8*w^3*x^4*y^3*u^5 \ + 72*z^6*w^2*x*y^6*u^4 - 864*z^7*w^3*x^4*y^3*u^8 \ + 480*z^7*w^4*x*y^4*u^7 + 60*z^4*w^2*x^2*u^5 \ + 375*z^8*w^3*x*y*u^7 + 150*z^8*w^5*x*y^4*u^6 \ + 180*z^6*x*y^3*u^5 + 216*z^6*w^3*x^2*y^3*u^6"); int main(int argc, char** argv) { cout << "Checking for more pgcd() bugs (infinite loop, miscalculation) ... " << flush; parser the_parser; ex e = the_parser(srep); const symbol x = ex_to(the_parser.get_syms()["x"]); ex g = gcd(e, e.diff(x)); ex should_be = the_parser(string("u^4*z^2")); if (!(g-should_be).expand().is_zero()) { cout << "GCD was miscomputed. " << flush; return 1; } cout << "not found. " << flush; return 0; } ginac-1.7.8.orig/check/pgcd_relatively_prime_bug.cpp0000644000000000000000000000147513457611471017444 0ustar /** @file pgcd_relatively_prime_bug.cpp * * A program exposing historical bug in the pgcd() function. */ #include #include #include #include "ginac.h" using namespace std; using namespace GiNaC; int main(int argc, char** argv) { cout << "Checking for pgcd() bug regarding relatively prime polynomials: " << flush; const symbol q("q"); parser reader; reader.get_syms().insert(make_pair(string("q"), q)); ex t = reader("-E20^16*E4^8*E5^8*E1^16*q^4" "-(E10^24-E20^8*E5^16)*E4^16*E1^8" "+E2^24*E20^16*E5^8*q^4"); ex g = gcd(t.expand(), t.diff(q).expand()) - 1; if (!g.is_zero()) { cout << " oops!" << endl << "** Error: should be 0, got " << g << endl << flush; throw std::logic_error("gcd was miscalculated"); } cout << "not found" << endl << flush; return 0; } ginac-1.7.8.orig/check/randomize_serials.cpp0000644000000000000000000000420613457611471015743 0ustar /** @file randomize_serials.cpp * * Utility function used by the benchmarks. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" using namespace GiNaC; #include #include using namespace std; /** Generate a random amount of symbols and destroy them again immediately. * This operation effectively makes the serial numbers of all subsequent * symbols unpredictable. If the serials are unpredictable, then so are * their hash values. If the hash values are unpredictable, then so are * the canonical orderings. If the canonical orderings are unpredictable, * all subsequent times are subject to some variation. This variation, * however is natural and desirable for two reasons: First, we cannot know * how many symbols have been generated before in real world computations. * Second, the following timings are subject to some semi-random variation * anyways because short timings need to be repeated until enough time has * gone by for the measurement to be reliable. During this process the serial * numbers will be shifted anyways in a semi-random way. It is better not * to lull the user in a false sense of reproducibility and instead confront * her with the normal variation to be expected. */ void randomify_symbol_serials() { srand(time(nullptr)); const int m = rand() % 666; for (int s=0; s #include #include #include template static void run_benchmark(T& benchmark, const unsigned ntests = 10, const std::clock_t t_annoying = 15*CLOCKS_PER_SEC, const std::clock_t t_min = CLOCKS_PER_SEC/100) { const std::clock_t start(std::clock()); std::clock_t elapsed(start); timer P36; unsigned n = 0; double t = 0; bool go_on = true; do { ++n; P36.start(); benchmark.run(); t += P36.read(); go_on = benchmark.check(); if (!go_on) break; elapsed = std::clock() - start; if (elapsed > t_annoying) break; } while (n <= ntests || elapsed < t_min); t /= n; benchmark.print_result(t); } // By default long-running timings are disabled (to not annoy the user). // If the GINAC_RUN_EXPENSIVE_TIMINGS environment variable is set to "1", // some of them (which are supposed to be relatively fast) will be enabled. // If GINAC_RUN_EXPENSIVE_TIMINGS is set to "2", all timings are enabled. static int run_expensive_timings_p() { static int value = 0; static int cc = 0; static const std::string env_name("GINAC_RUN_EXPENSIVE_TIMINGS"); if (cc++ == 0) { char* envvar = std::getenv(env_name.c_str()); if (envvar != nullptr) { value = std::atoi(envvar); if (value < 0 || value > 2) value = 0; } if (value) { std::cerr << "WARNING: " << "long-running timings are ENABLED." << std::endl << "Unset the \"" << env_name << "\" " << "environment variable skip them." << std::endl; } } return value; } #endif // ndef GINAC_CHECK_TEST_RUNNER_H ginac-1.7.8.orig/check/time_antipode.cpp0000644000000000000000000003646613457611471015067 0ustar /** @file time_antipode.cpp * * This is a beautiful example that calculates the counterterm for the * overall divergence of some special sorts of Feynman diagrams in a massless * Yukawa theory. For this end it computes the antipode of the corresponding * decorated rooted tree using dimensional regularization in the parameter * x==-(D-4)/2, which leads to a Laurent series in x. The renormalization * scheme used is the minimal subtraction scheme (MS). From an efficiency * point of view it boils down to power series expansion. It also has quite * an intriguing check for consistency, which is why we include it here. * * This program is based on work by * Isabella Bierenbaum and * Dirk Kreimer . * For details, please see . */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include #include #include #include #include using namespace std; // whether to run this beast or not: constexpr bool do_test = true; // regularization parameter: static const symbol x("x"); typedef pair ijpair; typedef pair child; const constant TrOne("Tr[One]", numeric(4)); /* Extract only the divergent part of a series and discard the rest. */ static ex div_part(const ex &exarg, const symbol &x, unsigned grad) { const ex exser = exarg.series(x==0, grad); if (exser.degree(x)<0) throw runtime_error("divergent part truncation disaster"); ex exser_trunc; for (int i=exser.ldegree(x); i<0; ++i) exser_trunc += exser.coeff(x,i)*pow(x,i); // NB: exser_trunc is by construction collected in x. return exser_trunc; } /* F_ab(a, i, b, j, "x") is a common pattern in all vertex evaluators. */ static ex F_ab(int a, int i, int b, int j, const symbol &x) { using GiNaC::tgamma; if ((i==0 && a<=0) || (j==0 && b<=0)) return 0; else return (tgamma(2-a-(i+1)*x)* tgamma(2-b-(1+j)*x)* tgamma(a+b-2+(1+i+j)*x)/ tgamma(a+i*x)/ tgamma(b+j*x)/tgamma(4-a-b-(2+i+j)*x)); } /* Abstract base class (ABC) for all types of vertices. */ class vertex { public: vertex(ijpair ij = ijpair(0,0)) : indices(ij) { } void increment_indices(const ijpair &ind) { indices.first += ind.first; indices.second += ind.second; } virtual ~vertex() { } virtual vertex* copy() const = 0; virtual ijpair get_increment() const { return indices; } virtual const ex evaluate(const symbol &x, const unsigned grad) const = 0; bool operator==(const vertex &v) const { return (indices==v.indices); } bool operator<(const vertex &v) const { return (indices catalog; static unsigned prev_grad = 0; if (grad>prev_grad) { catalog.clear(); prev_grad = grad; } map::iterator pos = catalog.find(*this); if (pos==catalog.end()) { int i = indices.first; int j = indices.second; const ex result = ((F_ab(0,i,1,j,x)+F_ab(1,i,1,j,x)-F_ab(1,i,0,j,x))/2).series(x==0, grad).expand(); pos = catalog.insert(map::value_type(*this,result)).first; if (gradsecond; } /** Class of vertices of type Sigma_flipped, sitting in the upper fermion line of Vacuum; no consequences for Gamma. */ class Sigma_flipped : public Sigma { public: Sigma_flipped(ijpair ij = ijpair(0,0)) : Sigma(ij) { } vertex* copy() const override { return new Sigma_flipped(*this); } ijpair get_increment() const override { return ijpair(0, indices.first+indices.second+1); } const ex evaluate(const symbol &x, const unsigned grad) const override { return Sigma::evaluate(x, grad); } private: }; /* *Class of vertices of type Gamma. */ class Gamma : public vertex { public: Gamma(ijpair ij = ijpair(0,0)) : vertex(ij) { } vertex* copy() const override { return new Gamma(*this); } ijpair get_increment() const override { return ijpair(indices.first+indices.second+1, 0); } const ex evaluate(const symbol &x, const unsigned grad) const override; private: }; const ex Gamma::evaluate(const symbol &x, const unsigned grad) const { // c.f. comments in node::evaluate() static map catalog; static unsigned prev_grad = 0; if (prev_grad::iterator pos = catalog.find(*this); if (pos==catalog.end()) { int i = indices.first; int j = indices.second; const ex result = (F_ab(1,i,1,j,x)).series(x==0,grad).expand(); pos = catalog.insert(map::value_type(*this,result)).first; if (gradsecond; } /* * Class of vertices of type Vacuum. */ class Vacuum : public vertex { public: Vacuum(ijpair ij = ijpair(0,0)) : vertex(ij) { } vertex* copy() const override { return new Vacuum(*this); } ijpair get_increment() const override { return ijpair(0, indices.first+indices.second+1); } const ex evaluate(const symbol &x, const unsigned grad) const override; private: }; const ex Vacuum::evaluate(const symbol &x, const unsigned grad) const { // c.f. comments in node::evaluate() static map catalog; static unsigned prev_grad = 0; if (prev_grad::iterator pos = catalog.find(*this); if (pos==catalog.end()) { int i = indices.first; int j = indices.second; const ex result = ((-TrOne*(F_ab(0,i,1,j,x)-F_ab(1,i,1,j,x)+F_ab(1,i,0,j,x)))/2).series(x==0,grad).expand(); pos = catalog.insert(map::value_type(*this,result)).first; if (gradsecond; } /* * Class of nodes (or trees or subtrees), including list of children. */ class node { public: node(const vertex &v) { vert = v.copy(); } node(const node &n) { vert = (n.vert)->copy(); children = n.children; } const node & operator=(const node &); ~node() { delete vert; } void add_child(const node &, bool = false); const ex evaluate(const symbol &x, unsigned grad) const; unsigned total_edges() const; bool operator==(const node &) const; bool operator<(const node &) const; private: vertex *vert; multiset children; }; const node & node::operator=(const node &n) { if (this!=&n) { delete vert; vert = (n.vert)->copy(); children = n.children; } return *this; } void node::add_child(const node &childnode, bool cut) { children.insert(child(childnode, cut)); if(!cut) vert->increment_indices(childnode.vert->get_increment()); } const ex node::evaluate(const symbol &x, unsigned grad) const { static map catalog; // lookup table for already evaluated subnodes static unsigned prev_grad = 0; // grad argument that the catalog has been build for if (grad>prev_grad) { // We haven't computed far enough last time. Our catalog cannot cope with // the demands for this value of grad so let's clear it. catalog.clear(); prev_grad = grad; } ex product = 1; // accumulator for all the children for (multiset::const_iterator i=children.begin(); i!=children.end(); ++i) { map::iterator pos = catalog.find(i->first); if (pos==catalog.end()) { pos = catalog.insert(map::value_type(i->first,i->first.evaluate(x,grad).series(x==0,grad).expand())).first; if (gradsecond) product *= pos->second; else product *= -div_part(pos->second,x,grad); } return (product * vert->evaluate(x,grad)); } unsigned node::total_edges() const { unsigned accu = 0; for (multiset::const_iterator i=children.begin(); i!=children.end(); ++i) { accu += i->first.total_edges(); ++accu; } return accu; } bool node::operator==(const node &n) const { // Are the types of the top-level node vertices equal? if (typeid(*vert)!=typeid(*n.vert)) return false; // Are the indices of the top-level nodes equal? if (!(*vert==*n.vert)) return false; // Are the sets of children equal, one by one? return (children==n.children); } bool node::operator<(const node &n) const { // Are the types of the top-level node vertices different? if (typeid(*vert)!=typeid(*n.vert)) return typeid(*vert).before(typeid(*n.vert)); // Are the indices of the top-level nodes different? if (!(*vert==*n.vert)) return (vert counter; for (unsigned i=0; i<(1U<::iterator i=counter.begin(); i!=counter.end(); ++i) result = (result+i->evaluate(x,vertices-1)).series(x==0,vertices-1).expand(); // ...and has the nice property that in each term all the Eulers cancel: if (result.has(Euler)) { clog << "The antipode was miscalculated\nAntipode==" << result << "\nshould not have any occurrence of Euler" << endl; return 1; } else if (result.ldegree(x)!=-vertices || result.degree(x)!=0) { clog << "The antipode was miscalculated\nAntipode==" << result << "\nshould run from " << x << "^(" << -vertices << ") to " << x << "^(0)" << "but it runs from " << x << "^(" << result.ldegree(x) << ")" << "to " << x << "^(" << result.degree(x) << ")" << endl; return 1; } return 0; } unsigned time_antipode() { unsigned result = 0; timer jaeger_le_coultre; cout << "timing computation of antipodes in Yukawa theory" << flush; if (do_test) { jaeger_le_coultre.start(); result += test_tree(tree1); cout << '.' << flush; result += test_tree(tree2); cout << '.' << flush; result += test_tree(tree3); cout << '.' << flush; result += test_tree(tree4); cout << '.' << flush; result += test_tree(tree5); cout << '.' << flush; result += test_tree(tree6); cout << '.' << flush; cout << jaeger_le_coultre.read() << "s (total)" << endl; } else { cout << " disabled" << endl; } return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_antipode(); } ginac-1.7.8.orig/check/time_dennyfliegner.cpp0000644000000000000000000000526013457611471016101 0ustar /** @file time_dennyfliegner.cpp * * The first test routine implements Denny Fliegner's quick consistency check: * 1) e = (a0 + a1 + a2 + a3 + ...)^2, in expanded form * 2) substitute a0 by (-a2 - a3 - ...) in e * 3) expand e * after which e should be just a1^2. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include #include using namespace std; static unsigned expand_subs(unsigned size) { unsigned result = 0; // create a vector of size symbols named "a0", "a1", ... vector a; ex e; for (unsigned i=0; i sizes = {100, 200, 400, 800}; vector times; timer breitling; for (vector::iterator i=sizes.begin(); i!=sizes.end(); ++i) { breitling.start(); result += expand_subs(*i); times.push_back(breitling.read()); cout << '.' << flush; } // print the report: cout << endl << " size: "; for (vector::iterator i=sizes.begin(); i!=sizes.end(); ++i) cout << '\t' << *i; cout << endl << " time/s:"; for (vector::iterator i=times.begin(); i!=times.end(); ++i) cout << '\t' << *i; cout << endl; return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_dennyfliegner(); } ginac-1.7.8.orig/check/time_fateman_expand.cpp0000644000000000000000000000374413457611471016227 0ustar /** @file time_fateman_expand.cpp * * Time for polynomial expansion of (x+y+z+1)^20 * ((x+y+z+1)^20+1). * This test was suggested by Richard J. Fateman as a benchmark for programs * to multiply sparse polynomials fast. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include using namespace std; static unsigned test() { unsigned result = 0; const symbol x("x"), y("y"), z("z"); const ex p = pow(x+y+z+1, 20); const ex hugesum = expand(p * (p+1)); if (hugesum.nops()!=12341) { clog << "(x+y+z+1)^20 * ((x+y+z+1)^20+1) was miscomputed!" << endl; ++result; } return result; } unsigned time_fateman_expand() { unsigned result = 0; unsigned count = 0; timer concord; double time = .0; cout << "timing Fateman's polynomial expand benchmark" << flush; concord.start(); // correct for very small times: do { result = test(); ++count; } while ((time=concord.read())<0.1 && !result); cout << '.' << flush; cout << time/count << 's' << endl; return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_fateman_expand(); } ginac-1.7.8.orig/check/time_gammaseries.cpp0000644000000000000000000000503613457611471015546 0ustar /** @file time_gammaseries.cpp * * Some timings on series expansion of the Gamma function around a pole. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include using namespace std; unsigned tgammaseries(unsigned order) { unsigned result = 0; symbol x; ex myseries = series(GiNaC::tgamma(x),x==0,order); // compute the last coefficient numerically: ex last_coeff = myseries.coeff(x,order-1).evalf(); // compute a bound for that coefficient using a variation of the leading // term in Stirling's formula: ex bound = exp(-.57721566490153286*(order-1))/(order-1); if (abs((last_coeff-pow(-1,ex(order)))/bound) > 1) { clog << "The " << order-1 << "th order coefficient in the power series expansion of tgamma(0) was erroneously found to be " << last_coeff << ", violating a simple estimate." << endl; ++result; } return result; } unsigned time_gammaseries() { unsigned result = 0; cout << "timing Laurent series expansion of Gamma function" << flush; vector sizes = {20, 25, 30, 35}; vector times; timer omega; for (vector::iterator i=sizes.begin(); i!=sizes.end(); ++i) { omega.start(); result += tgammaseries(*i); times.push_back(omega.read()); cout << '.' << flush; } // print the report: cout << endl << " order: "; for (vector::iterator i=sizes.begin(); i!=sizes.end(); ++i) cout << '\t' << *i; cout << endl << " time/s:"; for (vector::iterator i=times.begin(); i!=times.end(); ++i) cout << '\t' << *i; cout << endl; return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_gammaseries(); } ginac-1.7.8.orig/check/time_lw_A.cpp0000644000000000000000000000361213457611471014131 0ustar /** @file time_lw_A.cpp * * Test A from the paper "Comparison of Polynomial-Oriented CAS" by Robert H. * Lewis and Michael Wester. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include using namespace std; static unsigned test() { for (int i=1; i<=99; ++i) factorial(1000+i)/factorial(900+i); ex rat(factorial(1100)/factorial(1000)); if (abs(evalf(rat)-numeric(".13280014101512E303"))>numeric("1.0E289")) { clog << "1100!/1000! erroneously returned " << rat << endl; return 1; } return 0; } unsigned time_lw_A() { unsigned result = 0; unsigned count = 0; timer rolex; double time = .0; cout << "timing Lewis-Wester test A (divide factorials)" << flush; rolex.start(); // correct for very small times: do { result = test(); ++count; } while ((time=rolex.read())<0.1 && !result); cout << '.' << flush; cout << time/count << 's' << endl; return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_lw_A(); } ginac-1.7.8.orig/check/time_lw_B.cpp0000644000000000000000000000355713457611471014142 0ustar /** @file time_lw_B.cpp * * Test B from the paper "Comparison of Polynomial-Oriented CAS" by Robert H. * Lewis and Michael Wester. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include using namespace std; static unsigned test() { numeric s; for (int i=1; i<=1000; ++i) s += numeric(i).inverse(); if (abs(s.evalf()-numeric("7.4854708605503449"))>numeric("2.0E-16")) { clog << "sum(1/i,i=1..1000) erroneously returned " << s << endl; return 1; } return 0; } unsigned time_lw_B() { unsigned result = 0; unsigned count = 0; timer rolex; double time = .0; cout << "timing Lewis-Wester test B (sum of rational numbers)" << flush; rolex.start(); // correct for very small times: do { result = test(); ++count; } while ((time=rolex.read())<0.1 && !result); cout << '.' << flush; cout << time/count << 's' << endl; return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_lw_B(); } ginac-1.7.8.orig/check/time_lw_C.cpp0000644000000000000000000000436013457611471014134 0ustar /** @file time_lw_C.cpp * * Test C from the paper "Comparison of Polynomial-Oriented CAS" by Robert H. * Lewis and Michael Wester. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include using namespace std; static unsigned test() { numeric x(13*17*31); numeric y(13*19*29); for (int i=1; i<200; ++i) gcd(pow(x,300+(i%181)),pow(y,200+(i%183))); ex lastgcd = gcd(pow(x,300+(200%181)),pow(y,200+(200%183))); if (lastgcd != numeric("53174994123961114423610399251974962981084780166115806651505844915220196792416194060680805428433601792982500430324916963290494659936522782673704312949880308677990050199363768068005367578752699785180694630122629259539608472261461289805919741933")) { clog << "gcd(" << x << "^" << 300+(200%181) << "," << y << "^" << 200+(200%183) << ") erroneously returned " << lastgcd << endl; return 1; } return 0; } unsigned time_lw_C() { unsigned result = 0; unsigned count = 0; timer rolex; double time = .0; cout << "timing Lewis-Wester test C (gcd of big integers)" << flush; rolex.start(); // correct for very small times: do { result = test(); ++count; } while ((time=rolex.read())<0.1 && !result); cout << '.' << flush; cout << time/count << 's' << endl; return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_lw_C(); } ginac-1.7.8.orig/check/time_lw_D.cpp0000644000000000000000000000355513457611471014142 0ustar /** @file time_lw_D.cpp * * Test D from the paper "Comparison of Polynomial-Oriented CAS" by Robert H. * Lewis and Michael Wester. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include using namespace std; static unsigned test() { ex s; symbol y("y"); symbol t("t"); for (int i=1; i<=10; ++i) s += i*y*pow(t,i)/pow(y + i*t,i); s = s.normal(); if (s.subs(t==0)!=0) { clog << "something very strange happened" << endl; return 1; } return 0; } unsigned time_lw_D() { unsigned result = 0; unsigned count = 0; timer rolex; double time = .0; cout << "timing Lewis-Wester test D (normalized sum of rational fcns)" << flush; rolex.start(); // correct for very small times: do { result = test(); ++count; } while ((time=rolex.read())<0.1 && !result); cout << '.' << flush; cout << time/count << 's' << endl; return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_lw_D(); } ginac-1.7.8.orig/check/time_lw_E.cpp0000644000000000000000000000356413457611471014143 0ustar /** @file time_lw_E.cpp * * Test E from the paper "Comparison of Polynomial-Oriented CAS" by Robert H. * Lewis and Michael Wester. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include using namespace std; static unsigned test() { ex s; symbol y("y"); symbol t("t"); for (int i=1; i<=10; ++i) s += i*y*pow(t,i)/pow(y + abs(5-i)*t,i); s = s.normal(); if (s.subs(t==0)!=0) { clog << "something very strange happened" << endl; return 1; } return 0; } unsigned time_lw_E() { unsigned result = 0; unsigned count = 0; timer rolex; double time = .0; cout << "timing Lewis-Wester test E (normalized sum of rational fcns)" << flush; rolex.start(); // correct for very small times: do { result = test(); ++count; } while ((time=rolex.read())<0.1 && !result); cout << '.' << flush; cout << time/count << 's' << endl; return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_lw_E(); } ginac-1.7.8.orig/check/time_lw_F.cpp0000644000000000000000000000402113457611471014131 0ustar /** @file time_lw_F.cpp * * Test F from the paper "Comparison of Polynomial-Oriented CAS" by Robert H. * Lewis and Michael Wester. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include using namespace std; static unsigned test() { symbol x("x"); symbol y("y"); ex p = expand(pow(pow(x,2)-3*x*y+pow(y,2),4)*pow(3*x-7*y+2,5)); ex q = expand(pow(pow(x,2)-3*x*y+pow(y,2),3)*pow(3*x-7*y-2,6)); ex result = gcd(p,q); if (result!=expand(pow(pow(x,2)-3*x*y+pow(y,2),3))) { clog << "gcd(expand((x^2-3*x*y+y^2)^4*(3*x-7*y+2)^5),expand((x^2-3*x*y+y^2)^3*(3*x-7*y-2)^6)) erroneously returned " << result << endl; return 1; } return 0; } unsigned time_lw_F() { unsigned result = 0; unsigned count = 0; timer rolex; double time = .0; cout << "timing Lewis-Wester test F (gcd of 2-var polys)" << flush; rolex.start(); // correct for very small times: do { result = test(); ++count; } while ((time=rolex.read())<0.1 && !result); cout << '.' << flush; cout << time/count << 's' << endl; return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_lw_F(); } ginac-1.7.8.orig/check/time_lw_G.cpp0000644000000000000000000000432213457611471014136 0ustar /** @file time_lw_G.cpp * * Test G from the paper "Comparison of Polynomial-Oriented CAS" by Robert H. * Lewis and Michael Wester. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include using namespace std; static unsigned test() { symbol x("x"); symbol y("y"); symbol z("z"); ex p = expand(pow(7*y*pow(x*z,2)-3*x*y*z+11*(x+1)*pow(y,2)+5*z+1,4) *pow(3*x-7*y+2*z-3,5)); ex q = expand(pow(7*y*pow(x*z,2)-3*x*y*z+11*(x+1)*pow(y,2)+5*z+1,3) *pow(3*x-7*y+2*z+3,6)); ex result = gcd(p,q); if (result.expand()!=expand(pow(7*y*pow(x*z,2)-3*x*y*z+11*(x+1)*pow(y,2)+5*z+1,3))) { clog << "gcd(expand((7*y*x^2*z^2-3*x*y*z+11*(x+1)*y^2+5*z+1)^4*(3*x-7*y+2*z-3)^5),expand((7*y*x^2*z^2-3*x*y*z+11*(x+1)*y^2+5*z+1)^3*(3*x-7*y+2*z+3)^6)) erroneously returned " << result << endl; return 1; } return 0; } unsigned time_lw_G() { unsigned result = 0; unsigned count = 0; timer rolex; double time = .0; cout << "timing Lewis-Wester test G (gcd of 3-var polys)" << flush; rolex.start(); // correct for very small times: do { result = test(); ++count; } while ((time=rolex.read())<0.1 && !result); cout << '.' << flush; cout << time/count << 's' << endl; return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_lw_G(); } ginac-1.7.8.orig/check/time_lw_H.cpp0000644000000000000000000000446013457611471014142 0ustar /** @file time_lw_H.cpp * * Test H from the paper "Comparison of Polynomial-Oriented CAS" by Robert H. * Lewis and Michael Wester. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include using namespace std; static unsigned test(unsigned n) { matrix hilbert(n,n); for (unsigned r=0; r #include using namespace std; static unsigned test(unsigned n) { unsigned result = 0; timer cartier; char name = (n==40?'I':(n==70?'K':'?')); cout << "timing Lewis-Wester test " << name << " (invert rank " << n << " Hilbert)" << flush; // Create a rank n Hilbert matrix: matrix H(n,n); for (unsigned r=0; r using namespace std; static unsigned test() { // Determinant of a sparse matrix that comes up in graph theory: symbol x1("x1"), x2("x2"), x3("x3"), x4("x4"), x5("x5"); ex w[26][11] = { { 1, 1, 1, 7, x4, 12, x3, 17, x2, 22, x1}, { 2, 2, 1, 8, x4, 13, x3, 18, x2, 23, x1}, { 3, 3, 1, 9, x4, 14, x3, 19, x2, 24, x1}, { 4, 4, 1, 10, x4, 15, x3, 20, x2, 25, x1}, { 5, 5, 1, 26, 1, 1, 0, 1, 0, 1, 0 }, { 6, 2, x5, 6, 1, 12, x3, 17, x2, 22, x1}, { 7, 3, x5, 7, 1, 13, x3, 18, x2, 23, x1}, { 8, 4, x5, 8, 1, 14, x3, 19, x2, 24, x1}, { 9, 5, x5, 9, 1, 15, x3, 20, x2, 25, x1}, {10, 10, 1, 26, 1, 1, 0, 1, 0, 1, 0 }, {11, 2, x5, 7, x4, 11, 1, 17, x2, 22, x1}, {12, 3, x5, 8, x4, 12, 1, 18, x2, 23, x1}, {13, 4, x5, 9, x4, 13, 1, 19, x2, 24, x1}, {14, 5, x5, 10, x4, 14, 1, 20, x2, 25, x1}, {15, 15, 1, 26, 1, 1, 0, 1, 0, 1, 0 }, {16, 2, x5, 7, x4, 12, x3, 16, 1, 22, x1}, {17, 3, x5, 8, x4, 13, x3, 17, 1, 23, x1}, {18, 4, x5, 9, x4, 14, x3, 18, 1, 24, x1}, {19, 5, x5, 10, x4, 15, x3, 19, 1, 25, x1}, {20, 20, 1, 26, 1, 1, 0, 1, 0, 1, 0 }, {21, 2, x5, 7, x4, 12, x3, 17, x2, 21, 1 }, {22, 3, x5, 8, x4, 13, x3, 18, x2, 22, 1 }, {23, 4, x5, 9, x4, 14, x3, 19, x2, 23, 1 }, {24, 5, x5, 10, x4, 15, x3, 20, x2, 24, 1 }, {25, 25, 1, 26, 1, 1, 0, 1, 0, 1, 0 }, {26, 1, x5, 6, x4, 11, x3, 16, x2, 21, x1} }; matrix m(26,26); for (unsigned r=0; r<26; ++r) { for (unsigned c=0; c<5; ++c) { m.set(r, unsigned(ex_to(w[r][2*c+1]).to_int()-1), w[r][2*c+2]); } } ex det = m.determinant(); // The result should have been: ex cmp("-12*x2^2*x5^2*x4-12*x1*x5^2*x3^2-x5^3*x4^2-12*x1*x5^2*x4^2-12*x2*x5^2*x4^2-12*x3*x5^2*x4^2-x4^3*x5^2-36*x3*x1*x5^2*x4-36*x3*x1*x4^2*x5-36*x3*x2*x5^2*x4-36*x3*x2*x4^2*x5-2*x5^3*x4*x2-12*x3^2*x5^2*x4-12*x3^2*x4^2*x5-2*x5^3*x4*x3-2*x4^3*x5*x3-12*x1*x5^2*x2^2-36*x1*x5*x3^2*x4-36*x2*x5*x3^2*x4-x3^3*x5^2-x3^3*x4^2-2*x3^3*x5*x4-12*x2^2*x4^2*x5-12*x2*x5^2*x3^2-12*x2*x4^2*x3^2-12*x1*x4^2*x3^2-x3^2*x5^3-x3^2*x4^3-2*x4^3*x5*x2-2*x3*x5^3*x2-2*x3*x4^3*x2-2*x3^3*x5*x2-2*x3^3*x4*x2-2*x2^3*x5*x4-2*x2^3*x5*x3-2*x2^3*x4*x3-36*x2^2*x5*x4*x3-36*x2*x1*x5^2*x4-36*x2*x1*x4^2*x5-120*x2*x1*x5*x4*x3-36*x2*x1*x5^2*x3-36*x2*x1*x4^2*x3-36*x2*x1*x3^2*x5-36*x2*x1*x3^2*x4-12*x2^2*x5^2*x3-12*x2^2*x4^2*x3-12*x2^2*x3^2*x5-12*x2^2*x3^2*x4-2*x1^3*x4*x3-2*x1^3*x4*x2-2*x1^3*x3*x2-2*x1^3*x5*x2-36*x1^2*x5*x4*x3-36*x2*x1^2*x5*x4-36*x2*x3*x1^2*x5-36*x2*x3*x1^2*x4-x1^3*x5^2-x1^3*x4^2-x1^3*x3^2-x1^3*x2^2-x2^2*x5^3-x2^2*x4^3-x2^2*x3^3-12*x1*x4^2*x2^2-12*x1*x3^2*x2^2-12*x1^2*x5^2*x4-12*x1^2*x4^2*x5-12*x1^2*x5^2*x3-12*x1^2*x4^2*x3-12*x1^2*x3^2*x5-12*x1^2*x3^2*x4-12*x1^2*x5^2*x2-12*x1^2*x4^2*x2-12*x1^2*x3^2*x2-12*x1^2*x2^2*x5-12*x1^2*x2^2*x4-12*x1^2*x2^2*x3-2*x5^3*x4*x1-2*x4^3*x5*x1-2*x3*x5^3*x1-2*x3*x4^3*x1-2*x3^3*x5*x1-2*x3^3*x4*x1-2*x2*x5^3*x1-2*x2*x4^3*x1-2*x2*x3^3*x1-2*x2^3*x5*x1-2*x2^3*x4*x1-2*x2^3*x3*x1-2*x1^3*x5*x4-2*x1^3*x5*x3-36*x1*x5*x2^2*x4-36*x1*x5*x2^2*x3-36*x1*x4*x2^2*x3-x1^2*x5^3-x1^2*x4^3-x1^2*x3^3-x2^3*x5^2-x2^3*x4^2-x2^3*x3^2-x1^2*x2^3",lst{x1,x2,x3,x4,x5}); if (det!=cmp) { clog << "The determinant was miscalculated" << endl; return 1; } return 0; } unsigned time_lw_M1() { unsigned result = 0; unsigned count = 0; timer rolex; double time = .0; cout << "timing Lewis-Wester test M1 (26x26 sparse, det)" << flush; rolex.start(); // correct for very small times: do { result = test(); ++count; } while ((time=rolex.read())<0.1 && !result); cout << '.' << flush; cout << time/count << 's' << endl; return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_lw_M1(); } ginac-1.7.8.orig/check/time_lw_M2.cpp0000644000000000000000000002602413457611471014231 0ustar /** @file time_lw_M2.cpp * * Test M2 from the paper "Comparison of Polynomial-Oriented CAS" by Robert H. * Lewis and Michael Wester. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include using namespace std; constexpr bool do_test = false; // set to true in order to run this beast static unsigned test() { // Determinant of a sparse matrix that comes up in graph theory: symbol x1("x1"), x2("x2"), x3("x3"), x4("x4"), x5("x5"); symbol x6("x6"), x7("x7"), x8("x8"), x9("x9"), xA("xA"); ex w[101][21] = { { 1, 1, 1, 12, x9, 22, x8, 32, x7, 42, x6, 52, x5, 62, x4, 72, x3, 82, x2, 92, x1 }, { 2, 2, 1, 13, x9, 23, x8, 33, x7, 43, x6, 53, x5, 63, x4, 73, x3, 83, x2, 93, x1 }, { 3, 3, 1, 14, x9, 24, x8, 34, x7, 44, x6, 54, x5, 64, x4, 74, x3, 84, x2, 94, x1 }, { 4, 4, 1, 15, x9, 25, x8, 35, x7, 45, x6, 55, x5, 65, x4, 75, x3, 85, x2, 95, x1 }, { 5, 5, 1, 16, x9, 26, x8, 36, x7, 46, x6, 56, x5, 66, x4, 76, x3, 86, x2, 96, x1 }, { 6, 6, 1, 17, x9, 27, x8, 37, x7, 47, x6, 57, x5, 67, x4, 77, x3, 87, x2, 97, x1 }, { 7, 7, 1, 18, x9, 28, x8, 38, x7, 48, x6, 58, x5, 68, x4, 78, x3, 88, x2, 98, x1 }, { 8, 8, 1, 19, x9, 29, x8, 39, x7, 49, x6, 59, x5, 69, x4, 79, x3, 89, x2, 99, x1 }, { 9, 9, 1, 20, x9, 30, x8, 40, x7, 50, x6, 60, x5, 70, x4, 80, x3, 90, x2, 100, x1 }, {10, 10, 1, 101, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }, {11, 2, xA, 11, 1, 22, x8, 32, x7, 42, x6, 52, x5, 62, x4, 72, x3, 82, x2, 92, x1 }, {12, 3, xA, 12, 1, 23, x8, 33, x7, 43, x6, 53, x5, 63, x4, 73, x3, 83, x2, 93, x1 }, {13, 4, xA, 13, 1, 24, x8, 34, x7, 44, x6, 54, x5, 64, x4, 74, x3, 84, x2, 94, x1 }, {14, 5, xA, 14, 1, 25, x8, 35, x7, 45, x6, 55, x5, 65, x4, 75, x3, 85, x2, 95, x1 }, {15, 6, xA, 15, 1, 26, x8, 36, x7, 46, x6, 56, x5, 66, x4, 76, x3, 86, x2, 96, x1 }, {16, 7, xA, 16, 1, 27, x8, 37, x7, 47, x6, 57, x5, 67, x4, 77, x3, 87, x2, 97, x1 }, {17, 8, xA, 17, 1, 28, x8, 38, x7, 48, x6, 58, x5, 68, x4, 78, x3, 88, x2, 98, x1 }, {18, 9, xA, 18, 1, 29, x8, 39, x7, 49, x6, 59, x5, 69, x4, 79, x3, 89, x2, 99, x1 }, {19, 10, xA, 19, 1, 30, x8, 40, x7, 50, x6, 60, x5, 70, x4, 80, x3, 90, x2, 100, x1 }, {20, 20, 1, 101, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }, {21, 2, xA, 12, x9, 21, 1, 32, x7, 42, x6, 52, x5, 62, x4, 72, x3, 82, x2, 92, x1 }, {22, 3, xA, 13, x9, 22, 1, 33, x7, 43, x6, 53, x5, 63, x4, 73, x3, 83, x2, 93, x1 }, {23, 4, xA, 14, x9, 23, 1, 34, x7, 44, x6, 54, x5, 64, x4, 74, x3, 84, x2, 94, x1 }, {24, 5, xA, 15, x9, 24, 1, 35, x7, 45, x6, 55, x5, 65, x4, 75, x3, 85, x2, 95, x1 }, {25, 6, xA, 16, x9, 25, 1, 36, x7, 46, x6, 56, x5, 66, x4, 76, x3, 86, x2, 96, x1 }, {26, 7, xA, 17, x9, 26, 1, 37, x7, 47, x6, 57, x5, 67, x4, 77, x3, 87, x2, 97, x1 }, {27, 8, xA, 18, x9, 27, 1, 38, x7, 48, x6, 58, x5, 68, x4, 78, x3, 88, x2, 98, x1 }, {28, 9, xA, 19, x9, 28, 1, 39, x7, 49, x6, 59, x5, 69, x4, 79, x3, 89, x2, 99, x1 }, {29, 10, xA, 20, x9, 29, 1, 40, x7, 50, x6, 60, x5, 70, x4, 80, x3, 90, x2, 100, x1 }, {30, 30, 1, 101, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }, {31, 2, xA, 12, x9, 22, x8, 31, 1, 42, x6, 52, x5, 62, x4, 72, x3, 82, x2, 92, x1 }, {32, 3, xA, 13, x9, 23, x8, 32, 1, 43, x6, 53, x5, 63, x4, 73, x3, 83, x2, 93, x1 }, {33, 4, xA, 14, x9, 24, x8, 33, 1, 44, x6, 54, x5, 64, x4, 74, x3, 84, x2, 94, x1 }, {34, 5, xA, 15, x9, 25, x8, 34, 1, 45, x6, 55, x5, 65, x4, 75, x3, 85, x2, 95, x1 }, {35, 6, xA, 16, x9, 26, x8, 35, 1, 46, x6, 56, x5, 66, x4, 76, x3, 86, x2, 96, x1 }, {36, 7, xA, 17, x9, 27, x8, 36, 1, 47, x6, 57, x5, 67, x4, 77, x3, 87, x2, 97, x1 }, {37, 8, xA, 18, x9, 28, x8, 37, 1, 48, x6, 58, x5, 68, x4, 78, x3, 88, x2, 98, x1 }, {38, 9, xA, 19, x9, 29, x8, 38, 1, 49, x6, 59, x5, 69, x4, 79, x3, 89, x2, 99, x1 }, {39, 10, xA, 20, x9, 30, x8, 39, 1, 50, x6, 60, x5, 70, x4, 80, x3, 90, x2, 100, x1 }, {40, 40, 1, 101, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }, {41, 2, xA, 12, x9, 22, x8, 32, x7, 41, 1, 52, x5, 62, x4, 72, x3, 82, x2, 92, x1 }, {42, 3, xA, 13, x9, 23, x8, 33, x7, 42, 1, 53, x5, 63, x4, 73, x3, 83, x2, 93, x1 }, {43, 4, xA, 14, x9, 24, x8, 34, x7, 43, 1, 54, x5, 64, x4, 74, x3, 84, x2, 94, x1 }, {44, 5, xA, 15, x9, 25, x8, 35, x7, 44, 1, 55, x5, 65, x4, 75, x3, 85, x2, 95, x1 }, {45, 6, xA, 16, x9, 26, x8, 36, x7, 45, 1, 56, x5, 66, x4, 76, x3, 86, x2, 96, x1 }, {46, 7, xA, 17, x9, 27, x8, 37, x7, 46, 1, 57, x5, 67, x4, 77, x3, 87, x2, 97, x1 }, {47, 8, xA, 18, x9, 28, x8, 38, x7, 47, 1, 58, x5, 68, x4, 78, x3, 88, x2, 98, x1 }, {48, 9, xA, 19, x9, 29, x8, 39, x7, 48, 1, 59, x5, 69, x4, 79, x3, 89, x2, 99, x1 }, {49, 10, xA, 20, x9, 30, x8, 40, x7, 49, 1, 60, x5, 70, x4, 80, x3, 90, x2, 100, x1 }, {50, 50, 1, 101, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }, {51, 2, xA, 12, x9, 22, x8, 32, x7, 42, x6, 51, 1, 62, x4, 72, x3, 82, x2, 92, x1 }, {52, 3, xA, 13, x9, 23, x8, 33, x7, 43, x6, 52, 1, 63, x4, 73, x3, 83, x2, 93, x1 }, {53, 4, xA, 14, x9, 24, x8, 34, x7, 44, x6, 53, 1, 64, x4, 74, x3, 84, x2, 94, x1 }, {54, 5, xA, 15, x9, 25, x8, 35, x7, 45, x6, 54, 1, 65, x4, 75, x3, 85, x2, 95, x1 }, {55, 6, xA, 16, x9, 26, x8, 36, x7, 46, x6, 55, 1, 66, x4, 76, x3, 86, x2, 96, x1 }, {56, 7, xA, 17, x9, 27, x8, 37, x7, 47, x6, 56, 1, 67, x4, 77, x3, 87, x2, 97, x1 }, {57, 8, xA, 18, x9, 28, x8, 38, x7, 48, x6, 57, 1, 68, x4, 78, x3, 88, x2, 98, x1 }, {58, 9, xA, 19, x9, 29, x8, 39, x7, 49, x6, 58, 1, 69, x4, 79, x3, 89, x2, 99, x1 }, {59, 10, xA, 20, x9, 30, x8, 40, x7, 50, x6, 59, 1, 70, x4, 80, x3, 90, x2, 100, x1 }, {60, 60, 1, 101, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }, {61, 2, xA, 12, x9, 22, x8, 32, x7, 42, x6, 52, x5, 61, 1, 72, x3, 82, x2, 92, x1 }, {62, 3, xA, 13, x9, 23, x8, 33, x7, 43, x6, 53, x5, 62, 1, 73, x3, 83, x2, 93, x1 }, {63, 4, xA, 14, x9, 24, x8, 34, x7, 44, x6, 54, x5, 63, 1, 74, x3, 84, x2, 94, x1 }, {64, 5, xA, 15, x9, 25, x8, 35, x7, 45, x6, 55, x5, 64, 1, 75, x3, 85, x2, 95, x1 }, {65, 6, xA, 16, x9, 26, x8, 36, x7, 46, x6, 56, x5, 65, 1, 76, x3, 86, x2, 96, x1 }, {66, 7, xA, 17, x9, 27, x8, 37, x7, 47, x6, 57, x5, 66, 1, 77, x3, 87, x2, 97, x1 }, {67, 8, xA, 18, x9, 28, x8, 38, x7, 48, x6, 58, x5, 67, 1, 78, x3, 88, x2, 98, x1 }, {68, 9, xA, 19, x9, 29, x8, 39, x7, 49, x6, 59, x5, 68, 1, 79, x3, 89, x2, 99, x1 }, {69, 10, xA, 20, x9, 30, x8, 40, x7, 50, x6, 60, x5, 69, 1, 80, x3, 90, x2, 100, x1 }, {70, 70, 1, 101, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }, {71, 2, xA, 12, x9, 22, x8, 32, x7, 42, x6, 52, x5, 62, x4, 71, 1, 82, x2, 92, x1 }, {72, 3, xA, 13, x9, 23, x8, 33, x7, 43, x6, 53, x5, 63, x4, 72, 1, 83, x2, 93, x1 }, {73, 4, xA, 14, x9, 24, x8, 34, x7, 44, x6, 54, x5, 64, x4, 73, 1, 84, x2, 94, x1 }, {74, 5, xA, 15, x9, 25, x8, 35, x7, 45, x6, 55, x5, 65, x4, 74, 1, 85, x2, 95, x1 }, {75, 6, xA, 16, x9, 26, x8, 36, x7, 46, x6, 56, x5, 66, x4, 75, 1, 86, x2, 96, x1 }, {76, 7, xA, 17, x9, 27, x8, 37, x7, 47, x6, 57, x5, 67, x4, 76, 1, 87, x2, 97, x1 }, {77, 8, xA, 18, x9, 28, x8, 38, x7, 48, x6, 58, x5, 68, x4, 77, 1, 88, x2, 98, x1 }, {78, 9, xA, 19, x9, 29, x8, 39, x7, 49, x6, 59, x5, 69, x4, 78, 1, 89, x2, 99, x1 }, {79, 10, xA, 20, x9, 30, x8, 40, x7, 50, x6, 60, x5, 70, x4, 79, 1, 90, x2, 100, x1 }, {80, 80, 1, 101, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }, {81, 2, xA, 12, x9, 22, x8, 32, x7, 42, x6, 52, x5, 62, x4, 72, x3, 81, 1, 92, x1 }, {82, 3, xA, 13, x9, 23, x8, 33, x7, 43, x6, 53, x5, 63, x4, 73, x3, 82, 1, 93, x1 }, {83, 4, xA, 14, x9, 24, x8, 34, x7, 44, x6, 54, x5, 64, x4, 74, x3, 83, 1, 94, x1 }, {84, 5, xA, 15, x9, 25, x8, 35, x7, 45, x6, 55, x5, 65, x4, 75, x3, 84, 1, 95, x1 }, {85, 6, xA, 16, x9, 26, x8, 36, x7, 46, x6, 56, x5, 66, x4, 76, x3, 85, 1, 96, x1 }, {86, 7, xA, 17, x9, 27, x8, 37, x7, 47, x6, 57, x5, 67, x4, 77, x3, 86, 1, 97, x1 }, {87, 8, xA, 18, x9, 28, x8, 38, x7, 48, x6, 58, x5, 68, x4, 78, x3, 87, 1, 98, x1 }, {88, 9, xA, 19, x9, 29, x8, 39, x7, 49, x6, 59, x5, 69, x4, 79, x3, 88, 1, 99, x1 }, {89, 10, xA, 20, x9, 30, x8, 40, x7, 50, x6, 60, x5, 70, x4, 80, x3, 89, 1, 100, x1 }, {90, 90, 1, 101, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }, {91, 2, xA, 12, x9, 22, x8, 32, x7, 42, x6, 52, x5, 62, x4, 72, x3, 82, x2, 91, 1 }, {92, 3, xA, 13, x9, 23, x8, 33, x7, 43, x6, 53, x5, 63, x4, 73, x3, 83, x2, 92, 1 }, {93, 4, xA, 14, x9, 24, x8, 34, x7, 44, x6, 54, x5, 64, x4, 74, x3, 84, x2, 93, 1 }, {94, 5, xA, 15, x9, 25, x8, 35, x7, 45, x6, 55, x5, 65, x4, 75, x3, 85, x2, 94, 1 }, {95, 6, xA, 16, x9, 26, x8, 36, x7, 46, x6, 56, x5, 66, x4, 76, x3, 86, x2, 95, 1 }, {96, 7, xA, 17, x9, 27, x8, 37, x7, 47, x6, 57, x5, 67, x4, 77, x3, 87, x2, 96, 1 }, {97, 8, xA, 18, x9, 28, x8, 38, x7, 48, x6, 58, x5, 68, x4, 78, x3, 88, x2, 97, 1 }, {98, 9, xA, 19, x9, 29, x8, 39, x7, 49, x6, 59, x5, 69, x4, 79, x3, 89, x2, 98, 1 }, {99, 10, xA, 20, x9, 30, x8, 40, x7, 50, x6, 60, x5, 70, x4, 80, x3, 90, x2, 99, 1 }, {100, 100, 1, 101, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }, {101, 1, xA, 11, x9, 21, x8, 31, x7, 41, x6, 51, x5, 61, x4, 71, x3, 81, x2, 91, x1} }; matrix m(101,101); for (unsigned r=0; r<101; ++r) { for (unsigned c=0; c<10; ++c) { m.set(r, unsigned(ex_to(w[r][2*c+1]).to_int()-1), w[r][2*c+2]); } } ex det = m.determinant(); if (det.nops()!=85228) { clog << "The determinant was miscalculated." << endl; return 1; } return 0; } unsigned time_lw_M2() { unsigned result = 0; unsigned count = 0; timer piaget; double time = .0; cout << "timing Lewis-Wester test M2 (101x101 sparse, det)" << flush; if (do_test) { piaget.start(); // correct for very small times: do { result = test(); ++count; } while ((time=piaget.read())<0.1 && !result); cout << '.' << flush; cout << time/count << 's' << endl; } else { cout << " disabled" << endl; } return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_lw_M2(); } ginac-1.7.8.orig/check/time_lw_N.cpp0000644000000000000000000001665613457611471014162 0ustar /** @file time_lw_N.cpp * * Test N from the paper "Comparison of Polynomial-Oriented CAS" by Robert H. * Lewis and Michael Wester (also known as the smaller version of the first * Fermat-test). */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include using namespace std; constexpr bool do_test = false; // set to true in order to run this beast static unsigned test() { symbol p11("p11"), p12("p12"), p21("p21"), p22("p22"); symbol a12("a12"), a21("a21"), a22("a22"); symbol n11("n11"), n22("n22"); symbol g("g"); symbol q1("q1"), q2("q2"), q3("q3"), q4("q4"); ex ss1 = ex("(4*g*a22^3-g*a12*a21*a22^2-4*n22*a21*a22^2+4*n11*a21*a22^2+7*g*a12*a22^2+4*g^2*a22^2-4*n11*n22*a22^2+4*n11*a22^2+n22*a12*a21^2*a22-n11*a12*a21^2*a22-4*g*a21^2*a22-g*a12^2*a21*a22-5*g^2*a12*a21*a22+5*n11*n22*a12*a21*a22-7*n22*a12*a21*a22+2*n11*a12*a21*a22-4*g*a21*a22+3*g*a12^2*a22+3*g^2*a12*a22-3*n11*n22*a12*a22+3*n11*a12*a22+g*a12*a21^3+g^2*a12^2*a21^2-n11*n22*a12^2*a21^2+n22*a12^2*a21^2-2*g*a12*a21^2-3*g^2*a12^2*a21+3*n11*n22*a12^2*a21-3*n22*a12^2*a21-3*g*a12*a21)/(3*g*a12*a21*a22^2-3*n22*a21*a22^2+g*a12*a22^2-n22*a22^2+3*n11*a12*a21^2*a22-3*g*a21^2*a22+5*g*a12^2*a21*a22-5*n22*a12*a21*a22+4*n11*a12*a21*a22-4*g*a21*a22+g*a12^2*a22-n22*a12*a22+n11*a12*a22-g*a22+2*n11*a12^2*a21^2-2*g*a12*a21^2+2*g*a12^3*a21-2*n22*a12^2*a21+2*n11*a12^2*a21-2*g*a12*a21)",lst{g,a12,a21,a22,n11,n22}); ex ss2 = ex("(4*g*a12*a22^2-4*n22*a22^2+4*a22^2-g*a12^2*a21*a22+n22*a12*a21*a22+4*n11*a12*a21*a22-5*a12*a21*a22-4*g*a21*a22+3*g*a12^2*a22-3*n22*a12*a22+3*a12*a22-n11*a12^2*a21^2+a12^2*a21^2+g*a12*a21^2+3*n11*a12^2*a21-3*a12^2*a21-3*g*a12*a21)/(2*g*a12*a22^2-2*n22*a22^2+g*a12^2*a21*a22-n22*a12*a21*a22+2*n11*a12*a21*a22-2*g*a21*a22+2*g*a12^2*a22-2*n22*a12*a22+2*n11*a12*a22-2*g*a22+n11*a12^2*a21^2-g*a12*a21^2+g*a12^3*a21-n22*a12^2*a21+n11*a12^2*a21-g*a12*a21)",lst{g,a12,a21,a22,n11,n22}); ex ss3 = ex("(4*p21*a22^3-p21*a12*a21*a22^2-4*p22*a21*a22^2+4*p11*a21*a22^2+7*p21*a12*a22^2-4*p11*p22*a22^2+4*p12*p21*a22^2+4*p11*a22^2+p22*a12*a21^2*a22-p11*a12*a21^2*a22-4*p12*a21^2*a22-p21*a12^2*a21*a22+5*p11*p22*a12*a21*a22-7*p22*a12*a21*a22-5*p12*p21*a12*a21*a22+2*p11*a12*a21*a22-4*p12*a21*a22+3*p21*a12^2*a22-3*p11*p22*a12*a22+3*p12*p21*a12*a22+3*p11*a12*a22+p12*a12*a21^3-p11*p22*a12^2*a21^2+p22*a12^2*a21^2+p12*p21*a12^2*a21^2-2*p12*a12*a21^2+3*p11*p22*a12^2*a21-3*p22*a12^2*a21-3*p12*p21*a12^2*a21-3*p12*a12*a21)/(3*p21*a12*a21*a22^2-3*p22*a21*a22^2+p21*a12*a22^2-p22*a22^2+3*p11*a12*a21^2*a22-3*p12*a21^2*a22+5*p21*a12^2*a21*a22-5*p22*a12*a21*a22+4*p11*a12*a21*a22-4*p12*a21*a22+p21*a12^2*a22-p22*a12*a22+p11*a12*a22-p12*a22+2*p11*a12^2*a21^2-2*p12*a12*a21^2+2*p21*a12^3*a21-2*p22*a12^2*a21+2*p11*a12^2*a21-2*p12*a12*a21)",lst{a12,a21,a22,p11,p12,p21,p22}); ex ss4 = ex("(4*p21*a12*a22^2-4*p22*a22^2+4*a22^2-p21*a12^2*a21*a22+p22*a12*a21*a22+4*p11*a12*a21*a22-5*a12*a21*a22-4*p12*a21*a22+3*p21*a12^2*a22-3*p22*a12*a22+3*a12*a22-p11*a12^2*a21^2+a12^2*a21^2+p12*a12*a21^2+3*p11*a12^2*a21-3*a12^2*a21-3*p12*a12*a21)/(2*p21*a12*a22^2-2*p22*a22^2+p21*a12^2*a21*a22-p22*a12*a21*a22+2*p11*a12*a21*a22-2*p12*a21*a22+2*p21*a12^2*a22-2*p22*a12*a22+2*p11*a12*a22-2*p12*a22+p11*a12^2*a21^2-p12*a12*a21^2+p21*a12^3*a21-p22*a12^2*a21+p11*a12^2*a21-p12*a12*a21)",lst{p11,p12,p21,p22,a12,a21,a22}); ex res1 = ex("p11*p22*q1^2*q4^2-p12*p21*q1^2*q4^2-n22*p11*p22*q1*q4^2+2*n11*p11*p22*q1*q4^2-p11*p22*q1*q4^2+n22*p12*p21*q1*q4^2-2*n11*p12*p21*q1*q4^2+p12*p21*q1*q4^2+2*g^2*p11*p22*q4^2-2*n11*n22*p11*p22*q4^2+2*n22*p11*p22*q4^2+2*n11*p11*p22*q4^2-2*p11*p22*q4^2-2*g^2*p12*p21*q4^2+2*n11*n22*p12*p21*q4^2-2*n22*p12*p21*q4^2-2*n11*p12*p21*q4^2+2*p12*p21*q4^2-n11*p22*q1*q2*q3*q4+g*p21*q1*q2*q3*q4+g*p12*q1*q2*q3*q4-n22*p11*q1*q2*q3*q4-g^2*p22*q2*q3*q4+n11*n22*p22*q2*q3*q4-n11*p22*q2*q3*q4-2*g*p21*q2*q3*q4+g*p12*q2*q3*q4+2*g^2*p11*q2*q3*q4-2*n11*n22*p11*q2*q3*q4+2*n22*p11*q2*q3*q4-n11*p22*q1*q3*q4+p22*q1*q3*q4+g*p21*q1*q3*q4-2*g*p12*q1*q3*q4+2*n22*p11*q1*q3*q4-2*p11*q1*q3*q4-g^2*p22*q3*q4+n11*n22*p22*q3*q4-n22*p22*q3*q4-n11*p22*q3*q4+p22*q3*q4-4*g^2*p11*q3*q4+4*n11*n22*p11*q3*q4-4*n22*p11*q3*q4-4*n11*p11*q3*q4+4*p11*q3*q4+n22*p11*p22*q1*q2*q4-2*n11*p11*p22*q1*q2*q4+2*n11*p22*q1*q2*q4-n22*p12*p21*q1*q2*q4+2*n11*p12*p21*q1*q2*q4+g*p21*q1*q2*q4-2*g*p12*q1*q2*q4-n22*p11*q1*q2*q4-4*g^2*p11*p22*q2*q4+4*n11*n22*p11*p22*q2*q4-2*n22*p11*p22*q2*q4-2*n11*p11*p22*q2*q4+2*g^2*p22*q2*q4-2*n11*n22*p22*q2*q4+2*n11*p22*q2*q4+4*g^2*p12*p21*q2*q4-4*n11*n22*p12*p21*q2*q4+2*n22*p12*p21*q2*q4+2*n11*p12*p21*q2*q4-2*g*p21*q2*q4-2*g*p12*q2*q4+2*g^2*p11*q2*q4-2*n11*n22*p11*q2*q4+2*n22*p11*q2*q4-p11*p22*q1^2*q4-p22*q1^2*q4+p12*p21*q1^2*q4+2*p11*q1^2*q4-n22*p11*p22*q1*q4-4*n11*p11*p22*q1*q4+5*p11*p22*q1*q4+n22*p22*q1*q4-p22*q1*q4+n22*p12*p21*q1*q4+4*n11*p12*p21*q1*q4-5*p12*p21*q1*q4+g*p21*q1*q4+4*g*p12*q1*q4+4*n11*p11*q1*q4-4*p11*q1*q4-g^2*q2^2*q3^2+n11*n22*q2^2*q3^2+g^2*q2*q3^2-n11*n22*q2*q3^2-n22*q2*q3^2+2*n11*q2*q3^2+2*g^2*q3^2-2*n11*n22*q3^2+2*n22*q3^2+2*n11*q3^2-2*q3^2+g^2*p22*q2^2*q3-n11*n22*p22*q2^2*q3-2*g^2*p11*q2^2*q3+2*n11*n22*p11*q2^2*q3+g^2*q2^2*q3-n11*n22*q2^2*q3+2*n11*p22*q1*q2*q3-2*g*p21*q1*q2*q3+g*p12*q1*q2*q3-n22*p11*q1*q2*q3+n22*q1*q2*q3-2*n11*q1*q2*q3+g^2*p22*q2*q3-n11*n22*p22*q2*q3+n22*p22*q2*q3+4*g*p21*q2*q3+g*p12*q2*q3+4*g^2*p11*q2*q3-4*n11*n22*p11*q2*q3+4*n11*p11*q2*q3-5*g^2*q2*q3+5*n11*n22*q2*q3-n22*q2*q3-4*n11*q2*q3+2*n11*p22*q1*q3-2*p22*q1*q3-2*g*p21*q1*q3-2*g*p12*q1*q3+2*n22*p11*q1*q3-2*p11*q1*q3-2*n22*q1*q3-2*n11*q1*q3+4*q1*q3+2*g^2*p11*p22*q2^2-2*n11*n22*p11*p22*q2^2-2*g^2*p22*q2^2+2*n11*n22*p22*q2^2-2*g^2*p12*p21*q2^2+2*n11*n22*p12*p21*q2^2-2*g^2*p11*q2^2+2*n11*n22*p11*q2^2+2*g^2*q2^2-2*n11*n22*q2^2+n22*p11*p22*q1*q2+4*n11*p11*p22*q1*q2-n22*p22*q1*q2-4*n11*p22*q1*q2-n22*p12*p21*q1*q2-4*n11*p12*p21*q1*q2-n22*p11*q1*q2-4*n11*p11*q1*q2+n22*q1*q2+4*n11*q1*q2-2*p11*p22*q1^2+2*p22*q1^2+2*p12*p21*q1^2+2*p11*q1^2-2*q1^2",lst{p11,p12,p21,p22,n11,n22,g,q1,q2,q3,q4}); ex result = res1.subs(lst{q1==ss1, q2==ss2, q3==ss3, q4==ss4}); ex normalresult = normal(result); if (!normalresult.is_zero()) { clog << "Normalization should have returned 0." << endl; return 1; } return 0; } unsigned time_lw_N() { unsigned result = 0; unsigned count = 0; timer tag_heuer; double time = .0; cout << "timing Lewis-Wester test N (poly at rational fcns)" << flush; if (do_test) { tag_heuer.start(); // correct for very small times: do { result = test(); ++count; } while ((time=tag_heuer.read())<0.1 && !result); cout << '.' << flush; cout << time/count << 's' << endl; } else { cout << " disabled" << endl; } return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_lw_N(); } ginac-1.7.8.orig/check/time_lw_O.cpp0000644000000000000000000001445513457611471014156 0ustar /** @file time_lw_O.cpp * * Test O1 from the paper "Comparison of Polynomial-Oriented CAS" by Robert H. * Lewis and Michael Wester. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include using namespace std; constexpr bool do_test2 = false; // set to true in order to run this beast static const symbol a1("a1"), a2("a2"), a3("a3"), a4("a4"), a5("a5"), a6("a6"); static const symbol b1("b1"), b2("b2"), b3("b3"), b4("b4"), b5("b5"), b6("b6"); static const symbol c1("c1"), c2("c2"), c3("c3"), c4("c4"), c5("c5"), c6("c6"); static const ex det1() { matrix d1 = {{a6, a5, a4, a3, a2, a1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, a6, 0, a5, a4, 0, a3, a2, a1, 0, 0, 0, 0, 0}, {0, a6, 0, a5, a4, 0, a3, a2, a1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, a6, 0, 0, a5, a4, 0, 0, a3, a2, a1, 0, 0}, {0, 0, 0, 0, a6, 0, 0, a5, a4, 0, 0, a3, a2, a1, 0}, {0, 0, 0, 0, 0, a6, 0, 0, a5, a4, 0, 0, a3, a2, a1}, {0, 0, 0, b6, 0, 0, b5, b4, 0, 0, b3, b2, b1, 0, 0}, {0, 0, 0, 0, b6, 0, 0, b5, b4, 0, 0, b3, b2, b1, 0}, {0, b6, 0, b5, b4, 0, b3, b2, b1, 0, 0, 0, 0, 0, 0}, {0, 0, b6, 0, b5, b4, 0, b3, b2, b1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, b6, 0, 0, b5, b4, 0, 0, b3, b2, b1}, {0, 0, 0, 0, 0, c6, 0, 0, c5, c4, 0, 0, c3, c2, c1}, {0, 0, c6, 0, c5, c4, 0, c3, c2, c1, 0, 0, 0, 0, 0}, {0, c6, 0, c5, c4, 0, c3, c2, c1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, c6, 0, 0, c5, c4, 0, 0, c3, c2, c1, 0}}; return d1.determinant(); } static const ex det2() { matrix d2 = {{b6, b5, b4, b3, b2, b1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, b6, 0, b5, b4, 0, b3, b2, b1, 0, 0, 0, 0, 0}, {0, b6, 0, b5, b4, 0, b3, b2, b1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, b6, 0, 0, b5, b4, 0, 0, b3, b2, b1, 0, 0}, {0, 0, 0, 0, b6, 0, 0, b5, b4, 0, 0, b3, b2, b1, 0}, {0, 0, 0, 0, 0, b6, 0, 0, b5, b4, 0, 0, b3, b2, b1}, {0, 0, 0, c6, 0, 0, c5, c4, 0, 0, c3, c2, c1, 0, 0}, {0, 0, 0, 0, c6, 0, 0, c5, c4, 0, 0, c3, c2, c1, 0}, {0, c6, 0, c5, c4, 0, c3, c2, c1, 0, 0, 0, 0, 0, 0}, {0, 0, c6, 0, c5, c4, 0, c3, c2, c1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, c6, 0, 0, c5, c4, 0, 0, c3, c2, c1}, {0, 0, 0, 0, 0, a6, 0, 0, a5, a4, 0, 0, a3, a2, a1}, {0, 0, a6, 0, a5, a4, 0, a3, a2, a1, 0, 0, 0, 0, 0}, {0, a6, 0, a5, a4, 0, a3, a2, a1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, a6, 0, 0, a5, a4, 0, 0, a3, a2, a1, 0}}; return d2.determinant(); } static const ex det3() { matrix d3 = {{c6, c5, c4, c3, c2, c1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, c6, 0, c5, c4, 0, c3, c2, c1, 0, 0, 0, 0, 0}, {0, c6, 0, c5, c4, 0, c3, c2, c1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, c6, 0, 0, c5, c4, 0, 0, c3, c2, c1, 0, 0}, {0, 0, 0, 0, c6, 0, 0, c5, c4, 0, 0, c3, c2, c1, 0}, {0, 0, 0, 0, 0, c6, 0, 0, c5, c4, 0, 0, c3, c2, c1}, {0, 0, 0, a6, 0, 0, a5, a4, 0, 0, a3, a2, a1, 0, 0}, {0, 0, 0, 0, a6, 0, 0, a5, a4, 0, 0, a3, a2, a1, 0}, {0, a6, 0, a5, a4, 0, a3, a2, a1, 0, 0, 0, 0, 0, 0}, {0, 0, a6, 0, a5, a4, 0, a3, a2, a1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, a6, 0, 0, a5, a4, 0, 0, a3, a2, a1}, {0, 0, 0, 0, 0, b6, 0, 0, b5, b4, 0, 0, b3, b2, b1}, {0, 0, b6, 0, b5, b4, 0, b3, b2, b1, 0, 0, 0, 0, 0}, {0, b6, 0, b5, b4, 0, b3, b2, b1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, b6, 0, 0, b5, b4, 0, 0, b3, b2, b1, 0}}; return d3.determinant(); } // The results of test_O1 will be needed for test_O2: static ex d1, d2, d3; static unsigned test_O1() { d1 = det1(); cout << '.' << flush; d2 = det2(); cout << '.' << flush; d3 = det3(); cout << '.' << flush; unsigned nops1 = nops(d1); unsigned nops2 = nops(d2); unsigned nops3 = nops(d3); if ((nops1 != 37490) || (nops2 != 37490) || (nops3 != 37490)) { clog << "Determinants were miscalculated" << endl; return 1; } return 0; } static unsigned test_O2() { const ex gcd1 = gcd( d1, d2 ); cout << '.' << flush; const ex resultant = gcd( gcd1, d3 ); cout << '.' << flush; if (nops(resultant) != 21894) { clog << "Resultant was miscalculated" << endl; return 1; } return 0; } unsigned time_lw_O() { unsigned result = 0; unsigned count = 0; timer rolex; double time = .0; cout << "timing Lewis-Wester test O1 (three 15x15 dets)" << flush; rolex.start(); // correct for very small times: do { result = test_O1(); ++count; } while ((time=rolex.read())<0.1 && !result); if (result) return result; cout << time/(3*count) << "s (average)" << endl; cout << "timing Lewis-Wester test O2 (Resultant)" << flush; if (do_test2) { rolex.reset(); result += test_O2(); cout << rolex.read() << "s (combined)" << endl; } else { cout << " disabled" << endl; } return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_lw_O(); } ginac-1.7.8.orig/check/time_lw_P.cpp0000644000000000000000000000433613457611471014154 0ustar /** @file time_lw_P.cpp * * Test P from the paper "Comparison of Polynomial-Oriented CAS" by Robert H. * Lewis and Michael Wester. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include using namespace std; static unsigned test() { // This is a pattern that comes up in graph theory: const unsigned n = 10; matrix m(n*n+1,n*n+1); for (unsigned i=1; i<=n*n; ++i) m.set(i-1,i-1,1); for (unsigned i=1; i<=n*n; ++i) if (!(i%n)) m.set(i-1,n*n,1); for (unsigned i=1; i<=n*n; ++i) if (!((i-1)%n)) m.set(n*n,i-1,n-(i-1)/n); for(unsigned i=1; i<=n; ++i) for (unsigned j=1; j<=n; ++j) if (i-j) for (unsigned k=1; k #include using namespace std; static unsigned test() { // create the matrix from test P... const unsigned n = 10; matrix m(n*n+1,n*n+1); for (unsigned i=1; i<=n*n; ++i) m.set(i-1,i-1,1); for (unsigned i=1; i<=n*n; ++i) if (!(i%n)) m.set(i-1,n*n,1); for (unsigned i=1; i<=n*n; ++i) if (!((i-1)%n)) m.set(n*n,i-1,n-(i-1)/n); for(unsigned i=1; i<=n; ++i) for (unsigned j=1; j<=n; ++j) if (i-j) for (unsigned k=1; k #include using namespace std; const bool do_test = true; // set to true in order to run this beast static unsigned test() { // same matrix as in test P: const unsigned n = 10; matrix m(n*n+1,n*n+1); for (unsigned i=1; i<=n*n; ++i) m.set(i-1,i-1,1); for (unsigned i=1; i<=n*n; ++i) if (!(i%n)) m.set(i-1,n*n,1); for (unsigned i=1; i<=n*n; ++i) if (!((i-1)%n)) m.set(n*n,i-1,n-(i-1)/n); for(unsigned i=1; i<=n; ++i) for (unsigned j=1; j<=n; ++j) if (i-j) for (unsigned k=1; k #include using namespace std; const bool do_test = true; // set to true in order to run this beast static unsigned test() { // same matrix as in test P': const unsigned n = 10; matrix m(n*n+1,n*n+1); for (unsigned i=1; i<=n*n; ++i) m.set(i-1,i-1,1); for (unsigned i=1; i<=n*n; ++i) if (!(i%n)) m.set(i-1,n*n,1); for (unsigned i=1; i<=n*n; ++i) if (!((i-1)%n)) m.set(n*n,i-1,n-(i-1)/n); for(unsigned i=1; i<=n; ++i) for (unsigned j=1; j<=n; ++j) if (i-j) for (unsigned k=1; k #include #include #include #include #include #include using namespace std; extern void randomify_symbol_serials(); /// make a string "1+x+2*x^2+...+n*x^n" static string prepare_str(const unsigned n, const char x = 'x') { ostringstream s; s << x; for (unsigned i = 2; i < n; i++) s << '+' << i << '*' << x << '^' << i; return s.str(); } static double benchmark_and_cmp(const string& srep) { parser the_parser; timer RSD10; RSD10.start(); ex e = the_parser(srep); const double t = RSD10.read(); return t; } int main(int argc, char** argv) { cout << "timing GiNaC parser..." << flush; randomify_symbol_serials(); unsigned n_min = 1024; unsigned n_max = 32768; if (argc > 1) n_max = atoi(argv[1]); vector times; vector ns; for (unsigned n = n_min; n <= n_max; n = n << 1) { string srep = prepare_str(n); const double t = benchmark_and_cmp(srep); times.push_back(t); ns.push_back(n); } cout << "OK" << endl; cout << "# terms time, s" << endl; for (size_t i = 0; i < times.size(); i++) cout << " " << ns[i] << '\t' << times[i] << endl; return 0; } ginac-1.7.8.orig/check/time_toeplitz.cpp0000644000000000000000000000645213457611471015126 0ustar /** @file time_toeplitz.cpp * * Calculates determinants of dense symbolic Toeplitz materices. * For 4x4 our matrix would look like this: * [[a,b,a+b,a^2+a*b+b^2], [b,a,b,a+b], [a+b,b,a,b], [a^2+a*b+b^2,a+b,b,a]] */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include using namespace std; static unsigned toeplitz_det(unsigned size) { unsigned result = 0; const symbol a("a"), b("b"); ex p[10] = {ex("a",lst{a,b}), ex("b",lst{a,b}), ex("a+b",lst{a,b}), ex("a^2+a*b+b^2",lst{a,b}), ex("a^3+a^2*b-a*b^2+b^3",lst{a,b}), ex("a^4+a^3*b+a^2*b^2+a*b^3+b^4",lst{a,b}), ex("a^5+a^4*b+a^3*b^2-a^2*b^3+a*b^4+b^5",lst{a,b}), ex("a^6+a^5*b+a^4*b^2+a^3*b^3+a^2*b^4+a*b^5+b^6",lst{a,b}), ex("a^7+a^6*b+a^5*b^2+a^4*b^3-a^3*b^4+a^2*b^5+a*b^6+b^7",lst{a,b}), ex("a^8+a^7*b+a^6*b^2+a^5*b^3+a^4*b^4+a^3*b^5+a^2*b^6+a*b^7+b^8",lst{a,b}) }; // construct Toeplitz matrix (diagonal structure: [[x,y,z],[y,x,y],[z,y,x]]): matrix M(size,size); for (unsigned ro=0; ro sizes = {7, 8, 9, 10}; vector times; timer longines; for (vector::iterator i=sizes.begin(); i!=sizes.end(); ++i) { int count = 1; longines.start(); result += toeplitz_det(*i); // correct for very small times: while (longines.read()<0.1) { toeplitz_det(*i); ++count; } times.push_back(longines.read()/count); cout << '.' << flush; } // print the report: cout << endl << " dim: "; for (vector::iterator i=sizes.begin(); i!=sizes.end(); ++i) cout << '\t' << *i << 'x' << *i; cout << endl << " time/s:"; for (vector::iterator i=times.begin(); i!=times.end(); ++i) cout << '\t' << *i; cout << endl; return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_toeplitz(); } ginac-1.7.8.orig/check/time_uvar_gcd.cpp0000644000000000000000000036645313457611471015060 0ustar /** @file time_uvar_gcd.cpp * * Time the different GCD algorithms. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" #include "error_report.h" #include "test_runner.h" #include "polynomial/remainder.h" #include "polynomial/upoly.h" #include "polynomial/mod_gcd.h" using namespace GiNaC; #include #include #include static const std::string p1_srep("\ -936639990+26248623452*x^47-30174373832*x^46-19627087954*x^45 \ +23532819511*x^24-15331409214*x^23-5892518210*x^22-2954269379*x^28 \ -35110566664*x^27-4846605217*x^26-31276301429*x^25-19509035058*x^44 \ +18467021749*x^43+18517327396*x^42-3435911855*x^50-272899085*x^49 \ +1530941050*x^48+4507833875*x+10918084347*x^21+7814495607*x^20 \ +23471621465*x^19-11157075535*x^18-11580405260*x^41-12162845828*x^39 \ +12293848678*x^10-14679334842*x^9+17276957972*x^8+6436149609*x^7 \ -8608995580*x^3-178435747*x^2+21474090980*x^17-3966988360*x^16 \ -1330154020*x^15-13410537172*x^14-31038290506*x^51+17469329915*x^52 \ -15282350857*x^53-11990574398*x^54+4255578378*x^55+2134905268*x^56 \ +38375274669*x^57+9183261708*x^58+23467669465*x^59-5872201799*x^60 \ +44704228721*x^61+27682281779*x^62-17204774085*x^63-7544450778*x^64 \ -319408644*x^65+36034512058*x^66-6744628155*x^67+1363904895*x^68 \ +22219362387*x^69+4275663006*x^70+14038262112*x^71+25591410149*x^72 \ +9385606040*x^73-4745283802*x^74+11598735101*x^75-2508504600*x^76 \ +11912265375*x^77+6624766926*x^78-4828562936*x^79+16636451249*x^80 \ -9654281719*x^81+1913801599*x^82+2030662033*x^83-5474416933*x^84 \ +11196778577*x^85+512268187*x^86-1029159530*x^87+1890708440*x^88 \ +142491112*x^89-1261023993*x^90+3580061526*x^91-967823912*x^92 \ +2292551912*x^93-3890383043*x^94-7104898913*x^95+3692350529*x^96 \ -933592128*x^97+1199649580*x^98-227816977*x^99-12217636980*x^40 \ +26794929142*x^38-41046742100*x^37+8432066353*x^36-6214147095*x^35 \ +741141010*x^100-6270990007*x^34-6863205889*x^33-38388107386*x^32 \ -561107347*x^13-6663332709*x^12+5507703343*x^11+11614165303*x^31 \ -4503859503*x^30+26050790733*x^29+1788729074*x^6+2123912816*x^5- \ 2542140060*x^4\ "); static const std::string p2_srep("\ 1882371920-30937311949*x^47+6616907060*x^46-7420079075*x^45-28689993421*x^24 \ +5544486596*x^23+7149046134*x^22+29115114125*x^28-7204610489*x^27 \ -214559874*x^26+3363043648*x^25-6061422988*x^44-85814533599*x^43 \ -5548876327*x^42+20531692560*x^50-23673866858*x^49+1553111326*x^48 \ -7521320830*x-19801882818*x^21+7056872613*x^20-8039690791*x^19 \ +11049483001*x^18+21957440404*x^41+18566882873*x^39-1088265300*x^10 \ +29943249139*x^9+3160532878*x^8+110919258*x^7+1584505491*x^3-2133682609*x^2 \ +11700952246*x^17-12424469513*x^16-426278523*x^15+7561875663*x^14 \ +19494168654*x^51-8174921854*x^52+18073788685*x^53-48441925739*x^54 \ -3850452489*x^55-17753230977*x^56-44973929094*x^57+7332053562*x^58 \ -18246235652*x^59+9980611956*x^60+6961020716*x^61-3323333429*x^62 \ -20693764726*x^63+2577247520*x^64-22463329638*x^65-13528331424*x^66 \ +440594870*x^67+778770195*x^68+24497174109*x^69-11578701274*x^70 \ -217623403*x^71+16461882236*x^72-6001481047*x^73-5750277357*x^74 \ -16262001424*x^75+13760397067*x^76+12678193001*x^77+29675566382*x^78 \ +1889202286*x^79+12672890141*x^80+26252749471*x^81+25061328813*x^82 \ +20393397488*x^83-6344703601*x^84-12986831645*x^85+10287410396*x^86 \ +18964048763*x^87+9141433582*x^88+9742202475*x^89+1800283356*x^90 \ +9411879011*x^91+13562767020*x^92-3883570155*x^93+1190623161*x^94 \ +4638169279*x^95+10385086102*x^96+10263027507*x^97+5186524611*x^98 \ +1309311388*x^99+2485463829*x^40-14414308862*x^38-2750892631*x^37 \ -34230002076*x^36-21558061051*x^35+2789684836*x^100-9973372012*x^34 \ +12038293769*x^33-2280622009*x^32-14841292646*x^13+4463462090*x^12 \ +11039962159*x^11+20714527103*x^31+29530802947*x^30+4813620791*x^29 \ +8841198971*x^6-4237029618*x^5-1135211878*x^4"); static const std::string q1_srep_1("\ -96986421453*x^426-75230349764*x^425+128202397899*x^424+67687797741*x^423 \ +3024931260*x^422+43589211963*x^421+17028560437*x^420+9502389896*x^419 \ +4613252773*x^418+12194328527*x^417-57222260166*x^416+40667752907*x^415 \ +93728947357*x^414+35662883623*x^47-14000072723*x^46-9724148606*x^45 \ -368500426*x^174-66112223350*x^173-44075800265*x^172+7490450738*x^171 \ +51779005621*x^170-64020260063*x^169-35711451392*x^192-13811036693*x^191 \ +38422996693*x^190+78178593950*x^189-26765678624*x^188-36201354868*x^187 \ +2322225247*x^24-4088975893*x^23-5491427592*x^22+66441957259*x^333 \ +132975753131*x^332-25949991451*x^331-18528608186*x^330+34867243557*x^329 \ -86291867505*x^328-23705975211*x^327+28864997607*x^326-29169139957*x^325 \ -72081734233*x^324+16339897368*x^323-36285833017*x^322+38448532777*x^321 \ +5689122392*x^320-11755215572*x^113+27585680289*x^112+42744050328*x^111 \ -19842208161*x^110-15319380323*x^109-9901465464*x^108-5117699979*x^107 \ -46666019657*x^106-9394133585*x^105-6971615995*x^104+6471181832*x^114 \ -93545055409*x^347-52862770931*x^346-17176975268*x^345+102286955731*x^344 \ -108335379176*x^343-49965250837*x^342+70929683596*x^341+43502762174*x^340 \ -21623476978*x^339-48184795307*x^338+147075382031*x^337+2375821388*x^336 \ +73656068270*x^335-36587627572*x^334-46411968297*x^477+117867456111*x^476 \ +21597655248*x^475-96794140788*x^474+39647492898*x^473+34037992542*x^472 \ +46480360486*x^471-83731284596*x^470-95857281423*x^469+6999736667*x^468 \ -38822852477*x^467-130028027968*x^466-14942819105*x^465-44491532079*x^464 \ -136904650366*x^450+127351380760*x^449-127679332542*x^448-43163228644*x^447 \ +130723680563*x^446+20671214531*x^445+28594103126*x^444-20976472951*x^443 \ +51300798407*x^442-136736402258*x^441-70334716366*x^440-15000956055*x^439 \ -62750491292*x^438+80489844722*x^451-72300799704*x^373+85385725929*x^372 \ -36185314264*x^371+40354846070*x^370+100343908392*x^369-64625422713*x^368 \ +64635098245*x^367+148519100093*x^366-2548271547*x^365+81466612776*x^364 \ +4505982224*x^363-27138600773*x^362+33493048106*x^361-24851820772*x^28 \ -10244897195*x^27-4624820516*x^26-7148687043*x^25-31464114015*x^44 \ +4702632945*x^43+7767686263*x^42+42336900887*x^399+3102221349*x^398 \ -70334528471*x^397+64364012828*x^396+2888804578*x^395+128564212488*x^394 \ +46187560735*x^393-22449464022*x^392-10778814882*x^391-12324659485*x^390 \ -29896766926*x^389-81652748187*x^388+83789647837*x^387+117499172*x^50 \ +12296030709*x^49-19192082610*x^48-75325243338*x^202-23708473101*x^201 \ -26628963155*x^200+8750880100*x^199+51496310059*x^198-825543354*x^197 \ -55510698265*x^196+360107673*x^195+63114288079*x^194+47841450181*x^193 \ -64231677271*x^203-33846557625*x^500+32003634503*x^499-58125049485*x^498 \ -201024576939*x^497-16961069022*x^496-6460857023*x^495+17540403418*x^494 \ +110942113017*x^493+31743184966*x^492-25555053476*x^491+4508005212*x \ +54592680578*x^437-76412796528*x^436+1877940561*x^435-103704559046*x^434 \ +67584435952*x^433-92743779936*x^432+16830509289*x^431+90333755240*x^430 \ +7491824203*x^429-39217091446*x^428+9937722888*x^427-19900810770*x^281 \ +99196779*x^280-16832864815*x^279+12499571427*x^278+45347289311*x^277 \ +71352470823*x^276+43741436118*x^275+37615792835*x^274+46658948580*x^273 \ +33324303635*x^272+73592650369*x^271-67395425230*x^270-9849537996*x^269 \ +66141877639*x^268+123533283703*x^360+23749744933*x^359-158320760707*x^358 \ -96354447711*x^357+74192188378*x^356-12722639577*x^355-5277964622*x^354 \ +27541514016*x^353-15290636975*x^352-56026626672*x^351-83627404427*x^350 \ +134971538669*x^349-70927614564*x^348-30866959351*x^21+23196788827*x^20 \ +14806487974*x^19+7202161677*x^18-77560240113*x^168-97097519755*x^167 \ -7146671571*x^166+74640588234*x^165+44466905554*x^164+54305760741*x^163 \ -42912777561*x^162-53367072318*x^161-53826227844*x^160+58601558389*x^159 \ +46328377750*x^158+50761112626*x^157+45872218888*x^156-2281730398*x^155 \ +17638972322*x^41-18461568113*x^39+138681011610*x^186+37241543347*x^185 \ +6568392823*x^184+51513027685*x^183-7992856706*x^182+76890726092*x^181 \ +42349995803*x^180+56514811799*x^179+39745228095*x^178-5406867587*x^177 \ -1951053982*x^176-5802216424*x^175-50792201214*x^463+6116297*x^462 \ +6556570017*x^461+108055362490*x^460-12691470210*x^459+4182889988*x^458 \ -43791168823*x^457+34631974035*x^456-19719579134*x^455+25960754189*x^454 \ +98225606953*x^453+91031125129*x^452-24988409414*x^10-743558160*x^9 \ -1699950291*x^8+2808610975*x^7-48769244040*x^154-96704849123*x^153 \ +111227374137*x^152-14353055349*x^151-3530455648*x^150+67627044718*x^149 \ +48938383630*x^148-36284076468*x^147-36888035781*x^146+21119495829*x^145 \ -7910849264*x^144-12955332083*x^143-45900441635*x^142-13504842602*x^3 \ +6990226732*x^2-104066823246*x^294-33495506282*x^293+14075627371*x^292 \ +98874306790*x^291-60578180611*x^290+4520025730*x^289+11037329991*x^288 \ -61725490177*x^287-81799020830*x^286-7490987671*x^285-53034900008*x^284 \ -18832528068*x^283-41894083315*x^282+37239574099*x^217-19338020660*x^216 \ -12240694841*x^215+43055454509*x^214+40264787273*x^213-5627707745*x^212 \ +65168034480*x^211+60502488359*x^210-43821281361*x^209-66454240411*x^208 \ -2909056156*x^207+28786587304*x^206-30816172728*x^205+33777871529*x^204 \ -190549103953*x^490+76694110369*x^489-2193972225*x^488-15694566522*x^487 \ -5687638790*x^486+108859908155*x^485-10632768957*x^484+59932596621*x^483 \ -128319694751*x^482+9747184412*x^481-46212670973*x^480-241524000*x^479 \ -109350192806*x^478-19351431004*x^17-10992374349*x^16+4266182503*x^15 \ +1491492502*x^14-26936243598*x^51+9140784640*x^52-17235611114*x^53 \ +51043001177*x^54+17375254851*x^55+29087076273*x^56+41034433851*x^57 \ -3776695101*x^58+15602920815*x^59-33931973560*x^60-5394467773*x^61 \ -33356572049*x^62+26987634076*x^63-13728305358*x^64-9103761879*x^65 \ -7718466644*x^66-36314004427*x^67-5838889357*x^68-34997974374*x^69 \ +18394398361*x^70+2693349321*x^71+26120420097*x^72+17127750642*x^73 \ -13997783088*x^74-20592275154*x^75-32678406375*x^76-37626204617*x^77 \ -48378652006*x^78+21054785420*x^79-29131926756*x^80+8395471553*x^81 \ +7784927438*x^82+13009002197*x^83-6234144809*x^84-37572100716*x^85 \ -6593230199*x^86+66776088000*x^87+78828918914*x^88+11091149924*x^89 \ +10549817427*x^90+6921991220*x^91-10162442680*x^92-31105862688*x^93 \ +29905246284*x^94+56641649019*x^95+2729368709*x^96-29516060802*x^97 \ -60463907529*x^98-20589437573*x^99-76023724773*x^386-66294717897*x^385 \ +127893777713*x^384-33654971374*x^383+67124743823*x^382-31169670568*x^381 \ -62445748947*x^380-88066123018*x^379-38626212646*x^378-16479040877*x^377 \ -38277841666*x^376-22265169452*x^375-94473640391*x^374-16848867764*x^40 \ +97436811*x^38-11456803668*x^37+29134819428*x^36+19443677064*x^35 \ +115142334273*x^308+56747688015*x^307+25168740472*x^306+13152212288*x^305 \ -44950776707*x^304+76665344711*x^303+29576368959*x^302+32075973218*x^301 \ -9029375348*x^300+6642245020*x^299+91687715671*x^298-51412655310*x^297 \ +83980703440*x^296+46894388060*x^295-5884703744*x^141+2949366186*x^140 \ -94344563203*x^139-49160316545*x^138-32150373572*x^137+12194208956*x^136 \ +6964141193*x^135-33897455084*x^134+10261728181*x^133-55302581972*x^132 \ +21255450769*x^131-36152255205*x^130-15653019958*x^129+35552230340*x^128 \ +19003739378*x^244+108435248514*x^243+56090919989*x^242+69228227868*x^241 \ +91831598024*x^240-17331067829*x^239+85583813531*x^238+23101424573*x^237 \ -81857540502*x^236-36120008211*x^235+5734833290*x^234-18668026178*x^233 \ -49074512287*x^232+17073277846*x^413+30247783286*x^412-165671844164*x^411 \ -155653969476*x^410-187279578486*x^409+39531046142*x^408-27411804632*x^407 \ +29944561569*x^406-111402223051*x^405-154854505413*x^404-40754859947*x^403 \ -42933459998*x^402-49470282393*x^401+47851831012*x^400+14974328774*x^100 \ +35782130492*x^267-46375317876*x^266+35773383758*x^265+20027063447*x^264 \ +21061029248*x^263+39184671316*x^262-90547480531*x^261-66296134219*x^260 \ -17351793087*x^259+32060807026*x^258+94792744023*x^257+49960952178*x^256 \ -56558329066*x^255+24220170558*x^34+13174400153*x^33-32599593323*x^32 \ +68703378390*x^127+7209203154*x^126+53371357578*x^125+29055746831*x^124 \ +7953940336*x^123+58282173183*x^122+9572688731*x^121+18717721630*x^120 \ -73554904502*x^119+3118816831*x^118+14413362310*x^117+5342856589*x^116 \ +19553114613*x^115+21062039154*x^102-554311514*x^101-22619708092*x^103 \ +61239109029*x^254-3920281128*x^253-78250174682*x^252-54555413490*x^251 \ +115877792898*x^250+43662559749*x^249-120143669223*x^248+50903904162*x^247 \ +11038501743*x^246-77319776228*x^245+32754289554*x^13+9140139237*x^12 \ -5050784936*x^11-28608214851*x^319-115868216966*x^318+21037102483*x^317 \ -40760242975*x^316-97849927912*x^315+97524668075*x^314+15492130497*x^313 \ -109577284825*x^312-15523330582*x^311+53171617167*x^310+2760321123*x^309 \ +11953881518*x^31-4644794034*x^30+8900679779*x^29+3038154286*x^6 \ -1713528498*x^5-1682288772*x^4-48992402174*x^231-74205154963*x^230 \ -12320683295*x^229+2580030624*x^228+64073843802*x^227+98985527674*x^226 \ +27217405490*x^225-4798940390*x^224-40677318547*x^223+22320424589*x^222 \ -40460537540*x^221-2484720173*x^220+91568547773*x^219-30440775257*x^218 \ -20925478361*x^501-55379150825*x^502+41318859160*x^503-201803259151*x^504 \ +24491832146*x^505+11945310232*x^506+16801030141*x^507-85919705432*x^508 \ -204400811240*x^509+108827759662*x^510-7434778800*x^511+11930243788*x^512 \ +52620104622*x^513+2896973876*x^514-62777820856*x^515-58602826569*x^516 \ +133850541568*x^517-141993258526*x^518+23529758012*x^519-49454155126*x^520 \ +48873695726*x^521-4147628780*x^522+37394108608*x^523+47603927637*x^524 \ -24791421698*x^525+227326835801*x^526-14216866536*x^527+18576010707*x^528 \ -21047691775*x^529+41343039994*x^530+54576723923*x^531-93293864449*x^532 \ -33311213168*x^533-121363092547*x^534+33716301298*x^535-141040357184*x^536 \ +51729666523*x^537+47937306583*x^538+59972281522*x^539-118977051593*x^540 \ +67621432194*x^541+49510957189*x^542-18373445363*x^543+77268324211*x^544 \ -133652596329*x^545-33419335873*x^546-427835316*x^547-53735861227*x^548 \ -18820033537*x^549+39133250886*x^550-56649816582*x^551+39906553346*x^552 \ -38346679560*x^553-21315694546*x^554-5783912402*x^555+27780723169*x^556 \ -38733479148*x^557-105931482172*x^558-96741538387*x^559-49387589876*x^560 \ +8867816401*x^561+49087289355*x^562+1454848177*x^563+33306828689*x^564 \ -99246716946*x^565+37769469573*x^566+32186219432*x^567-11308309096*x^568 \ +18668048060*x^569+49786290189*x^570+18415965909*x^571+3684081565*x^572 \ -4772411978*x^573+29967501107*x^574+88125664232*x^575-45402703990*x^576 \ -17923494443*x^577-66856091994*x^578+52497931423*x^579-38961224535*x^580 \ -37418352186*x^581+49679845815*x^582-57132928134*x^583+59226638697*x^584 \ -154438376054*x^585-33182700061*x^586-29726913945*x^587-69912710958*x^588 \ -35066505635*x^589+12117333556*x^590+90618649713*x^591+25641508805*x^592 \ -14360015792*x^593-2388909185*x^594-66943383926*x^595+74263398539*x^596 \ +143519268530*x^597+69955222853*x^598+93655324812*x^599+95865179464*x^600 \ +26117219984*x^601+125957153927*x^602+85643852758*x^603+42892120680*x^604 \ -21713462866*x^605+14954939220*x^606+10043903038*x^607+75469410317*x^608 \ -51837119306*x^609+15040917218*x^610+20377338352*x^611+31441679566*x^612 \ -83915039746*x^613+26252571519*x^614-503634581*x^615+26287902963*x^616 \ -93906462389*x^617-31633190464*x^618+89968162928*x^619-170991982775*x^620 \ +83899910708*x^621+106560970300*x^622-44686742795*x^623+15837336057*x^624 \ +40628901174*x^625+45734331636*x^626+33015259104*x^627+98460164072*x^628 \ -42946149377*x^629-7628175548*x^630+19113794084*x^631-41069464410*x^632 \ +14600883385*x^633-39765610904*x^634+15187751854*x^635-64373116881*x^636 \ +57427180760*x^637-54359632537*x^638-64614552532*x^639+33179178357*x^640 \ +48320365071*x^641-11056685372*x^642+38160121363*x^643-103617462479*x^644 \ -2932820983*x^645+55149815103*x^646+2425431294*x^647-56577206559*x^648 \ +16057758155*x^649+35778946395*x^650-48176618659*x^651-64696379262*x^652 \ -22620871596*x^653+58425156881*x^654+44785934533*x^655+80551487292*x^656 \ +54031151324*x^657-5670209695*x^658+17381996998*x^659-19820657597*x^660 \ +21974450271*x^661-82269840114*x^662-37921867307*x^663+36456465218*x^664 \ -83294486767*x^665-15913209110*x^666-41870399203*x^667+75486284992*x^668 \ -69200721639*x^669+71593232147*x^670-24896238679*x^671+12917620475*x^672 \ +83950160209*x^673-49426619038*x^674-75127058039*x^675+54011881154*x^676 \ +37241246401*x^677-57745731856*x^678+139894949202*x^679+81749104336*x^680 \ +19047569663*x^681-3263108647*x^682+27211133766*x^683-122451257494*x^684 \ -8555594792*x^685+33253239722*x^686-107349740514*x^687+51092807913*x^688 \ +4057189648*x^689-93256950011*x^690+55162355472*x^691-61816339842*x^692 \ +16885083096*x^693-121751819826*x^694+50639115264*x^695+77247288431*x^696 \ +22943813602*x^697+33215869090*x^698-58975325286*x^699-157199542515*x^700 \ +87871148892*x^701-28766482795*x^702-29747811055*x^703-68956086160*x^704 \ +65220950625*x^705-21662209987*x^706+37272639173*x^707+96801516469*x^708 \ -71318240058*x^709+51218503786*x^710+89676365367*x^711-74236109343*x^712 \ +73239144110*x^713+74363608320*x^714+9145207269*x^715-43125847627*x^716 \ +45624962357*x^717-87121922253*x^718-16301512498*x^719-74699639223*x^720 \ +10858510024*x^721-49718828989*x^722+69188784202*x^723-57283163802*x^724 \ -25240946842*x^725-18848125183*x^726+30824101946*x^727+28131925069*x^728 \ -4523237314*x^729-21708406770*x^730+16572200087*x^731+33901545283*x^732 \ +36570946377*x^733-85342952665*x^734-11024354222*x^735-52996875075*x^736 \ +2850866301*x^737+584390938*x^738-15576643293*x^739-19952462826*x^740 \ +118150124588*x^741-30970777574*x^742-65402936216*x^743+59841029763*x^744 \ -45851459883*x^745-27905618565*x^746+9407727592*x^747+74081843028*x^748 \ -36908923676*x^749+33404180933*x^750-12010832118*x^751-27598133503*x^752 \ -18631604127*x^753+110706117529*x^754-58260993047*x^755+92000371551*x^756 \ -3544997753*x^757-24026345516*x^758-5326405854*x^759+78096319892*x^760 \ -597358210*x^761-35334977036*x^762+27768304059*x^763-27110809247*x^764 \ -73612582334*x^765+107609364617*x^766-59301141886*x^767+23970324440*x^768 \ -29060060082*x^769+68777102577*x^770-132377413827*x^771+22754238015*x^772 \ -32129043594*x^773-64999432548*x^774-19372762078*x^775+31184492389*x^776 \ -10477627638*x^777+50023457084*x^778+47413007239*x^779-26371384083*x^780 \ +60690219120*x^781+19239801238*x^782-83296732353*x^783+1369782155*x^784 \ +39528998233*x^785+89322610585*x^786-14469114718*x^787+61444882143*x^788 \ -27268007305*x^789-66782025565*x^790+72559382333*x^791-58375896558*x^792 \ -59019888869*x^793+59537001845*x^794-7672146710*x^795+46071362979*x^796 \ +43864876841*x^797-38389399338*x^798+12445498240*x^799+22445421945*x^800 \ -19867191482*x^801+29695639763*x^802-439060343*x^803-14548926177*x^804 \ +6493137958*x^805-26475885652*x^806+17199673294*x^807-14472466294*x^808 \ -3972443858*x^809-6694412444*x^810-27845179245*x^811+69564423337*x^812 \ -1242944956*x^813+71753847110*x^814-110162491247*x^815+28760590961*x^816 \ -45033514586*x^817+20432605842*x^818-2254902164*x^819-18122426841*x^820 \ +39792310652*x^821-16010785979*x^822-29809849055*x^823+9525854977*x^824 \ +17249950273*x^825-10134672379*x^826+20583429199*x^827+24105975389*x^828 \ +7878147881*x^829+7805909361*x^830+24860098133*x^831-5072168506*x^832 \ +40045803265*x^833+42779485436*x^834-13432875572*x^835+88161293341*x^836 \ +91355873384*x^837-1467257349*x^838+11158963816*x^839+9583583914*x^840 \ +31122429769*x^841-40482720803*x^842-4081869019*x^843-57902352430*x^844 \ +16964780747*x^845-29060953772*x^846-69504616419*x^847-61121483464*x^848 \ -46713891301*x^849+44904999298*x^850-69604536083*x^851-11337020865*x^852 \ +294505024*x^853-47318977509*x^854+3027572134*x^855+21339618482*x^856 \ -15853149005*x^857+16285335552*x^858+40110182790*x^859-18341657161*x^860 \ +49887789936*x^861-33552701768*x^862+46385081780*x^863-981469808*x^864 \ +41200826158*x^865+10777507154*x^866-14950519144*x^867+40419646263*x^868 \ -53741450130*x^869-22868517477*x^870+45151817598*x^871-19543438862*x^872 \ +3955972510*x^873+54752188479*x^874+21656278056*x^875-37418558367*x^876 \ +46148554703*x^877-47291859633*x^878-60826337453*x^879-95667516424*x^880 \ -25153078038*x^881-110893670927*x^882+36745227210*x^883+24891033298*x^884 \ +13329786568*x^885+1662662627*x^886+11971271338*x^887+17144987144*x^888 \ -2615988799*x^889-28070812835*x^890+37844104025*x^891+4209715470*x^892 \ +20489525484*x^893-34750326173*x^894-26930924040*x^895+28807856566*x^896 \ -67232744129*x^897+21557992547*x^898-7466474096*x^899-29460379882*x^900 \ +11599719084*x^901+67152781205*x^902+8214925141*x^903-36941792660*x^904 \ +53285909119*x^905+25945946437*x^906-50737201760*x^907-3797518282*x^908"); static const std::string q1_srep_2("\ -14516581381*x^909+17052064867*x^910+49668098832*x^911-25564508274*x^912 \ -27386697676*x^913-11774383518*x^914-493156372*x^915+13331359952*x^916 \ +18215828822*x^917-1703765835*x^918-25637155270*x^919+16201914729*x^920 \ +58046441105*x^921-63259400427*x^922+67373094341*x^923-10917543441*x^924 \ +12944714407*x^925-330113187*x^926+16734740522*x^927+2893980284*x^928 \ -32842296951*x^929+36608286601*x^930-15595841*x^931+16778173120*x^932 \ -19939580967*x^933-9051600178*x^934-35290902058*x^935+13004524714*x^936 \ -41266776816*x^937+12920294247*x^938+1269376803*x^939-5513768295*x^940 \ +12475046328*x^941+31918641624*x^942+66368453249*x^943-897770392*x^944 \ +40506291484*x^945+6825383600*x^946-210725476*x^947+23275280063*x^948 \ -5947164362*x^949-28808686423*x^950+4353896571*x^951+10244426548*x^952 \ -7839372567*x^953+30532389165*x^954-3403582670*x^955+45380086128*x^956 \ -13074314129*x^957+28545325753*x^958-5842784212*x^959-26959506281*x^960 \ +6604365268*x^961-32138117276*x^962-15682414365*x^963-4133390557*x^964 \ -12416495535*x^965-2929737653*x^966-19993300065*x^967+11247744076*x^968 \ +3841401771*x^969+25671473626*x^970-7838123767*x^971+3182563094*x^972 \ -23190705393*x^973+25687775853*x^974+4991068675*x^975+9883795932*x^976 \ -9640729721*x^977-9525700462*x^978+18936689098*x^979-1080031439*x^980 \ +21713668278*x^981-16017536235*x^982+10320999730*x^983-6460201416*x^984 \ -1480416714*x^985+1153896503*x^986-9970475903*x^987-1255301536*x^988 \ +7891254981*x^989+6703945740*x^990+6810250661*x^991+1856482568*x^992 \ +8149237774*x^993+7008509831*x^994+6006570629*x^995+6726792746*x^996 \ +4503145470*x^997+91649222*x^998+3092691860*x^999+2111130448*x^1000 \ +7931022064"); static const std::string q2_srep_1("\ 13695560229*x^426 \ +16181971852*x^425-90237548124*x^424-71238644589*x^423-54046636289*x^422 \ -56977010004*x^421+24652773038*x^420+20598565048*x^419+91475303480*x^418 \ -84971121323*x^417-113672677125*x^416+175104489886*x^415+24909134379*x^414 \ +6097498021*x^47-184800727*x^46-20666602129*x^45-11384394640*x^174 \ -39167969192*x^173+32831872664*x^172-414425301*x^171+26088535929*x^170 \ +35596493049*x^169+30563227841*x^192+11577650926*x^191-43191322527*x^190 \ +12086295210*x^189+23955571873*x^188-25298685458*x^187-28444834807*x^24 \ +7010388904*x^23-29006384328*x^22-84330871264*x^333+9836257003*x^332 \ +37640357302*x^331+17905116770*x^330-130251115515*x^329-95978501346*x^328 \ +19514981244*x^327-106652197296*x^326+35941298261*x^325+57388442425*x^324 \ +44763228998*x^323+51086800775*x^322-87113853021*x^321+63617860368*x^320 \ -65881485345*x^113-14717773249*x^112-30051082488*x^111-16699273079*x^110 \ +52386582094*x^109-51477006365*x^108+86299667628*x^107+33339117727*x^106 \ -11189599026*x^105+15726918*x^104-21825360566*x^114-31322461593*x^347 \ +65284435509*x^346-17301191144*x^345+15734564143*x^344+23681004128*x^343 \ +134055240076*x^342-63495561637*x^341+69119399187*x^340+15761017924*x^339 \ +62192334766*x^338+76140614307*x^337+48592812810*x^336-78591910551*x^335 \ +5387039994*x^334-20627179048*x^477+30863999178*x^476-81087236312*x^475 \ -75933164205*x^474-33082131999*x^473+45384435920*x^472+116792836581*x^471 \ +116973440762*x^470-58617873216*x^469+16707117530*x^468+70585482190*x^467 \ -25245695981*x^466+21964655001*x^465+156326246149*x^464+50572629272*x^450 \ +15562656594*x^449-31384475178*x^448+28806488822*x^447+98379780384*x^446 \ -8577150468*x^445-241997040784*x^444+44292557638*x^443-41043057929*x^442 \ +43426121636*x^441+73421002043*x^440-122245378325*x^439+666183816*x^438 \ -140210723957*x^451+33590048221*x^373+175101192821*x^372+70736972554*x^371 \ -92048656022*x^370-3495793191*x^369-86224980665*x^368-67443623327*x^367 \ +32314536775*x^366-28883186212*x^365+5111742127*x^364+121792145390*x^363 \ +37030667675*x^362-4097118072*x^361+22857776248*x^28-12136573216*x^27 \ +20442780080*x^26+25846700052*x^25+13425491987*x^44-51594114984*x^43 \ -4377477922*x^42-43041382453*x^399-57661186745*x^398-22359325055*x^397 \ +20325429303*x^396+69035457782*x^395+87685373045*x^394+24365492495*x^393 \ +29684393262*x^392+48430131525*x^391-695625227*x^390+20950623212*x^389 \ -11707096914*x^388+27698204708*x^387-17709284679*x^50-23800618055*x^49 \ +58495527083*x^48+14753967994*x^202-7917376913*x^201-7656165582*x^200 \ +44410996825*x^199+27191475903*x^198-65422047389*x^197-14819333083*x^196 \ -1269092109*x^195-23263288526*x^194+23503451557*x^193-45722872111*x^203 \ +18051733352*x^500-125499139260*x^499-36395631156*x^498-59637301917*x^497 \ +105481548989*x^496+75797493110*x^495+32239299835*x^494+11835972529*x^493 \ +116574982204*x^492-51868336172*x^491-9265203432*x-39597713836*x^437 \ +113015935234*x^436-153556796338*x^435-4853604252*x^434+97729740048*x^433 \ -33063566031*x^432+126719186003*x^431-74175775603*x^430-42715005191*x^429 \ +32714632165*x^428+76253488404*x^427-22147870587*x^281-17004010435*x^280 \ -17534946529*x^279+39828373720*x^278+52099668150*x^277+55016917354*x^276 \ -27029028714*x^275+1832097078*x^274-60942810739*x^273+47857879747*x^272 \ -51278864730*x^271-5222780191*x^270-5898650096*x^269-21678273747*x^268 \ -21425566464*x^360+39916245264*x^359-48631849103*x^358-15434842369*x^357 \ -11776709827*x^356+21409992004*x^355+60368342836*x^354-70458747506*x^353 \ +18437371892*x^352-51315223539*x^351-105763188874*x^350-41326464493*x^349 \ +26384980460*x^348-6783761138*x^21+21334689185*x^20-12549566198*x^19 \ +27317791211*x^18-21543723029*x^168-39565879160*x^167-85203918111*x^166 \ -6431356158*x^165+7131456890*x^164+56067799364*x^163-65758483287*x^162 \ +14185002785*x^161+4476126737*x^160+58098059740*x^159-15413944760*x^158 \ -21400285509*x^157+39120970417*x^156+41014228126*x^155+13550191011*x^41 \ +1778606821*x^39-41861155597*x^186-87150315050*x^185+60380468445*x^184 \ +11245803100*x^183-107391972561*x^182-15954816780*x^181-55185898305*x^180 \ -51517237471*x^179+1349603646*x^178+39890682017*x^177+73058970151*x^176 \ -88252631077*x^175+8225838344*x^463-52845822946*x^462-84438483052*x^461 \ -17729797211*x^460-98562969717*x^459-82399019651*x^458+104524956499*x^457 \ -126683869629*x^456+21367403421*x^455+36131797666*x^454-137807476393*x^453 \ -94740863919*x^452+1868123354*x^10+6382151694*x^9-14641898053*x^8 \ +21502452426*x^7-4475582501*x^154+8381680030*x^153+1999803400*x^152 \ -89024997066*x^151+38794061551*x^150-47355124077*x^149-43574475045*x^148 \ +981109162*x^147+13077105992*x^146-92234719034*x^145-22003948923*x^144 \ +65545791087*x^143-21673710856*x^142-3360829230*x^3-5213505618*x^2 \ +12467729502*x^294-5587793663*x^293+6216249569*x^292+1442921644*x^291 \ +37867507103*x^290-31492290101*x^289-14673167737*x^288+33015189422*x^287 \ -2704565484*x^286+95174488990*x^285-54217068575*x^284+44084204773*x^283 \ -36577262466*x^282+10376879211*x^217-20844169749*x^216-63109698641*x^215 \ +15376432884*x^214-21978305305*x^213+13899584470*x^212+139241561028*x^211 \ -44664654159*x^210+2599647517*x^209+76562835916*x^208+18920601168*x^207 \ +45165432827*x^206-13822292860*x^205-25195536685*x^204+2953366208*x^490 \ +62275626307*x^489+44809710519*x^488+111073061078*x^487+76178250211*x^486 \ +4726676962*x^485-16307384*x^484+25134354985*x^483+35561572012*x^482 \ -77940816336*x^481+14820209996*x^480-8713117577*x^479+138978861424*x^478 \ -900952782*x^17-15341289507*x^16-12806716201*x^15+9443970355*x^14 \ -5790259982*x^51-12187496620*x^52+14358577261*x^53+16962500513*x^54 \ +25955497814*x^55-18109191113*x^56-47942729935*x^57-25726536005*x^58 \ -22107331394*x^59-26777218680*x^60+9526384172*x^61-2329994611*x^62 \ -797667779*x^63+9992192122*x^64-10517453590*x^65+79225602882*x^66 \ +37973423762*x^67-14732143550*x^68-10707214185*x^69-20734263762*x^70 \ +32036697598*x^71-15304882544*x^72-8663047826*x^73+15796475487*x^74 \ -15625754764*x^75-1806722698*x^76-13992042720*x^77+24071578801*x^78 \ -1460871729*x^79-35556467385*x^80+6278675758*x^81+28441859025*x^82 \ -21446356551*x^83-22846651633*x^84+10847836941*x^85+4499336468*x^86 \ +128532189*x^87+4158071015*x^88+5253407021*x^89+29777404725*x^90 \ -26059465923*x^91-40927448548*x^92-25096489123*x^93+53387092350*x^94 \ -3391739440*x^95+19640218031*x^96-55211392254*x^97-25873270895*x^98 \ -9727303835*x^99+106230698908*x^386-15945119461*x^385-17935823635*x^384 \ -53556374993*x^383-109640641868*x^382-59714904671*x^381-122191901431*x^380 \ +9957955506*x^379+149517895199*x^378+48813595534*x^377+54994058521*x^376 \ -43911659492*x^375-40228007707*x^374+374490216*x^40+8496344002*x^38 \ +21128346388*x^37-492653491*x^36-26347609411*x^35+92580385617*x^308 \ +5753392383*x^307+72418711676*x^306-36955820476*x^305-2443808280*x^304 \ +51138244830*x^303+19081895493*x^302-777541237*x^301+42995124541*x^300 \ +43654667628*x^299-26268273836*x^298-61864683651*x^297+64621393027*x^296 \ -51924046581*x^295-25603791079*x^141-23477310146*x^140+4635174703*x^139 \ -2883430101*x^138+565462517*x^137+29217704662*x^136+40502985228*x^135 \ -5190429488*x^134-815731986*x^133-18342727081*x^132+14168171180*x^131 \ +72498842324*x^130+19120698858*x^129+3448048300*x^128-42150729253*x^244 \ -59646966806*x^243+25136726637*x^242-58312463169*x^241+13429294186*x^240 \ -68028026326*x^239-1855231812*x^238+67042351401*x^237-24141943642*x^236 \ -108693143246*x^235-42010041207*x^234+48918679823*x^233+72331711491*x^232 \ -40303836579*x^413-8185236331*x^412-90945546891*x^411-105388424000*x^410 \ +37156268112*x^409-38869414179*x^408+87460111563*x^407+70482270872*x^406 \ -73257224213*x^405-67165510452*x^404-45616617911*x^403+47409747378*x^402 \ -10941088271*x^401-72305864589*x^400+18141927617*x^100-27919403621*x^267 \ -75002469491*x^266-45875064276*x^265-18838130679*x^264+15478573827*x^263 \ +17341560325*x^262+54857986683*x^261+88131799297*x^260-76999127565*x^259 \ -66198972699*x^258+48106377422*x^257-77285757762*x^256+1624330315*x^255 \ +3841588365*x^34+30013218950*x^33-5340125031*x^32-37334201612*x^127 \ -59895558088*x^126-16505068767*x^125+33919294466*x^124+40944166758*x^123 \ +24536748508*x^122-51786214663*x^121+49057258571*x^120+5860208924*x^119 \ -16197153571*x^118+20745014792*x^117+1859432439*x^116+1336798052*x^115 \ +25319297625*x^102+15443752161*x^101+15888204012*x^103+5268537528*x^254 \ +13437751905*x^253+55130661310*x^252-56945656856*x^251-53187848971*x^250 \ +36792199923*x^249+65889482847*x^248+54676062204*x^247+9373444102*x^246 \ +82778707527*x^245-1155729565*x^13+10818690967*x^12-3151299763*x^11 \ -113435197911*x^319+36460320856*x^318+31533841659*x^317+59374192238*x^316 \ +36714124360*x^315-46466864464*x^314+57939540988*x^313-117051043786*x^312 \ +6908217352*x^311+119695096985*x^310-37288034834*x^309+32155729060*x^31 \ +10298011464*x^30-10817352548*x^29-4579078917*x^6+1775874428*x^5 \ +930697362*x^4-27139276488*x^231-12815380034*x^230+109060553835*x^229 \ -3147654703*x^228-69338296876*x^227-2295143261*x^226+88918309431*x^225 \ -52677961098*x^224-4339428106*x^223+39692513052*x^222+2368222659*x^221 \ -12821485264*x^220+40810501984*x^219-3135618321*x^218-3478620156 \ +121642846747*x^501-30077710643*x^502+135206627500*x^503+80788885407*x^504 \ +4294142336*x^505+60113761961*x^506-52525711241*x^507-67661624614*x^508 \ -19690589512*x^509+17662010567*x^510+46484264868*x^511-49055110297*x^512 \ +105429732598*x^513-159310387634*x^514-34712567266*x^515+17939009679*x^516 \ +10058720567*x^517+189648210622*x^518+178503051946*x^519+40612030324*x^520 \ +69140480072*x^521-19608267751*x^522-132451377221*x^523-101549814781*x^524 \ +50009385834*x^525-35218480373*x^526-108625790743*x^527+18136907263*x^528 \ -179938816243*x^529-15427215352*x^530-67053449940*x^531+47014300252*x^532 \ -119829185605*x^533-31934518648*x^534+44603663143*x^535-51498133528*x^536 \ -3111728028*x^537+27910834213*x^538-26950819455*x^539-15441994785*x^540 \ -109737641439*x^541+6588852171*x^542-38378954724*x^543+4250430490*x^544 \ +21653035413*x^545-90519813297*x^546+218486022762*x^547+15816240641*x^548 \ +27772488593*x^549-46868203601*x^550-692131251*x^551-21710665882*x^552 \ -3789275125*x^553+35568459021*x^554-145437381161*x^555+104188652886*x^556 \ +11967964256*x^557+32234710722*x^558+51264850939*x^559+19578428472*x^560 \ -6653459610*x^561+78776159254*x^562-90902552066*x^563+32028754344*x^564 \ -16371374875*x^565+43915617220*x^566-40979866127*x^567-113279807002*x^568 \ +41056504620*x^569+87062936546*x^570+84540227360*x^571+176182414158*x^572 \ +126129784646*x^573-18113497064*x^574+95632973430*x^575-61835186044*x^576 \ -1094266284*x^577-25548526606*x^578-16286188041*x^579+23652588125*x^580 \ +99748065654*x^581+89189400499*x^582-84281188422*x^583-24822510820*x^584 \ -89019899561*x^585+17299853927*x^586+37447146519*x^587-52389168891*x^588 \ +60307425654*x^589+105423385125*x^590-16151503989*x^591+51669035353*x^592 \ +25896930669*x^593+68125207997*x^594-48076475979*x^595+49080185222*x^596 \ -114085618440*x^597+62417918964*x^598-29972805919*x^599+102994192965*x^600 \ +9470661387*x^601-65249001543*x^602+101392509369*x^603+13718716428*x^604 \ +38937251889*x^605-65562594382*x^606+66443969710*x^607+18877176302*x^608 \ -31358768559*x^609+82684433809*x^610-35507835802*x^611+123781293747*x^612 \ +31262151912*x^613-38249975546*x^614+3925377499*x^615-9663279445*x^616 \ +65505212623*x^617-38333318816*x^618-10947904682*x^619-33057241878*x^620 \ +137158617657*x^621+82280949071*x^622-144548051021*x^623+26049388729*x^624 \ +120972835647*x^625+22919074287*x^626+21809122232*x^627+38807820245*x^628 \ -35626871745*x^629+61073211657*x^630+10263794194*x^631-87779372272*x^632 \ +122409165273*x^633-71973533044*x^634-16220803574*x^635+190684171230*x^636 \ +39466031010*x^637-28535534784*x^638-129018222849*x^639-83527842222*x^640 \ +12242673643*x^641-69609384363*x^642+110212358649*x^643+165584710235*x^644 \ +83720551042*x^645-46594433050*x^646-25255661563*x^647-32840172649*x^648 \ +38437706003*x^649+24359981454*x^650+103816698072*x^651+35342491654*x^652 \ +99935819866*x^653-76900534968*x^654+9187154790*x^655-21467901456*x^656 \ +11271802560*x^657+2793048339*x^658+156900676156*x^659-71757864537*x^660 \ +69068834560*x^661-21725605511*x^662+20565641172*x^663-17160005713*x^664 \ -28846431158*x^665-63820679105*x^666+67344279329*x^667+17417509088*x^668 \ -49749571514*x^669-149526619276*x^670+63726307333*x^671+47868397878*x^672 \ -152430070*x^673-98024226774*x^674-5900709150*x^675+35049382555*x^676 \ +45151856490*x^677-74725155328*x^678+85550840075*x^679-28035942909*x^680 \ -26105359645*x^681+8366135944*x^682-61065262686*x^683-11480596600*x^684 \ +66582786332*x^685+31934448191*x^686-4555392418*x^687+21122866405*x^688 \ +98576196894*x^689-67653329405*x^690+23891408534*x^691-97842890368*x^692 \ -38880790121*x^693+31989951820*x^694-85233731747*x^695+81476023995*x^696 \ +13150343534*x^697+34515945612*x^698-28479873758*x^699+7200965291*x^700 \ +22962247818*x^701+31245755201*x^702-7231787902*x^703+20078549142*x^704 \ +112814365060*x^705-37906130331*x^706+119341166775*x^707-4419273787*x^708 \ -136935403112*x^709-42320208584*x^710-76243411849*x^711-85094494474*x^712 \ +62345894287*x^713+123330307888*x^714-28416874429*x^715-8930496064*x^716 \ -27860939118*x^717-67479134742*x^718+63217142335*x^719-104983862154*x^720 \ +63261675838*x^721+29568447967*x^722+5532882614*x^723+7122613368*x^724 \ -75015246457*x^725+27623940192*x^726-71280327669*x^727+63881717913*x^728 \ -64602087729*x^729+55116167817*x^730-37894641441*x^731+24570439656*x^732 \ +60506453909*x^733-56693236822*x^734+65202309407*x^735+48657462670*x^736 \ +7020063399*x^737-14972937697*x^738+14832651654*x^739+38685418056*x^740 \ -120977459366*x^741+128129373977*x^742-93004438817*x^743+21708662393*x^744 \ -42256337713*x^745-74943652142*x^746+13089216312*x^747-68161772735*x^748 \ -9184732864*x^749-36881334485*x^750+12849929766*x^751-14616276010*x^752 \ -117623139884*x^753+85738538127*x^754-39397879206*x^755-41203911145*x^756 \ +17752041163*x^757-28528185854*x^758-75782937817*x^759+58967984992*x^760 \ -46501383932*x^761-30160463545*x^762+9264824504*x^763-61240651988*x^764 \ +46332296135*x^765-36374812215*x^766-33996335903*x^767+38748904012*x^768 \ +16692416615*x^769-24682633336*x^770-101120634096*x^771-16383524365*x^772 \ -9803993525*x^773-41138860891*x^774+6438402836*x^775+15150248922*x^776 \ +37535375473*x^777+38243096134*x^778+42990687315*x^779+6806571489*x^780 \ -98981551731*x^781+48378556460*x^782-20305038281*x^783-19970849999*x^784 \ -32199627381*x^785-33726111417*x^786+26825654676*x^787+61472162609*x^788 \ -52262572570*x^789+6245081045*x^790+37192923285*x^791-36188152777*x^792 \ -37778625393*x^793+26152618527*x^794-18379411727*x^795-16240247039*x^796 \ +45087181394*x^797-124867049408*x^798-107527500523*x^799-24928581030*x^800 \ +19049432356*x^801-47425859030*x^802+94662514506*x^803-83733870803*x^804 \ +24856672813*x^805-94427622673*x^806+243768097*x^807+12589141374*x^808 \ +41959344927*x^809+18983184801*x^810+42147767843*x^811+69911314756*x^812 \ +41515466302*x^813-25611533183*x^814+20697173226*x^815-23226268622*x^816 \ -3460976233*x^817+19330241623*x^818+53475160447*x^819-2631042112*x^820 \ -9676147438*x^821-48282043682*x^822-90120418937*x^823+48976788717*x^824 \ -7320635080*x^825-31580257870*x^826-40998967997*x^827-9980407645*x^828 \ +66749588012*x^829+7524200886*x^830+14940938828*x^831-28733285670*x^832 \ +61208670468*x^833-46627324765*x^834-324835109*x^835-104056679115*x^836 \ +29480632050*x^837-22586403838*x^838+40186158836*x^839+15807331652*x^840 \ -32196192662*x^841+4141096053*x^842-23428399361*x^843-68414521546*x^844 \ -39195126416*x^845+20150874189*x^846+70929847486*x^847+15213160735*x^848 \ -209188024*x^849-55922045928*x^850+31518449658*x^851+9332299671*x^852 \ -61000802604*x^853+42494294179*x^854+333778076*x^855+21847051495*x^856 \ -53208254853*x^857+41428747135*x^858-13241351753*x^859-16608043286*x^860 \ +9621250261*x^861+25806175298*x^862-21297665820*x^863-14032790352*x^864 \ -18013819490*x^865+15757760316*x^866+17003024240*x^867-30013032879*x^868 \ +30760011284*x^869-13804439291*x^870-51756563292*x^871+51909198130*x^872 \ -29495505438*x^873+7110464993*x^874-36258305774*x^875-9149267274*x^876 \ -30428902968*x^877-48039515073*x^878-34750047014*x^879+7876564124*x^880 \ -45028260612*x^881+29426481275*x^882+36322178879*x^883+55350571320*x^884 \ -72386726651*x^885+23215477084*x^886-95129391342*x^887-62068317572*x^888 \ -5131982570*x^889+25120942005*x^890+47570343070*x^891-16931626769*x^892 \ +32866462223*x^893+75548504697*x^894-48026152317*x^895-33748968072*x^896 \ -1682061382*x^897+8180943332*x^898+19356108993*x^899+7145333263*x^900 \ +22433305927*x^901+18401298176*x^902-46765206984*x^903-19742304183*x^904 \ -48845002624*x^905-27099816961*x^906+23031415252*x^907-4460429941*x^908"); static const std::string q2_srep_2("\ -14418681720*x^909-41227198785*x^910-10148524063*x^911+18686856429*x^912 \ -97172567422*x^913-9574103314*x^914-18076030731*x^915-28358519392*x^916 \ -16581350003*x^917+12090038057*x^918+44243258246*x^919-3986576854*x^920 \ +11411306779*x^921+17162852247*x^922+6351778392*x^923-15260387550*x^924 \ -29138592351*x^925-14800636505*x^926+9885625539*x^927-36480762358*x^928 \ +844036464*x^929-7561956503*x^930-28235178974*x^931-15625555530*x^932 \ +2051786154*x^933-31812159700*x^934+13415581956*x^935+5382068286*x^936 \ +20152707873*x^937-46081228993*x^938+17160743960*x^939-4906718548*x^940 \ -22981161630*x^941+39189470825*x^942-15015976743*x^943+36442762021*x^944 \ +14159701449*x^945-20259808043*x^946+19582548075*x^947+7969503721*x^948 \ +15803199913*x^949+9091493711*x^950-11663943215*x^951-5644414749*x^952 \ -3135411920*x^953+2212086003*x^954-3254521457*x^955-56705145197*x^956 \ +6408789788*x^957+10381413436*x^958-3057504701*x^959+12451307686*x^960 \ +9518096173*x^961-15016723746*x^962+37406257148*x^963+808574925*x^964 \ +8217276211*x^965-5548816739*x^966+8580073344*x^967-16411223685*x^968 \ +7110424112*x^969-8924388605*x^970+20244682123*x^971+16962224189*x^972 \ +21644034171*x^973+10349693065*x^974+14406123922*x^975+17009695542*x^976 \ +10162045861*x^977+5660460802*x^978-1036608219*x^979-1885363228*x^980 \ -5283058429*x^981-516240895*x^982-15317530637*x^983-11663251903*x^984 \ +4064930580*x^985+7633085681*x^986+8471058375*x^987+20912594799*x^988 \ +3688126507*x^989+11604012893*x^990+5171125016*x^991+7684753357*x^992 \ -2336834864*x^993+2482449646*x^994-23487081*x^995+41345539*x^996 \ -1908649318*x^997-1563161986*x^998-3391442566*x^999-1975737484*x^1000"); static const std::string r1_srep_1("\ 138233755629*x^426-22168686741*x^425-65314032186*x^424+46713467112*x^423 \ +54066842891*x^422+82543269656*x^421+176235947107*x^420+23156315980*x^419 \ -8714217205*x^418-7917439564*x^417-20923895097*x^416-96817317174*x^415 \ +37671252734*x^414+16053780026*x^47+26648458420*x^46+254608847*x^45 \ -11343106531*x^174-44222442938*x^173-10656079278*x^172-54688112379*x^171 \ -72653860271*x^170+70185903368*x^169-66162378498*x^192-19340590695*x^191 \ -74831870843*x^190-51340722881*x^189-65948469390*x^188-40940690738*x^187 \ -9541570627*x^24+12358437331*x^23-3840010930*x^22-26103658089*x^333 \ +16787990043*x^332-72471206553*x^331+38195377054*x^330+48906246421*x^329 \ +29212932541*x^328+27943555500*x^327-126086829668*x^326+45642899604*x^325 \ +152779000312*x^324-45599025206*x^323-86920511292*x^322+30167371152*x^321 \ +27416748135*x^320-546541724*x^113+41265938666*x^112-24708554690*x^111 \ -20961586765*x^110+16946301630*x^109+45088470222*x^108-5349150466*x^107 \ +15365225017*x^106-7995302120*x^105-20232813599*x^104+10081791273*x^114 \ -3865321947*x^347-87489963865*x^346-30639453185*x^345+3676613013*x^344 \ -58165676134*x^343-68737381572*x^342-3907635479*x^341+14873150406*x^340 \ -5503004922*x^339-78473587467*x^338-54025110093*x^337-29151845013*x^336 \ -67735495295*x^335+73397803045*x^334-27801675473*x^477-14039747517*x^476 \ -8375986438*x^475+84327817349*x^474+82430096016*x^473+85036210781*x^472 \ +74675551911*x^471-31481207861*x^470+50505881655*x^469+57661203244*x^468 \ +1422790738*x^467+46263290040*x^466+17837475246*x^465+109465309830*x^464 \ +5141857548*x^450-85449781066*x^449+84234728669*x^448-88234927160*x^447 \ -127641987837*x^446-92744124462*x^445-55229182896*x^444-58231651691*x^443 \ -71614587111*x^442-19795619691*x^441+16444963184*x^440+7188954710*x^439 \ -21800762926*x^438+858791107*x^451-75911542139*x^373-9360344384*x^372 \ +121593378315*x^371-13873126064*x^370+26377931906*x^369+65223112057*x^368 \ +54567161420*x^367+81605659307*x^366+50232494189*x^365+22085432850*x^364 \ +68840804661*x^363-15408612740*x^362+86485074789*x^361-15439204155*x^28 \ -6661325097*x^27+6410229219*x^26+30961129925*x^25+38724464689*x^44 \ +13389600650*x^43-4221359244*x^42-1728086134*x^399-37933493961*x^398 \ -14669037140*x^397+23734942521*x^396-58830055830*x^395+8467094098*x^394 \ +77771292477*x^393-89683404862*x^392-78155773051*x^391-39478631291*x^390 \ -67987409649*x^389-64950072499*x^388-12266565939*x^387+11491110518*x^50 \ +23873449940*x^49+22044595358*x^48+14077914429*x^202-57100831007*x^201 \ +13655668351*x^200-22624838544*x^199-51198193976*x^198+4929392620*x^197 \ +61541561422*x^196+58408299147*x^195-2755337167*x^194-2544113778*x^193 \ +38364208184*x^203-39653790505*x^1196+237290860955*x^1197+1445942111*x^1198 \ -44203650162*x^1199+82332058439*x^1200-8702521180*x^1201+70840770500*x^1202 \ +119211377409*x^1203+62594288529*x^1204-90021858665*x^1205-129281425167*x^1206 \ +136510590125*x^1207-32382101108*x^1208+4377395620*x^1209-94124507363*x^1210 \ -136821711247*x^1211-62766336520*x^1212+73042766437*x^1213+170448193742*x^1214 \ -159429807450*x^1215+23801498853*x^1216+83841365444*x^1217-2786331945*x^1218 \ -110101444536*x^1219+120943591409*x^1220-17972193177*x^1221-17917016958*x^1222 \ +76059557227*x^1223-26278875051*x^1224+28452314938*x^1225+59268213718*x^1226 \ -14918040641*x^1227+214442906160*x^1228-40652938342*x^1229+96990811343*x^1230 \ -1760397639*x^1231-21403305270*x^1232+108438376045*x^1233+11163376014*x^1234 \ -49795674343*x^1235-155428477820*x^1236-46317266895*x^1237-21181283092*x^1238 \ +54803863270*x^1239+77990955099*x^1240+9021816223*x^1241-81330127566*x^1242 \ -172066502236*x^1243+38125269764*x^1244+126728193806*x^1245+20491510600*x^1246 \ +52585146599*x^1247-188911557303*x^1248-134043853649*x^1249+67603167253*x^1250 \ -130154245559*x^1251-55153609001*x^1252+163170176229*x^1253-4743088670*x^1254 \ +41209412802*x^1255-10129602317*x^1256+181535124040*x^1257+56212841612*x^1258 \ +71426935568*x^1259-30429980124*x^1260-60832906417*x^1261+67431835761*x^1262 \ +121532246986*x^1263+33159787171*x^1264+79034947915*x^1265+12461193342*x^1266 \ -75977547043*x^1267-43756049561*x^1268+168122514802*x^1269-48398370299*x^1270 \ +35964935382*x^1271+54347586872*x^1272+44590944224*x^1273+10445353165*x^1274 \ -26132065869*x^1275-47859095692*x^1276-1718582779*x^1277-41783188995*x^1279 \ +11909834976*x^1278-77982413527*x^500-73027923452*x^499-85982752234*x^498 \ -88590919157*x^497+18625207103*x^496-19917282031*x^495-203961285889*x^494 \ +92315048982*x^493-113685780846*x^492-35278695612*x^491-4343198835*x \ +8372388799*x^437-7765335812*x^436+122688463230*x^435+143085745466*x^434 \ -15940623925*x^433+59911209151*x^432+41198459053*x^431+86637043974*x^430 \ -19150403305*x^429-9590187908*x^428+72843435206*x^427-18969078712*x^281 \ -45111690065*x^280-29657990745*x^279-29667542848*x^278-14810537128*x^277 \ +38201688736*x^276-3959944314*x^275+75115374863*x^274+13874014995*x^273 \ +9466913592*x^272+40932968214*x^271-124744392985*x^270+42790568189*x^269 \ +14764851450*x^268-56964896169*x^360+107236900075*x^359+64188502464*x^358 \ -19966311943*x^357-89292693652*x^356+37459485658*x^355+9602002258*x^354 \ +8694265442*x^353+104669007441*x^352+25291836948*x^351-18712737803*x^350 \ +72885504388*x^349-6701955331*x^348+16019376388*x^21-10276721887*x^20 \ +9332762048*x^19-15679749591*x^18+15800007975*x^168-43019181710*x^167 \ +44135505581*x^166+609100023*x^165+6765959027*x^164-13557946012*x^163 \ +4278574066*x^162+6019496346*x^161+63349714834*x^160+36279456292*x^159 \ -8605662788*x^158-16446890130*x^157-41810449045*x^156-7095450334*x^155 \ -4077050532*x^41+21830008852*x^39-29092609442*x^186-12826386339*x^185 \ +6695603221*x^184-49972209582*x^183-83136366951*x^182-50423891996*x^181 \ -18169858920*x^180-78476319819*x^179-21436351653*x^178+7919620529*x^177 \ +28970986638*x^176+79296839091*x^175+77264613819*x^463+116466004826*x^462 \ +55542962016*x^461-13262967705*x^460+36244684198*x^459+83226762576*x^458 \ -64390551357*x^457-18179417756*x^456-99881894932*x^455+75031794196*x^454 \ +26324508605*x^453-26157248749*x^452-3352003325*x^10-12675513756*x^9 \ -15441617775*x^8-5613718699*x^7+43860635066*x^154+27940358221*x^153 \ -2134093560*x^152+54527866704*x^151+2777626391*x^150+38378887212*x^149 \ +49841642562*x^148-30221044274*x^147+21827366162*x^146+17014456405*x^145 \ +30271071817*x^144-27945878711*x^143+51399953423*x^142-57512493*x^3 \ +2646183642*x^2-20412139833*x^294-93210725051*x^293-34887615044*x^292 \ -47910215801*x^291-6350488002*x^290-13981009447*x^289-155911910590*x^288 \ +34327352071*x^287-43586097508*x^286-23319014164*x^285-56002153978*x^284 \ +81803548303*x^283-71820207962*x^282-10617748524*x^217-34889926744*x^216 \ -43806949611*x^215+12004331776*x^214+29950034237*x^213-32867273114*x^212 \ -34298658181*x^211+21233130475*x^210-15987453386*x^209-28840589378*x^208 \ +1865221090*x^207+5310473345*x^206+21898421919*x^205-7574068856*x^204 \ +69079520037*x^490-77180539242*x^489-3940662000*x^488-74380408842*x^487 \ +46029555022*x^486+22962337328*x^485-121388716462*x^484-114696481860*x^483 \ -4968867689*x^482+69556807304*x^481+57719690408*x^480+83880745421*x^479 \ -90995723818*x^478+16426027446*x^17-9008826521*x^16+3125040990*x^15 \ -10087115771*x^14+7507131425*x^1364+5491038077*x^1365+23299185767*x^1366 \ +158679796477*x^1367+124242620006*x^1368-34138235836*x^1369-104792195268*x^1370 \ +44072214558*x^1371+30242736127*x^1372+74669209902*x^1373-28102587847*x^1374 \ -39469546681*x^1375+52533883313*x^1376-80940926697*x^1377+78402169540*x^1378 \ +58161497695*x^1379-78127274957*x^1380+187195727863*x^1381+34839827097*x^1382 \ +97631469873*x^1383-132261723396*x^1384-243403867184*x^1385+101905407375*x^1386 \ -103768707126*x^1387+140665326183*x^1388+38246904662*x^1389+94463316851*x^1390 \ +42616536629*x^1391+75720607770*x^1392+75120834886*x^1393+57978068569*x^1394 \ +82557166839*x^1395+14150729258*x^1396+27266620054*x^1397-18339937355*x^1398 \ +167325111479*x^1399-172482710865*x^1400+26706898368*x^1401+49778092097*x^1402 \ -153703751430*x^1403-61886877598*x^1404-81585576994*x^1405+19946334906*x^1406 \ -69565555266*x^1407+94052269487*x^1408-113507716080*x^1409-17501141543*x^1410 \ -137588116092*x^1411+165758417577*x^1412+35485042515*x^1413+61433836565*x^1414 \ +90286860422*x^1415+2551044222*x^1416-77880307583*x^1417-50298698782*x^1418 \ +83096470495*x^1419+115239475320*x^1420+72164396736*x^1421+189899241723*x^1422 \ -56373869311*x^1423+97019679656*x^1424-48247967357*x^1425+154619324085*x^1426 \ -67236039222*x^1427-47410964957*x^1428+169855658430*x^1429+30322992840*x^1430 \ -63052501875*x^1431+222129643467*x^1432+4192274277*x^1433-75770181677*x^1434 \ +64933458610*x^1435+77098206606*x^1436-27720674116*x^1437-5749263490*x^1438 \ +125660847820*x^1439-34531000515*x^1440-124220079488*x^1441-138169543755*x^1442 \ +17069521947*x^1443+47935404425*x^1444+52181081902*x^1445+16289942255*x^1446 \ -15900660870*x^51+32923650103*x^52+27554024107*x^53+18237379971*x^54 \ +20628678703*x^55+1475901766*x^56-15828776045*x^57+38774503478*x^58 \ -26045359531*x^59-23045701898*x^60-24089408197*x^61+34446523234*x^62 \ +40957087639*x^63+11389117440*x^64+9820681224*x^65+16429339120*x^66 \ +26545401357*x^67-32362862895*x^68-26680758766*x^69-13927308596*x^70 \ +57526789510*x^71-2089874730*x^72+77834083653*x^73+1750624845*x^74 \ -16803601217*x^75-60811888974*x^76-30511923805*x^77-49471168139*x^78 \ +295087634*x^79-2230079022*x^80+8101489602*x^81+1848095682*x^82 \ -13546237573*x^83-64824054906*x^84-1604410156*x^85-13212803439*x^86 \ -28859271440*x^87-21647178880*x^88-2728763159*x^89+20896727129*x^90 \ +17467604913*x^91+17068807003*x^92-6893543875*x^93+47303976287*x^94 \ +24117835126*x^95-42839904766*x^96+73128945825*x^97+16819953882*x^98 \ +23690754989*x^99+43674412612*x^386+125292875686*x^385-6868632145*x^384 \ +6792231538*x^383+13345729255*x^382+100308206906*x^381-36410281681*x^380 \ +151329173416*x^379+34770326061*x^378-31189291341*x^377+41062130384*x^376 \ +12585820391*x^375-25741536606*x^374+7011683808*x^40+3801986823*x^38 \ -13975966697*x^37+860658280*x^36+7772384392*x^35+70631237268*x^308 \ +8038593583*x^307+9785270382*x^306+7562096391*x^305+18097750087*x^304 \ -36486540217*x^303+21014018569*x^302-50758761074*x^301+31281420904*x^300 \ +53709825490*x^299+52888377853*x^298-74951274347*x^297+12921546086*x^296 \ -76415705347*x^295+15826680805*x^141-8143429483*x^140-1266967067*x^139 \ -52609851275*x^138-127235369220*x^137-5562487640*x^136+15459500426*x^135 \ -34261922713*x^134-26128935470*x^133-31766069313*x^132-46271941901*x^131 \ +11210102504*x^130-66673301013*x^129-52689509960*x^128+60511652766*x^244 \ -75008847608*x^243-20985226623*x^242+7192516942*x^241-161582525421*x^240 \ -49134000625*x^239-9420319932*x^238-52466552215*x^237+20737248665*x^236 \ +4518034715*x^235-86981206669*x^234-65413662872*x^233-55595224849*x^232 \ +48838613905*x^413-89117174044*x^412-28371635419*x^411+58369364519*x^410 \ -63080675673*x^409-30544354398*x^408-45382170441*x^407-18873560244*x^406 \ +18026475289*x^405-50705159627*x^404+38696002656*x^403+526588856*x^402 \ -21240649788*x^401-43406345490*x^400+74297814205*x^100+6264961896*x^267 \ -1021895999*x^266+86122332454*x^265+38169747213*x^264+64147932916*x^263 \ +58378689172*x^262+24226397033*x^261-29422870170*x^260-47943224531*x^259 \ +26452750294*x^258+105345226861*x^257+43954658692*x^256-20434482832*x^255 \ +8127775817*x^34+30199475755*x^33-12223507015*x^32+22756827882*x^127 \ -32719507346*x^126-49802125175*x^125+60597935861*x^124-74864424168*x^123 \ +13477644513*x^122+5355799358*x^121+10198619648*x^120+20797815942*x^119 \ +1011263561*x^118-6797018716*x^117-9127452274*x^116+22527387258*x^115 \ +10256659433*x^102+29285807465*x^101+7541734764*x^103+17761344886*x^254 \ -17286568131*x^253+25433230102*x^252-40561054425*x^251+11031323376*x^250 \ +23702567137*x^249-60198922511*x^248+28633857562*x^247+47422980942*x^246 \ -9295089069*x^245-10089830249*x^13-23491786545*x^12+4224016794*x^11 \ +81467257701*x^319+63655491886*x^318-66641279796*x^317+144469815422*x^316 \ -77290195044*x^315+70923255017*x^314+15984076870*x^313+14434564477*x^312 \ +36604017606*x^311+103558138654*x^310-51454408044*x^309-3209161334*x^31 \ +15201977479*x^30+28627262797*x^29-906050188*x^6-10466791945*x^5 \ -8215574614*x^4+6088611949*x^1280-155043352048*x^1281-118198059014*x^1282 \ +141985007241*x^1283-20206827728*x^1284-22529445083*x^1285+3357709716*x^1286 \ +20047180952*x^1287+20996464819*x^1288-23941814014*x^1289-95188363707*x^1290 \ +40630147116*x^1291-14052413668*x^1292-21048701821*x^1293+100140633841*x^1294 \ +167338922803*x^1295+33226558*x^1296-128357266656*x^1297+81105983581*x^1298 \ +31392576204*x^1299-21641561406*x^1300+235587348445*x^1301+161935696996*x^1302 \ -128703673247*x^1303-39346114561*x^1304+42054040866*x^1305-12956319862*x^1306 \ +65064708855*x^1307+44115412714*x^1308-39733064653*x^1309+3355869893*x^1310 \ -161862258823*x^1311+97885854896*x^1312-102623735650*x^1313-108185508417*x^1314 \ +108464851653*x^1315-112704576169*x^1316+131875786827*x^1317+60270345360*x^1318 \ +20669673912*x^1319+21026875646*x^1320+75295304489*x^1321+43782162551*x^1322 \ -61132288089*x^1323+24355164025*x^1324+63346171944*x^1325+85327679328*x^1326 \ +97712315102*x^1327+99189458373*x^1328-160846738551*x^1329-141296521216*x^1330 \ +20245830585*x^1331-52143723845*x^1332-76834814333*x^1333+41461601925*x^1334 \ +18631439711*x^1335-178840949428*x^1336-66799837449*x^1337+106991716450*x^1338 \ -153373473969*x^1339-50991501172*x^1340+136263482777*x^1341+40392134464*x^1342 \ -83367427546*x^1343+28165179356*x^1344+120448869294*x^1345-139735638019*x^1346 \ +55812330303*x^1347+115565807139*x^1348+80171150937*x^1349-29320222386*x^1350 \ +85845037273*x^1351-56994419699*x^1352-1430513579*x^1353+5782046987*x^1354 \ -38239520543*x^1355-80217085657*x^1356-66662368035*x^1357+73040143027*x^1358 \ +31583949065*x^1359+22409165365*x^1360-52189298813*x^1361-30600519487*x^1363 \ -160877387612*x^1362-130745878790*x^1447-164421846143*x^1448+58826335534*x^1449 \ -121078622350*x^1450-92870208218*x^1451+63205043793*x^1452-47504622824*x^1453 \ -40792276413*x^1454+132243469959*x^1455-50122842754*x^1456-25457647727*x^1457 \ +75460123980*x^1458+92360457423*x^1459-47123614245*x^1460+27742628194*x^1461 \ +70699349259*x^1462-60815737692*x^1463-169591512815*x^1464+120636922587*x^1465 \ +2874472932*x^1466-107608428068*x^1467-5720975123*x^1468+79093930048*x^1469 \ -56584218802*x^1470-170994826684*x^1471+72209169257*x^1472-49673733343*x^1473 \ -90870320816*x^1474+157355941752*x^1475+110866008554*x^1476+16569857191*x^1477 \ -30490578506*x^1478+76530403441*x^1479-162248432265*x^1480+93640590463*x^1481 \ -15744202469*x^1482+8788690056*x^1483-70664515415*x^1484+35129616345*x^1485 \ -39685588353*x^1486-10030759315*x^1487+88476545624*x^1488-37767780482*x^1489 \ +85460102492*x^1490-154368097388*x^1491-101122282432*x^1492-17958917193*x^1493 \ +15758996309*x^1494-52478307769*x^1495-40381137773*x^1496-133030420549*x^1497 \ -24719543246*x^1498-8096296417*x^1499+101004857673*x^1500+86200685962*x^1501 \ -25972251955*x^1502-84505928738*x^1503+4038114310*x^1504-1730887646*x^1505 \ +34280919324*x^1506-10546638656*x^1507+33864769034*x^1508+37325029980*x^1509 \ +52990264954*x^1510+78875435896*x^1511-23552799978*x^1512+18021688980*x^1513 \ -70918050095*x^1514+37377330996*x^1515+147115987122*x^1516+59886319925*x^1517 \ +69247156063*x^1518+44264194675*x^1519-5321836395*x^1520+49605413611*x^1521 \ +16106834226*x^1522-127288542421*x^1523+10517014560*x^1524-33826730451*x^1525 \ +17362491215*x^1526+11259519069*x^1527-111850411663*x^1528+169788136728*x^1529 \ -61627977383*x^1530-83949340540*x^1531-203179287438*x^1532+65741933623*x^1533 \ -43116357571*x^1534-40480690150*x^1535-41131362243*x^1536+79032181440*x^1537 \ -59212226430*x^1538+15954047280*x^1539+58552174868*x^1540-2763240020*x^1541 \ -70634496472*x^1542+61309662059*x^1543-116329612672*x^1544-3218593493*x^1545 \ +88470810821*x^1546+39987733363*x^1547-110861185999*x^1548+67527613693*x^1549 \ -5618360677*x^1550+34760731651*x^1551+101313541809*x^1552+57123487946*x^1553 \ -73138213965*x^1554-113152834893*x^1555+85732909325*x^1556+17860086653*x^1557 \ -112504565378*x^1558+55883545171*x^1559-65178434517*x^1560-39660841716*x^1561 \ -63794649779*x^1562+46366489306*x^1563-13439935357*x^1564+88339338684*x^1565 \ -57150594822*x^1566+30622063640*x^1567-16625632272*x^1568-119377667973*x^1569 \ +224593656399*x^1570+53193487159*x^1571+65126081701*x^1572+62970399092*x^1573 \ +68191968832*x^1574-2532739610*x^1575+182827386055*x^1576+88816579011*x^1577 \ -89385510567*x^1578+66143786656*x^1579+126309891941*x^1580+5804094044*x^1581 \ +97890664428*x^1582+85726994348*x^1583-23154770060*x^1584-117108787907*x^1585 \ +13971227562*x^1586+38219978507*x^1587-29292257027*x^1588-45584106398*x^1589"); static const std::string r1_srep_2("\ +226543786384*x^1590-123525218087*x^1591-106279675553*x^1592+59009279185*x^1593 \ -21501846244*x^1594-58215906325*x^1595+10168443133*x^1596+14253963923*x^1597 \ -103607933374*x^1598-23820552704*x^1599+73298115017*x^1600-76073336462*x^1601 \ +27722337160*x^1602+30665618287*x^1603-40718538083*x^1604-10845646905*x^1605 \ +103841915855*x^1606-88690958814*x^1607+15639683979*x^1608+63587256763*x^1609 \ +79584369720*x^1610-3856065377*x^1611+3277105804*x^1612+49374804337*x^1613 \ +22208269344*x^1614-103803342247*x^1615-18126304778*x^1616-2637468237*x^1617 \ +1194910718*x^1618+49396303997*x^1619-59067168846*x^1620-151244829011*x^1621 \ -61107141831*x^1622+6516627549*x^1623-46932605166*x^1624+40009442716*x^1625 \ +10816141849*x^1626-13881407844*x^1627+19588816684*x^1628-30762755573*x^1629 \ -3498132458*x^1630-51828207675*x^1631-143896344594*x^1632+13062299884*x^1633 \ +118213321141*x^1634+20450936554*x^1635-22769649400*x^1636+24410873563*x^1637 \ +61409701263*x^1638+62682111645*x^1639-12555885646*x^1640+81231121875*x^1641 \ -87265869575*x^1642-50101835778*x^1643+23208178290*x^1644+47909319630*x^1645 \ -56149574095*x^1646-5387312186*x^1647+45155954494*x^1648-26506247987*x^1649 \ -24655453114*x^1650+64438306450*x^1651+933006957*x^1652+88649043790*x^1653 \ +33722720231*x^1654-67168346690*x^1655+20490156374*x^1656+58590799138*x^1657 \ -35113882356*x^1658+86769469196*x^1659-31677323009*x^1660+68172444087*x^1661 \ +30384983461*x^1662+65971494796*x^1663+29114405715*x^1664-72273691319*x^1665 \ +8637409991*x^1666+102558776528*x^1667+25534632508*x^1668-150062568831*x^1669 \ +149103774958*x^1670+76826656126*x^1671-9206966427*x^1672+47754890342*x^1673 \ +143906292602*x^1674-47363760887*x^1675-100347436928*x^1676+49034963661*x^1677 \ -30032825100*x^1678+1904447368*x^1679-16465929892*x^1680+115898668860*x^1681 \ -15427200819*x^1682+78327171484*x^1683+40114906121*x^1684-115194215170*x^1685 \ -11250164384*x^1686-61135885162*x^1687-25229902390*x^1688-80960554583*x^1689 \ +46627919488*x^1690+12640135253*x^1691-12106872032*x^1692+657736289*x^1693 \ -61068471661*x^1694-69864159279*x^1695-132350791169*x^1696+98340842400*x^1697 \ -70012959047*x^1698-2783637838*x^1699+3610440908*x^1700-47500311360*x^1701 \ -27795498744*x^1702-8059436836*x^1703+31022917786*x^1704+11882840379*x^1705 \ +32303942074*x^1706+85260001288*x^1707+34515935101*x^1708-48862338609*x^1709 \ -37609344377*x^1710+26243060316*x^1711-93968692092*x^1712+7263670481*x^1713 \ +14186751888*x^1714+50504820421*x^1715-97325627322*x^1716-7505006522*x^1717 \ -22987526264*x^1718-25885379938*x^1719-60493345579*x^1720-35418112892*x^1721 \ +84502334154*x^1722-76073278035*x^1723-14606929933*x^1724+66548501808*x^1725 \ +5528600957*x^1726-8215155843*x^1727-59490241426*x^1728-28466163634*x^1729 \ -70616897676*x^1730-8577546165*x^1731-17443872540*x^1732+45985496045*x^1733 \ -25689081146*x^1734+31463778961*x^1735-11994818364*x^1736+26963273177*x^1737 \ -14658991498*x^1738+3071653886*x^1739+10415294559*x^1740-11371033244*x^1741 \ -63444243140*x^1742+6028056803*x^1743+43009638114*x^1744+134916900978*x^1745 \ +17343194494*x^1746+80265572665*x^1747-34809795749*x^1748-105843176239*x^1749 \ -825331310*x^1750-4839163988*x^1751-62409624690*x^1752-20792219308*x^1753 \ -97773424039*x^1754-40261609853*x^1755-43580213332*x^1756-35959090815*x^1757 \ -38749485599*x^1758-36327596188*x^1759-37274972348*x^1760+40676817240*x^1761 \ +83402203312*x^1762+68572573193*x^1763-13232334596*x^1764+26432741583*x^1765 \ -5897475378*x^1766-61972444406*x^1767+58535013523*x^1768+19602260192*x^1769 \ -8318743400*x^1770+7803001425*x^1771+76563637063*x^1772-113144033283*x^1773 \ -71048872512*x^1774+37755540165*x^1775+19330521255*x^1776-56127401651*x^1777 \ +18888644242*x^1778+31817399525*x^1779+10800209238*x^1780+42691003617*x^1781 \ +33764982495*x^1782+46697603267*x^1783-25632574756*x^1784+33073816150*x^1785 \ +60790438629*x^1786+52911597033*x^1787+36269227256*x^1788+24513405600*x^1789 \ -62856298604*x^1790+40347138135*x^1791+47204525731*x^1792-44078709555*x^1793 \ -70239814448*x^1794-16761046243*x^1795-40213099308*x^1796-70370190048*x^1797 \ +88560337870*x^1798-43789585801*x^1799-26066270170*x^1800-12513783195*x^1801 \ +40117642516*x^1802+1078125116*x^1803+51122854580*x^1804+49031149283*x^1805 \ -14630551725*x^1806+83787049535*x^1807+64190880486*x^1808+72057188859*x^1809 \ +10305597348*x^1810+79560003326*x^1811+27992723763*x^1812-40123535204*x^1813 \ +6540213580*x^1814-12201813772*x^1815-62863210776*x^1816-9530516684*x^1817 \ +26089647341*x^1818+8240990342*x^1819-16988726374*x^1820+25502485674*x^1821 \ +21819935364*x^1822+7578747975*x^1823-7924234392*x^1824-4583916789*x^1825 \ +27312267438*x^1826+27028394122*x^1827+36340332694*x^1828+34569493970*x^1829 \ -24317197250*x^1830-73040883806*x^1831+119152928326*x^1832-27999217300*x^1833 \ -66377712512*x^1834+19049296317*x^1835-1499967276*x^1836-101411288144*x^1837 \ -9893623936*x^1838-12904600465*x^1839-65098811535*x^1840-10374614407*x^1841 \ -63493256502*x^1842-20925111013*x^1843-43545631503*x^1844-56380343071*x^1845 \ -78765502946*x^1846-61513189902*x^1847-53296444805*x^1848-22832568686*x^1849 \ +35971486958*x^1850+15588623624*x^1851+53739674006*x^1852-27920615672*x^1853 \ +20232297980*x^1854-24748814662*x^1855+6432159679*x^1856+14056122601*x^1857 \ +16908873134*x^1858-54999071671*x^1859-3428715644*x^1860-19509913014*x^1861 \ -2921305636+10285270533*x^1862+54449949829*x^1863-16556984981*x^1864 \ -45632321047*x^1865-37192326359*x^1866-89167294735*x^1867+28988566970*x^1868 \ +33580738542*x^1869+17847650506*x^1870-2590933698*x^1871+60479028111*x^1872 \ -74174252419*x^1873-51005953957*x^1874+34076527326*x^1875-12501722418*x^1876 \ +11997164778*x^1877+11106537537*x^1878-67544802654*x^1879-28559326960*x^1880 \ +25496394971*x^1881-7743517594*x^1882-60700405990*x^1883-3306265111*x^1884 \ -52601213422*x^1885-48504437343*x^1886-33628794516*x^1887-6175399721*x^1888 \ -42427338898*x^1889+2438088321*x^1890-10879611090*x^1891-50114291787*x^1892 \ +8139307516*x^1893+699677484*x^1894+27742148976*x^1895+2363683066*x^1896 \ +23142955138*x^1897-13125418109*x^1898-8068365620*x^1899-26376527681*x^1900 \ -16879977313*x^1901-13899647882*x^1902+55501082808*x^1903+20977999945*x^1904 \ -41959603668*x^1905+42141731465*x^1906-65252748680*x^1907-5713058482*x^1908 \ +5531788408*x^1909+1048150468*x^1910-34295154871*x^1911+43795245653*x^1912 \ -4033095400*x^1913+72651409*x^1914+31984617590*x^1915+71930374776*x^1916 \ +54517887941*x^1917+63333532478*x^1918+28984482038*x^1919-3608878013*x^1920 \ +53698106501*x^1921-6222405514*x^1922-7430102368*x^1923+1402958879*x^1924 \ +24008303304*x^1925-26827491519*x^1926-18648926565*x^1927-3823394849*x^1928 \ +5733309563*x^1929-6299547658*x^1930-6962395749*x^1931-40969231686*x^1932 \ -45285051134*x^1933+10564829658*x^1934-30748565479*x^1935+26388805425*x^1936 \ -10363567687*x^1937-2246446609*x^1938+52290201133*x^1939-17786261909*x^1940 \ +17176068018*x^1941+64179974707*x^1942-1578020234*x^1943-2645079212*x^1944 \ +4997898669*x^1945+10466153459*x^1946-27279279576*x^1947+13143215693*x^1948 \ +25305770043*x^1949-7792611978*x^1950-3367810548*x^1951+23045646458*x^1952 \ +2489207763*x^1953-9625209614*x^1954+17800677290*x^1955+26661651216*x^1956 \ +10046368551*x^1957+42990303916*x^1958+25595010235*x^1959+10610259914*x^1960 \ +48515299215*x^1961+18912135820*x^1962-32456695901*x^1963+43323673755*x^1964 \ -21642505920*x^1965-52393990137*x^1966-9367854579*x^1967-10325914747*x^1968 \ -16523379626*x^1969+22693063102*x^1970+20643925200*x^1971-19137060196*x^1972 \ -39466187671*x^1973-22674273729*x^1974-13174940089*x^1975-28945458193*x^1976 \ +21790522131*x^1977+17410100411*x^1978-12046307125*x^1979-1835929094*x^1980 \ +12380357301*x^1981+373817436*x^1982+14048331587*x^1983+20998406345*x^1984 \ -20185931652*x^1985-17385658538*x^1986-6371722529*x^1987-11640878021*x^1988 \ +11243150741*x^1989+19803816827*x^1990+548583054*x^1991+5438200196*x^1992 \ -640602400*x^1993-9126628108*x^1994+4447085824*x^1995-398990035*x^1996 \ -5395080531*x^1997-2441931417*x^1998-1200282319*x^1999-655038612*x^2000 \ +5366597811*x^231+68706406617*x^230+17345409974*x^229-48143185759*x^228 \ +44737410494*x^227-68056841842*x^226-19799043985*x^225-49804885873*x^224 \ +47061365105*x^223-4032111915*x^222-3623332613*x^221-23047211828*x^220 \ -33602755354*x^219-53260548964*x^218+11121679469*x^1001+211391200411*x^1002 \ -121806627697*x^1003-7593859366*x^1004-68089674863*x^1005-93535081213*x^1006 \ -100904889771*x^1007+205151348397*x^1008-26911086523*x^1009+20992481200*x^1010 \ -26975210049*x^1011+9802944823*x^1012-99339217781*x^1013-28676624812*x^1014 \ -106268955620*x^1015-28064424851*x^1016+149985720354*x^1017-10056890284*x^1018 \ -25972392754*x^1019-60442506971*x^1020+24876839939*x^1021-140451184537*x^1022 \ +139436860282*x^1023+102456153010*x^1024+143113275735*x^1025-43874834829*x^1026 \ -120467763129*x^1027+82361748186*x^1028+70759866448*x^1029-132303541720*x^1030 \ +62109348740*x^1031-2307679959*x^1032-43220551985*x^1033-3105105156*x^501 \ -115056774450*x^502+112590551437*x^503+5074319239*x^504-65050446174*x^505 \ +27525467715*x^506+67043788704*x^507+73109872394*x^508+4454612231*x^509 \ -166827879565*x^510+48004509602*x^511+80073196338*x^512+84629877684*x^513 \ +24953136452*x^514-13404546936*x^515-60152470306*x^516+103604258158*x^517 \ +30378727630*x^518+96105639988*x^519+86931170303*x^520+1851307686*x^521 \ -10704467449*x^522+48099516842*x^523+25278865072*x^524-21023665046*x^525 \ -27596977843*x^526+65317392068*x^527+56996468517*x^528-23541114280*x^529 \ -4528634244*x^530-49979244811*x^531-1372409230*x^532+108626443622*x^533 \ +38697103934*x^534+5617360642*x^535-31315823926*x^536+6522344835*x^537 \ -50005336880*x^538-96453605654*x^539+28390028376*x^540+167430623705*x^541 \ -79419733246*x^542-24583477278*x^543+63017279331*x^544-12241800025*x^545 \ -40444796471*x^546-198616484429*x^547-9239010524*x^548+39965042629*x^549 \ -33945600302*x^550-12524550727*x^551+3446319229*x^552-45586186264*x^553 \ +95379898956*x^554-105411519522*x^555+28743671574*x^556-56347937800*x^557 \ +82076691560*x^558-74986185221*x^559-53554425965*x^560-4171382516*x^561 \ +47050272907*x^562-141507918105*x^563-68329670995*x^564-21468094592*x^565 \ -42005013644*x^566+1988928389*x^567+89304325452*x^568+46242523185*x^569 \ -64871208337*x^570-10239983494*x^571-70479561912*x^572+56681858933*x^573 \ +97804124796*x^574+171255081488*x^575-130052127051*x^576-14919774499*x^577 \ +18415158122*x^578-14270012626*x^579-9826133185*x^580+10877406520*x^581 \ -37520045371*x^582+172353597026*x^583+190781179637*x^584+86006600201*x^585 \ -63038348575*x^586+36324085954*x^587+25668119488*x^588-75472073699*x^589 \ +94604145076*x^590+31201682136*x^591-66618040256*x^592-45927957789*x^593 \ -30451201238*x^594+124888776542*x^595+106197365428*x^596-46438347803*x^597 \ -18424519559*x^598+2639003013*x^599-27907496745*x^600-18199794457*x^601 \ -103880772629*x^602+23137884650*x^603-1512635630*x^604-147696867223*x^605 \ +80829019035*x^606-161525424590*x^607-100434984435*x^608+29614936899*x^609 \ -6137679862*x^610+60715360985*x^611+34868225692*x^612-58893614200*x^613 \ -32696951034*x^614+29320270324*x^615-87130316336*x^616+113482677724*x^617 \ -160405479943*x^618-123613848093*x^619+93085583175*x^620+6456833758*x^621 \ +39419082730*x^622+68534416102*x^623-25600393374*x^624+90189542563*x^625 \ +188413710505*x^626+47761747853*x^627+133884897114*x^628+103302592307*x^629 \ +838529232*x^630+99793611131*x^631-30322268075*x^632+111356852748*x^633 \ +43231984135*x^634+110500432225*x^635+84573167353*x^636+437111929*x^637 \ +88828390775*x^638+150357932904*x^639+69321584552*x^640+4998543409*x^641 \ +77507164385*x^642-5551641217*x^643+133533084525*x^644-148039019687*x^645 \ +34184755625*x^646+58913273467*x^647-144075969804*x^648-81457644110*x^649 \ -88064205997*x^650-76970723677*x^651-135555167488*x^652-4963071211*x^653 \ -71129120*x^654-25524718409*x^655+63345713205*x^656+61571118817*x^657 \ -107047528701*x^658-16064516713*x^659-22356065855*x^660-96298139547*x^661 \ +117212160499*x^662+23069062197*x^663+67098662581*x^664+60095764808*x^665 \ +4311023429*x^666-13452349998*x^667+91235201366*x^668-122795422087*x^669 \ -9005240476*x^670-99246025367*x^671+90306081579*x^672-113597846449*x^673 \ -31798545519*x^674-71234065451*x^675+20415132246*x^676+171318088198*x^677 \ +76440873812*x^678+86723386966*x^679+60768372398*x^680+38646393133*x^681 \ +46034963485*x^682+161267463461*x^683-95395669596*x^684+43300902681*x^685 \ +1364577202*x^686+89232456559*x^687+20757990799*x^688+168914572153*x^689 \ -37448321567*x^690-15404071512*x^691-673765572*x^692-22284471241*x^693 \ -45418634390*x^694-51127164178*x^695-54766988245*x^696+23452651883*x^697 \ +82054856051*x^698+28585810080*x^699-128474952409*x^700-66068244980*x^701 \ -62286757834*x^702+10446524482*x^703-23350333885*x^704-49357457852*x^705 \ -20412291318*x^706+72438491276*x^707-9712277514*x^708+99856984639*x^709 \ +12531900104*x^710+15860752484*x^711+92139497336*x^712-22087999262*x^713 \ -189651791840*x^714+431932231*x^715-79802249583*x^716+31582207314*x^717 \ +71827172753*x^718+88606853762*x^719+121148429011*x^720-20480789552*x^721 \ -85506256319*x^722-22747058943*x^723+22272625680*x^724+75106833715*x^725 \ -87815085198*x^726-18573784977*x^727+51790194453*x^728-34926769490*x^729 \ +156368605389*x^730-89883516474*x^731-106204257960*x^732+126409684589*x^733 \ +99590987979*x^734+76044515259*x^735+134493643759*x^736+80505851731*x^737 \ -7948293309*x^738+28390988236*x^739+158320452938*x^740+45025281010*x^741 \ +79496671226*x^742-48239197544*x^743+78128671709*x^744-250719796024*x^745 \ -161889144663*x^746+121290695138*x^747+89224446335*x^748-12017264890*x^749 \ +8836137575*x^750-186287680017*x^751+79370288211*x^752+81231119965*x^753 \ +45969331743*x^754-84293927522*x^755-175094284570*x^756-77777720697*x^757 \ +96346229248*x^758-98800364838*x^759+13503370732*x^760-117936272490*x^761 \ -187387525590*x^762+16390728965*x^763-41826835741*x^764-108395149961*x^765 \ -107880166963*x^766-76149324709*x^767-88276194375*x^768+33191031138*x^769 \ -204617761996*x^770+161285750732*x^771-48140097503*x^772+11077755135*x^773 \ +12757803021*x^774-43152311232*x^775-271935037932*x^776+1831433875*x^777 \ +65100048254*x^778+17917219486*x^779+104345191161*x^780-19736603553*x^781 \ -36421925355*x^782-26813686138*x^783+263563040875*x^784+192297311726*x^785 \ -95972724582*x^786+17848985752*x^787-84432409440*x^788+111804445366*x^789 \ +245846106331*x^790+91609765067*x^791+63679570834*x^792+10523814205*x^793 \ -106441552262*x^794+115586926862*x^795+677538038*x^796+6853856052*x^797 \ -39814859093*x^798+15816033482*x^799+147593524975*x^800-73234648246*x^801 \ -53137394100*x^802+58091667262*x^803+37495621759*x^804-217416974216*x^805 \ -66396397229*x^806-91927898947*x^807+54149805354*x^808-123901425066*x^809 \ -51475545581*x^810-186300013422*x^811-126705120470*x^812-189510422*x^813 \ +11338404677*x^814+6325441981*x^815+91232083427*x^816-133780522659*x^817 \ -86298399414*x^818-44135279153*x^819+76816814544*x^820-138195966434*x^821 \ -75684218038*x^822-126386426657*x^823-44809130231*x^824-83490163212*x^825 \ -34351203484*x^826-41719317981*x^827-120688936869*x^828-14489273602*x^829 \ +106470084813*x^830+41964660903*x^831+33403043858*x^832+151505022397*x^833 \ +87862913140*x^834+120445537076*x^835-98566276077*x^836+4697632177*x^837 \ +44046773581*x^838+73352678462*x^839-11410306650*x^840+22742711623*x^841 \ -51216881846*x^842-147550591892*x^843+26476191234*x^844+193153996499*x^845 \ -35927538398*x^846-6194176598*x^847-221667022042*x^848-14015578041*x^849 \ -5698749713*x^850+26363594400*x^851+14645715378*x^852+48470068979*x^853 \ -138256378354*x^854-132853825554*x^855+57482839352*x^856+34735643796*x^857 \ +86752172547*x^858+60835536589*x^859-63791336423*x^860+23481544832*x^861 \ +378282280*x^862+23239795711*x^863+88713416598*x^864-48468401808*x^865 \ +43928927469*x^866+11773049307*x^867-62470361270*x^868+177145273813*x^869 \ -194358054372*x^870+18849309164*x^871-61004124650*x^872-89154730183*x^873 \ -180073144042*x^874+10857839862*x^875-11488914470*x^876-105388656993*x^877 \ +29610973464*x^878-179112409056*x^879+27490437080*x^880+6130882402*x^881 \ -73717395879*x^882-24727395241*x^883+6427407478*x^884+27774977309*x^885 \ +26171001560*x^886+285300862204*x^887+250920282226*x^888+69247036204*x^889 \ -68353373325*x^890-19660487923*x^891-199313228024*x^892+185922127103*x^893 \ -56927953551*x^894+60519873690*x^895+77728652690*x^896-105603952672*x^897 \ -63339878187*x^898-74519679962*x^899-45764977904*x^900+17864107983*x^901 \ +10133013854*x^902-144667843119*x^903+33769537229*x^904+116016157352*x^905 \ -109345484017*x^906+104654868950*x^907-961106931*x^908+31965621838*x^909 \ -6900915942*x^910+39708679388*x^911+165967464883*x^912-13498312464*x^913"); static const std::string r1_srep_3("\ -167799799320*x^914-131936289889*x^915+89614618044*x^916+85016248695*x^917 \ -79954038780*x^918-209591894768*x^919-71794807620*x^920-23283477500*x^921 \ +12638220555*x^922-95752230735*x^923-116899891043*x^924-101215036532*x^925 \ -119610153404*x^926+54021790022*x^927-21789255788*x^928-260168043271*x^929 \ +34842031670*x^930-47465526644*x^931+79209496048*x^932-162752101811*x^933 \ -175986001160*x^934+48825705322*x^935-136513818801*x^936-52160690022*x^937 \ +72550039192*x^938+94214685087*x^939+198826572346*x^940+57618960407*x^941 \ -89924832368*x^942+15802881411*x^943-62911879311*x^944+32899449993*x^945 \ +126311503110*x^946+78846277994*x^947+141308676066*x^948+70641162803*x^949 \ +5724759068*x^950-49633865841*x^951+95173521056*x^952+161015858353*x^953 \ -29202803241*x^954-12952363057*x^955+133465863039*x^956-87901324933*x^957 \ +69820941995*x^958+3949578988*x^959-8912902751*x^960-227471782047*x^961 \ -4215427616*x^962-36853070177*x^963-115632004639*x^964-137399830344*x^965 \ +37813828221*x^966-134999621522*x^967-81129702306*x^968+2906545160*x^969 \ +183426496219*x^970-58439170144*x^971-77898139208*x^972+27989592415*x^973 \ -114857219664*x^974-45221435974*x^975-39064281171*x^976-144100939667*x^977 \ +96900598155*x^978-9683692867*x^979+32505144597*x^980+75767337062*x^981 \ +1732485201*x^982+94598116663*x^983-104431472515*x^984+45112579763*x^985 \ -8325398155*x^986-25719591452*x^987+137274743203*x^988+63077282203*x^989 \ +49611802496*x^990-56530688200*x^991-187825062699*x^992+63000663541*x^993 \ +60988168565*x^994-38033047686*x^995+130178588597*x^996+38679439189*x^997 \ +32500163168*x^998+252301658883*x^999-2212947761*x^1000+85808058970*x^1034 \ -19483972835*x^1035-41683691103*x^1036+87145067951*x^1037-137328803807*x^1038 \ +73968879794*x^1039+36957534556*x^1040+130660430707*x^1041-166476549509*x^1042 \ +107108386321*x^1043+22690853232*x^1044-107648941612*x^1045-864971871*x^1046 \ -26346541667*x^1047+10871561131*x^1048+97767553492*x^1049-32532248732*x^1050 \ -1904971938*x^1051-103073957349*x^1052+86313670653*x^1053+62536836*x^1054 \ -42832050487*x^1055+121155288006*x^1056+26990131150*x^1057-214613212658*x^1058 \ +105777147715*x^1059+36621520780*x^1060+132811335476*x^1061+103729451809*x^1062 \ -38953804569*x^1063-92616845436*x^1064-16510771977*x^1065+58930939417*x^1066 \ +37085549174*x^1067+24888041169*x^1068-66607238646*x^1069+124192560702*x^1070 \ -68000929614*x^1071+81195252365*x^1072+125144994277*x^1073-237062572076*x^1074 \ +53610096124*x^1075+225331588922*x^1076-17707032826*x^1077-89973693921*x^1078 \ +19974317710*x^1079+102021238351*x^1080-93050149638*x^1081-98539649902*x^1082 \ -94653473795*x^1083-44306474118*x^1084+38414544973*x^1085+135628798013*x^1086 \ -70487053525*x^1087-72092697500*x^1088-192271505385*x^1089-62340659589*x^1090 \ +29834574943*x^1091-22322653140*x^1092-34947157570*x^1093-24287759319*x^1094 \ -47068473067*x^1095+154054328835*x^1096+164245063199*x^1097-51273349848*x^1098 \ -196203282068*x^1099-24096070070*x^1100-99584984772*x^1101+98129847697*x^1102 \ -65702953785*x^1103-10789632775*x^1104+44241978999*x^1105+37558102317*x^1106 \ -9505736359*x^1107-25199280665*x^1108+74235442860*x^1109-54694524996*x^1110 \ +2264402295*x^1111-128996845643*x^1112-71285266617*x^1113+67661071648*x^1114 \ -54492210583*x^1115+22513724859*x^1116+34033473659*x^1117+43758233629*x^1118 \ -41516781021*x^1119-42784639112*x^1120+123644068072*x^1121-14247218617*x^1122 \ +83808200085*x^1123-183298893778*x^1124-46735100971*x^1125-62031928641*x^1126 \ -99474744881*x^1127+17800004552*x^1128+106525151324*x^1129-251246407755*x^1130 \ -25580077568*x^1131-81843377333*x^1132+26788118746*x^1133+19182872780*x^1134 \ -59925937362*x^1135-50058300773*x^1136-101822550837*x^1137+657933280*x^1138 \ +19564861148*x^1139+35046428744*x^1140+2682475585*x^1141-56992102077*x^1142 \ +35860931273*x^1143+203789134219*x^1144-6727336873*x^1145-109903742856*x^1146 \ +47719560439*x^1147+13527975161*x^1148+98260043934*x^1149-58366673275*x^1150 \ -130127164351*x^1151+83455071177*x^1152-68823162825*x^1153-60225615746*x^1154 \ -74042831871*x^1155-12014905342*x^1156+23388731515*x^1157-8626013014*x^1158 \ +21953195679*x^1159-155980220910*x^1160-217972125487*x^1161+89682346870*x^1162 \ -37658668031*x^1163+58027967881*x^1164-90378430633*x^1165-43341202030*x^1166 \ +16523493943*x^1167-18906640960*x^1168+212117365642*x^1169-33986370441*x^1170 \ +45185768856*x^1171+4763319487*x^1172+1371747234*x^1173+148876972098*x^1174 \ +95191837796*x^1175-123809421852*x^1176+79843098120*x^1177-41267372840*x^1178 \ -121155059136*x^1179-65482206391*x^1180-79113584784*x^1181+11116916638*x^1182 \ -92738566955*x^1183+3388410239*x^1184+19005832198*x^1185+66751715230*x^1186 \ -96920966455*x^1187-184353824811*x^1188+29600147939*x^1189-36474471319*x^1190 \ -75094557509*x^1191-55155813058*x^1192-139796362527*x^1193-36990042600*x^1194 \ -149308311610*x^1195 \ "); static const std::string r2_srep_1("\ -12298243395*x^426-33246261919*x^425+14881216216*x^424+100717315398*x^423 \ +32435341799*x^422+11306102069*x^421-42857343048*x^420-23027068074*x^419 \ -121525059139*x^418+41062828633*x^417-9120088623*x^416+38127915034*x^415 \ -53332525642*x^414+10667345234*x^47+20250868505*x^46+28797169308*x^45 \ -43235989359*x^174+38758957270*x^173-29243855534*x^172-46185370245*x^171 \ -47223973616*x^170-10368178271*x^169-10557528292*x^192+37487979771*x^191 \ -16245699850*x^190-55729045478*x^189+36012407938*x^188+72614386131*x^187 \ -15204240841*x^24-8711949900*x^23+14257174071*x^22+56377120052*x^333 \ +14839742003*x^332-38325417931*x^331+54176364398*x^330-53620700530*x^329 \ +17198633981*x^328-15450486288*x^327+15372974977*x^326+5921781285*x^325 \ +81501682291*x^324-66626158040*x^323-20609502025*x^322-109523674165*x^321 \ +56875705806*x^320-23244792061*x^113-19309284277*x^112-38916326672*x^111 \ +44091306530*x^110-34827830974*x^109+32699097269*x^108-72721416508*x^107 \ +17265636833*x^106-36617312032*x^105-41573561571*x^104+12279258834*x^114 \ +82436036606*x^347-31261753091*x^346-44500371183*x^345-125274002688*x^344 \ -31133631871*x^343+128460249050*x^342+100179005762*x^341-114828839354*x^340 \ +108064336275*x^339+90994968967*x^338-44508032271*x^337+85772561126*x^336 \ -14871801916*x^335-21281913217*x^334+17047025764*x^477-26275017578*x^476 \ +101182365586*x^475+88231498193*x^474-59806242426*x^473+113427095614*x^472 \ +116163017856*x^471+53708041635*x^470-154328984869*x^469+56803301458*x^468 \ -35861674205*x^467-88315900409*x^466-33792693422*x^465-132786811376*x^464 \ -109585745531*x^450+37453216778*x^449+2927086149*x^448-59663587909*x^447 \ -99229589433*x^446+22434345521*x^445+3804407873*x^444-22843316212*x^443 \ +15023409723*x^442+79744521756*x^441-89156003460*x^440-62409603681*x^439 \ -22865453841*x^438-62845550343*x^451-10075612299*x^373+90241752514*x^372 \ +3172648684*x^371-64532174127*x^370+72446697772*x^369-44304010100*x^368 \ -94564984737*x^367-19761536748*x^366+26376102015*x^365-158229005056*x^364 \ -62154676691*x^363-40346077174*x^362-33481542412*x^361+13571997673*x^28 \ +8161213787*x^27+1023845397*x^26-16720514075*x^25-2383844588*x^44 \ +8356875255*x^43-26827438588*x^42+44585618338*x^399+37434341256*x^398 \ +48503836694*x^397+64340759602*x^396+70497118845*x^395+58332730505*x^394 \ +37917909552*x^393-17951385993*x^392-72126324042*x^391+83367616252*x^390 \ +54914454358*x^389-80690399086*x^388+3788723413*x^387+6657597500*x^50 \ -27587838729*x^49-11015114987*x^48-62834670333*x^202+14506585098*x^201 \ +6123240614*x^200-23983987723*x^199-8895963188*x^198+74318166429*x^197 \ -59835752920*x^196-29296586194*x^195-28410809765*x^194-57005146105*x^193 \ -58918383547*x^203+10630344160*x^1196-18556978555*x^1197-164043335170*x^1198 \ -87839930075*x^1199+4152300286*x^1200+99517087469*x^1201-73797793712*x^1202 \ -25260491411*x^1203+76114220378*x^1204+40133672638*x^1205-230680916222*x^1206 \ +219293086650*x^1207+3638620539*x^1208-6652308741*x^1209+12775249723*x^1210 \ +3251379936*x^1211-75721519451*x^1212-163406006228*x^1213-165491770209*x^1214 \ +46054734359*x^1215-741970731*x^1216+99721318208*x^1217-48283084345*x^1218 \ -201279475291*x^1219+57418480238*x^1220-134680981668*x^1221+34536313632*x^1222 \ +10430882187*x^1223+70914285740*x^1224-108730001945*x^1225+184561606957*x^1226 \ -50600427283*x^1227+27438909544*x^1228+3869947176*x^1229-99212395993*x^1230 \ -122356266132*x^1231+190721719645*x^1232+10663679376*x^1233+171017341569*x^1234 \ -61192181164*x^1235+100411947630*x^1236-85397438998*x^1237+106275225374*x^1238 \ +3419807107*x^1239+36976923465*x^1240+57882249834*x^1241-107227057330*x^1242 \ -45892223123*x^1243+39898058432*x^1244-25685770417*x^1245-15437084634*x^1246 \ +79678067292*x^1247+53459571441*x^1248-9772387681*x^1249-8634944328*x^1250 \ -103233454566*x^1251+80654434021*x^1252-30348898500*x^1253+31622090094*x^1254 \ -59747674770*x^1255+50418039889*x^1256-131270697937*x^1257+73386317355*x^1258 \ -33268294896*x^1259+220123546149*x^1260-47814110905*x^1261+31648485555*x^1262 \ +50736345265*x^1263+12957979612*x^1264-12352680940*x^1265+8954284112*x^1266 \ +4405063605*x^1267-66479748368*x^1268+98898741778*x^1269+137071640600*x^1270 \ -13677831086*x^1271-32633620324*x^1272+100644420930*x^1273-101006678220*x^1274 \ +57929446438*x^1275-46456850356*x^1276+119383219795*x^1277-68889453480*x^1279 \ +27403268808*x^1278-9452745528*x^500+12505989143*x^499-88746500517*x^498 \ +36522434736*x^497+105148848765*x^496-31099548526*x^495-29920704228*x^494 \ -84722298862*x^493-14005980691*x^492+18668364817*x^491+2284051770*x \ -33852801349*x^437+24746815214*x^436+14725842338*x^435+71589114295*x^434 \ +95344800351*x^433-103870206918*x^432-2292807366*x^431+122702353734*x^430 \ -39127758310*x^429+71141989765*x^428+91775420843*x^427+29584402698*x^281 \ +34879992632*x^280-7929148263*x^279-62511168551*x^278+75173708697*x^277 \ +2210745302*x^276+47365447862*x^275+34770067078*x^274+15629493834*x^273 \ +123387217284*x^272-83879189754*x^271+90474389247*x^270+20723731518*x^269 \ -13648232822*x^268+135048430531*x^360+9779963494*x^359-79763997627*x^358 \ +80167613186*x^357+59427033891*x^356-56617078458*x^355+70792836473*x^354 \ -42721386790*x^353+18854232633*x^352-27799012434*x^351-7540762106*x^350 \ +51000825517*x^349-61789935211*x^348+6364435339*x^21-8596138092*x^20 \ -13862640657*x^19+12972909594*x^18+25640262624*x^168+73106364011*x^167 \ +50996630476*x^166-46522919587*x^165-2318061818*x^164-46439765345*x^163 \ +3018635654*x^162-51033321714*x^161-54420823241*x^160-25754428117*x^159 \ -20957251811*x^158-56979883142*x^157-113069491386*x^156+78310111278*x^155 \ +8791974299*x^41-20484038584*x^39+65329554945*x^186+63604634904*x^185 \ +67548191757*x^184-46287362343*x^183+86853548227*x^182-78112812263*x^181 \ -39054030995*x^180+70082669285*x^179+4991564873*x^178+35132330683*x^177 \ +5220672794*x^176+27538233543*x^175+45604753836*x^463-72517449336*x^462 \ -172648125640*x^461+77371325704*x^460+103318563842*x^459-47970420952*x^458 \ -173692529*x^457-16267041286*x^456-39608578784*x^455-44014507517*x^454 \ -40698179828*x^453+64997452090*x^452-16621185638*x^10-5839518904*x^9 \ +7779380684*x^8+7805287316*x^7-931618705*x^154+77399210009*x^153 \ -12286080400*x^152-15618003169*x^151-44221287122*x^150+44169698801*x^149 \ -77234959789*x^148+19578529715*x^147-2795707215*x^146-11375091988*x^145 \ +21793365806*x^144+31454951276*x^143+6091116508*x^142+7402060559*x^3 \ -15638332394*x^2-16846517099*x^294-6573457577*x^293-36345200919*x^292 \ +104115784551*x^291-32337698003*x^290+17593183564*x^289+90879035663*x^288 \ +124574515327*x^287-2750093470*x^286+74836130434*x^285+28760033840*x^284 \ +76932285409*x^283+70510978158*x^282+2131234223*x^217-47160319189*x^216 \ -4500367537*x^215-10694873972*x^214-13052396086*x^213-119312329735*x^212 \ -12249530649*x^211-58377372451*x^210+61312423521*x^209-62735937652*x^208 \ -18739775224*x^207+19541226826*x^206+52687803759*x^205-48487381888*x^204 \ +49838817064*x^490+103336940622*x^489-114398006939*x^488+40164473234*x^487 \ +22188458973*x^486+102241404959*x^485-132777915090*x^484+77723628319*x^483 \ +29176152754*x^482+116603267994*x^481-14526032223*x^480-45775708833*x^479 \ -267391385*x^478+22100788607*x^17-11428840425*x^16-954947579*x^15 \ +6057723695*x^14+63494717499*x^1364-10349348333*x^1365-11354317920*x^1366 \ +90668431927*x^1367-92110654585*x^1368+231933389918*x^1369+19189606214*x^1370 \ +37836457811*x^1371-41835147412*x^1372-64829306413*x^1373-99539521475*x^1374 \ +14786388671*x^1375+213836900645*x^1376+22624850100*x^1377+4395435896*x^1378 \ -93161939597*x^1379+89789272863*x^1380-63671202085*x^1381-18208723976*x^1382 \ +102193294445*x^1383+42149570567*x^1384-57427709585*x^1385-101096944615*x^1386 \ +62581117784*x^1387-58899807423*x^1388+115177108233*x^1389-19168792202*x^1390 \ +38132618085*x^1391-50907816003*x^1392-23737421785*x^1393-65750929733*x^1394 \ -8568961669*x^1395-37662793882*x^1396+101039333860*x^1397-47341688773*x^1398 \ +9724870415*x^1399-15791202897*x^1400+13843025496*x^1401-128893801207*x^1402 \ -32183995709*x^1403-139023659805*x^1404-42684304557*x^1405-14610977549*x^1406 \ +57122422992*x^1407+128491635951*x^1408+3614885611*x^1409-36404761221*x^1410 \ -112811070097*x^1411+153443879256*x^1412+164794102332*x^1413+134470678635*x^1414 \ -88690316169*x^1415-74374605027*x^1416-90950545612*x^1417-104814317576*x^1418 \ -177228350594*x^1419-11835540964*x^1420+20873445658*x^1421-195114255686*x^1422 \ +87306904630*x^1423+59376189861*x^1424-117251826188*x^1425+57626371798*x^1426 \ +17253066619*x^1427-65717447508*x^1428+38123913202*x^1429+64257781929*x^1430 \ -110886945374*x^1431+70757769597*x^1432+10322610698*x^1433-48134918817*x^1434 \ -56503764527*x^1435+117474984824*x^1436+33765540181*x^1437+107731007106*x^1438 \ +96338855448*x^1439+8934843329*x^1440-30541434613*x^1441+72531211591*x^1442 \ +30197093191*x^1443+72368177095*x^1444-76451969600*x^1445-92672018447*x^1446 \ -1744298703*x^51+26882297486*x^52-18398383509*x^53+3005642217*x^54 \ +3593805670*x^55-21740657388*x^56+6314837654*x^57-14388840020*x^58 \ -48213795147*x^59-11593118081*x^60-1502891403*x^61+37639792348*x^62 \ +4590584128*x^63+62090294921*x^64+31955540056*x^65-8921556943*x^66 \ +21988615968*x^67-23025433031*x^68+38334620159*x^69+19779920702*x^70 \ -16146115882*x^71+18104295332*x^72-20379887728*x^73+28122778533*x^74 \ -22233760331*x^75+2601350324*x^76-23301155844*x^77+27813631959*x^78 \ -37895927213*x^79-2648750595*x^80+24636697824*x^81+17895391597*x^82 \ +8568029391*x^83+36393556404*x^84+17452747156*x^85-49612336092*x^86 \ -10886997637*x^87-11130667420*x^88+29158789170*x^89-5400236199*x^90 \ +77812065577*x^91-49643768511*x^92-13107221267*x^93-52311659384*x^94 \ +34469782323*x^95-35571894501*x^96+53972502564*x^97+30760824828*x^98 \ +100388019377*x^99+97252215701*x^386-116099602858*x^385+76103387516*x^384 \ -11150909008*x^383-43760747755*x^382+30435548717*x^381+105763654230*x^380 \ +62286795532*x^379+76050666216*x^378+37247029295*x^377+2903246935*x^376 \ +17740821225*x^375-67645627457*x^374+1068927231*x^40-21411907744*x^38 \ +30329881614*x^37-30031713761*x^36+18856879565*x^35+28958849017*x^308 \ -11122674865*x^307+16515984422*x^306-44335554221*x^305+54476123312*x^304 \ -20904234081*x^303+61391311771*x^302-16775061346*x^301+3210400498*x^300 \ +56658482015*x^299-105337656712*x^298+33759085293*x^297+61939776273*x^296 \ -41177733805*x^295-59566196142*x^141+18476269572*x^140-23088141060*x^139 \ -11801865656*x^138+30847010853*x^137+21929475729*x^136+31313930007*x^135 \ -2990246614*x^134-14929686587*x^133+38476911951*x^132-46205516843*x^131 \ -13904775963*x^130+10524952653*x^129+40066745986*x^128+1970323384*x^244 \ +1446777973*x^243+2391572443*x^242-89493321216*x^241+39101186256*x^240 \ +98222226415*x^239-9239552468*x^238+5916325669*x^237+36005795144*x^236 \ +45537168101*x^235-40607567937*x^234-3750879706*x^233+57951296798*x^232 \ -7755123318*x^413-37469436811*x^412+70016616413*x^411-42829701116*x^410 \ -40550876166*x^409-36147696900*x^408+65981234023*x^407-122609177512*x^406 \ -32890978471*x^405+89421010177*x^404+24395518617*x^403+97415643004*x^402 \ -61366468342*x^401-68686837546*x^400-24197772525*x^100-55496272864*x^267 \ +11842466716*x^266+11739104212*x^265+45395994939*x^264-2462010012*x^263 \ -46901504750*x^262+2194886178*x^261-43818646770*x^260-64456303482*x^259 \ -42678178437*x^258+16930473337*x^257-79111479558*x^256+55486339504*x^255 \ -6531034828*x^34+27035707153*x^33-29177734926*x^32-102519500337*x^127 \ -25120666485*x^126-30579535492*x^125+9392730819*x^124-19261680565*x^123 \ +9092366703*x^122-13808837057*x^121-10767506476*x^120+9387090911*x^119 \ +5861529627*x^118+30570618150*x^117+9821369125*x^116+27953902351*x^115 \ +25585821707*x^102-9147523101*x^101-43069458046*x^103-77197009243*x^254 \ +41768972254*x^253-51107733143*x^252+2179732347*x^251-73246837376*x^250 \ -76028238883*x^249-15944993585*x^248-122980270638*x^247+29301117006*x^246 \ -10775309722*x^245+18396353043*x^13-16862760430*x^12+15452547818*x^11 \ -10527226187*x^319+101533968365*x^318+45962612479*x^317-40854272816*x^316 \ +29357583774*x^315-98334493728*x^314-26844181578*x^313+152535370585*x^312 \ -48558849904*x^311-65465771182*x^310+48084068810*x^309-798955677*x^31 \ +35715352173*x^30-41114886366*x^29-10576978086*x^6-11825376542*x^5 \ +7286512470*x^4+18388806457*x^1280+161794076352*x^1281-28337710306*x^1282 \ -17255976845*x^1283-76008915764*x^1284+55400148387*x^1285-60639021891*x^1286 \ -101066145720*x^1287-123972185159*x^1288+87115039832*x^1289-155574783014*x^1290 \ +23730856463*x^1291+309102172*x^1292-106791492726*x^1293-237381096018*x^1294 \ +28548371390*x^1295-330246556*x^1296-29689811838*x^1297-189254819970*x^1298 \ -30865123604*x^1299-44582502556*x^1300-111505655799*x^1301-44557592539*x^1302 \ +53733507680*x^1303+20819197021*x^1304+1395361755*x^1305-49184624216*x^1306 \ -40903280869*x^1307-93317035741*x^1308-28525136465*x^1309+46815641959*x^1310 \ -37147646401*x^1311-171269226982*x^1312+55545463284*x^1313+26432914392*x^1314 \ +63358274704*x^1315-21229429338*x^1316-128600950288*x^1317-42113338606*x^1318 \ -140824193885*x^1319-2326798220*x^1320+64192104658*x^1321-51630561209*x^1322 \ -49498217773*x^1323-90416752098*x^1324+83991720563*x^1325+150608820483*x^1326 \ +65119613397*x^1327+20967841540*x^1328-95934246964*x^1329-177636442910*x^1330 \ -104683025381*x^1331+46752411240*x^1332-71028555511*x^1333-80536733392*x^1334 \ -60889544079*x^1335-22450515462*x^1336-61149950566*x^1337-23445736673*x^1338 \ -50742295044*x^1339+41001013374*x^1340+94763809142*x^1341+77883336357*x^1342 \ -53873424849*x^1343-85586877816*x^1344+147245896720*x^1345+103273157293*x^1346 \ +49487544766*x^1347-129528420075*x^1348-61945581330*x^1349-76408360080*x^1350 \ +84312569941*x^1351+3005072928*x^1352+21564682198*x^1353-99865781821*x^1354 \ -96904486038*x^1355-67290910420*x^1356+121809010991*x^1357-201280052*x^1358 \ -25659166014*x^1359-7854234250*x^1360+83496185253*x^1361-156457302131*x^1363 \ -130043471771*x^1362-116623034666*x^1447+63340754284*x^1448+29056858824*x^1449 \ -14463741969*x^1450+101462718016*x^1451-69374438503*x^1452-104332978401*x^1453 \ +14930947674*x^1454+32883271359*x^1455+37930611868*x^1456-16920913941*x^1457 \ -80230082425*x^1458+46610161083*x^1459+19972507802*x^1460-59510262751*x^1461 \ +10916713060*x^1462+57866464903*x^1463-10394342923*x^1464-90970881156*x^1465 \ +37858629616*x^1466-106679590218*x^1467-24913741790*x^1468+109967614373*x^1469 \ +48890249817*x^1470+1848149679*x^1471-98549032445*x^1472+60720768502*x^1473 \ +137842172780*x^1474+5243491906*x^1475-59750299327*x^1476+45228722812*x^1477 \ +27935880244*x^1478+80537672690*x^1479-20295991643*x^1480-87845315347*x^1481 \ +50218956865*x^1482-38373564442*x^1483-20957663060*x^1484+27711035106*x^1485 \ +95016265056*x^1486+55710516985*x^1487+82619750454*x^1488+110859243542*x^1489 \ +53435806482*x^1490-133528838222*x^1491+158330827120*x^1492-97083117015*x^1493 \ +111387362388*x^1494+85479818296*x^1495-10482105703*x^1496-2572665530*x^1497 \ +133068208484*x^1498+4146821725*x^1499+68330996935*x^1500-28065751920*x^1501 \ +15974361469*x^1502-85929799702*x^1503-28686472019*x^1504+148667781296*x^1505 \ -10084131821*x^1506-94793837277*x^1507-84791761144*x^1508-63678878999*x^1509 \ +39694015413*x^1510+446659189*x^1511+95377871547*x^1512+9666212199*x^1513 \ +161795671654*x^1514-91000484021*x^1515+145579875230*x^1516+81265093794*x^1517 \ -998831496*x^1518-128803139300*x^1519+52770776790*x^1520-146403349418*x^1521 \ +32587886089*x^1522-75251805801*x^1523+166805166779*x^1524-57035303250*x^1525 \ +57521577337*x^1526+21285234901*x^1527+3027584246*x^1528+105899112243*x^1529 \ +14781758392*x^1530-22683394179*x^1531-25210689640*x^1532+99935945643*x^1533 \ -84021930147*x^1534+42259497554*x^1535+45907068922*x^1536+84279071229*x^1537 \ -29539017121*x^1538+45338942887*x^1539-24806480906*x^1540+87977283203*x^1541 \ +62516484079*x^1542+159450661656*x^1543-23655833088*x^1544-44112269864*x^1545 \ +10606111566*x^1546-8499088313*x^1547+96101127142*x^1548-89377300943*x^1549 \ -59851591087*x^1550-56214120248*x^1551-157507855204*x^1552-62249119108*x^1553 \ -85445577597*x^1554-4401721329*x^1555-101536174643*x^1556-58119121629*x^1557 \ -114925796667*x^1558+48574709630*x^1559-34280314464*x^1560+14766752770*x^1561 \ -30236783234*x^1562-14509377591*x^1563-209749274080*x^1564-37393636602*x^1565 \ -59883917907*x^1566+90592372530*x^1567-125327647858*x^1568-144372630004*x^1569 \ +17757782785*x^1570+32530054069*x^1571-103160474054*x^1572+27004259534*x^1573 \ +36592332602*x^1574-49900527049*x^1575+109450983286*x^1576+87454580007*x^1577 \ -22429929394*x^1578-90955942668*x^1579-52085998619*x^1580+7542444291*x^1581 \ -129095640958*x^1582-116117273631*x^1583-15362293016*x^1584-75422573875*x^1585 \ +104080240756*x^1586+29567135838*x^1587-85533231646*x^1588-14007407713*x^1589"); static const std::string r2_srep_2("\ -72167537141*x^1590+15578436550*x^1591+37099609795*x^1592+5366651746*x^1593 \ -80006924851*x^1594+21429342288*x^1595+30269096496*x^1596-56303168087*x^1597 \ -32192045909*x^1598-24090181314*x^1599-91201040971*x^1600-90424483245*x^1601 \ -41789191466*x^1602+48796472891*x^1603+6667317240*x^1604-20054404612*x^1605 \ +90717205115*x^1606-45574268144*x^1607+96577965375*x^1608-84937868700*x^1609 \ +15254114769*x^1610-85324218128*x^1611-36100598429*x^1612+59140120545*x^1613 \ +28348387068*x^1614-25936772983*x^1615+14152778910*x^1616+93013422289*x^1617 \ +5325703012*x^1618+5299012928*x^1619-114456880810*x^1620+24631873118*x^1621 \ +71187736583*x^1622+44454005446*x^1623-65564007677*x^1624-18686868545*x^1625 \ -38320190467*x^1626-11068635951*x^1627+38623912436*x^1628+128145741026*x^1629 \ -47444447640*x^1630-69911372525*x^1631+73982054085*x^1632+67625321661*x^1633 \ -43780921866*x^1634+42499209425*x^1635+112438203531*x^1636-29637261064*x^1637 \ +29717059942*x^1638+73064218527*x^1639+78354730927*x^1640-23583391619*x^1641 \ +51406219011*x^1642-49806860311*x^1643-22338703465*x^1644-37561475541*x^1645 \ +87296115958*x^1646-25055231815*x^1647-26132634595*x^1648+51665990532*x^1649 \ -172652705651*x^1650-104663637871*x^1651+11737785837*x^1652+47284031389*x^1653 \ -125440895392*x^1654-42350923347*x^1655+22245934791*x^1656+50062160311*x^1657 \ +26993180274*x^1658+93916764416*x^1659+17723933407*x^1660-7709629970*x^1661 \ -10925189482*x^1662-87095313733*x^1663-24424934930*x^1664+138103101710*x^1665 \ +9725815469*x^1666-95975878178*x^1667+111443666516*x^1668-96028904366*x^1669 \ -61862950969*x^1670+20517212289*x^1671+85165260123*x^1672-168755515234*x^1673 \ -45383540058*x^1674-14246010186*x^1675+5321412602*x^1676-97837120785*x^1677 \ +63051474234*x^1678-11622330015*x^1679-6813440517*x^1680-158000336988*x^1681 \ -61045444490*x^1682-16113615735*x^1683+42790018648*x^1684-55289921194*x^1685 \ -55354435735*x^1686+7663298003*x^1687-75007919562*x^1688+155177776611*x^1689 \ +58476171975*x^1690+2632834366*x^1691+18899732593*x^1692+26511602610*x^1693 \ +105064498377*x^1694+61127828457*x^1695+6326945505-959052659*x^1696 \ -73433944554*x^1697+17547912794*x^1698-54354897407*x^1699-58838742934*x^1700 \ +94679918763*x^1701+42039556955*x^1702-130770900613*x^1703-54147770285*x^1704 \ +31508315675*x^1705+18763864996*x^1706-22723355698*x^1707+23015897095*x^1708 \ -73252327021*x^1709-66778379186*x^1710-33519375139*x^1711+8936095442*x^1712 \ -54146328075*x^1713+3330235304*x^1714-19390098322*x^1715+48324815570*x^1716 \ -22141912841*x^1717-37722070562*x^1718+26839695493*x^1719+76090925762*x^1720 \ +88225567190*x^1721+47256653156*x^1722+30627370862*x^1723-63714216871*x^1724 \ -18205624350*x^1725+59802680427*x^1726+53057549555*x^1727+14174441194*x^1728 \ +75765825464*x^1729+32963108753*x^1730-12499134875*x^1731+27273333256*x^1732 \ +9234764883*x^1733-22990113287*x^1734-30534003983*x^1735+5390988324*x^1736 \ +51965774003*x^1737+36123492542*x^1738+23495532313*x^1739+24538679309*x^1740 \ +48466824303*x^1741+25810926063*x^1742-12309341239*x^1743+71863273789*x^1744 \ +27521706644*x^1745+51703817418*x^1746+31047946433*x^1747-17225947158*x^1748 \ +113616875883*x^1749+48119672693*x^1750+32640697894*x^1751+5838339810*x^1752 \ +35494583363*x^1753+35996883701*x^1754+64454412007*x^1755+67672887170*x^1756 \ +24852637977*x^1757+39599198948*x^1758+100612424867*x^1759+61066112206*x^1760 \ -47730662897*x^1761-75220323201*x^1762-7637941778*x^1763-13208589131*x^1764 \ +55098518018*x^1765+102817175067*x^1766-46374680712*x^1767+7922233525*x^1768 \ +12354251760*x^1769-17497361436*x^1770-59990480700*x^1771-2475917864*x^1772 \ -53137166580*x^1773-65697709393*x^1774+8377278120*x^1775-39634303915*x^1776 \ +27494498566*x^1777-6623951999*x^1778-2860049814*x^1779+45174937843*x^1780 \ +19218150182*x^1781+31009745617*x^1782-57914680622*x^1783-93027860213*x^1784 \ -32466824482*x^1785-87664162092*x^1786-40426743792*x^1787+22191823745*x^1788 \ -4385019263*x^1789+40619736886*x^1790-59537851776*x^1791+29407007656*x^1792 \ +25083658856*x^1793+16109214404*x^1794-2628597691*x^1795+90593408292*x^1796 \ +73529865188*x^1797+69070203891*x^1798-22715686937*x^1799-47275795580*x^1800 \ +24349081011*x^1801+37519310529*x^1802-30466082586*x^1803+16849925300*x^1804 \ +52411382847*x^1805-49758979601*x^1806+15679528686*x^1807+76574645775*x^1808 \ +46732065431*x^1809-67248446805*x^1810-41574164595*x^1811-45948531070*x^1812 \ -91525781500*x^1813-98636828248*x^1814-62341009634*x^1815-106737947357*x^1816 \ +5944715919*x^1817+27959962466*x^1818-18281456838*x^1819+43419080798*x^1820 \ +8238895067*x^1821+57794363933*x^1822-3885695019*x^1823-16620769333*x^1824 \ +20617426129*x^1825+31772378717*x^1826-77659311932*x^1827-2614944050*x^1828 \ -53541082178*x^1829+47415264521*x^1830+19297049465*x^1831-50744052035*x^1832 \ -14699341644*x^1833-20185897392*x^1834+11304473461*x^1835-8417793205*x^1836 \ +42208138630*x^1837+40010050281*x^1838+8580892377*x^1839+744941642*x^1840 \ +13372194202*x^1841+14518343301*x^1842-12610498299*x^1843-19180304452*x^1844 \ +25853574415*x^1845-39663241273*x^1846-51735769060*x^1847+28701486795*x^1848 \ +34631767452*x^1849+30665603097*x^1850-31737130343*x^1851-11359635277*x^1852 \ -53356680586*x^1853+34804124525*x^1854-29905007001*x^1855-16020507432*x^1856 \ -11717124778*x^1857+34454112900*x^1858-29236460046*x^1859-27386914094*x^1860 \ +48525768547*x^1861+28213658802*x^1862+8947787875*x^1863+57150247624*x^1864 \ +8348708750*x^1865+8808792586*x^1866+25213586793*x^1867+56635111548*x^1868 \ -9337443075*x^1869+21165923060*x^1870+18588461938*x^1871+30858411086*x^1872 \ +3419917365*x^1873+77549765533*x^1874-7998236281*x^1875-19374386693*x^1876 \ -35418234974*x^1877+38577714149*x^1878+15358209695*x^1879+34405664552*x^1880 \ +4306560036*x^1881-60158002*x^1882-22204346895*x^1883+9575772188*x^1884 \ +38275674214*x^1885+76935802774*x^1886-8688725759*x^1887+4641950168*x^1888 \ +26752524534*x^1889+11976777389*x^1890+47203277801*x^1891+34427926908*x^1892 \ -10684178562*x^1893+11127497799*x^1894+42062545265*x^1895-53825407401*x^1896 \ +4989669095*x^1897+55453648034*x^1898+20983145705*x^1899-14958562665*x^1900 \ +8355251080*x^1901+24031795321*x^1902-29739158452*x^1903+21980289986*x^1904 \ -17205919827*x^1905+7346027701*x^1906+11569319363*x^1907+13614834645*x^1908 \ -35975188961*x^1909+46603311768*x^1910+30120456597*x^1911-8478220385*x^1912 \ -56827863625*x^1913+30296155243*x^1914-36287579039*x^1915-24672161998*x^1916 \ +24469720179*x^1917-35478863962*x^1918-54234895242*x^1919-66565864759*x^1920 \ -40947685264*x^1921-19971682562*x^1922+2385658644*x^1923-29296192350*x^1924 \ +1423940493*x^1925-10597630015*x^1926-20525914191*x^1927+2929730657*x^1928 \ +16463714177*x^1929+12681038897*x^1930-19145947289*x^1931-13466142524*x^1932 \ -20222110298*x^1933-19251726839*x^1934-37002885076*x^1935-7802339043*x^1936 \ -47523780291*x^1937+8321382372*x^1938+13992616571*x^1939+26068955056*x^1940 \ -8086679459*x^1941+286270153*x^1942-2705340674*x^1943+255535813*x^1944 \ -34493130463*x^1945-8359391510*x^1946+32075412687*x^1947+3157786517*x^1948 \ -5134583707*x^1949+20294329376*x^1950-5719300052*x^1951-3610361046*x^1952 \ +19714585416*x^1953+31029310975*x^1954+6525668645*x^1955-17551589763*x^1956 \ +6326740399*x^1957+4078698282*x^1958-19314799201*x^1959-3581682397*x^1960 \ -18696461472*x^1961-45787235498*x^1962-39343868284*x^1963-25552626240*x^1964 \ -47676215824*x^1965-6535189504*x^1966-20440671693*x^1967-27850667563*x^1968 \ -2284895619*x^1969+12350652323*x^1970+10616601145*x^1971+34114023739*x^1972 \ +31816702425*x^1973+26974067096*x^1974+29215489795*x^1975+23576334729*x^1976 \ +34095198361*x^1977+21863597299*x^1978+23856960019*x^1979+25344212108*x^1980 \ +15345894525*x^1981+2452061679*x^1982-7870355413*x^1983-19430775349*x^1984 \ -11433900994*x^1985-14519775288*x^1986-12549755734*x^1987+1850026837*x^1988 \ -7355516784*x^1989-5810824702*x^1990+512283203*x^1991-246928108*x^1992 \ +2728608*x^1993-1528915243*x^1994-3274467887*x^1995+111483392*x^1996 \ +204389413*x^1997-1867708432*x^1998+274767516*x^1999-407080161*x^2000 \ +9253740790*x^231+13104137650*x^230+34300405699*x^229-8555184450*x^228 \ +43336832551*x^227-56284596497*x^226-25147990866*x^225+60729543880*x^224 \ -33106841378*x^223+6879339359*x^222+66221993617*x^221+78495102233*x^220 \ +59060525921*x^219-45581015054*x^218-32695677520*x^1001+5858837086*x^1002 \ +11101676909*x^1003+54178409615*x^1004-102677317737*x^1005+49344188139*x^1006 \ -51959708001*x^1007+105417515933*x^1008+46478254597*x^1009+128535749044*x^1010 \ -94364594821*x^1011+33413669637*x^1012-45620718356*x^1013-100703155988*x^1014 \ +182697936406*x^1015-4328691289*x^1016-10572913320*x^1017+140226913701*x^1018 \ +53616253797*x^1019+20429764848*x^1020-12296179015*x^1021-28995067707*x^1022 \ +60058804070*x^1023+946107762*x^1024-123343657863*x^1025-119844451014*x^1026 \ -25586132061*x^1027+228044249670*x^1028-78424973402*x^1029+15544042868*x^1030 \ -156169819256*x^1031+133624252178*x^1032+134097573058*x^1033+10968367799*x^501 \ -18881216863*x^502+33402630296*x^503+76127322783*x^504+159555881935*x^505 \ -49965731760*x^506+115209281005*x^507-76077580384*x^508-78116158821*x^509 \ +117550323107*x^510+26979777455*x^511-155912045504*x^512+103479368669*x^513 \ +57621022564*x^514-13401704476*x^515+45474459041*x^516-96550433410*x^517 \ -33742521550*x^518-151057690994*x^519-56249009463*x^520-18145952124*x^521 \ -34496211522*x^522-37529073802*x^523-60399419461*x^524+76579518486*x^525 \ +9508878552*x^526-135885189822*x^527+46048035428*x^528-30487445718*x^529 \ -109948921884*x^530+70391869697*x^531-98966950587*x^532-44645403425*x^533 \ +5885105007*x^534-70206621840*x^535+132109982423*x^536+5785503183*x^537 \ +43805605951*x^538-212103940095*x^539+2924498758*x^540-35677811233*x^541 \ +95766897237*x^542+77061233199*x^543+150823590075*x^544+51669758591*x^545 \ +16098118870*x^546+62776931078*x^547+37921177915*x^548-72391602956*x^549 \ +103759653977*x^550+118007269422*x^551+74135478514*x^552+37851770609*x^553 \ -27151771323*x^554+135262774533*x^555-148721705333*x^556-57897207026*x^557 \ +213375944794*x^558+2012721198*x^559-180168011470*x^560-208947464842*x^561 \ +5976005785*x^562-122773099578*x^563-66719865278*x^564-44726841245*x^565 \ +48311917869*x^566-183072526346*x^567+76608052065*x^568-103253918977*x^569 \ -105765112928*x^570-109313878463*x^571-83146150392*x^572-79800305957*x^573 \ +12469814261*x^574-57834727129*x^575+31234388882*x^576-29973254616*x^577 \ -27479417998*x^578+85884874224*x^579-149843470993*x^580+139085218821*x^581 \ +36488567498*x^582-140867295982*x^583-81036140847*x^584-14734953476*x^585 \ +68113949406*x^586+76145793396*x^587+44037201888*x^588-58467597905*x^589 \ +57456355271*x^590-46396703755*x^591+218686220932*x^592-103656661497*x^593 \ +27260907290*x^594-74244694267*x^595+75519577923*x^596-31958208950*x^597 \ +56019215687*x^598-17061668425*x^599+105139109203*x^600+77415602565*x^601 \ -108954493245*x^602+85140330302*x^603-79572683246*x^604+114764444877*x^605 \ -45484289011*x^606-91760986422*x^607-94315977182*x^608+878602400*x^609 \ +16704751100*x^610-45166613346*x^611-79452542049*x^612-64363757544*x^613 \ -82091593450*x^614-66991607227*x^615-33107406460*x^616-84308321740*x^617 \ +41248072469*x^618+151606030721*x^619-20963307199*x^620-76780636743*x^621 \ -60506307359*x^622-65639868144*x^623+77307497014*x^624-120629395172*x^625 \ -58920551146*x^626-72152119854*x^627-13784023413*x^628-29723302902*x^629 \ -59103450945*x^630-42263718431*x^631+90530664298*x^632+2162738628*x^633 \ -58826755300*x^634-28237680670*x^635-104924312614*x^636+100208929059*x^637 \ -70312120136*x^638+77455696272*x^639-63510025164*x^640+13962573264*x^641 \ +51758925013*x^642-19656476291*x^643-90116387134*x^644+41548179409*x^645 \ +167043690167*x^646-13106079927*x^647-12639563298*x^648-31532919796*x^649 \ -81943547371*x^650+2659468451*x^651-72797097105*x^652-17552611729*x^653 \ -68871406970*x^654-78926317536*x^655-51871988682*x^656+10073360063*x^657 \ +117133535357*x^658-39610605270*x^659-124819309047*x^660+186332751132*x^661 \ -5951967439*x^662-48169310072*x^663+20768672093*x^664-91409373144*x^665 \ +19524139200*x^666+127619304757*x^667-98128438655*x^668-4904617268*x^669 \ -57989017792*x^670+73729690684*x^671+89333834959*x^672+99716011285*x^673 \ +103503472300*x^674-84453399907*x^675+8258389068*x^676-9450340905*x^677 \ +7822296540*x^678-78821470413*x^679-83133235896*x^680-80330275908*x^681 \ +22914959031*x^682-152091289333*x^683-36005600658*x^684+127080114963*x^685 \ -68043079905*x^686+49836751263*x^687-51469985682*x^688-6616590590*x^689 \ -69655808220*x^690+115173723007*x^691-45634640258*x^692-21385988093*x^693 \ -300962360849*x^694+58893380816*x^695+62393657508*x^696+48036552547*x^697 \ -134579469584*x^698+140621673048*x^699+7912276958*x^700-21132961576*x^701 \ +65127930334*x^702+131378452178*x^703-15011857309*x^704+30180971097*x^705 \ -80521071636*x^706-11613585664*x^707+7782812135*x^708-19836259198*x^709 \ +76867406939*x^710-192663376*x^711+115884985152*x^712-200807422928*x^713 \ +24839446685*x^714+118564095011*x^715-16582885964*x^716+8953308047*x^717 \ +2612524258*x^718+75668312401*x^719-103182809527*x^720+51780158587*x^721 \ +161189143724*x^722-16275946972*x^723-181335131597*x^724-182505534903*x^725 \ +59091110661*x^726-64607113177*x^727-2296140395*x^728-68790652631*x^729 \ -103730693290*x^730-207388846791*x^731-14552975373*x^732-62805658879*x^733 \ +18781202924*x^734-128986271973*x^735+31639320741*x^736-83104477502*x^737 \ -9885651183*x^738+137707546857*x^739+97735595675*x^740+112807494432*x^741 \ +68402438627*x^742+35895157342*x^743+12428002821*x^744-72588844028*x^745 \ -79799800966*x^746+42629111745*x^747+195740197570*x^748-39606216107*x^749 \ +13892037724*x^750-3213907310*x^751+143251925064*x^752+83337773036*x^753 \ +55289116209*x^754+111071736278*x^755+47114731432*x^756+46017675542*x^757 \ +106534303190*x^758+65005886163*x^759-75480068719*x^760-32231292099*x^761 \ -187585046063*x^762+106574561203*x^763-46410997680*x^764+132837442879*x^765 \ +78280061721*x^766+7680405380*x^767-42516357685*x^768+128713753555*x^769 \ -9029278097*x^770+47246046167*x^771+187701638909*x^772+19911051190*x^773 \ -30984914944*x^774-2484314352*x^775+7170418460*x^776-1284643600*x^777 \ +89116539289*x^778-20001530400*x^779-90466507480*x^780-74012539600*x^781 \ +57274308958*x^782-24727523350*x^783+128683569525*x^784-103054717034*x^785 \ -142511386724*x^786+73690538474*x^787-89229469699*x^788-74963796774*x^789 \ +71970802266*x^790+133757287893*x^791+187098918939*x^792+132291921645*x^793 \ +107833456866*x^794+64137348734*x^795-45340423408*x^796-20368785860*x^797 \ -35482501796*x^798+104548164657*x^799-225828818492*x^800+83058094351*x^801 \ +197238886430*x^802+71570704333*x^803-14855122348*x^804-11330859909*x^805 \ +73194349886*x^806-85465641976*x^807+195052602572*x^808+181032739569*x^809 \ +15148060162*x^810-148378949751*x^811+51042083256*x^812-69786758*x^813 \ +97712314954*x^814-101202436100*x^815-98106306738*x^816-80219160719*x^817 \ -46257669081*x^818-168779267268*x^819+151005793010*x^820+97144323363*x^821 \ +6301125373*x^822-127837257500*x^823+40902091406*x^824-101906053776*x^825 \ -23279213783*x^826-73850280596*x^827+21474507157*x^828-3710280111*x^829 \ +125929627807*x^830-65005088220*x^831+112378373235*x^832-130261726208*x^833 \ -103928057603*x^834+88732873688*x^835+123408542087*x^836-113183605499*x^837 \ -72717691074*x^838+78681040025*x^839+73703419129*x^840+127758960193*x^841 \ +17259409183*x^842-17726090931*x^843+162215334739*x^844-51931981106*x^845 \ -104999647147*x^846-38897884082*x^847+11139645386*x^848+117700946259*x^849 \ +109990176394*x^850-71799635745*x^851-459245032*x^852-69367307377*x^853 \ -2027522216*x^854-7461919795*x^855+129571738032*x^856+95090476040*x^857 \ -95589373455*x^858+144520675739*x^859+8580136460*x^860-76481988297*x^861 \ -80888061958*x^862+175337057530*x^863+39161149387*x^864+46724848451*x^865 \ -25067481720*x^866+109073193366*x^867-20110082142*x^868-2065440519*x^869 \ +196039832496*x^870+51287378325*x^871+226840092695*x^872-85044341352*x^873 \ +36582038212*x^874+22454235962*x^875-37614234565*x^876-12154781489*x^877 \ -92525662835*x^878+43210605729*x^879-29503086808*x^880+47536718905*x^881 \ -119488430617*x^882+41802893764*x^883-36749803555*x^884+96596043730*x^885 \ +46051300012*x^886+90602974436*x^887-53608972981*x^888-5306460651*x^889 \ +98749285110*x^890+131701203007*x^891+25773458094*x^892-46977988482*x^893 \ +6670499818*x^894-68968602211*x^895+21468836009*x^896-70795434629*x^897 \ -151229340489*x^898-79365642073*x^899+89379856502*x^900+180727114848*x^901 \ +19745037556*x^902+20006492259*x^903-68966001684*x^904+130265998317*x^905 \ -117371414201*x^906-7030328681*x^907-56677471592*x^908+19528257927*x^909 \ +44475269947*x^910+3470169206*x^911+22467959607*x^912+98656618915*x^913"); static const std::string r2_srep_3("\ -13743860146*x^914+23552943848*x^915-138242276800*x^916-88277644417*x^917 \ +47255373796*x^918-31977886816*x^919-115363640056*x^920+25243901225*x^921 \ -105295249154*x^922-36136467784*x^923+52453236830*x^924+80777038439*x^925 \ +44837049142*x^926-55254888309*x^927-68234489848*x^928-92165707190*x^929 \ -179410896808*x^930-6303111717*x^931-80199610328*x^932-15380092970*x^933 \ -33938724551*x^934+17931510779*x^935-96931631295*x^936-48687303542*x^937 \ -19820879797*x^938+37877911542*x^939-143694146707*x^940+113317058619*x^941 \ +20429285363*x^942-171716251844*x^943-84741152883*x^944-40418477950*x^945 \ +78524492177*x^946+22451226106*x^947-92140592429*x^948-224175995509*x^949 \ -94751427805*x^950-40689590157*x^951-160025438504*x^952+101043700206*x^953 \ +174023744486*x^954-42827761752*x^955-14794443421*x^956+243752790124*x^957 \ +61496900473*x^958-36377552247*x^959-58121282080*x^960+144994090046*x^961 \ +92486830236*x^962-149072168741*x^963+50911986581*x^964+63775356240*x^965 \ +97687261817*x^966-46280177159*x^967-7688043430*x^968-39472067128*x^969 \ +73201769053*x^970-58880360399*x^971+170840419458*x^972-54292746092*x^973 \ -103821886252*x^974-83322943096*x^975+76066200343*x^976+165315085358*x^977 \ +5424131554*x^978-67459706942*x^979+159323933212*x^980-107491571445*x^981 \ -55118253633*x^982-17278583408*x^983+19225845993*x^984-114988147351*x^985 \ -79315655096*x^986+11088007172*x^987-60859418995*x^988-145858383656*x^989 \ +113692045711*x^990-75018497310*x^991-365437868380*x^992+35092192414*x^993 \ -110082408015*x^994+51647441793*x^995-184568312640*x^996+99653476797*x^997 \ +38507247220*x^998+123929024786*x^999+172382798537*x^1000-15653697225*x^1034 \ -40712974939*x^1035-84481983259*x^1036-183059486597*x^1037+306329739993*x^1038 \ -86809010253*x^1039-193596563569*x^1040+77147957893*x^1041+71846054998*x^1042 \ -37049094394*x^1043-44803582029*x^1044+15081867854*x^1045-216710094742*x^1046 \ -47796798084*x^1047-96211690279*x^1048-189635981392*x^1049-88214456018*x^1050 \ +63138650430*x^1051-141086932675*x^1052+179045473644*x^1053+152961766238*x^1054 \ +42049851016*x^1055-12923309793*x^1056+77822981644*x^1057+49606124226*x^1058 \ +64949849127*x^1059+139832839733*x^1060-79078674035*x^1061-63872053437*x^1062 \ +5880968210*x^1063+77059684059*x^1064+118861193169*x^1065-67361913998*x^1066 \ -170366309445*x^1067-34162286067*x^1068-69460395006*x^1069+97779302218*x^1070 \ +216724014279*x^1071+58118563580*x^1072-206554378418*x^1073+3910530696*x^1074 \ +9692241373*x^1075+250051138068*x^1076-24386215253*x^1077-109899509519*x^1078 \ -3113733500*x^1079+71737845657*x^1080+65818722190*x^1081-42083406251*x^1082 \ +114681977929*x^1083+111087402900*x^1084-36208556668*x^1085+67189586885*x^1086 \ -95415909459*x^1087-39930935857*x^1088+61175159309*x^1089-119992012339*x^1090 \ +85494280676*x^1091-141608604262*x^1092+17013318480*x^1093-38635221143*x^1094 \ -48453647574*x^1095+21051206372*x^1096-158416995981*x^1097+70402137413*x^1098 \ +49633932323*x^1099-86748492368*x^1100+104553685254*x^1101-63949144239*x^1102 \ +419956495*x^1103+16552807277*x^1104-74328747961*x^1105+75400756459*x^1106 \ +34917686845*x^1107+37471578275*x^1108-73580767536*x^1109+77174108880*x^1110 \ +148715919329*x^1111-66428402497*x^1112+165172263241*x^1113-26783742086*x^1114 \ +190088576166*x^1115+54515121646*x^1116+101483331390*x^1117-108689512350*x^1118 \ +53249730955*x^1119+72222967172*x^1120-5526562207*x^1121-207861618362*x^1122 \ +39979297711*x^1123-131526399820*x^1124+89213762352*x^1125-62167567794*x^1126 \ -30249775241*x^1127-2196583404*x^1128+15230073656*x^1129+60729041258*x^1130 \ +88532730048*x^1131+10217062509*x^1132-60718111019*x^1133-57474242537*x^1134 \ +79431153433*x^1135+80845158176*x^1136+97779807512*x^1137-56322792891*x^1138 \ -164156429512*x^1139-19878255222*x^1140+78282404374*x^1141+98799976154*x^1142 \ -95492650246*x^1143+93751186963*x^1144-4498456358*x^1145-65869796255*x^1146 \ +169995598057*x^1147-50203042871*x^1148+109603182180*x^1149-111413589428*x^1150 \ +98314563037*x^1151+67616351563*x^1152+181622227355*x^1153+20284657424*x^1154 \ -61079727667*x^1155+147106285121*x^1156-17573539453*x^1157-30144779725*x^1158 \ -2161067542*x^1159+39349893244*x^1160-27707519713*x^1161+94277219419*x^1162 \ +134402588238*x^1163+179705148708*x^1164-162624387842*x^1165-67400319401*x^1166 \ +131747136365*x^1167-38125149979*x^1168-67302505083*x^1169-70487051743*x^1170 \ +8837205881*x^1171+83316371332*x^1172+50807693411*x^1173-52447034078*x^1174 \ -14301265462*x^1175-147487671006*x^1176-23113128499*x^1177+8300673447*x^1178 \ +56955833747*x^1179-12038131262*x^1180+47065770458*x^1181-157303901005*x^1182 \ +37559510536*x^1183-148257314211*x^1184+34849913846*x^1185+45007732808*x^1186 \ -115806825639*x^1187-161598801109*x^1188-18347919490*x^1189+60028556357*x^1190 \ +30303822679*x^1191+161206159164*x^1192-1888494396*x^1193-4658087012*x^1194 \ -61288806540*x^1195"); class sym_finder : public visitor, public symbol::visitor { protected: inline void visit(const symbol& s) override { found.insert(s); } public: sym_finder() { } exset found; }; static void ex2upoly(upoly& p, const ex& e) { sym_finder sfinder; e.traverse(sfinder); assert(sfinder.found.size() == 1); const ex x = *(sfinder.found.begin()); assert(e.ldegree(x) >= 0); p.resize(e.degree(x) + 1); for (int i = e.ldegree(x); i <= e.degree(x); ++i) { const numeric n = ex_to(e.coeff(x, i)); p[i] = cln::the(n.to_cl_N()); } } static void read_srep(ex& e1, ex& e2, upoly& a, upoly& b, const std::string& s1, const std::string& s2) { parser reader; e1 = reader(s1); e2 = reader(s2); a.resize(e1.nops()); b.resize(e2.nops()); ex2upoly(a, e1); ex2upoly(b, e2); canonicalize(a); canonicalize(b); } namespace GiNaC { extern upoly sr_gcd(const upoly& a, const upoly& b); extern bool heur_gcd_z(upoly& g, const upoly& a, const upoly& b); } /// Check if polynomial @a g divides polynomials @a a and @a b /// Used as GCD sanity check static bool gcd_sanity_check(const upoly& g, const upoly& a, const upoly& b, const std::string& label) { upoly r1, r2; remainder_in_ring(r1, a, g); cbug_on(!r1.empty(), "bug: " << label << " : gcd g = \"" << g << "\"does not divide a =\"" << a << "\""); remainder_in_ring(r2, b, g); cbug_on(!r2.empty(), "bug: " << label << " : gcd g = \"" << g << "\"does not divide b =\"" << b << "\""); return true; } struct mod_gcd_test { const upoly& a, b; upoly g; inline void run() { mod_gcd(g, a, b); } bool check() const { gcd_sanity_check(g, a, b, std::string("mod_gcd")); return true; } void print_result(const double t) const { std::streamsize display_digits = std::cout.precision(2); std::cout << std::scientific; std::cout << "mod_gcd\t\t: " << g.size() << " " << t << std::endl; std::cout.precision(display_digits); } mod_gcd_test(const upoly& a_, const upoly& b_) : a(a_), b(b_), g(std::min(degree(a_), degree(b_))) { } }; struct heur_gcd_test { const upoly& a, b; upoly g; const upoly& g_check; bool found; inline void run() { found = heur_gcd_z(g, a, b); } bool check() const { if (!found) return false; gcd_sanity_check(g, a, b, std::string("heur_gcd")); cbug_on(g != g_check, "modular and heuristic GCD disagree: " << "a = \"" << a << "\", b = \"" << b << "\", " << "mod_gcd = \"" << g_check << "\", " << "heur_gcd = \"" << g << "\""); return true; } void print_result(const double t) const { if (!found) return; std::streamsize display_digits = std::cout.precision(2); std::cout << std::scientific; std::cout << "heur_gcd\t: " << g.size() << " " << t << std::endl; std::cout.precision(display_digits); } heur_gcd_test(const upoly& a_, const upoly& b_, const upoly& g_) : a(a_), b(b_), g(std::min(degree(a_), degree(b_))), g_check(g_), found(false) { } }; struct sr_gcd_test { const upoly& a, b; const upoly& g_check; upoly g; sr_gcd_test(const upoly& a_, const upoly& b_, const upoly& g_) : a(a_), b(b_), g_check(g_), g(std::min(degree(a_), degree(b_))) { } inline void run() { g = sr_gcd(a, b); } bool check() const { gcd_sanity_check(g, a, b, std::string("sr_gcd")); cbug_on(g != g_check, "modular and PRS GCD disagree: " << "a = \"" << a << "\", b = \"" << b << "\", " << "mod_gcd = \"" << g_check << "\", " << "sr_gcd = \"" << g << "\""); return true; } void print_result(const double t) const { std::streamsize display_digits = std::cout.precision(2); std::cout << std::scientific; std::cout << "sr_gcd:\t\t: " << g.size() << " " << t << std::endl; std::cout.precision(display_digits); } }; struct ex_sr_gcd_test { ex a, b; ex g; const upoly& g_check; unsigned options; ex_sr_gcd_test(const ex& a_, const ex& b_, const upoly& g_) : a(a_), b(b_), g(0), g_check(g_), options(gcd_options::no_heur_gcd | gcd_options::use_sr_gcd) { } inline void run() { // always use subresultant PRS (to estimate the overhead // due to bad polynomial representation) g = gcd(a, b, 0, 0, false, options); } bool check() const { upoly g_gin; ex2upoly(g_gin, g); cbug_on(g_gin != g_check, "modular and old PRS GCD disagree: " << "a = \"" << a << "\", b = \"" << b << "\", " << "old sr_gcd = \"" << g_gin << "\", " << "mod_gcd = \"" << g_check << "\""); return true; } void print_result(const double t) const { std::streamsize display_digits = std::cout.precision(2); std::cout << std::scientific; if (options) std::cout << "sr_gcd (old)"; else std::cout << "heur_gcd (old)"; std::cout << "\t: " << g.nops() << " " << t << std::endl; std::cout.precision(display_digits); } }; static void run_test(const std::string& s1, const std::string& s2, bool use_sr_gcd = true, bool use_ex_sr_gcd = false) { upoly a, b; ex ea, eb; read_srep(ea, eb, a, b, s1, s2); std::cout << "Non-trivial GCD, degree(a) = " << degree(a) << ", degree(b) = " << degree(b) << std::endl << std::flush; mod_gcd_test b_mod_gcd(a, b); run_benchmark(b_mod_gcd); heur_gcd_test b_heur_gcd(a, b, b_mod_gcd.g); run_benchmark(b_heur_gcd); // Compute GCD using heuristic algorithm which operates on ex ex_sr_gcd_test b_ex_sr_gcd2(ea, eb, b_mod_gcd.g); b_ex_sr_gcd2.options = 0; run_benchmark(b_ex_sr_gcd2); if (use_sr_gcd) { sr_gcd_test b_sr_gcd(a, b, b_mod_gcd.g); run_benchmark(b_sr_gcd); } // GiNaC::sr_gcd (which operates on ex) is way too slow. if (use_ex_sr_gcd) { ex_sr_gcd_test b_ex_sr_gcd(ea, eb, b_mod_gcd.g); run_benchmark(b_ex_sr_gcd); } } static upoly make_random_upoly(const std::size_t deg); // Make random polynomials, most likely they will be relatively prime. // Check how different algorithms behave on such inputs. static void run_with_random_intputs(const unsigned d1, const unsigned d2) { std::cout << "GCD of relatively prime polynomials a and b" << std::endl << "degree(a) = " << d1 << ", degree(b) = " << d2 << std::endl << std::flush; upoly a = make_random_upoly(d1); upoly b = make_random_upoly(d2); mod_gcd_test b_mod(a, b); run_benchmark(b_mod); heur_gcd_test b_heur(a, b, b_mod.g); run_benchmark(b_heur); sr_gcd_test b_sr(a, b, b_mod.g); run_benchmark(b_sr); } int main(int argc, char** argv) { std::cout << "timing univariate GCD" << std::endl << std::flush; run_with_random_intputs(100, 50); // run PRS gcd tests, both with upoly and ex run_test(p1_srep, p2_srep, true, true); bool tolerant_p = (run_expensive_timings_p() >= 1); bool masochist_p = (run_expensive_timings_p() >= 2); // By default PRS gcd tests are disabled, they are way too slow run_test(q1_srep_1 + q1_srep_2, q2_srep_1 + q2_srep_2, tolerant_p, masochist_p); // ditto run_test(r1_srep_1 + r1_srep_2 + r1_srep_3, r2_srep_1 + r2_srep_2 + r2_srep_3, masochist_p, masochist_p); std::cout << ". " << std::flush; return 0; } static upoly make_random_upoly(const std::size_t deg) { static const cln::cl_I biggish("987654321098765432109876543210"); upoly p(deg + 1); for (std::size_t i = 0; i <= deg; ++i) p[i] = cln::random_I(biggish); // Make sure the leading coefficient is non-zero while (zerop(p[deg])) p[deg] = cln::random_I(biggish); return p; } ginac-1.7.8.orig/check/time_vandermonde.cpp0000644000000000000000000000564013457611471015554 0ustar /** @file time_vandermonde.cpp * * Calculates determinants of dense symbolic Vandermonde materices with * monomials in one single variable as entries. * For 4x4 our matrix would look like this: * [[1,a,a^2,a^3], [1,-a,a^2,-a^3], [1,a^2,a^4,a^6], [1,-a^2,a^4,-a^6]] */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "ginac.h" #include "timer.h" using namespace GiNaC; #include #include using namespace std; static unsigned vandermonde_det(unsigned size) { unsigned result = 0; const symbol a("a"); // construct Vandermonde matrix: matrix M(size,size); for (unsigned ro=0; ro sizes = {8, 10, 12, 14}; vector times; timer swatch; for (vector::iterator i=sizes.begin(); i!=sizes.end(); ++i) { int count = 1; swatch.start(); result += vandermonde_det(*i); // correct for very small times: while (swatch.read()<0.02) { vandermonde_det(*i); ++count; } times.push_back(swatch.read()/count); cout << '.' << flush; } // print the report: cout << endl << " dim: "; for (vector::iterator i=sizes.begin(); i!=sizes.end(); ++i) cout << '\t' << *i << 'x' << *i; cout << endl << " time/s:"; for (vector::iterator i=times.begin(); i!=times.end(); ++i) cout << '\t' << *i; cout << endl; return result; } extern void randomify_symbol_serials(); int main(int argc, char** argv) { randomify_symbol_serials(); cout << setprecision(2) << showpoint; return time_vandermonde(); } ginac-1.7.8.orig/check/timer.cpp0000644000000000000000000000427713457611471013361 0ustar /** @file timer.cpp * * A simple stop watch class. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #ifdef HAVE_RUSAGE #include #include #else #include #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "timer.h" timer::timer() : on(false) { #ifdef HAVE_RUSAGE getrusage(RUSAGE_SELF, &used1); used2.ru_utime = used1.ru_utime; used2.ru_stime = used1.ru_stime; #else used1 = clock(); used2 = used1; #endif } void timer::start() { on = true; #ifdef HAVE_RUSAGE getrusage(RUSAGE_SELF, &used1); used2.ru_utime = used1.ru_utime; used2.ru_stime = used1.ru_stime; #else used1 = clock(); used2 = used1; #endif } void timer::stop() { on = false; #ifdef HAVE_RUSAGE getrusage(RUSAGE_SELF, &used2); #else used2 = clock(); #endif } void timer::reset() { #ifdef HAVE_RUSAGE getrusage(RUSAGE_SELF, &used1); used2.ru_utime = used1.ru_utime; used2.ru_stime = used1.ru_stime; #else used1 = clock(); used2 = used1; #endif } double timer::read() { #ifdef HAVE_RUSAGE if (running()) getrusage(RUSAGE_SELF, &used2); return ((used2.ru_utime.tv_sec - used1.ru_utime.tv_sec) + (used2.ru_stime.tv_sec - used1.ru_stime.tv_sec) + (used2.ru_utime.tv_usec - used1.ru_utime.tv_usec) * 1e-6 + (used2.ru_stime.tv_usec - used1.ru_stime.tv_usec) * 1e-6); #else if (running()) used2 = clock(); return double(used2 - used1)/CLOCKS_PER_SEC; #endif } bool timer::running() { return on; } ginac-1.7.8.orig/check/timer.h0000644000000000000000000000237513457611471013023 0ustar /** @file timer.h * * A simple stop watch class. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #ifndef TIMER_H #define TIMER_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_RUSAGE #include #else #include #endif class timer { public: timer(); void start(); void stop(); void reset(); double read(); bool running(); private: bool on; #ifdef HAVE_RUSAGE struct rusage used1, used2; #else std::clock_t used1, used2; #endif }; #endif // ndef TIMER_H ginac-1.7.8.orig/cmake/0000755000000000000000000000000013546717364011535 5ustar ginac-1.7.8.orig/cmake/modules/0000755000000000000000000000000013546717364013205 5ustar ginac-1.7.8.orig/cmake/modules/FindCLN.cmake0000644000000000000000000001037113457611471015417 0ustar # CLN_FOUND CLN has been successfully found # CLN_INCLUDE_DIR the include directories # CLN_LIBRARIES CLN library and its dependencies (if any) if (CLN_INCLUDE_DIR AND CLN_LIBRARIES) set(CLN_FIND_QUIETLY TRUE) endif() function(_cl_get_version _out_major _out_minor _out_patch _cl_version_h) file(STRINGS ${_cl_version_h} _cl_vinfo REGEX "^#define[\t ]+CL_VERSION_.*") if (NOT _cl_vinfo) message(FATAL_ERROR "include file ${_cl_version_h} does not exist") endif() string(REGEX REPLACE "^.*CL_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" ${_out_major} "${_cl_vinfo}") string(REGEX REPLACE "^.*CL_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" ${_out_minor} "${_cl_vinfo}") string(REGEX REPLACE "^.*CL_VERSION_PATCHLEVEL[ \t]+([0-9]+).*" "\\1" ${_out_patch} "${_cl_vinfo}") if (NOT ${_out_major} MATCHES "[0-9]+") message(FATAL_ERROR "failed to determine CL_VERSION_MAJOR, " "expected a number, got ${${_out_major}}") endif() if (NOT ${_out_minor} MATCHES "[0-9]+") message(FATAL_ERROR "failed to determine CL_VERSION_MINOR, " "expected a number, got ${${_out_minor}}") endif() if (NOT ${_out_patch} MATCHES "[0-9]+") message(FATAL_ERROR "failed to determine CL_VERSION_PATCHLEVEL, " "expected a number, got ${${_out_patch}}") endif() message(STATUS "found CLN [${_cl_version_h}], version ${${_out_major}}.${${_out_minor}}.${${_out_patch}}") set(${_out_major} ${${_out_major}} PARENT_SCOPE) set(${_out_minor} ${${_out_minor}} PARENT_SCOPE) set(${_out_patch} ${${_out_patch}} PARENT_SCOPE) endfunction() set(CLN_FOUND) set(CLN_INCLUDE_DIR) set(CLN_LIBRARIES) include(FindPkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(_cln cln) endif() find_path(CLN_INCLUDE_DIR NAMES cln/cln.h HINTS ${_cln_INCLUDE_DIRS} $ENV{CLN_DIR}/include) find_library(CLN_LIBRARIES NAMES libcln cln HINTS ${_cln_LIBRARY_DIR} ${_cln_LIBRARY_DIRS} $ENV{CLN_DIR}/lib) if (CLN_INCLUDE_DIR) _cl_get_version(CLN_VERSION_MAJOR CLN_VERSION_MINOR CLN_VERSION_PATCHLEVEL ${CLN_INCLUDE_DIR}/cln/version.h) set(CLN_VERSION ${CLN_VERSION_MAJOR}.${CLN_VERSION_MINOR}.${CLN_VERSION_PATCHLEVEL}) # Check if the version reported by pkg-config is the same # as the one read from the header. This prevents us from # picking the wrong version of CLN (say, if several versions # are installed) if (_cln_FOUND AND NOT CLN_VERSION VERSION_EQUAL _cln_VERSION) if (NOT CLN_FIND_QUIETLY) message(ERROR "pkg-config and version.h disagree, " "${_cln_VERSION} vs ${CLN_VERSION}, " "please check your installation") endif() set(CLN_LIBRARIES CLN-NOTFOUND) set(CLN_INCLUDE_DIR CLN-NOTFOUND) set(CLN_LIBRARY_DIRS) set(CLN_VERSION) endif() endif() # Check if the version embedded into the library is the same as the one in the headers. if (CLN_INCLUDE_DIR AND CLN_LIBRARIES AND NOT CMAKE_CROSSCOMPILING) include(CheckCXXSourceRuns) set(_save_required_includes ${CMAKE_REQUIRED_INCLUDES}) set(_save_required_libraries ${CMAKE_REQUIRED_LIBRARIES}) set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${CLN_INCLUDE_DIR}) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${CLN_LIBRARIES}) check_cxx_source_runs(" #include int main() { return (CL_VERSION_MAJOR == cln::version_major) && (CL_VERSION_MINOR == cln::version_minor) && (CL_VERSION_PATCHLEVEL == cln::version_patchlevel) ? 0 : 1; } " _cl_version_matches) set(CMAKE_REQUIRED_LIBRARIES ${_save_required_libraries}) set(CMAKE_REQUIRED_INCLUDES ${_save_required_includes}) if (NOT _cl_version_matches) if (NOT CLN_FIND_QUIETLY) message(ERROR "header (version differs from the library one, " "please check your installation.") endif() set(CLN_INCLUDE_DIR CLN-NOTFOUND) set(CLN_LIBRARIES CLN-NOTFOUND) set(CLN_LIBRARY_DIRS) set(CLN_VERSION) endif() endif() if (CLN_LIBRARIES AND CLN_INCLUDE_DIR) set(_cln_library_dirs) foreach(_l ${CLN_LIBRARIES}) get_filename_component(_d "${_l}" PATH) list(APPEND _cln_library_dirs "${_d}") endforeach() list(REMOVE_DUPLICATES _cln_library_dirs) set(CLN_LIBRARY_DIRS ${_cln_library_dirs}) endif() include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(CLN REQUIRED_VARS CLN_LIBRARIES CLN_INCLUDE_DIR VERSION_VAR CLN_VERSION) ginac-1.7.8.orig/cmake/modules/FindGiNaC.cmake0000644000000000000000000001273713457611471015734 0ustar # GINAC_FOUND CiNaC has been successfully found # GINAC_INCLUDE_DIRS the include directories # GINAC_LIBRARIES GiNaC library and its dependencies if (GINAC_INCLUDE_DIRS AND GINAC_LIBRARIES) set(GINAC_FIND_QUIETLY TRUE) endif() function(_ginac_headers_version _out_major _out_minor _out_patch _version_h) file(STRINGS ${_version_h} _ginac_vinfo REGEX "^#define[\t ]+GINACLIB_.*_VERSION.*") if (NOT _ginac_vinfo) message(FATAL_ERROR "include file ${_version_h} does not exist") endif() string(REGEX REPLACE "^.*GINACLIB_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" ${_out_major} "${_ginac_vinfo}") string(REGEX REPLACE "^.*GINACLIB_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" ${_out_minor} "${_ginac_vinfo}") string(REGEX REPLACE "^.*GINACLIB_MICRO_VERSION[ \t]+([0-9]+).*" "\\1" ${_out_patch} "${_ginac_vinfo}") if (NOT ${_out_major} MATCHES "[0-9]+") message(FATAL_ERROR "failed to determine GINACLIB_MAJOR_VERSION, " "expected a number, got ${${_out_major}}") endif() if (NOT ${_out_minor} MATCHES "[0-9]+") message(FATAL_ERROR "failed to determine GINACLIB_MINOR_VERSION, " "expected a number, got ${${_out_minor}}") endif() if (NOT ${_out_patch} MATCHES "[0-9]+") message(FATAL_ERROR "failed to determine GINACLIB_MINOR_VERSION, " "expected a number, got ${${_out_patch}}") endif() set(${_out_major} ${${_out_major}} PARENT_SCOPE) set(${_out_minor} ${${_out_minor}} PARENT_SCOPE) set(${_out_patch} ${${_out_patch}} PARENT_SCOPE) endfunction() set(GINAC_FOUND) set(GINAC_INCLUDE_DIRS) set(GINAC_LIBRARIES) set(GINAC_LIBRARY_DIRS) set(GINAC_VERSION) include(FindPkgConfig) find_package(CLN 1.2.2) if (PKG_CONFIG_FOUND) pkg_check_modules(_ginac ginac) else() set(_ginac_LIBRARIES ginac cln gmp) endif() if (NOT CLN_FOUND) set(GINAC_INCLUDE_DIRS GINAC-NOTFOUND) set(GINAC_LIBRARIES GINAC-NOTFOUND) else() find_path(_ginac_include_dir NAMES ginac/ginac.h HINTS ${_ginac_INCLUDE_DIRS} $ENV{GINAC_DIR}/include) if (_ginac_include_dir) set(GINAC_INCLUDE_DIRS ${_ginac_include_dir} ${_ginac_INCLUDE_DIRS} ${CLN_INCLUDE_DIR}) list(REMOVE_DUPLICATES GINAC_INCLUDE_DIRS) else() set(GINAC_INCLUDE_DIRS GINAC-NOTFOUND) set(GINAC_LIBRARIES GINAC-NOTFOUND) if (NOT GINAC_FIND_QUIETLY) message(ERROR "couldn't find ginac.h") endif() endif() if (GINAC_INCLUDE_DIRS) find_library(_ginac_lib NAMES libginac ginac HINTS ${_ginac_LIBRARY_DIRS} $ENV{GINAC_DIR}/lib) if (_ginac_lib) set(GINAC_LIBRARIES ${_ginac_lib} ${CLN_LIBRARIES}) list(REMOVE_DUPLICATES GINAC_LIBRARIES) else() set(GINAC_LIBRARIES GINAC-NOTFOUND) set(GINAC_INCLUDE_DIRS GINAC-NOTFOUND) if (NOT GINAC_FIND_QUIETLY) message(ERROR "couldn't find libginac") endif() endif() endif() endif() if (GINAC_INCLUDE_DIRS) _ginac_headers_version(GINACLIB_MAJOR_VERSION GINACLIB_MINOR_VERSION GINACLIB_MICRO_VERSION ${_ginac_include_dir}/ginac/version.h) set(GINAC_VERSION ${GINACLIB_MAJOR_VERSION}.${GINACLIB_MINOR_VERSION}.${GINACLIB_MICRO_VERSION}) # Check if the version reported by pkg-config is the same # as the one read from the header. This prevents us from # picking the wrong version of GINAC (say, if several versions # are installed) if (PKG_CONFIG_FOUND AND NOT GINAC_VERSION VERSION_EQUAL _ginac_VERSION) if (NOT CLN_FIND_QUIETLY) message(ERROR "pkg-config and version.h disagree, " "${_ginac_VERSION} vs ${GINAC_VERSION}, " "please check your installation") endif() set(GINAC_LIBRARIES GINAC-NOTFOUND) set(GINAC_INCLUDE_DIRS GINAC-NOTFOUND) set(GINAC_LIBRARY_DIRS) set(GINAC_VERSION) endif() endif() # Check if the version embedded into the library is the same as the one in the headers. if (GINAC_INCLUDE_DIRS AND GINAC_LIBRARIES AND NOT CMAKE_CROSSCOMPILING) include(CheckCXXSourceRuns) set(_save_required_includes ${CMAKE_REQUIRED_INCLUDES}) set(_save_required_libraries ${CMAKE_REQUIRED_LIBRARIES}) set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${GINAC_INCLUDE_DIRS}) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${GINAC_LIBRARIES}) check_cxx_source_runs(" #include #include #include int main() { return (CL_VERSION_MAJOR == cln::version_major) && (CL_VERSION_MINOR == cln::version_minor) && (CL_VERSION_PATCHLEVEL == cln::version_patchlevel) && (GINACLIB_MAJOR_VERSION == GiNaC::version_major) && (GINACLIB_MINOR_VERSION == GiNaC::version_minor) && (GINACLIB_MICRO_VERSION == GiNaC::version_micro) ? 0 : 1; } " _ginac_version_matches) set(CMAKE_REQUIRED_LIBRARIES ${_save_required_libraries}) set(CMAKE_REQUIRED_INCLUDES ${_save_required_includes}) if (NOT _ginac_version_matches) if (NOT GINAC_FIND_QUIETLY) message(ERROR "header version differs from the library one, " "please check your installation.") endif() set(GINAC_INCLUDE_DIRS GINAC-NOTFOUND) set(GINAC_LIBRARIES GINAC_NOTFOUND) set(GINAC_LIBRARY_DIRS) set(GINAC_VERSION) endif() endif() if (GINAC_LIBRARIES AND GINAC_INCLUDE_DIRS) set(_ginac_library_dirs) foreach(_l ${GINAC_LIBRARIES}) get_filename_component(_d "${_l}" PATH) list(APPEND _ginac_library_dirs "${_d}") endforeach() list(REMOVE_DUPLICATES _ginac_library_dirs) set(GINAC_LIBRARY_DIRS ${_ginac_library_dirs}) endif() include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(GiNaC REQUIRED_VARS GINAC_LIBRARIES GINAC_INCLUDE_DIRS VERSION_VAR GINAC_VERSION) ginac-1.7.8.orig/cmake/modules/FindLibDL.cmake0000644000000000000000000000153413457611471015732 0ustar # - Find libdl # Find the native LIBDL includes and library # # LIBDL_INCLUDE_DIR - where to find dlfcn.h, etc. # LIBDL_LIBRARIES - List of libraries when using libdl. # LIBDL_FOUND - True if libdl found. IF (LIBDL_INCLUDE_DIR) # Already in cache, be silent SET(LIBDL_FIND_QUIETLY TRUE) ENDIF (LIBDL_INCLUDE_DIR) FIND_PATH(LIBDL_INCLUDE_DIR dlfcn.h) SET(LIBDL_NAMES dl libdl ltdl libltdl) FIND_LIBRARY(LIBDL_LIBRARY NAMES ${LIBDL_NAMES} ) # handle the QUIETLY and REQUIRED arguments and set LIBDL_FOUND to TRUE if # all listed variables are TRUE INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibDL DEFAULT_MSG LIBDL_LIBRARY LIBDL_INCLUDE_DIR) IF(LIBDL_FOUND) SET( LIBDL_LIBRARIES ${LIBDL_LIBRARY} ) ELSE(LIBDL_FOUND) SET( LIBDL_LIBRARIES ) ENDIF(LIBDL_FOUND) MARK_AS_ADVANCED( LIBDL_LIBRARY LIBDL_INCLUDE_DIR ) ginac-1.7.8.orig/cmake/modules/FindReadline.cmake0000644000000000000000000000303213457611471016522 0ustar # READLINE_FOUND # READLINE_INCLUDE_DIRS # READLINE_LIBRARIES if (READLINE_INCLUDE_DIRS AND READLINE_LIBRARIES) set(READLINE_FIND_QUIETLY TRUE) endif() include(CheckCXXSourceCompiles) find_path(READLINE_INCLUDE_DIRS NAMES readline/readline.h) if (NOT READLINE_INCLUDE_DIRS AND NOT READLINE_FIND_QUIETLY) message(ERROR "couldn't find the readline/readline.h header") endif() find_library(READLINE_LIBRARIES NAMES libreadline readline) if (NOT READLINE_LIBRARIES AND NOT READLINE_FIND_QUIETLY) message(ERROR "couldn't find libreadline") endif() if (READLINE_INCLUDE_DIRS AND READLINE_LIBRARIES) set(_save_req_includes ${CMAKE_REQUIRED_INCLUDES}) set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${READLINE_INCLUDE_DIR}) check_cxx_source_compiles(" #include #include #if !defined(RL_VERSION_MAJOR) || !defined(RL_VERSION_MINOR) #error Ancient version of readline #endif int main() { return 0; } " _rl_version_check) set(CMAKE_REQUIRED_INCLUDES ${_save_req_includes}) if (NOT _rl_version_check) set(READLINE_INCLUDE_DIRS READLINE-NOTFOUND) set(READLINE_LIBRARIES READLINE-NOTFOUND) if (NOT READLINE_FIND_QUIETLY) message(ERROR "Ancient/unsupported version of readline") endif() endif() endif() if (NOT READLINE_INCLUDE_DIRS OR NOT READLINE_LIBRARIES) set(READLINE_LIBRARIES READLINE-NOTFOUND) set(READLINE_INCLUDE_DIRS READLINE-NOTFOUND) endif() include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(READLINE REQUIRED_VARS READLINE_INCLUDE_DIRS READLINE_LIBRARIES) ginac-1.7.8.orig/config/0000755000000000000000000000000013546717365011723 5ustar ginac-1.7.8.orig/config/compile0000755000000000000000000001632713457611641013301 0ustar #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: ginac-1.7.8.orig/config/config.guess0000755000000000000000000012637313457611641014246 0ustar #! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval "$set_cc_for_build" cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval "$set_cc_for_build" SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ [ "$TARGET_BINARY_INTERFACE"x = x ] then echo m88k-dg-dgux"$UNAME_RELEASE" else echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "$HP_ARCH" = "" ]; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ "$HP_ARCH" = hppa2.0w ] then eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 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=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) if objdump -f /bin/sh | grep -q elf32-x86-64; then echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 else echo "$UNAME_MACHINE"-pc-linux-"$LIBC" fi exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then 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 case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ginac-1.7.8.orig/config/config.h.in0000644000000000000000000000440413541765136013742 0ustar /* config/config.h.in. Generated from configure.ac by autoheader. */ /* define if the compiler supports basic C++11 syntax */ #undef HAVE_CXX11 /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* set to 1 if dlopen() works. */ #undef HAVE_LIBDL /* Define to 1 if you have the `readline' library (-lreadline). */ #undef HAVE_LIBREADLINE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_HISTORY_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H /* define if struct rusage declared in */ #undef HAVE_RUSAGE /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the `tgetent' function. */ #undef HAVE_TGETENT /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER ginac-1.7.8.orig/config/config.rpath0000755000000000000000000004421613457611471014232 0ustar #! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2015 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally 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. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in ecc*) wl='-Wl,' ;; icc* | ifort*) wl='-Wl,' ;; lf95*) wl='-Wl,' ;; nagfor*) wl='-Wl,-Wl,,' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; xl* | bgxl* | bgf* | mpixl*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) wl= ;; *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; newsos6) ;; *nto* | *qnx*) ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) wl='-Qoption ld ' ;; *) wl='-Wl,' ;; esac ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # 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. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 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 fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; haiku*) ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; 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 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 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) 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 hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then : else ld_shlibs=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd2.[01]*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) 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 ;; hpux10*) if test "$with_gnu_ld" = no; then 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 fi ;; hpux11*) 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_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) 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 ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) case "$host_cpu" in powerpc*) library_names_spec='$libname$shrext' ;; m68k) library_names_spec='$libname.a' ;; esac ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd[23].*) library_names_spec='$libname$shrext$versuffix' ;; freebsd* | dragonfly*) library_names_spec='$libname$shrext' ;; gnu*) library_names_spec='$libname$shrext' ;; haiku*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; *nto* | *qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; tpf*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # 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: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo "$1" | sed 's/-[^-]*$//'` if [ "$basic_machine" != "$1" ] then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2*) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsv-tandem) basic_machine=nsv-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh5el) basic_machine=sh5le-unknown ;; simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; x64) basic_machine=x86_64-pc ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases that might get confused # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) -es1800*) os=-ose ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -xray | -os68k* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4*) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) os=-eabi ;; *) os=-elf ;; esac ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; pru-*) os=-elf ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac echo "$basic_machine$os" exit # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ginac-1.7.8.orig/config/depcomp0000755000000000000000000005602013457611641013272 0ustar #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} 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" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## 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). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - 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 -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # 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. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then 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" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: ginac-1.7.8.orig/config/install-sh0000755000000000000000000003601013457611641013716 0ustar #!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac 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. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: ginac-1.7.8.orig/config/ltmain.sh0000644000000000000000000117671213457611636013555 0ustar #! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 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 this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.6 Debian-2.4.6-9" package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 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. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! 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 ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >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 "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_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 # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_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 '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. 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. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # 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 "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # 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" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_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 "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # 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. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # 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 "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_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 "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_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_append 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_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || 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_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd 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 -z "$func_relative_path_tlibdir"; 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 -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # 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 () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_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. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # 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). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet 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 () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet 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 () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" 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 () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2015-10-07.11; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 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. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd _G_rc_run_hooks=false case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do if eval $_G_hook '"$@"'; then # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift _G_rc_run_hooks=: fi done $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, you may remove/edit # any options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. In this case you also must return $EXIT_SUCCESS to let the # hook's caller know that it should pay attention to # '_result'. Returning $EXIT_FAILURE signalizes that # arguments are left untouched by the hook and therefore caller will ignore the # result variable. # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). There is # # no need to do the equivalent (but slower) action: # # func_quote_for_eval ${1+"$@"} # # my_options_prep_result=$func_quote_for_eval_result # false # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@", we could need that later # # if $args_changed is true. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # if $args_changed; then # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # fi # # $args_changed # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # false # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd _G_func_options_finish_exit=false if func_run_hooks func_options ${1+"$@"}; then func_options_finish_result=$func_run_hooks_result _G_func_options_finish_exit=: fi $_G_func_options_finish_exit } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_rc_options=false for my_func in options_prep parse_options validate_options options_finish do if eval func_$my_func '${1+"$@"}'; then eval _G_res_var='$'"func_${my_func}_result" eval set dummy "$_G_res_var" ; shift _G_rc_options=: fi done # Save modified positional parameters for caller. As a top-level # options-parser function we always need to set the 'func_options_result' # variable (regardless the $_G_rc_options value). if $_G_rc_options; then func_options_result=$_G_res_var else func_quote_for_eval ${1+"$@"} func_options_result=$func_quote_for_eval_result fi $_G_rc_options } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned). func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= _G_rc_options_prep=false if func_run_hooks func_options_prep ${1+"$@"}; then _G_rc_options_prep=: # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result fi $_G_rc_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= _G_rc_parse_options=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. if func_run_hooks func_parse_options ${1+"$@"}; then eval set dummy "$func_run_hooks_result"; shift _G_rc_parse_options=: fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_rc_parse_options=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_rc_parse_options=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac $_G_match_parse_options && _G_rc_parse_options=: done if $_G_rc_parse_options; then # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result fi $_G_rc_parse_options } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd _G_rc_validate_options=false # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" if func_run_hooks func_validate_options ${1+"$@"}; then # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result _G_rc_validate_options=: fi # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE $_G_rc_validate_options } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # 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. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --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 --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_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) version: $progname $scriptversion Debian-2.4.6-9 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "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 yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; 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 } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= _G_rc_lt_options_prep=: # 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 ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result fi $_G_rc_lt_options_prep } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result fi $_G_rc_lt_parse_options } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # 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 test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; 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." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. 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= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # 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 | func_generated_by_libtool_p } # 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 yes = "$lalib_p" } # 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 () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # 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 () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs 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 () { $debug_cmd 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 () { $debug_cmd 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 yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$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 () { $debug_cmd # 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 () { $debug_cmd 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 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd $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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot 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 yes = "$build_old_libs"; 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 no = "$pic_mode" && test pass_all != "$deplibs_check_method"; 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 no = "$compiler_c_o"; 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 yes = "$need_locks"; 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 warn = "$need_locks"; 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 yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; 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 warn = "$need_locks" && 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 yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; 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 warn = "$need_locks" && 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 no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && 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 -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -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 () { $debug_cmd # 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 $opt_dry_run; then # 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 else 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 fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd 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_quiet && 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 finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # 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=false 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=: ;; -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-m = "X$prev" && 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=: if $isdir; 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 ;; os2*) 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 yes = "$build_old_libs"; 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=: 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'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; 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_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && 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 () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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) $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 can'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 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' 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[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi 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" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; 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" "${nlist}I"' # 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_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 () { $debug_cmd 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 () { $debug_cmd 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_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 () { $debug_cmd 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 case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) 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 } }'` ;; esac 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 () { $debug_cmd 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 () { $debug_cmd 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 that possess that section. Heuristic: eliminate # all those that 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_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 () { $debug_cmd 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 () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; 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 yes = "$lock_old_archive_extraction"; 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 () { $debug_cmd 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` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result 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 "$sed_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 where 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) $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/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that 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) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; 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 yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* 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_platform || defined ... */ #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 #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 (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t 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 = (size_t) (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 (STREQ (str, pat)) *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 size_t 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) { size_t orig_value_len = strlen (orig_value); size_t 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 #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd 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 # what 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 that 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= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false 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 yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && 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) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; 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 ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. 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 none = "$pic_object" && test none = "$non_pic_object"; 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 none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; 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 dlprefiles = "$prev"; 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 none != "$non_pic_object"; 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 none = "$pic_object"; 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 ;; os2dllname) os2dllname=$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 rpath = "$prev"; 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-export-symbols = "X$arg"; 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-lc = "X$arg" || test X-lm = "X$arg"; 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-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && 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-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname 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 # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC -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*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*) 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 ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # 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 none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; 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 dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; 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 none = "$pic_object"; 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 dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; 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 yes = "$export_dynamic" && 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\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" 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 lib = "$linkmode"; 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=false 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 lib,link = "$linkmode,$pass"; 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 lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; 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 lib,dlpreopen = "$linkmode,$pass"; 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 dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; 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 .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; 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 conv = "$pass" && 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 conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; 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 link = "$pass"; 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 conv = "$pass"; 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=false 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=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else 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." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; 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=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # 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 lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; 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 prog != "$linkmode" && test lib != "$linkmode"; 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 yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; 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 dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" 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 yes = "$installed"; 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 yes = "$hardcode_automatic" && 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 dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; 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 lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; 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 prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: 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 $linkalldeplibs; 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 prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || 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 $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && 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 built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; 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 yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; 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 lib = "$linkmode" && test yes = "$hardcode_into_libs"; 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* | *os2*) 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 prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; 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 cannot # 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 no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; 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 prog = "$linkmode"; 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 yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; 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 prog = "$linkmode"; 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 prog = "$linkmode"; 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 unsupported != "$hardcode_direct"; 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 yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; 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 cannot 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 yes = "$module"; 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 no = "$build_old_libs"; 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 lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; 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 no = "$link_static" && 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 no != "$link_all_deplibs"; 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 link = "$pass"; then if test prog = "$linkmode"; 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 dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # 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= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=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 # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # 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 prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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 no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; 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 pass_all != "$deplibs_check_method"; 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 no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; 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 # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|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" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; 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 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; 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 ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. 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 no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; 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 -n "$precious_files_regex"; 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 yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; 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 yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; 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 yes = "$build_libtool_libs"; 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 yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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 none = "$deplibs_check_method"; 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 yes = "$droppeddeps"; then if test yes = "$module"; 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 no = "$build_old_libs"; 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 no = "$allow_undefined"; 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 no = "$build_old_libs"; 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 yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || 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 func_dll_def_p "$export_symbols" || { # 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 ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || 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 yes = "$try_normal_branch" \ && { 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 : != "$skipped_export"; 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 : != "$skipped_export" && 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 yes = "$compiler_needs_object" && 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 yes = "$thread_safe" && 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 relink = "$opt_mode"; 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 yes = "$module" && 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 : != "$skipped_export" && 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 : != "$skipped_export" && test yes = "$with_gnu_ld"; 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 : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; 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 -z "$objlist" || 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 1 -eq "$k"; 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 ${skipped_export-false} && { 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 } 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_quiet || { 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 relink = "$opt_mode"; 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 ${skipped_export-false} && { 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 } 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 yes = "$module" && 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=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { 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 relink = "$opt_mode"; 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 relink = "$opt_mode"; 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 yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags 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 yes = "$build_libtool_libs" || 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 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 test yes = "$build_libtool_libs" || { 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 } if test -n "$pic_flag" || test default != "$pic_mode"; 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" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && 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 CXX = "$tagname"; 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 yes = "$build_old_libs"; 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@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # 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 } 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 yes = "$no_install"; 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 case $hardcode_action,$fast_install in relink,*) # 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" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # 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 case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac 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 yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; 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 yes = "$build_old_libs" && 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 yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; 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) $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 cannot 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 no,yes = "$installed,$need_relink"; 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 } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false 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=: ;; -*) 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 . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; 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 $rmforce; 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" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || 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 none != "$pic_object"; 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 none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; 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 yes = "$fast_install" && 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 } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi 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 # where 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: ginac-1.7.8.orig/config/mdate-sh0000755000000000000000000001373213457611642013351 0ustar #!/bin/sh # Get modification time of a file or directory and pretty-print it. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1995-2018 Free Software Foundation, Inc. # written by Ulrich Drepper , June 1995 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . 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 fi case $1 in '') echo "$0: No file. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: mdate-sh [--help] [--version] FILE Pretty-print the modification day of FILE, in the format: 1 January 1970 Report bugs to . EOF exit $? ;; -v | --v*) echo "mdate-sh $scriptversion" exit $? ;; esac error () { echo "$0: $1" >&2 exit 1 } # Prevent date giving response in another language. LANG=C export LANG LC_ALL=C export LC_ALL LC_TIME=C export LC_TIME # Use UTC to get reproducible result. TZ=UTC0 export TZ # GNU ls changes its time format in response to the TIME_STYLE # variable. Since we cannot assume 'unset' works, revert this # variable to its documented default. if test "${TIME_STYLE+set}" = set; then TIME_STYLE=posix-long-iso export TIME_STYLE fi save_arg1=$1 # Find out how to get the extended ls output of a file or directory. if ls -L /dev/null 1>/dev/null 2>&1; then ls_command='ls -L -l -d' else ls_command='ls -l -d' fi # Avoid user/group names that might have spaces, when possible. if ls -n /dev/null 1>/dev/null 2>&1; then ls_command="$ls_command -n" fi # A 'ls -l' line looks as follows on OS/2. # drwxrwx--- 0 Aug 11 2001 foo # This differs from Unix, which adds ownership information. # drwxrwx--- 2 root root 4096 Aug 11 2001 foo # # To find the date, we split the line on spaces and iterate on words # until we find a month. This cannot work with files whose owner is a # user named "Jan", or "Feb", etc. However, it's unlikely that '/' # will be owned by a user whose name is a month. So we first look at # the extended ls output of the root directory to decide how many # words should be skipped to get the date. # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. set x`$ls_command /` # Find which argument is the month. month= command= until test $month do test $# -gt 0 || error "failed parsing '$ls_command /' output" shift # Add another shift to the command. command="$command shift;" case $1 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac done test -n "$month" || error "failed parsing '$ls_command /' output" # Get the extended ls output of the file or directory. set dummy x`eval "$ls_command \"\\\$save_arg1\""` # Remove all preceding arguments eval $command # Because of the dummy argument above, month is in $2. # # On a POSIX system, we should have # # $# = 5 # $1 = file size # $2 = month # $3 = day # $4 = year or time # $5 = filename # # On Darwin 7.7.0 and 7.6.0, we have # # $# = 4 # $1 = day # $2 = month # $3 = year or time # $4 = filename # Get the month. case $2 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac case $3 in ???*) day=$1;; *) day=$3; shift;; esac # Here we have to deal with the problem that the ls output gives either # the time of day or the year. case $3 in *:*) set `date`; eval year=\$$# case $2 in Jan) nummonthtod=1;; Feb) nummonthtod=2;; Mar) nummonthtod=3;; Apr) nummonthtod=4;; May) nummonthtod=5;; Jun) nummonthtod=6;; Jul) nummonthtod=7;; Aug) nummonthtod=8;; Sep) nummonthtod=9;; Oct) nummonthtod=10;; Nov) nummonthtod=11;; Dec) nummonthtod=12;; esac # For the first six month of the year the time notation can also # be used for files modified in the last year. if (expr $nummonth \> $nummonthtod) > /dev/null; then year=`expr $year - 1` fi;; *) year=$3;; esac # The result. echo $day $month $year # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: ginac-1.7.8.orig/config/missing0000755000000000000000000001533613457611641013321 0ustar #! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: ginac-1.7.8.orig/config/test-driver0000755000000000000000000001104213457611641014106 0ustar #! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2018-03-07.03; # UTC # Copyright (C) 2011-2018 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>$log_file # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: ginac-1.7.8.orig/config/texinfo.tex0000644000000000000000000135240313457611642014121 0ustar % texinfo.tex -- TeX macros to handle Texinfo files. % % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % \def\texinfoversion{2018-02-12.17} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, % 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 % Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as % published by the Free Software Foundation, either version 3 of the % License, or (at your option) any later version. % % This texinfo.tex file is distributed in the hope that it will be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU % General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program. If not, see . % % As a special exception, when this file is read by TeX when processing % a Texinfo source document, you may use the result without % restriction. This Exception is an additional permission under section 7 % of the GNU General Public License, version 3 ("GPLv3"). % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: % https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or % https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or % https://www.gnu.org/software/texinfo/ (the Texinfo home page) % The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. % % To process a Texinfo manual with TeX, it's most reliable to use the % texi2dvi shell script that comes with the distribution. For a simple % manual foo.texi, however, you can get away with this: % tex foo.texi % texindex foo.?? % tex foo.texi % tex foo.texi % dvips foo.dvi -o # or whatever; this makes foo.ps. % The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. % % It is possible to adapt texinfo.tex for other languages, to some % extent. You can get the existing language-specific files from the % full Texinfo distribution. % % The GNU Texinfo home page is https://www.gnu.org/software/texinfo. \message{Loading texinfo [version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} % LaTeX's \typeout. This ensures that the messages it is used for % are identical in format to the corresponding ones from latex/pdflatex. \def\typeout{\immediate\write17}% \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax % Save some plain tex macros whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c \let\ptexcomma=\, \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! \let\ptexfootnote=\footnote \let\ptexgtr=> \let\ptexhat=^ \let\ptexi=\i \let\ptexindent=\indent \let\ptexinsert=\insert \let\ptexlbrace=\{ \let\ptexless=< \let\ptexnewwrite\newwrite \let\ptexnoindent=\noindent \let\ptexplus=+ \let\ptexraggedright=\raggedright \let\ptexrbrace=\} \let\ptexslash=\/ \let\ptexsp=\sp \let\ptexstar=\* \let\ptexsup=\sup \let\ptext=\t \let\ptextop=\top {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J % Use TeX 3.0's \inputlineno to get the line number, for better error % messages, but if we're using an old version of TeX, don't do anything. % \ifx\inputlineno\thisisundefined \let\linenumber = \empty % Pre-3.0. \else \def\linenumber{l.\the\inputlineno:\space} \fi % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi \ifx\putworderror\undefined \gdef\putworderror{error}\fi \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi \ifx\putwordin\undefined \gdef\putwordin{in}\fi \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi \ifx\putwordof\undefined \gdef\putwordof{of}\fi \ifx\putwordon\undefined \gdef\putwordon{on}\fi \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi % \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi % \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi % Give the space character the catcode for a space. \def\spaceisspace{\catcode`\ =10\relax} % Likewise for ^^M, the end of line character. \def\endlineisspace{\catcode13=10\relax} \chardef\dashChar = `\- \chardef\slashChar = `\/ \chardef\underChar = `\_ % Ignore a token. % \def\gobble#1{} % The following is used inside several \edef's. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} % Hyphenation fixes. \hyphenation{ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script auto-ma-ti-cal-ly ap-pen-dix bit-map bit-maps data-base data-bases eshell fall-ing half-way long-est man-u-script man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces spell-ing spell-ings stand-alone strong-est time-stamp time-stamps which-ever white-space wide-spread wrap-around } % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. We also make % some effort to order the tracing commands to reduce output in the log % file; cf. trace.sty in LaTeX. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% \def\loggingall{% \tracingstats2 \tracingpages1 \tracinglostchars2 % 2 gives us more in etex \tracingparagraphs1 \tracingoutput1 \tracingmacros2 \tracingrestores1 \showboxbreadth\maxdimen \showboxdepth\maxdimen \ifx\eTeXversion\thisisundefined\else % etex gives us more logging \tracingscantokens1 \tracingifs1 \tracinggroups1 \tracingnesting2 \tracingassigns1 \fi \tracingcommands3 % 3 gives us more in etex \errorcontextlines16 }% % @errormsg{MSG}. Do the index-like expansions on MSG, but if things % aren't perfect, it's not the end of the world, being an error message, % after all. % \def\errormsg{\begingroup \indexnofonts \doerrormsg} \def\doerrormsg#1{\errmessage{#1}} % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. % \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount \removelastskip\penalty-50\smallskip\fi\fi} \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount \removelastskip\penalty-100\medskip\fi\fi} \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount \removelastskip\penalty-200\bigskip\fi\fi} % Output routine % % For a final copy, take out the rectangles % that mark overfull boxes (in case you have decided % that the text looks ok even though it passes the margin). % \def\finalout{\overfullrule=0pt } % Do @cropmarks to get crop marks. % \newif\ifcropmarks \let\cropmarks = \cropmarkstrue % % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines \newdimen\cornerlong \cornerlong=1pc \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Output a mark which sets \thischapter, \thissection and \thiscolor. % We dump everything together because we only have one kind of mark. % This works because we only use \botmark / \topmark, not \firstmark. % % A mark contains a subexpression of the \ifcase ... \fi construct. % \get*marks macros below extract the needed part using \ifcase. % % Another complication is to let the user choose whether \thischapter % (\thissection) refers to the chapter (section) in effect at the top % of a page, or that at the bottom of a page. % \domark is called twice inside \chapmacro, to add one % mark before the section break, and one after. % In the second call \prevchapterdefs is the same as \lastchapterdefs, % and \prevsectiondefs is the same as \lastsectiondefs. % Then if the page is not broken at the mark, some of the previous % section appears on the page, and we can get the name of this section % from \firstmark for @everyheadingmarks top. % @everyheadingmarks bottom uses \botmark. % % See page 260 of The TeXbook. \def\domark{% \toks0=\expandafter{\lastchapterdefs}% \toks2=\expandafter{\lastsectiondefs}% \toks4=\expandafter{\prevchapterdefs}% \toks6=\expandafter{\prevsectiondefs}% \toks8=\expandafter{\lastcolordefs}% \mark{% \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom \noexpand\else \the\toks8 % 2: color marks }% } % \gettopheadingmarks, \getbottomheadingmarks, % \getcolormarks - extract needed part of mark. % % \topmark doesn't work for the very first chapter (after the title % page or the contents), so we use \firstmark there -- this gets us % the mark with the chapter defs, unless the user sneaks in, e.g., % @setcolor (or @url, or @link, etc.) between @contents and the very % first @chapter. \def\gettopheadingmarks{% \ifcase0\topmark\fi \ifx\thischapter\empty \ifcase0\firstmark\fi \fi } \def\getbottomheadingmarks{\ifcase1\botmark\fi} \def\getcolormarks{\ifcase2\topmark\fi} % Avoid "undefined control sequence" errors. \def\lastchapterdefs{} \def\lastsectiondefs{} \def\lastsection{} \def\prevchapterdefs{} \def\prevsectiondefs{} \def\lastcolordefs{} % Margin to add to right of even pages, to left of odd pages. \newdimen\bindingoffset \newdimen\normaloffset \newdimen\txipagewidth \newdimen\txipageheight % Main output routine. % \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox % \onepageout takes a vbox as an argument. % \shipout a vbox for a single page, adding an optional header, footer, % cropmarks, and footnote. This also causes index entries for this page % to be written to the auxiliary files. % \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % % Common context changes for both heading and footing. % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars} % % Retrieve the information for the headings from the marks in the page, % and call Plain TeX's \makeheadline and \makefootline, which use the % values in \headline and \footline. % % This is used to check if we are on the first page of a chapter. \ifcase1\topmark\fi \let\prevchaptername\thischaptername \ifcase0\firstmark\fi \let\curchaptername\thischaptername % \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi % \ifx\curchaptername\prevchaptername \let\thischapterheading\thischapter \else % \thischapterheading is the same as \thischapter except it is blank % for the first page of a chapter. This is to prevent the chapter name % being shown twice. \def\thischapterheading{}% \fi % \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}% % {% % Set context for writing to auxiliary files like index files. % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. % We don't want .vr (or whatever) entries like this: % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}} % "\acronym" won't work when it's read back in; % it needs to be % {\code {{\backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \vskip-\topandbottommargin \vtop to0pt{% \line{\ewtop\hfil\ewtop}% \nointerlineskip \line{% \vbox{\moveleft\cornerthick\nstop}% \hfill \vbox{\moveright\cornerthick\nstop}% }% \vss}% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. \ifodd\pageno\hskip\bindingoffset\fi \vbox\bgroup \fi % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. % (We lessened \vsize for it in \oddfootingyyy.) % The \baselineskip=24pt in plain's \makefootline has no effect. \vskip 24pt \unvbox\footlinebox \fi % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick \vbox to0pt{\vss \line{% \vbox{\moveleft\cornerthick\nsbot}% \hfill \vbox{\moveright\cornerthick\nsbot}% }% \nointerlineskip \line{\ewbot\hfil\ewbot}% }% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox }% end of group with \indexdummies \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \newinsert\margin \dimen\margin=\maxdimen % Main part of page, including any footnotes \def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi \dimen@=\dp#1\relax \unvbox#1\relax \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } % Here are the rules for the cropmarks. Note that they are % offset so that the space between them is truly \outerhsize or \outervsize % (P. A. MacKay, 12 November, 1986) % \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} \def\nstop{\vbox {\hrule height\cornerthick depth\cornerlong width\cornerthick}} \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} % Argument parsing % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % For example, \def\foo{\parsearg\fooxxx}. % \def\parsearg{\parseargusing{}} \def\parseargusing#1#2{% \def\argtorun{#2}% \begingroup \obeylines \spaceisspace #1% \parseargline\empty% Insert the \empty token, see \finishparsearg below. } {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. \argremovecomment #1\comment\ArgTerm% }% } % First remove any @comment, then any @c comment. Also remove a @texinfoc % comment (see \scanmacro for details). Pass the result on to \argcheckspaces. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} \def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm} \def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} % Each occurrence of `\^^M' or `\^^M' is replaced by a single space. % % \argremovec might leave us with trailing space, e.g., % @end itemize @c foo % This space token undergoes the same procedure and is eventually removed % by \finishparsearg. % \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% \def\temp{#3}% \ifx\temp\empty % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: \let\temp\finishparsearg \else \let\temp\argcheckspaces \fi % Put the space token in: \temp#1 #3\ArgTerm } % If a _delimited_ argument is enclosed in braces, they get stripped; so % to get _exactly_ the rest of the line, we had to prevent such situation. % We prepended an \empty token at the very beginning and we expand it now, % just before passing the control to \argtorun. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is % either the null string, or it ends with \^^M---thus there is no danger % that a pair of braces would be stripped. % % But first, we have to remove the trailing space token. % \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} % \parseargdef - define a command taking an argument on the line % % \parseargdef\foo{...} % is roughly equivalent to % \def\foo{\parsearg\Xfoo} % \def\Xfoo#1{...} \def\parseargdef#1{% \expandafter \doparseargdef \csname\string#1\endcsname #1% } \def\doparseargdef#1#2{% \def#2{\parsearg#1}% \def#1##1% } % Several utility definitions with active space: { \obeyspaces \gdef\obeyedspace{ } % Make each space character in the input produce a normal interword % space in the output. Don't allow a line break at this space, as this % is used only in environments like @example, where each line of input % should produce a line of output anyway. % \gdef\sepspaces{\obeyspaces\let =\tie} % If an index command is used in an @example environment, any spaces % therein should become regular spaces in the raw index file, not the % expansion of \tie (\leavevmode \penalty \@M \ ). \gdef\unsepspaces{\let =\space} } \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} % Define the framework for environments in texinfo.tex. It's used like this: % % \envdef\foo{...} % \def\Efoo{...} % % It's the responsibility of \envdef to insert \begingroup before the % actual body; @end closes the group after calling \Efoo. \envdef also % defines \thisenv, so the current environment is known; @end checks % whether the environment name matches. The \checkenv macro can also be % used to check whether the current environment is the one expected. % % Non-false conditionals (@iftex, @ifset) don't fit into this, so they % are not treated as environments; they don't open a group. (The % implementation of @end takes care not to call \endgroup in this % special case.) % At run-time, environments start with this: \def\startenvironment#1{\begingroup\def\thisenv{#1}} % initialize \let\thisenv\empty % ... but they get defined via ``\envdef\foo{...}'': \long\def\envdef#1#2{\def#1{\startenvironment#1#2}} \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} % Check whether we're in the right environment: \def\checkenv#1{% \def\temp{#1}% \ifx\thisenv\temp \else \badenverr \fi } % Environment mismatch, #1 expected: \def\badenverr{% \errhelp = \EMsimple \errmessage{This command can appear only \inenvironment\temp, not \inenvironment\thisenv}% } \def\inenvironment#1{% \ifx#1\empty outside of any environment% \else in environment \expandafter\string#1% \fi } % @end foo executes the definition of \Efoo. % But first, it executes a specialized version of \checkenv % \parseargdef\end{% \if 1\csname iscond.#1\endcsname \else % The general wording of \badenverr may not be ideal. \expandafter\checkenv\csname#1\endcsname \csname E#1\endcsname \endgroup \fi } \newhelp\EMsimple{Press RETURN to continue.} % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and % since \penalty is valid in vertical mode, we'd end up putting the % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 % Avoid using \@M directly, because that causes trouble % if the definition is written into an index file. \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } % @* forces a line break. \def\*{\unskip\hfil\break\hbox{}\ignorespaces} % @/ allows a line break. \let\/=\allowbreak % @. is an end-of-sentence period. \def\.{.\spacefactor=\endofsentencespacefactor\space} % @! is an end-of-sentence bang. \def\!{!\spacefactor=\endofsentencespacefactor\space} % @? is an end-of-sentence query. \def\?{?\spacefactor=\endofsentencespacefactor\space} % @frenchspacing on|off says whether to put extra space after punctuation. % \def\onword{on} \def\offword{off} % \parseargdef\frenchspacing{% \def\temp{#1}% \ifx\temp\onword \plainfrenchspacing \else\ifx\temp\offword \plainnonfrenchspacing \else \errhelp = \EMsimple \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% \fi\fi } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would % produce a whole line of output instead of starting the paragraph. \def\w#1{\leavevmode\hbox{#1}} % @group ... @end group forces ... to be all on one page, by enclosing % it in a TeX vbox. We use \vtop instead of \vbox to construct the box % to keep its height that of a normal line. According to the rules for % \topskip (p.114 of the TeXbook), the glue inserted is % max (\topskip - \ht (first item), 0). If that height is large, % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % % Another complication is that the group might be very large. This can % cause the glue on the previous page to be unduly stretched, because it % does not have much material. In this case, it's better to add an % explicit \vfill so that the extra space is at the bottom. The % threshold for doing this is if the group is more than \vfilllimit % percent of a page (\vfilllimit can be changed inside of @tex). % \newbox\groupbox \def\vfilllimit{0.7} % \envdef\group{% \ifnum\catcode`\^^M=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi \startsavinginserts % \setbox\groupbox = \vtop\bgroup % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after % the `@group' to put extra space in the output. Since @group % should appear on a line by itself (according to the Texinfo % manual), we don't worry about eating any user text. \comment } % % The \vtop produces a box with normal height and large depth; thus, TeX puts % \baselineskip glue before it, and (when the next line of text is done) % \lineskip glue after it. Thus, space below is not quite equal to space % above. But it's pretty close. \def\Egroup{% % To get correct interline space between the last line of the group % and the first line afterwards, we have to propagate \prevdepth. \endgraf % Not \par, as it may have been set to \lisppar. \global\dimen1 = \prevdepth \egroup % End the \vtop. \addgroupbox \prevdepth = \dimen1 \checkinserts } \def\addgroupbox{ % \dimen0 is the vertical size of the group's box. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox % \dimen2 is how much space is left on the page (more or less). \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal % if the group doesn't fit on the current page, and it's a big big % group, force a page break. \ifdim \dimen0 > \dimen2 \ifdim \pagetotal < \vfilllimit\txipageheight \page \fi \fi \box\groupbox } % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % \newhelp\groupinvalidhelp{% group can only be used in environments such as @example,^^J% where each line of input produces a line of output.} % @need space-in-mils % forces a page break if there is not space-in-mils remaining. \newdimen\mil \mil=0.001in \parseargdef\need{% % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par % % If the @need value is less than one line space, it's useless. \dimen0 = #1\mil \dimen2 = \ht\strutbox \advance\dimen2 by \dp\strutbox \ifdim\dimen0 > \dimen2 % % Do a \strut just to make the height of this box be normal, so the % normal leading is inserted relative to the preceding line. % And a page break here is fine. \vtop to #1\mil{\strut\vfil}% % % TeX does not even consider page breaks if a penalty added to the % main vertical list is 10000 or more. But in order to see if the % empty box we just added fits on the page, we must make it consider % page breaks. On the other hand, we don't want to actually break the % page after the empty box. So we use a penalty of 9999. % % There is an extremely small chance that TeX will actually break the % page at this \penalty, if there are no other feasible breakpoints in % sight. (If the user is using lots of big @group commands, which % almost-but-not-quite fill up a page, TeX will have a hard time doing % good page breaking, for example.) However, I could not construct an % example where a page broke at this \penalty; if it happens in a real % document, then we can reconsider our strategy. \penalty9999 % % Back up by the size of the box, whether we did a page break or not. \kern -#1\mil % % Do not allow a page break right after this kern. \nobreak \fi } % @br forces paragraph break (and is undocumented). \let\br = \par % @page forces the start of a new page. % \def\page{\par\vfill\supereject} % @exdent text.... % outputs text on separate line in roman font, starting at standard page margin % This records the amount of indent in the innermost environment. % That's how much \exdent should take out. \newskip\exdentamount % This defn is used inside fill environments such as @defun. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} % This defn is used inside nofill environments such as @example. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current % paragraph. For more general purposes, use the \margin insertion % class. WHICH is `l' or `r'. Not documented, written for gawk manual. % \newskip\inmarginspacing \inmarginspacing=1cm \def\strutdepth{\dp\strutbox} % \def\doinmargin#1#2{\strut\vadjust{% \nobreak \kern-\strutdepth \vtop to \strutdepth{% \baselineskip=\strutdepth \vss % if you have multiple lines of stuff to put here, you'll need to % make the vbox yourself of the appropriate size. \ifx#1l% \llap{\ignorespaces #2\hskip\inmarginspacing}% \else \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% \fi \null }% }} \def\inleftmargin{\doinmargin l} \def\inrightmargin{\doinmargin r} % % @inmargin{TEXT [, RIGHT-TEXT]} % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; % else use TEXT for both). % \def\inmargin#1{\parseinmargin #1,,\finish} \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \def\lefttext{#1}% have both texts \def\righttext{#2}% \else \def\lefttext{#1}% have only one text \def\righttext{#1}% \fi % \ifodd\pageno \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin \else \def\temp{\inleftmargin\lefttext}% \fi \temp } % @include FILE -- \input text of FILE. % \def\include{\parseargusing\filenamecatcodes\includezzz} \def\includezzz#1{% \pushthisfilestack \def\thisfile{#1}% {% \makevalueexpandable % we want to expand any @value in FILE. \turnoffactive % and allow special characters in the expansion \indexnofonts % Allow `@@' and other weird things in file names. \wlog{texinfo.tex: doing @include of #1^^J}% \edef\temp{\noexpand\input #1 }% % % This trickery is to read FILE outside of a group, in case it makes % definitions, etc. \expandafter }\temp \popthisfilestack } \def\filenamecatcodes{% \catcode`\\=\other \catcode`~=\other \catcode`^=\other \catcode`_=\other \catcode`|=\other \catcode`<=\other \catcode`>=\other \catcode`+=\other \catcode`-=\other \catcode`\`=\other \catcode`\'=\other } \def\pushthisfilestack{% \expandafter\pushthisfilestackX\popthisfilestack\StackTerm } \def\pushthisfilestackX{% \expandafter\pushthisfilestackY\thisfile\StackTerm } \def\pushthisfilestackY #1\StackTerm #2\StackTerm {% \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% } \def\popthisfilestack{\errthisfilestackempty} \def\errthisfilestackempty{\errmessage{Internal error: the stack of filenames is empty.}} % \def\thisfile{} % @center line % outputs that line, centered. % \parseargdef\center{% \ifhmode \let\centersub\centerH \else \let\centersub\centerV \fi \centersub{\hfil \ignorespaces#1\unskip \hfil}% \let\centersub\relax % don't let the definition persist, just in case } \def\centerH#1{{% \hfil\break \advance\hsize by -\leftskip \advance\hsize by -\rightskip \line{#1}% \break }} % \newcount\centerpenalty \def\centerV#1{% % The idea here is the same as in \startdefun, \cartouche, etc.: if % @center is the first thing after a section heading, we need to wipe % out the negative parskip inserted by \sectionheading, but still % prevent a page break here. \centerpenalty = \lastpenalty \ifnum\centerpenalty>10000 \vskip\parskip \fi \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi \line{\kern\leftskip #1\kern\rightskip}% } % @sp n outputs n lines of vertical space % \parseargdef\sp{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment \def\c{\begingroup \catcode`\^^M=\active% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \cxxx} {\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}} % \let\comment\c % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. % NCHARS can also be the word `asis' or `none'. % We cannot feasibly implement @paragraphindent asis, though. % \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % \parseargdef\paragraphindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \defaultparindent = 0pt \else \defaultparindent = #1em \fi \fi \parindent = \defaultparindent } % @exampleindent NCHARS % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. \parseargdef\exampleindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \lispnarrowing = 0pt \else \lispnarrowing = #1em \fi \fi } % @firstparagraphindent WORD % If WORD is `none', then suppress indentation of the first paragraph % after a section heading. If WORD is `insert', then do indent at such % paragraphs. % % The paragraph indentation is suppressed or not by calling % \suppressfirstparagraphindent, which the sectioning commands do. % We switch the definition of this back and forth according to WORD. % By default, we suppress indentation. % \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} \def\insertword{insert} % \parseargdef\firstparagraphindent{% \def\temp{#1}% \ifx\temp\noneword \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent \else\ifx\temp\insertword \let\suppressfirstparagraphindent = \relax \else \errhelp = \EMsimple \errmessage{Unknown @firstparagraphindent option `\temp'}% \fi\fi } % Here is how we actually suppress indentation. Redefine \everypar to % \kern backwards by \parindent, and then reset itself to empty. % % We also make \indent itself not actually do anything until the next % paragraph. % \gdef\dosuppressfirstparagraphindent{% \gdef\indent {\restorefirstparagraphindent \indent}% \gdef\noindent{\restorefirstparagraphindent \noindent}% \global\everypar = {\kern -\parindent \restorefirstparagraphindent}% } % \gdef\restorefirstparagraphindent{% \global\let\indent = \ptexindent \global\let\noindent = \ptexnoindent \global\everypar = {}% } % @refill is a no-op. \let\refill=\relax % @setfilename INFO-FILENAME - ignored \let\setfilename=\comment % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} \message{pdf,} % adobe `portable' document format \newcount\tempnum \newcount\lnkcount \newtoks\filename \newcount\filenamelength \newcount\pgn \newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD \newbox\boxA \newbox\boxB \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest % % For LuaTeX % \newif\iftxiuseunicodedestname \txiuseunicodedestnamefalse % For pdfTeX etc. \ifx\luatexversion\thisisundefined \else % Use Unicode destination names \txiuseunicodedestnametrue % Escape PDF strings with converting UTF-16 from UTF-8 \begingroup \catcode`\%=12 \directlua{ function UTF16oct(str) tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377') for c in string.utfvalues(str) do if c < 0x10000 then tex.sprint( string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. string.char(0x5c) .. string.char(0x25) .. '03o', (c / 256), (c % 256))) else c = c - 0x10000 local c_hi = c / 1024 + 0xd800 local c_lo = c % 1024 + 0xdc00 tex.sprint( string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. string.char(0x5c) .. string.char(0x25) .. '03o' .. string.char(0x5c) .. string.char(0x25) .. '03o' .. string.char(0x5c) .. string.char(0x25) .. '03o', (c_hi / 256), (c_hi % 256), (c_lo / 256), (c_lo % 256))) end end end } \endgroup \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}} % Escape PDF strings without converting \begingroup \directlua{ function PDFescstr(str) for c in string.bytes(str) do if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then tex.sprint( string.format(string.char(0x5c) .. string.char(0x25) .. '03o', c)) else tex.sprint(string.char(c)) end end end } \endgroup \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}} \ifnum\luatexversion>84 % For LuaTeX >= 0.85 \def\pdfdest{\pdfextension dest} \let\pdfoutput\outputmode \def\pdfliteral{\pdfextension literal} \def\pdfcatalog{\pdfextension catalog} \def\pdftexversion{\numexpr\pdffeedback version\relax} \let\pdfximage\saveimageresource \let\pdfrefximage\useimageresource \let\pdflastximage\lastsavedimageresourceindex \def\pdfendlink{\pdfextension endlink\relax} \def\pdfoutline{\pdfextension outline} \def\pdfstartlink{\pdfextension startlink} \def\pdffontattr{\pdfextension fontattr} \def\pdfobj{\pdfextension obj} \def\pdflastobj{\numexpr\pdffeedback lastobj\relax} \let\pdfpagewidth\pagewidth \let\pdfpageheight\pageheight \edef\pdfhorigin{\pdfvariable horigin} \edef\pdfvorigin{\pdfvariable vorigin} \fi \fi % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 % can be set). So we test for \relax and 0 as well as being undefined. \ifx\pdfoutput\thisisundefined \else \ifx\pdfoutput\relax \else \ifcase\pdfoutput \else \pdftrue \fi \fi \fi % PDF uses PostScript string constants for the names of xref targets, % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be % interpreted as a newline (\n), followed by o, d, e. Not good. % % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and % related messages. The final outcome is that it is up to the TeX user % to double the backslashes and otherwise make the string valid, so % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to % do this reliably, so we use it. % #1 is a control sequence in which to do the replacements, % which we \xdef. \def\txiescapepdf#1{% \ifx\pdfescapestring\thisisundefined % No primitive available; should we give a warning or log? % Many times it won't matter. \xdef#1{#1}% \else % The expandable \pdfescapestring primitive escapes parentheses, % backslashes, and other special chars. \xdef#1{\pdfescapestring{#1}}% \fi } \def\txiescapepdfutfsixteen#1{% \ifx\pdfescapestrutfsixteen\thisisundefined % No UTF-16 converting macro available. \txiescapepdf{#1}% \else \xdef#1{\pdfescapestrutfsixteen{#1}}% \fi } \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images with PDF output, and none of those formats could be found. (.eps cannot be supported due to the design of the PDF format; use regular TeX (DVI output) for that.)} \ifpdf % % Color manipulation macros using ideas from pdfcolor.tex, % except using rgb instead of cmyk; the latter is said to render as a % very dark gray on-screen and a very dark halftone in print, instead % of actual black. The dark red here is dark enough to print on paper as % nearly black, but still distinguishable for online viewing. We use % black by default, though. \def\rgbDarkRed{0.50 0.09 0.12} \def\rgbBlack{0 0 0} % % rg sets the color for filling (usual text, etc.); % RG sets the color for stroking (thin rules, e.g., normal _'s). \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} % % Set color, and create a mark which defines \thiscolor accordingly, % so that \makeheadline knows which color to restore. \def\setcolor#1{% \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% \domark \pdfsetcolor{#1}% } % \def\maincolor{\rgbBlack} \pdfsetcolor{\maincolor} \edef\thiscolor{\maincolor} \def\lastcolordefs{} % \def\makefootline{% \baselineskip24pt \line{\pdfsetcolor{\maincolor}\the\footline}% } % \def\makeheadline{% \vbox to 0pt{% \vskip-22.5pt \line{% \vbox to8.5pt{}% % Extract \thiscolor definition from the marks. \getcolormarks % Typeset the headline with \maincolor, then restore the color. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% }% \vss }% \nointerlineskip } % % \pdfcatalog{/PageMode /UseOutlines} % % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\dopdfimage#1#2#3{% \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% % % pdftex (and the PDF format) support .pdf, .png, .jpg (among % others). Let's try in that order, PDF first since if % someone has a scalable image, presumably better to use that than a % bitmap. \let\pdfimgext=\empty \begingroup \openin 1 #1.pdf \ifeof 1 \openin 1 #1.PDF \ifeof 1 \openin 1 #1.png \ifeof 1 \openin 1 #1.jpg \ifeof 1 \openin 1 #1.jpeg \ifeof 1 \openin 1 #1.JPG \ifeof 1 \errhelp = \nopdfimagehelp \errmessage{Could not find image file #1 for pdf}% \else \gdef\pdfimgext{JPG}% \fi \else \gdef\pdfimgext{jpeg}% \fi \else \gdef\pdfimgext{jpg}% \fi \else \gdef\pdfimgext{png}% \fi \else \gdef\pdfimgext{PDF}% \fi \else \gdef\pdfimgext{pdf}% \fi \closein 1 \endgroup % % without \immediate, ancient pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 \immediate\pdfimage \else \immediate\pdfximage \fi \ifdim \wd0 >0pt width \pdfimagewidth \fi \ifdim \wd2 >0pt height \pdfimageheight \fi \ifnum\pdftexversion<13 #1.\pdfimgext \else {#1.\pdfimgext}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} % \def\setpdfdestname#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. \indexnofonts \makevalueexpandable \turnoffactive \iftxiuseunicodedestname \ifx \declaredencoding \latone % Pass through Latin-1 characters. % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode. \else \ifx \declaredencoding \utfeight % Pass through Unicode characters. \else % Use ASCII approximations in destination names. \passthroughcharsfalse \fi \fi \else % Use ASCII approximations in destination names. \passthroughcharsfalse \fi \def\pdfdestname{#1}% \txiescapepdf\pdfdestname }} % \def\setpdfoutlinetext#1{{% \indexnofonts \makevalueexpandable \turnoffactive \ifx \declaredencoding \latone % The PDF format can use an extended form of Latin-1 in bookmark % strings. See Appendix D of the PDF Reference, Sixth Edition, for % the "PDFDocEncoding". \passthroughcharstrue % Pass through Latin-1 characters. % LuaTeX: Convert to Unicode % pdfTeX: Use Latin-1 as PDFDocEncoding \def\pdfoutlinetext{#1}% \else \ifx \declaredencoding \utfeight \ifx\luatexversion\thisisundefined % For pdfTeX with UTF-8. % TODO: the PDF format can use UTF-16 in bookmark strings, % but the code for this isn't done yet. % Use ASCII approximations. \passthroughcharsfalse \def\pdfoutlinetext{#1}% \else % For LuaTeX with UTF-8. % Pass through Unicode characters for title texts. \passthroughcharstrue \def\pdfoutlinetext{#1}% \fi \else % For non-Latin-1 or non-UTF-8 encodings. % Use ASCII approximations. \passthroughcharsfalse \def\pdfoutlinetext{#1}% \fi \fi % LuaTeX: Convert to UTF-16 % pdfTeX: Use Latin-1 as PDFDocEncoding \txiescapepdfutfsixteen\pdfoutlinetext }} % \def\pdfmkdest#1{% \setpdfdestname{#1}% \safewhatsit{\pdfdest name{\pdfdestname} xyz}% } % % used to mark target names; must be expandable. \def\pdfmkpgn#1{#1} % % by default, use black for everything. \def\urlcolor{\rgbBlack} \def\linkcolor{\rgbBlack} \def\endlink{\setcolor{\maincolor}\pdfendlink} % % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax \advance\tempnum by 1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} % % #1 is the section text, which is what will be displayed in the % outline by the pdf viewer. #2 is the pdf expression for the number % of subentries (or empty, for subsubsections). #3 is the node text, % which might be empty if this toc entry had no corresponding node. % #4 is the page number % \def\dopdfoutline#1#2#3#4{% % Generate a link to the node text if that exists; else, use the % page number. We could generate a destination for the section % text in the case where a section has no node, but it doesn't % seem worth the trouble, since most documents are normally structured. \setpdfoutlinetext{#1} \setpdfdestname{#3} \ifx\pdfdestname\empty \def\pdfdestname{#4}% \fi % \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% \begingroup % Read toc silently, to get counts of subentries for \pdfoutline. \def\partentry##1##2##3##4{}% ignore parts in the outlines \def\numchapentry##1##2##3##4{% \def\thischapnum{##2}% \def\thissecnum{0}% \def\thissubsecnum{0}% }% \def\numsecentry##1##2##3##4{% \advancenumber{chap\thischapnum}% \def\thissecnum{##2}% \def\thissubsecnum{0}% }% \def\numsubsecentry##1##2##3##4{% \advancenumber{sec\thissecnum}% \def\thissubsecnum{##2}% }% \def\numsubsubsecentry##1##2##3##4{% \advancenumber{subsec\thissubsecnum}% }% \def\thischapnum{0}% \def\thissecnum{0}% \def\thissubsecnum{0}% % % use \def rather than \let here because we redefine \chapentry et % al. a second time, below. \def\appentry{\numchapentry}% \def\appsecentry{\numsecentry}% \def\appsubsecentry{\numsubsecentry}% \def\appsubsubsecentry{\numsubsubsecentry}% \def\unnchapentry{\numchapentry}% \def\unnsecentry{\numsecentry}% \def\unnsubsecentry{\numsubsecentry}% \def\unnsubsubsecentry{\numsubsubsecentry}% \readdatafile{toc}% % % Read toc second time, this time actually producing the outlines. % The `-' means take the \expnumber as the absolute number of % subentries, which we calculated on our first read of the .toc above. % % We use the node names as the destinations. \def\numchapentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% \def\numsubsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% \def\numsubsubsecentry##1##2##3##4{% count is always zero \dopdfoutline{##1}{}{##3}{##4}}% % % PDF outlines are displayed using system fonts, instead of % document fonts. Therefore we cannot use special characters, % since the encoding is unknown. For example, the eogonek from % Latin 2 (0xea) gets translated to a | character. Info from % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. % % TODO this right, we have to translate 8-bit characters to % their "best" equivalent, based on the @documentencoding. Too % much work for too little return. Just use the ASCII equivalents % we use for the index sort strings. % \indexnofonts \setupdatafile % We can have normal brace characters in the PDF outlines, unlike % Texinfo index files. So set that up. \def\{{\lbracecharliteral}% \def\}{\rbracecharliteral}% \catcode`\\=\active \otherbackslash \input \tocreadfilename \endgroup } {\catcode`[=1 \catcode`]=2 \catcode`{=\other \catcode`}=\other \gdef\lbracecharliteral[{]% \gdef\rbracecharliteral[}]% ] % \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces \addtokens{\filename}{\PP}% \advance\filenamelength by 1 \fi \nextsp} \def\getfilename#1{% \filenamelength=0 % If we don't expand the argument now, \skipspaces will get % snagged on things like "@value{foo}". \edef\temp{#1}% \expandafter\skipspaces\temp|\relax } \ifnum\pdftexversion < 14 \let \startlink \pdfannotlink \else \let \startlink \pdfstartlink \fi % make a live url in pdf output. \def\pdfurl#1{% \begingroup % it seems we really need yet another set of dummies; have not % tried to figure out what each command should do in the context % of @url. for now, just make @/ a no-op, that's the only one % people have actually reported a problem with. % \normalturnoffactive \def\@{@}% \let\/=\empty \makevalueexpandable % do we want to go so far as to use \indexnofonts instead of just % special-casing \var here? \def\var##1{##1}% % \leavevmode\setcolor{\urlcolor}% \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% \expandafter\poptoks\the\toksA|ENDTOKS|\relax \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else \let\next=\maketoks \addtokens{\toksB}{\the\toksD} \ifx\first,\addtokens{\toksB}{\space}\fi \fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \setcolor{\linkcolor}#1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \else % non-pdf mode \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax \let\setcolor = \gobble \let\pdfsetcolor = \gobble \let\pdfmakeoutlines = \relax \fi % \ifx\pdfoutput % % For XeTeX % \ifx\XeTeXrevision\thisisundefined \else % % XeTeX version check % \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1 % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307. % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941). % For avoiding PDF destination name replacement, we use this special % instead of xdvipdfmx's command line option `-C 0x0010'. \special{dvipdfmx:config C 0x0010} % XeTeX 0.99995+ comes with xdvipdfmx 20160307+. % It can handle Unicode destination names for PDF. \txiuseunicodedestnametrue \else % XeTeX < 0.99996 (TeX Live < 2016) cannot use the % `dvipdfmx:config' special. % So for avoiding PDF destination name replacement, % xdvipdfmx's command line option `-C 0x0010' is necessary. % % XeTeX < 0.99995 can not handle Unicode destination names for PDF % because xdvipdfmx 20150315 has a UTF-16 conversion issue. % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). \txiuseunicodedestnamefalse \fi % % Color support % \def\rgbDarkRed{0.50 0.09 0.12} \def\rgbBlack{0 0 0} % \def\pdfsetcolor#1{\special{pdf:scolor [#1]}} % % Set color, and create a mark which defines \thiscolor accordingly, % so that \makeheadline knows which color to restore. \def\setcolor#1{% \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% \domark \pdfsetcolor{#1}% } % \def\maincolor{\rgbBlack} \pdfsetcolor{\maincolor} \edef\thiscolor{\maincolor} \def\lastcolordefs{} % \def\makefootline{% \baselineskip24pt \line{\pdfsetcolor{\maincolor}\the\footline}% } % \def\makeheadline{% \vbox to 0pt{% \vskip-22.5pt \line{% \vbox to8.5pt{}% % Extract \thiscolor definition from the marks. \getcolormarks % Typeset the headline with \maincolor, then restore the color. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% }% \vss }% \nointerlineskip } % % PDF outline support % % Emulate pdfTeX primitive \def\pdfdest name#1 xyz{% \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}% } % \def\setpdfdestname#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. \indexnofonts \makevalueexpandable \turnoffactive \iftxiuseunicodedestname % Pass through Unicode characters. \else % Use ASCII approximations in destination names. \passthroughcharsfalse \fi \def\pdfdestname{#1}% \txiescapepdf\pdfdestname }} % \def\setpdfoutlinetext#1{{% \turnoffactive % Always use Unicode characters in title texts. \def\pdfoutlinetext{#1}% % For XeTeX, xdvipdfmx converts to UTF-16. % So we do not convert. \txiescapepdf\pdfoutlinetext }} % \def\pdfmkdest#1{% \setpdfdestname{#1}% \safewhatsit{\pdfdest name{\pdfdestname} xyz}% } % % by default, use black for everything. \def\urlcolor{\rgbBlack} \def\linkcolor{\rgbBlack} \def\endlink{\setcolor{\maincolor}\pdfendlink} % \def\dopdfoutline#1#2#3#4{% \setpdfoutlinetext{#1} \setpdfdestname{#3} \ifx\pdfdestname\empty \def\pdfdestname{#4}% \fi % \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A << /S /GoTo /D (\pdfdestname) >> >> }% } % \def\pdfmakeoutlines{% \begingroup % % For XeTeX, counts of subentries are not necessary. % Therefore, we read toc only once. % % We use node names as destinations. \def\partentry##1##2##3##4{}% ignore parts in the outlines \def\numchapentry##1##2##3##4{% \dopdfoutline{##1}{1}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{2}{##3}{##4}}% \def\numsubsecentry##1##2##3##4{% \dopdfoutline{##1}{3}{##3}{##4}}% \def\numsubsubsecentry##1##2##3##4{% \dopdfoutline{##1}{4}{##3}{##4}}% % \let\appentry\numchapentry% \let\appsecentry\numsecentry% \let\appsubsecentry\numsubsecentry% \let\appsubsubsecentry\numsubsubsecentry% \let\unnchapentry\numchapentry% \let\unnsecentry\numsecentry% \let\unnsubsecentry\numsubsecentry% \let\unnsubsubsecentry\numsubsubsecentry% % % For XeTeX, xdvipdfmx converts strings to UTF-16. % Therefore, the encoding and the language may not be considered. % \indexnofonts \setupdatafile % We can have normal brace characters in the PDF outlines, unlike % Texinfo index files. So set that up. \def\{{\lbracecharliteral}% \def\}{\rbracecharliteral}% \catcode`\\=\active \otherbackslash \input \tocreadfilename \endgroup } {\catcode`[=1 \catcode`]=2 \catcode`{=\other \catcode`}=\other \gdef\lbracecharliteral[{]% \gdef\rbracecharliteral[}]% ] \special{pdf:docview << /PageMode /UseOutlines >> } % ``\special{pdf:tounicode ...}'' is not necessary % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it. % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315, % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings. % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). % \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces \addtokens{\filename}{\PP}% \advance\filenamelength by 1 \fi \nextsp} \def\getfilename#1{% \filenamelength=0 % If we don't expand the argument now, \skipspaces will get % snagged on things like "@value{foo}". \edef\temp{#1}% \expandafter\skipspaces\temp|\relax } % make a live url in pdf output. \def\pdfurl#1{% \begingroup % it seems we really need yet another set of dummies; have not % tried to figure out what each command should do in the context % of @url. for now, just make @/ a no-op, that's the only one % people have actually reported a problem with. % \normalturnoffactive \def\@{@}% \let\/=\empty \makevalueexpandable % do we want to go so far as to use \indexnofonts instead of just % special-casing \var here? \def\var##1{##1}% % \leavevmode\setcolor{\urlcolor}% \special{pdf:bann << /Border [0 0 0] /Subtype /Link /A << /S /URI /URI (#1) >> >>}% \endgroup} \def\endlink{\setcolor{\maincolor}\special{pdf:eann}} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% \expandafter\poptoks\the\toksA|ENDTOKS|\relax \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else \let\next=\maketoks \addtokens{\toksB}{\the\toksD} \ifx\first,\addtokens{\toksB}{\space}\fi \fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}% \setcolor{\linkcolor}#1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} % % % @image support % % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\doxeteximage#1#2#3{% \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% % % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among % others). Let's try in that order, PDF first since if % someone has a scalable image, presumably better to use that than a % bitmap. \let\xeteximgext=\empty \begingroup \openin 1 #1.pdf \ifeof 1 \openin 1 #1.PDF \ifeof 1 \openin 1 #1.png \ifeof 1 \openin 1 #1.jpg \ifeof 1 \openin 1 #1.jpeg \ifeof 1 \openin 1 #1.JPG \ifeof 1 \errmessage{Could not find image file #1 for XeTeX}% \else \gdef\xeteximgext{JPG}% \fi \else \gdef\xeteximgext{jpeg}% \fi \else \gdef\xeteximgext{jpg}% \fi \else \gdef\xeteximgext{png}% \fi \else \gdef\xeteximgext{PDF}% \fi \else \gdef\xeteximgext{pdf}% \fi \closein 1 \endgroup % \def\xetexpdfext{pdf}% \ifx\xeteximgext\xetexpdfext \XeTeXpdffile "#1".\xeteximgext "" \else \def\xetexpdfext{PDF}% \ifx\xeteximgext\xetexpdfext \XeTeXpdffile "#1".\xeteximgext "" \else \XeTeXpicfile "#1".\xeteximgext "" \fi \fi \ifdim \wd0 >0pt width \xeteximagewidth \fi \ifdim \wd2 >0pt height \xeteximageheight \fi \relax } \fi % \message{fonts,} % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. % \def\lineskipfactor{.08333} \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % % can get a sort of poor man's double spacing by redefining this. \def\baselinefactor{1} % \newdimen\textleading \def\setleading#1{% \dimen0 = #1\relax \normalbaselineskip = \baselinefactor\dimen0 \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% \vrule width0pt height\strutheightpercent\baselineskip depth \strutdepthpercent \baselineskip }% } % PDF CMaps. See also LaTeX's t1.cmap. % % do nothing with this by default. \expandafter\let\csname cmapOT1\endcsname\gobble \expandafter\let\csname cmapOT1IT\endcsname\gobble \expandafter\let\csname cmapOT1TT\endcsname\gobble % if we are producing pdf, and we have \pdffontattr, then define cmaps. % (\pdffontattr was introduced many years ago, but people still run % older pdftex's; it's easy to conditionalize, so we do.) \ifpdf \ifx\pdffontattr\thisisundefined \else \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1-0) %%Title: (TeX-OT1-0 TeX OT1 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1) /Supplement 0 >> def /CMapName /TeX-OT1-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <23> <26> <0023> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 40 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1IT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1IT-0) %%Title: (TeX-OT1IT-0 TeX OT1IT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1IT) /Supplement 0 >> def /CMapName /TeX-OT1IT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <25> <26> <0025> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 42 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <23> <0023> <24> <00A3> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1IT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1TT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1TT-0) %%Title: (TeX-OT1TT-0 TeX OT1TT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1TT) /Supplement 0 >> def /CMapName /TeX-OT1TT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 5 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <21> <26> <0021> <28> <5F> <0028> <61> <7E> <0061> endbfrange 32 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <2191> <0C> <2193> <0D> <0027> <0E> <00A1> <0F> <00BF> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <20> <2423> <27> <2019> <60> <2018> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1TT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% \fi\fi % Set the font macro #1 to the font named \fontprefix#2. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit). % Example: % #1 = \textrm % #2 = \rmshape % #3 = 10 % #4 = \mainmagstep % #5 = OT1 % \def\setfont#1#2#3#4#5{% \font#1=\fontprefix#2#3 scaled #4 \csname cmap#5\endcsname#1% } % This is what gets called when #5 of \setfont is empty. \let\cmap\gobble % % (end of cmaps) % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix % before you read in texinfo.tex. \ifx\fontprefix\thisisundefined \def\fontprefix{cm} \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} \def\rmbshape{bx} % where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} \def\ttbshape{tt} \def\ttslshape{sltt} \def\itshape{ti} \def\itbshape{bxti} \def\slshape{sl} \def\slbshape{bxsl} \def\sfshape{ss} \def\sfbshape{ss} \def\scshape{csc} \def\scbshape{csc} % Definitions for a main text size of 11pt. (The default in Texinfo.) % \def\definetextfontsizexi{% % Text fonts (11.2pt, magstep1). \def\textnominalsize{11pt} \edef\mainmagstep{\magstephalf} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1095} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstep1}{OT1} \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} \setfont\defsl\slshape{10}{\magstep1}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} \def\df{\let\ttfont=\deftt \let\bffont = \defbf \let\ttslfont=\defttsl \let\slfont=\defsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for math mode superscripts (7pt). \def\sevennominalsize{7pt} \setfont\sevenrm\rmshape{7}{1000}{OT1} \setfont\seventt\ttshape{10}{700}{OT1TT} \setfont\sevenbf\bfshape{10}{700}{OT1} \setfont\sevenit\itshape{7}{1000}{OT1IT} \setfont\sevensl\slshape{10}{700}{OT1} \setfont\sevensf\sfshape{10}{700}{OT1} \setfont\sevensc\scshape{10}{700}{OT1} \setfont\seventtsl\ttslshape{10}{700}{OT1TT} \font\seveni=cmmi7 \font\sevensy=cmsy7 \def\sevenecsize{0700} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter (and unnumbered) fonts (17.28pt). \def\chapnominalsize{17pt} \setfont\chaprm\rmbshape{12}{\magstep2}{OT1} \setfont\chapit\itbshape{10}{\magstep3}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep3}{OT1} \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} \setfont\chapsf\sfbshape{17}{1000}{OT1} \let\chapbf=\chaprm \setfont\chapsc\scbshape{10}{\magstep3}{OT1} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 \def\chapecsize{1728} % Section fonts (14.4pt). \def\secnominalsize{14pt} \setfont\secrm\rmbshape{12}{\magstep1}{OT1} \setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1} \setfont\secit\itbshape{10}{\magstep2}{OT1IT} \setfont\secsl\slbshape{10}{\magstep2}{OT1} \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\secsf\sfbshape{12}{\magstep1}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep2}{OT1} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 \def\sececsize{1440} % Subsection fonts (13.15pt). \def\ssecnominalsize{13pt} \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} \setfont\ssecit\itbshape{10}{1315}{OT1IT} \setfont\ssecsl\slbshape{10}{1315}{OT1} \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1315}{OT1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 \def\ssececsize{1200} % Reduced fonts for @acronym in text (10pt). \def\reducednominalsize{10pt} \setfont\reducedrm\rmshape{10}{1000}{OT1} \setfont\reducedtt\ttshape{10}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{1000}{OT1} \setfont\reducedit\itshape{10}{1000}{OT1IT} \setfont\reducedsl\slshape{10}{1000}{OT1} \setfont\reducedsf\sfshape{10}{1000}{OT1} \setfont\reducedsc\scshape{10}{1000}{OT1} \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} \font\reducedi=cmmi10 \font\reducedsy=cmsy10 \def\reducedecsize{1000} \textleading = 13.2pt % line spacing for 11pt CM \textfonts % reset the current fonts \rm } % end of 11pt text font size definitions, \definetextfontsizexi % Definitions to make the main text be 10pt Computer Modern, with % section, chapter, etc., sizes following suit. This is for the GNU % Press printing of the Emacs 22 manual. Maybe other manuals in the % future. Used with @smallbook, which sets the leading to 12pt. % \def\definetextfontsizex{% % Text fonts (10pt). \def\textnominalsize{10pt} \edef\mainmagstep{1000} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1000} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstephalf}{OT1} \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} \setfont\defsl\slshape{10}{\magstephalf}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} \def\df{\let\ttfont=\deftt \let\bffont = \defbf \let\slfont=\defsl \let\ttslfont=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for math mode superscripts (7pt). \def\sevennominalsize{7pt} \setfont\sevenrm\rmshape{7}{1000}{OT1} \setfont\seventt\ttshape{10}{700}{OT1TT} \setfont\sevenbf\bfshape{10}{700}{OT1} \setfont\sevenit\itshape{7}{1000}{OT1IT} \setfont\sevensl\slshape{10}{700}{OT1} \setfont\sevensf\sfshape{10}{700}{OT1} \setfont\sevensc\scshape{10}{700}{OT1} \setfont\seventtsl\ttslshape{10}{700}{OT1TT} \font\seveni=cmmi7 \font\sevensy=cmsy7 \def\sevenecsize{0700} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter fonts (14.4pt). \def\chapnominalsize{14pt} \setfont\chaprm\rmbshape{12}{\magstep1}{OT1} \setfont\chapit\itbshape{10}{\magstep2}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep2}{OT1} \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\chapsf\sfbshape{12}{\magstep1}{OT1} \let\chapbf\chaprm \setfont\chapsc\scbshape{10}{\magstep2}{OT1} \font\chapi=cmmi12 scaled \magstep1 \font\chapsy=cmsy10 scaled \magstep2 \def\chapecsize{1440} % Section fonts (12pt). \def\secnominalsize{12pt} \setfont\secrm\rmbshape{12}{1000}{OT1} \setfont\secit\itbshape{10}{\magstep1}{OT1IT} \setfont\secsl\slbshape{10}{\magstep1}{OT1} \setfont\sectt\ttbshape{12}{1000}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} \setfont\secsf\sfbshape{12}{1000}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep1}{OT1} \font\seci=cmmi12 \font\secsy=cmsy10 scaled \magstep1 \def\sececsize{1200} % Subsection fonts (10pt). \def\ssecnominalsize{10pt} \setfont\ssecrm\rmbshape{10}{1000}{OT1} \setfont\ssecit\itbshape{10}{1000}{OT1IT} \setfont\ssecsl\slbshape{10}{1000}{OT1} \setfont\ssectt\ttbshape{10}{1000}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} \setfont\ssecsf\sfbshape{10}{1000}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1000}{OT1} \font\sseci=cmmi10 \font\ssecsy=cmsy10 \def\ssececsize{1000} % Reduced fonts for @acronym in text (9pt). \def\reducednominalsize{9pt} \setfont\reducedrm\rmshape{9}{1000}{OT1} \setfont\reducedtt\ttshape{9}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{900}{OT1} \setfont\reducedit\itshape{9}{1000}{OT1IT} \setfont\reducedsl\slshape{9}{1000}{OT1} \setfont\reducedsf\sfshape{9}{1000}{OT1} \setfont\reducedsc\scshape{10}{900}{OT1} \setfont\reducedttsl\ttslshape{10}{900}{OT1TT} \font\reducedi=cmmi9 \font\reducedsy=cmsy9 \def\reducedecsize{0900} \divide\parskip by 2 % reduce space between paragraphs \textleading = 12pt % line spacing for 10pt CM \textfonts % reset the current fonts \rm } % end of 10pt text font size definitions, \definetextfontsizex % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000}{OT1} \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 \setfont\shortcontsl\slshape{12}{1000}{OT1} \setfont\shortconttt\ttshape{12}{1000}{OT1TT} % We provide the user-level command % @fonttextsize 10 % (or 11) to redefine the text font size. pt is assumed. % \def\xiword{11} \def\xword{10} \def\xwordpt{10pt} % \parseargdef\fonttextsize{% \def\textsizearg{#1}% %\wlog{doing @fonttextsize \textsizearg}% % % Set \globaldefs so that documents can use this inside @tex, since % makeinfo 4.8 does not support it, but we need it nonetheless. % \begingroup \globaldefs=1 \ifx\textsizearg\xword \definetextfontsizex \else \ifx\textsizearg\xiword \definetextfontsizexi \else \errhelp=\EMsimple \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} \fi\fi \endgroup } % % Change the current font style to #1, remembering it in \curfontstyle. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in % italics, not bold italics. % \def\setfontstyle#1{% \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. \csname #1font\endcsname % change the current font } \def\rm{\fam=0 \setfontstyle{rm}} \def\it{\fam=\itfam \setfontstyle{it}} \def\sl{\fam=\slfam \setfontstyle{sl}} \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} \def\tt{\fam=\ttfam \setfontstyle{tt}} % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf. \newfam\sffam \def\sf{\fam=\sffam \setfontstyle{sf}} % We don't need math for this font style. \def\ttsl{\setfontstyle{ttsl}} % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. % We don't bother to reset \scriptscriptfont; awaiting user need. % \def\resetmathfonts{% \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont \textfont\ttfam=\ttfont \textfont\sffam=\sffont % % Fonts for superscript. Note that the 7pt fonts are used regardless % of the current font size. \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt \scriptfont\sffam=\sevensf } % % The font-changing commands (all called \...fonts) redefine the meanings % of \STYLEfont, instead of just \STYLE. We do this because \STYLE needs % to also set the current \fam for math mode. Our \STYLE (e.g., \rm) % commands hardwire \STYLEfont to set the current font. % % The fonts used for \ifont are for "math italics" (\itfont is for italics % in regular text). \syfont is also used in math mode only. % % Each font-changing command also sets the names \lsize (one size lower) % and \lllsize (three sizes lower). These relative commands are used % in, e.g., the LaTeX logo and acronyms. % % This all needs generalizing, badly. % \def\assignfonts#1{% \expandafter\let\expandafter\rmfont\csname #1rm\endcsname \expandafter\let\expandafter\itfont\csname #1it\endcsname \expandafter\let\expandafter\slfont\csname #1sl\endcsname \expandafter\let\expandafter\bffont\csname #1bf\endcsname \expandafter\let\expandafter\ttfont\csname #1tt\endcsname \expandafter\let\expandafter\smallcaps\csname #1sc\endcsname \expandafter\let\expandafter\sffont \csname #1sf\endcsname \expandafter\let\expandafter\ifont \csname #1i\endcsname \expandafter\let\expandafter\syfont \csname #1sy\endcsname \expandafter\let\expandafter\ttslfont\csname #1ttsl\endcsname } \newif\ifrmisbold % Select smaller font size with the current style. Used to change font size % in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for % normal roman text, also use bold fonts for roman text in the smaller size. \def\switchtolllsize{% \expandafter\assignfonts\expandafter{\lllsize}% \ifrmisbold \let\rmfont\bffont \fi \csname\curfontstyle\endcsname }% \def\switchtolsize{% \expandafter\assignfonts\expandafter{\lsize}% \ifrmisbold \let\rmfont\bffont \fi \csname\curfontstyle\endcsname }% \def\definefontsetatsize#1#2#3#4#5{% \expandafter\def\csname #1fonts\endcsname{% \def\curfontsize{#1}% \def\lsize{#2}\def\lllsize{#3}% \csname rmisbold#5\endcsname \assignfonts{#1}% \resetmathfonts \setleading{#4}% }} \definefontsetatsize{text} {reduced}{smaller}{\textleading}{false} \definefontsetatsize{title} {chap} {subsec} {27pt} {true} \definefontsetatsize{chap} {sec} {text} {19pt} {true} \definefontsetatsize{sec} {subsec} {reduced}{17pt} {true} \definefontsetatsize{ssec} {text} {small} {15pt} {true} \definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false} \definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false} \definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false} \def\titlefont#1{{\titlefonts\rm #1}} \let\subsecfonts = \ssecfonts \let\subsubsecfonts = \ssecfonts % Define these just so they can be easily changed for other fonts. \def\angleleft{$\langle$} \def\angleright{$\rangle$} % Set the fonts to use with the @small... environments. \let\smallexamplefonts = \smallfonts % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample % can fit this many characters: % 8.5x11=86 smallbook=72 a4=90 a5=69 % If we use \scriptfonts (8pt), then we can fit this many characters: % 8.5x11=90+ smallbook=80 a4=90+ a5=77 % For me, subjectively, the few extra characters that fit aren't worth % the additional smallness of 8pt. So I'm making the default 9pt. % % By the way, for comparison, here's what fits with @example (10pt): % 8.5x11=71 smallbook=60 a4=75 a5=58 % --karl, 24jan03. % Set up the default fonts, so we can use them for creating boxes. % \definetextfontsizexi \message{markup,} % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will % define and register \INITMACRO to be called on markup style changes. % \INITMACRO can check \currentmarkupstyle for the innermost % style. \let\currentmarkupstyle\empty \def\setupmarkupstyle#1{% \def\currentmarkupstyle{#1}% \markupstylesetup } \let\markupstylesetup\empty \def\defmarkupstylesetup#1{% \expandafter\def\expandafter\markupstylesetup \expandafter{\markupstylesetup #1}% \def#1% } % Markup style setup for left and right quotes. \defmarkupstylesetup\markupsetuplq{% \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuplqdefault \else \temp \fi } \defmarkupstylesetup\markupsetuprq{% \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuprqdefault \else \temp \fi } { \catcode`\'=\active \catcode`\`=\active \gdef\markupsetuplqdefault{\let`\lq} \gdef\markupsetuprqdefault{\let'\rq} \gdef\markupsetcodequoteleft{\let`\codequoteleft} \gdef\markupsetcodequoteright{\let'\codequoteright} } \let\markupsetuplqcode \markupsetcodequoteleft \let\markupsetuprqcode \markupsetcodequoteright % \let\markupsetuplqexample \markupsetcodequoteleft \let\markupsetuprqexample \markupsetcodequoteright % \let\markupsetuplqkbd \markupsetcodequoteleft \let\markupsetuprqkbd \markupsetcodequoteright % \let\markupsetuplqsamp \markupsetcodequoteleft \let\markupsetuprqsamp \markupsetcodequoteright % \let\markupsetuplqverb \markupsetcodequoteleft \let\markupsetuprqverb \markupsetcodequoteright % \let\markupsetuplqverbatim \markupsetcodequoteleft \let\markupsetuprqverbatim \markupsetcodequoteright % Allow an option to not use regular directed right quote/apostrophe % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). % The undirected quote is ugly, so don't make it the default, but it % works for pasting with more pdf viewers (at least evince), the % lilypond developers report. xpdf does work with the regular 0x27. % \def\codequoteright{% \ifmonospace \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax '% \else \char'15 \fi \else \char'15 \fi \else '% \fi } % % and a similar option for the left quote char vs. a grave accent. % Modern fonts display ASCII 0x60 as a grave accent, so some people like % the code environments to do likewise. % \def\codequoteleft{% \ifmonospace \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax % [Knuth] pp. 380,381,391 % \relax disables Spanish ligatures ?` and !` of \tt font. \relax`% \else \char'22 \fi \else \char'22 \fi \else \relax`% \fi } % Commands to set the quote options. % \parseargdef\codequoteundirected{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxicodequoteundirected\endcsname = t% \else\ifx\temp\offword \expandafter\let\csname SETtxicodequoteundirected\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% \fi\fi } % \parseargdef\codequotebacktick{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxicodequotebacktick\endcsname = t% \else\ifx\temp\offword \expandafter\let\csname SETtxicodequotebacktick\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% \fi\fi } % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. \def\noligaturesquoteleft{\relax\lq} % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 % Font commands. % #1 is the font command (\sl or \it), #2 is the text to slant. % If we are in a monospaced environment, however, 1) always use \ttsl, % and 2) do not add an italic correction. \def\dosmartslant#1#2{% \ifusingtt {{\ttsl #2}\let\next=\relax}% {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% \next } \def\smartslanted{\dosmartslant\sl} \def\smartitalic{\dosmartslant\it} % Output an italic correction unless \next (presumed to be the following % character) is such as not to need one. \def\smartitaliccorrection{% \ifx\next,% \else\ifx\next-% \else\ifx\next.% \else\ifx\next\.% \else\ifx\next\comma% \else\ptexslash \fi\fi\fi\fi\fi \aftersmartic } % Unconditional use \ttsl, and no ic. @var is set to this for defuns. \def\ttslanted#1{{\ttsl #1}} % @cite is like \smartslanted except unconditionally use \sl. We never want % ttsl for book titles, do we? \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} \def\aftersmartic{} \def\var#1{% \let\saveaftersmartic = \aftersmartic \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% \smartslanted{#1}% } \let\i=\smartitalic \let\slanted=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic % Explicit font changes: @r, @sc, undocumented @ii. \def\r#1{{\rm #1}} % roman font \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font % @b, explicit bold. Also @strong. \def\b#1{{\bf #1}} \let\strong=\b % @sansserif, explicit sans. \def\sansserif#1{{\sf #1}} % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. % \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } % Set sfcode to normal for the chars that usually have another value. % Can't use plain's \frenchspacing because it uses the `\x notation, and % sometimes \x has an active definition that messes things up. % \catcode`@=11 \def\plainfrenchspacing{% \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m \def\endofsentencespacefactor{1000}% for @. and friends } \def\plainnonfrenchspacing{% \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 \def\endofsentencespacefactor{3000}% for @. and friends } \catcode`@=\other \def\endofsentencespacefactor{3000}% default % @t, explicit typewriter. \def\t#1{% {\tt \rawbackslash \plainfrenchspacing #1}% \null } % @samp. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} % @indicateurl is \samp, that is, with quotes. \let\indicateurl=\samp % @code (and similar) prints in typewriter, but with spaces the same % size as normal in the surrounding text, without hyphenation, etc. % This is a subroutine for that. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. \spaceskip = \fontdimen2\font % % Switch to typewriter. \tt % % But `\ ' produces the large typewriter interword space. \def\ {{\spaceskip = 0pt{} }}% % % Turn off hyphenation. \nohyphenation % \rawbackslash \plainfrenchspacing #1% }% \null % reset spacefactor to 1000 } % We *must* turn on hyphenation at `-' and `_' in @code. % (But see \codedashfinish below.) % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) % and arrange explicitly to hyphenate at a dash. -- rms. { \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active \catcode`\`=\active \global\let'=\rq \global\let`=\lq % default definitions % \global\def\code{\begingroup \setupmarkupstyle{code}% % The following should really be moved into \setupmarkupstyle handlers. \catcode\dashChar=\active \catcode\underChar=\active \ifallowcodebreaks \let-\codedash \let_\codeunder \else \let-\normaldash \let_\realunder \fi % Given -foo (with a single dash), we do not want to allow a break % after the hyphen. \global\let\codedashprev=\codedash % \codex } % \gdef\codedash{\futurelet\next\codedashfinish} \gdef\codedashfinish{% \normaldash % always output the dash character itself. % % Now, output a discretionary to allow a line break, unless % (a) the next character is a -, or % (b) the preceding character is a -. % E.g., given --posix, we do not want to allow a break after either -. % Given --foo-bar, we do want to allow a break between the - and the b. \ifx\next\codedash \else \ifx\codedashprev\codedash \else \discretionary{}{}{}\fi \fi % we need the space after the = for the case when \next itself is a % space token; it would get swallowed otherwise. As in @code{- a}. \global\let\codedashprev= \next } } \def\normaldash{-} % \def\codex #1{\tclose{#1}\endgroup} \def\codeunder{% % this is all so @math{@code{var_name}+1} can work. In math mode, _ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) % will therefore expand the active definition of _, which is us % (inside @code that is), therefore an endless loop. \ifusingtt{\ifmmode \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. \else\normalunderscore \fi \discretionary{}{}{}}% {\_}% } % An additional complication: the above will allow breaks after, e.g., % each of the four underscores in __typeof__. This is bad. % @allowcodebreaks provides a document-level way to turn breaking at - % and _ on and off. % \newif\ifallowcodebreaks \allowcodebreakstrue \def\keywordtrue{true} \def\keywordfalse{false} \parseargdef\allowcodebreaks{% \def\txiarg{#1}% \ifx\txiarg\keywordtrue \allowcodebreakstrue \else\ifx\txiarg\keywordfalse \allowcodebreaksfalse \else \errhelp = \EMsimple \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% \fi\fi } % For @command, @env, @file, @option quotes seem unnecessary, % so use \code rather than \samp. \let\command=\code \let\env=\code \let\file=\code \let\option=\code % @uref (abbreviation for `urlref') aka @url takes an optional % (comma-separated) second argument specifying the text to display and % an optional third arg as text to display instead of (rather than in % addition to) the url itself. First (mandatory) arg is the url. % TeX-only option to allow changing PDF output to show only the second % arg (if given), and not the url (which is then just the link target). \newif\ifurefurlonlylink % The main macro is \urefbreak, which allows breaking at expected % places within the url. (There used to be another version, which % didn't support automatic breaking.) \def\urefbreak{\begingroup \urefcatcodes \dourefbreak} \let\uref=\urefbreak % \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% look for second arg \ifdim\wd0 > 0pt \ifpdf % For pdfTeX and LuaTeX \ifurefurlonlylink % PDF plus option to not display url, show just arg \unhbox0 \else % PDF, normally display both arg and url for consistency, % visibility, if the pdf is eventually used to print, etc. \unhbox0\ (\urefcode{#1})% \fi \else \ifx\XeTeXrevision\thisisundefined \unhbox0\ (\urefcode{#1})% DVI, always show arg and url \else % For XeTeX \ifurefurlonlylink % PDF plus option to not display url, show just arg \unhbox0 \else % PDF, normally display both arg and url for consistency, % visibility, if the pdf is eventually used to print, etc. \unhbox0\ (\urefcode{#1})% \fi \fi \fi \else \urefcode{#1}% only url given, so show it \fi \fi \endlink \endgroup} % Allow line breaks around only a few characters (only). \def\urefcatcodes{% \catcode`\&=\active \catcode`\.=\active \catcode`\#=\active \catcode`\?=\active \catcode`\/=\active } { \urefcatcodes % \global\def\urefcode{\begingroup \setupmarkupstyle{code}% \urefcatcodes \let&\urefcodeamp \let.\urefcodedot \let#\urefcodehash \let?\urefcodequest \let/\urefcodeslash \codex } % % By default, they are just regular characters. \global\def&{\normalamp} \global\def.{\normaldot} \global\def#{\normalhash} \global\def?{\normalquest} \global\def/{\normalslash} } % we put a little stretch before and after the breakable chars, to help % line breaking of long url's. The unequal skips make look better in % cmtt at least, especially for dots. \def\urefprestretchamount{.13em} \def\urefpoststretchamount{.1em} \def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax} \def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax} % \def\urefcodeamp{\urefprestretch \&\urefpoststretch} \def\urefcodedot{\urefprestretch .\urefpoststretch} \def\urefcodehash{\urefprestretch \#\urefpoststretch} \def\urefcodequest{\urefprestretch ?\urefpoststretch} \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} { \catcode`\/=\active \global\def\urefcodeslashfinish{% \urefprestretch \slashChar % Allow line break only after the final / in a sequence of % slashes, to avoid line break between the slashes in http://. \ifx\next/\else \urefpoststretch \fi } } % One more complication: by default we'll break after the special % characters, but some people like to break before the special chars, so % allow that. Also allow no breaking at all, for manual control. % \parseargdef\urefbreakstyle{% \def\txiarg{#1}% \ifx\txiarg\wordnone \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordbefore \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordafter \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} \else \errhelp = \EMsimple \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% \fi\fi\fi } \def\wordafter{after} \def\wordbefore{before} \def\wordnone{none} \urefbreakstyle after % @url synonym for @uref, since that's how everyone uses it. % \let\url=\uref % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. % %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} \def\doemail#1,#2,#3\finish{\begingroup \unsepspaces \pdfurl{mailto:#1}% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi \endlink \endgroup} \else \ifx\XeTeXrevision\thisisundefined \let\email=\uref \else \def\email#1{\doemail#1,,\finish} \def\doemail#1,#2,#3\finish{\begingroup \unsepspaces \pdfurl{mailto:#1}% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi \endlink \endgroup} \fi \fi % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). \parseargdef\kbdinputstyle{% \def\txiarg{#1}% \ifx\txiarg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% \else\ifx\txiarg\wordexample \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\txiarg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \else \errhelp = \EMsimple \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} % Default is `distinct'. \kbdinputstyle distinct % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} \def\xkey{\key} \def\kbdsub#1#2#3\par{% \def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi } % definition of @key that produces a lozenge. Doesn't adjust to text size. %\setfont\keyrm\rmshape{8}{1000}{OT1} %\font\keysy=cmsy9 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% % \vbox{\hrule\kern-0.4pt % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% % \kern-0.4pt\hrule}% % \kern-.06em\raise0.4pt\hbox{\angleright}}}} % definition of @key with no lozenge. If the current font is already % monospace, don't change it; that way, we respect @kbdinputstyle. But % if it isn't monospace, then use \tt. % \def\key#1{{\setupmarkupstyle{key}% \nohyphenation \ifmonospace\else\tt\fi #1}\null} % @clicksequence{File @click{} Open ...} \def\clicksequence#1{\begingroup #1\endgroup} % @clickstyle @arrow (by default) \parseargdef\clickstyle{\def\click{#1}} \def\click{\arrow} % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} % @acronym for "FBI", "NATO", and the like. % We print this one point size smaller, since it's intended for % all-uppercase. % \def\acronym#1{\doacronym #1,,\finish} \def\doacronym#1,#2,#3\finish{% {\switchtolsize #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi \null % reset \spacefactor=1000 } % @abbr for "Comput. J." and the like. % No font change, but don't do end-of-sentence spacing. % \def\abbr#1{\doabbr #1,,\finish} \def\doabbr#1,#2,#3\finish{% {\plainfrenchspacing #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi \null % reset \spacefactor=1000 } % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math outputs its argument in math mode. % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make % _ active, and distinguish by seeing if the current family is \slfam, % which is what @var uses. { \catcode`\_ = \active \gdef\mathunderscore{% \catcode`\_=\active \def_{\ifnum\fam=\slfam \_\else\sb\fi}% } } % Another complication: we want \\ (and @\) to output a math (or tt) \. % FYI, plain.tex uses \\ as a temporary control sequence (for no % particular reason), but this is not advertised and we don't care. % % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% \ifmmode\else % only go into math if not in math mode already \tex \mathunderscore \let\\ = \mathbackslash \mathactive % make the texinfo accent commands work in math mode \let\"=\ddot \let\'=\acute \let\==\bar \let\^=\hat \let\`=\grave \let\u=\breve \let\v=\check \let\~=\tilde \let\dotaccent=\dot % have to provide another name for sup operator \let\mathopsup=\sup $\expandafter\finishmath\fi } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. % Some active characters (such as <) are spaced differently in math. % We have to reset their definitions in case the @math was an argument % to a command which sets the catcodes (such as @item or @section). % { \catcode`^ = \active \catcode`< = \active \catcode`> = \active \catcode`+ = \active \catcode`' = \active \gdef\mathactive{% \let^ = \ptexhat \let< = \ptexless \let> = \ptexgtr \let+ = \ptexplus \let' = \ptexquoteright } } % for @sub and @sup, if in math mode, just do a normal sub/superscript. % If in text, use math to place as sub/superscript, but switch % into text mode, with smaller fonts. This is a different font than the % one used for real math sub/superscripts (8pt vs. 7pt), but let's not % fix it (significant additions to font machinery) until someone notices. % \def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi} \def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}% % \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} \def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}% % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, % except specified as a normal braced arg, so no newlines to worry about. % \def\outfmtnametex{tex} % \long\def\inlinefmt#1{\doinlinefmt #1,\finish} \long\def\doinlinefmt#1,#2,\finish{% \def\inlinefmtname{#1}% \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi } % % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if % FMTNAME is tex, else ELSE-TEXT. \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish} \long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{% \def\inlinefmtname{#1}% \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi } % % For raw, must switch into @tex before parsing the argument, to avoid % setting catcodes prematurely. Doing it this way means that, for % example, @inlineraw{html, foo{bar} gets a parse error instead of being % ignored. But this isn't important because if people want a literal % *right* brace they would have to use a command anyway, so they may as % well use a command to get a left brace too. We could re-use the % delimiter character idea from \verb, but it seems like overkill. % \long\def\inlineraw{\tex \doinlineraw} \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} \def\doinlinerawtwo#1,#2,\finish{% \def\inlinerawname{#1}% \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi \endgroup % close group opened by \tex. } % @inlineifset{VAR, TEXT} expands TEXT if VAR is @set. % \long\def\inlineifset#1{\doinlineifset #1,\finish} \long\def\doinlineifset#1,#2,\finish{% \def\inlinevarname{#1}% \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \else\ignorespaces#2\fi } % @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set. % \long\def\inlineifclear#1{\doinlineifclear #1,\finish} \long\def\doinlineifclear#1,#2,\finish{% \def\inlinevarname{#1}% \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi } \message{glyphs,} % and logos. % @@ prints an @, as does @atchar{}. \def\@{\char64 } \let\atchar=\@ % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. \def\lbracechar{{\ifmonospace\char123\else\ensuremath\lbrace\fi}} \def\rbracechar{{\ifmonospace\char125\else\ensuremath\rbrace\fi}} \let\{=\lbracechar \let\}=\rbracechar % @comma{} to avoid , parsing problems. \let\comma = , % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. \let\, = \ptexc \let\dotaccent = \ptexdot \def\ringaccent#1{{\accent23 #1}} \let\tieaccent = \ptext \let\ubaraccent = \ptexb \let\udotaccent = \d % Other special characters: @questiondown @exclamdown @ordf @ordm % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} \def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}} \def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} \def\jmacro{j} \def\dotless#1{% \def\temp{#1}% \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi \else \errmessage{@dotless can be used only with i or j}% \fi\fi } % The \TeX{} logo, as in plain, but resetting the spacing so that a % period following counts as ending a sentence. (Idea found in latex.) % \edef\TeX{\TeX \spacefactor=1000 } % @LaTeX{} logo. Not quite the same results as the definition in % latex.ltx, since we use a different font for the raised A; it's most % convenient for us to use an explicitly smaller font, rather than using % the \scriptstyle font (since we don't reset \scriptstyle and % \scriptscriptstyle). % \def\LaTeX{% L\kern-.36em {\setbox0=\hbox{T}% \vbox to \ht0{\hbox{% \ifx\textnominalsize\xwordpt % for 10pt running text, lllsize (8pt) is too small for the A in LaTeX. % Revert to plain's \scriptsize, which is 7pt. \count255=\the\fam $\fam\count255 \scriptstyle A$% \else % For 11pt, we can use our lllsize. \switchtolllsize A% \fi }% \vss }}% \kern-.15em \TeX } % Some math mode symbols. Define \ensuremath to switch into math mode % unless we are already there. Expansion tricks may not be needed here, % but safer, and can't hurt. \def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi} \def\ensuredmath#1{$\relax#1$} % \def\bullet{\ensuremath\ptexbullet} \def\geq{\ensuremath\ge} \def\leq{\ensuremath\le} \def\minus{\ensuremath-} % @dots{} outputs an ellipsis using the current font. % We do .5em per period so that it has the same spacing in the cm % typewriter fonts as three actual period characters; on the other hand, % in other typewriter fonts three periods are wider than 1.5em. So do % whichever is larger. % \def\dots{% \leavevmode \setbox0=\hbox{...}% get width of three periods \ifdim\wd0 > 1.5em \dimen0 = \wd0 \else \dimen0 = 1.5em \fi \hbox to \dimen0{% \hskip 0pt plus.25fil .\hskip 0pt plus1fil .\hskip 0pt plus1fil .\hskip 0pt plus.5fil }% } % @enddots{} is an end-of-sentence ellipsis. % \def\enddots{% \dots \spacefactor=\endofsentencespacefactor } % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. % % Since these characters are used in examples, they should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % \def\point{$\star$} \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} % The @error{} command. % Adapted from the TeXbook's \boxit. % \newbox\errorbox % {\ttfont \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} % \setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. \vbox{% \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} % \def\error{\leavevmode\lower.7ex\copy\errorbox} % @pounds{} is a sterling sign, which Knuth put in the CM italic font. % \def\pounds{{\it\$}} % @euro{} comes from a separate font, depending on the current style. % We use the free feym* fonts from the eurosym package by Henrik % Theiling, which support regular, slanted, bold and bold slanted (and % "outlined" (blackboard board, sort of) versions, which we don't need). % It is available from http://www.ctan.org/tex-archive/fonts/eurosym. % % Although only regular is the truly official Euro symbol, we ignore % that. The Euro is designed to be slightly taller than the regular % font height. % % feymr - regular % feymo - slanted % feybr - bold % feybo - bold slanted % % There is no good (free) typewriter version, to my knowledge. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. % Hmm. % % Also doesn't work in math. Do we need to do math with euro symbols? % Hope not. % % \def\euro{{\eurofont e}} \def\eurofont{% % We set the font at each command, rather than predefining it in % \textfonts and the other font-switching commands, so that % installations which never need the symbol don't have to have the % font installed. % % There is only one designed size (nominal 10pt), so we always scale % that to the current nominal size. % % By the way, simply using "at 1em" works for cmr10 and the like, but % does not work for cmbx10 and other extended/shrunken fonts. % \def\eurosize{\csname\curfontsize nominalsize\endcsname}% % \ifx\curfontstyle\bfstylename % bold: \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize \else % regular: \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize \fi \thiseurofont } % Glyphs from the EC fonts. We don't use \let for the aliases, because % sometimes we redefine the original macro, and the alias should reflect % the redefinition. % % Use LaTeX names for the Icelandic letters. \def\DH{{\ecfont \char"D0}} % Eth \def\dh{{\ecfont \char"F0}} % eth \def\TH{{\ecfont \char"DE}} % Thorn \def\th{{\ecfont \char"FE}} % thorn % \def\guillemetleft{{\ecfont \char"13}} \def\guillemotleft{\guillemetleft} \def\guillemetright{{\ecfont \char"14}} \def\guillemotright{\guillemetright} \def\guilsinglleft{{\ecfont \char"0E}} \def\guilsinglright{{\ecfont \char"0F}} \def\quotedblbase{{\ecfont \char"12}} \def\quotesinglbase{{\ecfont \char"0D}} % % This positioning is not perfect (see the ogonek LaTeX package), but % we have the precomposed glyphs for the most common cases. We put the % tests to use those glyphs in the single \ogonek macro so we have fewer % dummy definitions to worry about for index entries, etc. % % ogonek is also used with other letters in Lithuanian (IOU), but using % the precomposed glyphs for those is not so easy since they aren't in % the same EC font. \def\ogonek#1{{% \def\temp{#1}% \ifx\temp\macrocharA\Aogonek \else\ifx\temp\macrochara\aogonek \else\ifx\temp\macrocharE\Eogonek \else\ifx\temp\macrochare\eogonek \else \ecfont \setbox0=\hbox{#1}% \ifdim\ht0=1ex\accent"0C #1% \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% \fi \fi\fi\fi\fi }% } \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} % % Use the European Computer Modern fonts (cm-super in outline format) % for non-CM glyphs. That is ec* for regular text and tc* for the text % companion symbols (LaTeX TS1 encoding). Both are part of the ec % package and follow the same conventions. % \def\ecfont{\etcfont{e}} \def\tcfont{\etcfont{t}} % \def\etcfont#1{% % We can't distinguish serif/sans and italic/slanted, but this % is used for crude hacks anyway (like adding French and German % quotes to documents typeset with CM, where we lose kerning), so % hopefully nobody will notice/care. \edef\ecsize{\csname\curfontsize ecsize\endcsname}% \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% \ifmonospace % typewriter: \font\thisecfont = #1ctt\ecsize \space at \nominalsize \else \ifx\curfontstyle\bfstylename % bold: \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize \else % regular: \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize \fi \fi \thisecfont } % @registeredsymbol - R in a circle. The font for the R should really % be smaller yet, but lllsize is the best we can do for now. % Adapted from the plain.tex definition of \copyright. % \def\registeredsymbol{% $^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}% \hfil\crcr\Orb}}% }$% } % @textdegree - the normal degrees sign. % \def\textdegree{$^\circ$} % Laurent Siebenmann reports \Orb undefined with: % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 % so we'll define it if necessary. % \ifx\Orb\thisisundefined \def\Orb{\mathhexbox20D} \fi % Quotes. \chardef\quotedblleft="5C \chardef\quotedblright=`\" \chardef\quoteleft=`\` \chardef\quoteright=`\' \message{page headings,} \newskip\titlepagetopglue \titlepagetopglue = 1.5in \newskip\titlepagebottomglue \titlepagebottomglue = 2pc % First the title page. Must do @settitle before @titlepage. \newif\ifseenauthor \newif\iffinishedtitlepage % @setcontentsaftertitlepage used to do an implicit @contents or % @shortcontents after @end titlepage, but it is now obsolete. \def\setcontentsaftertitlepage{% \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo command; move your @contents command if you want the contents after the title page.}}% \def\setshortcontentsaftertitlepage{% \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo command; move your @shortcontents and @contents commands if you want the contents after the title page.}}% \parseargdef\shorttitlepage{% \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \envdef\titlepage{% % Open one extra group, as we want to close it in the middle of \Etitlepage. \begingroup \parindent=0pt \textfonts % Leave some space at the very top of the page. \vglue\titlepagetopglue % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % % Most title ``pages'' are actually two pages long, with space % at the top of the second. We don't want the ragged left on the second. \let\oldpage = \page \def\page{% \iffinishedtitlepage\else \finishtitlepage \fi \let\page = \oldpage \page \null }% } \def\Etitlepage{% \iffinishedtitlepage\else \finishtitlepage \fi % It is important to do the page break before ending the group, % because the headline and footline are only empty inside the group. % If we use the new definition of \page, we always get a blank page % after the title page, which we certainly don't want. \oldpage \endgroup % % Need this before the \...aftertitlepage checks so that if they are % in effect the toc pages will come out with page numbers. \HEADINGSon } \def\finishtitlepage{% \vskip4pt \hrule height 2pt width \hsize \vskip\titlepagebottomglue \finishedtitlepagetrue } % Settings used for typesetting titles: no hyphenation, no indentation, % don't worry much about spacing, ragged right. This should be used % inside a \vbox, and fonts need to be set appropriately first. \par should % be specified before the end of the \vbox, since a vbox is a group. % \def\raggedtitlesettings{% \rm \hyphenpenalty=10000 \parindent=0pt \tolerance=5000 \ptexraggedright } % Macros to be used within @titlepage: \let\subtitlerm=\rmfont \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} \parseargdef\title{% \checkenv\titlepage \vbox{\titlefonts \raggedtitlesettings #1\par}% % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt } \parseargdef\subtitle{% \checkenv\titlepage {\subtitlefont \rightline{#1}}% } % @author should come last, but may come many times. % It can also be used inside @quotation. % \parseargdef\author{% \def\temp{\quotation}% \ifx\thisenv\temp \def\quotationauthor{#1}% printed in \Equotation. \else \checkenv\titlepage \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi {\secfonts\rm \leftline{#1}}% \fi } % Set up page headings and footings. \let\thispage=\folio \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make \makeheadline and \makefootline in Plain TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax % Commands to set those variables. % For example, this is what @headings on does % @evenheading @thistitle|@thispage|@thischapter % @oddheading @thischapter|@thispage|@thistitle % @evenfooting @thisfile|| % @oddfooting ||@thisfile \def\evenheading{\parsearg\evenheadingxxx} \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddheading{\parsearg\oddheadingxxx} \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% \def\evenfooting{\parsearg\evenfootingxxx} \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} \def\evenfootingyyy #1\|#2\|#3\|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddfooting{\parsearg\oddfootingxxx} \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} \def\oddfootingyyy #1\|#2\|#3\|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. \global\advance\txipageheight by -12pt \global\advance\vsize by -12pt } \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} % @evenheadingmarks top \thischapter <- chapter at the top of a page % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page % % The same set of arguments for: % % @oddheadingmarks % @evenfootingmarks % @oddfootingmarks % @everyheadingmarks % @everyfootingmarks % These define \getoddheadingmarks, \getevenheadingmarks, % \getoddfootingmarks, and \getevenfootingmarks, each to one of % \gettopheadingmarks, \getbottomheadingmarks. % \def\evenheadingmarks{\headingmarks{even}{heading}} \def\oddheadingmarks{\headingmarks{odd}{heading}} \def\evenfootingmarks{\headingmarks{even}{footing}} \def\oddfootingmarks{\headingmarks{odd}{footing}} \parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1} \headingmarks{odd}{heading}{#1} } \parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1} \headingmarks{odd}{footing}{#1} } % #1 = even/odd, #2 = heading/footing, #3 = top/bottom. \def\headingmarks#1#2#3 {% \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname \global\expandafter\let\csname get#1#2marks\endcsname \temp } \everyheadingmarks bottom \everyfootingmarks bottom % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. % @headings off turns them off. % @headings on same as @headings double, retained for compatibility. % @headings after turns on double-sided headings after this page. % @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. % By default, they are off at the start of a document, % and turned `on' after @end titlepage. \parseargdef\headings{\csname HEADINGS#1\endcsname} \def\headingsoff{% non-global headings elimination \evenheadline={\hfil}\evenfootline={\hfil}% \oddheadline={\hfil}\oddfootline={\hfil}% } \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting \HEADINGSoff % it's the default % When we turn headings on, set the page number to 1. % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapterheading\hfil\folio}} \global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} \let\HEADINGSdoubleafter=\HEADINGSafter \def\HEADINGSdoublex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapterheading\hfil\folio}} \global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings % This produces Day Month Year style of output. % Only define if not already defined, in case a txi-??.tex file has set % up a different format (e.g., txi-cs.tex does this). \ifx\today\thisisundefined \def\today{% \number\day\space \ifcase\month \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec \fi \space\number\year} \fi % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} \def\settitle{\parsearg{\gdef\thistitle}} \message{tables,} % Tables -- @table, @ftable, @vtable, @item(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in % default indentation of @itemize and @enumerate text \newdimen\itemindent \itemindent=.3in % margin between end of table item and start of table text. \newdimen\itemmargin \itemmargin=.1in % used internally for \itemindent minus \itemmargin \newdimen\itemmax % Note @table, @ftable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). \newif\ifitemxneedsnegativevskip \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent \setbox0=\hbox{\itemindicate{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next % command is, e.g., @kindex, the whatsit would get put into the % horizontal list on a line by itself, resulting in extra blank space. \ifdim \wd0>\itemmax % % Make this a paragraph so we get the \parskip glue and wrapping, % but leave it ragged-right. \begingroup \advance\leftskip by-\tableindent \advance\hsize by\tableindent \advance\rightskip by0pt plus1fil\relax \leavevmode\unhbox0\par \endgroup % % We're going to be starting a paragraph, but we don't want the % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % % Stop a page break at the \parskip glue coming up. However, if % what follows is an environment such as @example, there will be no % \parskip glue; then the negative vskip we just inserted would % cause the example and the item to crash together. So we use this % bizarre value of 10001 as a signal to \aboveenvbreak to insert % \parskip glue after all. Section titles are handled this way also. % \penalty 10001 \endgroup \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the % following text (if any) will end up on the same line. \noindent % Do this with kerns and \unhbox so that if there is a footnote in % the item text, it can migrate to the main vertical list and % eventually be printed. \nobreak\kern-\tableindent \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 \unhbox0 \nobreak\kern\dimen0 \endgroup \itemxneedsnegativevskiptrue \fi } \def\item{\errmessage{@item while not in a list environment}} \def\itemx{\errmessage{@itemx while not in a list environment}} % @table, @ftable, @vtable. \envdef\table{% \let\itemindex\gobble \tablecheck{table}% } \envdef\ftable{% \def\itemindex ##1{\doind {fn}{\code{##1}}}% \tablecheck{ftable}% } \envdef\vtable{% \def\itemindex ##1{\doind {vr}{\code{##1}}}% \tablecheck{vtable}% } \def\tablecheck#1{% \ifnum \the\catcode`\^^M=\active \endgroup \errmessage{This command won't work in this context; perhaps the problem is that we are \inenvironment\thisenv}% \def\next{\doignore{#1}}% \else \let\next\tablex \fi \next } \def\tablex#1{% \def\itemindicate{#1}% \parsearg\tabley } \def\tabley#1{% {% \makevalueexpandable \edef\temp{\noexpand\tablez #1\space\space\space}% \expandafter }\temp \endtablez } \def\tablez #1 #2 #3 #4\endtablez{% \aboveenvbreak \ifnum 0#1>0 \advance \leftskip by #1\mil \fi \ifnum 0#2>0 \tableindent=#2\mil \fi \ifnum 0#3>0 \advance \rightskip by #3\mil \fi \itemmax=\tableindent \advance \itemmax by -\itemmargin \advance \leftskip by \tableindent \exdentamount=\tableindent \parindent = 0pt \parskip = \smallskipamount \ifdim \parskip=0pt \parskip=2pt \fi \let\item = \internalBitem \let\itemx = \internalBitemx } \def\Etable{\endgraf\afterenvbreak} \let\Eftable\Etable \let\Evtable\Etable \let\Eitemize\Etable \let\Eenumerate\Etable % This is the counter used by @enumerate, which is really @itemize \newcount \itemno \envdef\itemize{\parsearg\doitemize} \def\doitemize#1{% \aboveenvbreak \itemmax=\itemindent \advance\itemmax by -\itemmargin \advance\leftskip by \itemindent \exdentamount=\itemindent \parindent=0pt \parskip=\smallskipamount \ifdim\parskip=0pt \parskip=2pt \fi % % Try typesetting the item mark so that if the document erroneously says % something like @itemize @samp (intending @table), there's an error % right away at the @itemize. It's not the best error message in the % world, but it's better than leaving it to the @item. This means if % the user wants an empty mark, they have to say @w{} not just @w. \def\itemcontents{#1}% \setbox0 = \hbox{\itemcontents}% % % @itemize with no arg is equivalent to @itemize @bullet. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi % \let\item=\itemizeitem } % Definition of @item while inside @itemize and @enumerate. % \def\itemizeitem{% \advance\itemno by 1 % for enumerations {\let\par=\endgraf \smallbreak}% reasonable place to break {% % If the document has an @itemize directly after a section title, a % \nobreak will be last on the list, and \sectionheading will have % done a \vskip-\parskip. In that case, we don't want to zero % parskip, or the item text will crash with the heading. On the % other hand, when there is normal text preceding the item (as there % usually is), we do want to zero parskip, or there would be too much % space. In that case, we won't have a \nobreak before. At least % that's the theory. \ifnum\lastpenalty<10000 \parskip=0in \fi \noindent \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% % \ifinner\else \vadjust{\penalty 1200}% not good to break after first line of item. \fi % We can be in inner vertical mode in a footnote, although an % @itemize looks awful there. }% \flushcr } % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. % \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% % Allow an optional argument of an uppercase letter, lowercase letter, % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % \envparseargdef\enumerate{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi % % Detect if the argument is a single token. If so, it might be a % letter. Otherwise, the only valid thing it can be is a number. % (We will always have one token, because of the test we just made. % This is a good thing, since \splitoff doesn't work given nothing at % all -- the first parameter is undelimited.) \expandafter\splitoff\thearg\endmark \ifx\rest\empty % Only one token in the argument. It could still be anything. % A ``lowercase letter'' is one whose \lccode is nonzero. % An ``uppercase letter'' is one whose \lccode is both nonzero, and % not equal to itself. % Otherwise, we assume it's a number. % % We need the \relax at the end of the \ifnum lines to stop TeX from % continuing to look for a . % \ifnum\lccode\expandafter`\thearg=0\relax \numericenumerate % a number (we hope) \else % It's a letter. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax \lowercaseenumerate % lowercase letter \else \uppercaseenumerate % uppercase letter \fi \fi \else % Multiple tokens in the argument. We hope it's a number. \numericenumerate \fi } % An @enumerate whose labels are integers. The starting integer is % given in \thearg. % \def\numericenumerate{% \itemno = \thearg \startenumeration{\the\itemno}% } % The starting (lowercase) letter is in \thearg. \def\lowercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more lowercase letters in @enumerate; get a bigger alphabet}% \fi \char\lccode\itemno }% } % The starting (uppercase) letter is in \thearg. \def\uppercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more uppercase letters in @enumerate; get a bigger alphabet} \fi \char\uccode\itemno }% } % Call \doitemize, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 \doitemize{#1.}\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg % to @enumerate. % \def\alphaenumerate{\enumerate{a}} \def\capsenumerate{\enumerate{A}} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 % % @multitable ... @end multitable will make as many columns as desired. % Contents of each column will wrap at width given in preamble. Width % can be specified either with sample text given in a template line, % or in percent of \hsize, the current width of text on page. % Table can continue over pages but will only break between lines. % To make preamble: % % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % % Numbers following @columnfractions are the percent of the total % current hsize to be used for each column. You may use as many % columns as desired. % Or use a template: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. % @item, @tab do not need to be on their own lines, but it will not hurt % if they are. % Sample multitable: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col % @item % first col stuff % @tab % second col stuff % @tab % third col % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable % Default dimensions may be reset by user. % @multitableparskip is vertical space between paragraphs in table. % @multitableparindent is paragraph indent in table. % @multitablecolmargin is horizontal space to be left between columns. % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. % \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace \newskip\multitablelinespace \multitableparskip=0pt \multitableparindent=6pt \multitablecolspace=12pt \multitablelinespace=0pt % Macros used to set up halign preamble: % \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent % #1 is the @columnfraction, usually a decimal number like .5, but might % be just 1. We just use it, whatever it is. % \def\pickupwholefraction#1 {% \global\advance\colcount by 1 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% \setuptable } \newcount\colcount \def\setuptable#1{% \def\firstarg{#1}% \ifx\firstarg\xendsetuptable \let\go = \relax \else \ifx\firstarg\xcolumnfractions \global\setpercenttrue \else \ifsetpercent \let\go\pickupwholefraction \else \global\advance\colcount by 1 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a % separator; typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi \fi \ifx\go\pickupwholefraction % Put the argument back for the \pickupwholefraction call, so % we'll always have a period there to be parsed. \def\go{\pickupwholefraction#1}% \else \let\go = \setuptable \fi% \fi \go } % multitable-only commands. % % @headitem starts a heading row, which we typeset in bold. Assignments % have to be global since we are inside the implicit group of an % alignment entry. \everycr below resets \everytab so we don't have to % undo it ourselves. \def\headitemfont{\b}% for people to use in the template row; not changeable \def\headitem{% \checkenv\multitable \crcr \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings \global\everytab={\bf}% can't use \headitemfont since the parsing differs \the\everytab % for the first item }% % % default for tables with no headings. \let\headitemcrhook=\relax % % A \tab used to include \hskip1sp. But then the space in a template % line is not enough. That is bad. So let's go back to just `&' until % we again encounter the problem the 1sp was intended to solve. % --karl, nathan@acm.org, 20apr99. \def\tab{\checkenv\multitable &\the\everytab}% % @multitable ... @end multitable definitions: % \newtoks\everytab % insert after every tab. % \envdef\multitable{% \vskip\parskip \startsavinginserts % % @item within a multitable starts a normal row. % We use \def instead of \let so that if one of the multitable entries % contains an @itemize, we don't choke on the \item (seen as \crcr aka % \endtemplate) expanding \doitemize. \def\item{\crcr}% % \tolerance=9500 \hbadness=9500 \setmultitablespacing \parskip=\multitableparskip \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 % \everycr = {% \noalign{% \global\everytab={}% Reset from possible headitem. \global\colcount=0 % Reset the column counter. % % Check for saved footnotes, etc.: \checkinserts % % Perhaps a \nobreak, then reset: \headitemcrhook \global\let\headitemcrhook=\relax }% }% % \parsearg\domultitable } \def\domultitable#1{% % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup &% \global\advance\colcount by 1 \multistrut \vtop{% % Use the current \colcount to find the correct column width: \hsize=\expandafter\csname col\the\colcount\endcsname % % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. % % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % % If the user has set preamble in terms of percent of \hsize we will % use that dimension as the width of the column, and the \leftskip % will keep entries from bumping into each other. Table will start at % left margin and final column will justify at right margin. % % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 % The first column will be indented with the surrounding text. \advance\hsize by\leftskip \else \ifsetpercent \else % If user has not set preamble in terms of percent of \hsize % we will advance \hsize by \multitablecolspace. \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi % Ignoring space at the beginning and end avoids an occasional spurious % blank line, when TeX decides to break the line at the space before the % box from the multistrut, so the strut ends up on a line by itself. % For example: % @multitable @columnfractions .11 .89 % @item @code{#} % @tab Legal holiday which is valid in major parts of the whole country. % Is automatically provided with highlighting sequences respectively % marking characters. \noindent\ignorespaces##\unskip\multistrut }\cr } \def\Emultitable{% \crcr \egroup % end the \halign \global\setpercentfalse } \def\setmultitablespacing{% \def\multistrut{\strut}% just use the standard line spacing % % Compute \multitablelinespace (if not defined by user) for use in % \multitableparskip calculation. We used define \multistrut based on % this, but (ironically) that caused the spacing to be off. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. \ifdim\multitablelinespace=0pt \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip \global\advance\multitablelinespace by-\ht0 \fi % Test to see if parskip is larger than space between lines of % table. If not, do nothing. % If so, set to same dimension as multitablelinespace. \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller % than skip between lines in the table. \fi% \ifdim\multitableparskip=0pt \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller % than skip between lines in the table. \fi} \message{conditionals,} % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, % @ifnotxml always succeed. They currently do nothing; we don't % attempt to check whether the conditionals are properly nested. But we % have to remember that they are conditionals, so that @end doesn't % attempt to close an environment group. % \def\makecond#1{% \expandafter\let\csname #1\endcsname = \relax \expandafter\let\csname iscond.#1\endcsname = 1 } \makecond{iftex} \makecond{ifnotdocbook} \makecond{ifnothtml} \makecond{ifnotinfo} \makecond{ifnotplaintext} \makecond{ifnotxml} % Ignore @ignore, @ifhtml, @ifinfo, and the like. % \def\direntry{\doignore{direntry}} \def\documentdescription{\doignore{documentdescription}} \def\docbook{\doignore{docbook}} \def\html{\doignore{html}} \def\ifdocbook{\doignore{ifdocbook}} \def\ifhtml{\doignore{ifhtml}} \def\ifinfo{\doignore{ifinfo}} \def\ifnottex{\doignore{ifnottex}} \def\ifplaintext{\doignore{ifplaintext}} \def\ifxml{\doignore{ifxml}} \def\ignore{\doignore{ignore}} \def\menu{\doignore{menu}} \def\xml{\doignore{xml}} % Ignore text until a line `@end #1', keeping track of nested conditionals. % % A count to remember the depth of nesting. \newcount\doignorecount \def\doignore#1{\begingroup % Scan in ``verbatim'' mode: \obeylines \catcode`\@ = \other \catcode`\{ = \other \catcode`\} = \other % % Make sure that spaces turn into tokens that match what \doignoretext wants. \spaceisspace % % Count number of #1's that we've seen. \doignorecount = 0 % % Swallow text until we reach the matching `@end #1'. \dodoignore{#1}% } { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. \obeylines % % \gdef\dodoignore#1{% % #1 contains the command name as a string, e.g., `ifinfo'. % % Define a command to find the next `@end #1'. \long\def\doignoretext##1^^M@end #1{% \doignoretextyyy##1^^M@#1\_STOP_}% % % And this command to find another #1 command, at the beginning of a % line. (Otherwise, we would consider a line `@c @ifset', for % example, to count as an @ifset for nesting.) \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% % % And now expand that command. \doignoretext ^^M% }% } \def\doignoreyyy#1{% \def\temp{#1}% \ifx\temp\empty % Nothing found. \let\next\doignoretextzzz \else % Found a nested condition, ... \advance\doignorecount by 1 \let\next\doignoretextyyy % ..., look for another. % If we're here, #1 ends with ^^M\ifinfo (for example). \fi \next #1% the token \_STOP_ is present just after this macro. } % We have to swallow the remaining "\_STOP_". % \def\doignoretextzzz#1{% \ifnum\doignorecount = 0 % We have just found the outermost @end. \let\next\enddoignore \else % Still inside a nested condition. \advance\doignorecount by -1 \let\next\doignoretext % Look for the next @end. \fi \next } % Finish off ignored text. { \obeylines% % Ignore anything after the last `@end #1'; this matters in verbatim % environments, where otherwise the newline after an ignored conditional % would result in a blank line in the output. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% } % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we % didn't need it. % We rely on the fact that \parsearg sets \catcode`\ =10. % \parseargdef\set{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% {% \makevalueexpandable \def\temp{#2}% \edef\next{\gdef\makecsname{SET#1}}% \ifx\temp\empty \next{}% \else \setzzz#2\endsetzzz \fi }% } % Remove the trailing space \setxxx inserted. \def\setzzz#1 \endsetzzz{\next{#1}} % @clear VAR clears (i.e., unsets) the variable VAR. % \parseargdef\clear{% {% \makevalueexpandable \global\expandafter\let\csname SET#1\endcsname=\relax }% } % @value{foo} gets the text saved in variable foo. \def\value{\begingroup\makevalueexpandable\valuexxx} \def\valuexxx#1{\expandablevalue{#1}\endgroup} { \catcode`\-=\active \catcode`\_=\active % \gdef\makevalueexpandable{% \let\value = \expandablevalue % We don't want these characters active, ... \catcode`\-=\other \catcode`\_=\other % ..., but we might end up with active ones in the argument if % we're called from @code, as @code{@value{foo-bar_}}, though. % So \let them to their normal equivalents. \let-\normaldash \let_\normalunderscore } } % We have this subroutine so that we can handle at least some @value's % properly in indexes (we call \makevalueexpandable in \indexdummies). % The command has to be fully expandable (if the variable is set), since % the result winds up in the index file. This means that if the % variable's value contains other Texinfo commands, it's almost certain % it will fail (although perhaps we could fix that with sufficient work % to do a one-level expansion on the result, instead of complete). % % Unfortunately, this has the consequence that when _ is in the *value* % of an @set, it does not print properly in the roman fonts (get the cmr % dot accent at position 126 instead). No fix comes to mind, and it's % been this way since 2003 or earlier, so just ignore it. % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% \message{Variable `#1', used in @value, is not set.}% \else \csname SET#1\endcsname \fi } % Like \expandablevalue, but completely expandable (the \message in the % definition above operates at the execution level of TeX). Used when % writing to auxiliary files, due to the expansion that \write does. % If flag is undefined, pass through an unexpanded @value command: maybe it % will be set by the time it is read back in. % % NB flag names containing - or _ may not work here. \def\dummyvalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax \noexpand\value{#1}% \else \csname SET#1\endcsname \fi } % Used for @value's in index entries to form the sort key: expand the @value % if possible, otherwise sort late. \def\indexnofontsvalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax ZZZZZZZ \else \csname SET#1\endcsname \fi } % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % % To get the special treatment we need for `@end ifset,' we call % \makecond and then redefine. % \makecond{ifset} \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} \def\doifset#1#2{% {% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname SET#2\endcsname\relax #1% If not set, redefine \next. \fi \expandafter }\next } \def\ifsetfail{\doignore{ifset}} % @ifclear VAR ... @end executes the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % % The `\else' inside the `\doifset' parameter is a trick to reuse the % above code: if the variable is not set, do nothing, if it is set, % then redefine \next to \ifclearfail. % \makecond{ifclear} \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} \def\ifclearfail{\doignore{ifclear}} % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written % without the @) is in fact defined. We can only feasibly check at the % TeX level, so something like `mathcode' is going to considered % defined even though it is not a Texinfo command. % \makecond{ifcommanddefined} \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} % \def\doifcmddefined#1#2{{% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname #2\endcsname\relax #1% If not defined, \let\next as above. \fi \expandafter }\next } \def\ifcmddefinedfail{\doignore{ifcommanddefined}} % @ifcommandnotdefined CMD ... handled similar to @ifclear above. \makecond{ifcommandnotdefined} \def\ifcommandnotdefined{% \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} % Set the `txicommandconditionals' variable, so documents have a way to % test if the @ifcommand...defined conditionals are available. \set txicommandconditionals % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory=\comment % @defininfoenclose. \let\definfoenclose=\comment \message{indexing,} % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite % except not \outer, so it can be used within macros and \if's. \edef\newwrite{\makecsname{ptexnewwrite}} % \newindex {foo} defines an index named IX. % It automatically defines \IXindex such that % \IXindex ...rest of line... puts an entry in the index IX. % It also defines \IXindfile to be the number of the output channel for % the file that accumulates this index. The file's extension is IX. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% \expandafter\chardef\csname#1indfile\endcsname=0 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} % \def\defindex{\parsearg\newindex} % Define @defcodeindex, like @defindex except put all entries in @code. % \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% \expandafter\chardef\csname#1indfile\endcsname=0 \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } % The default indices: \newindex{cp}% concepts, \newcodeindex{fn}% functions, \newcodeindex{vr}% variables, \newcodeindex{tp}% types, \newcodeindex{ky}% keys \newcodeindex{pg}% and programs. % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. % % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. % \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), % #3 the target index (bar). \def\dosynindex#1#2#3{% \requireopenindexfile{#3}% % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname \expandafter\let\csname#2indfile\endcsname=\temp % redefine \fooindex: \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } % Define \doindex, the driver for all index macros. % Argument #1 is generated by the calling \fooindex macro, % and it is the two-letter name of the index. \def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx} \def\doindexxxx #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx} \def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}} % Used when writing an index entry out to an index file to prevent % expansion of Texinfo commands that can appear in an index entry. % \def\indexdummies{% \escapechar = `\\ % use backslash in output files. \definedummyletter\@% \definedummyletter\ % % % For texindex which always views { and } as separators. \def\{{\lbracechar{}}% \def\}{\rbracechar{}}% % % Do the redefinitions. \definedummies } % Used for the aux and toc files, where @ is the escape character. % \def\atdummies{% \definedummyletter\@% \definedummyletter\ % \definedummyletter\{% \definedummyletter\}% % % Do the redefinitions. \definedummies \otherbackslash } % \definedummyword defines \#1 as \string\#1\space, thus effectively % preventing its expansion. This is used only for control words, % not control letters, because the \space would be incorrect for % control characters, but is needed to separate the control word % from whatever follows. % % These can be used both for control words that take an argument and % those that do not. If it is followed by {arg} in the input, then % that will dutifully get written to the index (or wherever). % % For control letters, we have \definedummyletter, which omits the % space. % \def\definedummyword #1{\def#1{\string#1\space}}% \def\definedummyletter#1{\def#1{\string#1}}% \let\definedummyaccent\definedummyletter % Called from \indexdummies and \atdummies, to effectively prevent % the expansion of commands. % \def\definedummies{% % \let\commondummyword\definedummyword \let\commondummyletter\definedummyletter \let\commondummyaccent\definedummyaccent \commondummiesnofonts % \definedummyletter\_% \definedummyletter\-% % % Non-English letters. \definedummyword\AA \definedummyword\AE \definedummyword\DH \definedummyword\L \definedummyword\O \definedummyword\OE \definedummyword\TH \definedummyword\aa \definedummyword\ae \definedummyword\dh \definedummyword\exclamdown \definedummyword\l \definedummyword\o \definedummyword\oe \definedummyword\ordf \definedummyword\ordm \definedummyword\questiondown \definedummyword\ss \definedummyword\th % % Although these internal commands shouldn't show up, sometimes they do. \definedummyword\bf \definedummyword\gtr \definedummyword\hat \definedummyword\less \definedummyword\sf \definedummyword\sl \definedummyword\tclose \definedummyword\tt % \definedummyword\LaTeX \definedummyword\TeX % % Assorted special characters. \definedummyword\atchar \definedummyword\arrow \definedummyword\bullet \definedummyword\comma \definedummyword\copyright \definedummyword\registeredsymbol \definedummyword\dots \definedummyword\enddots \definedummyword\entrybreak \definedummyword\equiv \definedummyword\error \definedummyword\euro \definedummyword\expansion \definedummyword\geq \definedummyword\guillemetleft \definedummyword\guillemetright \definedummyword\guilsinglleft \definedummyword\guilsinglright \definedummyword\lbracechar \definedummyword\leq \definedummyword\mathopsup \definedummyword\minus \definedummyword\ogonek \definedummyword\pounds \definedummyword\point \definedummyword\print \definedummyword\quotedblbase \definedummyword\quotedblleft \definedummyword\quotedblright \definedummyword\quoteleft \definedummyword\quoteright \definedummyword\quotesinglbase \definedummyword\rbracechar \definedummyword\result \definedummyword\sub \definedummyword\sup \definedummyword\textdegree % % We want to disable all macros so that they are not expanded by \write. \macrolist \let\value\dummyvalue % \normalturnoffactive } % \commondummiesnofonts: common to \definedummies and \indexnofonts. % Define \commondummyletter, \commondummyaccent and \commondummyword before % using. Used for accents, font commands, and various control letters. % \def\commondummiesnofonts{% % Control letters and accents. \commondummyletter\!% \commondummyaccent\"% \commondummyaccent\'% \commondummyletter\*% \commondummyaccent\,% \commondummyletter\.% \commondummyletter\/% \commondummyletter\:% \commondummyaccent\=% \commondummyletter\?% \commondummyaccent\^% \commondummyaccent\`% \commondummyaccent\~% \commondummyword\u \commondummyword\v \commondummyword\H \commondummyword\dotaccent \commondummyword\ogonek \commondummyword\ringaccent \commondummyword\tieaccent \commondummyword\ubaraccent \commondummyword\udotaccent \commondummyword\dotless % % Texinfo font commands. \commondummyword\b \commondummyword\i \commondummyword\r \commondummyword\sansserif \commondummyword\sc \commondummyword\slanted \commondummyword\t % % Commands that take arguments. \commondummyword\abbr \commondummyword\acronym \commondummyword\anchor \commondummyword\cite \commondummyword\code \commondummyword\command \commondummyword\dfn \commondummyword\dmn \commondummyword\email \commondummyword\emph \commondummyword\env \commondummyword\file \commondummyword\image \commondummyword\indicateurl \commondummyword\inforef \commondummyword\kbd \commondummyword\key \commondummyword\math \commondummyword\option \commondummyword\pxref \commondummyword\ref \commondummyword\samp \commondummyword\strong \commondummyword\tie \commondummyword\U \commondummyword\uref \commondummyword\url \commondummyword\var \commondummyword\verb \commondummyword\w \commondummyword\xref } % For testing: output @{ and @} in index sort strings as \{ and \}. \newif\ifusebracesinindexes \let\indexlbrace\relax \let\indexrbrace\relax {\catcode`\@=0 \catcode`\\=13 @gdef@backslashdisappear{@def\{}} } { \catcode`\<=13 \catcode`\-=13 \catcode`\`=13 \gdef\indexnonalnumdisappear{% \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else % @set txiindexlquoteignore makes us ignore left quotes in the sort term. % (Introduced for FSFS 2nd ed.) \let`=\empty \fi % \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else \backslashdisappear \fi % \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else \def-{}% \fi \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else \def<{}% \fi \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else \def\@{}% \fi } \gdef\indexnonalnumreappear{% \useindexbackslash \let-\normaldash \let<\normalless \def\@{@}% } } % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string % would be for a given command (usually its argument). % \def\indexnofonts{% % Accent commands should become @asis. \def\commondummyaccent##1{\let##1\asis}% % We can just ignore other control letters. \def\commondummyletter##1{\let##1\empty}% % All control words become @asis by default; overrides below. \let\commondummyword\commondummyaccent \commondummiesnofonts % % Don't no-op \tt, since it isn't a user-level command % and is used in the definitions of the active chars like <, >, |, etc. % Likewise with the other plain tex font commands. %\let\tt=\asis % \def\ { }% \def\@{@}% \def\_{\normalunderscore}% \def\-{}% @- shouldn't affect sorting % \uccode`\1=`\{ \uppercase{\def\{{1}}% \uccode`\1=`\} \uppercase{\def\}{1}}% \let\lbracechar\{% \let\rbracechar\}% % % Non-English letters. \def\AA{AA}% \def\AE{AE}% \def\DH{DZZ}% \def\L{L}% \def\OE{OE}% \def\O{O}% \def\TH{TH}% \def\aa{aa}% \def\ae{ae}% \def\dh{dzz}% \def\exclamdown{!}% \def\l{l}% \def\oe{oe}% \def\ordf{a}% \def\ordm{o}% \def\o{o}% \def\questiondown{?}% \def\ss{ss}% \def\th{th}% % \def\LaTeX{LaTeX}% \def\TeX{TeX}% % % Assorted special characters. \defglyph gives the control sequence a % definition that removes the {} that follows its use. \defglyph\atchar{@}% \defglyph\arrow{->}% \defglyph\bullet{bullet}% \defglyph\comma{,}% \defglyph\copyright{copyright}% \defglyph\dots{...}% \defglyph\enddots{...}% \defglyph\equiv{==}% \defglyph\error{error}% \defglyph\euro{euro}% \defglyph\expansion{==>}% \defglyph\geq{>=}% \defglyph\guillemetleft{<<}% \defglyph\guillemetright{>>}% \defglyph\guilsinglleft{<}% \defglyph\guilsinglright{>}% \defglyph\leq{<=}% \defglyph\lbracechar{\{}% \defglyph\minus{-}% \defglyph\point{.}% \defglyph\pounds{pounds}% \defglyph\print{-|}% \defglyph\quotedblbase{"}% \defglyph\quotedblleft{"}% \defglyph\quotedblright{"}% \defglyph\quoteleft{`}% \defglyph\quoteright{'}% \defglyph\quotesinglbase{,}% \defglyph\rbracechar{\}}% \defglyph\registeredsymbol{R}% \defglyph\result{=>}% \defglyph\textdegree{o}% % % We need to get rid of all macros, leaving only the arguments (if present). % Of course this is not nearly correct, but it is the best we can do for now. % makeinfo does not expand macros in the argument to @deffn, which ends up % writing an index entry, and texindex isn't prepared for an index sort entry % that starts with \. % % Since macro invocations are followed by braces, we can just redefine them % to take a single TeX argument. The case of a macro invocation that % goes to end-of-line is not handled. % \macrolist \let\value\indexnofontsvalue } \def\defglyph#1#2{\def#1##1{#2}} % see above \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % Most index entries go through here, but \dosubind is the general case. % #1 is the index name, #2 is the entry text. \def\doind#1#2{\dosubind{#1}{#2}{}} % There is also \dosubind {index}{topic}{subtopic} % which makes an entry in a two-level index such as the operation index. % TODO: Two-level index? Operation index? % Workhorse for all indexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % empty if called from \doind, as we usually are (the main exception % is with most defuns, which call us directly). % \def\dosubind#1#2#3{% \iflinks {% \requireopenindexfile{#1}% % Store the main index entry text (including the third arg). \toks0 = {#2}% % If third arg is present, precede it with a space. \def\thirdarg{#3}% \ifx\thirdarg\empty \else \toks0 = \expandafter{\the\toks0 \space #3}% \fi % \edef\writeto{\csname#1indfile\endcsname}% % \safewhatsit\dosubindwrite }% \fi } % Check if an index file has been opened, and if not, open it. \def\requireopenindexfile#1{% \ifnum\csname #1indfile\endcsname=0 \expandafter\newwrite \csname#1indfile\endcsname \edef\suffix{#1}% % A .fls suffix would conflict with the file extension for the output % of -recorder, so use .f1s instead. \ifx\suffix\indexisfl\def\suffix{f1}\fi % Open the file \immediate\openout\csname#1indfile\endcsname \jobname.\suffix % Using \immediate above here prevents an object entering into the current % box, which could confound checks such as those in \safewhatsit for % preceding skips. \typeout{Writing index file \jobname.\suffix}% \fi} \def\indexisfl{fl} % Output \ as {\indexbackslash}, because \ is an escape character in % the index files. \let\indexbackslash=\relax {\catcode`\@=0 \catcode`\\=\active @gdef@useindexbackslash{@def\{{@indexbackslash}}} } % Definition for writing index entry text. \def\sortas#1{\ignorespaces}% % Definition for writing index entry sort key. Should occur at the at % the beginning of the index entry, like % @cindex @sortas{september} \september % The \ignorespaces takes care of following space, but there's no way % to remove space before it. { \catcode`\-=13 \gdef\indexwritesortas{% \begingroup \indexnonalnumreappear \indexwritesortasxxx} \gdef\indexwritesortasxxx#1{% \xdef\indexsortkey{#1}\endgroup} } % Write the entry in \toks0 to the index file. % \def\dosubindwrite{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% \fi % % Remember, we are within a group. \indexdummies % Must do this here, since \bf, etc expand at this stage \useindexbackslash % \indexbackslash isn't defined now so it will be output % as is; and it will print as backslash. % The braces around \indexbrace are recognized by texindex. % % Get the string to sort by, by processing the index entry with all % font commands turned off. {\indexnofonts \def\lbracechar{{\indexlbrace}}% \def\rbracechar{{\indexrbrace}}% \let\{=\lbracechar \let\}=\rbracechar \indexnonalnumdisappear \xdef\indexsortkey{}% \let\sortas=\indexwritesortas \edef\temp{\the\toks0}% \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas \ifx\indexsortkey\empty \xdef\indexsortkey{\temp}% \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi \fi }% % % Set up the complete index entry, with both the sort key and % the original text, including any font commands. We write % three arguments to \entry to the .?? file (four in the % subentry case), texindex reduces to two when writing the .??s % sorted result. \edef\temp{% \write\writeto{% \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}% }% \temp } \newbox\dummybox % used above % Take care of unwanted page breaks/skips around a whatsit: % % If a skip is the last thing on the list now, preserve it % by backing up by \lastskip, doing the \write, then inserting % the skip again. Otherwise, the whatsit generated by the % \write or \pdfdest will make \lastskip zero. The result is that % sequences like this: % @end defun % @tindex whatever % @defun ... % will have extra space inserted, because the \medbreak in the % start of the @defun won't see the skip inserted by the @end of % the previous defun. % % But don't do any of this if we're not in vertical mode. We % don't want to do a \vskip and prematurely end a paragraph. % % Avoid page breaks due to these extra skips, too. % % But wait, there is a catch there: % We'll have to check whether \lastskip is zero skip. \ifdim is not % sufficient for this purpose, as it ignores stretch and shrink parts % of the skip. The only way seems to be to check the textual % representation of the skip. % % The following is almost like \def\zeroskipmacro{0.0pt} except that % the ``p'' and ``t'' characters have catcode \other, not 11 (letter). % \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} % \newskip\whatsitskip \newcount\whatsitpenalty % % ..., ready, GO: % \def\safewhatsit#1{\ifhmode #1% \else % \lastskip and \lastpenalty cannot both be nonzero simultaneously. \whatsitskip = \lastskip \edef\lastskipmacro{\the\lastskip}% \whatsitpenalty = \lastpenalty % % If \lastskip is nonzero, that means the last item was a % skip. And since a skip is discardable, that means this % -\whatsitskip glue we're inserting is preceded by a % non-discardable item, therefore it is not a potential % breakpoint, therefore no \nobreak needed. \ifx\lastskipmacro\zeroskipmacro \else \vskip-\whatsitskip \fi % #1% % \ifx\lastskipmacro\zeroskipmacro % If \lastskip was zero, perhaps the last item was a penalty, and % perhaps it was >=10000, e.g., a \nobreak. In that case, we want % to re-insert the same penalty (values >10000 are used for various % signals); since we just inserted a non-discardable item, any % following glue (such as a \parskip) would be a breakpoint. For example: % @deffn deffn-whatever % @vindex index-whatever % Description. % would allow a break between the index-whatever whatsit % and the "Description." paragraph. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi \else % On the other hand, if we had a nonzero \lastskip, % this make-up glue would be preceded by a non-discardable item % (the whatsit from the \write), so we must insert a \nobreak. \nobreak\vskip\whatsitskip \fi \fi} % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or % \entry {sortstring}{page}{topic}{subtopic} % The texindex program reads in these files and writes files % containing these kinds of lines: % \initial {c} % before the first topic whose initial is c % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. \def\findex {\fnindex} \def\kindex {\kyindex} \def\cindex {\cpindex} \def\vindex {\vrindex} \def\tindex {\tpindex} \def\pindex {\pgindex} \def\cindexsub {\begingroup\obeylines\cindexsub} {\obeylines % \gdef\cindexsub "#1" #2^^M{\endgroup % \dosubind{cp}{#2}{#1}}} % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % \parseargdef\printindex{\begingroup \dobreak \chapheadingskip{10000}% % \smallfonts \rm \tolerance = 9500 \plainfrenchspacing \everypar = {}% don't want the \kern\-parindent from indentation suppression. % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). \catcode`\@ = 12 % See comment in \requireopenindexfile. \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi \openin 1 \jobname.\indexname s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent \typeout{No file \jobname.\indexname s.}% \else \catcode`\\ = 0 % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. \read 1 to \thisline \ifeof 1 \putwordIndexIsEmpty \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. \def\indexbackslash{\ttbackslash}% \let\indexlbrace\{ % Likewise, set these sequences for braces \let\indexrbrace\} % used in the sort key. \begindoublecolumns \let\dotheinsertentrybox\dotheinsertentryboxwithpenalty % % Read input from the index file line by line. \loopdo \ifeof1 \else \read 1 to \nextline \fi % \indexinputprocessing \thisline % \ifeof1\else \let\thisline\nextline \repeat %% \enddoublecolumns \fi \fi \closein 1 \endgroup} \def\loopdo#1\repeat{\def\body{#1}\loopdoxxx} \def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next} \def\indexinputprocessing{% \ifeof1 \let\firsttoken\relax \else \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}% \act \fi } \def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken} \long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. {\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13 \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13 \catcode`\$=3 \gdef\initialglyphs{% % Some changes for non-alphabetic characters. Using the glyphs from the % math fonts looks more consistent than the typewriter font used elsewhere % for these characters. \def\indexbackslash{\math{\backslash}}% \let\\=\indexbackslash % % Can't get bold backslash so don't use bold forward slash \catcode`\/=13 \def/{{\secrmnotbold \normalslash}}% \def-{{\normaldash\normaldash}}% en dash `--' \def^{{\chapbf \normalcaret}}% \def~{{\chapbf \normaltilde}}% \def\_{% \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }% \def|{$\vert$}% \def<{$\less$}% \def>{$\gtr$}% \def+{$\normalplus$}% }} \def\initial{% \bgroup \initialglyphs \initialx } \def\initialx#1{% % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. % The glue before the bonus allows a little bit of space at the % bottom of a column to reduce an increase in inter-line spacing. \nobreak \vskip 0pt plus 5\baselineskip \penalty -300 \vskip 0pt plus -5\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column % to column. It still won't often be perfect, because of the stretch % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus 1\baselineskip \leftline{\secfonts \kern-0.05em \secbf #1}% % \secfonts is inside the argument of \leftline so that the change of % \baselineskip will not affect any glue inserted before the vbox that % \leftline creates. % Do our best not to break after the initial. \nobreak \vskip .33\baselineskip plus .1\baselineskip \egroup % \initialglyphs } \newdimen\entryrightmargin \entryrightmargin=0pt % \entry typesets a paragraph consisting of the text (#1), dot leaders, and % then page number (#2) flushed to the right margin. It is used for index % and table of contents entries. The paragraph is indented by \leftskip. % \def\entry{% \begingroup % % For pdfTeX and XeTeX. % The redefinition of \domark stops marks being added in \pdflink to % preserve coloured links across page boundaries. Otherwise the marks % would get in the way of \lastbox in \insertentrybox. \let\domark\relax % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % % No extra space above this paragraph. \parskip = 0in % % When reading the text of entry, convert explicit line breaks % from @* into spaces. The user might give these in long section % titles, for instance. \def\*{\unskip\space\ignorespaces}% \def\entrybreak{\hfil\break}% An undocumented command % % Swallow the left brace of the text (first parameter): \afterassignment\doentry \let\temp = } \def\entrybreak{\unskip\space\ignorespaces}% \def\doentry{% % Save the text of the entry \global\setbox\boxA=\hbox\bgroup \bgroup % Instead of the swallowed brace. \noindent \aftergroup\finishentry % And now comes the text of the entry. % Not absorbing as a macro argument reduces the chance of problems % with catcodes occurring. } {\catcode`\@=11 \gdef\finishentry#1{% \egroup % end box A \dimen@ = \wd\boxA % Length of text of entry \global\setbox\boxA=\hbox\bgroup\unhbox\boxA % #1 is the page number. % % Get the width of the page numbers, and only use % leaders if they are present. \global\setbox\boxB = \hbox{#1}% \ifdim\wd\boxB = 0pt \null\nobreak\hfill\ % \else % \null\nobreak\indexdotfill % Have leaders before the page number. % \ifpdf \pdfgettoks#1.% \hskip\skip\thinshrinkable\the\toksA \else \ifx\XeTeXrevision\thisisundefined \hskip\skip\thinshrinkable #1% \else \pdfgettoks#1.% \hskip\skip\thinshrinkable\the\toksA \fi \fi \fi \egroup % end \boxA \ifdim\wd\boxB = 0pt \global\setbox\entrybox=\vbox{\unhbox\boxA}% \else \global\setbox\entrybox=\vbox\bgroup % We want the text of the entries to be aligned to the left, and the % page numbers to be aligned to the right. % \parindent = 0pt \advance\leftskip by 0pt plus 1fil \advance\leftskip by 0pt plus -1fill \rightskip = 0pt plus -1fil \advance\rightskip by 0pt plus 1fill % Cause last line, which could consist of page numbers on their own % if the list of page numbers is long, to be aligned to the right. \parfillskip=0pt plus -1fill % \advance\rightskip by \entryrightmargin % Determine how far we can stretch into the margin. % This allows, e.g., "Appendix H GNU Free Documentation License" to % fit on one line in @letterpaper format. \ifdim\entryrightmargin>2.1em \dimen@i=2.1em \else \dimen@i=0em \fi \advance \parfillskip by 0pt minus 1\dimen@i % \dimen@ii = \hsize \advance\dimen@ii by -1\leftskip \advance\dimen@ii by -1\entryrightmargin \advance\dimen@ii by 1\dimen@i \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line \ifdim\dimen@ > 0.8\dimen@ii % due to long index text % Try to split the text roughly evenly. \dimen@ will be the length of % the first line. \dimen@ = 0.7\dimen@ \dimen@ii = \hsize \ifnum\dimen@>\dimen@ii % If the entry is too long (for example, if it needs more than % two lines), use all the space in the first line. \dimen@ = \dimen@ii \fi \advance\leftskip by 0pt plus 1fill % ragged right \advance \dimen@ by 1\rightskip \parshape = 2 0pt \dimen@ 0em \dimen@ii % Ideally we'd add a finite glue at the end of the first line only, % instead of using \parshape with explicit line lengths, but TeX % doesn't seem to provide a way to do such a thing. % % Indent all lines but the first one. \advance\leftskip by 1em \advance\parindent by -1em \fi\fi \indent % start paragraph \unhbox\boxA % % Do not prefer a separate line ending with a hyphen to fewer lines. \finalhyphendemerits = 0 % % Word spacing - no stretch \spaceskip=\fontdimen2\font minus \fontdimen4\font % \linepenalty=1000 % Discourage line breaks. \hyphenpenalty=5000 % Discourage hyphenation. % \par % format the paragraph \egroup % The \vbox \fi \endgroup \dotheinsertentrybox }} \newskip\thinshrinkable \skip\thinshrinkable=.15em minus .15em \newbox\entrybox \def\insertentrybox{% \ourunvbox\entrybox } % default definition \let\dotheinsertentrybox\insertentrybox % Use \lastbox to take apart vbox box by box, and add each sub-box % to the current vertical list. \def\ourunvbox#1{% \bgroup % for local binding of \delayedbox % Remove the last box from box #1 \global\setbox#1=\vbox{% \unvbox#1% \unskip % remove any glue \unpenalty \global\setbox\interbox=\lastbox }% \setbox\delayedbox=\box\interbox \ifdim\ht#1=0pt\else \ourunvbox#1 % Repeat on what's left of the box \nobreak \fi \box\delayedbox \egroup } \newbox\delayedbox \newbox\interbox % Used from \printindex. \firsttoken should be the first token % after the \entry. If it's not another \entry, we are at the last % line of a group of index entries, so insert a penalty to discourage % widowed index entries. \def\dotheinsertentryboxwithpenalty{% \ifx\firsttoken\isentry \else \penalty 9000 \fi \insertentrybox } \def\isentry{\entry}% % Like plain.tex's \dotfill, except uses up at least 1 em. % The filll stretch here overpowers both the fil and fill stretch to push % the page number to the right. \def\indexdotfill{\cleaders \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll} \def\primary #1{\line{#1\hfil}} \newskip\secondaryindent \secondaryindent=0.5cm \def\secondary#1#2{{% \parfillskip=0in \parskip=0in \hangindent=1in \hangafter=1 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else \ifx\XeTeXrevision\thisisundefined #2 \else \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \fi \fi \par }} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. \catcode`\@=11 % private names \newbox\partialpage \newdimen\doublecolumnhsize % Use inside an output routine to save \topmark and \firstmark \def\savemarks{% \global\savedtopmark=\expandafter{\topmark }% \global\savedfirstmark=\expandafter{\firstmark }% } \newtoks\savedtopmark \newtoks\savedfirstmark % Set \topmark and \firstmark for next time \output runs. % Can't be run from withinside \output (because any material % added while an output routine is active, including % penalties, is saved for after it finishes). The page so far % should be empty, otherwise what's on it will be thrown away. \def\restoremarks{% \mark{\the\savedtopmark}% \bgroup\output = {% \setbox\dummybox=\box\PAGE }abc\eject\egroup % "abc" because output routine doesn't fire for a completely empty page. \mark{\the\savedfirstmark}% } \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % If not much space left on page, start a new page. \ifdim\pagetotal>0.8\vsize\vfill\eject\fi % % Grab any single-column material above us. \output = {% % % Here is a possibility not foreseen in manmac: if we accumulate a % whole lot of material, we might end up calling this \output % routine twice in a row (see the doublecol-lose test, which is % essentially a couple of indexes with @setchapternewpage off). In % that case we just ship out what is in \partialpage with the normal % output routine. Generally, \partialpage will be empty when this % runs and this will be a no-op. See the indexspread.tex test case. \ifvoid\partialpage \else \onepageout{\pagecontents\partialpage}% \fi % \global\setbox\partialpage = \vbox{% % Unvbox the main output page. \unvbox\PAGE \kern-\topskip \kern\baselineskip }% \savemarks }% \eject % run that output routine to set \partialpage \restoremarks % % We recover the two marks that the last output routine saved in order % to propagate the information in marks added around a chapter heading, % which could be otherwise be lost by the time the final page is output. % % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% % % Change the page size parameters. We could do this once outside this % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 % format, but then we repeat the same computation. Repeating a couple % of assignments once per index is clearly meaningless for the % execution time, so we may as well do it in one place. % % First we halve the line length, less a little for the gutter between % the columns. We compute the gutter based on the line length, so it % changes automatically with the paper format. The magic constant % below is chosen so that the gutter has the same value (well, +-<1pt) % as it did when we hard-coded it. % % We put the result in a separate register, \doublecolumhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) % been clobbered. % \doublecolumnhsize = \hsize \advance\doublecolumnhsize by -.04154\hsize \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % % Double the \vsize as well. \advance\vsize by -\ht\partialpage \vsize = 2\vsize % % For the benefit of balancing columns \advance\baselineskip by 0pt plus 0.5pt } % The double-column output routine for all double-column pages except % the last, which is done by \balancecolumns. % \def\doublecolumnout{% % \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. \dimen@ = \vsize \divide\dimen@ by 2 % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@ \global\advance\vsize by 2\ht\partialpage \onepageout\pagesofar \unvbox\PAGE \penalty\outputpenalty } % % Re-output the contents of the output page -- any previous material, % followed by the two boxes we just split, in box0 and box2. \def\pagesofar{% \unvbox\partialpage % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\txipagewidth{\box0\hfil\box2}% } % Finished with with double columns. \def\enddoublecolumns{% % The following penalty ensures that the page builder is exercised % _before_ we change the output routine. This is necessary in the % following situation: % % The last section of the index consists only of a single entry. % Before this section, \pagetotal is less than \pagegoal, so no % break occurs before the last section starts. However, the last % section, consisting of \initial and the single \entry, does not % fit on the page and has to be broken off. Without the following % penalty the page builder will not be exercised until \eject % below, and by that time we'll already have changed the output % routine to the \balancecolumns version, so the next-to-last % double-column page will be processed with \balancecolumns, which % is wrong: The two columns will go to the main vertical list, with % the broken-off section in the recent contributions. As soon as % the output routine finishes, TeX starts reconsidering the page % break. The two columns and the broken-off section both fit on the % page, because the two columns now take up only half of the page % goal. When TeX sees \eject from below which follows the final % section, it invokes the new output routine that we've set after % \balancecolumns below; \onepageout will try to fit the two columns % and the final section into the vbox of \txipageheight (see % \pagebody), causing an overfull box. % % Note that glue won't work here, because glue does not exercise the % page builder, unlike penalties (see The TeXbook, pp. 280-281). \penalty0 % \output = {% % Split the last of the double-column material. \savemarks \balancecolumns }% \eject % call the \output just set \ifdim\pagetotal=0pt % Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. \global\output = {\onepageout{\pagecontents\PAGE}}% % \endgroup % started in \begindoublecolumns \restoremarks % Leave the double-column material on the current page, no automatic % page break. \box\balancedcolumns % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column % typesetting, so reset \pagegoal to the normal \vsize. \global\vsize = \txipageheight % \pagegoal = \txipageheight % \else % We had some left-over material. This might happen when \doublecolumnout % is called in \balancecolumns. Try again. \expandafter\enddoublecolumns \fi } \newbox\balancedcolumns \setbox\balancedcolumns=\vbox{shouldnt see this}% % % Only called for the last of the double column material. \doublecolumnout % does the others. \def\balancecolumns{% \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip \ifdim\dimen@<5\baselineskip % Don't split a short final column in two. \setbox2=\vbox{}% \global\setbox\balancedcolumns=\vbox{\pagesofar}% \else \divide\dimen@ by 2 % target to split to \dimen@ii = \dimen@ \splittopskip = \topskip % Loop until left column is at least as high as the right column. {% \vbadness = 10000 \loop \global\setbox3 = \copy0 \global\setbox1 = \vsplit3 to \dimen@ \ifdim\ht1<\ht3 \global\advance\dimen@ by 1pt \repeat }% % Now the left column is in box 1, and the right column in box 3. % % Check whether the left column has come out higher than the page itself. % (Note that we have doubled \vsize for the double columns, so % the actual height of the page is 0.5\vsize). \ifdim2\ht1>\vsize % It appears that we have been called upon to balance too much material. % Output some of it with \doublecolumnout, leaving the rest on the page. \setbox\PAGE=\box0 \doublecolumnout \else % Compare the heights of the two columns. \ifdim4\ht1>5\ht3 % Column heights are too different, so don't make their bottoms % flush with each other. \setbox2=\vbox to \ht1 {\unvbox3\vfill}% \setbox0=\vbox to \ht1 {\unvbox1\vfill}% \else % Make column bottoms flush with each other. \setbox2=\vbox to\ht1{\unvbox3\unskip}% \setbox0=\vbox to\ht1{\unvbox1\unskip}% \fi \global\setbox\balancedcolumns=\vbox{\pagesofar}% \fi \fi % } \catcode`\@ = \other \message{sectioning,} % Chapters, sections, etc. % Let's start with @part. \outer\parseargdef\part{\partzzz{#1}} \def\partzzz#1{% \chapoddpage \null \vskip.3\vsize % move it down on the page a bit \begingroup \noindent \titlefonts\rm #1\par % the text \let\lastnode=\empty % no node to associate with \writetocentry{part}{#1}{}% but put it in the toc \headingsoff % no headline or footline on the part page % This outputs a mark at the end of the page that clears \thischapter % and \thissection, as is done in \startcontents. \let\pchapsepmacro\relax \chapmacro{}{Yomitfromtoc}{}% \chapoddpage \endgroup } % \unnumberedno is an oxymoron. But we count the unnumbered % sections so that we can refer to them unambiguously in the pdf % outlines by their "section number". We avoid collisions with chapter % numbers by starting them at 10000. (If a document ever has 10000 % chapters, we're in trouble anyway, I'm sure.) \newcount\unnumberedno \unnumberedno = 10000 \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 \newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ % % \def\appendixletter{\char\the\appendixno} % We do the following ugly conditional instead of the above simple % construct for the sake of pdftex, which needs the actual % letter in the expansion, not just typeset. % \def\appendixletter{% \ifnum\appendixno=`A A% \else\ifnum\appendixno=`B B% \else\ifnum\appendixno=`C C% \else\ifnum\appendixno=`D D% \else\ifnum\appendixno=`E E% \else\ifnum\appendixno=`F F% \else\ifnum\appendixno=`G G% \else\ifnum\appendixno=`H H% \else\ifnum\appendixno=`I I% \else\ifnum\appendixno=`J J% \else\ifnum\appendixno=`K K% \else\ifnum\appendixno=`L L% \else\ifnum\appendixno=`M M% \else\ifnum\appendixno=`N N% \else\ifnum\appendixno=`O O% \else\ifnum\appendixno=`P P% \else\ifnum\appendixno=`Q Q% \else\ifnum\appendixno=`R R% \else\ifnum\appendixno=`S S% \else\ifnum\appendixno=`T T% \else\ifnum\appendixno=`U U% \else\ifnum\appendixno=`V V% \else\ifnum\appendixno=`W W% \else\ifnum\appendixno=`X X% \else\ifnum\appendixno=`Y Y% \else\ifnum\appendixno=`Z Z% % The \the is necessary, despite appearances, because \appendixletter is % expanded while writing the .toc file. \char\appendixno is not % expandable, thus it is written literally, thus all appendixes come out % with the same letter (or @) in the toc without it. \else\char\the\appendixno \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} % Each @chapter defines these (using marks) as the number+name, number % and name of the chapter. Page headings and footings can use % these. @section does likewise. \def\thischapter{} \def\thischapternum{} \def\thischaptername{} \def\thissection{} \def\thissectionnum{} \def\thissectionname{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} \let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name % we only have subsub. \chardef\maxseclevel = 3 % % A numbered section within an unnumbered changes to unnumbered too. % To achieve this, remember the "biggest" unnum. sec. we are currently in: \chardef\unnlevel = \maxseclevel % % Trace whether the current chapter is an appendix or not: % \chapheadtype is "N" or "A", unnumbered chapters are ignored. \def\chapheadtype{N} % Choose a heading macro % #1 is heading type % #2 is heading level % #3 is text for heading \def\genhead#1#2#3{% % Compute the abs. sec. level: \absseclevel=#2 \advance\absseclevel by \secbase % Make sure \absseclevel doesn't fall outside the range: \ifnum \absseclevel < 0 \absseclevel = 0 \else \ifnum \absseclevel > 3 \absseclevel = 3 \fi \fi % The heading type: \def\headtype{#1}% \if \headtype U% \ifnum \absseclevel < \unnlevel \chardef\unnlevel = \absseclevel \fi \else % Check for appendix sections: \ifnum \absseclevel = 0 \edef\chapheadtype{\headtype}% \else \if \headtype A\if \chapheadtype N% \errmessage{@appendix... within a non-appendix chapter}% \fi\fi \fi % Check for numbered within unnumbered: \ifnum \absseclevel > \unnlevel \def\headtype{U}% \else \chardef\unnlevel = 3 \fi \fi % Now print the heading: \if \headtype U% \ifcase\absseclevel \unnumberedzzz{#3}% \or \unnumberedseczzz{#3}% \or \unnumberedsubseczzz{#3}% \or \unnumberedsubsubseczzz{#3}% \fi \else \if \headtype A% \ifcase\absseclevel \appendixzzz{#3}% \or \appendixsectionzzz{#3}% \or \appendixsubseczzz{#3}% \or \appendixsubsubseczzz{#3}% \fi \else \ifcase\absseclevel \chapterzzz{#3}% \or \seczzz{#3}% \or \numberedsubseczzz{#3}% \or \numberedsubsubseczzz{#3}% \fi \fi \fi \suppressfirstparagraphindent } % an interface: \def\numhead{\genhead N} \def\apphead{\genhead A} \def\unnmhead{\genhead U} % @chapter, @appendix, @unnumbered. Increment top-level counter, reset % all lower-level sectioning counters to zero. % % Also set \chaplevelprefix, which we prepend to @float sequence numbers % (e.g., figures), q.v. By default (before any chapter), that is empty. \let\chaplevelprefix = \empty % \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz \def\chapterzzz#1{% % section resetting is \global in case the chapter is in a group, such % as an @include file. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\chapno by 1 % % Used for \float. \gdef\chaplevelprefix{\the\chapno.}% \resetallfloatnos % % \putwordChapter can contain complex things in translations. \toks0=\expandafter{\putwordChapter}% \message{\the\toks0 \space \the\chapno}% % % Write the actual heading. \chapmacro{#1}{Ynumbered}{\the\chapno}% % % So @section and the like are numbered underneath this chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz % \def\appendixzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\appendixno by 1 \gdef\chaplevelprefix{\appendixletter.}% \resetallfloatnos % % \putwordAppendix can contain complex things in translations. \toks0=\expandafter{\putwordAppendix}% \message{\the\toks0 \space \appendixletter}% % \chapmacro{#1}{Yappendix}{\appendixletter}% % \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } % normally unnmhead0 calls unnumberedzzz: \outer\parseargdef\unnumbered{\unnmhead0{#1}} \def\unnumberedzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\unnumberedno by 1 % % Since an unnumbered has no number, no prefix for figures. \global\let\chaplevelprefix = \empty \resetallfloatnos % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX % expanded them. For example, in `@unnumbered The @cite{Book}', TeX % expanded @cite (which turns out to cause errors because \cite is meant % to be executed, not expanded). % % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, % simply yielding the contents of . (We also do this for % the toc entries.) \toks0 = {#1}% \message{(\the\toks0)}% % \chapmacro{#1}{Ynothing}{\the\unnumberedno}% % \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. \outer\parseargdef\centerchap{% \let\centerparametersmaybe = \centerparameters \unnmhead0{#1}% \let\centerparametersmaybe = \relax } % @top is like @unnumbered. \let\top\unnumbered % Sections. % \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz \def\seczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% } % normally calls appendixsectionzzz: \outer\parseargdef\appendixsection{\apphead1{#1}} \def\appendixsectionzzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% } \let\appendixsec\appendixsection % normally calls unnumberedseczzz: \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} \def\unnumberedseczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% } % Subsections. % % normally calls numberedsubseczzz: \outer\parseargdef\numberedsubsec{\numhead2{#1}} \def\numberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% } % normally calls appendixsubseczzz: \outer\parseargdef\appendixsubsec{\apphead2{#1}} \def\appendixsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno}% } % normally calls unnumberedsubseczzz: \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} \def\unnumberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno}% } % Subsubsections. % % normally numberedsubsubseczzz: \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} \def\numberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynumbered}% {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% } % normally appendixsubsubseczzz: \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} \def\appendixsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% } % normally unnumberedsubsubseczzz: \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} \def\unnumberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% } % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. \let\section = \numberedsec \let\subsection = \numberedsubsec \let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading \def\majorheading{% {\advance\chapheadingskip by 10pt \chapbreak }% \parsearg\chapheadingzzz } \def\chapheading{\chapbreak \parsearg\chapheadingzzz} \def\chapheadingzzz#1{% \vbox{\chapfonts \raggedtitlesettings #1\par}% \nobreak\bigskip \nobreak \suppressfirstparagraphindent } % @heading, @subheading, @subsubheading. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), % given all the information in convenient, parsed form. % Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} % Parameter controlling skip before chapter headings (if needed) \newskip\chapheadingskip % Define plain chapter starts, and page on/off switching for it. \def\chapbreak{\dobreak \chapheadingskip {-4000}} % Start a new page \def\chappager{\par\vfill\supereject} % \chapoddpage - start on an odd page for a new chapter % Because \domark is called before \chapoddpage, the filler page will % get the headings for the next chapter, which is wrong. But we don't % care -- we just disable all headings on the filler page. \def\chapoddpage{% \chappager \ifodd\pageno \else \begingroup \headingsoff \null \chappager \endgroup \fi } \parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon % \chapmacro - Chapter opening. % % #1 is the text, #2 is the section type (Ynumbered, Ynothing, % Yappendix, Yomitfromtoc), #3 the chapter number. % Not used for @heading series. % % To test against our argument. \def\Ynothingkeyword{Ynothing} \def\Yappendixkeyword{Yappendix} \def\Yomitfromtockeyword{Yomitfromtoc} % \def\chapmacro#1#2#3{% \expandafter\ifx\thisenv\titlepage\else \checkenv{}% chapters, etc., should not start inside an environment. \fi % FIXME: \chapmacro is currently called from inside \titlepage when % \setcontentsaftertitlepage to print the "Table of Contents" heading, but % this should probably be done by \sectionheading with an option to print % in chapter size. % % Insert the first mark before the heading break (see notes for \domark). \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% \gdef\thissection{}}% % \def\temptype{#2}% \ifx\temptype\Ynothingkeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{\thischaptername}}% \else\ifx\temptype\Yomitfromtockeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{}}% \else\ifx\temptype\Yappendixkeyword \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\appendixletter}% % \noexpand\putwordAppendix avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \else \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\the\chapno}% % \noexpand\putwordChapter avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordChapter{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \fi\fi\fi % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert the chapter heading break. \pchapsepmacro % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \domark % {% \chapfonts \rm \let\footnote=\errfootnoteheading % give better error message % % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called % after \pchapsepmacro, or the headline will change too soon. \gdef\lastsection{#1}% % % Only insert the separating space if we have a chapter/appendix % number, and don't print the unnumbered ``number''. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unnchap}% \else\ifx\temptype\Yomitfromtockeyword \setbox0 = \hbox{}% contents like unnumbered, but no toc entry \def\toctype{omit}% \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% \def\toctype{app}% \else \setbox0 = \hbox{#3\enspace}% \def\toctype{numchap}% \fi\fi\fi % % Write the toc entry for this chapter. Must come before the % \donoderef, because we include the current node name in the toc % entry, and \donoderef resets it to empty. \writetocentry{\toctype}{#1}{#3}% % % For pdftex, we have to write out the node definition (aka, make % the pdfdest) after any page break, but before the actual text has % been typeset. If the destination for the pdf outline is after the % text, then jumping from the outline may wind up with the text not % being visible, for instance under high magnification. \donoderef{#2}% % % Typeset the actual heading. \nobreak % Avoid page breaks at the interline glue. \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax \def\centerparameters{% \advance\rightskip by 3\rightskip \leftskip = \rightskip \parfillskip = 0pt } % Section titles. These macros combine the section number parts and % call the generic \sectionheading to do the printing. % \newskip\secheadingskip \def\secheadingbreak{\dobreak \secheadingskip{-1000}} % Subsection titles. \newskip\subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} % Subsubsection titles. \def\subsubsecheadingskip{\subsecheadingskip} \def\subsubsecheadingbreak{\subsecheadingbreak} % Print any size, any type, section title. % % #1 is the text of the title, % #2 is the section level (sec/subsec/subsubsec), % #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc), % #4 is the section number. % \def\seckeyword{sec} % \def\sectionheading#1#2#3#4{% {% \def\sectionlevel{#2}% \def\temptype{#3}% % % It is ok for the @heading series commands to appear inside an % environment (it's been historically allowed, though the logic is % dubious), but not the others. \ifx\temptype\Yomitfromtockeyword\else \checkenv{}% non-@*heading should not be in an environment. \fi \let\footnote=\errfootnoteheading % % Switch to the right set of fonts. \csname #2fonts\endcsname \rm % % Insert first mark before the heading break (see notes for \domark). \let\prevsectiondefs=\lastsectiondefs \ifx\temptype\Ynothingkeyword \ifx\sectionlevel\seckeyword \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% \gdef\thissection{\thissectionname}}% \fi \else\ifx\temptype\Yomitfromtockeyword % Don't redefine \thissection. \else\ifx\temptype\Yappendixkeyword \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \else \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \fi\fi\fi % % Go into vertical mode. Usually we'll already be there, but we % don't want the following whatsit to end up in a preceding paragraph % if the document didn't happen to have a blank line. \par % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert space above the heading. \csname #2headingbreak\endcsname % % Now the second mark, after the heading break. No break points % between here and the heading. \global\let\prevsectiondefs=\lastsectiondefs \domark % % Only insert the space after the number if we have a section number. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unn}% \gdef\lastsection{#1}% \else\ifx\temptype\Yomitfromtockeyword % for @headings -- no section number, don't include in toc, % and don't redefine \lastsection. \setbox0 = \hbox{}% \def\toctype{omit}% \let\sectionlevel=\empty \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{#4\enspace}% \def\toctype{app}% \gdef\lastsection{#1}% \else \setbox0 = \hbox{#4\enspace}% \def\toctype{num}% \gdef\lastsection{#1}% \fi\fi\fi % % Write the toc entry (before \donoderef). See comments in \chapmacro. \writetocentry{\toctype\sectionlevel}{#1}{#4}% % % Write the node reference (= pdf destination for pdftex). % Again, see comments in \chapmacro. \donoderef{#3}% % % Interline glue will be inserted when the vbox is completed. % That glue will be a valid breakpoint for the page, since it'll be % preceded by a whatsit (usually from the \donoderef, or from the % \writetocentry if there was no node). We don't want to allow that % break, since then the whatsits could end up on page n while the % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. \nobreak % % Output the actual section heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright \hangindent=\wd0 % zero if no section number \unhbox0 #1}% }% % Add extra space after the heading -- half of whatever came above it. % Don't allow stretch, though. \kern .5 \csname #2headingskip\endcsname % % Do not let the kern be a potential breakpoint, as it would be if it % was followed by glue. \nobreak % % We'll almost certainly start a paragraph next, so don't let that % glue accumulate. (Not a breakpoint because it's preceded by a % discardable item.) However, when a paragraph is not started next % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out % or the negative glue will cause weirdly wrong output, typically % obscuring the section heading with something else. \vskip-\parskip % % This is so the last item on the main vertical list is a known % \penalty > 10000, so \startdefun, etc., can recognize the situation % and do the needful. \penalty 10001 } \message{toc,} % Table of contents. \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. % Called from @chapter, etc. % % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} % We append the current node name (if any) and page number as additional % arguments for the \{chap,sec,...}entry macros which will eventually % read this. The node name is used in the pdf outlines as the % destination to jump to. % % We open the .toc file for writing here instead of at @setfilename (or % any other fixed time) so that @contents can be anywhere in the document. % But if #1 is `omit', then we don't do anything. This is used for the % table of contents chapter openings themselves. % \newif\iftocfileopened \def\omitkeyword{omit}% % \def\writetocentry#1#2#3{% \edef\writetoctype{#1}% \ifx\writetoctype\omitkeyword \else \iftocfileopened\else \immediate\openout\tocfile = \jobname.toc \global\tocfileopenedtrue \fi % \iflinks {\atdummies \edef\temp{% \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% \temp }% \fi \fi % % Tell \shipout to create a pdf destination on each page, if we're % writing pdf. These are used in the table of contents. We can't % just write one on every page because the title pages are numbered % 1 and 2 (the page numbers aren't printed), and so are the first % two pages of the document. Thus, we'd have two destinations named % `1', and two named `2'. \ifpdf \global\pdfmakepagedesttrue \else \ifx\XeTeXrevision\thisisundefined \else \global\pdfmakepagedesttrue \fi \fi } % These characters do not print properly in the Computer Modern roman % fonts, so we must take special care. This is more or less redundant % with the Texinfo input format setup at the end of this file. % \def\activecatcodes{% \catcode`\"=\active \catcode`\$=\active \catcode`\<=\active \catcode`\>=\active \catcode`\\=\active \catcode`\^=\active \catcode`\_=\active \catcode`\|=\active \catcode`\~=\active } % Read the toc file, which is essentially Texinfo input. \def\readtocfile{% \setupdatafile \activecatcodes \input \tocreadfilename } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 % Prepare to read what we've written to \tocfile. % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund \contentsalignmacro \immediate\closeout\tocfile % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \chapmacro{#1}{Yomitfromtoc}{}% % \savepageno = \pageno \begingroup % Set up to handle contents files properly. \raggedbottom % Worry more about breakpoints than the bottom. \entryrightmargin=\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi } % redefined for the two-volume lispref. We always output on % \jobname.toc even if this is redefined. % \def\tocreadfilename{\jobname.toc} % Normal (long) toc. % \def\contents{% \startcontents{\putwordTOC}% \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \ifeof 1 \else \pdfmakeoutlines \fi \closein 1 \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } % And just the chapters. \def\summarycontents{% \startcontents{\putwordShortTOC}% % \let\partentry = \shortpartentry \let\numchapentry = \shortchapentry \let\appentry = \shortchapentry \let\unnchapentry = \shortunnchapentry % We want a true roman here for the page numbers. \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \let\tt=\shortconttt \rm \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\numsecentry##1##2##3##4{} \let\appsecentry = \numsecentry \let\unnsecentry = \numsecentry \let\numsubsecentry = \numsecentry \let\appsubsecentry = \numsecentry \let\unnsubsecentry = \numsecentry \let\numsubsubsecentry = \numsecentry \let\appsubsubsecentry = \numsecentry \let\unnsubsubsecentry = \numsecentry \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \closein 1 \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } \let\shortcontents = \summarycontents % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g., `A' for an appendix, or `3' for a chapter. % \def\shortchaplabel#1{% % This space should be enough, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % But use \hss just in case. % (This space doesn't include the extra space that gets added after % the label; that gets put in by \shortchapentry above.) % % We'd like to right-justify chapter numbers, but that looks strange % with appendix letters. And right-justifying numbers and % left-justifying letters looks strange when there is less than 10 % chapters. Have to read the whole toc once to know how many chapters % there are before deciding ... \hbox to 1em{#1\hss}% } % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. % The arguments in between are the chapter number, section number, ... % Parts, in the main contents. Replace the part number, which doesn't % exist, with an empty box. Let's hope all the numbers have the same width. % Also ignore the page number, which is conventionally not printed. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} \def\partentry#1#2#3#4{% % Add stretch and a bonus for breaking the page before the part heading. % This reduces the chance of the page being broken immediately after the % part heading, before a following chapter heading. \vskip 0pt plus 5\baselineskip \penalty-300 \vskip 0pt plus -5\baselineskip \dochapentry{\numeralbox\labelspace#1}{}% } % % Parts, in the short toc. \def\shortpartentry#1#2#3#4{% \penalty-300 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip \shortchapentry{{\bf #1}}{\numeralbox}{}{}% } % Chapters, in the main contents. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3#4{% \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% } % Appendices, in the main contents. % Need the word Appendix, and a fixed-size box. % \def\appendixbox#1{% % We use M since it's probably the widest letter. \setbox0 = \hbox{\putwordAppendix{} M}% \hbox to \wd0{\putwordAppendix{} #1\hss}} % \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}} % Unnumbered chapters. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} % Sections. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} \let\appsecentry=\numsecentry \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} % Subsections. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} \let\appsubsecentry=\numsubsecentry \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} \let\appsubsubsecentry=\numsubsubsecentry \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} % This parameter controls the indentation of the various levels. % Same as \defaultparindent. \newdimen\tocindent \tocindent = 15pt % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup % Move the page numbers slightly to the right \advance\entryrightmargin by -0.05em \chapentryfonts \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} % We use the same \entry macro as for the index entries. \let\tocentry = \entry % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} \def\dopageno#1{{\rm #1}} \def\doshortpageno#1{{\rm #1}} \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} \def\subsecentryfonts{\textfonts} \def\subsubsecentryfonts{\textfonts} \message{environments,} % @foo ... @end foo. % @tex ... @end tex escapes into raw TeX temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain @ character. \envdef\tex{% \setupmarkupstyle{tex}% \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie \catcode `\%=14 \catcode `\+=\other \catcode `\"=\other \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other \catcode `\`=\other \catcode `\'=\other % % ' is active in math mode (mathcode"8000). So reset it, and all our % other math active characters (just in case), to plain's definitions. \mathactive % % Inverse of the list at the beginning of the file. \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc \let\,=\ptexcomma \let\.=\ptexdot \let\dots=\ptexdots \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi \let\indent=\ptexindent \let\noindent=\ptexnoindent \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace \let\/=\ptexslash \let\sp=\ptexsp \let\*=\ptexstar %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode \let\t=\ptext \expandafter \let\csname top\endcsname=\ptextop % we've made it outer \let\frenchspacing=\plainfrenchspacing % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% } % There is no need to define \Etex. % Define @lisp ... @end lisp. % @lisp environment forms a group so it can rebind things, % including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in % This is the definition that ^^M gets inside @lisp, @example, and other % such environments. \null is better than a space, since it doesn't % have any width. \def\lisppar{\null\endgraf} % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the % start of the next paragraph will insert \parskip. % \def\aboveenvbreak{{% % =10000 instead of <10000 because of a special case in \itemzzz and % \sectionheading, q.v. \ifnum \lastpenalty=10000 \else \advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip \ifnum\lastpenalty<10000 % Penalize breaking before the environment, because preceding text % often leads into it. \penalty100 \fi \vskip\envskipamount \fi \fi }} \def\afterenvbreak{{% % =10000 instead of <10000 because of a special case in \itemzzz and % \sectionheading, q.v. \ifnum \lastpenalty=10000 \else \advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip % it's not a good place to break if the last penalty was \nobreak % or better ... \ifnum\lastpenalty<10000 \penalty-50 \fi \vskip\envskipamount \fi \fi }} % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will % also clear it, so that its embedded environments do the narrowing again. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner \newskip\normbskip\newskip\normpskip\newskip\normlskip \circthick=\fontdimen8\circle % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip \ctl\leaders\hrule height\circthick\hfil\ctr \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip \cbl\leaders\hrule height\circthick\hfil\cbr \hskip\rskip}} % \newskip\lskip\newskip\rskip \envdef\cartouche{% \ifhmode\par\fi % can't be in the midst of a paragraph. \startsavinginserts \lskip=\leftskip \rskip=\rightskip \leftskip=0pt\rightskip=0pt % we want these *outside*. \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % % If this cartouche directly follows a sectioning command, we need the % \parskip glue (backspaced over by default) or the cartouche can % collide with the section heading. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi % \setbox\groupbox=\vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup \hskip\lskip \vrule\kern3pt \vbox\bgroup \kern3pt \hsize=\cartinner \baselineskip=\normbskip \lineskip=\normlskip \parskip=\normpskip \vskip -\parskip \comment % For explanation, see the end of def\group. } \def\Ecartouche{% \ifhmode\par\fi \kern3pt \egroup \kern3pt\vrule \hskip\rskip \egroup \cartbot \egroup \addgroupbox \checkinserts } % This macro is called at the beginning of all the @example variants, % inside a group. \newdimen\nonfillparindent \def\nonfillstart{% \aboveenvbreak \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt % Turn off paragraph indentation but redefine \indent to emulate % the normal \indent. \nonfillparindent=\parindent \parindent = 0pt \let\indent\nonfillindent % \emergencystretch = 0pt % don't try to avoid overfull boxes \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing \else \let\nonarrowing = \relax \fi \let\exdent=\nofillexdent } \begingroup \obeyspaces % We want to swallow spaces (but not other tokens) after the fake % @indent in our nonfill-environments, where spaces are normally % active and set to @tie, resulting in them not being ignored after % @indent. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% \gdef\nonfillindentcheck{% \ifx\temp % \expandafter\nonfillindentgobble% \else% \leavevmode\nonfillindentbox% \fi% }% \endgroup \def\nonfillindentgobble#1{\nonfillindent} \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} % If you want all examples etc. small: @set dispenvsize small. % If you want even small examples the full size: @set dispenvsize nosmall. % This affects the following displayed environments: % @example, @display, @format, @lisp % \def\smallword{small} \def\nosmallword{nosmall} \let\SETdispenvsize\relax \def\setnormaldispenv{% \ifx\SETdispenvsize\smallword % end paragraph for sake of leading, in case document has no blank % line. This is redundant with what happens in \aboveenvbreak, but % we need to do it before changing the fonts, and it's inconvenient % to change the fonts afterward. \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } \def\setsmalldispenv{% \ifx\SETdispenvsize\nosmallword \else \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } % We often define two environments, @foo and @smallfoo. % Let's do it in one command. #1 is the env name, #2 the definition. \def\makedispenvdef#1#2{% \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% \expandafter\let\csname E#1\endcsname \afterenvbreak \expandafter\let\csname Esmall#1\endcsname \afterenvbreak } % Define two environment synonyms (#1 and #2) for an environment. \def\maketwodispenvdef#1#2#3{% \makedispenvdef{#1}{#3}% \makedispenvdef{#2}{#3}% } % % @lisp: indented, narrowed, typewriter font; % @example: same as @lisp. % % @smallexample and @smalllisp: use smaller fonts. % Originally contributed by Pavel@xerox. % \maketwodispenvdef{lisp}{example}{% \nonfillstart \tt\setupmarkupstyle{example}% \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } % @display/@smalldisplay: same as @lisp except keep current font. % \makedispenvdef{display}{% \nonfillstart \gobble } % @format/@smallformat: same as @display except don't narrow margins. % \makedispenvdef{format}{% \let\nonarrowing = t% \nonfillstart \gobble } % @flushleft: same as @format, but doesn't obey \SETdispenvsize. \envdef\flushleft{% \let\nonarrowing = t% \nonfillstart \gobble } \let\Eflushleft = \afterenvbreak % @flushright. % \envdef\flushright{% \let\nonarrowing = t% \nonfillstart \advance\leftskip by 0pt plus 1fill\relax \gobble } \let\Eflushright = \afterenvbreak % @raggedright does more-or-less normal line breaking but no right % justification. From plain.tex. Don't stretch around special % characters in urls in this environment, since the stretch at the right % should be enough. \envdef\raggedright{% \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax \def\urefprestretchamount{0pt}% \def\urefpoststretchamount{0pt}% } \let\Eraggedright\par \envdef\raggedleft{% \parindent=0pt \leftskip0pt plus2em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedleft\par \envdef\raggedcenter{% \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedcenter\par % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. We keep \parskip nonzero in general, since % we're doing normal filling. So, when using \aboveenvbreak and % \afterenvbreak, temporarily make \parskip 0. % \makedispenvdef{quotation}{\quotationstart} % \def\quotationstart{% \indentedblockstart % same as \indentedblock, but increase right margin too. \ifx\nonarrowing\relax \advance\rightskip by \lispnarrowing \fi \parsearg\quotationlabel } % We have retained a nonzero parskip for the environment, since we're % doing normal filling. % \def\Equotation{% \par \ifx\quotationauthor\thisisundefined\else % indent a bit. \leftline{\kern 2\leftskip \sl ---\quotationauthor}% \fi {\parskip=0pt \afterenvbreak}% } \def\Esmallquotation{\Equotation} % If we're given an argument, typeset it in bold with a colon after. \def\quotationlabel#1{% \def\temp{#1}% \ifx\temp\empty \else {\bf #1: }% \fi } % @indentedblock is like @quotation, but indents only on the left and % has no optional argument. % \makedispenvdef{indentedblock}{\indentedblockstart} % \def\indentedblockstart{% {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \parindent=0pt % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax \advance\leftskip by \lispnarrowing \exdentamount = \lispnarrowing \else \let\nonarrowing = \relax \fi } % Keep a nonzero parskip for the environment, since we're doing normal filling. % \def\Eindentedblock{% \par {\parskip=0pt \afterenvbreak}% } \def\Esmallindentedblock{\Eindentedblock} % LaTeX-like @verbatim...@end verbatim and @verb{...} % If we want to allow any as delimiter, % we need the curly braces so that makeinfo sees the @verb command, eg: % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org % % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. % % [Knuth] p.344; only we need to do the other characters Texinfo sets % active too. Otherwise, they get lost as the first character on a % verbatim line. \def\dospecials{% \do\ \do\\\do\{\do\}\do\$\do\&% \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% \do\<\do\>\do\|\do\@\do+\do\"% % Don't do the quotes -- if we do, @set txicodequoteundirected and % @set txicodequotebacktick will not have effect on @verb and % @verbatim, and ?` and !` ligatures won't get disabled. %\do\`\do\'% } % % [Knuth] p. 380 \def\uncatcodespecials{% \def\do##1{\catcode`##1=\other}\dospecials} % % Setup for the @verb command. % % Eight spaces for a tab \begingroup \catcode`\^^I=\active \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} \endgroup % \def\setupverb{% \tt % easiest (and conventionally used) font for verbatim \def\par{\leavevmode\endgraf}% \setupmarkupstyle{verb}% \tabeightspaces % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces } % Setup for the @verbatim environment % % Real tab expansion. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % % We typeset each line of the verbatim in an \hbox, so we can handle % tabs. The \global is in case the verbatim line starts with an accent, % or some other command that starts with a begin-group. Otherwise, the % entire \verbbox would disappear at the corresponding end-group, before % it is typeset. Meanwhile, we can't have nested verbatim commands % (can we?), so the \global won't be overwriting itself. \newbox\verbbox \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} % \begingroup \catcode`\^^I=\active \gdef\tabexpand{% \catcode`\^^I=\active \def^^I{\leavevmode\egroup \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab \divide\dimen\verbbox by\tabw \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox }% } \endgroup % start the verbatim environment. \def\setupverbatim{% \let\nonarrowing = t% \nonfillstart \tt % easiest (and conventionally used) font for verbatim % The \leavevmode here is for blank lines. Otherwise, we would % never \starttabox and the \egroup would end verbatim mode. \def\par{\leavevmode\egroup\box\verbbox\endgraf}% \tabexpand \setupmarkupstyle{verbatim}% % Respect line breaks, % print special symbols as themselves, and % make each space count. % Must do in this order: \obeylines \uncatcodespecials \sepspaces \everypar{\starttabbox}% } % Do the @verb magic: verbatim text is quoted by unique % delimiter characters. Before first delimiter expect a % right brace, after last delimiter expect closing brace: % % \def\doverb'{'#1'}'{#1} % % [Knuth] p. 382; only eat outer {} \begingroup \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] \endgroup % \def\verb{\begingroup\setupverb\doverb} % % % Do the @verbatim magic: define the macro \doverbatim so that % the (first) argument ends when '@end verbatim' is reached, ie: % % \def\doverbatim#1@end verbatim{#1} % % For Texinfo it's a lot easier than for LaTeX, % because texinfo's \verbatim doesn't stop at '\end{verbatim}': % we need not redefine '\', '{' and '}'. % % Inspired by LaTeX's verbatim command set [latex.ltx] % \begingroup \catcode`\ =\active \obeylines % % ignore everything up to the first ^^M, that's the newline at the end % of the @verbatim input line itself. Otherwise we get an extra blank % line in the output. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% % We really want {...\end verbatim} in the body of the macro, but % without the active space; thus we have to use \xdef and \gobble. \endgroup % \envdef\verbatim{% \setupverbatim\doverbatim } \let\Everbatim = \afterenvbreak % @verbatiminclude FILE - insert text of file in verbatim environment. % \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} % \def\doverbatiminclude#1{% {% \makevalueexpandable \setupverbatim \indexnofonts % Allow `@@' and other weird things in file names. \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% \input #1 \afterenvbreak }% } % @copying ... @end copying. % Save the text away for @insertcopying later. % % We save the uninterpreted tokens, rather than creating a box. % Saving the text in a box would be much easier, but then all the % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as % possible is desirable. % \def\copying{\checkenv{}\begingroup\scanargctxt\docopying} \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} % \def\insertcopying{% \begingroup \parindent = 0pt % paragraph indentation looks wrong on title page \scanexp\copyingtext \endgroup } \message{defuns,} % @defun etc. \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deflastargmargin \deflastargmargin=18pt \newcount\defunpenalty % Start the processing of @deffn: \def\startdefun{% \ifnum\lastpenalty<10000 \medbreak \defunpenalty=10003 % Will keep this @deffn together with the % following @def command, see below. \else % If there are two @def commands in a row, we'll have a \nobreak, % which is there to keep the function description together with its % header. But if there's nothing but headers, we need to allow a % break somewhere. Check specifically for penalty 10002, inserted % by \printdefunline, instead of 10000, since the sectioning % commands also insert a nobreak penalty, and we don't want to allow % a break between a section heading and a defun. % % As a further refinement, we avoid "club" headers by signalling % with penalty of 10003 after the very first @deffn in the % sequence (see above), and penalty of 10002 after any following % @def command. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi % % Similarly, after a section heading, do not allow a break. % But do insert the glue. \medskip % preceded by discardable penalty, so not a breakpoint \fi % \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent } \def\dodefunx#1{% % First, check whether we are in the right environment: \checkenv#1% % % As above, allow line break if we have multiple x headers in a row. % It's not a great place, though. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi % % And now, it's time to reuse the body of the original defun: \expandafter\gobbledefun#1% } \def\gobbledefun#1\startdefun{} % \printdefunline \deffnheader{text} % \def\printdefunline#1#2{% \begingroup % call \deffnheader: #1#2 \endheader % common ending: \interlinepenalty = 10000 \advance\rightskip by 0pt plus 1fil\relax \endgraf \nobreak\vskip -\parskip \penalty\defunpenalty % signal to \startdefun and \dodefunx % Some of the @defun-type tags do not enable magic parentheses, % rendering the following check redundant. But we don't optimize. \checkparencounts \endgroup } \def\Edefun{\endgraf\medbreak} % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; % the only thing remaining is to define \deffnheader. % \def\makedefun#1{% \expandafter\let\csname E#1\endcsname = \Edefun \edef\temp{\noexpand\domakedefun \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% \temp } % \domakedefun \deffn \deffnx \deffnheader { (defn. of \deffnheader) } % % Define \deffn and \deffnx, without parameters. % \deffnheader has to be defined explicitly. % \def\domakedefun#1#2#3{% \envdef#1{% \startdefun \doingtypefnfalse % distinguish typed functions from all else \parseargusing\activeparens{\printdefunline#3}% }% \def#2{\dodefunx#1}% \def#3% } \newif\ifdoingtypefn % doing typed function? \newif\ifrettypeownline % typeset return type on its own line? % @deftypefnnewline on|off says whether the return type of typed functions % are printed on their own line. This affects @deftypefn, @deftypefun, % @deftypeop, and @deftypemethod. % \parseargdef\deftypefnnewline{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxideftypefnnl\endcsname = \empty \else\ifx\temp\offword \expandafter\let\csname SETtxideftypefnnl\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @txideftypefnnl value `\temp', must be on|off}% \fi\fi } % Untyped functions: % @deffn category name args \makedefun{deffn}{\deffngeneral{}} % @deffn category class name args \makedefun{defop}#1 {\defopon{#1\ \putwordon}} % \defopon {category on}class name args \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deffngeneral {subind}category name args % \def\deffngeneral#1#2 #3 #4\endheader{% % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. \dosubind{fn}{\code{#3}}{#1}% \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% } % Typed functions: % @deftypefn category type name args \makedefun{deftypefn}{\deftypefngeneral{}} % @deftypeop category class type name args \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} % \deftypeopon {category on}class type name args \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deftypefngeneral {subind}category type name args % \def\deftypefngeneral#1#2 #3 #4 #5\endheader{% \dosubind{fn}{\code{#4}}{#1}% \doingtypefntrue \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } % Typed variables: % @deftypevr category type var args \makedefun{deftypevr}{\deftypecvgeneral{}} % @deftypecv category class type var args \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} % \deftypecvof {category of}class type var args \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } % \deftypecvgeneral {subind}category type var args % \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% \dosubind{vr}{\code{#4}}{#1}% \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } % Untyped variables: % @defvr category var args \makedefun{defvr}#1 {\deftypevrheader{#1} {} } % @defcv category class var args \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} % \defcvof {category of}class var args \def\defcvof#1#2 {\deftypecvof{#1}#2 {} } % Types: % @deftp category name args \makedefun{deftp}#1 #2 #3\endheader{% \doind{tp}{\code{#2}}% \defname{#1}{}{#2}\defunargs{#3\unskip}% } % Remaining @defun-like shortcuts: \makedefun{defun}{\deffnheader{\putwordDeffunc} } \makedefun{defmac}{\deffnheader{\putwordDefmac} } \makedefun{defspec}{\deffnheader{\putwordDefspec} } \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } \makedefun{defvar}{\defvrheader{\putwordDefvar} } \makedefun{defopt}{\defvrheader{\putwordDefopt} } \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } \makedefun{defmethod}{\defopon\putwordMethodon} \makedefun{deftypemethod}{\deftypeopon\putwordMethodon} \makedefun{defivar}{\defcvof\putwordInstanceVariableof} \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} % \defname, which formats the name of the @def (not the args). % #1 is the category, such as "Function". % #2 is the return type, if any. % #3 is the function name. % % We are followed by (but not passed) the arguments, if any. % \def\defname#1#2#3{% \par % Get the values of \leftskip and \rightskip as they were outside the @def... \advance\leftskip by -\defbodyindent % % Determine if we are typesetting the return type of a typed function % on a line by itself. \rettypeownlinefalse \ifdoingtypefn % doing a typed function specifically? % then check user option for putting return type on its own line: \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else \rettypeownlinetrue \fi \fi % % How we'll format the category name. Putting it in brackets helps % distinguish it from the body text that may end up on the next line % just below it. \def\temp{#1}% \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} % % Figure out line sizes for the paragraph shape. We'll always have at % least two. \tempnum = 2 % % The first line needs space for \box0; but if \rightskip is nonzero, % we need only space for the part of \box0 which exceeds it: \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip % % If doing a return type on its own line, we'll have another line. \ifrettypeownline \advance\tempnum by 1 \def\maybeshapeline{0in \hsize}% \else \def\maybeshapeline{}% \fi % % The continuations: \dimen2=\hsize \advance\dimen2 by -\defargsindent % % The final paragraph shape: \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 % % Put the category name at the right margin. \noindent \hbox to 0pt{% \hfil\box0 \kern-\hsize % \hsize has to be shortened this way: \kern\leftskip % Intentionally do not respect \rightskip, since we need the space. }% % % Allow all lines to be underfull without complaint: \tolerance=10000 \hbadness=10000 \exdentamount=\defbodyindent {% % defun fonts. We use typewriter by default (used to be bold) because: % . we're printing identifiers, they should be in tt in principle. % . in languages with many accents, such as Czech or French, it's % common to leave accents off identifiers. The result looks ok in % tt, but exceedingly strange in rm. % . we don't want -- and --- to be treated as ligatures. % . this still does not fix the ?` and !` ligatures, but so far no % one has made identifiers using them :). \df \tt \def\temp{#2}% text of the return type \ifx\temp\empty\else \tclose{\temp}% typeset the return type \ifrettypeownline % put return type on its own line; prohibit line break following: \hfil\vadjust{\nobreak}\break \else \space % type on same line, so just followed by a space \fi \fi % no return type #3% output function name }% {\rm\enskip}% hskip 0.5 em of \rmfont % \boldbrax % arguments will be output next, if any. } % Print arguments in slanted roman (not ttsl), inconsistently with using % tt for the name. This is because literal text is sometimes needed in % the argument list (groff manual), and ttsl and tt are not very % distinguishable. Prevent hyphenation at `-' chars. % \def\defunargs#1{% % use sl by default (not ttsl), % tt for the names. \df \sl \hyphenchar\font=0 % % On the other hand, if an argument has two dashes (for instance), we % want a way to get ttsl. We used to recommend @var for that, so % leave the code in, but it's strange for @var to lead to typewriter. % Nowadays we recommend @code, since the difference between a ttsl hyphen % and a tt hyphen is pretty tiny. @code also disables ?` !`. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% #1% \sl\hyphenchar\font=45 } % We want ()&[] to print specially on the defun line. % \def\activeparens{% \catcode`\(=\active \catcode`\)=\active \catcode`\[=\active \catcode`\]=\active \catcode`\&=\active } % Make control sequences which act like normal parenthesis chars. \let\lparen = ( \let\rparen = ) % Be sure that we always have a definition for `(', etc. For example, % if the fn name has parens in it, \boldbrax will not be in effect yet, % so TeX would otherwise complain about undefined control sequence. { \activeparens \global\let(=\lparen \global\let)=\rparen \global\let[=\lbrack \global\let]=\rbrack \global\let& = \& \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} \gdef\magicamp{\let&=\amprm} } \newcount\parencount % If we encounter &foo, then turn on ()-hacking afterwards \newif\ifampseen \def\amprm#1 {\ampseentrue{\bf\ }} \def\parenfont{% \ifampseen % At the first level, print parens in roman, % otherwise use the default font. \ifnum \parencount=1 \rm \fi \else % The \sf parens (in \boldbrax) actually are a little bolder than % the contained text. This is especially needed for [ and ] . \sf \fi } \def\infirstlevel#1{% \ifampseen \ifnum\parencount=1 #1% \fi \fi } \def\bfafterword#1 {#1 \bf} \def\opnr{% \global\advance\parencount by 1 {\parenfont(}% \infirstlevel \bfafterword } \def\clnr{% {\parenfont)}% \infirstlevel \sl \global\advance\parencount by -1 } \newcount\brackcount \def\lbrb{% \global\advance\brackcount by 1 {\bf[}% } \def\rbrb{% {\bf]}% \global\advance\brackcount by -1 } \def\checkparencounts{% \ifnum\parencount=0 \else \badparencount \fi \ifnum\brackcount=0 \else \badbrackcount \fi } % these should not use \errmessage; the glibc manual, at least, actually % has such constructs (when documenting function pointers). \def\badparencount{% \message{Warning: unbalanced parentheses in @def...}% \global\parencount=0 } \def\badbrackcount{% \message{Warning: unbalanced square brackets in @def...}% \global\brackcount=0 } \message{macros,} % @macro. % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\thisisundefined \newwrite\macscribble \def\scantokens#1{% \toks0={#1}% \immediate\openout\macscribble=\jobname.tmp \immediate\write\macscribble{\the\toks0}% \immediate\closeout\macscribble \input \jobname.tmp } \fi % alias because \c means cedilla in @tex or @math \let\texinfoc=\c \newcount\savedcatcodeone \newcount\savedcatcodetwo % Used at the time of macro expansion. % Argument is macro body with arguments substituted \def\scanmacro#1{% \newlinechar`\^^M \def\xeatspaces{\eatspaces}% % % Temporarily undo catcode changes of \printindex. Set catcode of @ to % 0 so that @-commands in macro expansions aren't printed literally when % formatting an index file, where \ is used as the escape character. \savedcatcodeone=\catcode`\@ \savedcatcodetwo=\catcode`\\ \catcode`\@=0 \catcode`\\=\active % % Process the macro body under the current catcode regime. \scantokens{#1@texinfoc}% % \catcode`\@=\savedcatcodeone \catcode`\\=\savedcatcodetwo % % The \texinfoc is to remove the \newlinechar added by \scantokens, and % can be noticed by \parsearg. % We avoid surrounding the call to \scantokens with \bgroup and \egroup % to allow macros to open or close groups themselves. } % Used for copying and captions \def\scanexp#1{% \expandafter\scanmacro\expandafter{#1}% } \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? % List of all defined macros in the form % \commondummyword\macro1\commondummyword\macro2... % Currently is also contains all @aliases; the list can be split % if there is a need. \def\macrolist{} % Add the macro to \macrolist \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} \def\addtomacrolistxxx#1{% \toks0 = \expandafter{\macrolist\commondummyword#1}% \xdef\macrolist{\the\toks0}% } % Utility routines. % This does \let #1 = #2, with \csnames; that is, % \let \csname#1\endcsname = \csname#2\endcsname % (except of course we have to play expansion games). % \def\cslet#1#2{% \expandafter\let \csname#1\expandafter\endcsname \csname#2\endcsname } % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). {\catcode`\@=11 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} \def\unbrace#1{#1} \unbrace{\gdef\trim@@@ #1 } #2@{#1} } % Trim a single trailing ^^M off a string. {\catcode`\^^M=\other \catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% } % Macro bodies are absorbed as an argument in a context where % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \ % to recognize macro arguments; this is the job of \mbodybackslash. % % Non-ASCII encodings make 8-bit characters active, so un-activate % them to avoid their expansion. Must do this non-globally, to % confine the change to the current group. % % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. % \def\scanctxt{% used as subroutine \catcode`\"=\other \catcode`\+=\other \catcode`\<=\other \catcode`\>=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\~=\other \passthroughcharstrue } \def\scanargctxt{% used for copying and captions, not macros. \scanctxt \catcode`\@=\other \catcode`\\=\other \catcode`\^^M=\other } \def\macrobodyctxt{% used for @macro definitions \scanctxt \catcode`\ =\other \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other \catcode`\^^M=\other \usembodybackslash } % Used when scanning braced macro arguments. Note, however, that catcode % changes here are ineffectual if the macro invocation was nested inside % an argument to another Texinfo command. \def\macroargctxt{% \scanctxt \catcode`\ =\active \catcode`\^^M=\other \catcode`\\=\active } \def\macrolineargctxt{% used for whole-line arguments without braces \scanctxt \catcode`\{=\other \catcode`\}=\other } % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. % We define \csname macarg.\endcsname to be \realbackslash, so % \\ in macro replacement text gets you a backslash. % {\catcode`@=0 @catcode`@\=@active @gdef@usembodybackslash{@let\=@mbodybackslash} @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} } \expandafter\def\csname macarg.\endcsname{\realbackslash} \def\margbackslash#1{\char`\#1 } \def\macro{\recursivefalse\parsearg\macroxxx} \def\rmacro{\recursivetrue\parsearg\macroxxx} \def\macroxxx#1{% \getargs{#1}% now \macname is the macname and \argl the arglist \ifx\argl\empty % no arguments \paramno=0\relax \else \expandafter\parsemargdef \argl;% \if\paramno>256\relax \ifx\eTeXversion\thisisundefined \errhelp = \EMsimple \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} \fi \fi \fi \if1\csname ismacro.\the\macname\endcsname \message{Warning: redefining \the\macname}% \else \expandafter\ifx\csname \the\macname\endcsname \relax \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% \addtomacrolist{\the\macname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody \else \expandafter\parsemacbody \fi} \parseargdef\unmacro{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% % Remove the macro name from \macrolist: \begingroup \expandafter\let\csname#1\endcsname \relax \let\commondummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup \else \errmessage{Macro #1 not defined}% \fi } % Called by \do from \dounmacro on each macro. The idea is to omit any % macro definitions that have been changed to \relax. % \def\unmacrodo#1{% \ifx #1\relax % remove this \else \noexpand\commondummyword \noexpand#1% \fi } % \getargs -- Parse the arguments to a @macro line. Set \macname to % the name of the macro, and \argl to the braced argument list. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname#1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} % This made use of the feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. % Parse the optional {params} list to @macro or @rmacro. % Set \paramno to the number of arguments, % and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a % three-param macro.) Define \macarg.BLAH for each BLAH in the params % list to some hook where the argument is to be expanded. If there are % less than 10 arguments that hook is to be replaced by ##N where N % is the position in that list, that is to say the macro arguments are to be % defined `a la TeX in the macro body. % % That gets used by \mbodybackslash (above). % % If there are 10 or more arguments, a different technique is used: see % \parsemmanyargdef. % \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax % \hash is redefined to `#' later to get it into definitions \let\xeatspaces\relax \parsemargdefxxx#1,;,% \ifnum\paramno<10\relax\else \paramno0\relax \parsemmanyargdef@@#1,;,% 10 or more arguments \fi } \def\parsemargdefxxx#1,{% \if#1;\let\next=\relax \else \let\next=\parsemargdefxxx \advance\paramno by 1 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname {\xeatspaces{\hash\the\paramno}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} % \parsemacbody, \parsermacbody % % Read recursive and nonrecursive macro bodies. (They're different since % rec and nonrec macros end differently.) % % We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro % body to be transformed. % Set \macrobody to the body of the macro, and call \defmacro. % {\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{% \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% {\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{% \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% % Make @ a letter, so that we can make private-to-Texinfo macro names. \edef\texiatcatcode{\the\catcode`\@} \catcode `@=11\relax %%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%% % If there are 10 or more arguments, a different technique is used, where the % hook remains in the body, and when macro is to be expanded the body is % processed again to replace the arguments. % % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the % argument N value and then \edef the body (nothing else will expand because of % the catcode regime under which the body was input). % % If you compile with TeX (not eTeX), and you have macros with 10 or more % arguments, no macro can have more than 256 arguments (else error). % % In case that there are 10 or more arguments we parse again the arguments % list to set new definitions for the \macarg.BLAH macros corresponding to % each BLAH argument. It was anyhow needed to parse already once this list % in order to count the arguments, and as macros with at most 9 arguments % are by far more frequent than macro with 10 or more arguments, defining % twice the \macarg.BLAH macros does not cost too much processing power. \def\parsemmanyargdef@@#1,{% \if#1;\let\next=\relax \else \let\next=\parsemmanyargdef@@ \edef\tempb{\eatspaces{#1}}% \expandafter\def\expandafter\tempa \expandafter{\csname macarg.\tempb\endcsname}% % Note that we need some extra \noexpand\noexpand, this is because we % don't want \the to be expanded in the \parsermacbody as it uses an % \xdef . \expandafter\edef\tempa {\noexpand\noexpand\noexpand\the\toks\the\paramno}% \advance\paramno by 1\relax \fi\next} \let\endargs@\relax \let\nil@\relax \def\nilm@{\nil@}% \long\def\nillm@{\nil@}% % This macro is expanded during the Texinfo macro expansion, not during its % definition. It gets all the arguments' values and assigns them to macros % macarg.ARGNAME % % #1 is the macro name % #2 is the list of argument names % #3 is the list of argument values \def\getargvals@#1#2#3{% \def\macargdeflist@{}% \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. \def\paramlist{#2,\nil@}% \def\macroname{#1}% \begingroup \macroargctxt \def\argvaluelist{#3,\nil@}% \def\@tempa{#3}% \ifx\@tempa\empty \setemptyargvalues@ \else \getargvals@@ \fi } \def\getargvals@@{% \ifx\paramlist\nilm@ % Some sanity check needed here that \argvaluelist is also empty. \ifx\argvaluelist\nillm@ \else \errhelp = \EMsimple \errmessage{Too many arguments in macro `\macroname'!}% \fi \let\next\macargexpandinbody@ \else \ifx\argvaluelist\nillm@ % No more arguments values passed to macro. Set remaining named-arg % macros to empty. \let\next\setemptyargvalues@ \else % pop current arg name into \@tempb \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% \expandafter\@tempa\expandafter{\paramlist}% % pop current argument value into \@tempc \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% \expandafter\@tempa\expandafter{\argvaluelist}% % Here \@tempb is the current arg name and \@tempc is the current arg value. % First place the new argument macro definition into \@tempd \expandafter\macname\expandafter{\@tempc}% \expandafter\let\csname macarg.\@tempb\endcsname\relax \expandafter\def\expandafter\@tempe\expandafter{% \csname macarg.\@tempb\endcsname}% \edef\@tempd{\long\def\@tempe{\the\macname}}% \push@\@tempd\macargdeflist@ \let\next\getargvals@@ \fi \fi \next } \def\push@#1#2{% \expandafter\expandafter\expandafter\def \expandafter\expandafter\expandafter#2% \expandafter\expandafter\expandafter{% \expandafter#1#2}% } % Replace arguments by their values in the macro body, and place the result % in macro \@tempa. % \def\macvalstoargs@{% % To do this we use the property that token registers that are \the'ed % within an \edef expand only once. So we are going to place all argument % values into respective token registers. % % First we save the token context, and initialize argument numbering. \begingroup \paramno0\relax % Then, for each argument number #N, we place the corresponding argument % value into a new token list register \toks#N \expandafter\putargsintokens@\saveparamlist@,;,% % Then, we expand the body so that argument are replaced by their % values. The trick for values not to be expanded themselves is that they % are within tokens and that tokens expand only once in an \edef . \edef\@tempc{\csname mac.\macroname .body\endcsname}% % Now we restore the token stack pointer to free the token list registers % which we have used, but we make sure that expanded body is saved after % group. \expandafter \endgroup \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% } % Define the named-macro outside of this group and then close this group. % \def\macargexpandinbody@{% \expandafter \endgroup \macargdeflist@ % First the replace in body the macro arguments by their values, the result % is in \@tempa . \macvalstoargs@ % Then we point at the \norecurse or \gobble (for recursive) macro value % with \@tempb . \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname % Depending on whether it is recursive or not, we need some tailing % \egroup . \ifx\@tempb\gobble \let\@tempc\relax \else \let\@tempc\egroup \fi % And now we do the real job: \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% \@tempd } \def\putargsintokens@#1,{% \if#1;\let\next\relax \else \let\next\putargsintokens@ % First we allocate the new token list register, and give it a temporary % alias \@tempb . \toksdef\@tempb\the\paramno % Then we place the argument value into that token list register. \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname \expandafter\@tempb\expandafter{\@tempa}% \advance\paramno by 1\relax \fi \next } % Trailing missing arguments are set to empty. % \def\setemptyargvalues@{% \ifx\paramlist\nilm@ \let\next\macargexpandinbody@ \else \expandafter\setemptyargvaluesparser@\paramlist\endargs@ \let\next\setemptyargvalues@ \fi \next } \def\setemptyargvaluesparser@#1,#2\endargs@{% \expandafter\def\expandafter\@tempa\expandafter{% \expandafter\def\csname macarg.#1\endcsname{}}% \push@\@tempa\macargdeflist@ \def\paramlist{#2}% } % #1 is the element target macro % #2 is the list macro % #3,#4\endargs@ is the list value \def\pop@#1#2#3,#4\endargs@{% \def#1{#3}% \def#2{#4}% } \long\def\longpop@#1#2#3,#4\endargs@{% \long\def#1{#3}% \long\def#2{#4}% } %%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%% % This defines a Texinfo @macro or @rmacro, called by \parsemacbody. % \macrobody has the body of the macro in it, with placeholders for % its parameters, looking like "\xeatspaces{\hash 1}". % \paramno is the number of parameters % \paramlist is a TeX parameter text, e.g. "#1,#2,#3," % There are four cases: macros of zero, one, up to nine, and many arguments. % \xdef is used so that macro definitions will survive the file % they're defined in: @include reads the file inside a group. % \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars \ifnum\paramno=1 \def\xeatspaces##1{##1}% % This removes the pair of braces around the argument. We don't % use \eatspaces, because this can cause ends of lines to be lost % when the argument to \eatspaces is read, leading to line-based % commands like "@itemize" not being read correctly. \else \let\xeatspaces\relax % suppress expansion \fi \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup \noexpand\spaceisspace \noexpand\endlineisspace \noexpand\expandafter % skip any whitespace after the macro name. \expandafter\noexpand\csname\the\macname @@@\endcsname}% \expandafter\xdef\csname\the\macname @@@\endcsname{% \egroup \noexpand\scanmacro{\macrobody}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup \noexpand\braceorline \expandafter\noexpand\csname\the\macname @@@\endcsname}% \expandafter\xdef\csname\the\macname @@@\endcsname##1{% \egroup \noexpand\scanmacro{\macrobody}% }% \else % at most 9 \ifnum\paramno<10\relax % @MACNAME sets the context for reading the macro argument % @MACNAME@@ gets the argument, processes backslashes and appends a % comma. % @MACNAME@@@ removes braces surrounding the argument list. % @MACNAME@@@@ scans the macro body with arguments substituted. \expandafter\xdef\csname\the\macname\endcsname{% \bgroup \noexpand\expandafter % This \expandafter skip any spaces after the \noexpand\macroargctxt % macro before we change the catcode of space. \noexpand\expandafter \expandafter\noexpand\csname\the\macname @@\endcsname}% \expandafter\xdef\csname\the\macname @@\endcsname##1{% \noexpand\passargtomacro \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}% \expandafter\xdef\csname\the\macname @@@\endcsname##1{% \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname @@@@\endcsname\paramlist{% \egroup\noexpand\scanmacro{\macrobody}}% \else % 10 or more: \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% }% \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble \fi \fi} \catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % {\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape @catcode`@_=11 % private names @catcode`@!=11 % used as argument separator % \passargtomacro#1#2 - % Call #1 with a list of tokens #2, with any doubled backslashes in #2 % compressed to one. % % This implementation works by expansion, and not execution (so we cannot use % \def or similar). This reduces the risk of this failing in contexts where % complete expansion is done with no execution (for example, in writing out to % an auxiliary file for an index entry). % % State is kept in the input stream: the argument passed to % @look_ahead, @gobble_and_check_finish and @add_segment is % % THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input) % % where: % THE_MACRO - name of the macro we want to call % ARG_RESULT - argument list we build to pass to that macro % PENDING_BS - either a backslash or nothing % NEXT_TOKEN - used to look ahead in the input stream to see what's coming next @gdef@passargtomacro#1#2{% @add_segment #1!{}@relax#2\@_finish\% } @gdef@_finish{@_finishx} @global@let@_finishx@relax % #1 - THE_MACRO ARG_RESULT % #2 - PENDING_BS % #3 - NEXT_TOKEN % #4 used to look ahead % % If the next token is not a backslash, process the rest of the argument; % otherwise, remove the next token. @gdef@look_ahead#1!#2#3#4{% @ifx#4\% @expandafter@gobble_and_check_finish @else @expandafter@add_segment @fi#1!{#2}#4#4% } % #1 - THE_MACRO ARG_RESULT % #2 - PENDING_BS % #3 - NEXT_TOKEN % #4 should be a backslash, which is gobbled. % #5 looks ahead % % Double backslash found. Add a single backslash, and look ahead. @gdef@gobble_and_check_finish#1!#2#3#4#5{% @add_segment#1\!{}#5#5% } @gdef@is_fi{@fi} % #1 - THE_MACRO ARG_RESULT % #2 - PENDING_BS % #3 - NEXT_TOKEN % #4 is input stream until next backslash % % Input stream is either at the start of the argument, or just after a % backslash sequence, either a lone backslash, or a doubled backslash. % NEXT_TOKEN contains the first token in the input stream: if it is \finish, % finish; otherwise, append to ARG_RESULT the segment of the argument up until % the next backslash. PENDING_BACKSLASH contains a backslash to represent % a backslash just before the start of the input stream that has not been % added to ARG_RESULT. @gdef@add_segment#1!#2#3#4\{% @ifx#3@_finish @call_the_macro#1!% @else % append the pending backslash to the result, followed by the next segment @expandafter@is_fi@look_ahead#1#2#4!{\}@fi % this @fi is discarded by @look_ahead. % we can't get rid of it with \expandafter because we don't know how % long #4 is. } % #1 - THE_MACRO % #2 - ARG_RESULT % #3 discards the res of the conditional in @add_segment, and @is_fi ends the % conditional. @gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \braceorline MAC is used for a one-argument macro MAC. It checks % whether the next non-whitespace character is a {. It sets the context % for reading the argument (slightly different in the two cases). Then, % to read the argument, in the whole-line case, it then calls the regular % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC. % \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup \macroargctxt \expandafter\passargtomacro \else \macrolineargctxt\expandafter\parsearg \fi \macnamexxx} % @alias. % We need some trickery to remove the optional spaces around the equal % sign. Make them active and then expand them all to nothing. % \def\alias{\parseargusing\obeyspaces\aliasxxx} \def\aliasxxx #1{\aliasyyy#1\relax} \def\aliasyyy #1=#2\relax{% {% \expandafter\let\obeyedspace=\empty \addtomacrolist{#1}% \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% }% \next } \message{cross references,} \newwrite\auxfile \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. % @inforef is relatively simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{% \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} % @node's only job in TeX is to define \lastnode, which is used in % cross-references. The @node line might or might not have commas, and % might or might not have spaces before the first comma, like: % @node foo , bar , ... % We don't want such trailing spaces in the node name. % \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} % % also remove a trailing comma, in case of something like this: % @node Help-Cross, , , Cross-refs \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} \let\nwnode=\node \let\lastnode=\empty % Write a cross-reference definition for the current node. #1 is the % type (Ynumbered, Yappendix, Ynothing). % \def\donoderef#1{% \ifx\lastnode\empty\else \setref{\lastnode}{#1}% \global\let\lastnode=\empty \fi } % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister % \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an % anchor), which consists of three parts: % 1) NAME-title - the current sectioning name taken from \lastsection, % or the anchor name. % 2) NAME-snt - section number and type, passed as the SNT arg, or % empty for anchors. % 3) NAME-pg - the page number. % % This is called from \donoderef, \anchor, and \dofloat. In the case of % floats, there is an additional part, which is not written here: % 4) NAME-lof - the text as it should appear in a @listoffloats. % \def\setref#1#2{% \pdfmkdest{#1}% \iflinks {% \requireauxfile \atdummies % preserve commands, but don't expand them % match definition in \xrdef, \refx, \xrefX. \def\value##1{##1}% \edef\writexrdef##1##2{% \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef }% \toks0 = \expandafter{\lastsection}% \immediate \writexrdef{title}{\the\toks0 }% \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout }% \fi } % @xrefautosectiontitle on|off says whether @section(ing) names are used % automatically in xrefs, if the third arg is not explicitly specified. % This was provided as a "secret" @set xref-automatic-section-title % variable, now it's official. % \parseargdef\xrefautomaticsectiontitle{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETxref-automatic-section-title\endcsname = \empty \else\ifx\temp\offword \expandafter\let\csname SETxref-automatic-section-title\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', must be on|off}% \fi\fi } % % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % \def\pxref{\putwordsee{} \xrefXX} \def\xref{\putwordSee{} \xrefXX} \def\ref{\xrefXX} \def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX} \def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]} % \newbox\toprefbox \newbox\printedrefnamebox \newbox\infofilenamebox \newbox\printedmanualbox % \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces % % Get args without leading/trailing spaces. \def\printedrefname{\ignorespaces #3}% \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% % \def\infofilename{\ignorespaces #4}% \setbox\infofilenamebox = \hbox{\infofilename\unskip}% % \def\printedmanual{\ignorespaces #5}% \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% % % If the printed reference name (arg #3) was not explicitly given in % the @xref, figure out what we want to use. \ifdim \wd\printedrefnamebox = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax % Not auto section-title: use node name inside the square brackets. \def\printedrefname{\ignorespaces #1}% \else % Auto section-title: use chapter/section title inside % the square brackets if we have it. \ifdim \wd\printedmanualbox > 0pt % It is in another manual, so we don't have it; use node name. \def\printedrefname{\ignorespaces #1}% \else \ifhavexrefs % We (should) know the real title if we have the xref values. \def\printedrefname{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. \def\printedrefname{\ignorespaces #1}% \fi% \fi \fi \fi % % Make link in pdf output. \ifpdf % For pdfTeX and LuaTeX {\indexnofonts \makevalueexpandable \turnoffactive % This expands tokens, so do it after making catcode changes, so _ % etc. don't get their TeX definitions. This ignores all spaces in % #4, including (wrongly) those in the middle of the filename. \getfilename{#4}% % % This (wrongly) does not take account of leading or trailing % spaces in #1, which should be ignored. \setpdfdestname{#1}% % \ifx\pdfdestname\empty \def\pdfdestname{Top}% no empty targets \fi % \leavevmode \startlink attr{/Border [0 0 0]}% \ifnum\filenamelength>0 goto file{\the\filename.pdf} name{\pdfdestname}% \else goto name{\pdfmkpgn{\pdfdestname}}% \fi }% \setcolor{\linkcolor}% \else \ifx\XeTeXrevision\thisisundefined \else % For XeTeX {\indexnofonts \makevalueexpandable \turnoffactive % This expands tokens, so do it after making catcode changes, so _ % etc. don't get their TeX definitions. This ignores all spaces in % #4, including (wrongly) those in the middle of the filename. \getfilename{#4}% % % This (wrongly) does not take account of leading or trailing % spaces in #1, which should be ignored. \setpdfdestname{#1}% % \ifx\pdfdestname\empty \def\pdfdestname{Top}% no empty targets \fi % \leavevmode \ifnum\filenamelength>0 % With default settings, % XeTeX (xdvipdfmx) replaces link destination names with integers. % In this case, the replaced destination names of % remote PDFs are no longer known. In order to avoid a replacement, % you can use xdvipdfmx's command line option `-C 0x0010'. % If you use XeTeX 0.99996+ (TeX Live 2016+), % this command line option is no longer necessary % because we can use the `dvipdfmx:config' special. \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}% \else \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A << /S /GoTo /D (\pdfdestname) >> >>}% \fi }% \setcolor{\linkcolor}% \fi \fi {% % Have to otherify everything special to allow the \csname to % include an _ in the xref name, etc. \indexnofonts \turnoffactive \def\value##1{##1}% \expandafter\global\expandafter\let\expandafter\Xthisreftitle \csname XR#1-title\endcsname }% % % Float references are printed completely differently: "Figure 1.2" % instead of "[somenode], p.3". \iffloat distinguishes them by % \Xthisreftitle being set to a magic string. \iffloat\Xthisreftitle % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". \ifdim\wd\printedrefnamebox = 0pt \refx{#1-snt}{}% \else \printedrefname \fi % % If the user also gave the printed manual name (fifth arg), append % "in MANUALNAME". \ifdim \wd\printedmanualbox > 0pt \space \putwordin{} \cite{\printedmanual}% \fi \else % node/anchor (non-float) references. % % If we use \unhbox to print the node names, TeX does not insert % empty discretionaries after hyphens, which means that it will not % find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, % this is a loss. Therefore, we give the text of the node name % again, so it is as if TeX is seeing it for the first time. % \ifdim \wd\printedmanualbox > 0pt % Cross-manual reference with a printed manual name. % \crossmanualxref{\cite{\printedmanual\unskip}}% % \else\ifdim \wd\infofilenamebox > 0pt % Cross-manual reference with only an info filename (arg 4), no % printed manual name (arg 5). This is essentially the same as % the case above; we output the filename, since we have nothing else. % \crossmanualxref{\code{\infofilename\unskip}}% % \else % Reference within this manual. % % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. {\turnoffactive % Only output a following space if the -snt ref is nonempty; for % @unnumbered and @anchor, it won't be. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% % output the `[mynode]' via the macro below so it can be overridden. \xrefprintnodename\printedrefname % % But we always want a comma and a space: ,\space % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% % Add a , if xref followed by a space \if\space\noexpand\tokenafterxref ,% \else\ifx\ \tokenafterxref ,% @TAB \else\ifx\*\tokenafterxref ,% @* \else\ifx\ \tokenafterxref ,% @SPACE \else\ifx\ \tokenafterxref ,% @NL \else\ifx\tie\tokenafterxref ,% @tie \fi\fi\fi\fi\fi\fi \fi\fi \fi \endlink \endgroup} % Output a cross-manual xref to #1. Used just above (twice). % % Only include the text "Section ``foo'' in" if the foo is neither % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply % "see The Foo Manual", the idea being to refer to the whole manual. % % But, this being TeX, we can't easily compare our node name against the % string "Top" while ignoring the possible spaces before and after in % the input. By adding the arbitrary 7sp below, we make it much less % likely that a real node name would have the same width as "Top" (e.g., % in a monospaced font). Hopefully it will never happen in practice. % % For the same basic reason, we retypeset the "Top" at every % reference, since the current font is indeterminate. % \def\crossmanualxref#1{% \setbox\toprefbox = \hbox{Top\kern7sp}% \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% \ifdim \wd2 > 7sp % nonempty? \ifdim \wd2 = \wd\toprefbox \else % same as Top? \putwordSection{} ``\printedrefname'' \putwordin{}\space \fi \fi #1% } % This macro is called from \xrefX for the `[nodename]' part of xref % output. It's a separate macro only so it can be changed more easily, % since square brackets don't work well in some documents. Particularly % one that Bob is working on :). % \def\xrefprintnodename#1{[#1]} % Things referred to by \setref. % \def\Ynothing{} \def\Yomitfromtoc{} \def\Ynumbered{% \ifnum\secno=0 \putwordChapter@tie \the\chapno \else \ifnum\subsecno=0 \putwordSection@tie \the\chapno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno \else \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } \def\Yappendix{% \ifnum\secno=0 \putwordAppendix@tie @char\the\appendixno{}% \else \ifnum\subsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno \else \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } % \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX % is output afterwards if non-empty. \def\refx#1#2{% \requireauxfile {% \indexnofonts \otherbackslash \def\value##1{##1}% \expandafter\global\expandafter\let\expandafter\thisrefX \csname XR#1\endcsname }% \ifx\thisrefX\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks \ifhavexrefs {\toks0 = {#1}% avoid expansion of possibly-complex value \message{\linenumber Undefined cross reference `\the\toks0'.}}% \else \ifwarnedxrefs\else \global\warnedxrefstrue \message{Cross reference values unknown; you must run TeX again.}% \fi \fi \fi \else % It's defined, so just use it. \thisrefX \fi #2% Output the suffix in any case. } % This is the macro invoked by entries in the aux file. Define a control % sequence for a cross-reference target (we prepend XR to the control sequence % name to avoid collisions). The value is the page number. If this is a float % type, we have more work to do. % \def\xrdef#1#2{% {% Expand the node or anchor name to remove control sequences. % \turnoffactive stops 8-bit characters being changed to commands % like @'e. \refx does the same to retrieve the value in the definition. \indexnofonts \turnoffactive \def\value##1{##1}% \xdef\safexrefname{#1}% }% % \bgroup \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% \egroup % We put the \gdef inside a group to avoid the definitions building up on % TeX's save stack, which can cause it to run out of space for aux files with % thousands of lines. \gdef doesn't use the save stack, but \csname does % when it defines an unknown control sequence as \relax. % % Was that xref control sequence that we just defined for a float? \expandafter\iffloat\csname XR\safexrefname\endcsname % it was a float, and we have the (safe) float type in \iffloattype. \expandafter\let\expandafter\floatlist \csname floatlist\iffloattype\endcsname % % Is this the first time we've seen this float type? \expandafter\ifx\floatlist\relax \toks0 = {\do}% yes, so just \do \else % had it before, so preserve previous elements in list. \toks0 = \expandafter{\floatlist\do}% \fi % % Remember this xref in the control sequence \floatlistFLOATTYPE, % for later use in \listoffloats. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 {\safexrefname}}% \fi } % If working on a large document in chapters, it is convenient to % be able to disable indexing, cross-referencing, and contents, for test runs. % This is done with @novalidate at the beginning of the file. % \newif\iflinks \linkstrue % by default we want the aux files. \let\novalidate = \linksfalse % Used when writing to the aux file, or when using data from it. \def\requireauxfile{% \iflinks \tryauxfile % Open the new aux file. TeX will close it automatically at exit. \immediate\openout\auxfile=\jobname.aux \fi \global\let\requireauxfile=\relax % Only do this once. } % Read the last existing aux file, if any. No error if none exists. % \def\tryauxfile{% \openin 1 \jobname.aux \ifeof 1 \else \readdatafile{aux}% \global\havexrefstrue \fi \closein 1 } \def\setupdatafile{% \catcode`\^^@=\other \catcode`\^^A=\other \catcode`\^^B=\other \catcode`\^^C=\other \catcode`\^^D=\other \catcode`\^^E=\other \catcode`\^^F=\other \catcode`\^^G=\other \catcode`\^^H=\other \catcode`\^^K=\other \catcode`\^^L=\other \catcode`\^^N=\other \catcode`\^^P=\other \catcode`\^^Q=\other \catcode`\^^R=\other \catcode`\^^S=\other \catcode`\^^T=\other \catcode`\^^U=\other \catcode`\^^V=\other \catcode`\^^W=\other \catcode`\^^X=\other \catcode`\^^Z=\other \catcode`\^^[=\other \catcode`\^^\=\other \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ % character, we would end up writing a line like this: 'xrdef {'hat % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first % argument, and \hat is not an expandable control sequence. It could % all be worked out, but why? Either we support ^^ or we don't. % % The other change necessary for this was to define \auxhat: % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % \catcode`\^=\other % % Special characters. Should be turned off anyway, but... \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other \catcode`\"=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % % This is to support \ in node names and titles, since the \ % characters end up in a \csname. It's easier than % leaving it active and making its active definition an actual \ % character. What I don't understand is why it works in the *value* % of the xrdef. Seems like it should be a catcode12 \, and that % should not typeset properly. But it works, so I'm moving on for % now. --karl, 15jan04. \catcode`\\=\other % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 \catcode`\@=0 } \def\readdatafile#1{% \begingroup \setupdatafile \input\jobname.#1 \endgroup} \message{insertions,} % including footnotes. \newcount \footnoteno % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is % removed. (Generally, numeric constants should always be followed by a % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for Info output only. \let\footnotestyle=\comment {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf \dofootnote }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % % Oh yes, they do; otherwise, @ifset (and anything else that uses % \parseargline) fails inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % \gdef\dofootnote{% \insert\footins\bgroup % % Nested footnotes are not supported in TeX, that would take a lot % more work. (\startsavinginserts does not suffice.) \let\footnote=\errfootnotenest % % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. \hsize=\txipagewidth \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox \floatingpenalty\@MM \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip \parindent\defaultparindent % \smallfonts \rm % % Because we use hanging indentation in footnotes, a @noindent appears % to exdent this text, so make it be a no-op. makeinfo does not use % hanging indentation so @noindent can still be needed within footnote % text after an @example or the like (not that this is good style). \let\noindent = \relax % % Hang the footnote text off the number. Use \everypar in case the % footnote extends for more than one paragraph. \everypar = {\hang}% \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut % % Invoke rest of plain TeX footnote routine. \futurelet\next\fo@t } }%end \catcode `\@=11 \def\errfootnotenest{% \errhelp=\EMsimple \errmessage{Nested footnotes not supported in texinfo.tex, even though they work in makeinfo; sorry} } \def\errfootnoteheading{% \errhelp=\EMsimple \errmessage{Footnotes in chapters, sections, etc., are not supported} } % In case a @footnote appears in a vbox, save the footnote text and create % the real \insert just after the vbox finished. Otherwise, the insertion % would be lost. % Similarly, if a @footnote appears inside an alignment, save the footnote % text to a box and make the \insert when a row of the table is finished. % And the same can be done for other insert classes. --kasal, 16nov03. % % Replace the \insert primitive by a cheating macro. % Deeper inside, just make sure that the saved insertions are not spilled % out prematurely. % \def\startsavinginserts{% \ifx \insert\ptexinsert \let\insert\saveinsert \else \let\checkinserts\relax \fi } % This \insert replacement works for both \insert\footins{foo} and % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. % \def\saveinsert#1{% \edef\next{\noexpand\savetobox \makeSAVEname#1}% \afterassignment\next % swallow the left brace \let\temp = } \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} \def\placesaveins#1{% \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname {\box#1}% } % eat @SAVE -- beware, all of them have catcode \other: { \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) \gdef\gobblesave @SAVE{} } % initialization: \def\newsaveins #1{% \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% \next } \def\newsaveinsX #1{% \csname newbox\endcsname #1% \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts \checksaveins #1}% } % initialize: \let\checkinserts\empty \newsaveins\footins \newsaveins\margin % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. % % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else % Do not bother showing banner with epsf.tex v2.7k (available in % doc/epsf.tex and on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi \closein 1 % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.} % \def\image#1{% \ifx\epsfbox\thisisundefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% \global\warnednoepsftrue \fi \else \imagexxx #1,,,,,\finish \fi } % % Arguments to @image: % #1 is (mandatory) image filename; we tack on .eps extension. % #2 is (optional) width, #3 is (optional) height. % #4 is (ignored optional) html alt text. % #5 is (ignored optional) extension. % #6 is just the usual extra ignored arg for parsing stuff. \newif\ifimagevmode \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro % If the image is by itself, center it. \ifvmode \imagevmodetrue \else \ifx\centersub\centerV % for @center @image, we need a vbox so we can have our vertical space \imagevmodetrue \vbox\bgroup % vbox has better behavior than vtop herev \fi\fi % \ifimagevmode \nobreak\medskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space % above and below. \nobreak\vskip\parskip \nobreak \fi % % Leave vertical mode so that indentation from an enclosing % environment such as @quotation is respected. % However, if we're at the top level, we don't want the % normal paragraph indentation. % On the other hand, if we are in the case of @center @image, we don't % want to start a paragraph, which will create a hsize-width box and % eradicate the centering. \ifx\centersub\centerV\else \noindent \fi % % Output the image. \ifpdf % For pdfTeX and LuaTeX <= 0.80 \dopdfimage{#1}{#2}{#3}% \else \ifx\XeTeXrevision\thisisundefined % For epsf.tex % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi \epsfbox{#1.eps}% \else % For XeTeX \doxeteximage{#1}{#2}{#3}% \fi \fi % \ifimagevmode \medskip % space after a standalone image \fi \ifx\centersub\centerV \egroup \fi \endgroup} % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, % etc. We don't actually implement floating yet, we always include the % float "here". But it seemed the best name for the future. % \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} % There may be a space before second and/or third parameter; delete it. \def\eatcommaspace#1, {#1,} % #1 is the optional FLOATTYPE, the text label for this float, typically % "Figure", "Table", "Example", etc. Can't contain commas. If omitted, % this float will not be numbered and cannot be referred to. % % #2 is the optional xref label. Also must be present for the float to % be referable. % % #3 is the optional positioning argument; for now, it is ignored. It % will somehow specify the positions allowed to float to (here, top, bottom). % % We keep a separate counter for each FLOATTYPE, which we reset at each % chapter-level command. \let\resetallfloatnos=\empty % \def\dofloat#1,#2,#3,#4\finish{% \let\thiscaption=\empty \let\thisshortcaption=\empty % % don't lose footnotes inside @float. % % BEWARE: when the floats start float, we have to issue warning whenever an % insert appears inside a float which could possibly float. --kasal, 26may04 % \startsavinginserts % % We can't be used inside a paragraph. \par % \vtop\bgroup \def\floattype{#1}% \def\floatlabel{#2}% \def\floatloc{#3}% we do nothing with this yet. % \ifx\floattype\empty \let\safefloattype=\empty \else {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% \fi % % If label is given but no type, we handle that as the empty type. \ifx\floatlabel\empty \else % We want each FLOATTYPE to be numbered separately (Figure 1, % Table 1, Figure 2, ...). (And if no label, no number.) % \expandafter\getfloatno\csname\safefloattype floatno\endcsname \global\advance\floatno by 1 % {% % This magic value for \lastsection is output by \setref as the % XREFLABEL-title value. \xrefX uses it to distinguish float % labels (which have a completely different output format) from % node and anchor labels. And \xrdef uses it to construct the % lists of floats. % \edef\lastsection{\floatmagic=\safefloattype}% \setref{\floatlabel}{Yfloat}% }% \fi % % start with \parskip glue, I guess. \vskip\parskip % % Don't suppress indentation if a float happens to start a section. \restorefirstparagraphindent } % we have these possibilities: % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap % @float Foo,lbl & no caption: Foo 1.1 % @float Foo & @caption{Cap}: Foo: Cap % @float Foo & no caption: Foo % @float ,lbl & Caption{Cap}: 1.1: Cap % @float ,lbl & no caption: 1.1 % @float & @caption{Cap}: Cap % @float & no caption: % \def\Efloat{% \let\floatident = \empty % % In all cases, if we have a float type, it comes first. \ifx\floattype\empty \else \def\floatident{\floattype}\fi % % If we have an xref label, the number comes next. \ifx\floatlabel\empty \else \ifx\floattype\empty \else % if also had float type, need tie first. \appendtomacro\floatident{\tie}% \fi % the number. \appendtomacro\floatident{\chaplevelprefix\the\floatno}% \fi % % Start the printed caption with what we've constructed in % \floatident, but keep it separate; we need \floatident again. \let\captionline = \floatident % \ifx\thiscaption\empty \else \ifx\floatident\empty \else \appendtomacro\captionline{: }% had ident, so need a colon between \fi % % caption text. \appendtomacro\captionline{\scanexp\thiscaption}% \fi % % If we have anything to print, print it, with space before. % Eventually this needs to become an \insert. \ifx\captionline\empty \else \vskip.5\parskip \captionline % % Space below caption. \vskip\parskip \fi % % If have an xref label, write the list of floats info. Do this % after the caption, to avoid chance of it being a breakpoint. \ifx\floatlabel\empty \else % Write the text that goes in the lof to the aux file as % \floatlabel-lof. Besides \floatident, we include the short % caption if specified, else the full caption if specified, else nothing. {% \requireauxfile \atdummies % \ifx\thisshortcaption\empty \def\gtemp{\thiscaption}% \else \def\gtemp{\thisshortcaption}% \fi \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident \ifx\gtemp\empty \else : \gtemp \fi}}% }% \fi \egroup % end of \vtop % \checkinserts } % Append the tokens #2 to the definition of macro #1, not expanding either. % \def\appendtomacro#1#2{% \expandafter\def\expandafter#1\expandafter{#1#2}% } % @caption, @shortcaption % \def\caption{\docaption\thiscaption} \def\shortcaption{\docaption\thisshortcaption} \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} \def\defcaption#1#2{\egroup \def#1{#2}} % The parameter is the control sequence identifying the counter we are % going to use. Create it if it doesn't exist and assign it to \floatno. \def\getfloatno#1{% \ifx#1\relax % Haven't seen this figure type before. \csname newcount\endcsname #1% % % Remember to reset this floatno at the next chap. \expandafter\gdef\expandafter\resetallfloatnos \expandafter{\resetallfloatnos #1=0 }% \fi \let\floatno#1% } % \setref calls this to get the XREFLABEL-snt value. We want an @xref % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we % first read the @float command. % \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% % Magic string used for the XREFLABEL-title value, so \xrefX can % distinguish floats from other xref types. \def\floatmagic{!!float!!} % #1 is the control sequence we are passed; we expand into a conditional % which is true if #1 represents a float ref. That is, the magic % \lastsection value which we \setref above. % \def\iffloat#1{\expandafter\doiffloat#1==\finish} % % #1 is (maybe) the \floatmagic string. If so, #2 will be the % (safe) float type for this float. We set \iffloattype to #2. % \def\doiffloat#1=#2=#3\finish{% \def\temp{#1}% \def\iffloattype{#2}% \ifx\temp\floatmagic } % @listoffloats FLOATTYPE - print a list of floats like a table of contents. % \parseargdef\listoffloats{% \def\floattype{#1}% floattype {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% % % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax \ifhavexrefs % if the user said @listoffloats foo but never @float foo. \message{\linenumber No `\safefloattype' floats to list.}% \fi \else \begingroup \leftskip=\tocindent % indent these entries like a toc \let\do=\listoffloatsdo \csname floatlist\safefloattype\endcsname \endgroup \fi } % This is called on each entry in a list of floats. We're passed the % xref label, in the form LABEL-title, which is how we save it in the % aux file. We strip off the -title and look up \XRLABEL-lof, which % has the text we're supposed to typeset here. % % Figures without xref labels will not be included in the list (since % they won't appear in the aux file). % \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} \def\listoffloatsdoentry#1-title\finish{{% % Can't fully expand XR#1-lof because it can contain anything. Just % pass the control sequence. On the other hand, XR#1-pg is just the % page number, and we want to fully expand that so we can get a link % in pdf output. \toksA = \expandafter{\csname XR#1-lof\endcsname}% % % use the same \entry macro we use to generate the TOC and index. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% \writeentry }} \message{localization,} % For single-language documents, @documentlanguage is usually given very % early, just after @documentencoding. Single argument is the language % (de) or locale (de_DE) abbreviation. % { \catcode`\_ = \active \globaldefs=1 \parseargdef\documentlanguage{% \tex % read txi-??.tex file in plain TeX. % Read the file by the name they passed if it exists. \let_ = \normalunderscore % normal _ character for filename test \openin 1 txi-#1.tex \ifeof 1 \documentlanguagetrywithoutunderscore #1_\finish \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 \endgroup % end raw TeX } % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. % \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% \openin 1 txi-#1.tex \ifeof 1 \errhelp = \nolanghelp \errmessage{Cannot read language file txi-#1.tex}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 } }% end of special _ catcode % \newhelp\nolanghelp{The given language definition file cannot be found or is empty. Maybe you need to install it? Putting it in the current directory should work if nowhere else does.} % This macro is called from txi-??.tex files; the first argument is the % \language name to set (without the "\lang@" prefix), the second and % third args are \{left,right}hyphenmin. % % The language names to pass are determined when the format is built. % See the etex.log file created at that time, e.g., % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. % % With TeX Live 2008, etex now includes hyphenation patterns for all % available languages. This means we can support hyphenation in % Texinfo, at least to some extent. (This still doesn't solve the % accented characters problem.) % \catcode`@=11 \def\txisetlanguage#1#2#3{% % do not set the language if the name is undefined in the current TeX. \expandafter\ifx\csname lang@#1\endcsname \relax \message{no patterns for #1}% \else \global\language = \csname lang@#1\endcsname \fi % but there is no harm in adjusting the hyphenmin values regardless. \global\lefthyphenmin = #2\relax \global\righthyphenmin = #3\relax } % XeTeX and LuaTeX can handle Unicode natively. % Their default I/O uses UTF-8 sequences instead of a byte-wise operation. % Other TeX engines' I/O (pdfTeX, etc.) is byte-wise. % \newif\iftxinativeunicodecapable \newif\iftxiusebytewiseio \ifx\XeTeXrevision\thisisundefined \ifx\luatexversion\thisisundefined \txinativeunicodecapablefalse \txiusebytewiseiotrue \else \txinativeunicodecapabletrue \txiusebytewiseiofalse \fi \else \txinativeunicodecapabletrue \txiusebytewiseiofalse \fi % Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex % for non-UTF-8 (byte-wise) encodings. % \def\setbytewiseio{% \ifx\XeTeXrevision\thisisundefined \else \XeTeXdefaultencoding "bytes" % For subsequent files to be read \XeTeXinputencoding "bytes" % For document root file % Unfortunately, there seems to be no corresponding XeTeX command for % output encoding. This is a problem for auxiliary index and TOC files. % The only solution would be perhaps to write out @U{...} sequences in % place of non-ASCII characters. \fi \ifx\luatexversion\thisisundefined \else \directlua{ local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub local function convert_char (char) return utf8_char(byte(char)) end local function convert_line (line) return gsub(line, ".", convert_char) end callback.register("process_input_buffer", convert_line) local function convert_line_out (line) local line_out = "" for c in string.utfvalues(line) do line_out = line_out .. string.char(c) end return line_out end callback.register("process_output_buffer", convert_line_out) } \fi \txiusebytewiseiotrue } % Helpers for encodings. % Set the catcode of characters 128 through 255 to the specified number. % \def\setnonasciicharscatcode#1{% \count255=128 \loop\ifnum\count255<256 \global\catcode\count255=#1\relax \advance\count255 by 1 \repeat } \def\setnonasciicharscatcodenonglobal#1{% \count255=128 \loop\ifnum\count255<256 \catcode\count255=#1\relax \advance\count255 by 1 \repeat } % @documentencoding sets the definition of non-ASCII characters % according to the specified encoding. % \def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz} \def\documentencodingzzz#1{% % % Encoding being declared for the document. \def\declaredencoding{\csname #1.enc\endcsname}% % % Supported encodings: names converted to tokens in order to be able % to compare them with \ifx. \def\ascii{\csname US-ASCII.enc\endcsname}% \def\latnine{\csname ISO-8859-15.enc\endcsname}% \def\latone{\csname ISO-8859-1.enc\endcsname}% \def\lattwo{\csname ISO-8859-2.enc\endcsname}% \def\utfeight{\csname UTF-8.enc\endcsname}% % \ifx \declaredencoding \ascii \asciichardefs % \else \ifx \declaredencoding \lattwo \iftxinativeunicodecapable \setbytewiseio \fi \setnonasciicharscatcode\active \lattwochardefs % \else \ifx \declaredencoding \latone \iftxinativeunicodecapable \setbytewiseio \fi \setnonasciicharscatcode\active \latonechardefs % \else \ifx \declaredencoding \latnine \iftxinativeunicodecapable \setbytewiseio \fi \setnonasciicharscatcode\active \latninechardefs % \else \ifx \declaredencoding \utfeight \iftxinativeunicodecapable % For native Unicode handling (XeTeX and LuaTeX) \nativeunicodechardefs \else % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX) \setnonasciicharscatcode\active % since we already invoked \utfeightchardefs at the top level % (below), do not re-invoke it, otherwise our check for duplicated % definitions gets triggered. Making non-ascii chars active is % sufficient. \fi % \else \message{Ignoring unknown document encoding: #1.}% % \fi % utfeight \fi % latnine \fi % latone \fi % lattwo \fi % ascii % \ifx\XeTeXrevision\thisisundefined \else \ifx \declaredencoding \utfeight \else \ifx \declaredencoding \ascii \else \message{Warning: XeTeX with non-UTF-8 encodings cannot handle % non-ASCII characters in auxiliary files.}% \fi \fi \fi } % emacs-page % A message to be logged when using a character that isn't available % the default font encoding (OT1). % \def\missingcharmsg#1{\message{Character missing, sorry: #1.}} % Take account of \c (plain) vs. \, (Texinfo) difference. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} % First, make active non-ASCII characters in order for them to be % correctly categorized when TeX reads the replacement text of % macros containing the character definitions. \setnonasciicharscatcode\active % \def\gdefchar#1#2{% \gdef#1{% \ifpassthroughchars \string#1% \else #2% \fi }} % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% \gdefchar^^a0{\tie} \gdefchar^^a1{\exclamdown} \gdefchar^^a2{{\tcfont \char162}} % cent \gdefchar^^a3{\pounds{}} \gdefchar^^a4{{\tcfont \char164}} % currency \gdefchar^^a5{{\tcfont \char165}} % yen \gdefchar^^a6{{\tcfont \char166}} % broken bar \gdefchar^^a7{\S} \gdefchar^^a8{\"{}} \gdefchar^^a9{\copyright{}} \gdefchar^^aa{\ordf} \gdefchar^^ab{\guillemetleft{}} \gdefchar^^ac{\ensuremath\lnot} \gdefchar^^ad{\-} \gdefchar^^ae{\registeredsymbol{}} \gdefchar^^af{\={}} % \gdefchar^^b0{\textdegree} \gdefchar^^b1{$\pm$} \gdefchar^^b2{$^2$} \gdefchar^^b3{$^3$} \gdefchar^^b4{\'{}} \gdefchar^^b5{$\mu$} \gdefchar^^b6{\P} \gdefchar^^b7{\ensuremath\cdot} \gdefchar^^b8{\cedilla\ } \gdefchar^^b9{$^1$} \gdefchar^^ba{\ordm} \gdefchar^^bb{\guillemetright{}} \gdefchar^^bc{$1\over4$} \gdefchar^^bd{$1\over2$} \gdefchar^^be{$3\over4$} \gdefchar^^bf{\questiondown} % \gdefchar^^c0{\`A} \gdefchar^^c1{\'A} \gdefchar^^c2{\^A} \gdefchar^^c3{\~A} \gdefchar^^c4{\"A} \gdefchar^^c5{\ringaccent A} \gdefchar^^c6{\AE} \gdefchar^^c7{\cedilla C} \gdefchar^^c8{\`E} \gdefchar^^c9{\'E} \gdefchar^^ca{\^E} \gdefchar^^cb{\"E} \gdefchar^^cc{\`I} \gdefchar^^cd{\'I} \gdefchar^^ce{\^I} \gdefchar^^cf{\"I} % \gdefchar^^d0{\DH} \gdefchar^^d1{\~N} \gdefchar^^d2{\`O} \gdefchar^^d3{\'O} \gdefchar^^d4{\^O} \gdefchar^^d5{\~O} \gdefchar^^d6{\"O} \gdefchar^^d7{$\times$} \gdefchar^^d8{\O} \gdefchar^^d9{\`U} \gdefchar^^da{\'U} \gdefchar^^db{\^U} \gdefchar^^dc{\"U} \gdefchar^^dd{\'Y} \gdefchar^^de{\TH} \gdefchar^^df{\ss} % \gdefchar^^e0{\`a} \gdefchar^^e1{\'a} \gdefchar^^e2{\^a} \gdefchar^^e3{\~a} \gdefchar^^e4{\"a} \gdefchar^^e5{\ringaccent a} \gdefchar^^e6{\ae} \gdefchar^^e7{\cedilla c} \gdefchar^^e8{\`e} \gdefchar^^e9{\'e} \gdefchar^^ea{\^e} \gdefchar^^eb{\"e} \gdefchar^^ec{\`{\dotless i}} \gdefchar^^ed{\'{\dotless i}} \gdefchar^^ee{\^{\dotless i}} \gdefchar^^ef{\"{\dotless i}} % \gdefchar^^f0{\dh} \gdefchar^^f1{\~n} \gdefchar^^f2{\`o} \gdefchar^^f3{\'o} \gdefchar^^f4{\^o} \gdefchar^^f5{\~o} \gdefchar^^f6{\"o} \gdefchar^^f7{$\div$} \gdefchar^^f8{\o} \gdefchar^^f9{\`u} \gdefchar^^fa{\'u} \gdefchar^^fb{\^u} \gdefchar^^fc{\"u} \gdefchar^^fd{\'y} \gdefchar^^fe{\th} \gdefchar^^ff{\"y} } % Latin9 (ISO-8859-15) encoding character definitions. \def\latninechardefs{% % Encoding is almost identical to Latin1. \latonechardefs % \gdefchar^^a4{\euro{}} \gdefchar^^a6{\v S} \gdefchar^^a8{\v s} \gdefchar^^b4{\v Z} \gdefchar^^b8{\v z} \gdefchar^^bc{\OE} \gdefchar^^bd{\oe} \gdefchar^^be{\"Y} } % Latin2 (ISO-8859-2) character definitions. \def\lattwochardefs{% \gdefchar^^a0{\tie} \gdefchar^^a1{\ogonek{A}} \gdefchar^^a2{\u{}} \gdefchar^^a3{\L} \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}} \gdefchar^^a5{\v L} \gdefchar^^a6{\'S} \gdefchar^^a7{\S} \gdefchar^^a8{\"{}} \gdefchar^^a9{\v S} \gdefchar^^aa{\cedilla S} \gdefchar^^ab{\v T} \gdefchar^^ac{\'Z} \gdefchar^^ad{\-} \gdefchar^^ae{\v Z} \gdefchar^^af{\dotaccent Z} % \gdefchar^^b0{\textdegree{}} \gdefchar^^b1{\ogonek{a}} \gdefchar^^b2{\ogonek{ }} \gdefchar^^b3{\l} \gdefchar^^b4{\'{}} \gdefchar^^b5{\v l} \gdefchar^^b6{\'s} \gdefchar^^b7{\v{}} \gdefchar^^b8{\cedilla\ } \gdefchar^^b9{\v s} \gdefchar^^ba{\cedilla s} \gdefchar^^bb{\v t} \gdefchar^^bc{\'z} \gdefchar^^bd{\H{}} \gdefchar^^be{\v z} \gdefchar^^bf{\dotaccent z} % \gdefchar^^c0{\'R} \gdefchar^^c1{\'A} \gdefchar^^c2{\^A} \gdefchar^^c3{\u A} \gdefchar^^c4{\"A} \gdefchar^^c5{\'L} \gdefchar^^c6{\'C} \gdefchar^^c7{\cedilla C} \gdefchar^^c8{\v C} \gdefchar^^c9{\'E} \gdefchar^^ca{\ogonek{E}} \gdefchar^^cb{\"E} \gdefchar^^cc{\v E} \gdefchar^^cd{\'I} \gdefchar^^ce{\^I} \gdefchar^^cf{\v D} % \gdefchar^^d0{\DH} \gdefchar^^d1{\'N} \gdefchar^^d2{\v N} \gdefchar^^d3{\'O} \gdefchar^^d4{\^O} \gdefchar^^d5{\H O} \gdefchar^^d6{\"O} \gdefchar^^d7{$\times$} \gdefchar^^d8{\v R} \gdefchar^^d9{\ringaccent U} \gdefchar^^da{\'U} \gdefchar^^db{\H U} \gdefchar^^dc{\"U} \gdefchar^^dd{\'Y} \gdefchar^^de{\cedilla T} \gdefchar^^df{\ss} % \gdefchar^^e0{\'r} \gdefchar^^e1{\'a} \gdefchar^^e2{\^a} \gdefchar^^e3{\u a} \gdefchar^^e4{\"a} \gdefchar^^e5{\'l} \gdefchar^^e6{\'c} \gdefchar^^e7{\cedilla c} \gdefchar^^e8{\v c} \gdefchar^^e9{\'e} \gdefchar^^ea{\ogonek{e}} \gdefchar^^eb{\"e} \gdefchar^^ec{\v e} \gdefchar^^ed{\'{\dotless{i}}} \gdefchar^^ee{\^{\dotless{i}}} \gdefchar^^ef{\v d} % \gdefchar^^f0{\dh} \gdefchar^^f1{\'n} \gdefchar^^f2{\v n} \gdefchar^^f3{\'o} \gdefchar^^f4{\^o} \gdefchar^^f5{\H o} \gdefchar^^f6{\"o} \gdefchar^^f7{$\div$} \gdefchar^^f8{\v r} \gdefchar^^f9{\ringaccent u} \gdefchar^^fa{\'u} \gdefchar^^fb{\H u} \gdefchar^^fc{\"u} \gdefchar^^fd{\'y} \gdefchar^^fe{\cedilla t} \gdefchar^^ff{\dotaccent{}} } % UTF-8 character definitions. % % This code to support UTF-8 is based on LaTeX's utf8.def, with some % changes for Texinfo conventions. It is included here under the GPL by % permission from Frank Mittelbach and the LaTeX team. % \newcount\countUTFx \newcount\countUTFy \newcount\countUTFz \gdef\UTFviiiTwoOctets#1#2{\expandafter \UTFviiiDefined\csname u8:#1\string #2\endcsname} % \gdef\UTFviiiThreeOctets#1#2#3{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} % \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} \gdef\UTFviiiDefined#1{% \ifx #1\relax \message{\linenumber Unicode char \string #1 not defined for Texinfo}% \else \expandafter #1% \fi } % Give non-ASCII bytes the active definitions for processing UTF-8 sequences \begingroup \catcode`\~13 \catcode`\$12 \catcode`\"12 % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp % substituting ~ and $ with a character token of that value. \def\UTFviiiLoop{% \global\catcode\countUTFx\active \uccode`\~\countUTFx \uccode`\$\countUTFx \uppercase\expandafter{\UTFviiiTmp}% \advance\countUTFx by 1 \ifnum\countUTFx < \countUTFy \expandafter\UTFviiiLoop \fi} % For bytes other than the first in a UTF-8 sequence. Not expected to % be expanded except when writing to auxiliary files. \countUTFx = "80 \countUTFy = "C2 \def\UTFviiiTmp{% \gdef~{% \ifpassthroughchars $\fi}}% \UTFviiiLoop \countUTFx = "C2 \countUTFy = "E0 \def\UTFviiiTmp{% \gdef~{% \ifpassthroughchars $% \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}% \UTFviiiLoop \countUTFx = "E0 \countUTFy = "F0 \def\UTFviiiTmp{% \gdef~{% \ifpassthroughchars $% \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}% \UTFviiiLoop \countUTFx = "F0 \countUTFy = "F4 \def\UTFviiiTmp{% \gdef~{% \ifpassthroughchars $% \else\expandafter\UTFviiiFourOctets\expandafter$\fi }}% \UTFviiiLoop \endgroup \def\globallet{\global\let} % save some \expandafter's below % @U{xxxx} to produce U+xxxx, if we support it. \def\U#1{% \expandafter\ifx\csname uni:#1\endcsname \relax \iftxinativeunicodecapable % All Unicode characters can be used if native Unicode handling is % active. However, if the font does not have the glyph, % letters are missing. \begingroup \uccode`\.="#1\relax \uppercase{.} \endgroup \else \errhelp = \EMsimple \errmessage{Unicode character U+#1 not supported, sorry}% \fi \else \csname uni:#1\endcsname \fi } % These macros are used here to construct the name of a control % sequence to be defined. \def\UTFviiiTwoOctetsName#1#2{% \csname u8:#1\string #2\endcsname}% \def\UTFviiiThreeOctetsName#1#2#3{% \csname u8:#1\string #2\string #3\endcsname}% \def\UTFviiiFourOctetsName#1#2#3#4{% \csname u8:#1\string #2\string #3\string #4\endcsname}% % For UTF-8 byte sequences (TeX, e-TeX and pdfTeX), % provide a definition macro to replace a Unicode character; % this gets used by the @U command % \begingroup \catcode`\"=12 \catcode`\<=12 \catcode`\.=12 \catcode`\,=12 \catcode`\;=12 \catcode`\!=12 \catcode`\~=13 \gdef\DeclareUnicodeCharacterUTFviii#1#2{% \countUTFz = "#1\relax \begingroup \parseXMLCharref % Give \u8:... its definition. The sequence of seven \expandafter's % expands after the \gdef three times, e.g. % % 1. \UTFviiTwoOctetsName B1 B2 % 2. \csname u8:B1 \string B2 \endcsname % 3. \u8: B1 B2 (a single control sequence token) % \expandafter\expandafter \expandafter\expandafter \expandafter\expandafter \expandafter\gdef \UTFviiiTmp{#2}% % \expandafter\ifx\csname uni:#1\endcsname \relax \else \message{Internal error, already defined: #1}% \fi % % define an additional control sequence for this code point. \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp \endgroup} % % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp % to the corresponding UTF-8 sequence. \gdef\parseXMLCharref{% \ifnum\countUTFz < "A0\relax \errhelp = \EMsimple \errmessage{Cannot define Unicode char value < 00A0}% \else\ifnum\countUTFz < "800\relax \parseUTFviiiA,% \parseUTFviiiB C\UTFviiiTwoOctetsName.,% \else\ifnum\countUTFz < "10000\relax \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}% \else \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiA!% \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}% \fi\fi\fi } % Extract a byte from the end of the UTF-8 representation of \countUTFx. % It must be a non-initial byte in the sequence. % Change \uccode of #1 for it to be used in \parseUTFviiiB as one % of the bytes. \gdef\parseUTFviiiA#1{% \countUTFx = \countUTFz \divide\countUTFz by 64 \countUTFy = \countUTFz % Save to be the future value of \countUTFz. \multiply\countUTFz by 64 % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract % in order to get the last five bits. \advance\countUTFx by -\countUTFz % Convert this to the byte in the UTF-8 sequence. \advance\countUTFx by 128 \uccode `#1\countUTFx \countUTFz = \countUTFy} % Used to put a UTF-8 byte sequence into \UTFviiiTmp % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8 % sequence. % #2 is one of the \UTFviii*OctetsName macros. % #3 is always a full stop (.) % #4 is a template for the other bytes in the sequence. The values for these % bytes is substituted in here with \uppercase using the \uccode's. \gdef\parseUTFviiiB#1#2#3#4{% \advance\countUTFz by "#10\relax \uccode `#3\countUTFz \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} \endgroup % For native Unicode handling (XeTeX and LuaTeX), % provide a definition macro that sets a catcode to `other' non-globally % \def\DeclareUnicodeCharacterNativeOther#1#2{% \catcode"#1=\other } % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M % U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block) % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block) % U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A % U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B % % Many of our renditions are less than wonderful, and all the missing % characters are available somewhere. Loading the necessary fonts % awaits user request. We can't truly support Unicode without % reimplementing everything that's been done in LaTeX for many years, % plus probably using luatex or xetex, and who knows what else. % We won't be doing that here in this simple file. But we can try to at % least make most of the characters not bomb out. % \def\unicodechardefs{% \DeclareUnicodeCharacter{00A0}{\tie}% \DeclareUnicodeCharacter{00A1}{\exclamdown}% \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent \DeclareUnicodeCharacter{00A3}{\pounds{}}% \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar \DeclareUnicodeCharacter{00A7}{\S}% \DeclareUnicodeCharacter{00A8}{\"{ }}% \DeclareUnicodeCharacter{00A9}{\copyright{}}% \DeclareUnicodeCharacter{00AA}{\ordf}% \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}% \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}% \DeclareUnicodeCharacter{00AD}{\-}% \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}% \DeclareUnicodeCharacter{00AF}{\={ }}% % \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}% \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}% \DeclareUnicodeCharacter{00B2}{$^2$}% \DeclareUnicodeCharacter{00B3}{$^3$}% \DeclareUnicodeCharacter{00B4}{\'{ }}% \DeclareUnicodeCharacter{00B5}{$\mu$}% \DeclareUnicodeCharacter{00B6}{\P}% \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}% \DeclareUnicodeCharacter{00B8}{\cedilla{ }}% \DeclareUnicodeCharacter{00B9}{$^1$}% \DeclareUnicodeCharacter{00BA}{\ordm}% \DeclareUnicodeCharacter{00BB}{\guillemetright{}}% \DeclareUnicodeCharacter{00BC}{$1\over4$}% \DeclareUnicodeCharacter{00BD}{$1\over2$}% \DeclareUnicodeCharacter{00BE}{$3\over4$}% \DeclareUnicodeCharacter{00BF}{\questiondown}% % \DeclareUnicodeCharacter{00C0}{\`A}% \DeclareUnicodeCharacter{00C1}{\'A}% \DeclareUnicodeCharacter{00C2}{\^A}% \DeclareUnicodeCharacter{00C3}{\~A}% \DeclareUnicodeCharacter{00C4}{\"A}% \DeclareUnicodeCharacter{00C5}{\AA}% \DeclareUnicodeCharacter{00C6}{\AE}% \DeclareUnicodeCharacter{00C7}{\cedilla{C}}% \DeclareUnicodeCharacter{00C8}{\`E}% \DeclareUnicodeCharacter{00C9}{\'E}% \DeclareUnicodeCharacter{00CA}{\^E}% \DeclareUnicodeCharacter{00CB}{\"E}% \DeclareUnicodeCharacter{00CC}{\`I}% \DeclareUnicodeCharacter{00CD}{\'I}% \DeclareUnicodeCharacter{00CE}{\^I}% \DeclareUnicodeCharacter{00CF}{\"I}% % \DeclareUnicodeCharacter{00D0}{\DH}% \DeclareUnicodeCharacter{00D1}{\~N}% \DeclareUnicodeCharacter{00D2}{\`O}% \DeclareUnicodeCharacter{00D3}{\'O}% \DeclareUnicodeCharacter{00D4}{\^O}% \DeclareUnicodeCharacter{00D5}{\~O}% \DeclareUnicodeCharacter{00D6}{\"O}% \DeclareUnicodeCharacter{00D7}{\ensuremath\times}% \DeclareUnicodeCharacter{00D8}{\O}% \DeclareUnicodeCharacter{00D9}{\`U}% \DeclareUnicodeCharacter{00DA}{\'U}% \DeclareUnicodeCharacter{00DB}{\^U}% \DeclareUnicodeCharacter{00DC}{\"U}% \DeclareUnicodeCharacter{00DD}{\'Y}% \DeclareUnicodeCharacter{00DE}{\TH}% \DeclareUnicodeCharacter{00DF}{\ss}% % \DeclareUnicodeCharacter{00E0}{\`a}% \DeclareUnicodeCharacter{00E1}{\'a}% \DeclareUnicodeCharacter{00E2}{\^a}% \DeclareUnicodeCharacter{00E3}{\~a}% \DeclareUnicodeCharacter{00E4}{\"a}% \DeclareUnicodeCharacter{00E5}{\aa}% \DeclareUnicodeCharacter{00E6}{\ae}% \DeclareUnicodeCharacter{00E7}{\cedilla{c}}% \DeclareUnicodeCharacter{00E8}{\`e}% \DeclareUnicodeCharacter{00E9}{\'e}% \DeclareUnicodeCharacter{00EA}{\^e}% \DeclareUnicodeCharacter{00EB}{\"e}% \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}% \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}% \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}% \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}% % \DeclareUnicodeCharacter{00F0}{\dh}% \DeclareUnicodeCharacter{00F1}{\~n}% \DeclareUnicodeCharacter{00F2}{\`o}% \DeclareUnicodeCharacter{00F3}{\'o}% \DeclareUnicodeCharacter{00F4}{\^o}% \DeclareUnicodeCharacter{00F5}{\~o}% \DeclareUnicodeCharacter{00F6}{\"o}% \DeclareUnicodeCharacter{00F7}{\ensuremath\div}% \DeclareUnicodeCharacter{00F8}{\o}% \DeclareUnicodeCharacter{00F9}{\`u}% \DeclareUnicodeCharacter{00FA}{\'u}% \DeclareUnicodeCharacter{00FB}{\^u}% \DeclareUnicodeCharacter{00FC}{\"u}% \DeclareUnicodeCharacter{00FD}{\'y}% \DeclareUnicodeCharacter{00FE}{\th}% \DeclareUnicodeCharacter{00FF}{\"y}% % \DeclareUnicodeCharacter{0100}{\=A}% \DeclareUnicodeCharacter{0101}{\=a}% \DeclareUnicodeCharacter{0102}{\u{A}}% \DeclareUnicodeCharacter{0103}{\u{a}}% \DeclareUnicodeCharacter{0104}{\ogonek{A}}% \DeclareUnicodeCharacter{0105}{\ogonek{a}}% \DeclareUnicodeCharacter{0106}{\'C}% \DeclareUnicodeCharacter{0107}{\'c}% \DeclareUnicodeCharacter{0108}{\^C}% \DeclareUnicodeCharacter{0109}{\^c}% \DeclareUnicodeCharacter{010A}{\dotaccent{C}}% \DeclareUnicodeCharacter{010B}{\dotaccent{c}}% \DeclareUnicodeCharacter{010C}{\v{C}}% \DeclareUnicodeCharacter{010D}{\v{c}}% \DeclareUnicodeCharacter{010E}{\v{D}}% \DeclareUnicodeCharacter{010F}{d'}% % \DeclareUnicodeCharacter{0110}{\DH}% \DeclareUnicodeCharacter{0111}{\dh}% \DeclareUnicodeCharacter{0112}{\=E}% \DeclareUnicodeCharacter{0113}{\=e}% \DeclareUnicodeCharacter{0114}{\u{E}}% \DeclareUnicodeCharacter{0115}{\u{e}}% \DeclareUnicodeCharacter{0116}{\dotaccent{E}}% \DeclareUnicodeCharacter{0117}{\dotaccent{e}}% \DeclareUnicodeCharacter{0118}{\ogonek{E}}% \DeclareUnicodeCharacter{0119}{\ogonek{e}}% \DeclareUnicodeCharacter{011A}{\v{E}}% \DeclareUnicodeCharacter{011B}{\v{e}}% \DeclareUnicodeCharacter{011C}{\^G}% \DeclareUnicodeCharacter{011D}{\^g}% \DeclareUnicodeCharacter{011E}{\u{G}}% \DeclareUnicodeCharacter{011F}{\u{g}}% % \DeclareUnicodeCharacter{0120}{\dotaccent{G}}% \DeclareUnicodeCharacter{0121}{\dotaccent{g}}% \DeclareUnicodeCharacter{0122}{\cedilla{G}}% \DeclareUnicodeCharacter{0123}{\cedilla{g}}% \DeclareUnicodeCharacter{0124}{\^H}% \DeclareUnicodeCharacter{0125}{\^h}% \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}% \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}% \DeclareUnicodeCharacter{0128}{\~I}% \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}% \DeclareUnicodeCharacter{012A}{\=I}% \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}% \DeclareUnicodeCharacter{012C}{\u{I}}% \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}% \DeclareUnicodeCharacter{012E}{\ogonek{I}}% \DeclareUnicodeCharacter{012F}{\ogonek{i}}% % \DeclareUnicodeCharacter{0130}{\dotaccent{I}}% \DeclareUnicodeCharacter{0131}{\dotless{i}}% \DeclareUnicodeCharacter{0132}{IJ}% \DeclareUnicodeCharacter{0133}{ij}% \DeclareUnicodeCharacter{0134}{\^J}% \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}% \DeclareUnicodeCharacter{0136}{\cedilla{K}}% \DeclareUnicodeCharacter{0137}{\cedilla{k}}% \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}% \DeclareUnicodeCharacter{0139}{\'L}% \DeclareUnicodeCharacter{013A}{\'l}% \DeclareUnicodeCharacter{013B}{\cedilla{L}}% \DeclareUnicodeCharacter{013C}{\cedilla{l}}% \DeclareUnicodeCharacter{013D}{L'}% should kern \DeclareUnicodeCharacter{013E}{l'}% should kern \DeclareUnicodeCharacter{013F}{L\U{00B7}}% % \DeclareUnicodeCharacter{0140}{l\U{00B7}}% \DeclareUnicodeCharacter{0141}{\L}% \DeclareUnicodeCharacter{0142}{\l}% \DeclareUnicodeCharacter{0143}{\'N}% \DeclareUnicodeCharacter{0144}{\'n}% \DeclareUnicodeCharacter{0145}{\cedilla{N}}% \DeclareUnicodeCharacter{0146}{\cedilla{n}}% \DeclareUnicodeCharacter{0147}{\v{N}}% \DeclareUnicodeCharacter{0148}{\v{n}}% \DeclareUnicodeCharacter{0149}{'n}% \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}% \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}% \DeclareUnicodeCharacter{014C}{\=O}% \DeclareUnicodeCharacter{014D}{\=o}% \DeclareUnicodeCharacter{014E}{\u{O}}% \DeclareUnicodeCharacter{014F}{\u{o}}% % \DeclareUnicodeCharacter{0150}{\H{O}}% \DeclareUnicodeCharacter{0151}{\H{o}}% \DeclareUnicodeCharacter{0152}{\OE}% \DeclareUnicodeCharacter{0153}{\oe}% \DeclareUnicodeCharacter{0154}{\'R}% \DeclareUnicodeCharacter{0155}{\'r}% \DeclareUnicodeCharacter{0156}{\cedilla{R}}% \DeclareUnicodeCharacter{0157}{\cedilla{r}}% \DeclareUnicodeCharacter{0158}{\v{R}}% \DeclareUnicodeCharacter{0159}{\v{r}}% \DeclareUnicodeCharacter{015A}{\'S}% \DeclareUnicodeCharacter{015B}{\'s}% \DeclareUnicodeCharacter{015C}{\^S}% \DeclareUnicodeCharacter{015D}{\^s}% \DeclareUnicodeCharacter{015E}{\cedilla{S}}% \DeclareUnicodeCharacter{015F}{\cedilla{s}}% % \DeclareUnicodeCharacter{0160}{\v{S}}% \DeclareUnicodeCharacter{0161}{\v{s}}% \DeclareUnicodeCharacter{0162}{\cedilla{T}}% \DeclareUnicodeCharacter{0163}{\cedilla{t}}% \DeclareUnicodeCharacter{0164}{\v{T}}% \DeclareUnicodeCharacter{0165}{\v{t}}% \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}% \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}% \DeclareUnicodeCharacter{0168}{\~U}% \DeclareUnicodeCharacter{0169}{\~u}% \DeclareUnicodeCharacter{016A}{\=U}% \DeclareUnicodeCharacter{016B}{\=u}% \DeclareUnicodeCharacter{016C}{\u{U}}% \DeclareUnicodeCharacter{016D}{\u{u}}% \DeclareUnicodeCharacter{016E}{\ringaccent{U}}% \DeclareUnicodeCharacter{016F}{\ringaccent{u}}% % \DeclareUnicodeCharacter{0170}{\H{U}}% \DeclareUnicodeCharacter{0171}{\H{u}}% \DeclareUnicodeCharacter{0172}{\ogonek{U}}% \DeclareUnicodeCharacter{0173}{\ogonek{u}}% \DeclareUnicodeCharacter{0174}{\^W}% \DeclareUnicodeCharacter{0175}{\^w}% \DeclareUnicodeCharacter{0176}{\^Y}% \DeclareUnicodeCharacter{0177}{\^y}% \DeclareUnicodeCharacter{0178}{\"Y}% \DeclareUnicodeCharacter{0179}{\'Z}% \DeclareUnicodeCharacter{017A}{\'z}% \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}% \DeclareUnicodeCharacter{017C}{\dotaccent{z}}% \DeclareUnicodeCharacter{017D}{\v{Z}}% \DeclareUnicodeCharacter{017E}{\v{z}}% \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}% % \DeclareUnicodeCharacter{01C4}{D\v{Z}}% \DeclareUnicodeCharacter{01C5}{D\v{z}}% \DeclareUnicodeCharacter{01C6}{d\v{z}}% \DeclareUnicodeCharacter{01C7}{LJ}% \DeclareUnicodeCharacter{01C8}{Lj}% \DeclareUnicodeCharacter{01C9}{lj}% \DeclareUnicodeCharacter{01CA}{NJ}% \DeclareUnicodeCharacter{01CB}{Nj}% \DeclareUnicodeCharacter{01CC}{nj}% \DeclareUnicodeCharacter{01CD}{\v{A}}% \DeclareUnicodeCharacter{01CE}{\v{a}}% \DeclareUnicodeCharacter{01CF}{\v{I}}% % \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}% \DeclareUnicodeCharacter{01D1}{\v{O}}% \DeclareUnicodeCharacter{01D2}{\v{o}}% \DeclareUnicodeCharacter{01D3}{\v{U}}% \DeclareUnicodeCharacter{01D4}{\v{u}}% % \DeclareUnicodeCharacter{01E2}{\={\AE}}% \DeclareUnicodeCharacter{01E3}{\={\ae}}% \DeclareUnicodeCharacter{01E6}{\v{G}}% \DeclareUnicodeCharacter{01E7}{\v{g}}% \DeclareUnicodeCharacter{01E8}{\v{K}}% \DeclareUnicodeCharacter{01E9}{\v{k}}% % \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}% \DeclareUnicodeCharacter{01F1}{DZ}% \DeclareUnicodeCharacter{01F2}{Dz}% \DeclareUnicodeCharacter{01F3}{dz}% \DeclareUnicodeCharacter{01F4}{\'G}% \DeclareUnicodeCharacter{01F5}{\'g}% \DeclareUnicodeCharacter{01F8}{\`N}% \DeclareUnicodeCharacter{01F9}{\`n}% \DeclareUnicodeCharacter{01FC}{\'{\AE}}% \DeclareUnicodeCharacter{01FD}{\'{\ae}}% \DeclareUnicodeCharacter{01FE}{\'{\O}}% \DeclareUnicodeCharacter{01FF}{\'{\o}}% % \DeclareUnicodeCharacter{021E}{\v{H}}% \DeclareUnicodeCharacter{021F}{\v{h}}% % \DeclareUnicodeCharacter{0226}{\dotaccent{A}}% \DeclareUnicodeCharacter{0227}{\dotaccent{a}}% \DeclareUnicodeCharacter{0228}{\cedilla{E}}% \DeclareUnicodeCharacter{0229}{\cedilla{e}}% \DeclareUnicodeCharacter{022E}{\dotaccent{O}}% \DeclareUnicodeCharacter{022F}{\dotaccent{o}}% % \DeclareUnicodeCharacter{0232}{\=Y}% \DeclareUnicodeCharacter{0233}{\=y}% \DeclareUnicodeCharacter{0237}{\dotless{j}}% % \DeclareUnicodeCharacter{02DB}{\ogonek{ }}% % % Greek letters upper case \DeclareUnicodeCharacter{0391}{{\it A}}% \DeclareUnicodeCharacter{0392}{{\it B}}% \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}% \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}% \DeclareUnicodeCharacter{0395}{{\it E}}% \DeclareUnicodeCharacter{0396}{{\it Z}}% \DeclareUnicodeCharacter{0397}{{\it H}}% \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}% \DeclareUnicodeCharacter{0399}{{\it I}}% \DeclareUnicodeCharacter{039A}{{\it K}}% \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}% \DeclareUnicodeCharacter{039C}{{\it M}}% \DeclareUnicodeCharacter{039D}{{\it N}}% \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}% \DeclareUnicodeCharacter{039F}{{\it O}}% \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}% \DeclareUnicodeCharacter{03A1}{{\it P}}% %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}% \DeclareUnicodeCharacter{03A4}{{\it T}}% \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}% \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}% \DeclareUnicodeCharacter{03A7}{{\it X}}% \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}% \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}% % % Vowels with accents \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}% \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}% \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}% \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}% \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}% \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}% % % Standalone accent \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}% % % Greek letters lower case \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}% \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}% \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}% \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}% \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}% \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}% \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}% \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}% \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}% \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}% \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}% \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}% \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}% \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}% \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}% \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}% \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}% \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}% \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}% \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}% \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}% \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}% \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}% \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}% % % More Greek vowels with accents \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}% \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}% \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}% \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}% \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}% % % Variant Greek letters \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}% \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}% \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}% % \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}% \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}% \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}% \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}% \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}% \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}% \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}% \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}% \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}% \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}% \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}% \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}% % \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}% \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}% % \DeclareUnicodeCharacter{1E20}{\=G}% \DeclareUnicodeCharacter{1E21}{\=g}% \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}% \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}% \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}% \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}% \DeclareUnicodeCharacter{1E26}{\"H}% \DeclareUnicodeCharacter{1E27}{\"h}% % \DeclareUnicodeCharacter{1E30}{\'K}% \DeclareUnicodeCharacter{1E31}{\'k}% \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}% \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}% \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}% \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}% \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}% \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}% \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}% \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}% \DeclareUnicodeCharacter{1E3E}{\'M}% \DeclareUnicodeCharacter{1E3F}{\'m}% % \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}% \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}% \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}% \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}% \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}% \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}% \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}% \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}% \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}% \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}% % \DeclareUnicodeCharacter{1E54}{\'P}% \DeclareUnicodeCharacter{1E55}{\'p}% \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}% \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}% \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}% \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}% \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}% \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}% \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}% \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}% % \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}% \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}% \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}% \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}% \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}% \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}% \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}% \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}% \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}% \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}% % \DeclareUnicodeCharacter{1E7C}{\~V}% \DeclareUnicodeCharacter{1E7D}{\~v}% \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}% \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}% % \DeclareUnicodeCharacter{1E80}{\`W}% \DeclareUnicodeCharacter{1E81}{\`w}% \DeclareUnicodeCharacter{1E82}{\'W}% \DeclareUnicodeCharacter{1E83}{\'w}% \DeclareUnicodeCharacter{1E84}{\"W}% \DeclareUnicodeCharacter{1E85}{\"w}% \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}% \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}% \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}% \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}% \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}% \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}% \DeclareUnicodeCharacter{1E8C}{\"X}% \DeclareUnicodeCharacter{1E8D}{\"x}% \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}% \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}% % \DeclareUnicodeCharacter{1E90}{\^Z}% \DeclareUnicodeCharacter{1E91}{\^z}% \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}% \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}% \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}% \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}% \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}% \DeclareUnicodeCharacter{1E97}{\"t}% \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}% \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}% % \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}% \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}% % \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}% \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}% \DeclareUnicodeCharacter{1EBC}{\~E}% \DeclareUnicodeCharacter{1EBD}{\~e}% % \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}% \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}% \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}% \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}% % \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}% \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}% % \DeclareUnicodeCharacter{1EF2}{\`Y}% \DeclareUnicodeCharacter{1EF3}{\`y}% \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}% % \DeclareUnicodeCharacter{1EF8}{\~Y}% \DeclareUnicodeCharacter{1EF9}{\~y}% % % Punctuation \DeclareUnicodeCharacter{2013}{--}% \DeclareUnicodeCharacter{2014}{---}% \DeclareUnicodeCharacter{2018}{\quoteleft{}}% \DeclareUnicodeCharacter{2019}{\quoteright{}}% \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}% \DeclareUnicodeCharacter{201C}{\quotedblleft{}}% \DeclareUnicodeCharacter{201D}{\quotedblright{}}% \DeclareUnicodeCharacter{201E}{\quotedblbase{}}% \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}% \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}% \DeclareUnicodeCharacter{2022}{\bullet{}}% \DeclareUnicodeCharacter{202F}{\thinspace}% \DeclareUnicodeCharacter{2026}{\dots{}}% \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}% \DeclareUnicodeCharacter{203A}{\guilsinglright{}}% % \DeclareUnicodeCharacter{20AC}{\euro{}}% % \DeclareUnicodeCharacter{2192}{\expansion{}}% \DeclareUnicodeCharacter{21D2}{\result{}}% % % Mathematical symbols \DeclareUnicodeCharacter{2200}{\ensuremath\forall}% \DeclareUnicodeCharacter{2203}{\ensuremath\exists}% \DeclareUnicodeCharacter{2208}{\ensuremath\in}% \DeclareUnicodeCharacter{2212}{\minus{}}% \DeclareUnicodeCharacter{2217}{\ast}% \DeclareUnicodeCharacter{221E}{\ensuremath\infty}% \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}% \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}% \DeclareUnicodeCharacter{2229}{\ensuremath\cap}% \DeclareUnicodeCharacter{2261}{\equiv{}}% \DeclareUnicodeCharacter{2264}{\ensuremath\leq}% \DeclareUnicodeCharacter{2265}{\ensuremath\geq}% \DeclareUnicodeCharacter{2282}{\ensuremath\subset}% \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}% % \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}% \DeclareUnicodeCharacter{2032}{\ensuremath\prime}% \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}% \DeclareUnicodeCharacter{2111}{\ensuremath\Im}% \DeclareUnicodeCharacter{2113}{\ensuremath\ell}% \DeclareUnicodeCharacter{2118}{\ensuremath\wp}% \DeclareUnicodeCharacter{211C}{\ensuremath\Re}% \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}% \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}% \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}% \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}% \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}% \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}% \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}% \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}% \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}% \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}% \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}% \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}% \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}% \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}% \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}% \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}% \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}% \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}% \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}% \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}% \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}% \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}% \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}% \DeclareUnicodeCharacter{2202}{\ensuremath\partial}% \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}% \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}% \DeclareUnicodeCharacter{2209}{\ensuremath\notin}% \DeclareUnicodeCharacter{220B}{\ensuremath\owns}% \DeclareUnicodeCharacter{220F}{\ensuremath\prod}% \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}% \DeclareUnicodeCharacter{2211}{\ensuremath\sum}% \DeclareUnicodeCharacter{2213}{\ensuremath\mp}% \DeclareUnicodeCharacter{2218}{\ensuremath\circ}% \DeclareUnicodeCharacter{221A}{\ensuremath\surd}% \DeclareUnicodeCharacter{221D}{\ensuremath\propto}% \DeclareUnicodeCharacter{2220}{\ensuremath\angle}% \DeclareUnicodeCharacter{2223}{\ensuremath\mid}% \DeclareUnicodeCharacter{2228}{\ensuremath\vee}% \DeclareUnicodeCharacter{222A}{\ensuremath\cup}% \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}% \DeclareUnicodeCharacter{222E}{\ensuremath\oint}% \DeclareUnicodeCharacter{223C}{\ensuremath\sim}% \DeclareUnicodeCharacter{2240}{\ensuremath\wr}% \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}% \DeclareUnicodeCharacter{2245}{\ensuremath\cong}% \DeclareUnicodeCharacter{2248}{\ensuremath\approx}% \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}% \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}% \DeclareUnicodeCharacter{2260}{\ensuremath\neq}% \DeclareUnicodeCharacter{226A}{\ensuremath\ll}% \DeclareUnicodeCharacter{226B}{\ensuremath\gg}% \DeclareUnicodeCharacter{227A}{\ensuremath\prec}% \DeclareUnicodeCharacter{227B}{\ensuremath\succ}% \DeclareUnicodeCharacter{2283}{\ensuremath\supset}% \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}% \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}% \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}% \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}% \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}% \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}% \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}% \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}% \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}% \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}% \DeclareUnicodeCharacter{2299}{\ensuremath\odot}% \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}% \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}% \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}% \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}% \DeclareUnicodeCharacter{22A8}{\ensuremath\models}% \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}% \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}% \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}% \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}% \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}% \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}% \DeclareUnicodeCharacter{22C6}{\ensuremath\star}% \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}% \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}% \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}% \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}% \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}% \DeclareUnicodeCharacter{2322}{\ensuremath\frown}% \DeclareUnicodeCharacter{2323}{\ensuremath\smile}% % \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}% \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}% \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}% \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}% \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}% \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}% \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}% \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}% \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}% \DeclareUnicodeCharacter{266D}{\ensuremath\flat}% \DeclareUnicodeCharacter{266E}{\ensuremath\natural}% \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}% \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}% \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}% \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}% \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}% \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}% \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}% \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}% \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}% \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}% \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}% \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}% \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}% \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}% \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}% \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}% \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}% \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}% % \global\mathchardef\checkmark="1370% actually the square root sign \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}% }% end of \unicodechardefs % UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command) % It makes the setting that replace UTF-8 byte sequence. \def\utfeightchardefs{% \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii \unicodechardefs } % Whether the active definitions of non-ASCII characters expand to % non-active tokens with the same character code. This is used to % write characters literally, instead of using active definitions for % printing the correct glyphs. \newif\ifpassthroughchars \passthroughcharsfalse % For native Unicode handling (XeTeX and LuaTeX), % provide a definition macro to replace/pass-through a Unicode character % \def\DeclareUnicodeCharacterNative#1#2{% \catcode"#1=\active \def\dodeclareunicodecharacternative##1##2##3{% \begingroup \uccode`\~="##2\relax \uppercase{\gdef~}{% \ifpassthroughchars ##1% \else ##3% \fi } \endgroup } \begingroup \uccode`\.="#1\relax \uppercase{\def\UTFNativeTmp{.}}% \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}% \endgroup } % Native Unicode handling (XeTeX and LuaTeX) character replacing definition. % It activates the setting that replaces Unicode characters. \def\nativeunicodechardefs{% \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative \unicodechardefs } % For native Unicode handling (XeTeX and LuaTeX), % make the character token expand % to the sequences given in \unicodechardefs for printing. \def\DeclareUnicodeCharacterNativeAtU#1#2{% \def\UTFAtUTmp{#2} \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp } % @U command definitions for native Unicode handling (XeTeX and LuaTeX). \def\nativeunicodechardefsatu{% \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU \unicodechardefs } % US-ASCII character definitions. \def\asciichardefs{% nothing need be done \relax } % define all Unicode characters we know about, for the sake of @U. \iftxinativeunicodecapable \nativeunicodechardefsatu \else \utfeightchardefs \fi % Make non-ASCII characters printable again for compatibility with % existing Texinfo documents that may use them, even without declaring a % document encoding. % \setnonasciicharscatcode \other \message{formatting,} \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. \vbadness = 10000 % Don't be very finicky about underfull hboxes, either. \hbadness = 6666 % Following George Bush, get rid of widows and orphans. \widowpenalty=10000 \clubpenalty=10000 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on % \hsize. We call this whenever the paper size is set. % \def\setemergencystretch{% \ifx\emergencystretch\thisisundefined % Allow us to assign to \emergencystretch anyway. \def\emergencystretch{\dimen0}% \else \emergencystretch = .15\hsize \fi } % Parameters in order: 1) textheight; 2) textwidth; % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; % 7) physical page height; 8) physical page width. % % We also call \setleading{\textleading}, so the caller should define % \textleading. The caller should also set \parskip. % \def\internalpagesizes#1#2#3#4#5#6#7#8{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip % \vsize = #1\relax \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 2\topandbottommargin \txipageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in \txipagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax % \ifpdf \pdfpageheight #7\relax \pdfpagewidth #8\relax % if we don't reset these, they will remain at "1 true in" of % whatever layout pdftex was dumped with. \pdfhorigin = 1 true in \pdfvorigin = 1 true in \else \ifx\XeTeXrevision\thisisundefined \special{papersize=#8,#7}% \else \pdfpageheight #7\relax \pdfpagewidth #8\relax % XeTeX does not have \pdfhorigin and \pdfvorigin. \fi \fi % \setleading{\textleading} % \parindent = \defaultparindent \setemergencystretch } % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % If page is nothing but text, make it come out even. \internalpagesizes{607.2pt}{6in}% that's 46 lines {\voffset}{.25in}% {\bindingoffset}{36pt}% {11in}{8.5in}% }} % Use @smallbook to reset parameters for 7x9.25 trim size. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt \textleading = 12pt % \internalpagesizes{7.5in}{5in}% {-.2in}{0in}% {\bindingoffset}{16pt}% {9.25in}{7in}% % \lispnarrowing = 0.3in \tolerance = 700 \contentsrightmargin = 0pt \defbodyindent = .5cm }} % Use @smallerbook to reset parameters for 6x9 trim size. % (Just testing, parameters still in flux.) \def\smallerbook{{\globaldefs = 1 \parskip = 1.5pt plus 1pt \textleading = 12pt % \internalpagesizes{7.4in}{4.8in}% {-.2in}{-.4in}% {0pt}{14pt}% {9in}{6in}% % \lispnarrowing = 0.25in \tolerance = 700 \contentsrightmargin = 0pt \defbodyindent = .4cm }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % Double-side printing via postscript on Laserjet 4050 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. % To change the settings for a different printer or situation, adjust % \normaloffset until the front-side and back-side texts align. Then % do the same for \bindingoffset. You can set these for testing in % your texinfo source file like this: % @tex % \global\normaloffset = -6mm % \global\bindingoffset = 10mm % @end tex \internalpagesizes{673.2pt}{160mm}% that's 51 lines {\voffset}{\hoffset}% {\bindingoffset}{44pt}% {297mm}{210mm}% % \tolerance = 700 \contentsrightmargin = 0pt \defbodyindent = 5mm }} % Use @afivepaper to print on European A5 paper. % From romildo@urano.iceb.ufop.br, 2 July 2000. % He also recommends making @example and @lisp be small. \def\afivepaper{{\globaldefs = 1 \parskip = 2pt plus 1pt minus 0.1pt \textleading = 12.5pt % \internalpagesizes{160mm}{120mm}% {\voffset}{\hoffset}% {\bindingoffset}{8pt}% {210mm}{148mm}% % \lispnarrowing = 0.2in \tolerance = 800 \contentsrightmargin = 0pt \defbodyindent = 2mm \tableindent = 12mm }} % A specific text layout, 24x15cm overall, intended for A4 paper. \def\afourlatex{{\globaldefs = 1 \afourpaper \internalpagesizes{237mm}{150mm}% {\voffset}{4.6mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% % % Must explicitly reset to 0 because we call \afourpaper. \globaldefs = 0 }} % Use @afourwide to print on A4 paper in landscape format. \def\afourwide{{\globaldefs = 1 \afourpaper \internalpagesizes{241mm}{165mm}% {\voffset}{-2.95mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% \globaldefs = 0 }} % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % \parseargdef\pagesizes{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt \setleading{\textleading}% % \dimen0 = #1\relax \advance\dimen0 by \voffset \advance\dimen0 by 1in % reference point for DVI is 1 inch from top of page % \dimen2 = \hsize \advance\dimen2 by \normaloffset \advance\dimen2 by 1in % reference point is 1 inch from left edge of page % \internalpagesizes{#1}{\hsize}% {\voffset}{\normaloffset}% {\bindingoffset}{44pt}% {\dimen0}{\dimen2}% }} % Set default to letter. % \letterpaper % Default value of \hfuzz, for suppressing warnings about overfull hboxes. \hfuzz = 1pt \message{and turning on texinfo input format.} \def^^L{\par} % remove \outer, so ^L can appear in an @comment % DEL is a comment character, in case @c does not suffice. \catcode`\^^? = 14 % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \def\normaldoublequote{"} \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix \catcode`\+=\other \def\normalplus{+} \catcode`\<=\other \def\normalless{<} \catcode`\>=\other \def\normalgreater{>} \catcode`\^=\other \def\normalcaret{^} \catcode`\_=\other \def\normalunderscore{_} \catcode`\|=\other \def\normalverticalbar{|} \catcode`\~=\other \def\normaltilde{~} % This macro is used to make a character print one way in \tt % (where it can probably be output as-is), and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print % otherwise. Since all the Computer Modern typewriter fonts have zero % interword stretch (and shrink), and it is reasonable to expect all % typewriter fonts to have this, we can check that font parameter. % \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} % Same as above, but check for italic font. Actually this also catches % non-italic slanted fonts since it is impossible to distinguish them from % italic fonts. But since this is only used by $ and it uses \sl anyway % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} % Set catcodes for Texinfo file % Active characters for printing the wanted glyph. % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. % \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde \chardef\hatchar=`\^ \catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } \let\realunder=_ \catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless \chardef \gtr=`\> \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix \catcode`\-=\active \let-=\normaldash % used for headline/footline in the output routine, in case the page % breaks in the middle of an @tex block. \def\texinfochars{% \let< = \activeless \let> = \activegtr \let~ = \activetilde \let^ = \activehat \markupsetuplqdefault \markupsetuprqdefault \let\b = \strong \let\i = \smartitalic % in principle, all other definitions in \tex have to be undone too. } % Used sometimes to turn off (effectively) the active characters even after % parsing them. \def\turnoffactive{% \normalturnoffactive \otherbackslash } \catcode`\@=0 % \backslashcurfont outputs one backslash character in current font, % as in \char`\\. \global\chardef\backslashcurfont=`\\ \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work % \realbackslash is an actual character `\' with catcode other, and % \doublebackslash is two of them (for the pdf outlines). {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} % In Texinfo, backslash is an active character; it prints the backslash % in fixed width font. \catcode`\\=\active % @ for escape char from now on. % Print a typewriter backslash. For math mode, we can't simply use % \backslashcurfont: the story here is that in math mode, the \char % of \backslashcurfont ends up printing the roman \ from the math symbol % font (because \char in math mode uses the \mathcode, and plain.tex % sets \mathcode`\\="026E). Hence we use an explicit \mathchar, % which is the decimal equivalent of "715c (class 7, e.g., use \fam; % ignored family value; char position "5C). We can't use " for the % usual hex value because it has already been made active. @def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} @let@backslashchar = @ttbackslash % @backslashchar{} is for user documents. % \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with % catcode other. We switch back and forth between these. @gdef@rawbackslash{@let\=@backslashcurfont} @gdef@otherbackslash{@let\=@realbackslash} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of % the literal character `\'. % {@catcode`- = @active @gdef@normalturnoffactive{% @passthroughcharstrue @let-=@normaldash @let"=@normaldoublequote @let$=@normaldollar %$ font-lock fix @let+=@normalplus @let<=@normalless @let>=@normalgreater @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let~=@normaltilde @let\=@ttbackslash @markupsetuplqdefault @markupsetuprqdefault @unsepspaces } } % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have @fixbackslash turn them back on. @catcode`+=@other @catcode`@_=@other % \enablebackslashhack - allow file to begin `\input texinfo' % % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. % If the file did not have a `\input texinfo', then it is turned off after % the first line; otherwise the first `\' in the file would cause an error. % This is used on the very last line of this file, texinfo.tex. % We also use @c to call @fixbackslash, in case ends of lines are hidden. { @catcode`@^=7 @catcode`@^^M=13@gdef@enablebackslashhack{% @global@let\ = @eatinput% @catcode`@^^M=13% @def@c{@fixbackslash@c}% % Definition for the newline at the end of this file. @def ^^M{@let^^M@secondlinenl}% % Definition for a newline in the main Texinfo file. @gdef @secondlinenl{@fixbackslash}% % In case the first line has a whole-line command on it @let@originalparsearg@parsearg @def@parsearg{@fixbackslash@originalparsearg} }} {@catcode`@^=7 @catcode`@^^M=13% @gdef@eatinput input texinfo#1^^M{@fixbackslash}} % Emergency active definition of newline, in case an active newline token % appears by mistake. {@catcode`@^=7 @catcode13=13% @gdef@enableemergencynewline{% @gdef^^M{% @par% %@par% }}} @gdef@fixbackslash{% @ifx\@eatinput @let\ = @ttbackslash @fi @catcode13=5 % regular end of line @enableemergencynewline @let@c=@texinfoc @let@parsearg@originalparsearg % Also turn back on active characters that might appear in the input % file name, in case not using a pre-dumped format. @catcode`+=@active @catcode`@_=@active % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets % called at the beginning of every Texinfo file. Not opening texinfo.cnf % directly in this file, texinfo.tex, makes it possible to make a format % file for Texinfo. % @openin 1 texinfo.cnf @ifeof 1 @else @input texinfo.cnf @fi @closein 1 } % Say @foo, not \foo, in error messages. @escapechar = `@@ % These (along with & and #) are made active for url-breaking, so need % active definitions as the normal characters. @def@normaldot{.} @def@normalquest{?} @def@normalslash{/} % These look ok in all fonts, so just make them not special. % @hashchar{} gets its own user-level command, because of #line. @catcode`@& = @other @def@normalamp{&} @catcode`@# = @other @def@normalhash{#} @catcode`@% = @other @def@normalpercent{%} @let @hashchar = @normalhash @c Finally, make ` and ' active, so that txicodequoteundirected and @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we @c don't make ` and ' active, @code will not get them as active chars. @c Do this last of all since we use ` in the previous @catcode assignments. @catcode`@'=@active @catcode`@`=@active @markupsetuplqdefault @markupsetuprqdefault @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @c page-delimiter: "^\\\\message\\|emacs-page" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: @c vim:sw=2: @enablebackslashhack ginac-1.7.8.orig/config/ylwrap0000755000000000000000000001531413457611642013163 0ustar #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . get_dirname () { case $1 in */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; # Otherwise, we want the empty string (not "."). esac } # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. guard () { printf '%s\n' "$1" \ | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ -e 's/__*/_/g' } # quote_for_sed [STRING] # ---------------------- # Return STRING (or stdin) quoted to be used as a sed pattern. quote_for_sed () { case $# in 0) cat;; 1) printf '%s\n' "$1";; esac \ | sed -e 's|[][\\.*]|\\&|g' } case "$1" in '') echo "$0: No files given. Try '$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot=false if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot=true fi # The parser itself, the first file, is the destination of the .y.c # rule in the Makefile. parser=$1 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for # instance, we rename #include "y.tab.h" into #include "parse.h" # during the conversion from y.tab.c to parse.c. sed_fix_filenames= # Also rename header guards, as Bison 2.7 for instance uses its header # guard in its implementation file. sed_fix_header_guards= while test $# -ne 0; do if test x"$1" = x"--"; then shift break fi from=$1 # Handle y_tab.c and y_tab.h output by DOS if $y_tab_nodot; then case $from in "y.tab.c") from=y_tab.c;; "y.tab.h") from=y_tab.h;; esac fi shift to=$1 shift sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" done # The program to run. prog=$1 shift # Make any relative path in $prog absolute. case $prog in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog=`pwd`/$prog ;; esac dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then for from in * do to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless # recompilations. Always update the parser itself: it is the # destination of the .y.c rule in the Makefile. Divert the # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi # Munge "#line" or "#" directives. Don't let the resulting # debug information point at an absolute srcdir. Use the real # output file name, not yy.lex.c for instance. Adjust the # include guards too. sed -e "/^#/!b" \ -e "s|$input_rx|$input_sub_rx|" \ -e "$sed_fix_filenames" \ -e "$sed_fix_header_guards" \ "$from" >"$target" || ret=$? # Check whether files must be updated. if test "$from" != "$parser"; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$to is unchanged" rm -f "$target" else echo "updating $to" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the parser. This is a # blatant hack to let us support using "yacc -d". If -d is not # specified, don't fail when the header file is "missing". if test "$from" = "$parser"; then ret=1 fi fi done fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: ginac-1.7.8.orig/config.cmake.in0000644000000000000000000000023413457611471013321 0ustar #cmakedefine HAVE_UNISTD_H #cmakedefine HAVE_LIBREADLINE #cmakedefine HAVE_READLINE_READLINE_H #cmakedefine HAVE_READLINE_HISTORY_H #cmakedefine HAVE_LIBDL ginac-1.7.8.orig/configure0000755000000000000000000236337513546714001012370 0ustar #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for GiNaC 1.7.8. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: ginac-list@ginac.de about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='GiNaC' PACKAGE_TARNAME='ginac' PACKAGE_VERSION='1.7.8' PACKAGE_STRING='GiNaC 1.7.8' PACKAGE_BUGREPORT='ginac-list@ginac.de' PACKAGE_URL='http://www.ginac.de/' ac_unique_file="ginac/basic.cpp" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS CONFIG_FIG2DEV_FALSE CONFIG_FIG2DEV_TRUE FIG2DEV CONFIG_TEX_FALSE CONFIG_TEX_TRUE DVIPS MAKEINDEX PDFLATEX LATEX CONFIG_DOXYGEN_FALSE CONFIG_DOXYGEN_TRUE DOXYGEN CONFIG_EXCOMPILER_FALSE CONFIG_EXCOMPILER_TRUE CONFIG_EXCOMPILER DL_LIBS PYTHON GINSH_LIBS LIBTERMCAP CONFIG_RUSAGE GINACLIB_RPATH CLN_RPATH CLN_LIBS CLN_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG HAVE_CXX11 YACCEXE YFLAGS YACC LEXLIB LEX_OUTPUT_ROOT LEX CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE ac_ct_CC CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX LT_VERSION_INFO AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V 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 runstatedir 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 am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock enable_rpath enable_excompiler ' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CXXCPP CC CFLAGS LT_SYS_LIBRARY_PATH CPP YACC YFLAGS PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR CLN_CFLAGS CLN_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures GiNaC 1.7.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --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/ginac] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of GiNaC 1.7.8:";; 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-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --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) --disable-rpath do not hardcode runtime library paths --enable-excompiler Enable GiNaC::compile_ex (default: yes) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --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-gnu-ld assume the C compiler uses GNU ld [default=no] Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXXCPP C++ preprocessor CC C compiler command CFLAGS C compiler flags LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path CLN_CFLAGS C compiler flags for CLN, overriding pkg-config CLN_LIBS linker flags for CLN, overriding pkg-config 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 . GiNaC home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF GiNaC configure 1.7.8 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_cxx_check_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; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_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 ginac-list@ginac.de ## ## ---------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_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 declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GiNaC $as_me 1.7.8, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in config "$srcdir"/config; 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 config \"$srcdir\"/config" "$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/config.h" am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='ginac' VERSION='1.7.8' 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"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi LT_VERSION_INFO="10:2:4" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 $as_echo_n "checking whether the C++ compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C++ compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 $as_echo_n "checking for C++ compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' 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 ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that 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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; 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 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; 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 if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # 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"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$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"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && 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 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_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 dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. 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 yes = "$lt_cv_prog_gnu_ld"; 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. 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 emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. 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*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; 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 no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; 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 func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; 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 os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; 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 no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; 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 yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/(^)\+)\s\+//' 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 ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; 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 no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; 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 tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; 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 set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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 set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; 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 archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; 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*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; 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 "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; 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 no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; 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 link_all_deplibs=no 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 ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; 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 ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) 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__`"; 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 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; 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 yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; 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 CANNOT 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 yes = "$GCC"; 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 sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; 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` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco 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 yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $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 yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; 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 yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; 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 no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive 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 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; 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 yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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 set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; 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 archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $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, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; 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*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; 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 yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=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 ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$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 yes = "$GXX"; 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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) 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__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; 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 $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 $wl-h $wl$soname -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 $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 $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; 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 no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; 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 no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco 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 yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $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 yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: for ac_prog in flex lex 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_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$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 LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" 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 "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi for ac_prog in 'bison -y' byacc 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_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$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 YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" # Extract the first word of "$YACC", so it can be a program name with args. set dummy $YACC; 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_YACCEXE+:} false; then : $as_echo_n "(cached) " >&6 else case $YACCEXE in [\\/]* | ?:[\\/]*) ac_cv_path_YACCEXE="$YACCEXE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_YACCEXE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_YACCEXE" && ac_cv_path_YACCEXE="""" ;; esac fi YACCEXE=$ac_cv_path_YACCEXE if test -n "$YACCEXE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACCEXE" >&5 $as_echo "$YACCEXE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$LEX" = "x:" -a ! -f $srcdir/ginsh/ginsh_lexer.cpp; then : ginac_warning_txt="$ginac_warning_txt == ginsh will not compile, because lex/flex is missing " ginac_warning=yes fi if test -z "$YACCEXE" -a ! -f $srcdir/ginsh/ginsh_parser.hpp; then : ginac_warning_txt="$ginac_warning_txt == ginsh will not compile, because yacc/bison is missing " ginac_warning=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true 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_success=no if test x$ac_success = xno; then for alternative in ${ax_cxx_compile_alternatives}; do switch="-std=gnu++${alternative}" cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } if eval \${$cachevar+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_CXX="$CXX" CXX="$CXX $switch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { virtual ~Derived() override {} virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval $cachevar=yes else eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXX="$ac_save_CXX" fi eval ac_res=\$$cachevar { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done fi if test x$ac_success = xno; then for alternative in ${ax_cxx_compile_alternatives}; do for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } if eval \${$cachevar+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_CXX="$CXX" CXX="$CXX $switch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { virtual ~Derived() override {} virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval $cachevar=yes else eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXX="$ac_save_CXX" fi eval ac_res=\$$cachevar { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done if test x$ac_success = xyes; then break fi done 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 if test x$ax_cxx_compile_cxx11_required = xtrue; then if test x$ac_success = xno; then as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 fi fi if test x$ac_success = xno; then HAVE_CXX11=0 { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 $as_echo "$as_me: No compiler with C++11 support was found" >&6;} else HAVE_CXX11=1 $as_echo "#define HAVE_CXX11 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for standard C++ header files" >&5 $as_echo_n "checking for standard C++ header files... " >&6; } if ${ginac_cv_std_cxx_headers+:} false; then : $as_echo_n "(cached) " >&6 else ginac_cv_std_cxx_headers="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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ginac_cv_std_cxx_headers="yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ginac_cv_std_cxx_headers" >&5 $as_echo "$ginac_cv_std_cxx_headers" >&6; } if test "${ginac_cv_std_cxx_headers}" != "yes"; then as_fn_error $? "Standard ISO C++ headers are missing" "$LINENO" 5 fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CLN" >&5 $as_echo_n "checking for CLN... " >&6; } if test -n "$CLN_CFLAGS"; then pkg_cv_CLN_CFLAGS="$CLN_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cln >= 1.2.2\""; } >&5 ($PKG_CONFIG --exists --print-errors "cln >= 1.2.2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CLN_CFLAGS=`$PKG_CONFIG --cflags "cln >= 1.2.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CLN_LIBS"; then pkg_cv_CLN_LIBS="$CLN_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cln >= 1.2.2\""; } >&5 ($PKG_CONFIG --exists --print-errors "cln >= 1.2.2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CLN_LIBS=`$PKG_CONFIG --libs "cln >= 1.2.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CLN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cln >= 1.2.2" 2>&1` else CLN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cln >= 1.2.2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CLN_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (cln >= 1.2.2) were not met: $CLN_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables CLN_CFLAGS and CLN_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables CLN_CFLAGS and CLN_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else CLN_CFLAGS=$pkg_cv_CLN_CFLAGS CLN_LIBS=$pkg_cv_CLN_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } 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 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. 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 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 ${acl_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_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 `"$acl_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; : else enable_rpath=yes fi acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 $as_echo_n "checking for 64-bit host... " >&6; } if ${gl_cv_solaris_64bit+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _LP64 sixtyfour bits #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sixtyfour bits" >/dev/null 2>&1; then : gl_cv_solaris_64bit=yes else gl_cv_solaris_64bit=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 $as_echo "$gl_cv_solaris_64bit" >&6; } if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" CLN_RPATH= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then rpathdirs= next= for opt in $CLN_LIBS; do if test -n "$next"; then dir="$next" if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n """"; then for dir in $rpathdirs; do CLN_RPATH="${CLN_RPATH}${CLN_RPATH:+ }-R$dir" done else if test -n "$acl_hardcode_libdir_separator"; then alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" CLN_RPATH="$flag" else for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" CLN_RPATH="${CLN_RPATH}${CLN_RPATH:+ }$flag" done fi fi fi fi fi LIBS="$LIBS $CLN_LIBS $CLN_RPATH" CPPFLAGS="$CPPFLAGS $CLN_CFLAGS" GINACLIB_LIBS='-L${libdir} -lginac' GINACLIB_RPATH= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then rpathdirs= next= for opt in $GINACLIB_LIBS; do if test -n "$next"; then dir="$next" if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n """"; then for dir in $rpathdirs; do GINACLIB_RPATH="${GINACLIB_RPATH}${GINACLIB_RPATH:+ }-R$dir" done else if test -n "$acl_hardcode_libdir_separator"; then alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" GINACLIB_RPATH="$flag" else for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" GINACLIB_RPATH="${GINACLIB_RPATH}${GINACLIB_RPATH:+ }$flag" done fi fi fi fi fi for ac_header in unistd.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct rusage is declared in " >&5 $as_echo_n "checking whether struct rusage is declared in ... " >&6; } if ${ac_cv_have_rusage+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct rusage resUsage; getrusage(RUSAGE_SELF, &resUsage); return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_have_rusage=yes else ac_cv_have_rusage=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_rusage" >&5 $as_echo "$ac_cv_have_rusage" >&6; } CONFIG_RUSAGE="no" if test "$ac_cv_have_rusage" = yes; then CONFIG_RUSAGE="yes" $as_echo "#define HAVE_RUSAGE /**/" >>confdefs.h fi LIBTERMCAP= case $host_os in *mingw32*) ;; *) for ac_func in tgetent do : ac_fn_cxx_check_func "$LINENO" "tgetent" "ac_cv_func_tgetent" if test "x$ac_cv_func_tgetent" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_TGETENT 1 _ACEOF fi done if test "x$ac_cv_func_tgetent" = "xyes"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncurses" >&5 $as_echo_n "checking for tgetent in -lncurses... " >&6; } if ${ac_cv_lib_ncurses_tgetent+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $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 tgetent (); int main () { return tgetent (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_ncurses_tgetent=yes else ac_cv_lib_ncurses_tgetent=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_ncurses_tgetent" >&5 $as_echo "$ac_cv_lib_ncurses_tgetent" >&6; } if test "x$ac_cv_lib_ncurses_tgetent" = xyes; then : LIBTERMCAP="-lncurses" fi if test -z "$LIBTERMCAP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5 $as_echo_n "checking for tgetent in -ltermcap... " >&6; } if ${ac_cv_lib_termcap_tgetent+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltermcap $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 tgetent (); int main () { return tgetent (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_termcap_tgetent=yes else ac_cv_lib_termcap_tgetent=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_termcap_tgetent" >&5 $as_echo "$ac_cv_lib_termcap_tgetent" >&6; } if test "x$ac_cv_lib_termcap_tgetent" = xyes; then : LIBTERMCAP="-ltermcap" fi fi fi ;; esac GINSH_LIBS="" for ac_header in readline/readline.h readline/history.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 fi done if test "x${ac_cv_header_readline_readline_h}" != "xyes" -o "x${ac_cv_header_readline_history_h}" != "xyes"; then ginac_warning_txt="$ginac_warning_txt == ginsh will not compile, because readline headers could not be found. " ginac_warning=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version of libreadline" >&5 $as_echo_n "checking for version of libreadline... " >&6; } if ${ginac_cv_rl_supported+:} false; then : $as_echo_n "(cached) " >&6 else ginac_cv_rl_supported="no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if !defined(RL_VERSION_MAJOR) || !defined(RL_VERSION_MINOR) #error "Ancient/unsupported version of readline" #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ginac_cv_rl_supported="yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ginac_cv_rl_supported" >&5 $as_echo "$ginac_cv_rl_supported" >&6; } if test "x${ginac_cv_rl_supported}" != "xyes"; then ginac_warning_txt="$ginac_warning_txt == ginsh will not compile, because of an unsupported version of readline (<= 4.2 or non-GNU). " ginac_warning=yes else save_LIBS="$LIBS" LIBS="$LIBTERMCAP $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $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 readline (); int main () { return readline (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=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_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBREADLINE 1 _ACEOF LIBS="-lreadline $LIBS" fi if test "x${ac_cv_lib_readline_readline}" != "xyes"; then ginac_warning_txt="$ginac_warning_txt == ginsh will not compile, because libreadline could not be found. " ginac_warning=yes fi GINSH_LIBS="$LIBS" LIBS="$save_LIBS" fi fi # Extract the first word of "python", so it can be a program name with args. set dummy python; 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_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="""" ;; esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$PYTHON" -a ! -f "$srcdir/ginac/function.cpp"; then : as_fn_error $? "GiNaC will not compile because Python is missing" "$LINENO" 5 fi CONFIG_EXCOMPILER=yes DL_LIBS="" # Check whether --enable-excompiler was given. if test "${enable_excompiler+set}" = set; then : enableval=$enable_excompiler; if test "$enableval" = "no"; then CONFIG_EXCOMPILER="no" fi else CONFIG_EXCOMPILER="yes" fi case $host_os in *mingw32*) CONFIG_EXCOMPILER="notsupported" ;; *) ;; esac if test "$CONFIG_EXCOMPILER" = "yes"; then ac_fn_cxx_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = xyes; then : CONFIG_EXCOMPILER="yes" else CONFIG_EXCOMPILER="no" fi elif test "$CONFIG_EXCOMPILER" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: GiNaC::compile_ex disabled at user request." >&5 $as_echo "$as_me: GiNaC::compile_ex disabled at user request." >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: GiNaC::compile_ex is not supported on $host_os." >&5 $as_echo "$as_me: GiNaC::compile_ex is not supported on $host_os." >&6;} fi if test "$CONFIG_EXCOMPILER" = "yes"; then found_dlopen_lib="no" DL_LIBS="-ldl" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : found_dlopen_lib="yes" fi if test "$found_dlopen_lib" = "no"; then DL_LIBS="" ac_fn_cxx_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : found_dlopen_lib="yes" fi fi if test "$found_dlopen_lib" = "no"; then CONFIG_EXCOMPILER="no" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not found working dlopen(). GiNaC::compile_ex will be disabled." >&5 $as_echo "$as_me: WARNING: Could not found working dlopen(). GiNaC::compile_ex will be disabled." >&2;} else $as_echo "#define HAVE_LIBDL 1" >>confdefs.h fi fi if test "x${CONFIG_EXCOMPILER}" = "xyes"; then CONFIG_EXCOMPILER_TRUE= CONFIG_EXCOMPILER_FALSE='#' else CONFIG_EXCOMPILER_TRUE='#' CONFIG_EXCOMPILER_FALSE= fi # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; 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_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else case $DOXYGEN in [\\/]* | ?:[\\/]*) ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_DOXYGEN" && ac_cv_path_DOXYGEN="""" ;; esac fi DOXYGEN=$ac_cv_path_DOXYGEN if test -n "$DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 $as_echo "$DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test ! -z "$DOXYGEN"; then CONFIG_DOXYGEN_TRUE= CONFIG_DOXYGEN_FALSE='#' else CONFIG_DOXYGEN_TRUE='#' CONFIG_DOXYGEN_FALSE= fi # Extract the first word of "latex", so it can be a program name with args. set dummy latex; 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_LATEX+:} false; then : $as_echo_n "(cached) " >&6 else case $LATEX in [\\/]* | ?:[\\/]*) ac_cv_path_LATEX="$LATEX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LATEX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LATEX" && ac_cv_path_LATEX="""" ;; esac fi LATEX=$ac_cv_path_LATEX if test -n "$LATEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LATEX" >&5 $as_echo "$LATEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "pdflatex", so it can be a program name with args. set dummy pdflatex; 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_PDFLATEX+:} false; then : $as_echo_n "(cached) " >&6 else case $PDFLATEX in [\\/]* | ?:[\\/]*) ac_cv_path_PDFLATEX="$PDFLATEX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PDFLATEX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PDFLATEX" && ac_cv_path_PDFLATEX="""" ;; esac fi PDFLATEX=$ac_cv_path_PDFLATEX if test -n "$PDFLATEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PDFLATEX" >&5 $as_echo "$PDFLATEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "makeindex", so it can be a program name with args. set dummy makeindex; 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_MAKEINDEX+:} false; then : $as_echo_n "(cached) " >&6 else case $MAKEINDEX in [\\/]* | ?:[\\/]*) ac_cv_path_MAKEINDEX="$MAKEINDEX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MAKEINDEX" && ac_cv_path_MAKEINDEX="""" ;; esac fi MAKEINDEX=$ac_cv_path_MAKEINDEX if test -n "$MAKEINDEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKEINDEX" >&5 $as_echo "$MAKEINDEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "makeinfo", so it can be a program name with args. set dummy makeinfo; 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_MAKEINFO+:} false; then : $as_echo_n "(cached) " >&6 else case $MAKEINFO in [\\/]* | ?:[\\/]*) ac_cv_path_MAKEINFO="$MAKEINFO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MAKEINFO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MAKEINFO" && ac_cv_path_MAKEINFO="""" ;; esac fi MAKEINFO=$ac_cv_path_MAKEINFO if test -n "$MAKEINFO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKEINFO" >&5 $as_echo "$MAKEINFO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "dvips", so it can be a program name with args. set dummy dvips; 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_DVIPS+:} false; then : $as_echo_n "(cached) " >&6 else case $DVIPS in [\\/]* | ?:[\\/]*) ac_cv_path_DVIPS="$DVIPS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DVIPS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_DVIPS" && ac_cv_path_DVIPS="""" ;; esac fi DVIPS=$ac_cv_path_DVIPS if test -n "$DVIPS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DVIPS" >&5 $as_echo "$DVIPS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test ! \( -z "$LATEX" -o -z $"PDFLATEX" -o -z "$MAKEINDEX" -o -z "$DVIPS" \); then CONFIG_TEX_TRUE= CONFIG_TEX_FALSE='#' else CONFIG_TEX_TRUE='#' CONFIG_TEX_FALSE= fi # Extract the first word of "fig2dev", so it can be a program name with args. set dummy fig2dev; 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_FIG2DEV+:} false; then : $as_echo_n "(cached) " >&6 else case $FIG2DEV in [\\/]* | ?:[\\/]*) ac_cv_path_FIG2DEV="$FIG2DEV" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_FIG2DEV="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_FIG2DEV" && ac_cv_path_FIG2DEV="""" ;; esac fi FIG2DEV=$ac_cv_path_FIG2DEV if test -n "$FIG2DEV"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FIG2DEV" >&5 $as_echo "$FIG2DEV" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test ! -z "$FIG2DEV"; then CONFIG_FIG2DEV_TRUE= CONFIG_FIG2DEV_FALSE='#' else CONFIG_FIG2DEV_TRUE='#' CONFIG_FIG2DEV_FALSE= fi if test -z "$FIG2DEV" -o -z "$MAKEINFO"; then : ginac_warning_txt="$ginac_warning_txt == Documentation may not build, because fig2dev/texinfo is missing. " ginac_warning=yes fi if test -z "$DOXYGEN"; then : ginac_warning_txt="$ginac_warning_txt == Reference manual will not build, because doxygen is missing. " ginac_warning=yes fi if test -z "$LATEX" -o -z "$PDFLATEX" -o -z "$DVIPS"; then : ginac_warning_txt="$ginac_warning_txt == Some documentation formats may not build, because latex/pdflatex/dvips is missing. " ginac_warning=yes fi ac_config_files="$ac_config_files Makefile GiNaC.spec ginac.pc ginac/Makefile check/Makefile ginsh/Makefile ginsh/ginsh.1 tools/Makefile tools/viewgar.1 tools/ginac-excompiler doc/Makefile doc/examples/Makefile doc/tutorial/Makefile doc/reference/Makefile doc/reference/DoxyfileHTML doc/reference/DoxyfileTEX doc/reference/DoxyfilePDF doc/reference/Doxyfooter" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONFIG_EXCOMPILER_TRUE}" && test -z "${CONFIG_EXCOMPILER_FALSE}"; then as_fn_error $? "conditional \"CONFIG_EXCOMPILER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONFIG_DOXYGEN_TRUE}" && test -z "${CONFIG_DOXYGEN_FALSE}"; then as_fn_error $? "conditional \"CONFIG_DOXYGEN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONFIG_TEX_TRUE}" && test -z "${CONFIG_TEX_FALSE}"; then as_fn_error $? "conditional \"CONFIG_TEX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONFIG_FIG2DEV_TRUE}" && test -z "${CONFIG_FIG2DEV_FALSE}"; then as_fn_error $? "conditional \"CONFIG_FIG2DEV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by GiNaC $as_me 1.7.8, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . GiNaC home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ GiNaC config.status 1.7.8 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # 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"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $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"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $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"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ 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\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config/config.h") CONFIG_HEADERS="$CONFIG_HEADERS config/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "GiNaC.spec") CONFIG_FILES="$CONFIG_FILES GiNaC.spec" ;; "ginac.pc") CONFIG_FILES="$CONFIG_FILES ginac.pc" ;; "ginac/Makefile") CONFIG_FILES="$CONFIG_FILES ginac/Makefile" ;; "check/Makefile") CONFIG_FILES="$CONFIG_FILES check/Makefile" ;; "ginsh/Makefile") CONFIG_FILES="$CONFIG_FILES ginsh/Makefile" ;; "ginsh/ginsh.1") CONFIG_FILES="$CONFIG_FILES ginsh/ginsh.1" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "tools/viewgar.1") CONFIG_FILES="$CONFIG_FILES tools/viewgar.1" ;; "tools/ginac-excompiler") CONFIG_FILES="$CONFIG_FILES tools/ginac-excompiler" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/examples/Makefile") CONFIG_FILES="$CONFIG_FILES doc/examples/Makefile" ;; "doc/tutorial/Makefile") CONFIG_FILES="$CONFIG_FILES doc/tutorial/Makefile" ;; "doc/reference/Makefile") CONFIG_FILES="$CONFIG_FILES doc/reference/Makefile" ;; "doc/reference/DoxyfileHTML") CONFIG_FILES="$CONFIG_FILES doc/reference/DoxyfileHTML" ;; "doc/reference/DoxyfileTEX") CONFIG_FILES="$CONFIG_FILES doc/reference/DoxyfileTEX" ;; "doc/reference/DoxyfilePDF") CONFIG_FILES="$CONFIG_FILES doc/reference/DoxyfilePDF" ;; "doc/reference/Doxyfooter") CONFIG_FILES="$CONFIG_FILES doc/reference/Doxyfooter" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf 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. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; 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 $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that 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 # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 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 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 this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # 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 where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _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 set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi if test "x${ginac_error}" = "xyes"; then echo echo "**** The following problems have been detected by configure." echo "**** Please check the messages below before running \"make\"." echo "**** (see the section 'Common Problems' in the INSTALL file)" echo "$ginac_error_txt" if test "x${ginac_warning_txt}" != "x"; then echo "${ginac_warning_txt}" fi if test "x$cache_file" != "x/dev/null"; then echo "deleting cache ${cache_file}" rm -f $cache_file fi exit 1 else if test "x${ginac_warning}" = "xyes"; then echo echo "=== The following minor problems have been detected by configure." echo "=== Please check the messages below before running \"make\"." echo "=== (see the section 'Common Problems' in the INSTALL file)" echo "$ginac_warning_txt" fi echo "Configuration of GiNaC $VERSION done. Now type \"make\"." fi ginac-1.7.8.orig/configure.ac0000644000000000000000000001036713457611471012743 0ustar dnl Pull version info from the ginac/version.h file. dnl GiNaC release number: m4_define([ginac_major_version], GINAC_GET_VERSION([MAJOR])) m4_define([ginac_minor_version], GINAC_GET_VERSION([MINOR])) m4_define([ginac_micro_version], GINAC_GET_VERSION([MICRO])) m4_define([ginac_version], [ginac_major_version.ginac_minor_version.ginac_micro_version]) m4_define([ginac_release], [ginac_major_version.ginac_minor_version]) dnl GiNaC library version information. It has very little to do with GiNaC dnl version number. In particular, library version is OS dependent. m4_define([ginac_lt_current], GINAC_GET_LTVERSION([CURRENT])) m4_define([ginac_lt_age], GINAC_GET_LTVERSION([AGE])) m4_define([ginac_lt_revision], GINAC_GET_LTVERSION([REVISION])) AC_INIT([GiNaC], ginac_version, [ginac-list@ginac.de], [ginac], [http://www.ginac.de/]) AC_PREREQ(2.59) AC_CONFIG_SRCDIR(ginac/basic.cpp) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_HEADERS([config/config.h]) AC_CONFIG_MACRO_DIR([m4]) dnl This defines PACKAGE and VERSION. AM_INIT_AUTOMAKE([gnu 1.8 dist-bzip2 subdir-objects]) dnl libtool versioning LT_VERSION_INFO="ginac_lt_current:ginac_lt_revision:ginac_lt_age" AC_SUBST(LT_VERSION_INFO) dnl Check for the compiler and all the utilities needed for the build. AC_PROG_CXX AC_PROG_CXXCPP AC_PROG_INSTALL AM_PROG_LIBTOOL AC_PROG_LEX AC_PROG_YACC AC_PATH_PROG(YACCEXE, $YACC, "") AS_IF([test "x$LEX" = "x:" -a ! -f $srcdir/ginsh/ginsh_lexer.cpp], [GINAC_WARNING([ginsh will not compile, because lex/flex is missing])]) AS_IF([test -z "$YACCEXE" -a ! -f $srcdir/ginsh/ginsh_parser.hpp], [GINAC_WARNING([ginsh will not compile, because yacc/bison is missing])]) dnl Switch to C++ language mode for the following libraries and headers. AC_LANG([C++]) AX_CXX_COMPILE_STDCXX([11]) dnl Make sure all the necessary standard headers are installed on the system. GINAC_STD_CXX_HEADERS dnl We need to have CLN installed. PKG_CHECK_MODULES(CLN, cln >= 1.2.2) AC_LIB_LINKFLAGS_FROM_LIBS([CLN_RPATH], [$CLN_LIBS]) LIBS="$LIBS $CLN_LIBS $CLN_RPATH" CPPFLAGS="$CPPFLAGS $CLN_CFLAGS" dnl Include proper rpath into pkg-config meta data, so dnl g++ `pkg-config --cflags --libs ginac` dnl actually works GINACLIB_LIBS='-L${libdir} -lginac' AC_LIB_LINKFLAGS_FROM_LIBS([GINACLIB_RPATH], [$GINACLIB_LIBS]) dnl Check for stuff needed for building the GiNaC interactive shell (ginsh). AC_CHECK_HEADERS(unistd.h) GINAC_HAVE_RUSAGE GINAC_READLINE dnl Python is necessary for building function.{cpp,h} AC_PATH_PROG(PYTHON, python, "") AS_IF([test -z "$PYTHON" -a ! -f "$srcdir/ginac/function.cpp"], [AC_MSG_ERROR([GiNaC will not compile because Python is missing])]) dnl Check for dl library (needed for GiNaC::compile). GINAC_EXCOMPILER AM_CONDITIONAL(CONFIG_EXCOMPILER, [test "x${CONFIG_EXCOMPILER}" = "xyes"]) dnl Check for utilities needed by the different kinds of documentation. dnl Documentation needs only be built when extending it, so never mind if it dnl cannot find those helpers: AC_PATH_PROG(DOXYGEN, doxygen, "") AM_CONDITIONAL(CONFIG_DOXYGEN, [test ! -z "$DOXYGEN"]) AC_PATH_PROG(LATEX, latex, "") AC_PATH_PROG(PDFLATEX, pdflatex, "") AC_PATH_PROG(MAKEINDEX, makeindex, "") AC_PATH_PROG(MAKEINFO, makeinfo, "") AC_PATH_PROG(DVIPS, dvips, "") AM_CONDITIONAL(CONFIG_TEX, [test ! \( -z "$LATEX" -o -z $"PDFLATEX" -o -z "$MAKEINDEX" -o -z "$DVIPS" \)]) AC_PATH_PROG(FIG2DEV, fig2dev, "") AM_CONDITIONAL(CONFIG_FIG2DEV, [test ! -z "$FIG2DEV"]) AS_IF([test -z "$FIG2DEV" -o -z "$MAKEINFO"], [GINAC_WARNING([Documentation may not build, because fig2dev/texinfo is missing.])]) AS_IF([test -z "$DOXYGEN"], [GINAC_WARNING([Reference manual will not build, because doxygen is missing.])]) AS_IF([test -z "$LATEX" -o -z "$PDFLATEX" -o -z "$DVIPS"], [GINAC_WARNING([Some documentation formats may not build, because latex/pdflatex/dvips is missing.])]) dnl Output makefiles etc. AC_CONFIG_FILES([ Makefile GiNaC.spec ginac.pc ginac/Makefile check/Makefile ginsh/Makefile ginsh/ginsh.1 tools/Makefile tools/viewgar.1 tools/ginac-excompiler doc/Makefile doc/examples/Makefile doc/tutorial/Makefile doc/reference/Makefile doc/reference/DoxyfileHTML doc/reference/DoxyfileTEX doc/reference/DoxyfilePDF doc/reference/Doxyfooter ]) AC_OUTPUT dnl Display a final warning if there has been a GINAC_ERROR or a GINAC_WARNING GINAC_CHECK_ERRORS ginac-1.7.8.orig/doc/0000755000000000000000000000000013546717365011223 5ustar ginac-1.7.8.orig/doc/CMakeLists.txt0000644000000000000000000000420713457611471013756 0ustar find_package(Doxygen) find_program(FIG2DEV fig2dev) find_program(TEXI2DVI texi2dvi) find_package(LATEX) if (PDFLATEX_COMPILER AND MAKEINDEX_COMPILER) set(LATEX_FOUND true) endif() macro(add_info_file thename) set(${thename}_INFO ${CMAKE_CURRENT_BINARY_DIR}/${thename}.info) set(${thename}_HTML ${CMAKE_CURRENT_BINARY_DIR}/${thename}.html) set(${thename}_TEXINFO ${CMAKE_CURRENT_SOURCE_DIR}/${thename}.texi) add_custom_command( OUTPUT ${${thename}_INFO} COMMAND ${MAKEINFO} --no-split -o ${${thename}_INFO} ${${thename}_TEXINFO} DEPENDS ${${thename}_TEXINFO} COMMENT "MAKEFINO ${thename}.texi" VERBATIM) add_custom_command( OUTPUT ${${thename}_HTML} COMMAND ${MAKEINFO} --html --no-split -o ${${thename}_HTML} ${${thename}_TEXINFO} DEPENDS ${${thename}_TEXINFO} ${${thename}_HTML_EXTRA_DEPS} COMMENT "MAKEINFOHTML ${thename}.texi" VERBATIM) add_custom_target(${thename}_info ALL DEPENDS ${${thename}_INFO}) add_custom_target(${thename}_html DEPENDS ${${thename}_HTML}) add_dependencies(info ${thename}_info) add_dependencies(html ${thename}_html) install(FILES ${${thename}_INFO} DESTINATION "${SHARE_INSTALL_PREFIX}/info") endmacro() macro(pdflatex_process texfile) get_filename_component(_dirname "${texfile}" PATH) get_filename_component(_basename "${texfile}" NAME_WE) set(_idx ${_dirname}/${_basename}.idx) set(_ind ${_dirname}/${_basename}.ind) set(_pdf ${_dirname}/${_basename}.pdf) set(_fixupind ${CMAKE_SOURCE_DIR}/scripts/fixupind.py) add_custom_command( OUTPUT ${_idx} COMMAND ${PDFLATEX_COMPILER} ${texfile} WORKING_DIRECTORY ${_dirname} DEPENDS ${texfile} COMMENT "PDFLATEX ${_basename}.tex (1)") add_custom_command( OUTPUT ${_ind} COMMAND ${MAKEINDEX_COMPILER} ${_idx} COMMAND python ${_fixupind} ${_idx} WORKING_DIRECTORY ${_dirname} DEPENDS ${texfile} ${_idx} COMMENT "MAKEINDEX ${_basename}.idx") add_custom_command( OUTPUT ${_pdf} COMMAND ${PDFLATEX_COMPILER} ${texfile} WORKING_DIRECTORY ${_dirname} DEPENDS ${texfile} ${_ind} COMMENT "PDFLATEX ${_basename}.tex (2)") endmacro() add_subdirectory(tutorial) add_subdirectory(examples) if (DOXYGEN_FOUND) add_subdirectory(reference) endif() ginac-1.7.8.orig/doc/Makefile.am0000644000000000000000000000017413457611471013251 0ustar ## Process this file with automake to produce Makefile.in SUBDIRS = tutorial reference examples EXTRA_DIST = CMakeLists.txt ginac-1.7.8.orig/doc/Makefile.in0000644000000000000000000004566513541765075013304 0ustar # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLN_CFLAGS = @CLN_CFLAGS@ CLN_LIBS = @CLN_LIBS@ CLN_RPATH = @CLN_RPATH@ CONFIG_EXCOMPILER = @CONFIG_EXCOMPILER@ CONFIG_RUSAGE = @CONFIG_RUSAGE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVIPS = @DVIPS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FIG2DEV = @FIG2DEV@ GINACLIB_RPATH = @GINACLIB_RPATH@ GINSH_LIBS = @GINSH_LIBS@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LATEX = @LATEX@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAKEINDEX = @MAKEINDEX@ 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@ PDFLATEX = @PDFLATEX@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YACCEXE = @YACCEXE@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = tutorial reference examples EXTRA_DIST = CMakeLists.txt all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean 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-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: ginac-1.7.8.orig/doc/examples/0000755000000000000000000000000013546717365013041 5ustar ginac-1.7.8.orig/doc/examples/CMakeLists.txt0000644000000000000000000000003613457611471015570 0ustar add_info_file(ginac-examples) ginac-1.7.8.orig/doc/examples/Makefile.am0000644000000000000000000000072513457611471015071 0ustar ## Process this file with automake to produce Makefile.in EXFILES = archive1.cpp compile1.cpp compile2.cpp compile3.cpp lanczos.cpp \ mystring.cpp derivative.cpp TEXI = ginac-examples.texi info_TEXINFOS = $(TEXI) TXT = ginac-examples.txt HTML = ginac-examples.html all: $(EXFILES) ${MAKEINFO} --no-split --no-headers $(srcdir)/$(TEXI) > $(TXT) ${MAKEINFO} --no-split --html $(srcdir)/$(TEXI) CLEANFILES = $(TXT) $(HTML) EXTRA_DIST = $(EXFILES) CMakeLists.txt ginac-1.7.8.orig/doc/examples/Makefile.in0000644000000000000000000006142213541765075015107 0ustar # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/examples ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = AM_V_DVIPS = $(am__v_DVIPS_@AM_V@) am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@) am__v_DVIPS_0 = @echo " DVIPS " $@; am__v_DVIPS_1 = AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@) am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@) am__v_MAKEINFO_0 = @echo " MAKEINFO" $@; am__v_MAKEINFO_1 = AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@) am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@) am__v_INFOHTML_0 = @echo " INFOHTML" $@; am__v_INFOHTML_1 = AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@) am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@) am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@; am__v_TEXI2DVI_1 = AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@) am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@) am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@; am__v_TEXI2PDF_1 = AM_V_texinfo = $(am__v_texinfo_@AM_V@) am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@) am__v_texinfo_0 = -q am__v_texinfo_1 = AM_V_texidevnull = $(am__v_texidevnull_@AM_V@) am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) am__v_texidevnull_0 = > /dev/null am__v_texidevnull_1 = INFO_DEPS = $(srcdir)/ginac-examples.info TEXINFO_TEX = $(top_srcdir)/config/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir)/config DVIS = ginac-examples.dvi PDFS = ginac-examples.pdf PSS = ginac-examples.ps HTMLS = ginac-examples.html TEXINFOS = $(TEXI) TEXI2DVI = texi2dvi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__installdirs = "$(DESTDIR)$(infodir)" am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/config/texinfo.tex DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLN_CFLAGS = @CLN_CFLAGS@ CLN_LIBS = @CLN_LIBS@ CLN_RPATH = @CLN_RPATH@ CONFIG_EXCOMPILER = @CONFIG_EXCOMPILER@ CONFIG_RUSAGE = @CONFIG_RUSAGE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVIPS = @DVIPS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FIG2DEV = @FIG2DEV@ GINACLIB_RPATH = @GINACLIB_RPATH@ GINSH_LIBS = @GINSH_LIBS@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LATEX = @LATEX@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAKEINDEX = @MAKEINDEX@ 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@ PDFLATEX = @PDFLATEX@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YACCEXE = @YACCEXE@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXFILES = archive1.cpp compile1.cpp compile2.cpp compile3.cpp lanczos.cpp \ mystring.cpp derivative.cpp TEXI = ginac-examples.texi info_TEXINFOS = $(TEXI) TXT = ginac-examples.txt HTML = ginac-examples.html CLEANFILES = $(TXT) $(HTML) EXTRA_DIST = $(EXFILES) CMakeLists.txt all: all-am .SUFFIXES: .SUFFIXES: .dvi .html .info .pdf .ps .texi $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/examples/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs .texi.info: $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $<; \ then \ rc=0; \ $(am__cd) $(srcdir); \ else \ rc=$$?; \ $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc .texi.dvi: $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ $< .texi.pdf: $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ $< .texi.html: $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $(@:.html=.htp) $<; \ then \ rm -rf $@ && mv $(@:.html=.htp) $@; \ else \ rm -rf $(@:.html=.htp); exit 1; \ fi $(srcdir)/ginac-examples.info: ginac-examples.texi ginac-examples.dvi: ginac-examples.texi ginac-examples.pdf: ginac-examples.texi ginac-examples.html: ginac-examples.texi .dvi.ps: $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) $(AM_V_texinfo) -o $@ $< uninstall-dvi-am: @$(NORMAL_UNINSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ rm -f "$(DESTDIR)$(dvidir)/$$f"; \ done uninstall-html-am: @$(NORMAL_UNINSTALL) @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ done uninstall-info-am: @$(PRE_UNINSTALL) @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done uninstall-pdf-am: @$(NORMAL_UNINSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ done uninstall-ps-am: @$(NORMAL_UNINSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ rm -f "$(DESTDIR)$(psdir)/$$f"; \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ if test -f $$file; then \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f "$(distdir)/$$relfile" || \ cp -p $$file "$(distdir)/$$relfile"; \ else :; fi; \ done; \ done mostlyclean-aminfo: -rm -rf ginac-examples.t2d ginac-examples.t2p clean-aminfo: -test -z "ginac-examples.dvi ginac-examples.pdf ginac-examples.ps \ ginac-examples.html" \ || rm -rf ginac-examples.dvi ginac-examples.pdf ginac-examples.ps \ ginac-examples.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info check-am: all-am check: check-am all-am: Makefile $(INFO_DEPS) installdirs: for dir in "$(DESTDIR)$(infodir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-aminfo clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: $(DVIS) html: html-am html-am: $(HTMLS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-info-am install-dvi: install-dvi-am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ done install-exec-am: install-html: install-html-am install-html-am: $(HTMLS) @$(NORMAL_INSTALL) @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ d2=$$d$$p; \ if test -d "$$d2"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ else \ list2="$$list2 $$d2"; \ fi; \ done; \ test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ done; } install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ fi; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ echo "$$ifile"; \ else : ; fi; \ done; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done @$(POST_INSTALL) @if $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ done; \ else : ; fi install-man: install-pdf: install-pdf-am install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done install-ps: install-ps-am install-ps-am: $(PSS) @$(NORMAL_INSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ uninstall-pdf-am uninstall-ps-am .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-aminfo clean-generic \ clean-libtool cscopelist-am ctags-am dist-info 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-aminfo maintainer-clean-generic mostlyclean \ mostlyclean-aminfo mostlyclean-generic mostlyclean-libtool pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am \ uninstall-dvi-am uninstall-html-am uninstall-info-am \ uninstall-pdf-am uninstall-ps-am .PRECIOUS: Makefile all: $(EXFILES) ${MAKEINFO} --no-split --no-headers $(srcdir)/$(TEXI) > $(TXT) ${MAKEINFO} --no-split --html $(srcdir)/$(TEXI) # 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: ginac-1.7.8.orig/doc/examples/archive1.cpp0000644000000000000000000000150713457611471015242 0ustar /* * Archiving code example from the tutorial */ #include using namespace std; #include using namespace GiNaC; int main() { symbol x("x"), y("y"), z("z"); // do some math ex foo = sin(x + 2*y) + 3*z + 41; ex bar = foo + 1; // write the archive archive a; a.archive_ex(foo, "foo"); a.archive_ex(bar, "the second one"); ofstream out("foobar.gar"); out << a; out.close(); // read in the archive archive a2; ifstream in("foobar.gar"); in >> a2; lst syms; syms = x, y; ex ex1 = a2.unarchive_ex(syms, "foo"); ex ex2 = a2.unarchive_ex(syms, "the second one"); // do some math again cout << ex1 << endl; // prints "41+sin(x+2*y)+3*z" cout << ex2 << endl; // prints "42+sin(x+2*y)+3*z" cout << ex1.subs(x == 2) << endl; // prints "41+sin(2+2*y)+3*z" } ginac-1.7.8.orig/doc/examples/compile1.cpp0000644000000000000000000000313413457611471015247 0ustar #include #include using namespace std; #include using namespace GiNaC; /* * Demonstrates the use of compile_ex. * * Compiles a small expression as C code via compile_ex and evaluates the * expression numerically. The evalation speed is timed and compared to the * evaluation of the original GiNaC expression. * */ int main() { // Define some expression symbol x("x"); ex expr = sin(x); // Some variables for timing time_t start, end; double cpu_time_used; // Our function pointer that points to the compiled ex FUNCP_1P fp; // Optionally, compile with custom compiler flags: // setenv("CXXFLAGS", "-O3 -fomit-frame-pointer -ffast-math", 1); compile_ex(expr, x, fp); // Do some (not necessarily meaningful ;-)) numerical stuff ... cout << "Doing numerics with compile_ex ..." << endl; // First using compile_ex { double result; double point = 0.2; start = clock(); for (int i=0; i<100000; ++i) { point += 0.001; result += fp(point); } end = clock(); // Show the result cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC; cout << "result = " << result << " in " << cpu_time_used << " seconds" << endl; } cout << "Doing numerics without compile_ex ..." << endl; // Then without compile_ex { ex result; ex point = 0.2; start = clock(); for (int i=0; i<100000; ++i) { point += 0.001; result += sin(point); } end = clock(); // Show the other result cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC; cout << "result = " << result << " in " << cpu_time_used << " seconds" << endl; } return 0; } ginac-1.7.8.orig/doc/examples/compile2.cpp0000644000000000000000000000314513457611471015252 0ustar #include using namespace std; #include using namespace GiNaC; // Yes, we are using CUBA (should be installed on the system!) #include /* * Demonstrates the use of compile_ex with the CUBA library. * * The user can enter an expression on the command line. This expression is * compiled via compile_ex and integrated over the region 0 <= x,y <= 1 with * the help of the CUBA library (http://www.feynarts.de/cuba). * */ int main() { // Let the user enter a expression symbol x("x"), y("y"); string s; cout << "Enter an expression containing 'x' and/or 'y': "; cin >> s; // Expression now in expr ex expr(s, lst{x,y}); cout << "start integration of " << expr << " ..." << endl; // Some definitions for VEGAS #define NDIM 2 #define NCOMP 1 #define EPSREL 1e-3 #define EPSABS 1e-12 #define VERBOSE 0 #define MINEVAL 0 #define MAXEVAL 50000 #define NSTART 1000 #define NINCREASE 500 // Some variables for VEGAS int comp, nregions, neval, fail; double integral[NCOMP], error[NCOMP], prob[NCOMP]; // Our function pointer that points to the compiled ex FUNCP_CUBA fp; // Optionally, compile with custom compiler flags: // setenv("CXXFLAGS", "-O3 -fomit-frame-pointer -ffast-math", 1); compile_ex(lst{expr}, lst{x,y}, fp); // Starting VEGAS // By invocation of compile() the expression in expr is converted into the // appropriate function pointer Vegas(NDIM, NCOMP, fp, EPSREL, EPSABS, VERBOSE, MINEVAL, MAXEVAL, NSTART, NINCREASE, &neval, &fail, integral, error, prob); // Show the result cout << "result: " << integral[0] << endl; return 0; } ginac-1.7.8.orig/doc/examples/compile3.cpp0000644000000000000000000000210513457611471015246 0ustar #include #include using namespace std; #include using namespace GiNaC; /* * Demonstrates the use of link_ex. * * When run for the first time link_ex will fail. This is a rude way of * checking whether the needed .so file is available. The .so is then created * by compile_ex using the filename parameter. When run again link_ex will use * the existing .so file. * */ int main() { FUNCP_2P fp; try { link_ex("compile3_testprg.so", fp); cout << "Using existing 'compile3_testprg.so'." << endl; } catch (const std::exception& e) { // hope the exception is just raised because of missing 'compile2_testprg.so' file, // so being lazy no error management here ... cout << "Error: " << e.what() << endl; cout << "Building new 'compile3_testprg.so'." << endl; symbol a, b; ex expr = a*b; // Optionally, compile with custom compiler flags: // setenv("CXXFLAGS", "-O3 -fomit-frame-pointer -ffast-math", 1); compile_ex(expr, a, b, fp, "compile3_testprg"); } cout << "result of 2.3*1.5 is " << fp(2.3, 1.5) << endl; return 0; } ginac-1.7.8.orig/doc/examples/derivative.cpp0000644000000000000000000000131613457611471015700 0ustar // Input expression containing variable 'x' and compute its derivative // with respect to 'x'. // Example from the tutorial (chapter Input/Output, section `Expression // input'). #include #include #include #include using namespace std; using namespace GiNaC; int main() { cout << "Enter an expression containing 'x': " << flush; parser reader; try { ex e = reader(cin); symtab table = reader.get_syms(); symbol x = table.find("x") != table.end() ? ex_to(table["x"]) : symbol("x"); cout << "The derivative of " << e << " with respect to x is "; cout << e.diff(x) << "." << endl; } catch (exception &p) { cerr << p.what() << endl; } } ginac-1.7.8.orig/doc/examples/ginac-examples.info0000644000000000000000000000361113546714216016604 0ustar This is ginac-examples.info, produced by makeinfo version 6.6 from ginac-examples.texi. INFO-DIR-SECTION Mathematics START-INFO-DIR-ENTRY * ginac-examples: (ginac-examples). C++ library for symbolic computation. END-INFO-DIR-ENTRY  File: ginac-examples.info, Node: Top, Up: (dir) GiNaC Examples ************** This is a collection of code examples using GiNaC. 1 Input / Output **************** 1.1 Archiving expressions (source) (archive1.cpp) ================================================= Two expression are stored in an archive on the disk and are restored again. 1.2 Input and output of expressions =================================== 1.2.1 Expression input (source) (derivative.cpp) ------------------------------------------------ Interactively input expression and compute its derivative with respect to the "x" variable. 2 Monte Carlo Integration ************************* 2.1 Example showing compile_ex (source) (compile1.cpp) ====================================================== Simple example showing compile_ex with one free variable. Timing between CLN and C double numerics is done. 2.2 Using VEGAS from CUBA (source) (compile2.cpp) ================================================= An expression in two variables is integrated by using VEGAS from the CUBA library (http://www.feynarts.de/cuba/). 2.3 Example showing link_ex (source) (compile3.cpp) =================================================== Demonstrates the use of link_ex. Program has to be called more than once to see the effect. 3 Lanczos Approximation *********************** The program lanczos.cpp calculates coefficients for use in the Lanczos approximation of the gamma function. The Lanczos approximation is used by the function inside GiNaC that approximates the gamma function numerically. See the comments in the source file for more information.  Tag Table: Node: Top251  End Tag Table ginac-1.7.8.orig/doc/examples/ginac-examples.texi0000644000000000000000000000351713457611471016627 0ustar \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename ginac-examples.info @settitle GiNaC Examples @afourpaper @c For `info' only. @paragraphindent 0 @c For TeX only. @iftex @c I hate putting "@noindent" in front of every paragraph. @parindent=0pt @end iftex @c %**end of header @dircategory Mathematics @direntry * ginac-examples: (ginac-examples). C++ library for symbolic computation. @end direntry @ifnottex @node Top @end ifnottex @finalout @c finalout prevents ugly black rectangles on overfull hbox lines @majorheading GiNaC Examples This is a collection of code examples using GiNaC. @contents @chapter Input / Output @section Archiving expressions @uref{archive1.cpp, (source)} Two expression are stored in an archive on the disk and are restored again. @section Input and output of expressions @subsection Expression input @uref{derivative.cpp, (source)} Interactively input expression and compute its derivative with respect to the ``x'' variable. @chapter Monte Carlo Integration @section Example showing compile_ex @uref{compile1.cpp, (source)} Simple example showing compile_ex with one free variable. Timing between CLN and C double numerics is done. @section Using VEGAS from CUBA @uref{compile2.cpp, (source)} An expression in two variables is integrated by using VEGAS from the @uref{http://www.feynarts.de/cuba/, CUBA library}. @section Example showing link_ex @uref{compile3.cpp, (source)} Demonstrates the use of link_ex. Program has to be called more than once to see the effect. @chapter Lanczos Approximation The program lanczos.cpp calculates coefficients for use in the Lanczos approximation of the gamma function. The Lanczos approximation is used by the function inside GiNaC that approximates the gamma function numerically. See the comments in the source file for more information. @bye ginac-1.7.8.orig/doc/examples/lanczos.cpp0000644000000000000000000001636213457611471015216 0ustar /* * This program can be used to find the coefficients needed to approximate * the gamma function using the Lanczos approximation. * * Usage: lanczos -n order -D digits * * The order defaults to 10. digits defaults to GiNaCs default. * It is recommended to run the program several times with an increasing * value for digits until numerically stablilty for the values has been * reached. The program will also print the number of digits for which * the approximation is still reliable. This will be lower then the * number of digits given at command line. It is determined by comparing * Gamma(1/2) to sqrt(Pi). Note that the program may crash if the number of * digits is unreasonably small for the given order. Another thing that * can happen if the number of digits is too small is that the program will * print "Forget it, this is waaaaaaay too inaccurate." at the top of the * output. * * The gamma function can be (for real_part(z) > -1/2) calculated using * * Gamma(z+1) = sqrt(2*Pi)*power(z+g+ex(1)/2, z+ex(1)/2)*exp(-(z+g+ex(1)/2)) * *A_g(z), * where, * * A_g(z) = coeff[0] + coeff[1]/(z+1) + coeff[2]/(z+2) + ... * + coeff[N-1]/(z+N-1). * * The value of g is taken to be equal to the order N. * * More details can be found at Wikipedia: * http://en.wikipedia.org/wiki/Lanczos_approximation. * * (C) 2006 Chris Dams * * 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 */ #include #include // for size_t #include #include #include #include #include #include #include #include using namespace std; using namespace cln; /* * Chebyshev polynomial coefficient matrix as far as is required for * the Lanczos approximation. */ void calc_chebyshev(vector>& C, const size_t size) { C.reserve(size); for (size_t i=0; i(size, 0)); C[1][1] = cl_I(1); C[2][2] = cl_I(1); for (size_t i=3; i>& C) { const float_format_t prec = float_format(g); const cl_F sqrtPi = sqrt(pi(prec)); cl_F result = cl_float(0, prec); result = result + (2*C[2*k+1][1])*recip(sqrtPi)* recip(sqrt(2*g+1))*exp(g+cl_RA(1)/2); for (size_t a=1; a <= k; ++a) result = result + (2*C[2*k+1][2*a+1]*doublefactorial(2*a-1))*recip(sqrtPi)* recip(expt(2*cl_I(a)+2*g+1, a))*recip(sqrt(2*cl_I(a)+2*g+1))* exp(cl_I(a)+g+cl_RA(1)/2); return result; } /* * Calculate coefficients that occurs in the expression for the * Lanczos approximation of order n. */ void calc_lanczos_coeffs(vector& lanc, const cln::cl_F& g) { const size_t n = lanc.size(); vector> C; calc_chebyshev(C, 2*n+2); // \Pi_{i=1}^n (z-i+1)/(z+i) = \Pi_{i=1}^n (1 - (2i-1)/(z+i)) // Such a product can be rewritten as multivariate polynomial \in // Q[1/(z+1),...1/(z+n)] of degree 1. To store coefficients of this // polynomial we use vector, so the set of such polynomials is // stored as vector> fractions(n); // xi = 1/(z+i) fractions[0] = vector(1); fractions[0][0] = cl_I(1); fractions[1] = fractions[0]; fractions[1].push_back(cl_I(-1)); // 1 - 1/(z+1) for (size_t i=2; i p_cache(n); for (size_t i=0; i < n; i++) p_cache[i] = p(i, g, C); lanc[0] = p_cache[0]/2; float_format_t prec = float_format(g); // A = p(i, g, C)*fraction[i] = p(i, g, C)*F[i][j]*xj, for (size_t j=1; j < n; ++j) { lanc[j] = cl_float(0, prec); lanc[0] = lanc[0] + p_cache[j]; for (size_t i=j; i < n; i++) lanc[j] = lanc[j] + p_cache[i]*fractions[i][j]; } } /* * Calculate Gamma(z) using the Lanczos approximation with parameter g and * coefficients stored in the exvector coeffs. */ const cl_N calc_gamma(const cl_N& z, const cl_F& g, const vector& lanc) { const cl_F thePi = pi(float_format(g)); // XXX: need to check if z is floating-point and precision of z // matches one of g if (realpart(z) < 0.5) return (thePi/sin(thePi*z))/calc_gamma(1-z, g, lanc); cl_N A = lanc[0]; for (size_t i=1; i < lanc.size(); ++i) A = A + lanc[i]/(z-1+i); cl_N result = sqrt(2*thePi)*expt(z+g-cl_RA(1)/2, z-cl_RA(1)/2)* exp(-(z+g-cl_RA(1)/2))*A; return result; } void usage(char *progname) { cout << "Usage: " << progname << " -n order -D digits" << endl; exit(0); } void read_options(int argc, char**argv, int &order, int& digits) { int c; while((c=getopt(argc,argv,"n:D:"))!=-1) { if(c=='n') order = atoi(optarg); else if (c=='D') digits = atoi(optarg); else usage(argv[0]); } if(optind!=argc) usage(argv[0]); } int main(int argc, char *argv[]) { /* * Handle command line options. */ int order = 10; int digits_ini = 17; read_options(argc, argv, order, digits_ini); float_format_t prec = float_format(digits_ini); const cl_F thePi = pi(prec); /* * Calculate coefficients. */ const cl_F g_val = cl_float(order, prec); vector coeffs(order); calc_lanczos_coeffs(coeffs, g_val); /* * Determine the accuracy by comparing Gamma(1/2) to sqrt(Pi). */ cl_N gamma_half = calc_gamma(cl_float(cl_RA(1)/2, prec), g_val, coeffs); cl_F digits = (ln(thePi)/2 - ln(abs(gamma_half - sqrt(thePi))))/ln(cl_float(10, prec)); int i_digits = cl_I_to_int(floor1(digits)); if (digits < cl_I(1)) cout << "Forget it, this is waaaaaaay too inaccurate." << endl; else cout << "Reliable digits: " << i_digits << endl; /* * Print the coefficients. */ for (size_t i=0; i #include #include using namespace std; #include using namespace GiNaC; class mystring : public basic { GINAC_DECLARE_REGISTERED_CLASS(mystring, basic) public: mystring(const string &s); ex eval(int level) const override; private: string str; protected: void do_print(const print_context &c, unsigned level = 0) const; }; GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(mystring, basic, print_func(&mystring::do_print)) // ctors mystring::mystring() { } mystring::mystring(const string &s) : str(s) { } // comparison int mystring::compare_same_type(const basic &other) const { const mystring &o = static_cast(other); int cmpval = str.compare(o.str); if (cmpval == 0) return 0; else if (cmpval < 0) return -1; else return 1; } // printing void mystring::do_print(const print_context &c, unsigned level) const { // print_context::s is a reference to an ostream c.s << '\"' << str << '\"'; } /** * evaluation: all strings automatically converted to lowercase with * non-alphabetic characters stripped, and empty strings removed */ ex mystring::eval(int level) const { string new_str; for (size_t i=0; i= 'A' && c <= 'Z') new_str += tolower(c); else if (c >= 'a' && c <= 'z') new_str += c; } if (new_str.length() == 0) return 0; else return mystring(new_str).hold(); } int main(int argc, char** argv) { ex e = mystring("Hello, world!"); cout << is_a(e) << endl; cout << ex_to(e).class_name() << endl; cout << e << endl; ex another = pow(mystring("One string"), 2*sin(Pi-mystring("Another string"))); cout << another << endl; return 0; } ginac-1.7.8.orig/doc/reference/0000755000000000000000000000000013546717365013161 5ustar ginac-1.7.8.orig/doc/reference/CMakeLists.txt0000644000000000000000000000266213457611471015717 0ustar set(VERSION ${GINAC_VERSION}) set(top_srcdir ${CMAKE_SOURCE_DIR}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DoxyfileHTML.in ${CMAKE_CURRENT_BINARY_DIR}/DoxyfileHTML @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DoxyfilePDF.in ${CMAKE_CURRENT_BINARY_DIR}/DoxyfilePDF @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DoxyfileTEX.in ${CMAKE_CURRENT_BINARY_DIR}/DoxyfileTEX @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfooter.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfooter @ONLY) add_custom_target(html_dox COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/DoxyfileHTML WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "DOXYGEN DoxyfileHTML") add_dependencies(html html_dox) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pdflatex/refman.tex COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/DoxyfilePDF WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "DOXYGEN DoxyfilePDF") add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/pdflatex/reference.tex COMMAND ${CMAKE_COMMAND} -E copy refman.tex reference.tex DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/pdflatex/refman.tex WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pdflatex) if (LATEX_FOUND) pdflatex_process(${CMAKE_CURRENT_BINARY_DIR}/pdflatex/reference.tex) add_custom_target(pdf_dox DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/pdflatex/reference.pdf) add_dependencies(pdf pdf_dox) endif() ginac-1.7.8.orig/doc/reference/DoxyfileHTML.in0000644000000000000000000013126613457611471015762 0ustar # Doxyfile 1.3.6 # 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 #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = GiNaC # 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 = @VERSION@ # 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 = # 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: # Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, # Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en # (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, # Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # This tag can be used to specify the encoding used in the generated output. # The encoding is not always determined by the language that is chosen, # but also whether or not the output is meant for Windows or non-Windows users. # In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES # forces the Windows encoding (this is the default for the Windows binary), # whereas setting the tag to NO uses a Unix-style encoding (the default for # all platforms other than Windows). USE_WINDOWS_ENCODING = NO # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is used # as the annotated text. Otherwise, the brief description is used as-is. If left # blank, the following values are used ("$name" is automatically replaced with the # name of the entity): "The $name class" "The $name widget" "The $name file" # "is" "provides" "specifies" "contains" "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited # members of a class in the documentation of that class as if those members were # ordinary class members. Constructors, destructors and assignment operators of # the base classes will not be shown. INLINE_INHERITED_MEMB = NO # 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. It is allowed to use relative paths in the argument list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_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 the Qt-style comments (thus requiring an # explicit @brief command for a brief description. JAVADOC_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 DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = 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 member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # 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 = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources # only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the 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 #--------------------------------------------------------------------------- # 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 = YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = 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_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 = NO # 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 = NO # 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 = NO # 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= NO # 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 #--------------------------------------------------------------------------- # 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 = NO # 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 # 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. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = @top_srcdir@/ginac # 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 FILE_PATTERNS = *.cpp \ *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories # that are symbolic links (a Unix filesystem feature) are excluded from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. INPUT_FILTER = # 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 = YES # 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 (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # 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 = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html_files # 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 = Doxyfooter # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the 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 compressed 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 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 # 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 # If the GENERATE_TREEVIEW tag 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 (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = 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 #--------------------------------------------------------------------------- # 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. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = 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 #--------------------------------------------------------------------------- # 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 = YES # 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_PREDEFINED tags. EXPAND_ONLY_PREDEF = YES # 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 = *.h # 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. PREDEFINED = "GINAC_DECLARE_REGISTERED_CLASS_NO_CTORS(class, base)=" \ "GINAC_DECLARE_REGISTERED_CLASS(class, base)=" # 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 # 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 # 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 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 = YES # 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 tags 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 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 # 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 on 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 MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_WIDTH = 1024 # The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_HEIGHT = 1024 # 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 a graph may be further truncated if the graph's image dimensions are # not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). # If 0 is used for the depth value (the default), the graph is not depth-constrained. MAX_DOT_GRAPH_DEPTH = 0 # 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 #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO ginac-1.7.8.orig/doc/reference/DoxyfilePDF.in0000644000000000000000000013125713546713720015626 0ustar # Doxyfile 1.3.6 # 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 #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = GiNaC # 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 = @VERSION@ # 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 = # 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: # Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, # Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en # (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, # Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # This tag can be used to specify the encoding used in the generated output. # The encoding is not always determined by the language that is chosen, # but also whether or not the output is meant for Windows or non-Windows users. # In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES # forces the Windows encoding (this is the default for the Windows binary), # whereas setting the tag to NO uses a Unix-style encoding (the default for # all platforms other than Windows). USE_WINDOWS_ENCODING = NO # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is used # as the annotated text. Otherwise, the brief description is used as-is. If left # blank, the following values are used ("$name" is automatically replaced with the # name of the entity): "The $name class" "The $name widget" "The $name file" # "is" "provides" "specifies" "contains" "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited # members of a class in the documentation of that class as if those members were # ordinary class members. Constructors, destructors and assignment operators of # the base classes will not be shown. INLINE_INHERITED_MEMB = NO # 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. It is allowed to use relative paths in the argument list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_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 the Qt-style comments (thus requiring an # explicit @brief command for a brief description. JAVADOC_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 DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = 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 member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # 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 = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources # only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the 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 #--------------------------------------------------------------------------- # 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 = YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = 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_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 = NO # 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 = NO # 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 = NO # 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= NO # 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 #--------------------------------------------------------------------------- # 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 = NO # 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 # 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. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = @top_srcdir@/ginac # 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 FILE_PATTERNS = *.cpp \ *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories # that are symbolic links (a Unix filesystem feature) are excluded from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. INPUT_FILTER = # 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 (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # 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 = YES # 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 = NO # 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 = . # 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 = Doxyfooter # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the 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 compressed 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 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 # 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 # If the GENERATE_TREEVIEW tag 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 (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = 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 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = pdflatex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = YES # 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_PREDEFINED tags. EXPAND_ONLY_PREDEF = YES # 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 = *.h # 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. PREDEFINED = "GINAC_DECLARE_REGISTERED_CLASS_NO_CTORS(class, base)=" \ "GINAC_DECLARE_REGISTERED_CLASS(class, base)=" # 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 # 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 # 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 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 = YES # 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 = NO # 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 = NO # If the CALL_GRAPH and HAVE_DOT tags 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 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 # 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 on 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 MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_WIDTH = 1024 # The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_HEIGHT = 1024 # 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 a graph may be further truncated if the graph's image dimensions are # not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). # If 0 is used for the depth value (the default), the graph is not depth-constrained. MAX_DOT_GRAPH_DEPTH = 0 # 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 #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO ginac-1.7.8.orig/doc/reference/DoxyfileTEX.in0000644000000000000000000013125213457611471015651 0ustar # Doxyfile 1.3.6 # 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 #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = GiNaC # 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 = @VERSION@ # 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 = # 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: # Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, # Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en # (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, # Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # This tag can be used to specify the encoding used in the generated output. # The encoding is not always determined by the language that is chosen, # but also whether or not the output is meant for Windows or non-Windows users. # In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES # forces the Windows encoding (this is the default for the Windows binary), # whereas setting the tag to NO uses a Unix-style encoding (the default for # all platforms other than Windows). USE_WINDOWS_ENCODING = NO # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is used # as the annotated text. Otherwise, the brief description is used as-is. If left # blank, the following values are used ("$name" is automatically replaced with the # name of the entity): "The $name class" "The $name widget" "The $name file" # "is" "provides" "specifies" "contains" "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited # members of a class in the documentation of that class as if those members were # ordinary class members. Constructors, destructors and assignment operators of # the base classes will not be shown. INLINE_INHERITED_MEMB = NO # 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. It is allowed to use relative paths in the argument list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_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 the Qt-style comments (thus requiring an # explicit @brief command for a brief description. JAVADOC_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 DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = 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 member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # 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 = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources # only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the 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 #--------------------------------------------------------------------------- # 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 = YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = 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_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 = NO # 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 = NO # 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 = NO # 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= NO # 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 #--------------------------------------------------------------------------- # 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 = NO # 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 # 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. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = @top_srcdir@/ginac # 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 FILE_PATTERNS = *.cpp \ *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories # that are symbolic links (a Unix filesystem feature) are excluded from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. INPUT_FILTER = # 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 (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # 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 = YES # 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 = NO # 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 = . # 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 = Doxyfooter # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the 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 compressed 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 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 # 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 # If the GENERATE_TREEVIEW tag 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 (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = 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 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = 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 #--------------------------------------------------------------------------- # 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 = YES # 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_PREDEFINED tags. EXPAND_ONLY_PREDEF = YES # 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 = *.h # 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. PREDEFINED = "GINAC_DECLARE_REGISTERED_CLASS_NO_CTORS(class, base)=" \ "GINAC_DECLARE_REGISTERED_CLASS(class, base)=" # 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 # 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 # 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 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 = YES # 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 = NO # 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 = NO # If the CALL_GRAPH and HAVE_DOT tags 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 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 # 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 on 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 MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_WIDTH = 1024 # The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_HEIGHT = 1024 # 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 a graph may be further truncated if the graph's image dimensions are # not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). # If 0 is used for the depth value (the default), the graph is not depth-constrained. MAX_DOT_GRAPH_DEPTH = 0 # 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 #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO ginac-1.7.8.orig/doc/reference/Doxyfooter.in0000644000000000000000000000046713457611471015652 0ustar
This page is part of the GiNaC developer's reference. It was generated automatically by doxygen. For an introduction, see the tutorial. ginac-1.7.8.orig/doc/reference/Makefile.am0000644000000000000000000000352513457611471015212 0ustar ## Process this file with automake to produce Makefile.in # Targets if CONFIG_DOXYGEN html: html_files/index.html if CONFIG_TEX dvi: reference.dvi ps: reference.ps pdf: reference.pdf endif # This section produces HTML'ed and TeX'ed developer's reference from the # sources with a JavaDoc-like tool (in this case doxygen): html_files:: @[ -d html_files ] || mkdir html_files >/dev/null 2>&1 html_files/index.html: @echo "Running ${DOXYGEN} DoxyfileHTML..."; \ ${DOXYGEN} DoxyfileHTML if CONFIG_TEX latex:: @[ -d latex ] || mkdir latex >/dev/null 2>&1 latex/reference.tex: @echo "Running ${DOXYGEN} DoxyfileTEX..."; \ ${DOXYGEN} DoxyfileTEX; \ mv latex/refman.tex latex/reference.tex latex/reference.dvi: latex/reference.tex @set -e ;\ cd latex; \ ${LATEX} reference.tex ; \ ${MAKEINDEX} reference.idx ; \ ${LATEX} reference.tex latex/reference.ps: latex/reference.dvi @echo "Running ${DVIPS} -o reference.ps reference.dvi..."; \ cd latex; ${DVIPS} -o reference.ps reference.dvi pdflatex:: @[ -d pdflatex ] || mkdir pdflatex >/dev/null 2>&1 pdflatex/reference.tex: @echo "Running ${DOXYGEN} DoxyfilePDF..."; \ ${DOXYGEN} DoxyfilePDF; \ mv pdflatex/refman.tex pdflatex/reference.tex pdflatex/reference.pdf: pdflatex/reference.tex @set -e ; \ cd pdflatex; \ ${PDFLATEX} reference.tex ;\ ${MAKEINDEX} reference.idx ;\ ${PYTHON} $(abs_top_srcdir)/scripts/fixupind.py reference.ind; \ ${PDFLATEX} reference.tex reference.dvi: latex latex/reference.dvi cp latex/reference.dvi reference.dvi reference.ps: latex latex/reference.ps cp latex/reference.ps reference.ps reference.pdf: pdflatex pdflatex/reference.pdf cp pdflatex/reference.pdf reference.pdf endif ## CONFIG_TEX endif ## CONFIG_DOXYGEN CLEANFILES = reference.dvi reference.ps reference.pdf html_files/* latex/* pdflatex/* EXTRA_DIST = CMakeLists.txt ginac-1.7.8.orig/doc/reference/Makefile.in0000644000000000000000000004131613541765075015227 0ustar # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/reference ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = DoxyfileHTML DoxyfileTEX DoxyfilePDF Doxyfooter CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/DoxyfileHTML.in $(srcdir)/DoxyfilePDF.in \ $(srcdir)/DoxyfileTEX.in $(srcdir)/Doxyfooter.in \ $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLN_CFLAGS = @CLN_CFLAGS@ CLN_LIBS = @CLN_LIBS@ CLN_RPATH = @CLN_RPATH@ CONFIG_EXCOMPILER = @CONFIG_EXCOMPILER@ CONFIG_RUSAGE = @CONFIG_RUSAGE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVIPS = @DVIPS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FIG2DEV = @FIG2DEV@ GINACLIB_RPATH = @GINACLIB_RPATH@ GINSH_LIBS = @GINSH_LIBS@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LATEX = @LATEX@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAKEINDEX = @MAKEINDEX@ 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@ PDFLATEX = @PDFLATEX@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YACCEXE = @YACCEXE@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ CLEANFILES = reference.dvi reference.ps reference.pdf html_files/* latex/* pdflatex/* EXTRA_DIST = CMakeLists.txt all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/reference/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/reference/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): DoxyfileHTML: $(top_builddir)/config.status $(srcdir)/DoxyfileHTML.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ DoxyfileTEX: $(top_builddir)/config.status $(srcdir)/DoxyfileTEX.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ DoxyfilePDF: $(top_builddir)/config.status $(srcdir)/DoxyfilePDF.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ Doxyfooter: $(top_builddir)/config.status $(srcdir)/Doxyfooter.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic @CONFIG_DOXYGEN_FALSE@dvi: dvi-am @CONFIG_TEX_FALSE@dvi: dvi-am dvi-am: @CONFIG_DOXYGEN_FALSE@html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool @CONFIG_DOXYGEN_FALSE@pdf: pdf-am @CONFIG_TEX_FALSE@pdf: pdf-am pdf-am: @CONFIG_DOXYGEN_FALSE@ps: ps-am @CONFIG_TEX_FALSE@ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am 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 \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Targets @CONFIG_DOXYGEN_TRUE@html: html_files/index.html @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@dvi: reference.dvi @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ps: reference.ps @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@pdf: reference.pdf # This section produces HTML'ed and TeX'ed developer's reference from the # sources with a JavaDoc-like tool (in this case doxygen): @CONFIG_DOXYGEN_TRUE@html_files:: @CONFIG_DOXYGEN_TRUE@ @[ -d html_files ] || mkdir html_files >/dev/null 2>&1 @CONFIG_DOXYGEN_TRUE@html_files/index.html: @CONFIG_DOXYGEN_TRUE@ @echo "Running ${DOXYGEN} DoxyfileHTML..."; \ @CONFIG_DOXYGEN_TRUE@ ${DOXYGEN} DoxyfileHTML @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@latex:: @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ @[ -d latex ] || mkdir latex >/dev/null 2>&1 @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@latex/reference.tex: @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ @echo "Running ${DOXYGEN} DoxyfileTEX..."; \ @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ ${DOXYGEN} DoxyfileTEX; \ @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ mv latex/refman.tex latex/reference.tex @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@latex/reference.dvi: latex/reference.tex @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ @set -e ;\ @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ cd latex; \ @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ ${LATEX} reference.tex ; \ @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ ${MAKEINDEX} reference.idx ; \ @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ ${LATEX} reference.tex @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@latex/reference.ps: latex/reference.dvi @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ @echo "Running ${DVIPS} -o reference.ps reference.dvi..."; \ @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ cd latex; ${DVIPS} -o reference.ps reference.dvi @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@pdflatex:: @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ @[ -d pdflatex ] || mkdir pdflatex >/dev/null 2>&1 @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@pdflatex/reference.tex: @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ @echo "Running ${DOXYGEN} DoxyfilePDF..."; \ @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ ${DOXYGEN} DoxyfilePDF; \ @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ mv pdflatex/refman.tex pdflatex/reference.tex @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@pdflatex/reference.pdf: pdflatex/reference.tex @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ @set -e ; \ @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ cd pdflatex; \ @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ ${PDFLATEX} reference.tex ;\ @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ ${MAKEINDEX} reference.idx ;\ @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ ${PYTHON} $(abs_top_srcdir)/scripts/fixupind.py reference.ind; \ @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ ${PDFLATEX} reference.tex @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@reference.dvi: latex latex/reference.dvi @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ cp latex/reference.dvi reference.dvi @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@reference.ps: latex latex/reference.ps @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ cp latex/reference.ps reference.ps @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@reference.pdf: pdflatex pdflatex/reference.pdf @CONFIG_DOXYGEN_TRUE@@CONFIG_TEX_TRUE@ cp pdflatex/reference.pdf reference.pdf # 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: ginac-1.7.8.orig/doc/tutorial/0000755000000000000000000000000013546717365013066 5ustar ginac-1.7.8.orig/doc/tutorial/CMakeLists.txt0000644000000000000000000000406713457611471015625 0ustar configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.texi.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.texi @ONLY) set(_ginac_tutorial_figures classhierarchy repnaive reppair repreal) set(_ginac_tutorial_figures_pdf) set(_ginac_tutorial_figures_png) set(_ginac_tutorial_figures_eps) macro(add_xfig_figure thename) set(${thename}_XFIG ${CMAKE_CURRENT_SOURCE_DIR}/${thename}.fig) set(${thename}_PDF ${CMAKE_CURRENT_BINARY_DIR}/${thename}.pdf) set(${thename}_EPS ${CMAKE_CURRENT_BINARY_DIR}/${thename}.eps) set(${thename}_PNG ${CMAKE_CURRENT_BINARY_DIR}/${thename}.png) list(APPEND _ginac_tutorial_figures_pdf ${${thename}_PDF}) list(APPEND _ginac_tutorial_figures_png ${${thename}_PNG}) list(APPEND _ginac_tutorial_figures_png ${${thename}_EPS}) add_custom_command( OUTPUT ${${thename}_PDF} COMMAND ${FIG2DEV} -L pdf -m 0.9 ${${thename}_XFIG} ${${thename}_PDF} DEPENDS ${${thename}_XFIG} COMMENT "FIG2DEV ${thename}.xfig ==> ${thename}.pdf" VERBATIM) add_custom_command( OUTPUT ${${thename}_EPS} COMMAND ${FIG2DEV} -L eps -m 0.9 ${${thename}_XFIG} ${${thename}_EPS} DEPENDS ${${thename}_XFIG} COMMENT "FIG2DEV ${thename}.xfig ==> ${thename}.eps" VERBATIM) add_custom_command( OUTPUT ${${thename}_PNG} COMMAND ${FIG2DEV} -L png -m 0.9 ${${thename}_XFIG} ${${thename}_PNG} DEPENDS ${${thename}_XFIG} COMMENT "FIG2DEV ${thename}.xfig ==> ${thename}.png" VERBATIM) endmacro() macro(add_doc_format src fmt) set(_out ${CMAKE_CURRENT_BINARY_DIR}/${src}.${fmt}) set(_src ${CMAKE_CURRENT_SOURCE_DIR}/${src}.texi) add_custom_command( OUTPUT ${_out} COMMAND ${TEXI2DVI} --${fmt} --batch -o ${_out} ${_src} DEPENDS ${_src} ${_${src}_tutorial_figures_${fmt}} COMMENT "TEXI2DVI ${src}.texi => ${src}.${fmt}" VERBATIM) add_custom_target(${fmt}_${src}_tutorial DEPENDS ${_out}) add_dependencies(${fmt} ${fmt}_${src}_tutorial) endmacro() if (TEXI2DVI AND FIG2DEV) foreach(_f ${_ginac_tutorial_figures}) add_xfig_figure(${_f}) endforeach() set(ginac_HTML_EXTRA_DEPS ${_ginac_tutorial_figures_png}) add_doc_format(ginac pdf) endif() add_info_file(ginac) ginac-1.7.8.orig/doc/tutorial/Makefile.am0000644000000000000000000000166613457611471015123 0ustar ## Process this file with automake to produce Makefile.in FIG = classhierarchy.fig repnaive.fig reppair.fig repreal.fig info_TEXINFOS = AM_MAKEINFOHTMLFLAGS = --no-split if CONFIG_TEX if CONFIG_FIG2DEV # Graphics file conversion PNG = classhierarchy.png repnaive.png reppair.png repreal.png EPS = classhierarchy.eps repnaive.eps reppair.eps repreal.eps PDF = classhierarchy.pdf repnaive.pdf reppair.pdf repreal.pdf SUFFIXES = .fig .png .eps .fig.eps: echo "Running ${FIG2DEV} -L eps -m 0.9 $< $@..."; \ ${FIG2DEV} -L eps -m 0.9 $< $@; .fig.pdf: echo "Running ${FIG2DEV} -L pdf -m 0.9 $< $@..."; \ ${FIG2DEV} -L pdf -m 0.9 $< $@ .fig.png: @echo "Running ${FIG2DEV} -L png $< $@..."; \ ${FIG2DEV} -L png $< $@ info_TEXINFOS += ginac.texi ginac.pdf: $(PDF) ginac.dvi: $(EPS) ginac.html: $(PNG) CLEANFILES = $(EPS) $(PDF) $(PNG) ## CONFIG_FIG2DEV endif ## CONFIG_TEX endif EXTRA_DIST = $(FIG) CMakeLists.txt version.texi.cmake ginac-1.7.8.orig/doc/tutorial/Makefile.in0000644000000000000000000006564113541765075015143 0ustar # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@am__append_1 = ginac.texi subdir = doc/tutorial ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \ $(srcdir)/stamp-vti $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = AM_V_DVIPS = $(am__v_DVIPS_@AM_V@) am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@) am__v_DVIPS_0 = @echo " DVIPS " $@; am__v_DVIPS_1 = AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@) am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@) am__v_MAKEINFO_0 = @echo " MAKEINFO" $@; am__v_MAKEINFO_1 = AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@) am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@) am__v_INFOHTML_0 = @echo " INFOHTML" $@; am__v_INFOHTML_1 = AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@) am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@) am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@; am__v_TEXI2DVI_1 = AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@) am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@) am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@; am__v_TEXI2PDF_1 = AM_V_texinfo = $(am__v_texinfo_@AM_V@) am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@) am__v_texinfo_0 = -q am__v_texinfo_1 = AM_V_texidevnull = $(am__v_texidevnull_@AM_V@) am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) am__v_texidevnull_0 = > /dev/null am__v_texidevnull_1 = INFO_DEPS = $(srcdir)/ginac.info TEXINFO_TEX = $(top_srcdir)/config/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir)/config DVIS = ginac.dvi PDFS = ginac.pdf PSS = ginac.ps HTMLS = ginac.html TEXINFOS = $(am__append_1) TEXI2DVI = texi2dvi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__installdirs = "$(DESTDIR)$(infodir)" am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/mdate-sh \ $(top_srcdir)/config/texinfo.tex mdate-sh DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLN_CFLAGS = @CLN_CFLAGS@ CLN_LIBS = @CLN_LIBS@ CLN_RPATH = @CLN_RPATH@ CONFIG_EXCOMPILER = @CONFIG_EXCOMPILER@ CONFIG_RUSAGE = @CONFIG_RUSAGE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVIPS = @DVIPS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FIG2DEV = @FIG2DEV@ GINACLIB_RPATH = @GINACLIB_RPATH@ GINSH_LIBS = @GINSH_LIBS@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LATEX = @LATEX@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAKEINDEX = @MAKEINDEX@ 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@ PDFLATEX = @PDFLATEX@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YACCEXE = @YACCEXE@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ FIG = classhierarchy.fig repnaive.fig reppair.fig repreal.fig info_TEXINFOS = $(am__append_1) AM_MAKEINFOHTMLFLAGS = --no-split # Graphics file conversion @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@PNG = classhierarchy.png repnaive.png reppair.png repreal.png @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@EPS = classhierarchy.eps repnaive.eps reppair.eps repreal.eps @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@PDF = classhierarchy.pdf repnaive.pdf reppair.pdf repreal.pdf @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@SUFFIXES = .fig .png .eps @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@CLEANFILES = $(EPS) $(PDF) $(PNG) EXTRA_DIST = $(FIG) CMakeLists.txt version.texi.cmake all: all-am .SUFFIXES: .SUFFIXES: .fig .png .eps .dvi .html .info .pdf .ps .texi $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/tutorial/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/tutorial/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs .texi.info: $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $<; \ then \ rc=0; \ $(am__cd) $(srcdir); \ else \ rc=$$?; \ $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc .texi.dvi: $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ $< .texi.pdf: $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ $< .texi.html: $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $(@:.html=.htp) $<; \ then \ rm -rf $@ && mv $(@:.html=.htp) $@; \ else \ rm -rf $(@:.html=.htp); exit 1; \ fi $(srcdir)/ginac.info: ginac.texi $(srcdir)/version.texi @CONFIG_FIG2DEV_FALSE@ginac.dvi: ginac.texi $(srcdir)/version.texi @CONFIG_TEX_FALSE@ginac.dvi: ginac.texi $(srcdir)/version.texi @CONFIG_FIG2DEV_FALSE@ginac.pdf: ginac.texi $(srcdir)/version.texi @CONFIG_TEX_FALSE@ginac.pdf: ginac.texi $(srcdir)/version.texi @CONFIG_FIG2DEV_FALSE@ginac.html: ginac.texi $(srcdir)/version.texi @CONFIG_TEX_FALSE@ginac.html: ginac.texi $(srcdir)/version.texi $(srcdir)/version.texi: $(srcdir)/stamp-vti $(srcdir)/stamp-vti: ginac.texi $(top_srcdir)/configure @(dir=.; test -f ./ginac.texi || dir=$(srcdir); \ set `$(SHELL) $(top_srcdir)/config/mdate-sh $$dir/ginac.texi`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \ (cmp -s vti.tmp$$$$ $(srcdir)/version.texi \ || (echo "Updating $(srcdir)/version.texi" && \ cp vti.tmp$$$$ $(srcdir)/version.texi.tmp$$$$ && \ mv $(srcdir)/version.texi.tmp$$$$ $(srcdir)/version.texi)) && \ rm -f vti.tmp$$$$ $(srcdir)/version.texi.$$$$ @cp $(srcdir)/version.texi $@ mostlyclean-vti: -rm -f vti.tmp* $(srcdir)/version.texi.tmp* maintainer-clean-vti: -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi .dvi.ps: $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) $(AM_V_texinfo) -o $@ $< uninstall-dvi-am: @$(NORMAL_UNINSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ rm -f "$(DESTDIR)$(dvidir)/$$f"; \ done uninstall-html-am: @$(NORMAL_UNINSTALL) @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ done uninstall-info-am: @$(PRE_UNINSTALL) @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done uninstall-pdf-am: @$(NORMAL_UNINSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ done uninstall-ps-am: @$(NORMAL_UNINSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ rm -f "$(DESTDIR)$(psdir)/$$f"; \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ if test -f $$file; then \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f "$(distdir)/$$relfile" || \ cp -p $$file "$(distdir)/$$relfile"; \ else :; fi; \ done; \ done mostlyclean-aminfo: -rm -rf ginac.t2d ginac.t2p clean-aminfo: -test -z "ginac.dvi ginac.pdf ginac.ps ginac.html" \ || rm -rf ginac.dvi ginac.pdf ginac.ps ginac.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info check-am: all-am check: check-am all-am: Makefile $(INFO_DEPS) installdirs: for dir in "$(DESTDIR)$(infodir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-aminfo clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: $(DVIS) html: html-am html-am: $(HTMLS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-info-am install-dvi: install-dvi-am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ done install-exec-am: install-html: install-html-am install-html-am: $(HTMLS) @$(NORMAL_INSTALL) @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ d2=$$d$$p; \ if test -d "$$d2"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ else \ list2="$$list2 $$d2"; \ fi; \ done; \ test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ done; } install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ fi; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ echo "$$ifile"; \ else : ; fi; \ done; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done @$(POST_INSTALL) @if $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ done; \ else : ; fi install-man: install-pdf: install-pdf-am install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done install-ps: install-ps-am install-ps-am: $(PSS) @$(NORMAL_INSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \ mostlyclean-libtool mostlyclean-vti pdf: pdf-am pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ uninstall-pdf-am uninstall-ps-am .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-aminfo clean-generic \ clean-libtool cscopelist-am ctags-am dist-info 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-aminfo maintainer-clean-generic \ maintainer-clean-vti mostlyclean mostlyclean-aminfo \ mostlyclean-generic mostlyclean-libtool mostlyclean-vti pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am \ uninstall-dvi-am uninstall-html-am uninstall-info-am \ uninstall-pdf-am uninstall-ps-am .PRECIOUS: Makefile @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@.fig.eps: @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@ echo "Running ${FIG2DEV} -L eps -m 0.9 $< $@..."; \ @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@ ${FIG2DEV} -L eps -m 0.9 $< $@; @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@.fig.pdf: @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@ echo "Running ${FIG2DEV} -L pdf -m 0.9 $< $@..."; \ @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@ ${FIG2DEV} -L pdf -m 0.9 $< $@ @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@.fig.png: @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@ @echo "Running ${FIG2DEV} -L png $< $@..."; \ @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@ ${FIG2DEV} -L png $< $@ @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@ginac.pdf: $(PDF) @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@ginac.dvi: $(EPS) @CONFIG_FIG2DEV_TRUE@@CONFIG_TEX_TRUE@ginac.html: $(PNG) # 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: ginac-1.7.8.orig/doc/tutorial/classhierarchy.fig0000644000000000000000000002457113457611471016562 0ustar #FIG 3.2 Landscape Center Metric A4 100.00 Single -2 1200 2 5 1 1 1 0 7 50 0 -1 4.000 0 0 1 0 1912.500 4102.500 945 720 1980 585 2880 720 1 0 1.00 60.00 120.00 6 675 1125 975 2175 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 675 2115 675 1125 945 1125 945 2115 675 2115 4 0 0 50 0 14 10 4.7124 4 135 810 765 1260 expairseq\001 -6 6 1650 1200 2025 2175 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 1665 2115 1665 1260 1935 1260 1935 2115 1665 2115 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 1710 2160 1980 2160 1980 1305 1710 1305 1710 2160 4 0 0 50 0 14 10 4.7124 4 135 630 1755 1395 pseries\001 -6 6 3825 1425 4200 2550 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 3870 2475 3870 1485 4140 1485 4140 2475 3870 2475 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 3915 2520 4185 2520 4185 1530 3915 1530 3915 2520 4 0 0 50 0 14 10 4.7124 4 105 900 3960 1575 relational\001 -6 6 4275 1425 4650 2250 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 4320 2205 4320 1440 4590 1440 4590 2205 4320 2205 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 4365 2250 4635 2250 4635 1485 4365 1485 4365 2250 4 0 0 50 0 14 10 4.7124 4 105 540 4410 1575 matrix\001 -6 6 2400 1200 2700 2025 2 2 0 1 0 7 51 0 20 4.000 0 0 -1 0 0 5 2430 2025 2700 2025 2700 1215 2430 1215 2430 2025 4 0 0 50 0 14 10 4.7124 4 105 630 2520 1350 exprseq\001 -6 6 450 2325 825 3075 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 450 2970 450 2385 720 2385 720 2970 450 2970 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 495 3015 765 3015 765 2430 495 2430 495 3015 4 0 0 50 0 14 10 4.7124 4 105 270 540 2565 add\001 -6 6 1500 2325 1875 3150 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 1575 3150 1845 3150 1845 2430 1575 2430 1575 3150 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 1530 3105 1530 2385 1800 2385 1800 3105 1530 3105 4 0 0 50 0 14 10 4.7124 4 105 450 1620 2520 ncmul\001 -6 6 2025 2325 2400 3375 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 2115 3330 2385 3330 2385 2430 2115 2430 2115 3330 2 2 0 1 0 7 51 0 20 3.000 0 0 -1 0 0 5 2070 3285 2340 3285 2340 2385 2070 2385 2070 3285 4 1 0 50 0 14 10 4.7124 4 105 720 2160 2835 function\001 -6 6 2550 2325 2925 3375 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 2610 3330 2610 2385 2880 2385 2880 3330 2610 3330 4 1 0 50 0 14 10 4.7124 4 105 630 2700 2880 indexed\001 -6 6 2850 525 3600 900 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 2880 585 3600 585 3600 855 2880 855 2880 585 4 0 0 50 0 14 10 0.0000 4 105 450 3015 765 basic\001 -6 6 225 525 975 900 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 270 630 945 630 945 900 270 900 270 630 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 225 585 900 585 900 855 225 855 225 585 4 0 0 50 0 14 10 0.0000 4 75 180 450 765 ex\001 -6 6 2775 1425 3150 2100 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 2880 2070 3150 2070 3150 1485 2880 1485 2880 2070 2 2 0 1 0 7 51 0 20 4.000 0 0 -1 0 0 5 2835 2025 3105 2025 3105 1440 2835 1440 2835 2025 4 0 0 50 0 14 10 4.7124 4 105 270 2925 1620 lst\001 -6 6 3675 2700 3975 3525 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 3690 3510 3690 2745 3960 2745 3960 3510 3690 3510 4 1 0 50 0 14 10 4.7124 4 105 540 3780 3150 tensor\001 -6 6 2775 3600 3150 4725 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 2835 4680 3105 4680 3105 3690 2835 3690 2835 4680 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 2790 4635 2790 3645 3060 3645 3060 4635 2790 4635 4 1 0 50 0 14 10 4.7124 4 105 720 2880 4140 clifford\001 -6 6 900 2325 1275 3075 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 900 2970 900 2385 1170 2385 1170 2970 900 2970 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 945 3015 1215 3015 1215 2430 945 2430 945 3015 4 0 0 50 0 14 10 4.7124 4 105 270 990 2565 mul\001 -6 6 3150 2100 3525 2775 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 3195 2700 3195 2115 3465 2115 3465 2700 3195 2700 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 3240 2745 3510 2745 3510 2160 3240 2160 3240 2745 4 1 0 50 0 14 10 4.7124 4 105 270 3285 2385 idx\001 -6 6 2325 3600 2700 4725 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 2430 4680 2700 4680 2700 3690 2430 3690 2430 4680 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 2385 4635 2385 3645 2655 3645 2655 4635 2385 4635 4 1 0 50 0 14 10 4.7124 4 105 450 2475 4140 color\001 -6 6 3225 3000 3600 3825 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 3240 3735 3240 3015 3510 3015 3510 3735 3240 3735 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 3285 3780 3555 3780 3555 3060 3285 3060 3285 3780 4 1 0 50 0 14 10 4.7124 4 105 540 3330 3375 varidx\001 -6 6 5325 2475 7875 4800 6 6975 3525 7650 4800 6 6975 3525 7575 3825 6 6975 3525 7575 3825 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 6975 3540 7560 3540 7560 3810 6975 3810 6975 3540 4 0 0 50 0 14 10 0.0000 4 105 450 7065 3720 basic\001 -6 -6 6 6975 4425 7575 4800 6 6975 4425 7575 4800 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 6975 4485 7560 4485 7560 4755 6975 4755 6975 4485 4 0 0 50 0 14 10 0.0000 4 75 180 7155 4665 ex\001 -6 -6 2 1 1 1 0 7 50 0 10 4.000 0 0 -1 1 0 2 1 0 1.00 60.00 120.00 7200 4485 7200 3810 4 0 0 50 0 0 10 0.0000 4 105 375 7245 4170 wraps\001 -6 6 5625 3525 6375 4800 6 5625 4425 6225 4800 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 5640 4485 6180 4485 6180 4755 5640 4755 5640 4485 4 0 0 50 0 14 10 0.0000 4 90 90 5865 4665 B\001 -6 6 5625 3525 6225 3825 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 5640 3540 6180 3540 6180 3810 5640 3810 5640 3540 4 0 0 50 0 14 10 0.0000 4 90 90 5865 3720 A\001 -6 6 5775 3750 6225 4500 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 5820 4485 5820 3810 4 0 0 50 0 0 10 0.0000 4 105 105 5865 4035 is\001 4 0 0 50 0 0 10 0.0000 4 105 315 5865 4350 from\001 -6 4 0 0 50 0 0 10 0.0000 4 105 450 5865 4185 derived\001 -6 6 5325 2925 6600 3300 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 5340 2955 6510 2955 6510 3225 5340 3225 5340 2955 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 5385 3000 6555 3000 6555 3270 5385 3270 5385 3000 4 0 0 50 0 1 10 0.0000 4 105 945 5430 3135 container class\001 -6 6 5325 2475 6525 2775 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 5340 2520 6525 2520 6525 2775 5340 2775 5340 2520 4 0 0 50 0 1 10 0.0000 4 105 855 5430 2685 abstract class\001 -6 6 6600 2925 7875 3300 2 4 0 0 0 7 52 0 10 0.000 0 0 7 0 0 5 7830 3270 6660 3270 6660 3000 7830 3000 7830 3270 2 4 0 1 0 7 51 0 20 0.000 0 0 7 0 0 5 7785 3225 6615 3225 6615 2955 7785 2955 7785 3225 4 1 0 50 0 1 10 0.0000 4 105 765 7065 3135 atomic class\001 -6 6 6600 2475 7800 2775 2 2 3 1 0 7 51 0 20 4.000 0 0 -1 0 0 5 6600 2520 7785 2520 7785 2775 6600 2775 6600 2520 4 0 0 50 0 1 10 0.0000 4 150 885 6690 2685 class template\001 -6 -6 6 3600 3825 3975 4800 2 4 0 0 0 7 52 0 10 0.000 0 0 7 0 0 5 3915 3870 3915 4770 3645 4770 3645 3870 3915 3870 2 4 0 1 0 7 51 0 20 0.000 0 0 7 0 0 5 3870 3825 3870 4725 3600 4725 3600 3825 3870 3825 4 1 0 50 0 14 10 4.7124 4 105 810 3690 4275 tensdelta\001 -6 6 1125 1200 1500 2025 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 1170 1980 1440 1980 1440 1260 1170 1260 1170 1980 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 1125 1935 1125 1215 1395 1215 1395 1935 1125 1935 4 0 0 50 0 14 10 4.7124 4 105 450 1215 1395 power\001 -6 6 1650 3600 2025 4725 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 1755 4725 2025 4725 2025 3645 1755 3645 1755 4725 2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 1710 4680 1710 3600 1980 3600 1980 4680 1710 4680 4 0 0 50 0 14 10 4.7124 4 105 990 1800 3645 fderivative\001 -6 6 6375 1050 6750 2025 2 4 0 1 0 7 51 0 20 0.000 0 0 7 0 0 5 6705 1065 6705 1965 6435 1965 6435 1065 6705 1065 2 4 0 0 0 7 52 0 10 0.000 0 0 7 0 0 5 6750 1110 6750 2010 6480 2010 6480 1110 6750 1110 4 1 0 50 0 14 10 4.7124 4 135 540 6525 1515 symbol\001 -6 6 6000 1125 6375 2175 2 4 0 1 0 7 51 0 20 0.000 0 0 7 0 0 5 6285 1170 6285 2070 6015 2070 6015 1170 6285 1170 2 4 0 0 0 7 52 0 10 0.000 0 0 7 0 0 5 6330 1215 6330 2115 6060 2115 6060 1215 6330 1215 4 1 0 50 0 14 10 4.7124 4 105 720 6105 1620 constant\001 -6 6 5550 1275 5925 2250 2 4 0 0 0 7 52 0 10 0.000 0 0 7 0 0 5 5880 1320 5880 2220 5610 2220 5610 1320 5880 1320 2 4 0 1 0 7 51 0 20 0.000 0 0 7 0 0 5 5835 1275 5835 2175 5565 2175 5565 1275 5835 1275 4 1 0 50 0 14 10 4.7124 4 105 630 5655 1725 numeric\001 -6 6 5100 1350 5475 2325 2 4 0 0 0 7 52 0 10 0.000 0 0 7 0 0 5 5430 1395 5430 2295 5160 2295 5160 1395 5430 1395 2 4 0 1 0 7 51 0 20 0.000 0 0 7 0 0 5 5385 1350 5385 2250 5115 2250 5115 1350 5385 1350 4 1 0 50 0 14 10 4.7124 4 105 720 5205 1800 wildcard\001 -6 6 4725 1350 5025 2400 2 2 3 1 0 7 51 0 20 4.000 0 0 -1 0 0 5 4755 2340 4995 2340 4995 1410 4755 1410 4755 2340 4 0 0 50 0 14 10 4.7124 4 105 810 4845 1545 structure\001 -6 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 810 1125 2835 855 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 1260 1215 2880 900 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 1800 1260 3015 900 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 6120 1170 3645 810 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 5698 1275 3645 855 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 5265 1350 3645 900 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 4005 1485 3465 900 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 2970 1440 3195 900 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 4455 1440 3510 900 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 2790 2385 2655 2070 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 2565 1215 3105 900 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 1665 2385 2475 2070 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 2205 2385 2565 2070 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 585 2385 810 2115 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 1035 2385 810 2115 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 3330 2115 3285 900 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 3825 2745 3390 901 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 3735 3825 3790 3517 2 2 0 0 0 7 52 0 10 0.000 0 0 -1 0 0 5 2655 3375 2925 3375 2925 2430 2655 2430 2655 3375 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 2565 3645 2745 3375 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 2925 3645 2790 3375 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 3375 3015 3330 2745 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 6480 1080 3650 740 2 1 0 1 0 7 50 0 10 0.000 0 0 -1 1 0 2 1 1 1.00 45.00 90.00 1836 3593 2205 3330 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 1 1 1.00 60.00 120.00 4869 1410 3555 900 4 0 0 50 0 0 16 0.0000 4 30 180 3150 4275 ...\001 4 0 0 50 0 0 16 0.0000 4 30 180 3960 4365 ...\001 ginac-1.7.8.orig/doc/tutorial/ginac.info0000644000000000000000000120377413546714216015032 0ustar This is ginac.info, produced by makeinfo version 6.6 from ginac.texi. INFO-DIR-SECTION Mathematics START-INFO-DIR-ENTRY * ginac: (ginac). C++ library for symbolic computation. END-INFO-DIR-ENTRY This is a tutorial that documents GiNaC 1.7.8, an open framework for symbolic computation within the C++ programming language. Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.  File: ginac.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) GiNaC ***** This is a tutorial that documents GiNaC 1.7.8, an open framework for symbolic computation within the C++ programming language. * Menu: * Introduction:: GiNaC's purpose. * A tour of GiNaC:: A quick tour of the library. * Installation:: How to install the package. * Basic concepts:: Description of fundamental classes. * Methods and functions:: Algorithms for symbolic manipulations. * Extending GiNaC:: How to extend the library. * A comparison with other CAS:: Compares GiNaC to traditional CAS. * Internal structures:: Description of some internal structures. * Package tools:: Configuring packages to work with GiNaC. * Bibliography:: * Concept index::  File: ginac.info, Node: Introduction, Next: A tour of GiNaC, Prev: Top, Up: Top 1 Introduction ************** The motivation behind GiNaC derives from the observation that most present day computer algebra systems (CAS) are linguistically and semantically impoverished. Although they are quite powerful tools for learning math and solving particular problems they lack modern linguistic structures that allow for the creation of large-scale projects. GiNaC is an attempt to overcome this situation by extending a well established and standardized computer language (C++) by some fundamental symbolic capabilities, thus allowing for integrated systems that embed symbolic manipulations together with more established areas of computer science (like computation-intense numeric applications, graphical interfaces, etc.) under one roof. The particular problem that led to the writing of the GiNaC framework is still a very active field of research, namely the calculation of higher order corrections to elementary particle interactions. There, theoretical physicists are interested in matching present day theories against experiments taking place at particle accelerators. The computations involved are so complex they call for a combined symbolical and numerical approach. This turned out to be quite difficult to accomplish with the present day CAS we have worked with so far and so we tried to fill the gap by writing GiNaC. But of course its applications are in no way restricted to theoretical physics. This tutorial is intended for the novice user who is new to GiNaC but already has some background in C++ programming. However, since a hand-made documentation like this one is difficult to keep in sync with the development, the actual documentation is inside the sources in the form of comments. That documentation may be parsed by one of the many Javadoc-like documentation systems. If you fail at generating it you may access it from the GiNaC home page (http://www.ginac.de/reference/). It is an invaluable resource not only for the advanced user who wishes to extend the system (or chase bugs) but for everybody who wants to comprehend the inner workings of GiNaC. This little tutorial on the other hand only covers the basic things that are unlikely to change in the near future. 1.1 License =========== The GiNaC framework for symbolic computation within the C++ programming language is Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany. 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; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  File: ginac.info, Node: A tour of GiNaC, Next: How to use it from within C++, Prev: Introduction, Up: Top 2 A Tour of GiNaC ***************** This quick tour of GiNaC wants to arise your interest in the subsequent chapters by showing off a bit. Please excuse us if it leaves many open questions. * Menu: * How to use it from within C++:: Two simple examples. * What it can do for you:: A Tour of GiNaC's features.  File: ginac.info, Node: How to use it from within C++, Next: What it can do for you, Prev: A tour of GiNaC, Up: A tour of GiNaC 2.1 How to use it from within C++ ================================= The GiNaC open framework for symbolic computation within the C++ programming language does not try to define a language of its own as conventional CAS do. Instead, it extends the capabilities of C++ by symbolic manipulations. Here is how to generate and print a simple (and rather pointless) bivariate polynomial with some large coefficients: #include #include using namespace std; using namespace GiNaC; int main() { symbol x("x"), y("y"); ex poly; for (int i=0; i<3; ++i) poly += factorial(i+16)*pow(x,i)*pow(y,2-i); cout << poly << endl; return 0; } Assuming the file is called 'hello.cc', on our system we can compile and run it like this: $ c++ hello.cc -o hello -lginac -lcln $ ./hello 355687428096000*x*y+20922789888000*y^2+6402373705728000*x^2 (*Note Package tools::, for tools that help you when creating a software package that uses GiNaC.) Next, there is a more meaningful C++ program that calls a function which generates Hermite polynomials in a specified free variable. #include #include using namespace std; using namespace GiNaC; ex HermitePoly(const symbol & x, int n) { ex HKer=exp(-pow(x, 2)); // uses the identity H_n(x) == (-1)^n exp(x^2) (d/dx)^n exp(-x^2) return normal(pow(-1, n) * diff(HKer, x, n) / HKer); } int main() { symbol z("z"); for (int i=0; i<6; ++i) cout << "H_" << i << "(z) == " << HermitePoly(z,i) << endl; return 0; } When run, this will type out H_0(z) == 1 H_1(z) == 2*z H_2(z) == 4*z^2-2 H_3(z) == -12*z+8*z^3 H_4(z) == -48*z^2+16*z^4+12 H_5(z) == 120*z-160*z^3+32*z^5 This method of generating the coefficients is of course far from optimal for production purposes. In order to show some more examples of what GiNaC can do we will now use the 'ginsh', a simple GiNaC interactive shell that provides a convenient window into GiNaC's capabilities.  File: ginac.info, Node: What it can do for you, Next: Installation, Prev: How to use it from within C++, Up: A tour of GiNaC 2.2 What it can do for you ========================== After invoking 'ginsh' one can test and experiment with GiNaC's features much like in other Computer Algebra Systems except that it does not provide programming constructs like loops or conditionals. For a concise description of the 'ginsh' syntax we refer to its accompanied man page. Suffice to say that assignments and comparisons in 'ginsh' are written as they are in C, i.e. '=' assigns and '==' compares. It can manipulate arbitrary precision integers in a very fast way. Rational numbers are automatically converted to fractions of coprime integers: > x=3^150; 369988485035126972924700782451696644186473100389722973815184405301748249 > y=3^149; 123329495011708990974900260817232214728824366796574324605061468433916083 > x/y; 3 > y/x; 1/3 Exact numbers are always retained as exact numbers and only evaluated as floating point numbers if requested. For instance, with numeric radicals is dealt pretty much as with symbols. Products of sums of them can be expanded: > expand((1+a^(1/5)-a^(2/5))^3); 1+3*a+3*a^(1/5)-5*a^(3/5)-a^(6/5) > expand((1+3^(1/5)-3^(2/5))^3); 10-5*3^(3/5) > evalf((1+3^(1/5)-3^(2/5))^3); 0.33408977534118624228 The function 'evalf' that was used above converts any number in GiNaC's expressions into floating point numbers. This can be done to arbitrary predefined accuracy: > evalf(1/7); 0.14285714285714285714 > Digits=150; 150 > evalf(1/7); 0.1428571428571428571428571428571428571428571428571428571428571428571428 5714285714285714285714285714285714285 Exact numbers other than rationals that can be manipulated in GiNaC include predefined constants like Archimedes' 'Pi'. They can both be used in symbolic manipulations (as an exact number) as well as in numeric expressions (as an inexact number): > a=Pi^2+x; x+Pi^2 > evalf(a); 9.869604401089358619+x > x=2; 2 > evalf(a); 11.869604401089358619 Built-in functions evaluate immediately to exact numbers if this is possible. Conversions that can be safely performed are done immediately; conversions that are not generally valid are not done: > cos(42*Pi); 1 > cos(acos(x)); x > acos(cos(x)); acos(cos(x)) (Note that converting the last input to 'x' would allow one to conclude that '42*Pi' is equal to '0'.) Linear equation systems can be solved along with basic linear algebra manipulations over symbolic expressions. In C++ GiNaC offers a matrix class for this purpose but we can see what it can do using 'ginsh''s bracket notation to type them in: > lsolve(a+x*y==z,x); y^(-1)*(z-a); > lsolve({3*x+5*y == 7, -2*x+10*y == -5}, {x, y}); {x==19/8,y==-1/40} > M = [ [1, 3], [-3, 2] ]; [[1,3],[-3,2]] > determinant(M); 11 > charpoly(M,lambda); lambda^2-3*lambda+11 > A = [ [1, 1], [2, -1] ]; [[1,1],[2,-1]] > A+2*M; [[1,1],[2,-1]]+2*[[1,3],[-3,2]] > evalm(%); [[3,7],[-4,3]] > B = [ [0, 0, a], [b, 1, -b], [-1/a, 0, 0] ]; > evalm(B^(2^12345)); [[1,0,0],[0,1,0],[0,0,1]] Multivariate polynomials and rational functions may be expanded, collected and normalized (i.e. converted to a ratio of two coprime polynomials): > a = x^4 + 2*x^2*y^2 + 4*x^3*y + 12*x*y^3 - 3*y^4; 12*x*y^3+2*x^2*y^2+4*x^3*y-3*y^4+x^4 > b = x^2 + 4*x*y - y^2; 4*x*y-y^2+x^2 > expand(a*b); 8*x^5*y+17*x^4*y^2+43*x^2*y^4-24*x*y^5+16*x^3*y^3+3*y^6+x^6 > collect(a+b,x); 4*x^3*y-y^2-3*y^4+(12*y^3+4*y)*x+x^4+x^2*(1+2*y^2) > collect(a+b,y); 12*x*y^3-3*y^4+(-1+2*x^2)*y^2+(4*x+4*x^3)*y+x^2+x^4 > normal(a/b); 3*y^2+x^2 You can differentiate functions and expand them as Taylor or Laurent series in a very natural syntax (the second argument of 'series' is a relation defining the evaluation point, the third specifies the order): > diff(tan(x),x); tan(x)^2+1 > series(sin(x),x==0,4); x-1/6*x^3+Order(x^4) > series(1/tan(x),x==0,4); x^(-1)-1/3*x+Order(x^2) > series(tgamma(x),x==0,3); x^(-1)-Euler+(1/12*Pi^2+1/2*Euler^2)*x+ (-1/3*zeta(3)-1/12*Pi^2*Euler-1/6*Euler^3)*x^2+Order(x^3) > evalf(%); x^(-1)-0.5772156649015328606+(0.9890559953279725555)*x -(0.90747907608088628905)*x^2+Order(x^3) > series(tgamma(2*sin(x)-2),x==Pi/2,6); -(x-1/2*Pi)^(-2)+(-1/12*Pi^2-1/2*Euler^2-1/240)*(x-1/2*Pi)^2 -Euler-1/12+Order((x-1/2*Pi)^3) Here we have made use of the 'ginsh'-command '%' to pop the previously evaluated element from 'ginsh''s internal stack. Often, functions don't have roots in closed form. Nevertheless, it's quite easy to compute a solution numerically, to arbitrary precision: > Digits=50: > fsolve(cos(x)==x,x,0,2); 0.7390851332151606416553120876738734040134117589007574649658 > f=exp(sin(x))-x: > X=fsolve(f,x,-10,10); 2.2191071489137460325957851882042901681753665565320678854155 > subs(f,x==X); -6.372367644529809108115521591070847222364418220770475144296E-58 Notice how the final result above differs slightly from zero by about 6*10^(-58). This is because with 50 decimal digits precision the root cannot be represented more accurately than 'X'. Such inaccuracies are to be expected when computing with finite floating point values. If you ever wanted to convert units in C or C++ and found this is cumbersome, here is the solution. Symbolic types can always be used as tags for different types of objects. Converting from wrong units to the metric system is now easy: > in=.0254*m; 0.0254*m > lb=.45359237*kg; 0.45359237*kg > 200*lb/in^2; 140613.91592783185568*kg*m^(-2)  File: ginac.info, Node: Installation, Next: Prerequisites, Prev: What it can do for you, Up: Top 3 Installation ************** GiNaC's installation follows the spirit of most GNU software. It is easily installed on your system by three steps: configuration, build, installation. * Menu: * Prerequisites:: Packages upon which GiNaC depends. * Configuration:: How to configure GiNaC. * Building GiNaC:: How to compile GiNaC. * Installing GiNaC:: How to install GiNaC on your system.  File: ginac.info, Node: Prerequisites, Next: Configuration, Prev: Installation, Up: Installation 3.1 Prerequisites ================= In order to install GiNaC on your system, some prerequisites need to be met. First of all, you need to have a C++-compiler adhering to the ISO standard 'ISO/IEC 14882:2011(E)'. We used GCC for development so if you have a different compiler you are on your own. For the configuration to succeed you need a Posix compliant shell installed in '/bin/sh', GNU 'bash' is fine. The pkg-config utility is required for the configuration, it can be downloaded from . Last but not least, the CLN library is used extensively and needs to be installed on your system. Please get it from (it is licensed under the GPL) and install it prior to trying to install GiNaC. The configure script checks if it can find it and if it cannot, it will refuse to continue.  File: ginac.info, Node: Configuration, Next: Building GiNaC, Prev: Prerequisites, Up: Installation 3.2 Configuration ================= To configure GiNaC means to prepare the source distribution for building. It is done via a shell script called 'configure' that is shipped with the sources and was originally generated by GNU Autoconf. Since a configure script generated by GNU Autoconf never prompts, all customization must be done either via command line parameters or environment variables. It accepts a list of parameters, the complete set of which can be listed by calling it with the '--help' option. The most important ones will be shortly described in what follows: * '--disable-shared': When given, this option switches off the build of a shared library, i.e. a '.so' file. This may be convenient when developing because it considerably speeds up compilation. * '--prefix=PREFIX': The directory where the compiled library and headers are installed. It defaults to '/usr/local' which means that the library is installed in the directory '/usr/local/lib', the header files in '/usr/local/include/ginac' and the documentation (like this one) into '/usr/local/share/doc/GiNaC'. * '--libdir=LIBDIR': Use this option in case you want to have the library installed in some other directory than 'PREFIX/lib/'. * '--includedir=INCLUDEDIR': Use this option in case you want to have the header files installed in some other directory than 'PREFIX/include/ginac/'. For instance, if you specify '--includedir=/usr/include' you will end up with the header files sitting in the directory '/usr/include/ginac/'. Note that the subdirectory 'ginac' is enforced by this process in order to keep the header files separated from others. This avoids some clashes and allows for an easier deinstallation of GiNaC. This ought to be considered A Good Thing (tm). * '--datadir=DATADIR': This option may be given in case you want to have the documentation installed in some other directory than 'PREFIX/share/doc/GiNaC/'. In addition, you may specify some environment variables. 'CXX' holds the path and the name of the C++ compiler in case you want to override the default in your path. (The 'configure' script searches your path for 'c++', 'g++', 'gcc', 'CC', 'cxx' and 'cc++' in that order.) It may be very useful to define some compiler flags with the 'CXXFLAGS' environment variable, like optimization, debugging information and warning levels. If omitted, it defaults to '-g -O2'.(1) The whole process is illustrated in the following two examples. (Substitute 'setenv VARIABLE VALUE' for 'export VARIABLE=VALUE' if the Berkeley C shell is your login shell.) Here is a simple configuration for a site-wide GiNaC library assuming everything is in default paths: $ export CXXFLAGS="-Wall -O2" $ ./configure And here is a configuration for a private static GiNaC library with several components sitting in custom places (site-wide GCC and private CLN). The compiler is persuaded to be picky and full assertions and debugging information are switched on: $ export CXX=/usr/local/gnu/bin/c++ $ export CPPFLAGS="$(CPPFLAGS) -I$(HOME)/include" $ export CXXFLAGS="$(CXXFLAGS) -DDO_GINAC_ASSERT -ggdb -Wall -pedantic" $ export LDFLAGS="$(LDFLAGS) -L$(HOME)/lib" $ ./configure --disable-shared --prefix=$(HOME) ---------- Footnotes ---------- (1) The 'configure' script is itself generated from the file 'configure.ac'. It is only distributed in packaged releases of GiNaC. If you got the naked sources, e.g. from git, you must generate 'configure' along with the various 'Makefile.in' by using the 'autoreconf' utility. This will require a fair amount of support from your local toolchain, though.  File: ginac.info, Node: Building GiNaC, Next: Installing GiNaC, Prev: Configuration, Up: Installation 3.3 Building GiNaC ================== After proper configuration you should just build the whole library by typing $ make at the command prompt and go for a cup of coffee. The exact time it takes to compile GiNaC depends not only on the speed of your machines but also on other parameters, for instance what value for 'CXXFLAGS' you entered. Optimization may be very time-consuming. Just to make sure GiNaC works properly you may run a collection of regression tests by typing $ make check This will compile some sample programs, run them and check the output for correctness. The regression tests fall in three categories. First, the so called _exams_ are performed, simple tests where some predefined input is evaluated (like a pupils' exam). Second, the _checks_ test the coherence of results among each other with possible random input. Third, some _timings_ are performed, which benchmark some predefined problems with different sizes and display the CPU time used in seconds. Each individual test should return a message 'passed'. This is mostly intended to be a QA-check if something was broken during development, not a sanity check of your system. Some of the tests in sections _checks_ and _timings_ may require insane amounts of memory and CPU time. Feel free to kill them if your machine catches fire. Another quite important intent is to allow people to fiddle around with optimization. By default, the only documentation that will be built is this tutorial in '.info' format. To build the GiNaC tutorial and reference manual in HTML, DVI, PostScript, or PDF formats, use one of $ make html $ make dvi $ make ps $ make pdf Generally, the top-level Makefile runs recursively to the subdirectories. It is therefore safe to go into any subdirectory ('doc/', 'ginsh/', ...) and simply type 'make' TARGET there in case something went wrong.  File: ginac.info, Node: Installing GiNaC, Next: Basic concepts, Prev: Building GiNaC, Up: Installation 3.4 Installing GiNaC ==================== To install GiNaC on your system, simply type $ make install As described in the section about configuration the files will be installed in the following directories (the directories will be created if they don't already exist): * 'libginac.a' will go into 'PREFIX/lib/' (or 'LIBDIR') which defaults to '/usr/local/lib/'. So will 'libginac.so' unless the configure script was given the option '--disable-shared'. The proper symlinks will be established as well. * All the header files will be installed into 'PREFIX/include/ginac/' (or 'INCLUDEDIR/ginac/', if specified). * All documentation (info) will be stuffed into 'PREFIX/share/doc/GiNaC/' (or 'DATADIR/doc/GiNaC/', if DATADIR was specified). For the sake of completeness we will list some other useful make targets: 'make clean' deletes all files generated by 'make', i.e. all the object files. In addition 'make distclean' removes all files generated by the configuration and 'make maintainer-clean' goes one step further and deletes files that may require special tools to rebuild (like the 'libtool' for instance). Finally 'make uninstall' removes the installed library, header files and documentation(1). ---------- Footnotes ---------- (1) Uninstallation does not work after you have called 'make distclean' since the 'Makefile' is itself generated by the configuration from 'Makefile.in' and hence deleted by 'make distclean'. There are two obvious ways out of this dilemma. First, you can run the configuration again with the same PREFIX thus creating a 'Makefile' with a working 'uninstall' target. Second, you can do it by hand since you now know where all the files went during installation.  File: ginac.info, Node: Basic concepts, Next: Expressions, Prev: Installing GiNaC, Up: Top 4 Basic concepts **************** This chapter will describe the different fundamental objects that can be handled by GiNaC. But before doing so, it is worthwhile introducing you to the more commonly used class of expressions, representing a flexible meta-class for storing all mathematical objects. * Menu: * Expressions:: The fundamental GiNaC class. * Automatic evaluation:: Evaluation and canonicalization. * Error handling:: How the library reports errors. * The class hierarchy:: Overview of GiNaC's classes. * Symbols:: Symbolic objects. * Numbers:: Numerical objects. * Constants:: Pre-defined constants. * Fundamental containers:: Sums, products and powers. * Lists:: Lists of expressions. * Mathematical functions:: Mathematical functions. * Relations:: Equality, Inequality and all that. * Integrals:: Symbolic integrals. * Matrices:: Matrices. * Indexed objects:: Handling indexed quantities. * Non-commutative objects:: Algebras with non-commutative products.  File: ginac.info, Node: Expressions, Next: Automatic evaluation, Prev: Basic concepts, Up: Basic concepts 4.1 Expressions =============== The most common class of objects a user deals with is the expression 'ex', representing a mathematical object like a variable, number, function, sum, product, etc... Expressions may be put together to form new expressions, passed as arguments to functions, and so on. Here is a little collection of valid expressions: ex MyEx1 = 5; // simple number ex MyEx2 = x + 2*y; // polynomial in x and y ex MyEx3 = (x + 1)/(x - 1); // rational expression ex MyEx4 = sin(x + 2*y) + 3*z + 41; // containing a function ex MyEx5 = MyEx4 + 1; // similar to above Expressions are handles to other more fundamental objects, that often contain other expressions thus creating a tree of expressions (*Note Internal structures::, for particular examples). Most methods on 'ex' therefore run top-down through such an expression tree. For example, the method 'has()' scans recursively for occurrences of something inside an expression. Thus, if you have declared 'MyEx4' as in the example above 'MyEx4.has(y)' will find 'y' inside the argument of 'sin' and hence return 'true'. The next sections will outline the general picture of GiNaC's class hierarchy and describe the classes of objects that are handled by 'ex'. 4.1.1 Note: Expressions and STL containers ------------------------------------------ GiNaC expressions ('ex' objects) have value semantics (they can be assigned, reassigned and copied like integral types) but the operator '<' doesn't provide a well-defined ordering on them. In STL-speak, expressions are 'Assignable' but not 'LessThanComparable'. This implies that in order to use expressions in sorted containers such as 'std::map<>' and 'std::set<>' you have to supply a suitable comparison predicate. GiNaC provides such a predicate, called 'ex_is_less'. For example, a set of expressions should be defined as 'std::set'. Unsorted containers such as 'std::vector<>' and 'std::list<>' don't pose a problem. A 'std::vector' works as expected. *Note Information about expressions::, for more about comparing and ordering expressions.  File: ginac.info, Node: Automatic evaluation, Next: Error handling, Prev: Expressions, Up: Basic concepts 4.2 Automatic evaluation and canonicalization of expressions ============================================================ GiNaC performs some automatic transformations on expressions, to simplify them and put them into a canonical form. Some examples: ex MyEx1 = 2*x - 1 + x; // 3*x-1 ex MyEx2 = x - x; // 0 ex MyEx3 = cos(2*Pi); // 1 ex MyEx4 = x*y/x; // y This behavior is usually referred to as "automatic" or "anonymous evaluation". GiNaC only performs transformations that are * at most of complexity O(n log n) * algebraically correct, possibly except for a set of measure zero (e.g. x/x is transformed to 1 although this is incorrect for x=0) There are two types of automatic transformations in GiNaC that may not behave in an entirely obvious way at first glance: * The terms of sums and products (and some other things like the arguments of symmetric functions, the indices of symmetric tensors etc.) are re-ordered into a canonical form that is deterministic, but not lexicographical or in any other way easy to guess (it almost always depends on the number and order of the symbols you define). However, constructing the same expression twice, either implicitly or explicitly, will always result in the same canonical form. * Expressions of the form 'number times sum' are automatically expanded (this has to do with GiNaC's internal representation of sums and products). For example ex MyEx5 = 2*(x + y); // 2*x+2*y ex MyEx6 = z*(x + y); // z*(x+y) The general rule is that when you construct expressions, GiNaC automatically creates them in canonical form, which might differ from the form you typed in your program. This may create some awkward looking output ('-y+x' instead of 'x-y') but allows for more efficient operation and usually yields some immediate simplifications. Internally, the anonymous evaluator in GiNaC is implemented by the methods ex ex::eval() const; ex basic::eval() const; but unless you are extending GiNaC with your own classes or functions, there should never be any reason to call them explicitly. All GiNaC methods that transform expressions, like 'subs()' or 'normal()', automatically re-evaluate their results.  File: ginac.info, Node: Error handling, Next: The class hierarchy, Prev: Automatic evaluation, Up: Basic concepts 4.3 Error handling ================== GiNaC reports run-time errors by throwing C++ exceptions. All exceptions generated by GiNaC are subclassed from the standard 'exception' class defined in the '' header. In addition to the predefined 'logic_error', 'domain_error', 'out_of_range', 'invalid_argument', 'runtime_error', 'range_error' and 'overflow_error' types, GiNaC also defines a 'pole_error' exception that gets thrown when trying to evaluate a mathematical function at a singularity. The 'pole_error' class has a member function int pole_error::degree() const; that returns the order of the singularity (or 0 when the pole is logarithmic or the order is undefined). When using GiNaC it is useful to arrange for exceptions to be caught in the main program even if you don't want to do any special error handling. Otherwise whenever an error occurs in GiNaC, it will be delegated to the default exception handler of your C++ compiler's run-time system which usually only aborts the program without giving any information what went wrong. Here is an example for a 'main()' function that catches and prints exceptions generated by GiNaC: #include #include #include using namespace std; using namespace GiNaC; int main() { try { ... // code using GiNaC ... } catch (exception &p) { cerr << p.what() << endl; return 1; } return 0; }  File: ginac.info, Node: The class hierarchy, Next: Symbols, Prev: Error handling, Up: Basic concepts 4.4 The class hierarchy ======================= GiNaC's class hierarchy consists of several classes representing mathematical objects, all of which (except for 'ex' and some helpers) are internally derived from one abstract base class called 'basic'. You do not have to deal with objects of class 'basic', instead you'll be dealing with symbols, numbers, containers of expressions and so on. To get an idea about what kinds of symbolic composites may be built we have a look at the most important classes in the class hierarchy and some of the relations among the classes: The abstract classes shown here (the ones without drop-shadow) are of no interest for the user. They are used internally in order to avoid code duplication if two or more classes derived from them share certain features. An example is 'expairseq', a container for a sequence of pairs each consisting of one expression and a number ('numeric'). What _is_ visible to the user are the derived classes 'add' and 'mul', representing sums and products. *Note Internal structures::, where these two classes are described in more detail. The following table shortly summarizes what kinds of mathematical objects are stored in the different classes: 'symbol' Algebraic symbols a, x, y... 'constant' Constants like Pi 'numeric' All kinds of numbers, 42, 7/3*I, 3.14159... 'add' Sums like x+y or a-(2*b)+3 'mul' Products like x*y or 2*a^2*(x+y+z)/b 'ncmul' Products of non-commutative objects 'power' Exponentials such as x^2, a^b, 'sqrt('2')' ... 'pseries' Power Series, e.g. x-1/6*x^3+1/120*x^5+O(x^7) 'function' A symbolic function like sin(2*x) 'lst' Lists of expressions {x, 2*y, 3+z} 'matrix' mxn matrices of expressions 'relational' A relation like the identity x'=='y 'indexed' Indexed object like A_ij 'tensor' Special tensor like the delta and metric tensors 'idx' Index of an indexed object 'varidx' Index with variance 'spinidx' Index with variance and dot (used in Weyl-van-der-Waerden spinor formalism) 'wildcard' Wildcard for pattern matching 'structure' Template for user-defined classes  File: ginac.info, Node: Symbols, Next: Numbers, Prev: The class hierarchy, Up: Basic concepts 4.5 Symbols =========== Symbolic indeterminates, or "symbols" for short, are for symbolic manipulation what atoms are for chemistry. A typical symbol definition looks like this: symbol x("x"); This definition actually contains three very different things: * a C++ variable named 'x' * a 'symbol' object stored in this C++ variable; this object represents the symbol in a GiNaC expression * the string '"x"' which is the name of the symbol, used (almost) exclusively for printing expressions holding the symbol Symbols have an explicit name, supplied as a string during construction, because in C++, variable names can't be used as values, and the C++ compiler throws them away during compilation. It is possible to omit the symbol name in the definition: symbol x; In this case, GiNaC will assign the symbol an internal, unique name of the form 'symbolNNN'. This won't affect the usability of the symbol but the output of your calculations will become more readable if you give your symbols sensible names (for intermediate expressions that are only used internally such anonymous symbols can be quite useful, however). Now, here is one important property of GiNaC that differentiates it from other computer algebra programs you may have used: GiNaC does _not_ use the names of symbols to tell them apart, but a (hidden) serial number that is unique for each newly created 'symbol' object. If you want to use one and the same symbol in different places in your program, you must only create one 'symbol' object and pass that around. If you create another symbol, even if it has the same name, GiNaC will treat it as a different indeterminate. Observe: ex f(int n) { symbol x("x"); return pow(x, n); } int main() { symbol x("x"); ex e = f(6); cout << e << endl; // prints "x^6" which looks right, but... cout << e.degree(x) << endl; // ...this doesn't work. The symbol "x" here is different from the one // in f() and in the expression returned by f(). Consequently, it // prints "0". } One possibility to ensure that 'f()' and 'main()' use the same symbol is to pass the symbol as an argument to 'f()': ex f(int n, const ex & x) { return pow(x, n); } int main() { symbol x("x"); // Now, f() uses the same symbol. ex e = f(6, x); cout << e.degree(x) << endl; // prints "6", as expected } Another possibility would be to define a global symbol 'x' that is used by both 'f()' and 'main()'. If you are using global symbols and multiple compilation units you must take special care, however. Suppose that you have a header file 'globals.h' in your program that defines a 'symbol x("x");'. In this case, every unit that includes 'globals.h' would also get its own definition of 'x' (because header files are just inlined into the source code by the C++ preprocessor), and hence you would again end up with multiple equally-named, but different, symbols. Instead, the 'globals.h' header should only contain a _declaration_ like 'extern symbol x;', with the definition of 'x' moved into a C++ source file such as 'globals.cpp'. A different approach to ensuring that symbols used in different parts of your program are identical is to create them with a _factory_ function like this one: const symbol & get_symbol(const string & s) { static map directory; map::iterator i = directory.find(s); if (i != directory.end()) return i->second; else return directory.insert(make_pair(s, symbol(s))).first->second; } This function returns one newly constructed symbol for each name that is passed in, and it returns the same symbol when called multiple times with the same name. Using this symbol factory, we can rewrite our example like this: ex f(int n) { return pow(get_symbol("x"), n); } int main() { ex e = f(6); // Both calls of get_symbol("x") yield the same symbol. cout << e.degree(get_symbol("x")) << endl; // prints "6" } Instead of creating symbols from strings we could also have 'get_symbol()' take, for example, an integer number as its argument. In this case, we would probably want to give the generated symbols names that include this number, which can be accomplished with the help of an 'ostringstream'. In general, if you're getting weird results from GiNaC such as an expression 'x-x' that is not simplified to zero, you should check your symbol definitions. As we said, the names of symbols primarily serve for purposes of expression output. But there are actually two instances where GiNaC uses the names for identifying symbols: When constructing an expression from a string, and when recreating an expression from an archive (*note Input/output::). In addition to its name, a symbol may contain a special string that is used in LaTeX output: symbol x("x", "\\Box"); This creates a symbol that is printed as "'x'" in normal output, but as "'\Box'" in LaTeX code (*Note Input/output::, for more information about the different output formats of expressions in GiNaC). GiNaC automatically creates proper LaTeX code for symbols having names of greek letters ('alpha', 'mu', etc.). You can retrieve the name and the LaTeX name of a symbol using the respective methods: symbol::get_name() const; symbol::get_TeX_name() const; Symbols in GiNaC can't be assigned values. If you need to store results of calculations and give them a name, use C++ variables of type 'ex'. If you want to replace a symbol in an expression with something else, you can invoke the expression's '.subs()' method (*note Substituting expressions::). By default, symbols are expected to stand in for complex values, i.e. they live in the complex domain. As a consequence, operations like complex conjugation, for example (*note Complex expressions::), do _not_ evaluate if applied to such symbols. Likewise 'log(exp(x))' does not evaluate to 'x', because of the unknown imaginary part of 'x'. On the other hand, if you are sure that your symbols will hold only real values, you would like to have such functions evaluated. Therefore GiNaC allows you to specify the domain of the symbol. Instead of 'symbol x("x");' you can write 'realsymbol x("x");' to tell GiNaC that 'x' stands in for real values. Furthermore, it is also possible to declare a symbol as positive. This will, for instance, enable the automatic simplification of 'abs(x)' into 'x'. This is done by declaring the symbol as 'possymbol x("x");'.  File: ginac.info, Node: Numbers, Next: Constants, Prev: Symbols, Up: Basic concepts 4.6 Numbers =========== For storing numerical things, GiNaC uses Bruno Haible's library CLN. The classes therein serve as foundation classes for GiNaC. CLN stands for Class Library for Numbers or alternatively for Common Lisp Numbers. In order to find out more about CLN's internals, the reader is referred to the documentation of that library. *note (cln)Introduction::, for more information. Suffice to say that it is by itself build on top of another library, the GNU Multiple Precision library GMP, which is an extremely fast library for arbitrary long integers and rationals as well as arbitrary precision floating point numbers. It is very commonly used by several popular cryptographic applications. CLN extends GMP by several useful things: First, it introduces the complex number field over either reals (i.e. floating point numbers with arbitrary precision) or rationals. Second, it automatically converts rationals to integers if the denominator is unity and complex numbers to real numbers if the imaginary part vanishes and also correctly treats algebraic functions. Third it provides good implementations of state-of-the-art algorithms for all trigonometric and hyperbolic functions as well as for calculation of some useful constants. The user can construct an object of class 'numeric' in several ways. The following example shows the four most important constructors. It uses construction from C-integer, construction of fractions from two integers, construction from C-float and construction from a string: #include #include using namespace GiNaC; int main() { numeric two = 2; // exact integer 2 numeric r(2,3); // exact fraction 2/3 numeric e(2.71828); // floating point number numeric p = "3.14159265358979323846"; // constructor from string // Trott's constant in scientific notation: numeric trott("1.0841015122311136151E-2"); std::cout << two*p << std::endl; // floating point 6.283... ... The imaginary unit in GiNaC is a predefined 'numeric' object with the name 'I': ... numeric z1 = 2-3*I; // exact complex number 2-3i numeric z2 = 5.9+1.6*I; // complex floating point number } It may be tempting to construct fractions by writing 'numeric r(3/2)'. This would, however, call C's built-in operator '/' for integers first and result in a numeric holding a plain integer 1. *Never use the operator '/' on integers* unless you know exactly what you are doing! Use the constructor from two integers instead, as shown in the example above. Writing 'numeric(1)/2' may look funny but works also. We have seen now the distinction between exact numbers and floating point numbers. Clearly, the user should never have to worry about dynamically created exact numbers, since their 'exactness' always determines how they ought to be handled, i.e. how 'long' they are. The situation is different for floating point numbers. Their accuracy is controlled by one _global_ variable, called 'Digits'. (For those readers who know about Maple: it behaves very much like Maple's 'Digits'). All objects of class numeric that are constructed from then on will be stored with a precision matching that number of decimal digits: #include #include using namespace std; using namespace GiNaC; void foo() { numeric three(3.0), one(1.0); numeric x = one/three; cout << "in " << Digits << " digits:" << endl; cout << x << endl; cout << Pi.evalf() << endl; } int main() { foo(); Digits = 60; foo(); return 0; } The above example prints the following output to screen: in 17 digits: 0.33333333333333333334 3.1415926535897932385 in 60 digits: 0.33333333333333333333333333333333333333333333333333333333333333333334 3.1415926535897932384626433832795028841971693993751058209749445923078 Note that the last number is not necessarily rounded as you would naively expect it to be rounded in the decimal system. But note also, that in both cases you got a couple of extra digits. This is because numbers are internally stored by CLN as chunks of binary digits in order to match your machine's word size and to not waste precision. Thus, on architectures with different word size, the above output might even differ with regard to actually computed digits. It should be clear that objects of class 'numeric' should be used for constructing numbers or for doing arithmetic with them. The objects one deals with most of the time are the polymorphic expressions 'ex'. 4.6.1 Tests on numbers ---------------------- Once you have declared some numbers, assigned them to expressions and done some arithmetic with them it is frequently desired to retrieve some kind of information from them like asking whether that number is integer, rational, real or complex. For those cases GiNaC provides several useful methods. (Internally, they fall back to invocations of certain CLN functions.) As an example, let's construct some rational number, multiply it with some multiple of its denominator and test what comes out: #include #include using namespace std; using namespace GiNaC; // some very important constants: const numeric twentyone(21); const numeric ten(10); const numeric five(5); int main() { numeric answer = twentyone; answer /= five; cout << answer.is_integer() << endl; // false, it's 21/5 answer *= ten; cout << answer.is_integer() << endl; // true, it's 42 now! } Note that the variable 'answer' is constructed here as an integer by 'numeric''s copy constructor, but in an intermediate step it holds a rational number represented as integer numerator and integer denominator. When multiplied by 10, the denominator becomes unity and the result is automatically converted to a pure integer again. Internally, the underlying CLN is responsible for this behavior and we refer the reader to CLN's documentation. Suffice to say that the same behavior applies to complex numbers as well as return values of certain functions. Complex numbers are automatically converted to real numbers if the imaginary part becomes zero. The full set of tests that can be applied is listed in the following table. *Method* *Returns true if the object is...* '.is_zero()' ...equal to zero '.is_positive()' ...not complex and greater than 0 '.is_negative()' ...not complex and smaller than 0 '.is_integer()' ...a (non-complex) integer '.is_pos_integer()' ...an integer and greater than 0 '.is_nonneg_integer()' ...an integer and greater equal 0 '.is_even()' ...an even integer '.is_odd()' ...an odd integer '.is_prime()' ...a prime integer (probabilistic primality test) '.is_rational()' ...an exact rational number (integers are rational, too) '.is_real()' ...a real integer, rational or float (i.e. is not complex) '.is_cinteger()' ...a (complex) integer (such as 2-3*I) '.is_crational()' ...an exact (complex) rational number (such as 2/3+7/2*I) 4.6.2 Numeric functions ----------------------- The following functions can be applied to 'numeric' objects and will be evaluated immediately: *Name* *Function* 'inverse(z)' returns 1/z 'pow(a, b)' exponentiation a^b 'abs(z)' absolute value 'real(z)' real part 'imag(z)' imaginary part 'csgn(z)' complex sign (returns an 'int') 'step(x)' step function (returns an 'numeric') 'numer(z)' numerator of rational or complex rational number 'denom(z)' denominator of rational or complex rational number 'sqrt(z)' square root 'isqrt(n)' integer square root 'sin(z)' sine 'cos(z)' cosine 'tan(z)' tangent 'asin(z)' inverse sine 'acos(z)' inverse cosine 'atan(z)' inverse tangent 'atan(y, x)' inverse tangent with two arguments 'sinh(z)' hyperbolic sine 'cosh(z)' hyperbolic cosine 'tanh(z)' hyperbolic tangent 'asinh(z)' inverse hyperbolic sine 'acosh(z)' inverse hyperbolic cosine 'atanh(z)' inverse hyperbolic tangent 'exp(z)' exponential function 'log(z)' natural logarithm 'Li2(z)' dilogarithm 'zeta(z)' Riemann's zeta function 'tgamma(z)' gamma function 'lgamma(z)' logarithm of gamma function 'psi(z)' psi (digamma) function 'psi(n, z)' derivatives of psi function (polygamma functions) 'factorial(n)' factorial function n! 'doublefactorial(n)' double factorial function n!! 'binomial(n, k)' binomial coefficients 'bernoulli(n)' Bernoulli numbers 'fibonacci(n)' Fibonacci numbers 'mod(a, b)' modulus in positive representation (in the range '[0, abs(b)-1]' with the sign of b, or zero) 'smod(a, b)' modulus in symmetric representation (in the range '[-iquo(abs(b), 2), iquo(abs(b), 2)]') 'irem(a, b)' integer remainder (has the sign of a, or is zero) 'irem(a, b, q)' integer remainder and quotient, 'irem(a, b, q) == a-q*b' 'iquo(a, b)' integer quotient 'iquo(a, b, r)' integer quotient and remainder, 'r == a-iquo(a, b)*b' 'gcd(a, b)' greatest common divisor 'lcm(a, b)' least common multiple Most of these functions are also available as symbolic functions that can be used in expressions (*note Mathematical functions::) or, like 'gcd()', as polynomial algorithms. 4.6.3 Converting numbers ------------------------ Sometimes it is desirable to convert a 'numeric' object back to a built-in arithmetic type ('int', 'double', etc.). The 'numeric' class provides a couple of methods for this purpose: int numeric::to_int() const; long numeric::to_long() const; double numeric::to_double() const; cln::cl_N numeric::to_cl_N() const; 'to_int()' and 'to_long()' only work when the number they are applied on is an exact integer. Otherwise the program will halt with a message like 'Not a 32-bit integer'. 'to_double()' applied on a rational number will return a floating-point approximation. Both 'to_int()/to_long()' and 'to_double()' discard the imaginary part of complex numbers. Note the signature of the above methods, you may need to apply a type conversion and call 'evalf()' as shown in the following example: ... ex e1 = 1, e2 = sin(Pi/5); cout << ex_to(e1).to_int() << endl << ex_to(e2.evalf()).to_double() << endl; ...  File: ginac.info, Node: Constants, Next: Fundamental containers, Prev: Numbers, Up: Basic concepts 4.7 Constants ============= Constants behave pretty much like symbols except that they return some specific number when the method '.evalf()' is called. The predefined known constants are: *Name* *Common Name* *Numerical Value (to 35 digits)* 'Pi' Archimedes' constant 3.14159265358979323846264338327950288 'Catalan' Catalan's constant 0.91596559417721901505460351493238411 'Euler' Euler's (or 0.57721566490153286060651209008240243 Euler-Mascheroni) constant  File: ginac.info, Node: Fundamental containers, Next: Lists, Prev: Constants, Up: Basic concepts 4.8 Sums, products and powers ============================= Simple rational expressions are written down in GiNaC pretty much like in other CAS or like expressions involving numerical variables in C. The necessary operators '+', '-', '*' and '/' have been overloaded to achieve this goal. When you run the following code snippet, the constructor for an object of type 'mul' is automatically called to hold the product of 'a' and 'b' and then the constructor for an object of type 'add' is called to hold the sum of that 'mul' object and the number one: ... symbol a("a"), b("b"); ex MyTerm = 1+a*b; ... For exponentiation, you have already seen the somewhat clumsy (though C-ish) statement 'pow(x,2);' to represent 'x' squared. This direct construction is necessary since we cannot safely overload the constructor '^' in C++ to construct a 'power' object. If we did, it would have several counterintuitive and undesired effects: * Due to C's operator precedence, '2*x^2' would be parsed as '(2*x)^2'. * Due to the binding of the operator '^', 'x^a^b' would result in '(x^a)^b'. This would be confusing since most (though not all) other CAS interpret this as 'x^(a^b)'. * Also, expressions involving integer exponents are very frequently used, which makes it even more dangerous to overload '^' since it is then hard to distinguish between the semantics as exponentiation and the one for exclusive or. (It would be embarrassing to return '1' where one has requested '2^3'.) All effects are contrary to mathematical notation and differ from the way most other CAS handle exponentiation, therefore overloading '^' is ruled out for GiNaC's C++ part. The situation is different in 'ginsh', there the exponentiation-'^' exists. (Also note that the other frequently used exponentiation operator '**' does not exist at all in C++). To be somewhat more precise, objects of the three classes described here, are all containers for other expressions. An object of class 'power' is best viewed as a container with two slots, one for the basis, one for the exponent. All valid GiNaC expressions can be inserted. However, basic transformations like simplifying 'pow(pow(x,2),3)' to 'x^6' automatically are only performed when this is mathematically possible. If we replace the outer exponent three in the example by some symbols 'a', the simplification is not safe and will not be performed, since 'a' might be '1/2' and 'x' negative. Objects of type 'add' and 'mul' are containers with an arbitrary number of slots for expressions to be inserted. Again, simple and safe simplifications are carried out like transforming '3*x+4-x' to '2*x+4'.  File: ginac.info, Node: Lists, Next: Mathematical functions, Prev: Fundamental containers, Up: Basic concepts 4.9 Lists of expressions ======================== The GiNaC class 'lst' serves for holding a "list" of arbitrary expressions. They are not as ubiquitous as in many other computer algebra packages, but are sometimes used to supply a variable number of arguments of the same type to GiNaC methods such as 'subs()' and some 'matrix' constructors, so you should have a basic understanding of them. Lists can be constructed from an initializer list of expressions: { symbol x("x"), y("y"); lst l = {x, 2, y, x+y}; // now, l is a list holding the expressions 'x', '2', 'y', and 'x+y', // in that order ... Use the 'nops()' method to determine the size (number of expressions) of a list and the 'op()' method or the '[]' operator to access individual elements: ... cout << l.nops() << endl; // prints '4' cout << l.op(2) << " " << l[0] << endl; // prints 'y x' ... As with the standard 'list' container, accessing random elements of a 'lst' is generally an operation of order O(N). Faster read-only sequential access to the elements of a list is possible with the iterator types provided by the 'lst' class: typedef ... lst::const_iterator; typedef ... lst::const_reverse_iterator; lst::const_iterator lst::begin() const; lst::const_iterator lst::end() const; lst::const_reverse_iterator lst::rbegin() const; lst::const_reverse_iterator lst::rend() const; For example, to print the elements of a list individually you can use: ... // O(N) for (lst::const_iterator i = l.begin(); i != l.end(); ++i) cout << *i << endl; ... which is one order faster than ... // O(N^2) for (size_t i = 0; i < l.nops(); ++i) cout << l.op(i) << endl; ... These iterators also allow you to use some of the algorithms provided by the C++ standard library: ... // print the elements of the list (requires #include ) std::copy(l.begin(), l.end(), ostream_iterator(cout, "\n")); // sum up the elements of the list (requires #include ) ex sum = std::accumulate(l.begin(), l.end(), ex(0)); cout << sum << endl; // prints '2+2*x+2*y' ... 'lst' is one of the few GiNaC classes that allow in-place modifications (the only other one is 'matrix'). You can modify single elements: ... l[1] = 42; // l is now {x, 42, y, x+y} l.let_op(1) = 7; // l is now {x, 7, y, x+y} ... You can append or prepend an expression to a list with the 'append()' and 'prepend()' methods: ... l.append(4*x); // l is now {x, 7, y, x+y, 4*x} l.prepend(0); // l is now {0, x, 7, y, x+y, 4*x} ... You can remove the first or last element of a list with 'remove_first()' and 'remove_last()': ... l.remove_first(); // l is now {x, 7, y, x+y, 4*x} l.remove_last(); // l is now {x, 7, y, x+y} ... You can remove all the elements of a list with 'remove_all()': ... l.remove_all(); // l is now empty ... You can bring the elements of a list into a canonical order with 'sort()': ... lst l1 = {x, 2, y, x+y}; lst l2 = {2, x+y, x, y}; l1.sort(); l2.sort(); // l1 and l2 are now equal ... Finally, you can remove all but the first element of consecutive groups of elements with 'unique()': ... lst l3 = {x, 2, 2, 2, y, x+y, y+x}; l3.unique(); // l3 is now {x, 2, y, x+y} }  File: ginac.info, Node: Mathematical functions, Next: Relations, Prev: Lists, Up: Basic concepts 4.10 Mathematical functions =========================== There are quite a number of useful functions hard-wired into GiNaC. For instance, all trigonometric and hyperbolic functions are implemented (*Note Built-in functions::, for a complete list). These functions (better called _pseudofunctions_) are all objects of class 'function'. They accept one or more expressions as arguments and return one expression. If the arguments are not numerical, the evaluation of the function may be halted, as it does in the next example, showing how a function returns itself twice and finally an expression that may be really useful: ... symbol x("x"), y("y"); ex foo = x+y/2; cout << tgamma(foo) << endl; // -> tgamma(x+(1/2)*y) ex bar = foo.subs(y==1); cout << tgamma(bar) << endl; // -> tgamma(x+1/2) ex foobar = bar.subs(x==7); cout << tgamma(foobar) << endl; // -> (135135/128)*Pi^(1/2) ... Besides evaluation most of these functions allow differentiation, series expansion and so on. Read the next chapter in order to learn more about this. It must be noted that these pseudofunctions are created by inline functions, where the argument list is templated. This means that whenever you call 'GiNaC::sin(1)' it is equivalent to 'sin(ex(1))' and will therefore not result in a floating point number. Unless of course the function prototype is explicitly overridden - which is the case for arguments of type 'numeric' (not wrapped inside an 'ex'). Hence, in order to obtain a floating point number of class 'numeric' you should call 'sin(numeric(1))'. This is almost the same as calling 'sin(1).evalf()' except that the latter will return a numeric wrapped inside an 'ex'.  File: ginac.info, Node: Relations, Next: Integrals, Prev: Mathematical functions, Up: Basic concepts 4.11 Relations ============== Sometimes, a relation holding between two expressions must be stored somehow. The class 'relational' is a convenient container for such purposes. A relation is by definition a container for two 'ex' and a relation between them that signals equality, inequality and so on. They are created by simply using the C++ operators '==', '!=', '<', '<=', '>' and '>=' between two expressions. *Note Mathematical functions::, for examples where various applications of the '.subs()' method show how objects of class relational are used as arguments. There they provide an intuitive syntax for substitutions. They are also used as arguments to the 'ex::series' method, where the left hand side of the relation specifies the variable to expand in and the right hand side the expansion point. They can also be used for creating systems of equations that are to be solved for unknown variables. But the most common usage of objects of this class is rather inconspicuous in statements of the form 'if (expand(pow(a+b,2))==a*a+2*a*b+b*b) {...}'. Here, an implicit conversion from 'relational' to 'bool' takes place. Note, however, that '==' here does not perform any simplifications, hence 'expand()' must be called explicitly.  File: ginac.info, Node: Integrals, Next: Matrices, Prev: Relations, Up: Basic concepts 4.12 Integrals ============== An object of class "integral" can be used to hold a symbolic integral. If you want to symbolically represent the integral of 'x*x' from 0 to 1, you would write this as integral(x, 0, 1, x*x) The first argument is the integration variable. It should be noted that GiNaC is not very good (yet?) at symbolically evaluating integrals. In fact, it can only integrate polynomials. An expression containing integrals can be evaluated symbolically by calling the .eval_integ() method on it. Numerical evaluation is available by calling the .evalf() method on an expression containing the integral. This will only evaluate integrals into a number if 'subs'ing the integration variable by a number in the fourth argument of an integral and then 'evalf'ing the result always results in a number. Of course, also the boundaries of the integration domain must 'evalf' into numbers. It should be noted that trying to 'evalf' a function with discontinuities in the integration domain is not recommended. The accuracy of the numeric evaluation of integrals is determined by the static member variable ex integral::relative_integration_error of the class 'integral'. The default value of this is 10^-8. The integration works by halving the interval of integration, until numeric stability of the answer indicates that the requested accuracy has been reached. The maximum depth of the halving can be set via the static member variable int integral::max_integration_level The default value is 15. If this depth is exceeded, 'evalf' will simply return the integral unevaluated. The function that performs the numerical evaluation, is also available as ex adaptivesimpson(const ex & x, const ex & a, const ex & b, const ex & f, const ex & error) This function will throw an exception if the maximum depth is exceeded. The last parameter of the function is optional and defaults to the 'relative_integration_error'. To make sure that we do not do too much work if an expression contains the same integral multiple times, a lookup table is used. If you know that an expression holds an integral, you can get the integration variable, the left boundary, right boundary and integrand by respectively calling '.op(0)', '.op(1)', '.op(2)', and '.op(3)'. Differentiating integrals with respect to variables works as expected. Note that it makes no sense to differentiate an integral with respect to the integration variable.  File: ginac.info, Node: Matrices, Next: Indexed objects, Prev: Integrals, Up: Basic concepts 4.13 Matrices ============= A "matrix" is a two-dimensional array of expressions. The elements of a matrix with m rows and n columns are accessed with two 'unsigned' indices, the first one in the range 0...m-1, the second one in the range 0...n-1. There are a couple of ways to construct matrices, with or without preset elements. The constructor matrix::matrix(unsigned r, unsigned c); creates a matrix with 'r' rows and 'c' columns with all elements set to zero. The easiest way to create a matrix is using an initializer list of initializer lists, all of the same size: { matrix m = {{1, -a}, {a, 1}}; } You can also specify the elements as a (flat) list with matrix::matrix(unsigned r, unsigned c, const lst & l); The function ex lst_to_matrix(const lst & l); constructs a matrix from a list of lists, each list representing a matrix row. There is also a set of functions for creating some special types of matrices: ex diag_matrix(const lst & l); ex diag_matrix(initializer_list l); ex unit_matrix(unsigned x); ex unit_matrix(unsigned r, unsigned c); ex symbolic_matrix(unsigned r, unsigned c, const string & base_name); ex symbolic_matrix(unsigned r, unsigned c, const string & base_name, const string & tex_base_name); 'diag_matrix()' constructs a square diagonal matrix given the diagonal elements. 'unit_matrix()' creates an 'x' by 'x' (or 'r' by 'c') unit matrix. And finally, 'symbolic_matrix' constructs a matrix filled with newly generated symbols made of the specified base name and the position of each element in the matrix. Matrices often arise by omitting elements of another matrix. For instance, the submatrix 'S' of a matrix 'M' takes a rectangular block from 'M'. The reduced matrix 'R' is defined by removing one row and one column from a matrix 'M'. (The determinant of a reduced matrix is called a _Minor_ of 'M' and can be used for computing the inverse using Cramer's rule.) ex sub_matrix(const matrix&m, unsigned r, unsigned nr, unsigned c, unsigned nc); ex reduced_matrix(const matrix& m, unsigned r, unsigned c); The function 'sub_matrix()' takes a row offset 'r' and a column offset 'c' and takes a block of 'nr' rows and 'nc' columns. The function 'reduced_matrix()' has two integer arguments that specify which row and column to remove: { matrix m = {{11, 12, 13}, {21, 22, 23}, {31, 32, 33}}; cout << reduced_matrix(m, 1, 1) << endl; // -> [[11,13],[31,33]] cout << sub_matrix(m, 1, 2, 1, 2) << endl; // -> [[22,23],[32,33]] } Matrix elements can be accessed and set using the parenthesis (function call) operator: const ex & matrix::operator()(unsigned r, unsigned c) const; ex & matrix::operator()(unsigned r, unsigned c); It is also possible to access the matrix elements in a linear fashion with the 'op()' method. But C++-style subscripting with square brackets '[]' is not available. Here are a couple of examples for constructing matrices: { symbol a("a"), b("b"); matrix M = {{a, 0}, {0, b}}; cout << M << endl; // -> [[a,0],[0,b]] matrix M2(2, 2); M2(0, 0) = a; M2(1, 1) = b; cout << M2 << endl; // -> [[a,0],[0,b]] cout << matrix(2, 2, lst{a, 0, 0, b}) << endl; // -> [[a,0],[0,b]] cout << lst_to_matrix(lst{lst{a, 0}, lst{0, b}}) << endl; // -> [[a,0],[0,b]] cout << diag_matrix(lst{a, b}) << endl; // -> [[a,0],[0,b]] cout << unit_matrix(3) << endl; // -> [[1,0,0],[0,1,0],[0,0,1]] cout << symbolic_matrix(2, 3, "x") << endl; // -> [[x00,x01,x02],[x10,x11,x12]] } The method 'matrix::is_zero_matrix()' returns 'true' only if all entries of the matrix are zeros. There is also method 'ex::is_zero_matrix()' which returns 'true' only if the expression is zero or a zero matrix. There are three ways to do arithmetic with matrices. The first (and most direct one) is to use the methods provided by the 'matrix' class: matrix matrix::add(const matrix & other) const; matrix matrix::sub(const matrix & other) const; matrix matrix::mul(const matrix & other) const; matrix matrix::mul_scalar(const ex & other) const; matrix matrix::pow(const ex & expn) const; matrix matrix::transpose() const; All of these methods return the result as a new matrix object. Here is an example that calculates A*B-2*C for three matrices A, B and C: { matrix A = {{ 1, 2}, { 3, 4}}; matrix B = {{-1, 0}, { 2, 1}}; matrix C = {{ 8, 4}, { 2, 1}}; matrix result = A.mul(B).sub(C.mul_scalar(2)); cout << result << endl; // -> [[-13,-6],[1,2]] ... } The second (and probably the most natural) way is to construct an expression containing matrices with the usual arithmetic operators and 'pow()'. For efficiency reasons, expressions with sums, products and powers of matrices are not automatically evaluated in GiNaC. You have to call the method ex ex::evalm() const; to obtain the result: { ... ex e = A*B - 2*C; cout << e << endl; // -> [[1,2],[3,4]]*[[-1,0],[2,1]]-2*[[8,4],[2,1]] cout << e.evalm() << endl; // -> [[-13,-6],[1,2]] ... } The non-commutativity of the product 'A*B' in this example is automatically recognized by GiNaC. There is no need to use a special operator here. *Note Non-commutative objects::, for more information about dealing with non-commutative expressions. Finally, you can work with indexed matrices and call 'simplify_indexed()' to perform the arithmetic: { ... idx i(symbol("i"), 2), j(symbol("j"), 2), k(symbol("k"), 2); e = indexed(A, i, k) * indexed(B, k, j) - 2 * indexed(C, i, j); cout << e << endl; // -> -2*[[8,4],[2,1]].i.j+[[-1,0],[2,1]].k.j*[[1,2],[3,4]].i.k cout << e.simplify_indexed() << endl; // -> [[-13,-6],[1,2]].i.j } Using indices is most useful when working with rectangular matrices and one-dimensional vectors because you don't have to worry about having to transpose matrices before multiplying them. *Note Indexed objects::, for more information about using matrices with indices, and about indices in general. The 'matrix' class provides a couple of additional methods for computing determinants, traces, characteristic polynomials and ranks: ex matrix::determinant(unsigned algo=determinant_algo::automatic) const; ex matrix::trace() const; ex matrix::charpoly(const ex & lambda) const; unsigned matrix::rank(unsigned algo=solve_algo::automatic) const; The optional 'algo' argument of 'determinant()' and 'rank()' functions allows to select between different algorithms for calculating the determinant and rank respectively. The asymptotic speed (as parametrized by the matrix size) can greatly differ between those algorithms, depending on the nature of the matrix' entries. The possible values are defined in the 'flags.h' header file. By default, GiNaC uses a heuristic to automatically select an algorithm that is likely (but not guaranteed) to give the result most quickly. Linear systems can be solved with: matrix matrix::solve(const matrix & vars, const matrix & rhs, unsigned algo=solve_algo::automatic) const; Assuming the matrix object this method is applied on is an 'm' times 'n' matrix, then 'vars' must be a 'n' times 'p' matrix of symbolic indeterminates and 'rhs' a 'm' times 'p' matrix. The returned matrix then has dimension 'n' times 'p' and in the case of an underdetermined system will still contain some of the indeterminates from 'vars'. If the system is overdetermined, an exception is thrown. To invert a matrix, use the method: matrix matrix::inverse(unsigned algo=solve_algo::automatic) const; The 'algo' argument is optional. If given, it must be one of 'solve_algo' defined in 'flags.h'.  File: ginac.info, Node: Indexed objects, Next: Non-commutative objects, Prev: Matrices, Up: Basic concepts 4.14 Indexed objects ==================== GiNaC allows you to handle expressions containing general indexed objects in arbitrary spaces. It is also able to canonicalize and simplify such expressions and perform symbolic dummy index summations. There are a number of predefined indexed objects provided, like delta and metric tensors. There are few restrictions placed on indexed objects and their indices and it is easy to construct nonsense expressions, but our intention is to provide a general framework that allows you to implement algorithms with indexed quantities, getting in the way as little as possible. 4.14.1 Indexed quantities and their indices ------------------------------------------- Indexed expressions in GiNaC are constructed of two special types of objects, "index objects" and "indexed objects". * Index objects are of class 'idx' or a subclass. Every index has a "value" and a "dimension" (which is the dimension of the space the index lives in) which can both be arbitrary expressions but are usually a number or a simple symbol. In addition, indices of class 'varidx' have a "variance" (they can be co- or contravariant), and indices of class 'spinidx' have a variance and can be "dotted" or "undotted". * Indexed objects are of class 'indexed' or a subclass. They contain a "base expression" (which is the expression being indexed), and one or more indices. *Please notice:* when printing expressions, covariant indices and indices without variance are denoted '.i' while contravariant indices are denoted '~i'. Dotted indices have a '*' in front of the index value. In the following, we are going to use that notation in the text so instead of A^i_jk we will write 'A~i.j.k'. Index dimensions are not visible in the output. A simple example shall illustrate the concepts: #include #include using namespace std; using namespace GiNaC; int main() { symbol i_sym("i"), j_sym("j"); idx i(i_sym, 3), j(j_sym, 3); symbol A("A"); cout << indexed(A, i, j) << endl; // -> A.i.j cout << index_dimensions << indexed(A, i, j) << endl; // -> A.i[3].j[3] cout << dflt; // reset cout to default output format (dimensions hidden) ... The 'idx' constructor takes two arguments, the index value and the index dimension. First we define two index objects, 'i' and 'j', both with the numeric dimension 3. The value of the index 'i' is the symbol 'i_sym' (which prints as 'i') and the value of the index 'j' is the symbol 'j_sym' (which prints as 'j'). Next we construct an expression containing one indexed object, 'A.i.j'. It has the symbol 'A' as its base expression and the two indices 'i' and 'j'. The dimensions of indices are normally not visible in the output, but one can request them to be printed with the 'index_dimensions' manipulator, as shown above. Note the difference between the indices 'i' and 'j' which are of class 'idx', and the index values which are the symbols 'i_sym' and 'j_sym'. The indices of indexed objects cannot directly be symbols or numbers but must be index objects. For example, the following is not correct and will raise an exception: symbol i("i"), j("j"); e = indexed(A, i, j); // ERROR: indices must be of type idx You can have multiple indexed objects in an expression, index values can be numeric, and index dimensions symbolic: ... symbol B("B"), dim("dim"); cout << 4 * indexed(A, i) + indexed(B, idx(j_sym, 4), idx(2, 3), idx(i_sym, dim)) << endl; // -> B.j.2.i+4*A.i ... 'B' has a 4-dimensional symbolic index 'k', a 3-dimensional numeric index of value 2, and a symbolic index 'i' with the symbolic dimension 'dim'. Note that GiNaC doesn't automatically notify you that the free indices of 'A' and 'B' in the sum don't match (you have to call 'simplify_indexed()' for that, see below). In fact, base expressions, index values and index dimensions can be arbitrary expressions: ... cout << indexed(A+B, idx(2*i_sym+1, dim/2)) << endl; // -> (B+A).(1+2*i) ... It's also possible to construct nonsense like 'Pi.sin(x)'. You will not get an error message from this but you will probably not be able to do anything useful with it. The methods ex idx::get_value(); ex idx::get_dim(); return the value and dimension of an 'idx' object. If you have an index in an expression, such as returned by calling '.op()' on an indexed object, you can get a reference to the 'idx' object with the function 'ex_to()' on the expression. There are also the methods bool idx::is_numeric(); bool idx::is_symbolic(); bool idx::is_dim_numeric(); bool idx::is_dim_symbolic(); for checking whether the value and dimension are numeric or symbolic (non-numeric). Using the 'info()' method of an index (see *note Information about expressions::) returns information about the index value. If you need co- and contravariant indices, use the 'varidx' class: ... symbol mu_sym("mu"), nu_sym("nu"); varidx mu(mu_sym, 4), nu(nu_sym, 4); // default is contravariant ~mu, ~nu varidx mu_co(mu_sym, 4, true); // covariant index .mu cout << indexed(A, mu, nu) << endl; // -> A~mu~nu cout << indexed(A, mu_co, nu) << endl; // -> A.mu~nu cout << indexed(A, mu.toggle_variance(), nu) << endl; // -> A.mu~nu ... A 'varidx' is an 'idx' with an additional flag that marks it as co- or contravariant. The default is a contravariant (upper) index, but this can be overridden by supplying a third argument to the 'varidx' constructor. The two methods bool varidx::is_covariant(); bool varidx::is_contravariant(); allow you to check the variance of a 'varidx' object (use 'ex_to()' to get the object reference from an expression). There's also the very useful method ex varidx::toggle_variance(); which makes a new index with the same value and dimension but the opposite variance. By using it you only have to define the index once. The 'spinidx' class provides dotted and undotted variant indices, as used in the Weyl-van-der-Waerden spinor formalism: ... symbol K("K"), C_sym("C"), D_sym("D"); spinidx C(C_sym, 2), D(D_sym); // default is 2-dimensional, // contravariant, undotted spinidx C_co(C_sym, 2, true); // covariant index spinidx D_dot(D_sym, 2, false, true); // contravariant, dotted spinidx D_co_dot(D_sym, 2, true, true); // covariant, dotted cout << indexed(K, C, D) << endl; // -> K~C~D cout << indexed(K, C_co, D_dot) << endl; // -> K.C~*D cout << indexed(K, D_co_dot, D) << endl; // -> K.*D~D ... A 'spinidx' is a 'varidx' with an additional flag that marks it as dotted or undotted. The default is undotted but this can be overridden by supplying a fourth argument to the 'spinidx' constructor. The two methods bool spinidx::is_dotted(); bool spinidx::is_undotted(); allow you to check whether or not a 'spinidx' object is dotted (use 'ex_to()' to get the object reference from an expression). Finally, the two methods ex spinidx::toggle_dot(); ex spinidx::toggle_variance_dot(); create a new index with the same value and dimension but opposite dottedness and the same or opposite variance. 4.14.2 Substituting indices --------------------------- Sometimes you will want to substitute one symbolic index with another symbolic or numeric index, for example when calculating one specific element of a tensor expression. This is done with the '.subs()' method, as it is done for symbols (see *note Substituting expressions::). You have two possibilities here. You can either substitute the whole index by another index or expression: ... ex e = indexed(A, mu_co); cout << e << " becomes " << e.subs(mu_co == nu) << endl; // -> A.mu becomes A~nu cout << e << " becomes " << e.subs(mu_co == varidx(0, 4)) << endl; // -> A.mu becomes A~0 cout << e << " becomes " << e.subs(mu_co == 0) << endl; // -> A.mu becomes A.0 ... The third example shows that trying to replace an index with something that is not an index will substitute the index value instead. Alternatively, you can substitute the _symbol_ of a symbolic index by another expression: ... ex e = indexed(A, mu_co); cout << e << " becomes " << e.subs(mu_sym == nu_sym) << endl; // -> A.mu becomes A.nu cout << e << " becomes " << e.subs(mu_sym == 0) << endl; // -> A.mu becomes A.0 ... As you see, with the second method only the value of the index will get substituted. Its other properties, including its dimension, remain unchanged. If you want to change the dimension of an index you have to substitute the whole index by another one with the new dimension. Finally, substituting the base expression of an indexed object works as expected: ... ex e = indexed(A, mu_co); cout << e << " becomes " << e.subs(A == A+B) << endl; // -> A.mu becomes (B+A).mu ... 4.14.3 Symmetries ----------------- Indexed objects can have certain symmetry properties with respect to their indices. Symmetries are specified as a tree of objects of class 'symmetry' that is constructed with the helper functions symmetry sy_none(...); symmetry sy_symm(...); symmetry sy_anti(...); symmetry sy_cycl(...); 'sy_none()' stands for no symmetry, 'sy_symm()' and 'sy_anti()' specify fully symmetric or antisymmetric, respectively, and 'sy_cycl()' represents a cyclic symmetry. Each of these functions accepts up to four arguments which can be either symmetry objects themselves or unsigned integer numbers that represent an index position (counting from 0). A symmetry specification that consists of only a single 'sy_symm()', 'sy_anti()' or 'sy_cycl()' with no arguments specifies the respective symmetry for all indices. Here are some examples of symmetry definitions: ... // No symmetry: e = indexed(A, i, j); e = indexed(A, sy_none(), i, j); // equivalent e = indexed(A, sy_none(0, 1), i, j); // equivalent // Symmetric in all three indices: e = indexed(A, sy_symm(), i, j, k); e = indexed(A, sy_symm(0, 1, 2), i, j, k); // equivalent e = indexed(A, sy_symm(2, 0, 1), i, j, k); // same symmetry, but yields a // different canonical order // Symmetric in the first two indices only: e = indexed(A, sy_symm(0, 1), i, j, k); e = indexed(A, sy_none(sy_symm(0, 1), 2), i, j, k); // equivalent // Antisymmetric in the first and last index only (index ranges need not // be contiguous): e = indexed(A, sy_anti(0, 2), i, j, k); e = indexed(A, sy_none(sy_anti(0, 2), 1), i, j, k); // equivalent // An example of a mixed symmetry: antisymmetric in the first two and // last two indices, symmetric when swapping the first and last index // pairs (like the Riemann curvature tensor): e = indexed(A, sy_symm(sy_anti(0, 1), sy_anti(2, 3)), i, j, k, l); // Cyclic symmetry in all three indices: e = indexed(A, sy_cycl(), i, j, k); e = indexed(A, sy_cycl(0, 1, 2), i, j, k); // equivalent // The following examples are invalid constructions that will throw // an exception at run time. // An index may not appear multiple times: e = indexed(A, sy_symm(0, 0, 1), i, j, k); // ERROR e = indexed(A, sy_none(sy_symm(0, 1), sy_anti(0, 2)), i, j, k); // ERROR // Every child of sy_symm(), sy_anti() and sy_cycl() must refer to the // same number of indices: e = indexed(A, sy_symm(sy_anti(0, 1), 2), i, j, k); // ERROR // And of course, you cannot specify indices which are not there: e = indexed(A, sy_symm(0, 1, 2, 3), i, j, k); // ERROR ... If you need to specify more than four indices, you have to use the '.add()' method of the 'symmetry' class. For example, to specify full symmetry in the first six indices you would write 'sy_symm(0, 1, 2, 3).add(4).add(5)'. If an indexed object has a symmetry, GiNaC will automatically bring the indices into a canonical order which allows for some immediate simplifications: ... cout << indexed(A, sy_symm(), i, j) + indexed(A, sy_symm(), j, i) << endl; // -> 2*A.j.i cout << indexed(B, sy_anti(), i, j) + indexed(B, sy_anti(), j, i) << endl; // -> 0 cout << indexed(B, sy_anti(), i, j, k) - indexed(B, sy_anti(), j, k, i) << endl; // -> 0 ... 4.14.4 Dummy indices -------------------- GiNaC treats certain symbolic index pairs as "dummy indices" meaning that a summation over the index range is implied. Symbolic indices which are not dummy indices are called "free indices". Numeric indices are neither dummy nor free indices. To be recognized as a dummy index pair, the two indices must be of the same class and their value must be the same single symbol (an index like '2*n+1' is never a dummy index). If the indices are of class 'varidx' they must also be of opposite variance; if they are of class 'spinidx' they must be both dotted or both undotted. The method '.get_free_indices()' returns a vector containing the free indices of an expression. It also checks that the free indices of the terms of a sum are consistent: { symbol A("A"), B("B"), C("C"); symbol i_sym("i"), j_sym("j"), k_sym("k"), l_sym("l"); idx i(i_sym, 3), j(j_sym, 3), k(k_sym, 3), l(l_sym, 3); ex e = indexed(A, i, j) * indexed(B, j, k) + indexed(C, k, l, i, l); cout << exprseq(e.get_free_indices()) << endl; // -> (.i,.k) // 'j' and 'l' are dummy indices symbol mu_sym("mu"), nu_sym("nu"), rho_sym("rho"), sigma_sym("sigma"); varidx mu(mu_sym, 4), nu(nu_sym, 4), rho(rho_sym, 4), sigma(sigma_sym, 4); e = indexed(A, mu, nu) * indexed(B, nu.toggle_variance(), rho) + indexed(C, mu, sigma, rho, sigma.toggle_variance()); cout << exprseq(e.get_free_indices()) << endl; // -> (~mu,~rho) // 'nu' is a dummy index, but 'sigma' is not e = indexed(A, mu, mu); cout << exprseq(e.get_free_indices()) << endl; // -> (~mu) // 'mu' is not a dummy index because it appears twice with the same // variance e = indexed(A, mu, nu) + 42; cout << exprseq(e.get_free_indices()) << endl; // ERROR // this will throw an exception: // "add::get_free_indices: inconsistent indices in sum" } A dummy index summation like a.i b~i can be expanded for indices with numeric dimensions (e.g. 3) into the explicit sum like a.1 b~1 + a.2 b~2 + a.3 b~3. This is performed by the function ex expand_dummy_sum(const ex & e, bool subs_idx = false); which takes an expression 'e' and returns the expanded sum for all dummy indices with numeric dimensions. If the parameter 'subs_idx' is set to 'true' then all substitutions are made by 'idx' class indices, i.e. without variance. In this case the above sum a.i b~i will be expanded to a.1 b.1 + a.2 b.2 + a.3 b.3. 4.14.5 Simplifying indexed expressions -------------------------------------- In addition to the few automatic simplifications that GiNaC performs on indexed expressions (such as re-ordering the indices of symmetric tensors and calculating traces and convolutions of matrices and predefined tensors) there is the method ex ex::simplify_indexed(); ex ex::simplify_indexed(const scalar_products & sp); that performs some more expensive operations: * it checks the consistency of free indices in sums in the same way 'get_free_indices()' does * it tries to give dummy indices that appear in different terms of a sum the same name to allow simplifications like a_i*b_i-a_j*b_j=0 * it (symbolically) calculates all possible dummy index summations/contractions with the predefined tensors (this will be explained in more detail in the next section) * it detects contractions that vanish for symmetry reasons, for example the contraction of a symmetric and a totally antisymmetric tensor * as a special case of dummy index summation, it can replace scalar products of two tensors with a user-defined value The last point is done with the help of the 'scalar_products' class which is used to store scalar products with known values (this is not an arithmetic class, you just pass it to 'simplify_indexed()'): { symbol A("A"), B("B"), C("C"), i_sym("i"); idx i(i_sym, 3); scalar_products sp; sp.add(A, B, 0); // A and B are orthogonal sp.add(A, C, 0); // A and C are orthogonal sp.add(A, A, 4); // A^2 = 4 (A has length 2) e = indexed(A + B, i) * indexed(A + C, i); cout << e << endl; // -> (B+A).i*(A+C).i cout << e.expand(expand_options::expand_indexed).simplify_indexed(sp) << endl; // -> 4+C.i*B.i } The 'scalar_products' object 'sp' acts as a storage for the scalar products added to it with the '.add()' method. This method takes three arguments: the two expressions of which the scalar product is taken, and the expression to replace it with. The example above also illustrates a feature of the 'expand()' method: if passed the 'expand_indexed' option it will distribute indices over sums, so '(A+B).i' becomes 'A.i+B.i'. 4.14.6 Predefined tensors ------------------------- Some frequently used special tensors such as the delta, epsilon and metric tensors are predefined in GiNaC. They have special properties when contracted with other tensor expressions and some of them have constant matrix representations (they will evaluate to a number when numeric indices are specified). 4.14.6.1 Delta tensor ..................... The delta tensor takes two indices, is symmetric and has the matrix representation 'diag(1, 1, 1, ...)'. It is constructed by the function 'delta_tensor()': { symbol A("A"), B("B"); idx i(symbol("i"), 3), j(symbol("j"), 3), k(symbol("k"), 3), l(symbol("l"), 3); ex e = indexed(A, i, j) * indexed(B, k, l) * delta_tensor(i, k) * delta_tensor(j, l); cout << e.simplify_indexed() << endl; // -> B.i.j*A.i.j cout << delta_tensor(i, i) << endl; // -> 3 } 4.14.6.2 General metric tensor .............................. The function 'metric_tensor()' creates a general symmetric metric tensor with two indices that can be used to raise/lower tensor indices. The metric tensor is denoted as 'g' in the output and if its indices are of mixed variance it is automatically replaced by a delta tensor: { symbol A("A"); varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4), rho(symbol("rho"), 4); ex e = metric_tensor(mu, nu) * indexed(A, nu.toggle_variance(), rho); cout << e.simplify_indexed() << endl; // -> A~mu~rho e = delta_tensor(mu, nu.toggle_variance()) * metric_tensor(nu, rho); cout << e.simplify_indexed() << endl; // -> g~mu~rho e = metric_tensor(mu.toggle_variance(), nu.toggle_variance()) * metric_tensor(nu, rho); cout << e.simplify_indexed() << endl; // -> delta.mu~rho e = metric_tensor(nu.toggle_variance(), rho.toggle_variance()) * metric_tensor(mu, nu) * (delta_tensor(mu.toggle_variance(), rho) + indexed(A, mu.toggle_variance(), rho)); cout << e.simplify_indexed() << endl; // -> 4+A.rho~rho } 4.14.6.3 Minkowski metric tensor ................................ The Minkowski metric tensor is a special metric tensor with a constant matrix representation which is either 'diag(1, -1, -1, ...)' (negative signature, the default) or 'diag(-1, 1, 1, ...)' (positive signature). It is created with the function 'lorentz_g()' (although it is output as 'eta'): { varidx mu(symbol("mu"), 4); e = delta_tensor(varidx(0, 4), mu.toggle_variance()) * lorentz_g(mu, varidx(0, 4)); // negative signature cout << e.simplify_indexed() << endl; // -> 1 e = delta_tensor(varidx(0, 4), mu.toggle_variance()) * lorentz_g(mu, varidx(0, 4), true); // positive signature cout << e.simplify_indexed() << endl; // -> -1 } 4.14.6.4 Spinor metric tensor ............................. The function 'spinor_metric()' creates an antisymmetric tensor with two indices that is used to raise/lower indices of 2-component spinors. It is output as 'eps': { symbol psi("psi"); spinidx A(symbol("A")), B(symbol("B")), C(symbol("C")); ex A_co = A.toggle_variance(), B_co = B.toggle_variance(); e = spinor_metric(A, B) * indexed(psi, B_co); cout << e.simplify_indexed() << endl; // -> psi~A e = spinor_metric(A, B) * indexed(psi, A_co); cout << e.simplify_indexed() << endl; // -> -psi~B e = spinor_metric(A_co, B_co) * indexed(psi, B); cout << e.simplify_indexed() << endl; // -> -psi.A e = spinor_metric(A_co, B_co) * indexed(psi, A); cout << e.simplify_indexed() << endl; // -> psi.B e = spinor_metric(A_co, B_co) * spinor_metric(A, B); cout << e.simplify_indexed() << endl; // -> 2 e = spinor_metric(A_co, B_co) * spinor_metric(B, C); cout << e.simplify_indexed() << endl; // -> -delta.A~C } The matrix representation of the spinor metric is '[[0, 1], [-1, 0]]'. 4.14.6.5 Epsilon tensor ....................... The epsilon tensor is totally antisymmetric, its number of indices is equal to the dimension of the index space (the indices must all be of the same numeric dimension), and 'eps.1.2.3...' (resp. 'eps~0~1~2...') is defined to be 1. Its behavior with indices that have a variance also depends on the signature of the metric. Epsilon tensors are output as 'eps'. There are three functions defined to create epsilon tensors in 2, 3 and 4 dimensions: ex epsilon_tensor(const ex & i1, const ex & i2); ex epsilon_tensor(const ex & i1, const ex & i2, const ex & i3); ex lorentz_eps(const ex & i1, const ex & i2, const ex & i3, const ex & i4, bool pos_sig = false); The first two functions create an epsilon tensor in 2 or 3 Euclidean dimensions, the last function creates an epsilon tensor in a 4-dimensional Minkowski space (the last 'bool' argument specifies whether the metric has negative or positive signature, as in the case of the Minkowski metric tensor): { varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4), rho(symbol("rho"), 4), sig(symbol("sig"), 4), lam(symbol("lam"), 4), bet(symbol("bet"), 4); e = lorentz_eps(mu, nu, rho, sig) * lorentz_eps(mu.toggle_variance(), nu.toggle_variance(), lam, bet); cout << simplify_indexed(e) << endl; // -> 2*eta~bet~rho*eta~sig~lam-2*eta~sig~bet*eta~rho~lam idx i(symbol("i"), 3), j(symbol("j"), 3), k(symbol("k"), 3); symbol A("A"), B("B"); e = epsilon_tensor(i, j, k) * indexed(A, j) * indexed(B, k); cout << simplify_indexed(e) << endl; // -> -B.k*A.j*eps.i.k.j e = epsilon_tensor(i, j, k) * indexed(A, j) * indexed(A, k); cout << simplify_indexed(e) << endl; // -> 0 } 4.14.7 Linear algebra --------------------- The 'matrix' class can be used with indices to do some simple linear algebra (linear combinations and products of vectors and matrices, traces and scalar products): { idx i(symbol("i"), 2), j(symbol("j"), 2); symbol x("x"), y("y"); // A is a 2x2 matrix, X is a 2x1 vector matrix A = {{1, 2}, {3, 4}}; matrix X = {{x, y}}; cout << indexed(A, i, i) << endl; // -> 5 ex e = indexed(A, i, j) * indexed(X, j); cout << e.simplify_indexed() << endl; // -> [[2*y+x],[4*y+3*x]].i e = indexed(A, i, j) * indexed(X, i) + indexed(X, j) * 2; cout << e.simplify_indexed() << endl; // -> [[3*y+3*x,6*y+2*x]].j } You can of course obtain the same results with the 'matrix::add()', 'matrix::mul()' and 'matrix::trace()' methods (*note Matrices::) but with indices you don't have to worry about transposing matrices. Matrix indices always start at 0 and their dimension must match the number of rows/columns of the matrix. Matrices with one row or one column are vectors and can have one or two indices (it doesn't matter whether it's a row or a column vector). Other matrices must have two indices. You should be careful when using indices with variance on matrices. GiNaC doesn't look at the variance and doesn't know that 'F~mu~nu' and 'F.mu.nu' are different matrices. In this case you should use only one form for 'F' and explicitly multiply it with a matrix representation of the metric tensor.  File: ginac.info, Node: Non-commutative objects, Next: Methods and functions, Prev: Indexed objects, Up: Basic concepts 4.15 Non-commutative objects ============================ GiNaC is equipped to handle certain non-commutative algebras. Three classes of non-commutative objects are built-in which are mostly of use in high energy physics: * Clifford (Dirac) algebra (class 'clifford') * su(3) Lie algebra (class 'color') * Matrices (unindexed) (class 'matrix') The 'clifford' and 'color' classes are subclasses of 'indexed' because the elements of these algebras usually carry indices. The 'matrix' class is described in more detail in *note Matrices::. Unlike most computer algebra systems, GiNaC does not primarily provide an operator (often denoted '&*') for representing inert products of arbitrary objects. Rather, non-commutativity in GiNaC is a property of the classes of objects involved, and non-commutative products are formed with the usual '*' operator, as are ordinary products. GiNaC is capable of figuring out by itself which objects commutate and will group the factors by their class. Consider this example: ... varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4); idx a(symbol("a"), 8), b(symbol("b"), 8); ex e = -dirac_gamma(mu) * (2*color_T(a)) * 8 * color_T(b) * dirac_gamma(nu); cout << e << endl; // -> -16*(gamma~mu*gamma~nu)*(T.a*T.b) ... As can be seen, GiNaC pulls out the overall commutative factor '-16' and groups the non-commutative factors (the gammas and the su(3) generators) together while preserving the order of factors within each class (because Clifford objects commutate with color objects). The resulting expression is a _commutative_ product with two factors that are themselves non-commutative products ('gamma~mu*gamma~nu' and 'T.a*T.b'). For clarification, parentheses are placed around the non-commutative products in the output. Non-commutative products are internally represented by objects of the class 'ncmul', as opposed to commutative products which are handled by the 'mul' class. You will normally not have to worry about this distinction, though. The advantage of this approach is that you never have to worry about using (or forgetting to use) a special operator when constructing non-commutative expressions. Also, non-commutative products in GiNaC are more intelligent than in other computer algebra systems; they can, for example, automatically canonicalize themselves according to rules specified in the implementation of the non-commutative classes. The drawback is that to work with other than the built-in algebras you have to implement new classes yourself. Both symbols and user-defined functions can be specified as being non-commutative. For symbols, this is done by subclassing class symbol; for functions, by explicitly setting the return type (*note Symbolic functions::). Information about the commutativity of an object or expression can be obtained with the two member functions unsigned ex::return_type() const; return_type_t ex::return_type_tinfo() const; The 'return_type()' function returns one of three values (defined in the header file 'flags.h'), corresponding to three categories of expressions in GiNaC: * 'return_types::commutative': Commutates with everything. Most GiNaC classes are of this kind. * 'return_types::noncommutative': Non-commutative, belonging to a certain class of non-commutative objects which can be determined with the 'return_type_tinfo()' method. Expressions of this category commutate with everything except 'noncommutative' expressions of the same class. * 'return_types::noncommutative_composite': Non-commutative, composed of non-commutative objects of different classes. Expressions of this category don't commutate with any other 'noncommutative' or 'noncommutative_composite' expressions. The 'return_type_tinfo()' method returns an object of type 'return_type_t' that contains information about the type of the expression and, if given, its representation label (see section on dirac gamma matrices for more details). The objects of type 'return_type_t' can be tested for equality to test whether two expressions belong to the same category and therefore may not commute. Here are a couple of examples: *Expression* *'return_type()'* '42' 'commutative' '2*x-y' 'commutative' 'dirac_ONE()' 'noncommutative' 'dirac_gamma(mu)*dirac_gamma(nu)' 'noncommutative' '2*color_T(a)' 'noncommutative' 'dirac_ONE()*color_T(a)' 'noncommutative_composite' A last note: With the exception of matrices, positive integer powers of non-commutative objects are automatically expanded in GiNaC. For example, 'pow(a*b, 2)' becomes 'a*b*a*b' if 'a' and 'b' are non-commutative expressions). 4.15.1 Clifford algebra ----------------------- Clifford algebras are supported in two flavours: Dirac gamma matrices (more physical) and generic Clifford algebras (more mathematical). 4.15.1.1 Dirac gamma matrices ............................. Dirac gamma matrices (note that GiNaC doesn't treat them as matrices) are designated as 'gamma~mu' and satisfy 'gamma~mu*gamma~nu + gamma~nu*gamma~mu = 2*eta~mu~nu' where 'eta~mu~nu' is the Minkowski metric tensor. Dirac gammas are constructed by the function ex dirac_gamma(const ex & mu, unsigned char rl = 0); which takes two arguments: the index and a "representation label" in the range 0 to 255 which is used to distinguish elements of different Clifford algebras (this is also called a "spin line index"). Gammas with different labels commutate with each other. The dimension of the index can be 4 or (in the framework of dimensional regularization) any symbolic value. Spinor indices on Dirac gammas are not supported in GiNaC. The unity element of a Clifford algebra is constructed by ex dirac_ONE(unsigned char rl = 0); *Please notice:* You must always use 'dirac_ONE()' when referring to multiples of the unity element, even though it's customary to omit it. E.g. instead of 'dirac_gamma(mu)*(dirac_slash(q,4)+m)' you have to write 'dirac_gamma(mu)*(dirac_slash(q,4)+m*dirac_ONE())'. Otherwise, GiNaC will complain and/or produce incorrect results. There is a special element 'gamma5' that commutates with all other gammas, has a unit square, and in 4 dimensions equals 'gamma~0 gamma~1 gamma~2 gamma~3', provided by ex dirac_gamma5(unsigned char rl = 0); The chiral projectors '(1+/-gamma5)/2' are also available as proper objects, constructed by ex dirac_gammaL(unsigned char rl = 0); ex dirac_gammaR(unsigned char rl = 0); They observe the relations 'gammaL^2 = gammaL', 'gammaR^2 = gammaR', and 'gammaL gammaR = gammaR gammaL = 0'. Finally, the function ex dirac_slash(const ex & e, const ex & dim, unsigned char rl = 0); creates a term that represents a contraction of 'e' with the Dirac Lorentz vector (it behaves like a term of the form 'e.mu gamma~mu' with a unique index whose dimension is given by the 'dim' argument). Such slashed expressions are printed with a trailing backslash, e.g. 'e\'. In products of dirac gammas, superfluous unity elements are automatically removed, squares are replaced by their values, and 'gamma5', 'gammaL' and 'gammaR' are moved to the front. The 'simplify_indexed()' function performs contractions in gamma strings, for example { ... symbol a("a"), b("b"), D("D"); varidx mu(symbol("mu"), D); ex e = dirac_gamma(mu) * dirac_slash(a, D) * dirac_gamma(mu.toggle_variance()); cout << e << endl; // -> gamma~mu*a\*gamma.mu e = e.simplify_indexed(); cout << e << endl; // -> -D*a\+2*a\ cout << e.subs(D == 4) << endl; // -> -2*a\ ... } To calculate the trace of an expression containing strings of Dirac gammas you use one of the functions ex dirac_trace(const ex & e, const std::set & rls, const ex & trONE = 4); ex dirac_trace(const ex & e, const lst & rll, const ex & trONE = 4); ex dirac_trace(const ex & e, unsigned char rl = 0, const ex & trONE = 4); These functions take the trace over all gammas in the specified set 'rls' or list 'rll' of representation labels, or the single label 'rl'; gammas with other labels are left standing. The last argument to 'dirac_trace()' is the value to be returned for the trace of the unity element, which defaults to 4. The 'dirac_trace()' function is a linear functional that is equal to the ordinary matrix trace only in D = 4 dimensions. In particular, the functional is not cyclic in D != 4 dimensions when acting on expressions containing 'gamma5', so it's not a proper trace. This 'gamma5' scheme is described in greater detail in the article 'The Role of gamma5 in Dimensional Regularization' (*note Bibliography::). The value of the trace itself is also usually different in 4 and in D != 4 dimensions: { // 4 dimensions varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4), rho(symbol("rho"), 4); ex e = dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(mu.toggle_variance()) * dirac_gamma(rho); cout << dirac_trace(e).simplify_indexed() << endl; // -> -8*eta~rho~nu } ... { // D dimensions symbol D("D"); varidx mu(symbol("mu"), D), nu(symbol("nu"), D), rho(symbol("rho"), D); ex e = dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(mu.toggle_variance()) * dirac_gamma(rho); cout << dirac_trace(e).simplify_indexed() << endl; // -> 8*eta~rho~nu-4*eta~rho~nu*D } Here is an example for using 'dirac_trace()' to compute a value that appears in the calculation of the one-loop vacuum polarization amplitude in QED: { symbol q("q"), l("l"), m("m"), ldotq("ldotq"), D("D"); varidx mu(symbol("mu"), D), nu(symbol("nu"), D); scalar_products sp; sp.add(l, l, pow(l, 2)); sp.add(l, q, ldotq); ex e = dirac_gamma(mu) * (dirac_slash(l, D) + dirac_slash(q, D) + m * dirac_ONE()) * dirac_gamma(mu.toggle_variance()) * (dirac_slash(l, D) + m * dirac_ONE()); e = dirac_trace(e).simplify_indexed(sp); e = e.collect(lst{l, ldotq, m}); cout << e << endl; // -> (8-4*D)*l^2+(8-4*D)*ldotq+4*D*m^2 } The 'canonicalize_clifford()' function reorders all gamma products that appear in an expression to a canonical (but not necessarily simple) form. You can use this to compare two expressions or for further simplifications: { varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4); ex e = dirac_gamma(mu) * dirac_gamma(nu) + dirac_gamma(nu) * dirac_gamma(mu); cout << e << endl; // -> gamma~mu*gamma~nu+gamma~nu*gamma~mu e = canonicalize_clifford(e); cout << e << endl; // -> 2*ONE*eta~mu~nu } 4.15.1.2 A generic Clifford algebra ................................... A generic Clifford algebra, i.e. a 2^n dimensional algebra with generators e_k satisfying the identities e~i e~j + e~j e~i = M(i, j) + M(j, i) for some bilinear form ('metric') M(i, j), which may be non-symmetric (see arXiv:math.QA/9911180) and contain symbolic entries. Such generators are created by the function ex clifford_unit(const ex & mu, const ex & metr, unsigned char rl = 0); where 'mu' should be a 'idx' (or descendant) class object indexing the generators. Parameter 'metr' defines the metric M(i, j) and can be represented by a square 'matrix', 'tensormetric' or 'indexed' class object. In fact, any expression either with two free indices or without indices at all is admitted as 'metr'. In the later case an 'indexed' object with two newly created indices with 'metr' as its 'op(0)' will be used. Optional parameter 'rl' allows to distinguish different Clifford algebras, which will commute with each other. Note that the call 'clifford_unit(mu, minkmetric())' creates something very close to 'dirac_gamma(mu)', although 'dirac_gamma' have more efficient simplification mechanism. Also, the object created by 'clifford_unit(mu, minkmetric())' is not aware about the symmetry of its metric, see the start of the previous paragraph. A more accurate analog of 'dirac_gamma(mu)' should be specifies as follows: clifford_unit(mu, indexed(minkmetric(),sy_symm(),varidx(symbol("i"),4),varidx(symbol("j"),4))); The method 'clifford::get_metric()' returns a metric defining this Clifford number. If the matrix M(i, j) is in fact symmetric you may prefer to create the Clifford algebra units with a call like that ex e = clifford_unit(mu, indexed(M, sy_symm(), i, j)); since this may yield some further automatic simplifications. Again, for a metric defined through a 'matrix' such a symmetry is detected automatically. Individual generators of a Clifford algebra can be accessed in several ways. For example { ... idx i(symbol("i"), 4); realsymbol s("s"); ex M = diag_matrix(lst{1, -1, 0, s}); ex e = clifford_unit(i, M); ex e0 = e.subs(i == 0); ex e1 = e.subs(i == 1); ex e2 = e.subs(i == 2); ex e3 = e.subs(i == 3); ... } will produce four anti-commuting generators of a Clifford algebra with properties 'pow(e0, 2) = 1', 'pow(e1, 2) = -1', 'pow(e2, 2) = 0' and 'pow(e3, 2) = s'. A similar effect can be achieved from the function ex lst_to_clifford(const ex & v, const ex & mu, const ex & metr, unsigned char rl = 0); ex lst_to_clifford(const ex & v, const ex & e); which converts a list or vector 'v = (v~0, v~1, ..., v~n)' into the Clifford number 'v~0 e.0 + v~1 e.1 + ... + v~n e.n' with 'e.k' directly supplied in the second form of the procedure. In the first form the Clifford unit 'e.k' is generated by the call of 'clifford_unit(mu, metr, rl)'. If the number of components supplied by 'v' exceeds the dimensionality of the Clifford unit 'e' by 1 then function 'lst_to_clifford()' uses the following pseudo-vector representation: 'v~0 ONE + v~1 e.0 + v~2 e.1 + ... + v~[n+1] e.n' The previous code may be rewritten with the help of 'lst_to_clifford()' as follows { ... idx i(symbol("i"), 4); realsymbol s("s"); ex M = diag_matrix({1, -1, 0, s}); ex e0 = lst_to_clifford(lst{1, 0, 0, 0}, i, M); ex e1 = lst_to_clifford(lst{0, 1, 0, 0}, i, M); ex e2 = lst_to_clifford(lst{0, 0, 1, 0}, i, M); ex e3 = lst_to_clifford(lst{0, 0, 0, 1}, i, M); ... } There is the inverse function lst clifford_to_lst(const ex & e, const ex & c, bool algebraic = true); which takes an expression 'e' and tries to find a list 'v = (v~0, v~1, ..., v~n)' such that the expression is either vector 'e = v~0 c.0 + v~1 c.1 + ... + v~n c.n' or pseudo-vector 'v~0 ONE + v~1 e.0 + v~2 e.1 + ... + v~[n+1] e.n' with respect to the given Clifford units 'c'. Here none of the 'v~k' should contain Clifford units 'c' (of course, this may be impossible). This function can use an 'algebraic' method (default) or a symbolic one. With the 'algebraic' method the 'v~k' are calculated as '(e c.k + c.k e)/pow(c.k, 2)'. If 'pow(c.k, 2)' is zero or is not 'numeric' for some 'k' then the method will be automatically changed to symbolic. The same effect is obtained by the assignment ('algebraic = false') in the procedure call. There are several functions for (anti-)automorphisms of Clifford algebras: ex clifford_prime(const ex & e) inline ex clifford_star(const ex & e) inline ex clifford_bar(const ex & e) The automorphism of a Clifford algebra 'clifford_prime()' simply changes signs of all Clifford units in the expression. The reversion of a Clifford algebra 'clifford_star()' reverses the order of Clifford units in any product. Finally the main anti-automorphism of a Clifford algebra 'clifford_bar()' is the composition of the previous two, i.e. it makes the reversion and changes signs of all Clifford units in a product. These functions correspond to the notations e', e* and '\bar{e}' used in Clifford algebra textbooks. The function ex clifford_norm(const ex & e); calculates the norm of a Clifford number from the expression '||e||^2 = e \bar{e}' The inverse of a Clifford expression is returned by the function ex clifford_inverse(const ex & e); which calculates it as e^{-1} = \bar{e}/||e||^2 If ||e||=0 then an exception is raised. If a Clifford number happens to be a factor of 'dirac_ONE()' then we can convert it to a "real" (non-Clifford) expression by the function ex remove_dirac_ONE(const ex & e); The function 'canonicalize_clifford()' works for a generic Clifford algebra in a similar way as for Dirac gammas. The next provided function is ex clifford_moebius_map(const ex & a, const ex & b, const ex & c, const ex & d, const ex & v, const ex & G, unsigned char rl = 0); ex clifford_moebius_map(const ex & M, const ex & v, const ex & G, unsigned char rl = 0); It takes a list or vector 'v' and makes the Moebius (conformal or linear-fractional) transformation 'v -> (av+b)/(cv+d)' defined by the matrix 'M = [[a, b], [c, d]]'. The parameter 'G' defines the metric of the surrounding (pseudo-)Euclidean space. This can be an indexed object, tensormetric, matrix or a Clifford unit, in the later case the optional parameter 'rl' is ignored even if supplied. Depending from the type of 'v' the returned value of this function is either a vector or a list holding vector's components. Finally the function char clifford_max_label(const ex & e, bool ignore_ONE = false); can detect a presence of Clifford objects in the expression 'e': if such objects are found it returns the maximal 'representation_label' of them, otherwise '-1'. The optional parameter 'ignore_ONE' indicates if 'dirac_ONE' objects should be ignored during the search. LaTeX output for Clifford units looks like '\clifford[1]{e}^{{\nu}}', where '1' is the 'representation_label' and '\nu' is the index of the corresponding unit. This provides a flexible typesetting with a suitable definition of the '\clifford' command. For example, the definition \newcommand{\clifford}[1][]{} typesets all Clifford units identically, while the alternative definition \newcommand{\clifford}[2][]{\ifcase #1 #2\or \tilde{#2} \or \breve{#2} \fi} prints units with 'representation_label=0' as 'e', with 'representation_label=1' as '\tilde{e}' and with 'representation_label=2' as '\breve{e}'. 4.15.2 Color algebra -------------------- For computations in quantum chromodynamics, GiNaC implements the base elements and structure constants of the su(3) Lie algebra (color algebra). The base elements T_a are constructed by the function ex color_T(const ex & a, unsigned char rl = 0); which takes two arguments: the index and a "representation label" in the range 0 to 255 which is used to distinguish elements of different color algebras. Objects with different labels commutate with each other. The dimension of the index must be exactly 8 and it should be of class 'idx', not 'varidx'. The unity element of a color algebra is constructed by ex color_ONE(unsigned char rl = 0); *Please notice:* You must always use 'color_ONE()' when referring to multiples of the unity element, even though it's customary to omit it. E.g. instead of 'color_T(a)*(color_T(b)*indexed(X,b)+1)' you have to write 'color_T(a)*(color_T(b)*indexed(X,b)+color_ONE())'. Otherwise, GiNaC may produce incorrect results. The functions ex color_d(const ex & a, const ex & b, const ex & c); ex color_f(const ex & a, const ex & b, const ex & c); create the symmetric and antisymmetric structure constants d_abc and f_abc which satisfy {T_a, T_b} = 1/3 delta_ab + d_abc T_c and [T_a, T_b] = i f_abc T_c. These functions evaluate to their numerical values, if you supply numeric indices to them. The index values should be in the range from 1 to 8, not from 0 to 7. This departure from usual conventions goes along better with the notations used in physical literature. There's an additional function ex color_h(const ex & a, const ex & b, const ex & c); which returns the linear combination 'color_d(a, b, c)+I*color_f(a, b, c)'. The function 'simplify_indexed()' performs some simplifications on expressions containing color objects: { ... idx a(symbol("a"), 8), b(symbol("b"), 8), c(symbol("c"), 8), k(symbol("k"), 8), l(symbol("l"), 8); e = color_d(a, b, l) * color_f(a, b, k); cout << e.simplify_indexed() << endl; // -> 0 e = color_d(a, b, l) * color_d(a, b, k); cout << e.simplify_indexed() << endl; // -> 5/3*delta.k.l e = color_f(l, a, b) * color_f(a, b, k); cout << e.simplify_indexed() << endl; // -> 3*delta.k.l e = color_h(a, b, c) * color_h(a, b, c); cout << e.simplify_indexed() << endl; // -> -32/3 e = color_h(a, b, c) * color_T(b) * color_T(c); cout << e.simplify_indexed() << endl; // -> -2/3*T.a e = color_h(a, b, c) * color_T(a) * color_T(b) * color_T(c); cout << e.simplify_indexed() << endl; // -> -8/9*ONE e = color_T(k) * color_T(a) * color_T(b) * color_T(k); cout << e.simplify_indexed() << endl; // -> 1/4*delta.b.a*ONE-1/6*T.a*T.b ... To calculate the trace of an expression containing color objects you use one of the functions ex color_trace(const ex & e, const std::set & rls); ex color_trace(const ex & e, const lst & rll); ex color_trace(const ex & e, unsigned char rl = 0); These functions take the trace over all color 'T' objects in the specified set 'rls' or list 'rll' of representation labels, or the single label 'rl'; 'T's with other labels are left standing. For example: ... e = color_trace(4 * color_T(a) * color_T(b) * color_T(c)); cout << e << endl; // -> -I*f.a.c.b+d.a.c.b }  File: ginac.info, Node: Methods and functions, Next: Information about expressions, Prev: Non-commutative objects, Up: Top 5 Methods and functions *********************** In this chapter the most important algorithms provided by GiNaC will be described. Some of them are implemented as functions on expressions, others are implemented as methods provided by expression objects. If they are methods, there exists a wrapper function around it, so you can alternatively call it in a functional way as shown in the simple example: ... cout << "As method: " << sin(1).evalf() << endl; cout << "As function: " << evalf(sin(1)) << endl; ... The general rule is that wherever methods accept one or more parameters (ARG1, ARG2, ...) the order of arguments the function wrapper accepts is the same but preceded by the object to act on (OBJECT, ARG1, ARG2, ...). This approach is the most natural one in an OO model but it may lead to confusion for MapleV users because where they would type 'A:=x+1; subs(x=2,A);' GiNaC would require 'A=x+1; subs(A,x==2);' (after proper declaration of 'A' and 'x'). On the other hand, since MapleV returns 3 on 'A:=x^2+3; coeff(A,x,0);' (GiNaC: 'A=pow(x,2)+3; coeff(A,x,0);') it is clear that MapleV is not trying to be consistent here. Also, users of MuPAD will in most cases feel more comfortable with GiNaC's convention. All function wrappers are implemented as simple inline functions which just call the corresponding method and are only provided for users uncomfortable with OO who are dead set to avoid method invocations. Generally, nested function wrappers are much harder to read than a sequence of methods and should therefore be avoided if possible. On the other hand, not everything in GiNaC is a method on class 'ex' and sometimes calling a function cannot be avoided. * Menu: * Information about expressions:: * Numerical evaluation:: * Substituting expressions:: * Pattern matching and advanced substitutions:: * Applying a function on subexpressions:: * Visitors and tree traversal:: * Polynomial arithmetic:: Working with polynomials. * Rational expressions:: Working with rational functions. * Symbolic differentiation:: * Series expansion:: Taylor and Laurent expansion. * Symmetrization:: * Built-in functions:: List of predefined mathematical functions. * Multiple polylogarithms:: * Complex expressions:: * Solving linear systems of equations:: * Input/output:: Input and output of expressions.  File: ginac.info, Node: Information about expressions, Next: Numerical evaluation, Prev: Methods and functions, Up: Methods and functions 5.1 Getting information about expressions ========================================= 5.1.1 Checking expression types ------------------------------- Sometimes it's useful to check whether a given expression is a plain number, a sum, a polynomial with integer coefficients, or of some other specific type. GiNaC provides a couple of functions for this: bool is_a(const ex & e); bool is_exactly_a(const ex & e); bool ex::info(unsigned flag); unsigned ex::return_type() const; return_type_t ex::return_type_tinfo() const; When the test made by 'is_a()' returns true, it is safe to call one of the functions 'ex_to()', where 'T' is one of the class names (*Note The class hierarchy::, for a list of all classes). For example, assuming 'e' is an 'ex': { ... if (is_a(e)) numeric n = ex_to(e); ... } 'is_a(e)' allows you to check whether the top-level object of an expression 'e' is an instance of the GiNaC class 'T' (*Note The class hierarchy::, for a list of all classes). This is most useful, e.g., for checking whether an expression is a number, a sum, or a product: { symbol x("x"); ex e1 = 42; ex e2 = 4*x - 3; is_a(e1); // true is_a(e2); // false is_a(e1); // false is_a(e2); // true is_a(e1); // false is_a(e2); // false } In contrast, 'is_exactly_a(e)' allows you to check whether the top-level object of an expression 'e' is an instance of the GiNaC class 'T', not including parent classes. The 'info()' method is used for checking certain attributes of expressions. The possible values for the 'flag' argument are defined in 'ginac/flags.h', the most important being explained in the following table: *Flag* *Returns true if the object is...* 'numeric' ...a number (same as 'is_a(...)') 'real' ...a real number, symbol or constant (i.e. is not complex) 'rational' ...an exact rational number (integers are rational, too) 'integer' ...a (non-complex) integer 'crational' ...an exact (complex) rational number (such as 2/3+7/2*I) 'cinteger' ...a (complex) integer (such as 2-3*I) 'positive' ...not complex and greater than 0 'negative' ...not complex and less than 0 'nonnegative' ...not complex and greater than or equal to 0 'posint' ...an integer greater than 0 'negint' ...an integer less than 0 'nonnegint' ...an integer greater than or equal to 0 'even' ...an even integer 'odd' ...an odd integer 'prime' ...a prime integer (probabilistic primality test) 'relation' ...a relation (same as 'is_a(...)') 'relation_equal' ...a '==' relation 'relation_not_equal' ...a '!=' relation 'relation_less' ...a '<' relation 'relation_less_or_equal'...a '<=' relation 'relation_greater' ...a '>' relation 'relation_greater_or_equal'...a '>=' relation 'symbol' ...a symbol (same as 'is_a(...)') 'list' ...a list (same as 'is_a(...)') 'polynomial' ...a polynomial (i.e. only consists of sums and products of numbers and symbols with positive integer powers) 'integer_polynomial' ...a polynomial with (non-complex) integer coefficients 'cinteger_polynomial' ...a polynomial with (possibly complex) integer coefficients (such as 2-3*I) 'rational_polynomial' ...a polynomial with (non-complex) rational coefficients 'crational_polynomial' ...a polynomial with (possibly complex) rational coefficients (such as 2/3+7/2*I) 'rational_function' ...a rational function (x+y, z/(x+y)) To determine whether an expression is commutative or non-commutative and if so, with which other expressions it would commutate, you use the methods 'return_type()' and 'return_type_tinfo()'. *Note Non-commutative objects::, for an explanation of these. 5.1.2 Accessing subexpressions ------------------------------ Many GiNaC classes, like 'add', 'mul', 'lst', and 'function', act as containers for subexpressions. For example, the subexpressions of a sum (an 'add' object) are the individual terms, and the subexpressions of a 'function' are the function's arguments. GiNaC provides several ways of accessing subexpressions. The first way is to use the two methods size_t ex::nops(); ex ex::op(size_t i); 'nops()' determines the number of subexpressions (operands) contained in the expression, while 'op(i)' returns the 'i'-th (0..'nops()-1') subexpression. In the case of a 'power' object, 'op(0)' will return the basis and 'op(1)' the exponent. For 'indexed' objects, 'op(0)' is the base expression and 'op(i)', i>0 are the indices. The second way to access subexpressions is via the STL-style random-access iterator class 'const_iterator' and the methods const_iterator ex::begin(); const_iterator ex::end(); 'begin()' returns an iterator referring to the first subexpression; 'end()' returns an iterator which is one-past the last subexpression. If the expression has no subexpressions, then 'begin() == end()'. These iterators can also be used in conjunction with non-modifying STL algorithms. Here is an example that (non-recursively) prints the subexpressions of a given expression in three different ways: { ex e = ... // with nops()/op() for (size_t i = 0; i != e.nops(); ++i) cout << e.op(i) << endl; // with iterators for (const_iterator i = e.begin(); i != e.end(); ++i) cout << *i << endl; // with iterators and STL copy() std::copy(e.begin(), e.end(), std::ostream_iterator(cout, "\n")); } 'op()'/'nops()' and 'const_iterator' only access an expression's immediate children. GiNaC provides two additional iterator classes, 'const_preorder_iterator' and 'const_postorder_iterator', that iterate over all objects in an expression tree, in preorder or postorder, respectively. They are STL-style forward iterators, and are created with the methods const_preorder_iterator ex::preorder_begin(); const_preorder_iterator ex::preorder_end(); const_postorder_iterator ex::postorder_begin(); const_postorder_iterator ex::postorder_end(); The following example illustrates the differences between 'const_iterator', 'const_preorder_iterator', and 'const_postorder_iterator': { symbol A("A"), B("B"), C("C"); ex e = lst{lst{A, B}, C}; std::copy(e.begin(), e.end(), std::ostream_iterator(cout, "\n")); // {A,B} // C std::copy(e.preorder_begin(), e.preorder_end(), std::ostream_iterator(cout, "\n")); // {{A,B},C} // {A,B} // A // B // C std::copy(e.postorder_begin(), e.postorder_end(), std::ostream_iterator(cout, "\n")); // A // B // {A,B} // C // {{A,B},C} } Finally, the left-hand side and right-hand side expressions of objects of class 'relational' (and only of these) can also be accessed with the methods ex ex::lhs(); ex ex::rhs(); 5.1.3 Comparing expressions --------------------------- Expressions can be compared with the usual C++ relational operators like '==', '>', and '<' but if the expressions contain symbols, the result is usually not determinable and the result will be 'false', except in the case of the '!=' operator. You should also be aware that GiNaC will only do the most trivial test for equality (subtracting both expressions), so something like '(pow(x,2)+x)/x==x+1' will return 'false'. Actually, if you construct an expression like 'a == b', this will be represented by an object of the 'relational' class (*note Relations::) which is not evaluated until (explicitly or implicitly) cast to a 'bool'. There are also two methods bool ex::is_equal(const ex & other); bool ex::is_zero(); for checking whether one expression is equal to another, or equal to zero, respectively. See also the method 'ex::is_zero_matrix()', *note Matrices::. 5.1.4 Ordering expressions -------------------------- Sometimes it is necessary to establish a mathematically well-defined ordering on a set of arbitrary expressions, for example to use expressions as keys in a 'std::map<>' container, or to bring a vector of expressions into a canonical order (which is done internally by GiNaC for sums and products). The operators '<', '>' etc. described in the last section cannot be used for this, as they don't implement an ordering relation in the mathematical sense. In particular, they are not guaranteed to be antisymmetric: if 'a' and 'b' are different expressions, and 'a < b' yields 'false', then 'b < a' doesn't necessarily yield 'true'. By default, STL classes and algorithms use the '<' and '==' operators to compare objects, which are unsuitable for expressions, but GiNaC provides two functors that can be supplied as proper binary comparison predicates to the STL: class ex_is_less { public: bool operator()(const ex &lh, const ex &rh) const; }; class ex_is_equal { public: bool operator()(const ex &lh, const ex &rh) const; }; For example, to define a 'map' that maps expressions to strings you have to use std::map myMap; Omitting the 'ex_is_less' template parameter will introduce spurious bugs because the map operates improperly. Other examples for the use of the functors: std::vector v; // fill vector ... // sort vector std::sort(v.begin(), v.end(), ex_is_less()); // count the number of expressions equal to '1' unsigned num_ones = std::count_if(v.begin(), v.end(), [](const ex& e) { return ex_is_equal()(e, 1); }); The implementation of 'ex_is_less' uses the member function int ex::compare(const ex & other) const; which returns 0 if '*this' and 'other' are equal, -1 if '*this' sorts before 'other', and 1 if '*this' sorts after 'other'.  File: ginac.info, Node: Numerical evaluation, Next: Substituting expressions, Prev: Information about expressions, Up: Methods and functions 5.2 Numerical evaluation ======================== GiNaC keeps algebraic expressions, numbers and constants in their exact form. To evaluate them using floating-point arithmetic you need to call ex ex::evalf() const; The accuracy of the evaluation is controlled by the global object 'Digits' which can be assigned an integer value. The default value of 'Digits' is 17. *Note Numbers::, for more information and examples. To evaluate an expression to a 'double' floating-point number you can call 'evalf()' followed by 'numeric::to_double()', like this: { // Approximate sin(x/Pi) symbol x("x"); ex e = series(sin(x/Pi), x == 0, 6); // Evaluate numerically at x=0.1 ex f = evalf(e.subs(x == 0.1)); // ex_to is an unsafe cast, so check the type first if (is_a(f)) { double d = ex_to(f).to_double(); cout << d << endl; // -> 0.0318256 } else // error }  File: ginac.info, Node: Substituting expressions, Next: Pattern matching and advanced substitutions, Prev: Numerical evaluation, Up: Methods and functions 5.3 Substituting expressions ============================ Algebraic objects inside expressions can be replaced with arbitrary expressions via the '.subs()' method: ex ex::subs(const ex & e, unsigned options = 0); ex ex::subs(const exmap & m, unsigned options = 0); ex ex::subs(const lst & syms, const lst & repls, unsigned options = 0); In the first form, 'subs()' accepts a relational of the form 'object == expression' or a 'lst' of such relationals: { symbol x("x"), y("y"); ex e1 = 2*x*x-4*x+3; cout << "e1(7) = " << e1.subs(x == 7) << endl; // -> 73 ex e2 = x*y + x; cout << "e2(-2, 4) = " << e2.subs(lst{x == -2, y == 4}) << endl; // -> -10 } If you specify multiple substitutions, they are performed in parallel, so e.g. 'subs(lst{x == y, y == x})' exchanges 'x' and 'y'. The second form of 'subs()' takes an 'exmap' object which is a pair associative container that maps expressions to expressions (currently implemented as a 'std::map'). This is the most efficient one of the three 'subs()' forms and should be used when the number of objects to be substituted is large or unknown. Using this form, the second example from above would look like this: { symbol x("x"), y("y"); ex e2 = x*y + x; exmap m; m[x] = -2; m[y] = 4; cout << "e2(-2, 4) = " << e2.subs(m) << endl; } The third form of 'subs()' takes two lists, one for the objects to be replaced and one for the expressions to be substituted (both lists must contain the same number of elements). Using this form, you would write { symbol x("x"), y("y"); ex e2 = x*y + x; cout << "e2(-2, 4) = " << e2.subs(lst{x, y}, lst{-2, 4}) << endl; } The optional last argument to 'subs()' is a combination of 'subs_options' flags. There are three options available: 'subs_options::no_pattern' disables pattern matching, which makes large 'subs()' operations significantly faster if you are not using patterns. The second option, 'subs_options::algebraic' enables algebraic substitutions in products and powers. *Note Pattern matching and advanced substitutions::, for more information about patterns and algebraic substitutions. The third option, 'subs_options::no_index_renaming' disables the feature that dummy indices are renamed if the substitution could give a result in which a dummy index occurs more than two times. This is sometimes necessary if you want to use 'subs()' to rename your dummy indices. 'subs()' performs syntactic substitution of any complete algebraic object; it does not try to match sub-expressions as is demonstrated by the following example: { symbol x("x"), y("y"), z("z"); ex e1 = pow(x+y, 2); cout << e1.subs(x+y == 4) << endl; // -> 16 ex e2 = sin(x)*sin(y)*cos(x); cout << e2.subs(sin(x) == cos(x)) << endl; // -> cos(x)^2*sin(y) ex e3 = x+y+z; cout << e3.subs(x+y == 4) << endl; // -> x+y+z // (and not 4+z as one might expect) } A more powerful form of substitution using wildcards is described in the next section.  File: ginac.info, Node: Pattern matching and advanced substitutions, Next: Applying a function on subexpressions, Prev: Substituting expressions, Up: Methods and functions 5.4 Pattern matching and advanced substitutions =============================================== GiNaC allows the use of patterns for checking whether an expression is of a certain form or contains subexpressions of a certain form, and for substituting expressions in a more general way. A "pattern" is an algebraic expression that optionally contains wildcards. A "wildcard" is a special kind of object (of class 'wildcard') that represents an arbitrary expression. Every wildcard has a "label" which is an unsigned integer number to allow having multiple different wildcards in a pattern. Wildcards are printed as '$label' (this is also the way they are specified in 'ginsh'). In C++ code, wildcard objects are created with the call ex wild(unsigned label = 0); which is simply a wrapper for the 'wildcard()' constructor with a shorter name. Some examples for patterns: *Constructed as* *Output as* 'wild()' '$0' 'pow(x,wild())' 'x^$0' 'atan2(wild(1),wild(2))' 'atan2($1,$2)' 'indexed(A,idx(wild(),3))' 'A.$0' Notes: * Wildcards behave like symbols and are subject to the same algebraic rules. E.g., '$0+2*$0' is automatically transformed to '3*$0'. * As shown in the last example, to use wildcards for indices you have to use them as the value of an 'idx' object. This is because indices must always be of class 'idx' (or a subclass). * Wildcards only represent expressions or subexpressions. It is not possible to use them as placeholders for other properties like index dimension or variance, representation labels, symmetry of indexed objects etc. * Because wildcards are commutative, it is not possible to use wildcards as part of noncommutative products. * A pattern does not have to contain wildcards. 'x' and 'x+y' are also valid patterns. 5.4.1 Matching expressions -------------------------- The most basic application of patterns is to check whether an expression matches a given pattern. This is done by the function bool ex::match(const ex & pattern); bool ex::match(const ex & pattern, exmap& repls); This function returns 'true' when the expression matches the pattern and 'false' if it doesn't. If used in the second form, the actual subexpressions matched by the wildcards get returned in the associative array 'repls' with 'wildcard' as a key. If 'match()' returns false, 'repls' remains unmodified. The matching algorithm works as follows: * A single wildcard matches any expression. If one wildcard appears multiple times in a pattern, it must match the same expression in all places (e.g. '$0' matches anything, and '$0*($0+1)' matches 'x*(x+1)' but not 'x*(y+1)'). * If the expression is not of the same class as the pattern, the match fails (i.e. a sum only matches a sum, a function only matches a function, etc.). * If the pattern is a function, it only matches the same function (i.e. 'sin($0)' matches 'sin(x)' but doesn't match 'exp(x)'). * Except for sums and products, the match fails if the number of subexpressions ('nops()') is not equal to the number of subexpressions of the pattern. * If there are no subexpressions, the expressions and the pattern must be equal (in the sense of 'is_equal()'). * Except for sums and products, each subexpression ('op()') must match the corresponding subexpression of the pattern. Sums ('add') and products ('mul') are treated in a special way to account for their commutativity and associativity: * If the pattern contains a term or factor that is a single wildcard, this one is used as the "global wildcard". If there is more than one such wildcard, one of them is chosen as the global wildcard in a random way. * Every term/factor of the pattern, except the global wildcard, is matched against every term of the expression in sequence. If no match is found, the whole match fails. Terms that did match are not considered in further matches. * If there are no unmatched terms left, the match succeeds. Otherwise the match fails unless there is a global wildcard in the pattern, in which case this wildcard matches the remaining terms. In general, having more than one single wildcard as a term of a sum or a factor of a product (such as 'a+$0+$1') will lead to unpredictable or ambiguous results. Here are some examples in 'ginsh' to demonstrate how it works (the 'match()' function in 'ginsh' returns 'FAIL' if the match fails, and the list of wildcard replacements otherwise): > match((x+y)^a,(x+y)^a); {} > match((x+y)^a,(x+y)^b); FAIL > match((x+y)^a,$1^$2); {$1==x+y,$2==a} > match((x+y)^a,$1^$1); FAIL > match((x+y)^(x+y),$1^$1); {$1==x+y} > match((x+y)^(x+y),$1^$2); {$1==x+y,$2==x+y} > match((a+b)*(a+c),($1+b)*($1+c)); {$1==a} > match((a+b)*(a+c),(a+$1)*(a+$2)); {$1==b,$2==c} (Unpredictable. The result might also be [$1==c,$2==b].) > match((a+b)*(a+c),($1+$2)*($1+$3)); (The result is undefined. Due to the sequential nature of the algorithm and the re-ordering of terms in GiNaC, the match for the first factor may be {$1==a,$2==b} in which case the match for the second factor succeeds, or it may be {$1==b,$2==a} which causes the second match to fail.) > match(a*(x+y)+a*z+b,a*$1+$2); (This is also ambiguous and may return either {$1==z,$2==a*(x+y)+b} or {$1=x+y,$2=a*z+b}.) > match(a+b+c+d+e+f,c); FAIL > match(a+b+c+d+e+f,c+$0); {$0==a+e+b+f+d} > match(a+b+c+d+e+f,c+e+$0); {$0==a+b+f+d} > match(a+b,a+b+$0); {$0==0} > match(a*b^2,a^$1*b^$2); FAIL (The matching is syntactic, not algebraic, and "a" doesn't match "a^$1" even though a==a^1.) > match(x*atan2(x,x^2),$0*atan2($0,$0^2)); {$0==x} > match(atan2(y,x^2),atan2(y,$0)); {$0==x^2} 5.4.2 Matching parts of expressions ----------------------------------- A more general way to look for patterns in expressions is provided by the member function bool ex::has(const ex & pattern); This function checks whether a pattern is matched by an expression itself or by any of its subexpressions. Again some examples in 'ginsh' for illustration (in 'ginsh', 'has()' returns '1' for 'true' and '0' for 'false'): > has(x*sin(x+y+2*a),y); 1 > has(x*sin(x+y+2*a),x+y); 0 (This is because in GiNaC, "x+y" is not a subexpression of "x+y+2*a" (which has the subexpressions "x", "y" and "2*a".) > has(x*sin(x+y+2*a),x+y+$1); 1 (But this is possible.) > has(x*sin(2*(x+y)+2*a),x+y); 0 (This fails because "2*(x+y)" automatically gets converted to "2*x+2*y" of which "x+y" is not a subexpression.) > has(x+1,x^$1); 0 (Although x^1==x and x^0==1, neither "x" nor "1" are actually of the form "x^something".) > has(4*x^2-x+3,$1*x); 1 > has(4*x^2+x+3,$1*x); 0 (Another possible pitfall. The first expression matches because the term "-x" has the form "(-1)*x" in GiNaC. To check whether a polynomial contains a linear term you should use the coeff() function instead.) The method bool ex::find(const ex & pattern, exset& found); works a bit like 'has()' but it doesn't stop upon finding the first match. Instead, it appends all found matches to the specified list. If there are multiple occurrences of the same expression, it is entered only once to the list. 'find()' returns false if no matches were found (in 'ginsh', it returns an empty list): > find(1+x+x^2+x^3,x); {x} > find(1+x+x^2+x^3,y); {} > find(1+x+x^2+x^3,x^$1); {x^3,x^2} (Note the absence of "x".) > expand((sin(x)+sin(y))*(a+b)); sin(y)*a+sin(x)*b+sin(x)*a+sin(y)*b > find(%,sin($1)); {sin(y),sin(x)} 5.4.3 Substituting expressions ------------------------------ Probably the most useful application of patterns is to use them for substituting expressions with the 'subs()' method. Wildcards can be used in the search patterns as well as in the replacement expressions, where they get replaced by the expressions matched by them. 'subs()' doesn't know anything about algebra; it performs purely syntactic substitutions. Some examples: > subs(a^2+b^2+(x+y)^2,$1^2==$1^3); b^3+a^3+(x+y)^3 > subs(a^4+b^4+(x+y)^4,$1^2==$1^3); b^4+a^4+(x+y)^4 > subs((a+b+c)^2,a+b==x); (a+b+c)^2 > subs((a+b+c)^2,a+b+$1==x+$1); (x+c)^2 > subs(a+2*b,a+b==x); a+2*b > subs(4*x^3-2*x^2+5*x-1,x==a); -1+5*a-2*a^2+4*a^3 > subs(4*x^3-2*x^2+5*x-1,x^$0==a^$0); -1+5*x-2*a^2+4*a^3 > subs(sin(1+sin(x)),sin($1)==cos($1)); cos(1+cos(x)) > expand(subs(a*sin(x+y)^2+a*cos(x+y)^2+b,cos($1)^2==1-sin($1)^2)); a+b The last example would be written in C++ in this way: { symbol a("a"), b("b"), x("x"), y("y"); e = a*pow(sin(x+y), 2) + a*pow(cos(x+y), 2) + b; e = e.subs(pow(cos(wild()), 2) == 1-pow(sin(wild()), 2)); cout << e.expand() << endl; // -> a+b } 5.4.4 The option algebraic -------------------------- Both 'has()' and 'subs()' take an optional argument to pass them extra options. This section describes what happens if you give the former the option 'has_options::algebraic' or the latter 'subs_options::algebraic'. In that case the matching condition for powers and multiplications is changed in such a way that they become more intuitive. Intuition says that 'x*y' is a part of 'x*y*z'. If you use these options you will find that '(x*y*z).has(x*y, has_options::algebraic)' indeed returns true. Besides matching some of the factors of a product also powers match as often as is possible without getting negative exponents. For example '(x^5*y^2*z).subs(x^2*y^2==c, subs_options::algebraic)' will return 'x*c^2*z'. This also works with negative powers: '(x^(-3)*y^(-2)*z).subs(1/(x*y)==c, subs_options::algebraic)' will return 'x^(-1)*c^2*z'. *Please notice:* this only works for multiplications and not for locating 'x+y' within 'x+y+z'.  File: ginac.info, Node: Applying a function on subexpressions, Next: Visitors and tree traversal, Prev: Pattern matching and advanced substitutions, Up: Methods and functions 5.5 Applying a function on subexpressions ========================================= Sometimes you may want to perform an operation on specific parts of an expression while leaving the general structure of it intact. An example of this would be a matrix trace operation: the trace of a sum is the sum of the traces of the individual terms. That is, the trace should "map" on the sum, by applying itself to each of the sum's operands. It is possible to do this manually which usually results in code like this: ex calc_trace(ex e) { if (is_a(e)) return ex_to(e).trace(); else if (is_a(e)) { ex sum = 0; for (size_t i=0; i)(e)) { ... } else { ... } } This is, however, slightly inefficient (if the sum is very large it can take a long time to add the terms one-by-one), and its applicability is limited to a rather small class of expressions. If 'calc_trace()' is called with a relation or a list as its argument, you will probably want the trace to be taken on both sides of the relation or of all elements of the list. GiNaC offers the 'map()' method to aid in the implementation of such operations: ex ex::map(map_function & f) const; ex ex::map(ex (*f)(const ex & e)) const; In the first (preferred) form, 'map()' takes a function object that is subclassed from the 'map_function' class. In the second form, it takes a pointer to a function that accepts and returns an expression. 'map()' constructs a new expression of the same type, applying the specified function on all subexpressions (in the sense of 'op()'), non-recursively. The use of a function object makes it possible to supply more arguments to the function that is being mapped, or to keep local state information. The 'map_function' class declares a virtual function call operator that you can overload. Here is a sample implementation of 'calc_trace()' that uses 'map()' in a recursive fashion: struct calc_trace : public map_function { ex operator()(const ex &e) { if (is_a(e)) return ex_to(e).trace(); else if (is_a(e)) { ... } else return e.map(*this); } }; This function object could then be used like this: { ex M = ... // expression with matrices calc_trace do_trace; ex tr = do_trace(M); } Here is another example for you to meditate over. It removes quadratic terms in a variable from an expanded polynomial: struct map_rem_quad : public map_function { ex var; map_rem_quad(const ex & var_) : var(var_) {} ex operator()(const ex & e) { if (is_a(e) || is_a(e)) return e.map(*this); else if (is_a(e) && e.op(0).is_equal(var) && e.op(1).info(info_flags::even)) return 0; else return e; } }; ... { symbol x("x"), y("y"); ex e; for (int i=0; i<8; i++) e += pow(x, i) * pow(y, 8-i) * (i+1); cout << e << endl; // -> 4*y^5*x^3+5*y^4*x^4+8*y*x^7+7*y^2*x^6+2*y^7*x+6*y^3*x^5+3*y^6*x^2+y^8 map_rem_quad rem_quad(x); cout << rem_quad(e) << endl; // -> 4*y^5*x^3+8*y*x^7+2*y^7*x+6*y^3*x^5+y^8 } 'ginsh' offers a slightly different implementation of 'map()' that allows applying algebraic functions to operands. The second argument to 'map()' is an expression containing the wildcard '$0' which acts as the placeholder for the operands: > map(a*b,sin($0)); sin(a)*sin(b) > map(a+2*b,sin($0)); sin(a)+sin(2*b) > map({a,b,c},$0^2+$0); {a^2+a,b^2+b,c^2+c} Note that it is only possible to use algebraic functions in the second argument. You can not use functions like 'diff()', 'op()', 'subs()' etc. because these are evaluated immediately: > map({a,b,c},diff($0,a)); {0,0,0} This is because "diff($0,a)" evaluates to "0", so the command is equivalent to "map({a,b,c},0)".  File: ginac.info, Node: Visitors and tree traversal, Next: Polynomial arithmetic, Prev: Applying a function on subexpressions, Up: Methods and functions 5.6 Visitors and tree traversal =============================== Suppose that you need a function that returns a list of all indices appearing in an arbitrary expression. The indices can have any dimension, and for indices with variance you always want the covariant version returned. You can't use 'get_free_indices()' because you also want to include dummy indices in the list, and you can't use 'find()' as it needs specific index dimensions (and it would require two passes: one for indices with variance, one for plain ones). The obvious solution to this problem is a tree traversal with a type switch, such as the following: void gather_indices_helper(const ex & e, lst & l) { if (is_a(e)) { const varidx & vi = ex_to(e); l.append(vi.is_covariant() ? vi : vi.toggle_variance()); } else if (is_a(e)) { l.append(e); } else { size_t n = e.nops(); for (size_t i = 0; i < n; ++i) gather_indices_helper(e.op(i), l); } } lst gather_indices(const ex & e) { lst l; gather_indices_helper(e, l); l.sort(); l.unique(); return l; } This works fine but fans of object-oriented programming will feel uncomfortable with the type switch. One reason is that there is a possibility for subtle bugs regarding derived classes. If we had, for example, written if (is_a(e)) { ... } else if (is_a(e)) { ... in 'gather_indices_helper', the code wouldn't have worked because the first line "absorbs" all classes derived from 'idx', including 'varidx', so the special case for 'varidx' would never have been executed. Also, for a large number of classes, a type switch like the above can get unwieldy and inefficient (it's a linear search, after all). 'gather_indices_helper' only checks for two classes, but if you had to write a function that required a different implementation for nearly every GiNaC class, the result would be very hard to maintain and extend. The cleanest approach to the problem would be to add a new virtual function to GiNaC's class hierarchy. In our example, there would be specializations for 'idx' and 'varidx' while the default implementation in 'basic' performed the tree traversal. Unfortunately, in C++ it's impossible to add virtual member functions to existing classes without changing their source and recompiling everything. GiNaC comes with source, so you could actually do this, but for a small algorithm like the one presented this would be impractical. One solution to this dilemma is the "Visitor" design pattern, which is implemented in GiNaC (actually, Robert Martin's Acyclic Visitor variation, described in detail in ). Instead of adding virtual functions to the class hierarchy to implement operations, GiNaC provides a single "bouncing" method 'accept()' that takes an instance of a special 'visitor' class and redirects execution to the one 'visit()' virtual function of the visitor that matches the type of object that 'accept()' was being invoked on. Visitors in GiNaC must derive from the global 'visitor' class as well as from the class 'T::visitor' of each class 'T' they want to visit, and implement the member functions 'void visit(const T &)' for each class. A call of void ex::accept(visitor & v) const; will then dispatch to the correct 'visit()' member function of the specified visitor 'v' for the type of GiNaC object at the root of the expression tree (e.g. a 'symbol', an 'idx' or a 'mul'). Here is an example of a visitor: class my_visitor : public visitor, // this is required public add::visitor, // visit add objects public numeric::visitor, // visit numeric objects public basic::visitor // visit basic objects { void visit(const add & x) { cout << "called with an add object" << endl; } void visit(const numeric & x) { cout << "called with a numeric object" << endl; } void visit(const basic & x) { cout << "called with a basic object" << endl; } }; which can be used as follows: ... symbol x("x"); ex e1 = 42; ex e2 = 4*x-3; ex e3 = 8*x; my_visitor v; e1.accept(v); // prints "called with a numeric object" e2.accept(v); // prints "called with an add object" e3.accept(v); // prints "called with a basic object" ... The 'visit(const basic &)' method gets called for all objects that are not 'numeric' or 'add' and acts as an (optional) default. From a conceptual point of view, the 'visit()' methods of the visitor behave like a newly added virtual function of the visited hierarchy. In addition, visitors can store state in member variables, and they can be extended by deriving a new visitor from an existing one, thus building hierarchies of visitors. We can now rewrite our index example from above with a visitor: class gather_indices_visitor : public visitor, public idx::visitor, public varidx::visitor { lst l; void visit(const idx & i) { l.append(i); } void visit(const varidx & vi) { l.append(vi.is_covariant() ? vi : vi.toggle_variance()); } public: const lst & get_result() // utility function { l.sort(); l.unique(); return l; } }; What's missing is the tree traversal. We could implement it in 'visit(const basic &)', but GiNaC has predefined methods for this: void ex::traverse_preorder(visitor & v) const; void ex::traverse_postorder(visitor & v) const; void ex::traverse(visitor & v) const; 'traverse_preorder()' visits a node _before_ visiting its subexpressions, while 'traverse_postorder()' visits a node _after_ visiting its subexpressions. 'traverse()' is a synonym for 'traverse_preorder()'. Here is a new implementation of 'gather_indices()' that uses the visitor and 'traverse()': lst gather_indices(const ex & e) { gather_indices_visitor v; e.traverse(v); return v.get_result(); } Alternatively, you could use pre- or postorder iterators for the tree traversal: lst gather_indices(const ex & e) { gather_indices_visitor v; for (const_preorder_iterator i = e.preorder_begin(); i != e.preorder_end(); ++i) { i->accept(v); } return v.get_result(); }  File: ginac.info, Node: Polynomial arithmetic, Next: Rational expressions, Prev: Visitors and tree traversal, Up: Methods and functions 5.7 Polynomial arithmetic ========================= 5.7.1 Testing whether an expression is a polynomial --------------------------------------------------- Testing whether an expression is a polynomial in one or more variables can be done with the method bool ex::is_polynomial(const ex & vars) const; In the case of more than one variable, the variables are given as a list. (x*y*sin(y)).is_polynomial(x) // Returns true. (x*y*sin(y)).is_polynomial(lst{x,y}) // Returns false. 5.7.2 Expanding and collecting ------------------------------ A polynomial in one or more variables has many equivalent representations. Some useful ones serve a specific purpose. Consider for example the trivariate polynomial 4*x*y + x*z + 20*y^2 + 21*y*z + 4*z^2 (written down here in output-style). It is equivalent to the factorized polynomial (x + 5*y + 4*z)*(4*y + z). Other representations are the recursive ones where one collects for exponents in one of the three variable. Since the factors are themselves polynomials in the remaining two variables the procedure can be repeated. In our example, two possibilities would be (4*y + z)*x + 20*y^2 + 21*y*z + 4*z^2 and 20*y^2 + (21*z + 4*x)*y + 4*z^2 + x*z. To bring an expression into expanded form, its method ex ex::expand(unsigned options = 0); may be called. In our example above, this corresponds to 4*x*y + x*z + 20*y^2 + 21*y*z + 4*z^2. Again, since the canonical form in GiNaC is not easy to guess you should be prepared to see different orderings of terms in such sums! Another useful representation of multivariate polynomials is as a univariate polynomial in one of the variables with the coefficients being polynomials in the remaining variables. The method 'collect()' accomplishes this task: ex ex::collect(const ex & s, bool distributed = false); The first argument to 'collect()' can also be a list of objects in which case the result is either a recursively collected polynomial, or a polynomial in a distributed form with terms like c*x1^e1*...*xn^en, as specified by the 'distributed' flag. Note that the original polynomial needs to be in expanded form (for the variables concerned) in order for 'collect()' to be able to find the coefficients properly. The following 'ginsh' transcript shows an application of 'collect()' together with 'find()': > a=expand((sin(x)+sin(y))*(1+p+q)*(1+d)); d*p*sin(x)+p*sin(x)+q*d*sin(x)+q*sin(y)+d*sin(x)+q*d*sin(y)+sin(y)+d*sin(y) +q*sin(x)+d*sin(y)*p+sin(x)+sin(y)*p > collect(a,{p,q}); d*sin(x)+(d*sin(x)+sin(y)+d*sin(y)+sin(x))*p +(d*sin(x)+sin(y)+d*sin(y)+sin(x))*q+sin(y)+d*sin(y)+sin(x) > collect(a,find(a,sin($1))); (1+q+d+q*d+d*p+p)*sin(y)+(1+q+d+q*d+d*p+p)*sin(x) > collect(a,{find(a,sin($1)),p,q}); (1+(1+d)*p+d+q*(1+d))*sin(x)+(1+(1+d)*p+d+q*(1+d))*sin(y) > collect(a,{find(a,sin($1)),d}); (1+q+d*(1+q+p)+p)*sin(y)+(1+q+d*(1+q+p)+p)*sin(x) Polynomials can often be brought into a more compact form by collecting common factors from the terms of sums. This is accomplished by the function ex collect_common_factors(const ex & e); This function doesn't perform a full factorization but only looks for factors which are already explicitly present: > collect_common_factors(a*x+a*y); (x+y)*a > collect_common_factors(a*x^2+2*a*x*y+a*y^2); a*(2*x*y+y^2+x^2) > collect_common_factors(a*(b*(a+c)*x+b*((a+c)*x+(a+c)*y)*y)); (c+a)*a*(x*y+y^2+x)*b 5.7.3 Degree and coefficients ----------------------------- The degree and low degree of a polynomial in expanded form can be obtained using the two methods int ex::degree(const ex & s); int ex::ldegree(const ex & s); These functions even work on rational functions, returning the asymptotic degree. By definition, the degree of zero is zero. To extract a coefficient with a certain power from an expanded polynomial you use ex ex::coeff(const ex & s, int n); You can also obtain the leading and trailing coefficients with the methods ex ex::lcoeff(const ex & s); ex ex::tcoeff(const ex & s); which are equivalent to 'coeff(s, degree(s))' and 'coeff(s, ldegree(s))', respectively. An application is illustrated in the next example, where a multivariate polynomial is analyzed: { symbol x("x"), y("y"); ex PolyInp = 4*pow(x,3)*y + 5*x*pow(y,2) + 3*y - pow(x+y,2) + 2*pow(y+2,2) - 8; ex Poly = PolyInp.expand(); for (int i=Poly.ldegree(x); i<=Poly.degree(x); ++i) { cout << "The x^" << i << "-coefficient is " << Poly.coeff(x,i) << endl; } cout << "As polynomial in y: " << Poly.collect(y) << endl; } When run, it returns an output in the following fashion: The x^0-coefficient is y^2+11*y The x^1-coefficient is 5*y^2-2*y The x^2-coefficient is -1 The x^3-coefficient is 4*y As polynomial in y: -x^2+(5*x+1)*y^2+(-2*x+4*x^3+11)*y As always, the exact output may vary between different versions of GiNaC or even from run to run since the internal canonical ordering is not within the user's sphere of influence. 'degree()', 'ldegree()', 'coeff()', 'lcoeff()', 'tcoeff()' and 'collect()' can also be used to a certain degree with non-polynomial expressions as they not only work with symbols but with constants, functions and indexed objects as well: { symbol a("a"), b("b"), c("c"), x("x"); idx i(symbol("i"), 3); ex e = pow(sin(x) - cos(x), 4); cout << e.degree(cos(x)) << endl; // -> 4 cout << e.expand().coeff(sin(x), 3) << endl; // -> -4*cos(x) e = indexed(a+b, i) * indexed(b+c, i); e = e.expand(expand_options::expand_indexed); cout << e.collect(indexed(b, i)) << endl; // -> a.i*c.i+(a.i+c.i)*b.i+b.i^2 } 5.7.4 Polynomial division ------------------------- The two functions ex quo(const ex & a, const ex & b, const ex & x); ex rem(const ex & a, const ex & b, const ex & x); compute the quotient and remainder of univariate polynomials in the variable 'x'. The results satisfy a = b*quo(a, b, x) + rem(a, b, x). The additional function ex prem(const ex & a, const ex & b, const ex & x); computes the pseudo-remainder of 'a' and 'b' which satisfies c*a = b*q + prem(a, b, x), where c = b.lcoeff(x) ^ (a.degree(x) - b.degree(x) + 1). Exact division of multivariate polynomials is performed by the function bool divide(const ex & a, const ex & b, ex & q); If 'b' divides 'a' over the rationals, this function returns 'true' and returns the quotient in the variable 'q'. Otherwise it returns 'false' in which case the value of 'q' is undefined. 5.7.5 Unit, content and primitive part -------------------------------------- The methods ex ex::unit(const ex & x); ex ex::content(const ex & x); ex ex::primpart(const ex & x); ex ex::primpart(const ex & x, const ex & c); return the unit part, content part, and primitive polynomial of a multivariate polynomial with respect to the variable 'x' (the unit part being the sign of the leading coefficient, the content part being the GCD of the coefficients, and the primitive polynomial being the input polynomial divided by the unit and content parts). The second variant of 'primpart()' expects the previously calculated content part of the polynomial in 'c', which enables it to work faster in the case where the content part has already been computed. The product of unit, content, and primitive part is the original polynomial. Additionally, the method void ex::unitcontprim(const ex & x, ex & u, ex & c, ex & p); computes the unit, content, and primitive parts in one go, returning them in 'u', 'c', and 'p', respectively. 5.7.6 GCD, LCM and resultant ---------------------------- The functions for polynomial greatest common divisor and least common multiple have the synopsis ex gcd(const ex & a, const ex & b); ex lcm(const ex & a, const ex & b); The functions 'gcd()' and 'lcm()' accept two expressions 'a' and 'b' as arguments and return a new expression, their greatest common divisor or least common multiple, respectively. If the polynomials 'a' and 'b' are coprime 'gcd(a,b)' returns 1 and 'lcm(a,b)' returns the product of 'a' and 'b'. Note that all the coefficients must be rationals. #include using namespace GiNaC; int main() { symbol x("x"), y("y"), z("z"); ex P_a = 4*x*y + x*z + 20*pow(y, 2) + 21*y*z + 4*pow(z, 2); ex P_b = x*y + 3*x*z + 5*pow(y, 2) + 19*y*z + 12*pow(z, 2); ex P_gcd = gcd(P_a, P_b); // x + 5*y + 4*z ex P_lcm = lcm(P_a, P_b); // 4*x*y^2 + 13*y*x*z + 20*y^3 + 81*y^2*z + 67*y*z^2 + 3*x*z^2 + 12*z^3 } The resultant of two expressions only makes sense with polynomials. It is always computed with respect to a specific symbol within the expressions. The function has the interface ex resultant(const ex & a, const ex & b, const ex & s); Resultants are symmetric in 'a' and 'b'. The following example computes the resultant of two expressions with respect to 'x' and 'y', respectively: #include using namespace GiNaC; int main() { symbol x("x"), y("y"); ex e1 = x+pow(y,2), e2 = 2*pow(x,3)-1; // x+y^2, 2*x^3-1 ex r; r = resultant(e1, e2, x); // -> 1+2*y^6 r = resultant(e1, e2, y); // -> 1-4*x^3+4*x^6 } 5.7.7 Square-free decomposition ------------------------------- Square-free decomposition is available in GiNaC: ex sqrfree(const ex & a, const lst & l = lst{}); Here is an example that by the way illustrates how the exact form of the result may slightly depend on the order of differentiation, calling for some care with subsequent processing of the result: ... symbol x("x"), y("y"); ex BiVarPol = expand(pow(2-2*y,3) * pow(1+x*y,2) * pow(x-2*y,2) * (x+y)); cout << sqrfree(BiVarPol, lst{x,y}) << endl; // -> 8*(1-y)^3*(y*x^2-2*y+x*(1-2*y^2))^2*(y+x) cout << sqrfree(BiVarPol, lst{y,x}) << endl; // -> 8*(1-y)^3*(-y*x^2+2*y+x*(-1+2*y^2))^2*(y+x) cout << sqrfree(BiVarPol) << endl; // -> depending on luck, any of the above ... Note also, how factors with the same exponents are not fully factorized with this method. 5.7.8 Polynomial factorization ------------------------------ Polynomials can also be fully factored with a call to the function ex factor(const ex & a, unsigned int options = 0); The factorization works for univariate and multivariate polynomials with rational coefficients. The following code snippet shows its capabilities: ... cout << factor(pow(x,2)-1) << endl; // -> (1+x)*(-1+x) cout << factor(expand((x-y*z)*(x-pow(y,2)-pow(z,3))*(x+y+z))) << endl; // -> (y+z+x)*(y*z-x)*(y^2-x+z^3) cout << factor(pow(x,2)-1+sin(pow(x,2)-1)) << endl; // -> -1+sin(-1+x^2)+x^2 ... The results are as expected except for the last one where no factorization seems to have been done. This is due to the default option 'factor_options::polynomial' (equals zero) to 'factor()', which tells GiNaC to try a factorization only if the expression is a valid polynomial. In the shown example this is not the case, because one term is a function. There exists a second option 'factor_options::all', which tells GiNaC to ignore non-polynomial parts of an expression and also to look inside function arguments. With this option the example gives: ... cout << factor(pow(x,2)-1+sin(pow(x,2)-1), factor_options::all) << endl; // -> (-1+x)*(1+x)+sin((-1+x)*(1+x)) ... GiNaC's factorization functions cannot handle algebraic extensions. Therefore the following example does not factor: ... cout << factor(pow(x,2)-2) << endl; // -> -2+x^2 and not (x-sqrt(2))*(x+sqrt(2)) ... Factorization is useful in many applications. A lot of algorithms in computer algebra depend on the ability to factor a polynomial. Of course, factorization can also be used to simplify expressions, but it is costly and applying it to complicated expressions (high degrees or many terms) may consume far too much time. So usually, looking for a GCD at strategic points in a calculation is the cheaper and more appropriate alternative.  File: ginac.info, Node: Rational expressions, Next: Symbolic differentiation, Prev: Polynomial arithmetic, Up: Methods and functions 5.8 Rational expressions ======================== 5.8.1 The 'normal' method ------------------------- Some basic form of simplification of expressions is called for frequently. GiNaC provides the method '.normal()', which converts a rational function into an equivalent rational function of the form 'numerator/denominator' where numerator and denominator are coprime. If the input expression is already a fraction, it just finds the GCD of numerator and denominator and cancels it, otherwise it performs fraction addition and multiplication. '.normal()' can also be used on expressions which are not rational functions as it will replace all non-rational objects (like functions or non-integer powers) by temporary symbols to bring the expression to the domain of rational functions before performing the normalization, and re-substituting these symbols afterwards. This algorithm is also available as a separate method '.to_rational()', described below. This means that both expressions 't1' and 't2' are indeed simplified in this little code snippet: { symbol x("x"); ex t1 = (pow(x,2) + 2*x + 1)/(x + 1); ex t2 = (pow(sin(x),2) + 2*sin(x) + 1)/(sin(x) + 1); std::cout << "t1 is " << t1.normal() << std::endl; std::cout << "t2 is " << t2.normal() << std::endl; } Of course this works for multivariate polynomials too, so the ratio of the sample-polynomials from the section about GCD and LCM above would be normalized to 'P_a/P_b' = '(4*y+z)/(y+3*z)'. 5.8.2 Numerator and denominator ------------------------------- The numerator and denominator of an expression can be obtained with ex ex::numer(); ex ex::denom(); ex ex::numer_denom(); These functions will first normalize the expression as described above and then return the numerator, denominator, or both as a list, respectively. If you need both numerator and denominator, call 'numer_denom()': it is faster than using 'numer()' and 'denom()' separately. And even more important: a separate evaluation of 'numer()' and 'denom()' may result in a spurious sign, e.g. for $x/(x^2-1)$ 'numer()' may return $x$ and 'denom()' $1-x^2$. 5.8.3 Converting to a polynomial or rational expression ------------------------------------------------------- Some of the methods described so far only work on polynomials or rational functions. GiNaC provides a way to extend the domain of these functions to general expressions by using the temporary replacement algorithm described above. You do this by calling ex ex::to_polynomial(exmap & m); or ex ex::to_rational(exmap & m); on the expression to be converted. The supplied 'exmap' will be filled with the generated temporary symbols and their replacement expressions in a format that can be used directly for the 'subs()' method. It can also already contain a list of replacements from an earlier application of '.to_polynomial()' or '.to_rational()', so it's possible to use it on multiple expressions and get consistent results. The difference between '.to_polynomial()' and '.to_rational()' is probably best illustrated with an example: { symbol x("x"), y("y"); ex a = 2*x/sin(x) - y/(3*sin(x)); cout << a << endl; exmap mp; ex p = a.to_polynomial(mp); cout << " = " << p << "\n with " << mp << endl; // = symbol3*symbol2*y+2*symbol2*x // with {symbol2==sin(x)^(-1),symbol3==-1/3} exmap mr; ex r = a.to_rational(mr); cout << " = " << r << "\n with " << mr << endl; // = -1/3*symbol4^(-1)*y+2*symbol4^(-1)*x // with {symbol4==sin(x)} } The following more useful example will print 'sin(x)-cos(x)': { symbol x("x"); ex a = pow(sin(x), 2) - pow(cos(x), 2); ex b = sin(x) + cos(x); ex q; exmap m; divide(a.to_polynomial(m), b.to_polynomial(m), q); cout << q.subs(m) << endl; }  File: ginac.info, Node: Symbolic differentiation, Next: Series expansion, Prev: Rational expressions, Up: Methods and functions 5.9 Symbolic differentiation ============================ GiNaC's objects know how to differentiate themselves. Thus, a polynomial (class 'add') knows that its derivative is the sum of the derivatives of all the monomials: { symbol x("x"), y("y"), z("z"); ex P = pow(x, 5) + pow(x, 2) + y; cout << P.diff(x,2) << endl; // -> 20*x^3 + 2 cout << P.diff(y) << endl; // 1 // -> 1 cout << P.diff(z) << endl; // 0 // -> 0 } If a second integer parameter N is given, the 'diff' method returns the Nth derivative. If _every_ object and every function is told what its derivative is, all derivatives of composed objects can be calculated using the chain rule and the product rule. Consider, for instance the expression '1/cosh(x)'. Since the derivative of 'cosh(x)' is 'sinh(x)' and the derivative of 'pow(x,-1)' is '-pow(x,-2)', GiNaC can readily compute the composition. It turns out that the composition is the generating function for Euler Numbers, i.e. the so called Nth Euler number is the coefficient of 'x^n/n!' in the expansion of '1/cosh(x)'. We may use this identity to code a function that generates Euler numbers in just three lines: #include using namespace GiNaC; ex EulerNumber(unsigned n) { symbol x; const ex generator = pow(cosh(x),-1); return generator.diff(x,n).subs(x==0); } int main() { for (unsigned i=0; i<11; i+=2) std::cout << EulerNumber(i) << std::endl; return 0; } When you run it, it produces the sequence '1', '-1', '5', '-61', '1385', '-50521'. We increment the loop variable 'i' by two since all odd Euler numbers vanish anyways.  File: ginac.info, Node: Series expansion, Next: Symmetrization, Prev: Symbolic differentiation, Up: Methods and functions 5.10 Series expansion ===================== Expressions know how to expand themselves as a Taylor series or (more generally) a Laurent series. As in most conventional Computer Algebra Systems, no distinction is made between those two. There is a class of its own for storing such series ('class pseries') and a built-in function (called 'Order') for storing the order term of the series. As a consequence, if you want to work with series, i.e. multiply two series, you need to call the method 'ex::series' again to convert it to a series object with the usual structure (expansion plus order term). A sample application from special relativity could read: #include using namespace std; using namespace GiNaC; int main() { symbol v("v"), c("c"); ex gamma = 1/sqrt(1 - pow(v/c,2)); ex mass_nonrel = gamma.series(v==0, 10); cout << "the relativistic mass increase with v is " << endl << mass_nonrel << endl; cout << "the inverse square of this series is " << endl << pow(mass_nonrel,-2).series(v==0, 10) << endl; } Only calling the series method makes the last output simplify to 1-v^2/c^2+O(v^10), without that call we would just have a long series raised to the power -2. As another instructive application, let us calculate the numerical value of Archimedes' constant Pi (for which there already exists the built-in constant 'Pi') using John Machin's amazing formula Pi==16*atan(1/5)-4*atan(1/239). This equation (and similar ones) were used for over 200 years for computing digits of pi (see 'Pi Unleashed'). We may expand the arcus tangent around '0' and insert the fractions '1/5' and '1/239'. However, as we have seen, a series in GiNaC carries an order term with it and the question arises what the system is supposed to do when the fractions are plugged into that order term. The solution is to use the function 'series_to_poly()' to simply strip the order term off: #include using namespace GiNaC; ex machin_pi(int degr) { symbol x; ex pi_expansion = series_to_poly(atan(x).series(x,degr)); ex pi_approx = 16*pi_expansion.subs(x==numeric(1,5)) -4*pi_expansion.subs(x==numeric(1,239)); return pi_approx; } int main() { using std::cout; // just for fun, another way of... using std::endl; // ...dealing with this namespace std. ex pi_frac; for (int i=2; i<12; i+=2) { pi_frac = machin_pi(i); cout << i << ":\t" << pi_frac << endl << "\t" << pi_frac.evalf() << endl; } return 0; } Note how we just called '.series(x,degr)' instead of '.series(x==0,degr)'. This is a simple shortcut for 'ex''s method 'series()': if the first argument is a symbol the expression is expanded in that symbol around point '0'. When you run this program, it will type out: 2: 3804/1195 3.1832635983263598326 4: 5359397032/1706489875 3.1405970293260603143 6: 38279241713339684/12184551018734375 3.141621029325034425 8: 76528487109180192540976/24359780855939418203125 3.141591772182177295 10: 327853873402258685803048818236/104359128170408663038552734375 3.1415926824043995174  File: ginac.info, Node: Symmetrization, Next: Built-in functions, Prev: Series expansion, Up: Methods and functions 5.11 Symmetrization =================== The three methods ex ex::symmetrize(const lst & l); ex ex::antisymmetrize(const lst & l); ex ex::symmetrize_cyclic(const lst & l); symmetrize an expression by returning the sum over all symmetric, antisymmetric or cyclic permutations of the specified list of objects, weighted by the number of permutations. The three additional methods ex ex::symmetrize(); ex ex::antisymmetrize(); ex ex::symmetrize_cyclic(); symmetrize or antisymmetrize an expression over its free indices. Symmetrization is most useful with indexed expressions but can be used with almost any kind of object (anything that is 'subs()'able): { idx i(symbol("i"), 3), j(symbol("j"), 3), k(symbol("k"), 3); symbol A("A"), B("B"), a("a"), b("b"), c("c"); cout << ex(indexed(A, i, j)).symmetrize() << endl; // -> 1/2*A.j.i+1/2*A.i.j cout << ex(indexed(A, i, j, k)).antisymmetrize(lst{i, j}) << endl; // -> -1/2*A.j.i.k+1/2*A.i.j.k cout << ex(lst{a, b, c}).symmetrize_cyclic(lst{a, b, c}) << endl; // -> 1/3*{a,b,c}+1/3*{b,c,a}+1/3*{c,a,b} }  File: ginac.info, Node: Built-in functions, Next: Multiple polylogarithms, Prev: Symmetrization, Up: Methods and functions 5.12 Predefined mathematical functions ====================================== * Menu: * Multiple polylogarithms:: 5.12.1 Overview --------------- GiNaC contains the following predefined mathematical functions: *Name* *Function* 'abs(x)' absolute value 'step(x)' step function 'csgn(x)' complex sign 'conjugate(x)' complex conjugation 'real_part(x)' real part 'imag_part(x)' imaginary part 'sqrt(x)' square root (not a GiNaC function, rather an alias for 'pow(x, numeric(1, 2))') 'sin(x)' sine 'cos(x)' cosine 'tan(x)' tangent 'asin(x)' inverse sine 'acos(x)' inverse cosine 'atan(x)' inverse tangent 'atan2(y, x)' inverse tangent with two arguments 'sinh(x)' hyperbolic sine 'cosh(x)' hyperbolic cosine 'tanh(x)' hyperbolic tangent 'asinh(x)' inverse hyperbolic sine 'acosh(x)' inverse hyperbolic cosine 'atanh(x)' inverse hyperbolic tangent 'exp(x)' exponential function 'log(x)' natural logarithm 'eta(x,y)' Eta function: 'eta(x,y) = log(x*y) - log(x) - log(y)' 'Li2(x)' dilogarithm 'Li(m, x)' classical polylogarithm as well as multiple polylogarithm 'G(a, y)' multiple polylogarithm 'G(a, s, y)' multiple polylogarithm with explicit signs for the imaginary parts 'S(n, p, x)' Nielsen's generalized polylogarithm 'H(m, x)' harmonic polylogarithm 'zeta(m)' Riemann's zeta function as well as multiple zeta value 'zeta(m, s)' alternating Euler sum 'zetaderiv(n, x)' derivatives of Riemann's zeta function 'tgamma(x)' gamma function 'lgamma(x)' logarithm of gamma function 'beta(x, y)' beta function ('tgamma(x)*tgamma(y)/tgamma(x+y)') 'psi(x)' psi (digamma) function 'psi(n, x)' derivatives of psi function (polygamma functions) 'factorial(n)' factorial function n! 'binomial(n, k)' binomial coefficients 'Order(x)' order term function in truncated power series For functions that have a branch cut in the complex plane, GiNaC follows the conventions of C/C++ for systems that do not support a signed zero. In particular: the natural logarithm ('log') and the square root ('sqrt') both have their branch cuts running along the negative real axis. The 'asin', 'acos', and 'atanh' functions all have two branch cuts starting at +/-1 and running away towards infinity along the real axis. The 'atan' and 'asinh' functions have two branch cuts starting at +/-i and running away towards infinity along the imaginary axis. The 'acosh' function has one branch cut starting at +1 and running towards -infinity. These functions are continuous as the branch cut is approached coming around the finite endpoint of the cut in a counter clockwise direction. 5.12.2 Expanding functions -------------------------- GiNaC knows several expansion laws for trancedent functions, e.g. 'exp(a+b)=exp(a) exp(b), |zw|=|z| |w|' or 'log(cd)=log(c)+log(d)' (for positive 'c, d' ). In order to use these rules you need to call 'expand()' method with the option 'expand_options::expand_transcendental'. Another relevant option is 'expand_options::expand_function_args'. Their usage and interaction can be seen from the following example: { symbol x("x"), y("y"); ex e=exp(pow(x+y,2)); cout << e.expand() << endl; // -> exp((x+y)^2) cout << e.expand(expand_options::expand_transcendental) << endl; // -> exp((x+y)^2) cout << e.expand(expand_options::expand_function_args) << endl; // -> exp(2*x*y+x^2+y^2) cout << e.expand(expand_options::expand_function_args | expand_options::expand_transcendental) << endl; // -> exp(y^2)*exp(2*x*y)*exp(x^2) } If both flags are set (as in the last call), then GiNaC tries to get the maximal expansion. For example, for the exponent GiNaC firstly expands the argument and then the function. For the logarithm and absolute value, GiNaC uses the opposite order: firstly expands the function and then its argument. Of course, a user can fine-tune this behavior by sequential calls of several 'expand()' methods with desired flags.  File: ginac.info, Node: Multiple polylogarithms, Next: Complex expressions, Prev: Built-in functions, Up: Methods and functions 5.12.3 Multiple polylogarithms ------------------------------ The multiple polylogarithm is the most generic member of a family of functions, to which others like the harmonic polylogarithm, Nielsen's generalized polylogarithm and the multiple zeta value belong. Everyone of these functions can also be written as a multiple polylogarithm with specific parameters. This whole family of functions is therefore often referred to simply as multiple polylogarithms, containing 'Li', 'G', 'H', 'S' and 'zeta'. The multiple polylogarithm itself comes in two variants: 'Li' and 'G'. While 'Li' and 'G' in principle represent the same function, the different notations are more natural to the series representation or the integral representation, respectively. To facilitate the discussion of these functions we distinguish between indices and arguments as parameters. In the table above indices are printed as 'm', 's', 'n' or 'p', whereas arguments are printed as 'x', 'a' and 'y'. To define a 'Li', 'H' or 'zeta' with a depth greater than one, you have to pass a GiNaC 'lst' for the indices 'm' and 's', and in the case of 'Li' for the argument 'x' as well. The parameter 'a' of 'G' must always be a 'lst' containing the arguments in expanded form. If 'G' is used with a third parameter 's', 's' must have the same length as 'a'. It contains then the signs of the imaginary parts of the arguments. If 's' is not given, the signs default to +1. Note that 'Li' and 'zeta' are polymorphic in this respect. They can stand in for the classical polylogarithm and Riemann's zeta function (if depth is one), as well as for the multiple polylogarithm and the multiple zeta value, respectively. Note also, that GiNaC doesn't check whether the 'lst's for two parameters do have the same length. It is up to the user to ensure this, otherwise evaluating will result in undefined behavior. The functions print in LaTeX format as '\mbox{Li}_{m_1,m_2,...,m_k}(x_1,x_2,...,x_k)', '\mbox{S}_{n,p}(x)', '\mbox{H}_{m_1,m_2,...,m_k}(x)' and '\zeta(m_1,m_2,...,m_k)' (with the dots replaced by actual parameters). If 'zeta' is an alternating zeta sum, i.e. 'zeta(m,s)', the indices with negative sign are printed with a line above, e.g. '\zeta(5,\overline{2})'. The order of indices and arguments in the GiNaC 'lst's and in the output is the same. Definitions and analytical as well as numerical properties of multiple polylogarithms are too numerous to be covered here. Instead, the user is referred to the publications listed at the end of this section. The implementation in GiNaC adheres to the definitions and conventions therein, except for a few differences which will be explicitly stated in the following. One difference is about the order of the indices and arguments. For GiNaC we adopt the convention that the indices and arguments are understood to be in the same order as in which they appear in the series representation. This means 'Li_{m_1,m_2,m_3}(x,1,1) = H_{m_1,m_2,m_3}(x)' and 'Li_{2,1}(1,1) = zeta(2,1) = zeta(3)', but 'zeta(1,2)' evaluates to infinity. So in comparison to the older ones of the referenced publications the order of indices and arguments for 'Li' is reversed. The functions only evaluate if the indices are integers greater than zero, except for the indices 's' in 'zeta' and 'G' as well as 'm' in 'H'. Since 's' will be interpreted as the sequence of signs for the corresponding indices 'm' or the sign of the imaginary part for the corresponding arguments 'a', it must contain 1 or -1, e.g. 'zeta(lst{3,4}, lst{-1,1})' means 'zeta(\overline{3},4)' and 'G(lst{a,b}, lst{-1,1}, c)' means 'G(a-0\epsilon,b+0\epsilon;c)'. The definition of 'H' allows indices to be 0, 1 or -1 (in expanded notation) or equally to be any integer (in compact notation). With GiNaC expanded and compact notation can be mixed, e.g. 'lst{0,0,-1,0,1,0,0}', 'lst{0,0,-1,2,0,0}' and 'lst{-3,2,0,0}' are equivalent as indices. The anonymous evaluator 'eval()' tries to reduce the functions, if possible, to the least-generic multiple polylogarithm. If all arguments are unit, it returns 'zeta'. Arguments equal to zero get considered, too. Riemann's zeta function 'zeta' (with depth one) evaluates also for negative integers and positive even integers. For example: > Li({3,1},{x,1}); S(2,2,x) > H({-3,2},1); -zeta({3,2},{-1,-1}) > S(3,1,1); 1/90*Pi^4 It is easy to tell for a given function into which other function it can be rewritten, may it be a less-generic or a more-generic one, except for harmonic polylogarithms 'H' with negative indices or trailing zeros (the example above gives a hint). Signs can quickly be messed up, for example. Therefore GiNaC offers a C++ function 'convert_H_to_Li()' to deal with the upgrade of a 'H' to a multiple polylogarithm 'Li' ('eval()' already cares for the possible downgrade): > convert_H_to_Li({0,-2,-1,3},x); Li({3,1,3},{-x,1,-1}) > convert_H_to_Li({2,-1,0},x); -Li({2,1},{x,-1})*log(x)+2*Li({3,1},{x,-1})+Li({2,2},{x,-1}) Every function can be numerically evaluated for arbitrary real or complex arguments. The precision is arbitrary and can be set through the global variable 'Digits': > Digits=100; 100 > evalf(zeta({3,1,3,1})); 0.005229569563530960100930652283899231589890420784634635522547448972148869544... Note that the convention for arguments on the branch cut in GiNaC as stated above is different from the one Remiddi and Vermaseren have chosen for the harmonic polylogarithm. If a function evaluates to infinity, no exceptions are raised, but the function is returned unevaluated, e.g. 'zeta(1)'. In long expressions this helps a lot with debugging, because you can easily spot the divergencies. But on the other hand, you have to make sure for yourself, that no illegal cancellations of divergencies happen. Useful publications: 'Nested Sums, Expansion of Transcendental Functions and Multi-Scale Multi-Loop Integrals', S.Moch, P.Uwer, S.Weinzierl, hep-ph/0110083 'Harmonic Polylogarithms', E.Remiddi, J.A.M.Vermaseren, Int.J.Mod.Phys. A15 (2000), pp. 725-754 'Special Values of Multiple Polylogarithms', J.Borwein, D.Bradley, D.Broadhurst, P.Lisonek, Trans.Amer.Math.Soc. 353/3 (2001), pp. 907-941 'Numerical Evaluation of Multiple Polylogarithms', J.Vollinga, S.Weinzierl, hep-ph/0410259  File: ginac.info, Node: Complex expressions, Next: Solving linear systems of equations, Prev: Multiple polylogarithms, Up: Methods and functions 5.13 Complex expressions ======================== For dealing with complex expressions there are the methods ex ex::conjugate(); ex ex::real_part(); ex ex::imag_part(); that return respectively the complex conjugate, the real part and the imaginary part of an expression. Complex conjugation works as expected for all built-in functions and objects. Taking real and imaginary parts has not yet been implemented for all built-in functions. In cases where it is not known how to conjugate or take a real/imaginary part one of the functions 'conjugate', 'real_part' or 'imag_part' is returned. For instance, in case of a complex symbol 'x' (symbols are complex by default), one could not simplify 'conjugate(x)'. In the case of strings of gamma matrices, the 'conjugate' method takes the Dirac conjugate. For example, { varidx a(symbol("a"), 4), b(symbol("b"), 4); symbol x("x"); realsymbol y("y"); cout << (3*I*x*y + sin(2*Pi*I*y)).conjugate() << endl; // -> -3*I*conjugate(x)*y+sin(-2*I*Pi*y) cout << (dirac_gamma(a)*dirac_gamma(b)*dirac_gamma5()).conjugate() << endl; // -> -gamma5*gamma~b*gamma~a } If you declare your own GiNaC functions and you want to conjugate them, you will have to supply a specialized conjugation method for them (see *note Symbolic functions:: and the GiNaC source-code for 'abs' as an example). GiNaC does not automatically conjugate user-supplied functions by conjugating their arguments because this would be incorrect on branch cuts. Also, specialized methods can be provided to take real and imaginary parts of user-defined functions.  File: ginac.info, Node: Solving linear systems of equations, Next: Input/output, Prev: Complex expressions, Up: Methods and functions 5.14 Solving linear systems of equations ======================================== The function 'lsolve()' provides a convenient wrapper around some matrix operations that comes in handy when a system of linear equations needs to be solved: ex lsolve(const ex & eqns, const ex & symbols, unsigned options = solve_algo::automatic); Here, 'eqns' is a 'lst' of equalities (i.e. class 'relational') while 'symbols' is a 'lst' of indeterminates. (*Note The class hierarchy::, for an exposition of class 'lst'). It returns the 'lst' of solutions as an expression. As an example, let us solve the two equations 'a*x+b*y==3' and 'x-y==b': { symbol a("a"), b("b"), x("x"), y("y"); lst eqns = {a*x+b*y==3, x-y==b}; lst vars = {x, y}; cout << lsolve(eqns, vars) << endl; // -> {x==(3+b^2)/(b+a),y==(3-b*a)/(b+a)} When the linear equations 'eqns' are underdetermined, the solution will contain one or more tautological entries like 'x==x', depending on the rank of the system. When they are overdetermined, the solution will be an empty 'lst'. Note the third optional parameter to 'lsolve()': it accepts the same parameters as 'matrix::solve()'. This is because 'lsolve' is just a wrapper around that method.  File: ginac.info, Node: Input/output, Next: Extending GiNaC, Prev: Solving linear systems of equations, Up: Methods and functions 5.15 Input and output of expressions ==================================== 5.15.1 Expression output ------------------------ Expressions can simply be written to any stream: { symbol x("x"); ex e = 4.5*I+pow(x,2)*3/2; cout << e << endl; // prints '4.5*I+3/2*x^2' // ... The default output format is identical to the 'ginsh' input syntax and to that used by most computer algebra systems, but not directly pastable into a GiNaC C++ program (note that in the above example, 'pow(x,2)' is printed as 'x^2'). It is possible to print expressions in a number of different formats with a set of stream manipulators; std::ostream & dflt(std::ostream & os); std::ostream & latex(std::ostream & os); std::ostream & tree(std::ostream & os); std::ostream & csrc(std::ostream & os); std::ostream & csrc_float(std::ostream & os); std::ostream & csrc_double(std::ostream & os); std::ostream & csrc_cl_N(std::ostream & os); std::ostream & index_dimensions(std::ostream & os); std::ostream & no_index_dimensions(std::ostream & os); The 'tree', 'latex' and 'csrc' formats are also available in 'ginsh' via the 'print()', 'print_latex()' and 'print_csrc()' functions, respectively. All manipulators affect the stream state permanently. To reset the output format to the default, use the 'dflt' manipulator: // ... cout << latex; // all output to cout will be in LaTeX format from // now on cout << e << endl; // prints '4.5 i+\frac{3}{2} x^{2}' cout << sin(x/2) << endl; // prints '\sin(\frac{1}{2} x)' cout << dflt; // revert to default output format cout << e << endl; // prints '4.5*I+3/2*x^2' // ... If you don't want to affect the format of the stream you're working with, you can output to a temporary 'ostringstream' like this: // ... ostringstream s; s << latex << e; // format of cout remains unchanged cout << s.str() << endl; // prints '4.5 i+\frac{3}{2} x^{2}' // ... The 'csrc' (an alias for 'csrc_double'), 'csrc_float', 'csrc_double' and 'csrc_cl_N' manipulators set the output to a format that can be directly used in a C or C++ program. The three possible formats select the data types used for numbers ('csrc_cl_N' uses the classes provided by the CLN library): // ... cout << "f = " << csrc_float << e << ";\n"; cout << "d = " << csrc_double << e << ";\n"; cout << "n = " << csrc_cl_N << e << ";\n"; // ... The above example will produce (note the 'x^2' being converted to 'x*x'): f = (3.0/2.0)*(x*x)+std::complex(0.0,4.5000000e+00); d = (3.0/2.0)*(x*x)+std::complex(0.0,4.5000000000000000e+00); n = cln::cl_RA("3/2")*(x*x)+cln::complex(cln::cl_I("0"),cln::cl_F("4.5_17")); The 'tree' manipulator allows dumping the internal structure of an expression for debugging purposes: // ... cout << tree << e; } produces add, hash=0x0, flags=0x3, nops=2 power, hash=0x0, flags=0x3, nops=2 x (symbol), serial=0, hash=0xc8d5bcdd, flags=0xf 2 (numeric), hash=0x6526b0fa, flags=0xf 3/2 (numeric), hash=0xf9828fbd, flags=0xf ----- overall_coeff 4.5L0i (numeric), hash=0xa40a97e0, flags=0xf ===== The 'latex' output format is for LaTeX parsing in mathematical mode. It is rather similar to the default format but provides some braces needed by LaTeX for delimiting boxes and also converts some common objects to conventional LaTeX names. It is possible to give symbols a special name for LaTeX output by supplying it as a second argument to the 'symbol' constructor. For example, the code snippet { symbol x("x", "\\circ"); ex e = lgamma(x).series(x==0,3); cout << latex << e << endl; } will print {(-\ln(\circ))}+{(-\gamma_E)} \circ+{(\frac{1}{12} \pi^{2})} \circ^{2} +\mathcal{O}(\circ^{3}) Index dimensions are normally hidden in the output. To make them visible, use the 'index_dimensions' manipulator. The dimensions will be written in square brackets behind each index value in the default and LaTeX output formats: { symbol x("x"), y("y"); varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4); ex e = indexed(x, mu) * indexed(y, nu); cout << e << endl; // prints 'x~mu*y~nu' cout << index_dimensions << e << endl; // prints 'x~mu[4]*y~nu[4]' cout << no_index_dimensions << e << endl; // prints 'x~mu*y~nu' } If you need any fancy special output format, e.g. for interfacing GiNaC with other algebra systems or for producing code for different programming languages, you can always traverse the expression tree yourself: static void my_print(const ex & e) { if (is_a(e)) cout << ex_to(e).get_name(); else cout << ex_to(e).class_name(); cout << "("; size_t n = e.nops(); if (n) for (size_t i=0; i>' stream input operator. Instead, GiNaC lets you read an expression from a stream or a string, specifying the mapping between the input strings and symbols to be used: { symbol x, y; symtab table; table["x"] = x; table["y"] = y; parser reader(table); ex e = reader("2*x+sin(y)"); } The input syntax is the same as that used by 'ginsh' and the stream output operator '<<'. Matching between the input strings and expressions is given by 'table'. The 'table' in this example instructs GiNaC to substitute any input substring "x" with symbol 'x'. Likewise, the substring "y" will be replaced with symbol 'y'. It's also possible to map input (sub)strings to arbitrary expressions: { symbol x, y; symtab table; table["x"] = x+log(y)+1; parser reader(table); ex e = reader("5*x^3 - x^2"); // e = 5*(x+log(y)+1)^3 - (x+log(y)+1)^2 } If no mapping is specified for a particular string GiNaC will create a symbol with corresponding name. Later on you can obtain all parser generated symbols with 'get_syms()' method: { parser reader; ex e = reader("2*x+sin(y)"); symtab table = reader.get_syms(); symbol x = ex_to(table["x"]); symbol y = ex_to(table["y"]); } Sometimes you might want to prevent GiNaC from inserting these extra symbols (for example, you want treat an unexpected string in the input as an error). { symtab table; table["x"] = symbol(); parser reader(table); parser.strict = true; ex e; try { e = reader("2*x+sin(y)"); } catch (parse_error& err) { cerr << err.what() << endl; // prints "unknown symbol "y" in the input" } } With this parser, it's also easy to implement interactive GiNaC programs. When running the following program interactively, remember to send an EOF marker after the input, e.g. by pressing Ctrl-D on an empty line: #include #include #include #include using namespace std; using namespace GiNaC; int main() { cout << "Enter an expression containing 'x': " << flush; parser reader; try { ex e = reader(cin); symtab table = reader.get_syms(); symbol x = table.find("x") != table.end() ? ex_to(table["x"]) : symbol("x"); cout << "The derivative of " << e << " with respect to x is "; cout << e.diff(x) << "." << endl; } catch (exception &p) { cerr << p.what() << endl; } } 5.15.3 Compiling expressions to C function pointers --------------------------------------------------- Numerical evaluation of algebraic expressions is seamlessly integrated into GiNaC by help of the CLN library. While CLN allows for very fast arbitrary precision numerics, which is more than sufficient for most users, sometimes only the speed of built-in floating point numbers is fast enough, e.g. for Monte Carlo integration. The only viable option then is the following: print the expression in C syntax format, manually add necessary C code, compile that program and run is as a separate application. This is not only cumbersome and involves a lot of manual intervention, but it also separates the algebraic and the numerical evaluation into different execution stages. GiNaC offers a couple of functions that help to avoid these inconveniences and problems. The functions automatically perform the printing of a GiNaC expression and the subsequent compiling of its associated C code. The created object code is then dynamically linked to the currently running program. A function pointer to the C function that performs the numerical evaluation is returned and can be used instantly. This all happens automatically, no user intervention is needed. The following example demonstrates the use of 'compile_ex': // ... symbol x("x"); ex myexpr = sin(x) / x; FUNCP_1P fp; compile_ex(myexpr, x, fp); cout << fp(3.2) << endl; // ... The function 'compile_ex' is called with the expression to be compiled and its only free variable 'x'. Upon successful completion the third parameter contains a valid function pointer to the corresponding C code module. If called like in the last line only built-in double precision numerics is involved. The function pointer has to be defined in advance. GiNaC offers three function pointer types at the moment: typedef double (*FUNCP_1P) (double); typedef double (*FUNCP_2P) (double, double); typedef void (*FUNCP_CUBA) (const int*, const double[], const int*, double[]); 'FUNCP_2P' allows for two variables in the expression. 'FUNCP_CUBA' is the correct type to be used with the CUBA library () for numerical integrations. The details for the parameters of 'FUNCP_CUBA' are explained in the CUBA manual. For every function pointer type there is a matching 'compile_ex' available: void compile_ex(const ex& expr, const symbol& sym, FUNCP_1P& fp, const std::string filename = ""); void compile_ex(const ex& expr, const symbol& sym1, const symbol& sym2, FUNCP_2P& fp, const std::string filename = ""); void compile_ex(const lst& exprs, const lst& syms, FUNCP_CUBA& fp, const std::string filename = ""); When the last parameter 'filename' is not supplied, 'compile_ex' will choose a unique random name for the intermediate source and object files it produces. On program termination these files will be deleted. If one wishes to keep the C code and the object files, one can supply the 'filename' parameter. The intermediate files will use that filename and will not be deleted. 'link_ex' is a function that allows to dynamically link an existing object file and to make it available via a function pointer. This is useful if you have already used 'compile_ex' on an expression and want to avoid the compilation step to be performed over and over again when you restart your program. The precondition for this is of course, that you have chosen a filename when you did call 'compile_ex'. For every above mentioned function pointer type there exists a corresponding 'link_ex' function: void link_ex(const std::string filename, FUNCP_1P& fp); void link_ex(const std::string filename, FUNCP_2P& fp); void link_ex(const std::string filename, FUNCP_CUBA& fp); The complete filename (including the suffix '.so') of the object file has to be supplied. The function void unlink_ex(const std::string filename); is supplied for the rare cases when one wishes to close the dynamically linked object files directly and have the intermediate files (only if filename has not been given) deleted. Normally one doesn't need this function, because all the clean-up will be done automatically upon (regular) program termination. All the described functions will throw an exception in case they cannot perform correctly, like for example when writing the file or starting the compiler fails. Since internally the same printing methods as described in section *note csrc printing:: are used, only functions and objects that are available in standard C will compile successfully (that excludes polylogarithms for example at the moment). Another precondition for success is, of course, that it must be possible to evaluate the expression numerically. No free variables despite the ones supplied to 'compile_ex' should appear in the expression. 'compile_ex' uses the shell script 'ginac-excompiler' to start the C compiler and produce the object files. This shell script comes with GiNaC and will be installed together with GiNaC in the configured '$LIBEXECDIR' (typically '$PREFIX/libexec' or '$PREFIX/lib/ginac'). You can also export additional compiler flags via the '$CXXFLAGS' variable: setenv("CXXFLAGS", "-O3 -fomit-frame-pointer -ffast-math", 1); compile_ex(...); 5.15.4 Archiving ---------------- GiNaC allows creating "archives" of expressions which can be stored to or retrieved from files. To create an archive, you declare an object of class 'archive' and archive expressions in it, giving each expression a unique name: #include using namespace std; #include using namespace GiNaC; int main() { symbol x("x"), y("y"), z("z"); ex foo = sin(x + 2*y) + 3*z + 41; ex bar = foo + 1; archive a; a.archive_ex(foo, "foo"); a.archive_ex(bar, "the second one"); // ... The archive can then be written to a file: // ... ofstream out("foobar.gar", ios::binary); out << a; out.close(); // ... The file 'foobar.gar' contains all information that is needed to reconstruct the expressions 'foo' and 'bar'. The flag 'ios::binary' prevents locales setting of your OS tampers the archive file structure. The tool 'viewgar' that comes with GiNaC can be used to view the contents of GiNaC archive files: $ viewgar foobar.gar foo = 41+sin(x+2*y)+3*z the second one = 42+sin(x+2*y)+3*z The point of writing archive files is of course that they can later be read in again: // ... archive a2; ifstream in("foobar.gar", ios::binary); in >> a2; // ... And the stored expressions can be retrieved by their name: // ... lst syms = {x, y}; ex ex1 = a2.unarchive_ex(syms, "foo"); ex ex2 = a2.unarchive_ex(syms, "the second one"); cout << ex1 << endl; // prints "41+sin(x+2*y)+3*z" cout << ex2 << endl; // prints "42+sin(x+2*y)+3*z" cout << ex1.subs(x == 2) << endl; // prints "41+sin(2+2*y)+3*z" } Note that you have to supply a list of the symbols which are to be inserted in the expressions. Symbols in archives are stored by their name only and if you don't specify which symbols you have, unarchiving the expression will create new symbols with that name. E.g. if you hadn't included 'x' in the 'syms' list above, the 'ex1.subs(x == 2)' statement would have had no effect because the 'x' in 'ex1' would have been a different symbol than the 'x' which was defined at the beginning of the program, although both would appear as 'x' when printed. You can also use the information stored in an 'archive' object to output expressions in a format suitable for exact reconstruction. The 'archive' and 'archive_node' classes have a couple of member functions that let you access the stored properties: static void my_print2(const archive_node & n) { string class_name; n.find_string("class", class_name); cout << class_name << "("; archive_node::propinfovector p; n.get_properties(p); size_t num = p.size(); for (size_t i=0; i 1) cout << "}"; if (i != num-1) cout << ","; } cout << ")"; } int main() { ex e = pow(2, x) - y; archive ar(e, "e"); my_print2(ar.get_top_node(0)); cout << endl; return 0; } This will produce: add(rest={power(basis=numeric(number="2"),exponent=symbol(name="x")), symbol(name="y")},coeff={numeric(number="1"),numeric(number="-1")}, overall_coeff=numeric(number="0")) Be warned, however, that the set of properties and their meaning for each class may change between GiNaC versions.  File: ginac.info, Node: Extending GiNaC, Next: What does not belong into GiNaC, Prev: Input/output, Up: Top 6 Extending GiNaC ***************** By reading so far you should have gotten a fairly good understanding of GiNaC's design patterns. From here on you should start reading the sources. All we can do now is issue some recommendations how to tackle GiNaC's many loose ends in order to fulfill everybody's dreams. If you develop some useful extension please don't hesitate to contact the GiNaC authors--they will happily incorporate them into future versions. * Menu: * What does not belong into GiNaC:: What to avoid. * Symbolic functions:: Implementing symbolic functions. * Printing:: Adding new output formats. * Structures:: Defining new algebraic classes (the easy way). * Adding classes:: Defining new algebraic classes (the hard way).  File: ginac.info, Node: What does not belong into GiNaC, Next: Symbolic functions, Prev: Extending GiNaC, Up: Extending GiNaC 6.1 What doesn't belong into GiNaC ================================== First of all, GiNaC's name must be read literally. It is designed to be a library for use within C++. The tiny 'ginsh' accompanying GiNaC makes this even more clear: it doesn't even attempt to provide a language. There are no loops or conditional expressions in 'ginsh', it is merely a window into the library for the programmer to test stuff (or to show off). Still, the design of a complete CAS with a language of its own, graphical capabilities and all this on top of GiNaC is possible and is without doubt a nice project for the future. There are many built-in functions in GiNaC that do not know how to evaluate themselves numerically to a precision declared at runtime (using 'Digits'). Some may be evaluated at certain points, but not generally. This ought to be fixed. However, doing numerical computations with GiNaC's quite abstract classes is doomed to be inefficient. For this purpose, the underlying foundation classes provided by CLN are much better suited.  File: ginac.info, Node: Symbolic functions, Next: Printing, Prev: What does not belong into GiNaC, Up: Extending GiNaC 6.2 Symbolic functions ====================== The easiest and most instructive way to start extending GiNaC is probably to create your own symbolic functions. These are implemented with the help of two preprocessor macros: DECLARE_FUNCTION_P() REGISTER_FUNCTION(, ) The 'DECLARE_FUNCTION' macro will usually appear in a header file. It declares a C++ function with the given 'name' that takes exactly 'n' parameters of type 'ex' and returns a newly constructed GiNaC 'function' object that represents your function. The 'REGISTER_FUNCTION' macro implements the function. It must be passed the same 'name' as the respective 'DECLARE_FUNCTION' macro, and a set of options that associate the symbolic function with C++ functions you provide to implement the various methods such as evaluation, derivative, series expansion etc. They also describe additional attributes the function might have, such as symmetry and commutation properties, and a name for LaTeX output. Multiple options are separated by the member access operator '.' and can be given in an arbitrary order. (By the way: in case you are worrying about all the macros above we can assure you that functions are GiNaC's most macro-intense classes. We have done our best to avoid macros where we can.) 6.2.1 A minimal example ----------------------- Here is an example for the implementation of a function with two arguments that is not further evaluated: DECLARE_FUNCTION_2P(myfcn) REGISTER_FUNCTION(myfcn, dummy()) Any code that has seen the 'DECLARE_FUNCTION' line can use 'myfcn()' in algebraic expressions: { ... symbol x("x"); ex e = 2*myfcn(42, 1+3*x) - x; cout << e << endl; // prints '2*myfcn(42,1+3*x)-x' ... } The 'dummy()' option in the 'REGISTER_FUNCTION' line signifies "no options". A function with no options specified merely acts as a kind of container for its arguments. It is a pure "dummy" function with no associated logic (which is, however, sometimes perfectly sufficient). Let's now have a look at the implementation of GiNaC's cosine function for an example of how to make an "intelligent" function. 6.2.2 The cosine function ------------------------- The GiNaC header file 'inifcns.h' contains the line DECLARE_FUNCTION_1P(cos) which declares to all programs using GiNaC that there is a function 'cos' that takes one 'ex' as an argument. This is all they need to know to use this function in expressions. The implementation of the cosine function is in 'inifcns_trans.cpp'. Here is its 'REGISTER_FUNCTION' line: REGISTER_FUNCTION(cos, eval_func(cos_eval). evalf_func(cos_evalf). derivative_func(cos_deriv). latex_name("\\cos")); There are four options defined for the cosine function. One of them ('latex_name') gives the function a proper name for LaTeX output; the other three indicate the C++ functions in which the "brains" of the cosine function are defined. The 'eval_func()' option specifies the C++ function that implements the 'eval()' method, GiNaC's anonymous evaluator. This function takes the same number of arguments as the associated symbolic function (one in this case) and returns the (possibly transformed or in some way simplified) symbolically evaluated function (*Note Automatic evaluation::, for a description of the automatic evaluation process). If no (further) evaluation is to take place, the 'eval_func()' function must return the original function with '.hold()', to avoid a potential infinite recursion. If your symbolic functions produce a segmentation fault or stack overflow when using them in expressions, you are probably missing a '.hold()' somewhere. The 'eval_func()' function for the cosine looks something like this (actually, it doesn't look like this at all, but it should give you an idea what is going on): static ex cos_eval(const ex & x) { if ("x is a multiple of 2*Pi") return 1; else if ("x is a multiple of Pi") return -1; else if ("x is a multiple of Pi/2") return 0; // more rules... else if ("x has the form 'acos(y)'") return y; else if ("x has the form 'asin(y)'") return sqrt(1-y^2); // more rules... else return cos(x).hold(); } This function is called every time the cosine is used in a symbolic expression: { ... e = cos(Pi); // this calls cos_eval(Pi), and inserts its return value into // the actual expression cout << e << endl; // prints '-1' ... } In this way, 'cos(4*Pi)' automatically becomes 1, 'cos(asin(a+b))' becomes 'sqrt(1-(a+b)^2)', etc. If no reasonable symbolic transformation can be done, the unmodified function is returned with '.hold()'. GiNaC doesn't automatically transform 'cos(2)' to '-0.416146...'. The user has to call 'evalf()' for that. This is implemented in a different function: static ex cos_evalf(const ex & x) { if (is_a(x)) return cos(ex_to(x)); else return cos(x).hold(); } Since we are lazy we defer the problem of numeric evaluation to somebody else, in this case the 'cos()' function for 'numeric' objects, which in turn hands it over to the 'cos()' function in CLN. The '.hold()' isn't really needed here, but reminds us that the corresponding 'eval()' function would require it in this place. Differentiation will surely turn up and so we need to tell 'cos' what its first derivative is (higher derivatives, '.diff(x,3)' for instance, are then handled automatically by 'basic::diff' and 'ex::diff'): static ex cos_deriv(const ex & x, unsigned diff_param) { return -sin(x); } The second parameter is obligatory but uninteresting at this point. It specifies which parameter to differentiate in a partial derivative in case the function has more than one parameter, and its main application is for correct handling of the chain rule. Derivatives of some functions, for example 'abs()' and 'Order()', could not be evaluated through the chain rule. In such cases the full derivative may be specified as shown for 'Order()': static ex Order_expl_derivative(const ex & arg, const symbol & s) { return Order(arg.diff(s)); } That is, we need to supply a procedure, which returns the expression of derivative with respect to the variable 's' for the argument 'arg'. This procedure need to be registered with the function through the option 'expl_derivative_func' (see the next Subsection). In contrast, a partial derivative, e.g. as was defined for 'cos()' above, needs to be registered through the option 'derivative_func'. An implementation of the series expansion is not needed for 'cos()' as it doesn't have any poles and GiNaC can do Taylor expansion by itself (as long as it knows what the derivative of 'cos()' is). 'tan()', on the other hand, does have poles and may need to do Laurent expansion: static ex tan_series(const ex & x, const relational & rel, int order, unsigned options) { // Find the actual expansion point const ex x_pt = x.subs(rel); if ("x_pt is not an odd multiple of Pi/2") throw do_taylor(); // tell function::series() to do Taylor expansion // On a pole, expand sin()/cos() return (sin(x)/cos(x)).series(rel, order+2, options); } The 'series()' implementation of a function _must_ return a 'pseries' object, otherwise your code will crash. 6.2.3 Function options ---------------------- GiNaC functions understand several more options which are always specified as '.option(params)'. None of them are required, but you need to specify at least one option to 'REGISTER_FUNCTION()'. There is a do-nothing option called 'dummy()' which you can use to define functions without any special options. eval_func() evalf_func() derivative_func() expl_derivative_func() series_func() conjugate_func() These specify the C++ functions that implement symbolic evaluation, numeric evaluation, partial derivatives, explicit derivative, and series expansion, respectively. They correspond to the GiNaC methods 'eval()', 'evalf()', 'diff()' and 'series()'. The 'eval_func()' function needs to use '.hold()' if no further automatic evaluation is desired or possible. If no 'series_func()' is given, GiNaC defaults to simple Taylor expansion, which is correct if there are no poles involved. If the function has poles in the complex plane, the 'series_func()' needs to check whether the expansion point is on a pole and fall back to Taylor expansion if it isn't. Otherwise, the pole usually needs to be regularized by some suitable transformation. latex_name(const string & n) specifies the LaTeX code that represents the name of the function in LaTeX output. The default is to put the function name in an '\mbox{}'. do_not_evalf_params() This tells 'evalf()' to not recursively evaluate the parameters of the function before calling the 'evalf_func()'. set_return_type(unsigned return_type, const return_type_t * return_type_tinfo) This allows you to explicitly specify the commutation properties of the function (*Note Non-commutative objects::, for an explanation of (non)commutativity in GiNaC). For example, with an object of type 'return_type_t' created like return_type_t my_type = make_return_type_t(); you can use 'set_return_type(return_types::noncommutative, &my_type)' to make GiNaC treat your function like a matrix. By default, functions inherit the commutation properties of their first argument. The utilized template function 'make_return_type_t<>()' template inline return_type_t make_return_type_t(const unsigned rl = 0) can also be called with an argument specifying the representation label of the non-commutative function (see section on dirac gamma matrices for more details). set_symmetry(const symmetry & s) specifies the symmetry properties of the function with respect to its arguments. *Note Indexed objects::, for an explanation of symmetry specifications. GiNaC will automatically rearrange the arguments of symmetric functions into a canonical order. Sometimes you may want to have finer control over how functions are displayed in the output. For example, the 'abs()' function prints itself as 'abs(x)' in the default output format, but as '|x|' in LaTeX mode, and 'fabs(x)' in C source output. This is achieved with the print_func() option which is explained in the next section. 6.2.4 Functions with a variable number of arguments --------------------------------------------------- The 'DECLARE_FUNCTION' and 'REGISTER_FUNCTION' macros define functions with a fixed number of arguments. Sometimes, though, you may need to have a function that accepts a variable number of expressions. One way to accomplish this is to pass variable-length lists as arguments. The 'Li()' function uses this method for multiple polylogarithms. It is also possible to define functions that accept a different number of parameters under the same function name, such as the 'psi()' function which can be called either as 'psi(z)' (the digamma function) or as 'psi(n, z)' (polygamma functions). These are actually two different functions in GiNaC that, however, have the same name. Defining such functions is not possible with the macros but requires manually fiddling with GiNaC internals. If you are interested, please consult the GiNaC source code for the 'psi()' function ('inifcns.h' and 'inifcns_gamma.cpp').  File: ginac.info, Node: Printing, Next: Structures, Prev: Symbolic functions, Up: Extending GiNaC 6.3 GiNaC's expression output system ==================================== GiNaC allows the output of expressions in a variety of different formats (*note Input/output::). This section will explain how expression output is implemented internally, and how to define your own output formats or change the output format of built-in algebraic objects. You will also want to read this section if you plan to write your own algebraic classes or functions. All the different output formats are represented by a hierarchy of classes rooted in the 'print_context' class, defined in the 'print.h' header file: 'print_dflt' the default output format 'print_latex' output in LaTeX mathematical mode 'print_tree' a dump of the internal expression structure (for debugging) 'print_csrc' the base class for C source output 'print_csrc_float' C source output using the 'float' type 'print_csrc_double' C source output using the 'double' type 'print_csrc_cl_N' C source output using CLN types The 'print_context' base class provides two public data members: class print_context { ... public: std::ostream & s; unsigned options; }; 's' is a reference to the stream to output to, while 'options' holds flags and modifiers. Currently, there is only one flag defined: 'print_options::print_index_dimensions' instructs the 'idx' class to print the index dimension which is normally hidden. When you write something like 'std::cout << e', where 'e' is an object of class 'ex', GiNaC will construct an appropriate 'print_context' object (of a class depending on the selected output format), fill in the 's' and 'options' members, and call void ex::print(const print_context & c, unsigned level = 0) const; which in turn forwards the call to the 'print()' method of the top-level algebraic object contained in the expression. Unlike other methods, GiNaC classes don't usually override their 'print()' method to implement expression output. Instead, the default implementation 'basic::print(c, level)' performs a run-time double dispatch to a function selected by the dynamic type of the object and the passed 'print_context'. To this end, GiNaC maintains a separate method table for each class, similar to the virtual function table used for ordinary (single) virtual function dispatch. The method table contains one slot for each possible 'print_context' type, indexed by the (internally assigned) serial number of the type. Slots may be empty, in which case GiNaC will retry the method lookup with the 'print_context' object's parent class, possibly repeating the process until it reaches the 'print_context' base class. If there's still no method defined, the method table of the algebraic object's parent class is consulted, and so on, until a matching method is found (eventually it will reach the combination 'basic/print_context', which prints the object's class name enclosed in square brackets). You can think of the print methods of all the different classes and output formats as being arranged in a two-dimensional matrix with one axis listing the algebraic classes and the other axis listing the 'print_context' classes. Subclasses of 'basic' can, of course, also overload 'basic::print()' to implement printing, but then they won't get any of the benefits of the double dispatch mechanism (such as the ability for derived classes to inherit only certain print methods from its parent, or the replacement of methods at run-time). 6.3.1 Print methods for classes ------------------------------- The method table for a class is set up either in the definition of the class, by passing the appropriate 'print_func()' option to 'GINAC_IMPLEMENT_REGISTERED_CLASS_OPT()' (*Note Adding classes::, for an example), or at run-time using 'set_print_func()'. The latter can also be used to override existing methods dynamically. The argument to 'print_func()' and 'set_print_func()' can be a member function of the class (or one of its parent classes), a static member function, or an ordinary (global) C++ function. The 'C' template parameter specifies the appropriate 'print_context' type for which the method should be invoked, while, in the case of 'set_print_func<>()', the 'T' parameter specifies the algebraic class (for 'print_func<>()', the class is the one being implemented by 'GINAC_IMPLEMENT_REGISTERED_CLASS_OPT'). For print methods that are member functions, their first argument must be of a type convertible to a 'const C &', and the second argument must be an 'unsigned'. For static members and global functions, the first argument must be of a type convertible to a 'const T &', the second argument must be of a type convertible to a 'const C &', and the third argument must be an 'unsigned'. A global function will, of course, not have access to private and protected members of 'T'. The 'unsigned' argument of the print methods (and of 'ex::print()' and 'basic::print()') is used for proper parenthesizing of the output (and by 'print_tree' for proper indentation). It can be used for similar purposes if you write your own output formats. The explanations given above may seem complicated, but in practice it's really simple, as shown in the following example. Suppose that we want to display exponents in LaTeX output not as superscripts but with little upwards-pointing arrows. This can be achieved in the following way: void my_print_power_as_latex(const power & p, const print_latex & c, unsigned level) { // get the precedence of the 'power' class unsigned power_prec = p.precedence(); // if the parent operator has the same or a higher precedence // we need parentheses around the power if (level >= power_prec) c.s << '('; // print the basis and exponent, each enclosed in braces, and // separated by an uparrow c.s << '{'; p.op(0).print(c, power_prec); c.s << "}\\uparrow{"; p.op(1).print(c, power_prec); c.s << '}'; // don't forget the closing parenthesis if (level >= power_prec) c.s << ')'; } int main() { // a sample expression symbol x("x"), y("y"); ex e = -3*pow(x, 3)*pow(y, -2) + pow(x+y, 2) - 1; // switch to LaTeX mode cout << latex; // this prints "-1+{(y+x)}^{2}-3 \frac{x^{3}}{y^{2}}" cout << e << endl; // now we replace the method for the LaTeX output of powers with // our own one set_print_func(my_print_power_as_latex); // this prints "-1+{{(y+x)}}\uparrow{2}-3 \frac{{x}\uparrow{3}}{{y} // \uparrow{2}}" cout << e << endl; } Some notes: * The first argument of 'my_print_power_as_latex' could also have been a 'const basic &', the second one a 'const print_context &'. * The above code depends on 'mul' objects converting their operands to 'power' objects for the purpose of printing. * The output of products including negative powers as fractions is also controlled by the 'mul' class. * The 'power/print_latex' method provided by GiNaC prints square roots using '\sqrt', but the above code doesn't. It's not possible to restore a method table entry to its previous or default value. Once you have called 'set_print_func()', you can only override it with another call to 'set_print_func()', but you can't easily go back to the default behavior again (you can, of course, dig around in the GiNaC sources, find the method that is installed at startup ('power::do_print_latex' in this case), and 'set_print_func' that one; that is, after you circumvent the C++ member access control...). 6.3.2 Print methods for functions --------------------------------- Symbolic functions employ a print method dispatch mechanism similar to the one used for classes. The methods are specified with 'print_func()' function options. If you don't specify any special print methods, the function will be printed with its name (or LaTeX name, if supplied), followed by a comma-separated list of arguments enclosed in parentheses. For example, this is what GiNaC's 'abs()' function is defined like: static ex abs_eval(const ex & arg) { ... } static ex abs_evalf(const ex & arg) { ... } static void abs_print_latex(const ex & arg, const print_context & c) { c.s << "{|"; arg.print(c); c.s << "|}"; } static void abs_print_csrc_float(const ex & arg, const print_context & c) { c.s << "fabs("; arg.print(c); c.s << ")"; } REGISTER_FUNCTION(abs, eval_func(abs_eval). evalf_func(abs_evalf). print_func(abs_print_latex). print_func(abs_print_csrc_float). print_func(abs_print_csrc_float)); This will display 'abs(x)' as '|x|' in LaTeX mode and 'fabs(x)' in non-CLN C source output, but as 'abs(x)' in all other formats. There is currently no equivalent of 'set_print_func()' for functions. 6.3.3 Adding new output formats ------------------------------- Creating a new output format involves subclassing 'print_context', which is somewhat similar to adding a new algebraic class (*note Adding classes::). There is a macro 'GINAC_DECLARE_PRINT_CONTEXT' that needs to go into the class definition, and a corresponding macro 'GINAC_IMPLEMENT_PRINT_CONTEXT' that has to appear at global scope. Every 'print_context' class needs to provide a default constructor and a constructor from an 'std::ostream' and an 'unsigned' options value. Here is an example for a user-defined 'print_context' class: class print_myformat : public print_dflt { GINAC_DECLARE_PRINT_CONTEXT(print_myformat, print_dflt) public: print_myformat(std::ostream & os, unsigned opt = 0) : print_dflt(os, opt) {} }; print_myformat::print_myformat() : print_dflt(std::cout) {} GINAC_IMPLEMENT_PRINT_CONTEXT(print_myformat, print_dflt) That's all there is to it. None of the actual expression output logic is implemented in this class. It merely serves as a selector for choosing a particular format. The algorithms for printing expressions in the new format are implemented as print methods, as described above. 'print_myformat' is a subclass of 'print_dflt', so it behaves exactly like GiNaC's default output format: { symbol x("x"); ex e = pow(x, 2) + 1; // this prints "1+x^2" cout << e << endl; // this also prints "1+x^2" e.print(print_myformat()); cout << endl; ... } To fill 'print_myformat' with life, we need to supply appropriate print methods with 'set_print_func()', like this: // This prints powers with '**' instead of '^'. See the LaTeX output // example above for explanations. void print_power_as_myformat(const power & p, const print_myformat & c, unsigned level) { unsigned power_prec = p.precedence(); if (level >= power_prec) c.s << '('; p.op(0).print(c, power_prec); c.s << "**"; p.op(1).print(c, power_prec); if (level >= power_prec) c.s << ')'; } { ... // install a new print method for power objects set_print_func(print_power_as_myformat); // now this prints "1+x**2" e.print(print_myformat()); cout << endl; // but the default format is still "1+x^2" cout << e << endl; }  File: ginac.info, Node: Structures, Next: Adding classes, Prev: Printing, Up: Extending GiNaC 6.4 Structures ============== If you are doing some very specialized things with GiNaC, or if you just need some more organized way to store data in your expressions instead of anonymous lists, you may want to implement your own algebraic classes. ('algebraic class' means any class directly or indirectly derived from 'basic' that can be used in GiNaC expressions). GiNaC offers two ways of accomplishing this: either by using the 'structure' template class, or by rolling your own class from scratch. This section will discuss the 'structure' template which is easier to use but more limited, while the implementation of custom GiNaC classes is the topic of the next section. However, you may want to read both sections because many common concepts and member functions are shared by both concepts, and it will also allow you to decide which approach is most suited to your needs. The 'structure' template, defined in the GiNaC header file 'structure.h', wraps a type that you supply (usually a C++ 'struct' or 'class') into a GiNaC object that can be used in expressions. 6.4.1 Example: scalar products ------------------------------ Let's suppose that we need a way to handle some kind of abstract scalar product of the form '' in expressions. Objects of the scalar product class have to store their left and right operands, which can in turn be arbitrary expressions. Here is a possible way to represent such a product in a C++ 'struct': #include using namespace std; #include using namespace GiNaC; struct sprod_s { ex left, right; sprod_s() {} sprod_s(ex l, ex r) : left(l), right(r) {} }; The default constructor is required. Now, to make a GiNaC class out of this data structure, we need only one line: typedef structure sprod; That's it. This line constructs an algebraic class 'sprod' which contains objects of type 'sprod_s'. We can now use 'sprod' in expressions like any other GiNaC class: ... symbol a("a"), b("b"); ex e = sprod(sprod_s(a, b)); ... Note the difference between 'sprod' which is the algebraic class, and 'sprod_s' which is the unadorned C++ structure containing the 'left' and 'right' data members. As shown above, an 'sprod' can be constructed from an 'sprod_s' object. If you find the nested 'sprod(sprod_s())' constructor too unwieldy, you could define a little wrapper function like this: inline ex make_sprod(ex left, ex right) { return sprod(sprod_s(left, right)); } The 'sprod_s' object contained in 'sprod' can be accessed with the GiNaC 'ex_to<>()' function followed by the '->' operator or 'get_struct()': ... cout << ex_to(e)->left << endl; // -> a cout << ex_to(e).get_struct().right << endl; // -> b ... You only have read access to the members of 'sprod_s'. The type definition of 'sprod' is enough to write your own algorithms that deal with scalar products, for example: ex swap_sprod(ex p) { if (is_a(p)) { const sprod_s & sp = ex_to(p).get_struct(); return make_sprod(sp.right, sp.left); } else return p; } ... f = swap_sprod(e); // f is now ... 6.4.2 Structure output ---------------------- While the 'sprod' type is useable it still leaves something to be desired, most notably proper output: ... cout << e << endl; // -> [structure object] ... By default, any structure types you define will be printed as '[structure object]'. To override this you can either specialize the template's 'print()' member function, or specify print methods with 'set_print_func<>()', as described in *note Printing::. Unfortunately, it's not possible to supply class options like 'print_func<>()' to structures, so for a self-contained structure type you need to resort to overriding the 'print()' function, which is also what we will do here. The member functions of GiNaC classes are described in more detail in the next section, but it shouldn't be hard to figure out what's going on here: void sprod::print(const print_context & c, unsigned level) const { // tree debug output handled by superclass if (is_a(c)) inherited::print(c, level); // get the contained sprod_s object const sprod_s & sp = get_struct(); // print_context::s is a reference to an ostream c.s << "<" << sp.left << "|" << sp.right << ">"; } Now we can print expressions containing scalar products: ... cout << e << endl; // -> cout << swap_sprod(e) << endl; // -> ... 6.4.3 Comparing structures -------------------------- The 'sprod' class defined so far still has one important drawback: all scalar products are treated as being equal because GiNaC doesn't know how to compare objects of type 'sprod_s'. This can lead to some confusing and undesired behavior: ... cout << make_sprod(a, b) - make_sprod(a*a, b*b) << endl; // -> 0 cout << make_sprod(a, b) + make_sprod(a*a, b*b) << endl; // -> 2* or 2* (which one is undefined) ... To remedy this, we first need to define the operators '==' and '<' for objects of type 'sprod_s': inline bool operator==(const sprod_s & lhs, const sprod_s & rhs) { return lhs.left.is_equal(rhs.left) && lhs.right.is_equal(rhs.right); } inline bool operator<(const sprod_s & lhs, const sprod_s & rhs) { return lhs.left.compare(rhs.left) < 0 ? true : lhs.right.compare(rhs.right) < 0; } The ordering established by the '<' operator doesn't have to make any algebraic sense, but it needs to be well defined. Note that we can't use expressions like 'lhs.left == rhs.left' or 'lhs.left < rhs.left' in the implementation of these operators because they would construct GiNaC 'relational' objects which in the case of '<' do not establish a well defined ordering (for arbitrary expressions, GiNaC can't decide which one is algebraically 'less'). Next, we need to change our definition of the 'sprod' type to let GiNaC know that an ordering relation exists for the embedded objects: typedef structure sprod; 'sprod' objects then behave as expected: ... cout << make_sprod(a, b) - make_sprod(a*a, b*b) << endl; // -> - cout << make_sprod(a, b) + make_sprod(a*a, b*b) << endl; // -> + cout << make_sprod(a, b) - make_sprod(a, b) << endl; // -> 0 cout << make_sprod(a, b) + make_sprod(a, b) << endl; // -> 2* ... The 'compare_std_less' policy parameter tells GiNaC to use the 'std::less' and 'std::equal_to' functors to compare objects of type 'sprod_s'. By default, these functors forward their work to the standard '<' and '==' operators, which we have overloaded. Alternatively, we could have specialized 'std::less' and 'std::equal_to' for class 'sprod_s'. GiNaC provides two other comparison policies for 'structure' objects: the default 'compare_all_equal', and 'compare_bitwise' which does a bit-wise comparison of the contained 'T' objects. This should be used with extreme care because it only works reliably with built-in integral types, and it also compares any padding (filler bytes of undefined value) that the 'T' class might have. 6.4.4 Subexpressions -------------------- Our scalar product class has two subexpressions: the left and right operands. It might be a good idea to make them accessible via the standard 'nops()' and 'op()' methods: size_t sprod::nops() const { return 2; } ex sprod::op(size_t i) const { switch (i) { case 0: return get_struct().left; case 1: return get_struct().right; default: throw std::range_error("sprod::op(): no such operand"); } } Implementing 'nops()' and 'op()' for container types such as 'sprod' has two other nice side effects: * 'has()' works as expected * GiNaC generates better hash keys for the objects (the default implementation of 'calchash()' takes subexpressions into account) There is a non-const variant of 'op()' called 'let_op()' that allows replacing subexpressions: ex & sprod::let_op(size_t i) { // every non-const member function must call this ensure_if_modifiable(); switch (i) { case 0: return get_struct().left; case 1: return get_struct().right; default: throw std::range_error("sprod::let_op(): no such operand"); } } Once we have provided 'let_op()' we also get 'subs()' and 'map()' for free. In fact, every container class that returns a non-null 'nops()' value must either implement 'let_op()' or provide custom implementations of 'subs()' and 'map()'. In turn, the availability of 'map()' enables the recursive behavior of a couple of other default method implementations, in particular 'evalf()', 'evalm()', 'normal()', 'diff()' and 'expand()'. Although we probably want to provide our own version of 'expand()' for scalar products that turns expressions like '' into '+'. This is left as an exercise for the reader. The 'structure' template defines many more member functions that you can override by specialization to customize the behavior of your structures. You are referred to the next section for a description of some of these (especially 'eval()'). There is, however, one topic that shall be addressed here, as it demonstrates one peculiarity of the 'structure' template: archiving. 6.4.5 Archiving structures -------------------------- If you don't know how the archiving of GiNaC objects is implemented, you should first read the next section and then come back here. You're back? Good. To implement archiving for structures it is not enough to provide specializations for the 'archive()' member function and the unarchiving constructor (the 'unarchive()' function has a default implementation). You also need to provide a unique name (as a string literal) for each structure type you define. This is because in GiNaC archives, the class of an object is stored as a string, the class name. By default, this class name (as returned by the 'class_name()' member function) is 'structure' for all structure classes. This works as long as you have only defined one structure type, but if you use two or more you need to provide a different name for each by specializing the 'get_class_name()' member function. Here is a sample implementation for enabling archiving of the scalar product type defined above: const char *sprod::get_class_name() { return "sprod"; } void sprod::archive(archive_node & n) const { inherited::archive(n); n.add_ex("left", get_struct().left); n.add_ex("right", get_struct().right); } sprod::structure(const archive_node & n, lst & sym_lst) : inherited(n, sym_lst) { n.find_ex("left", get_struct().left, sym_lst); n.find_ex("right", get_struct().right, sym_lst); } Note that the unarchiving constructor is 'sprod::structure' and not 'sprod::sprod', and that we don't need to supply an 'sprod::unarchive()' function.  File: ginac.info, Node: Adding classes, Next: A comparison with other CAS, Prev: Structures, Up: Extending GiNaC 6.5 Adding classes ================== The 'structure' template provides an way to extend GiNaC with custom algebraic classes that is easy to use but has its limitations, the most severe of which being that you can't add any new member functions to structures. To be able to do this, you need to write a new class definition from scratch. This section will explain how to implement new algebraic classes in GiNaC by giving the example of a simple 'string' class. After reading this section you will know how to properly declare a GiNaC class and what the minimum required member functions are that you have to implement. We only cover the implementation of a 'leaf' class here (i.e. one that doesn't contain subexpressions). Creating a container class like, for example, a class representing tensor products is more involved but this section should give you enough information so you can consult the source to GiNaC's predefined classes if you want to implement something more complicated. 6.5.1 Hierarchy of algebraic classes. ------------------------------------- All algebraic classes (that is, all classes that can appear in expressions) in GiNaC are direct or indirect subclasses of the class 'basic'. So a 'basic *' represents a generic pointer to an algebraic class. Working with such pointers directly is cumbersome (think of memory management), hence GiNaC wraps them into 'ex' (*note Expressions are reference counted::). To make such wrapping possible every algebraic class has to implement several methods. Visitors (*note Visitors and tree traversal::), printing, and (un)archiving (*note Input/output::) require helper methods too. But don't worry, most of the work is simplified by the following macros (defined in 'registrar.h'): * 'GINAC_DECLARE_REGISTERED_CLASS' * 'GINAC_IMPLEMENT_REGISTERED_CLASS' * 'GINAC_IMPLEMENT_REGISTERED_CLASS_OPT' The 'GINAC_DECLARE_REGISTERED_CLASS' macro inserts declarations required for memory management, visitors, printing, and (un)archiving. It takes the name of the class and its direct superclass as arguments. The 'GINAC_DECLARE_REGISTERED_CLASS' should be the first line after the opening brace of the class definition. 'GINAC_IMPLEMENT_REGISTERED_CLASS' takes the same arguments as 'GINAC_DECLARE_REGISTERED_CLASS'. It initializes certain static members of a class so that printing and (un)archiving works. The 'GINAC_IMPLEMENT_REGISTERED_CLASS' may appear anywhere else in the source (at global scope, of course, not inside a function). 'GINAC_IMPLEMENT_REGISTERED_CLASS_OPT' is a variant of 'GINAC_IMPLEMENT_REGISTERED_CLASS'. It allows specifying additional options, such as custom printing functions. 6.5.2 A minimalistic example ---------------------------- Now we will start implementing a new class 'mystring' that allows placing character strings in algebraic expressions (this is not very useful, but it's just an example). This class will be a direct subclass of 'basic'. You can use this sample implementation as a starting point for your own classes (1). The code snippets given here assume that you have included some header files as follows: #include #include #include using namespace std; #include using namespace GiNaC; Now we can write down the class declaration. The class stores a C++ 'string' and the user shall be able to construct a 'mystring' object from a string: class mystring : public basic { GINAC_DECLARE_REGISTERED_CLASS(mystring, basic) public: mystring(const string & s); private: string str; }; GINAC_IMPLEMENT_REGISTERED_CLASS(mystring, basic) The 'GINAC_DECLARE_REGISTERED_CLASS' macro insert declarations required for memory management, visitors, printing, and (un)archiving. 'GINAC_IMPLEMENT_REGISTERED_CLASS' initializes certain static members of a class so that printing and (un)archiving works. Now there are three member functions we have to implement to get a working class: * 'mystring()', the default constructor. * 'int compare_same_type(const basic & other)', which is used internally by GiNaC to establish a canonical sort order for terms. It returns 0, +1 or -1, depending on the relative order of this object and the 'other' object. If it returns 0, the objects are considered equal. *Please notice:* This has nothing to do with the (numeric) ordering relationship expressed by '<', '>=' etc (which cannot be defined for non-numeric classes). For example, 'numeric(1).compare_same_type(numeric(2))' may return +1 even though 1 is clearly smaller than 2. Every GiNaC class must provide a 'compare_same_type()' function, even those representing objects for which no reasonable algebraic ordering relationship can be defined. * And, of course, 'mystring(const string& s)' which is the constructor we declared. Let's proceed step-by-step. The default constructor looks like this: mystring::mystring() { } In the default constructor you should set all other member variables to reasonable default values (we don't need that here since our 'str' member gets set to an empty string automatically). Our 'compare_same_type()' function uses a provided function to compare the string members: int mystring::compare_same_type(const basic & other) const { const mystring &o = static_cast(other); int cmpval = str.compare(o.str); if (cmpval == 0) return 0; else if (cmpval < 0) return -1; else return 1; } Although this function takes a 'basic &', it will always be a reference to an object of exactly the same class (objects of different classes are not comparable), so the cast is safe. If this function returns 0, the two objects are considered equal (in the sense that A-B=0), so you should compare all relevant member variables. Now the only thing missing is our constructor: mystring::mystring(const string& s) : str(s) { } No surprises here. We set the 'str' member from the argument. That's it! We now have a minimal working GiNaC class that can store strings in algebraic expressions. Let's confirm that the RTTI works: ex e = mystring("Hello, world!"); cout << is_a(e) << endl; // -> 1 (true) cout << ex_to(e).class_name() << endl; // -> mystring Obviously it does. Let's see what the expression 'e' looks like: cout << e << endl; // -> [mystring object] Hm, not exactly what we expect, but of course the 'mystring' class doesn't yet know how to print itself. This can be done either by implementing the 'print()' member function, or, preferably, by specifying a 'print_func<>()' class option. Let's say that we want to print the string surrounded by double quotes: class mystring : public basic { ... protected: void do_print(const print_context & c, unsigned level = 0) const; ... }; void mystring::do_print(const print_context & c, unsigned level) const { // print_context::s is a reference to an ostream c.s << '\"' << str << '\"'; } The 'level' argument is only required for container classes to correctly parenthesize the output. Now we need to tell GiNaC that 'mystring' objects should use the 'do_print()' member function for printing themselves. For this, we replace the line GINAC_IMPLEMENT_REGISTERED_CLASS(mystring, basic) with GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(mystring, basic, print_func(&mystring::do_print)) Let's try again to print the expression: cout << e << endl; // -> "Hello, world!" Much better. If we wanted to have 'mystring' objects displayed in a different way depending on the output format (default, LaTeX, etc.), we would have supplied multiple 'print_func<>()' options with different template parameters ('print_dflt', 'print_latex', etc.), separated by dots. This is similar to the way options are specified for symbolic functions. *Note Printing::, for a more in-depth description of the way expression output is implemented in GiNaC. The 'mystring' class can be used in arbitrary expressions: e += mystring("GiNaC rulez"); cout << e << endl; // -> "GiNaC rulez"+"Hello, world!" (GiNaC's automatic term reordering is in effect here), or even e = pow(mystring("One string"), 2*sin(Pi-mystring("Another string"))); cout << e << endl; // -> "One string"^(2*sin(-"Another string"+Pi)) Whether this makes sense is debatable but remember that this is only an example. At least it allows you to implement your own symbolic algorithms for your objects. Note that GiNaC's algebraic rules remain unchanged: e = mystring("Wow") * mystring("Wow"); cout << e << endl; // -> "Wow"^2 e = pow(mystring("First")-mystring("Second"), 2); cout << e.expand() << endl; // -> -2*"First"*"Second"+"First"^2+"Second"^2 There's no way to, for example, make GiNaC's 'add' class perform string concatenation. You would have to implement this yourself. 6.5.3 Automatic evaluation -------------------------- When dealing with objects that are just a little more complicated than the simple string objects we have implemented, chances are that you will want to have some automatic simplifications or canonicalizations performed on them. This is done in the evaluation member function 'eval()'. Let's say that we wanted all strings automatically converted to lowercase with non-alphabetic characters stripped, and empty strings removed: class mystring : public basic { ... public: ex eval() const override; ... }; ex mystring::eval() const { string new_str; for (size_t i=0; i= 'A' && c <= 'Z') new_str += tolower(c); else if (c >= 'a' && c <= 'z') new_str += c; } if (new_str.length() == 0) return 0; return mystring(new_str).hold(); } The 'hold()' member function sets a flag in the object that prevents further evaluation. Otherwise we might end up in an endless loop. When you want to return the object unmodified, use 'return this->hold();'. If our class had subobjects, we would have to evaluate them first (unless they are all of type 'ex', which are automatically evaluated). We don't have any subexpressions in the 'mystring' class, so we are not concerned with this. Let's confirm that it works: ex e = mystring("Hello, world!") + mystring("!?#"); cout << e << endl; // -> "helloworld" e = mystring("Wow!") + mystring("WOW") + mystring(" W ** o ** W"); cout << e << endl; // -> 3*"wow" 6.5.4 Optional member functions ------------------------------- We have implemented only a small set of member functions to make the class work in the GiNaC framework. There are two functions that are not strictly required but will make operations with objects of the class more efficient: unsigned calchash() const override; bool is_equal_same_type(const basic & other) const override; The 'calchash()' method returns an 'unsigned' hash value for the object which will allow GiNaC to compare and canonicalize expressions much more efficiently. You should consult the implementation of some of the built-in GiNaC classes for examples of hash functions. The default implementation of 'calchash()' calculates a hash value out of the 'tinfo_key' of the class and all subexpressions that are accessible via 'op()'. 'is_equal_same_type()' works like 'compare_same_type()' but only tests for equality without establishing an ordering relation, which is often faster. The default implementation of 'is_equal_same_type()' just calls 'compare_same_type()' and tests its result for zero. 6.5.5 Other member functions ---------------------------- For a real algebraic class, there are probably some more functions that you might want to provide: bool info(unsigned inf) const override; ex evalf() const override; ex series(const relational & r, int order, unsigned options = 0) const override; ex derivative(const symbol & s) const override; If your class stores sub-expressions (see the scalar product example in the previous section) you will probably want to override size_t nops() const override; ex op(size_t i) const override; ex & let_op(size_t i) override; ex subs(const lst & ls, const lst & lr, unsigned options = 0) const override; ex map(map_function & f) const override; 'let_op()' is a variant of 'op()' that allows write access. The default implementations of 'subs()' and 'map()' use it, so you have to implement either 'let_op()', or 'subs()' and 'map()'. You can, of course, also add your own new member functions. Remember that the RTTI may be used to get information about what kinds of objects you are dealing with (the position in the class hierarchy) and that you can always extract the bare object from an 'ex' by stripping the 'ex' off using the 'ex_to(e)' function when that should become a need. That's it. May the source be with you! 6.5.6 Upgrading extension classes from older version of GiNaC ------------------------------------------------------------- GiNaC used to use a custom run time type information system (RTTI). It was removed from GiNaC. Thus, one needs to rewrite constructors which set 'tinfo_key' (which does not exist any more). For example, myclass::myclass() : inherited(&myclass::tinfo_static) {} needs to be rewritten as myclass::myclass() {} ---------- Footnotes ---------- (1) The self-contained source for this example is included in GiNaC, see the 'doc/examples/mystring.cpp' file.  File: ginac.info, Node: A comparison with other CAS, Next: Advantages, Prev: Adding classes, Up: Top 7 A Comparison With Other CAS ***************************** This chapter will give you some information on how GiNaC compares to other, traditional Computer Algebra Systems, like _Maple_, _Mathematica_ or _Reduce_, where it has advantages and disadvantages over these systems. * Menu: * Advantages:: Strengths of the GiNaC approach. * Disadvantages:: Weaknesses of the GiNaC approach. * Why C++?:: Attractiveness of C++.  File: ginac.info, Node: Advantages, Next: Disadvantages, Prev: A comparison with other CAS, Up: A comparison with other CAS 7.1 Advantages ============== GiNaC has several advantages over traditional Computer Algebra Systems, like * familiar language: all common CAS implement their own proprietary grammar which you have to learn first (and maybe learn again when your vendor decides to 'enhance' it). With GiNaC you can write your program in common C++, which is standardized. * structured data types: you can build up structured data types using 'struct's or 'class'es together with STL features instead of using unnamed lists of lists of lists. * strongly typed: in CAS, you usually have only one kind of variables which can hold contents of an arbitrary type. This 4GL like feature is nice for novice programmers, but dangerous. * development tools: powerful development tools exist for C++, like fancy editors (e.g. with automatic indentation and syntax highlighting), debuggers, visualization tools, documentation generators... * modularization: C++ programs can easily be split into modules by separating interface and implementation. * price: GiNaC is distributed under the GNU Public License which means that it is free and available with source code. And there are excellent C++-compilers for free, too. * extendable: you can add your own classes to GiNaC, thus extending it on a very low level. Compare this to a traditional CAS that you can usually only extend on a high level by writing in the language defined by the parser. In particular, it turns out to be almost impossible to fix bugs in a traditional system. * multiple interfaces: Though real GiNaC programs have to be written in some editor, then be compiled, linked and executed, there are more ways to work with the GiNaC engine. Many people want to play with expressions interactively, as in traditional CASs: The tiny 'ginsh' that comes with the distribution exposes many, but not all, of GiNaC's types to a command line. * seamless integration: it is somewhere between difficult and impossible to call CAS functions from within a program written in C++ or any other programming language and vice versa. With GiNaC, your symbolic routines are part of your program. You can easily call third party libraries, e.g. for numerical evaluation or graphical interaction. All other approaches are much more cumbersome: they range from simply ignoring the problem (i.e. _Maple_) to providing a method for 'embedding' the system (i.e. _Yacas_). * efficiency: often large parts of a program do not need symbolic calculations at all. Why use large integers for loop variables or arbitrary precision arithmetics where 'int' and 'double' are sufficient? For pure symbolic applications, GiNaC is comparable in speed with other CAS.  File: ginac.info, Node: Disadvantages, Next: Why C++?, Prev: Advantages, Up: A comparison with other CAS 7.2 Disadvantages ================= Of course it also has some disadvantages: * advanced features: GiNaC cannot compete with a program like _Reduce_ which exists for more than 30 years now or _Maple_ which grows since 1981 by the work of dozens of programmers, with respect to mathematical features. Integration, non-trivial simplifications, limits etc. are missing in GiNaC (and are not planned for the near future). * portability: While the GiNaC library itself is designed to avoid any platform dependent features (it should compile on any ANSI compliant C++ compiler), the currently used version of the CLN library (fast large integer and arbitrary precision arithmetics) can only by compiled without hassle on systems with the C++ compiler from the GNU Compiler Collection (GCC).(1) GiNaC uses recent language features like explicit constructors, mutable members, RTTI, 'dynamic_cast's and STL, so ANSI compliance is meant literally. ---------- Footnotes ---------- (1) This is because CLN uses PROVIDE/REQUIRE like macros to let the compiler gather all static initializations, which works for GNU C++ only. Feel free to contact the authors in case you really believe that you need to use a different compiler. We have occasionally used other compilers and may be able to give you advice.  File: ginac.info, Node: Why C++?, Next: Internal structures, Prev: Disadvantages, Up: A comparison with other CAS 7.3 Why C++? ============ Why did we choose to implement GiNaC in C++ instead of Java or any other language? C++ is not perfect: type checking is not strict (casting is possible), separation between interface and implementation is not complete, object oriented design is not enforced. The main reason is the often scolded feature of operator overloading in C++. While it may be true that operating on classes with a '+' operator is rarely meaningful, it is perfectly suited for algebraic expressions. Writing 3x+5y as '3*x+5*y' instead of 'x.times(3).plus(y.times(5))' looks much more natural. Furthermore, the main developers are more familiar with C++ than with any other programming language.  File: ginac.info, Node: Internal structures, Next: Expressions are reference counted, Prev: Why C++?, Up: Top Appendix A Internal structures ****************************** * Menu: * Expressions are reference counted:: * Internal representation of products and sums::  File: ginac.info, Node: Expressions are reference counted, Next: Internal representation of products and sums, Prev: Internal structures, Up: Internal structures A.1 Expressions are reference counted ===================================== In GiNaC, there is an _intrusive reference-counting_ mechanism at work where the counter belongs to the algebraic objects derived from class 'basic' but is maintained by the smart pointer class 'ptr', of which 'ex' contains an instance. If you understood that, you can safely skip the rest of this passage. Expressions are extremely light-weight since internally they work like handles to the actual representation. They really hold nothing more than a pointer to some other object. What this means in practice is that whenever you create two 'ex' and set the second equal to the first no copying process is involved. Instead, the copying takes place as soon as you try to change the second. Consider the simple sequence of code: #include #include using namespace std; using namespace GiNaC; int main() { symbol x("x"), y("y"), z("z"); ex e1, e2; e1 = sin(x + 2*y) + 3*z + 41; e2 = e1; // e2 points to same object as e1 cout << e2 << endl; // prints sin(x+2*y)+3*z+41 e2 += 1; // e2 is copied into a new object cout << e2 << endl; // prints sin(x+2*y)+3*z+42 } The line 'e2 = e1;' creates a second expression pointing to the object held already by 'e1'. The time involved for this operation is therefore constant, no matter how large 'e1' was. Actual copying, however, must take place in the line 'e2 += 1;' because 'e1' and 'e2' are not handles for the same object any more. This concept is called "copy-on-write semantics". It increases performance considerably whenever one object occurs multiple times and represents a simple garbage collection scheme because when an 'ex' runs out of scope its destructor checks whether other expressions handle the object it points to too and deletes the object from memory if that turns out not to be the case. A slightly less trivial example of differentiation using the chain-rule should make clear how powerful this can be: { symbol x("x"), y("y"); ex e1 = x + 3*y; ex e2 = pow(e1, 3); ex e3 = diff(sin(e2), x); // first derivative of sin(e2) by x cout << e1 << endl // prints x+3*y << e2 << endl // prints (x+3*y)^3 << e3 << endl; // prints 3*(x+3*y)^2*cos((x+3*y)^3) } Here, 'e1' will actually be referenced three times while 'e2' will be referenced two times. When the power of an expression is built, that expression needs not be copied. Likewise, since the derivative of a power of an expression can be easily expressed in terms of that expression, no copying of 'e1' is involved when 'e3' is constructed. So, when 'e3' is constructed it will print as '3*(x+3*y)^2*cos((x+3*y)^3)' but the argument of 'cos()' only holds a reference to 'e2' and the factor in front is just '3*e1^2'. As a user of GiNaC, you cannot see this mechanism of copy-on-write semantics. When you insert an expression into a second expression, the result behaves exactly as if the contents of the first expression were inserted. But it may be useful to remember that this is not what happens. Knowing this will enable you to write much more efficient code. If you still have an uncertain feeling with copy-on-write semantics, we recommend you have a look at the C++-FAQ lite (http://www.parashift.com/c++-faq-lite/) by Marshall Cline. Chapter 16 covers this issue and presents an implementation which is pretty close to the one in GiNaC.  File: ginac.info, Node: Internal representation of products and sums, Next: Package tools, Prev: Expressions are reference counted, Up: Internal structures A.2 Internal representation of products and sums ================================================ Although it should be completely transparent for the user of GiNaC a short discussion of this topic helps to understand the sources and also explain performance to a large degree. Consider the unexpanded symbolic expression 2*d^3*(4*a+5*b-3) which could naively be represented by a tree of linear containers for addition and multiplication, one container for exponentiation with base and exponent and some atomic leaves of symbols and numbers in this fashion: However, doing so results in a rather deeply nested tree which will quickly become inefficient to manipulate. We can improve on this by representing the sum as a sequence of terms, each one being a pair of a purely numeric multiplicative coefficient and its rest. In the same spirit we can store the multiplication as a sequence of terms, each having a numeric exponent and a possibly complicated base, the tree becomes much more flat: The number '3' above the symbol 'd' shows that 'mul' objects are treated similarly where the coefficients are interpreted as _exponents_ now. Addition of sums of terms or multiplication of products with numerical exponents can be coded to be very efficient with such a pair-wise representation. Internally, this handling is performed by most CAS in this way. It typically speeds up manipulations by an order of magnitude. The overall multiplicative factor '2' and the additive term '-3' look somewhat out of place in this representation, however, since they are still carrying a trivial exponent and multiplicative factor '1' respectively. Within GiNaC, this is avoided by adding a field that carries an overall numeric coefficient. This results in the realistic picture of internal representation for 2*d^3*(4*a+5*b-3): This also allows for a better handling of numeric radicals, since 'sqrt(2)' can now be carried along calculations. Now it should be clear, why both classes 'add' and 'mul' are derived from the same abstract class: the data representation is the same, only the semantics differs. In the class hierarchy, methods for polynomial expansion and the like are reimplemented for 'add' and 'mul', but the data structure is inherited from 'expairseq'.  File: ginac.info, Node: Package tools, Next: Configure script options, Prev: Internal representation of products and sums, Up: Top Appendix B Package tools ************************ If you are creating a software package that uses the GiNaC library, setting the correct command line options for the compiler and linker can be difficult. The 'pkg-config' utility makes this process easier. GiNaC supplies all necessary data in 'ginac.pc' (installed into '/usr/local/lib/pkgconfig' by default). To compile a simple program use (1) g++ -o simple `pkg-config --cflags --libs ginac` simple.cpp This command line might expand to (for example): g++ -o simple -lginac -lcln simple.cpp Not only is the form using 'pkg-config' easier to type, it will work on any system, no matter how GiNaC was configured. For packages configured using GNU automake, 'pkg-config' also provides the 'PKG_CHECK_MODULES' macro to automate the process of checking for libraries PKG_CHECK_MODULES(MYAPP, ginac >= MINIMUM_VERSION, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) This macro: * Determines the location of GiNaC using data from 'ginac.pc', which is either found in the default 'pkg-config' search path, or from the environment variable 'PKG_CONFIG_PATH'. * Tests the installed libraries to make sure that their version is later than MINIMUM-VERSION. * If the required version was found, sets the 'MYAPP_CFLAGS' variable to the output of 'pkg-config --cflags ginac' and the 'MYAPP_LIBS' variable to the output of 'pkg-config --libs ginac', and calls 'AC_SUBST()' for these variables so they can be used in generated makefiles, and then executes ACTION-IF-FOUND. * If the required version was not found, executes ACTION-IF-NOT-FOUND. * Menu: * Configure script options:: Configuring a package that uses GiNaC * Example package:: Example of a package using GiNaC ---------- Footnotes ---------- (1) If GiNaC is installed into some non-standard directory PREFIX one should set the PKG_CONFIG_PATH environment variable to PREFIX/lib/pkgconfig for this to work.  File: ginac.info, Node: Configure script options, Next: Example package, Prev: Package tools, Up: Package tools B.1 Configuring a package that uses GiNaC ========================================= The directory where the GiNaC libraries are installed needs to be found by your system's dynamic linkers (both compile- and run-time ones). See the documentation of your system linker for details. Also make sure that 'ginac.pc' is in 'pkg-config''s search path, *Note pkg-config: (*manpages*)pkg-config. The short summary below describes how to do this on a GNU/Linux system. Suppose GiNaC is installed into the directory 'PREFIX'. To tell the linkers where to find the library one should * edit '/etc/ld.so.conf' and run 'ldconfig'. For example, # echo PREFIX/lib >> /etc/ld.so.conf # ldconfig * or set the environment variables 'LD_LIBRARY_PATH' and 'LD_RUN_PATH' $ export LD_LIBRARY_PATH=PREFIX/lib $ export LD_RUN_PATH=PREFIX/lib * or give a '-L' and '--rpath' flags when running configure, for instance: $ LDFLAGS='-Wl,-LPREFIX/lib -Wl,--rpath=PREFIX/lib' ./configure To tell 'pkg-config' where the 'ginac.pc' file is, set the 'PKG_CONFIG_PATH' environment variable: $ export PKG_CONFIG_PATH=PREFIX/lib/pkgconfig Finally, run the 'configure' script $ ./configure  File: ginac.info, Node: Example package, Next: Bibliography, Prev: Configure script options, Up: Package tools B.2 Example of a package using GiNaC ==================================== The following shows how to build a simple package using automake and the 'PKG_CHECK_MODULES' macro. The program used here is 'simple.cpp': #include #include int main() { GiNaC::symbol x("x"); GiNaC::ex a = GiNaC::sin(x); std::cout << "Derivative of " << a << " is " << a.diff(x) << std::endl; return 0; } You should first read the introductory portions of the automake Manual, if you are not already familiar with it. Two files are needed, 'configure.ac', which is used to build the configure script: dnl Process this file with autoreconf to produce a configure script. AC_INIT([simple], 1.0.0, bogus@example.net) AC_CONFIG_SRCDIR(simple.cpp) AM_INIT_AUTOMAKE([foreign 1.8]) AC_PROG_CXX AC_PROG_INSTALL AC_LANG([C++]) PKG_CHECK_MODULES(SIMPLE, ginac >= 1.3.7) AC_OUTPUT(Makefile) The 'PKG_CHECK_MODULES' macro does the following: If a GiNaC version greater or equal than 1.3.7 is found, then it defines SIMPLE_CFLAGS and SIMPLE_LIBS. Otherwise, it dies with the error message like configure: error: Package requirements (ginac >= 1.3.7) were not met: Requested 'ginac >= 1.3.7' but version of GiNaC is 1.3.5 Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables SIMPLE_CFLAGS and SIMPLE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. And the 'Makefile.am', which will be used to build the Makefile. ## Process this file with automake to produce Makefile.in bin_PROGRAMS = simple simple_SOURCES = simple.cpp simple_CPPFLAGS = $(SIMPLE_CFLAGS) simple_LDADD = $(SIMPLE_LIBS) This 'Makefile.am', says that we are building a single executable, from a single source file 'simple.cpp'. Since every program we are building uses GiNaC we could have simply added SIMPLE_CFLAGS to CPPFLAGS and SIMPLE_LIBS to LIBS. However, it is more flexible to specify libraries and complier options on a per-program basis. To try this example out, create a new directory and add the three files above to it. Now execute the following command: $ autoreconf -i You now have a package that can be built in the normal fashion $ ./configure $ make $ make install  File: ginac.info, Node: Bibliography, Next: Concept index, Prev: Example package, Up: Top Appendix C Bibliography *********************** - 'ISO/IEC 14882:2011: Programming Languages: C++' - 'CLN: A Class Library for Numbers', Bruno Haible - 'The C++ Programming Language', Bjarne Stroustrup, 3rd Edition, ISBN 0-201-88954-4, Addison Wesley - 'C++ FAQs', Marshall Cline, ISBN 0-201-58958-3, 1995, Addison Wesley - 'Algorithms for Computer Algebra', Keith O. Geddes, Stephen R. Czapor, and George Labahn, ISBN 0-7923-9259-0, 1992, Kluwer Academic Publishers, Norwell, Massachusetts - 'Computer Algebra: Systems and Algorithms for Algebraic Computation', James H. Davenport, Yvon Siret and Evelyne Tournier, ISBN 0-12-204230-1, 1988, Academic Press, London - 'Computer Algebra Systems - A Practical Guide', Michael J. Wester (editor), ISBN 0-471-98353-5, 1999, Wiley, Chichester - 'The Art of Computer Programming, Vol 2: Seminumerical Algorithms', Donald E. Knuth, ISBN 0-201-89684-2, 1998, Addison Wesley - 'Pi Unleashed', Jo"rg Arndt and Christoph Haenel, ISBN 3-540-66572-2, 2001, Springer, Heidelberg - 'The Role of gamma5 in Dimensional Regularization', Dirk Kreimer, hep-ph/9401354  File: ginac.info, Node: Concept index, Prev: Bibliography, Up: Top Concept index ************* [index] * Menu: * abs(): Built-in functions. (line 16) * accept(): Visitors and tree traversal. (line 6) * accuracy: Numbers. (line 61) * acos(): Built-in functions. (line 28) * acosh(): Built-in functions. (line 35) * add: Fundamental containers. (line 6) * add <1>: Internal representation of products and sums. (line 6) * advocacy: A comparison with other CAS. (line 6) * alternating Euler sum: Multiple polylogarithms. (line 6) * antisymmetrize(): Symmetrization. (line 6) * append(): Lists. (line 6) * archive (class): Input/output. (line 391) * archiving: Input/output. (line 391) * asin(): Built-in functions. (line 27) * asinh(): Built-in functions. (line 34) * atan(): Built-in functions. (line 29) * atanh(): Built-in functions. (line 36) * atom: The class hierarchy. (line 12) * atom <1>: Symbols. (line 6) * Autoconf: Configuration. (line 6) * bernoulli(): Numbers. (line 224) * beta(): Built-in functions. (line 56) * binomial(): Built-in functions. (line 61) * branch cut: Built-in functions. (line 64) * building GiNaC: Building GiNaC. (line 6) * calchash(): Adding classes. (line 309) * canonicalize_clifford(): Non-commutative objects. (line 407) * Catalan: Constants. (line 6) * chain rule: Symbolic differentiation. (line 6) * charpoly(): Matrices. (line 200) * clifford (class): Non-commutative objects. (line 103) * clifford_bar(): Non-commutative objects. (line 373) * clifford_inverse(): Non-commutative objects. (line 393) * clifford_max_label(): Non-commutative objects. (line 427) * clifford_moebius_map(): Non-commutative objects. (line 412) * clifford_norm(): Non-commutative objects. (line 389) * clifford_prime(): Non-commutative objects. (line 373) * clifford_star(): Non-commutative objects. (line 373) * clifford_to_lst(): Non-commutative objects. (line 357) * clifford_unit(): Non-commutative objects. (line 265) * CLN: Installation. (line 6) * CLN <1>: Numbers. (line 6) * coeff(): Polynomial arithmetic. (line 92) * collect(): Polynomial arithmetic. (line 21) * collect_common_factors(): Polynomial arithmetic. (line 21) * color (class): Non-commutative objects. (line 448) * color_d(): Non-commutative objects. (line 474) * color_f(): Non-commutative objects. (line 474) * color_h(): Non-commutative objects. (line 488) * color_ONE(): Non-commutative objects. (line 464) * color_T(): Non-commutative objects. (line 452) * color_trace(): Non-commutative objects. (line 532) * compare(): Information about expressions. (line 231) * compare_same_type(): Adding classes. (line 104) * compile_ex: Input/output. (line 326) * compiling expressions: Input/output. (line 276) * complex numbers: Numbers. (line 46) * configuration: Configuration. (line 6) * conjugate(): Built-in functions. (line 18) * conjugate() <1>: Complex expressions. (line 6) * constant (class): Constants. (line 6) * const_iterator: Information about expressions. (line 124) * const_postorder_iterator: Information about expressions. (line 154) * const_preorder_iterator: Information about expressions. (line 154) * container: The class hierarchy. (line 12) * container <1>: Information about expressions. (line 107) * content(): Polynomial arithmetic. (line 193) * contravariant: Indexed objects. (line 23) * Converting ex to other classes: Information about expressions. (line 9) * copy-on-write: Expressions are reference counted. (line 6) * cos(): Built-in functions. (line 25) * cosh(): Built-in functions. (line 32) * covariant: Indexed objects. (line 23) * csrc: Input/output. (line 60) * csrc_cl_N: Input/output. (line 60) * csrc_double: Input/output. (line 60) * csrc_float: Input/output. (line 60) * CUBA library: Input/output. (line 321) * DECLARE_FUNCTION: Symbolic functions. (line 10) * degree(): Polynomial arithmetic. (line 92) * delta_tensor(): Indexed objects. (line 467) * denom(): Rational expressions. (line 42) * denominator: Rational expressions. (line 42) * determinant(): Matrices. (line 200) * dflt: Input/output. (line 39) * diag_matrix(): Matrices. (line 41) * diff(): Symbolic differentiation. (line 6) * differentiation: Symbolic differentiation. (line 6) * Digits: Numbers. (line 61) * Digits <1>: Numerical evaluation. (line 11) * dirac_gamma(): Non-commutative objects. (line 109) * dirac_gamma5(): Non-commutative objects. (line 138) * dirac_gammaL(): Non-commutative objects. (line 144) * dirac_gammaR(): Non-commutative objects. (line 144) * dirac_ONE(): Non-commutative objects. (line 128) * dirac_slash(): Non-commutative objects. (line 153) * dirac_trace(): Non-commutative objects. (line 185) * divide(): Polynomial arithmetic. (line 167) * doublefactorial(): Numbers. (line 222) * dummy index: Indexed objects. (line 339) * epsilon_tensor(): Indexed objects. (line 586) * eta(): Built-in functions. (line 40) * Euler: Constants. (line 6) * Euler numbers: Symbolic differentiation. (line 36) * eval(): Automatic evaluation. (line 44) * eval() <1>: Adding classes. (line 249) * evalf(): Constants. (line 6) * evalf() <1>: Numerical evaluation. (line 6) * evalm(): Matrices. (line 153) * evaluation: Automatic evaluation. (line 6) * evaluation <1>: Symbolic functions. (line 86) * evaluation <2>: Adding classes. (line 249) * exceptions: Error handling. (line 6) * exp(): Built-in functions. (line 37) * expand trancedent functions: Built-in functions. (line 80) * expand(): Indexed objects. (line 455) * expand() <1>: Polynomial arithmetic. (line 21) * expand_dummy_sum(): Indexed objects. (line 390) * expand_options::expand_function_args: Built-in functions. (line 80) * expand_options::expand_transcendental: Built-in functions. (line 80) * expression (class ex): Expressions. (line 6) * ex_is_equal (class): Information about expressions. (line 231) * ex_is_less (class): Information about expressions. (line 231) * ex_to<...>(): Information about expressions. (line 9) * factor(): Polynomial arithmetic. (line 300) * factorial(): Built-in functions. (line 60) * factorization: Polynomial arithmetic. (line 276) * factorization <1>: Polynomial arithmetic. (line 300) * fibonacci(): Numbers. (line 225) * find(): Pattern matching and advanced substitutions. (line 186) * fraction: Numbers. (line 6) * fsolve: What it can do for you. (line 146) * FUNCP_1P: Input/output. (line 314) * FUNCP_2P: Input/output. (line 314) * FUNCP_CUBA: Input/output. (line 314) * function (class): Mathematical functions. (line 6) * G(): Built-in functions. (line 44) * G() <1>: Built-in functions. (line 46) * Gamma function: Mathematical functions. (line 17) * gamma function: Built-in functions. (line 53) * garbage collection: Expressions are reference counted. (line 6) * GCD: Polynomial arithmetic. (line 220) * gcd(): Polynomial arithmetic. (line 220) * get_dim(): Indexed objects. (line 111) * get_free_indices(): Indexed objects. (line 340) * get_metric(): Non-commutative objects. (line 288) * get_name(): Symbols. (line 148) * get_TeX_name(): Symbols. (line 148) * get_value(): Indexed objects. (line 111) * ginac-excompiler: Input/output. (line 379) * ginsh: What it can do for you. (line 6) * ginsh <1>: Fundamental containers. (line 37) * ginsh <2>: What does not belong into GiNaC. (line 6) * GMP: Numbers. (line 6) * H(): Built-in functions. (line 48) * harmonic polylogarithm: Multiple polylogarithms. (line 6) * has(): Expressions. (line 6) * has() <1>: Pattern matching and advanced substitutions. (line 150) * Hermite polynomial: How to use it from within C++. (line 39) * hierarchy of classes: Symbols. (line 6) * hierarchy of classes <1>: Adding classes. (line 26) * history of GiNaC: Introduction. (line 6) * hold(): Symbolic functions. (line 86) * hold() <1>: Adding classes. (line 249) * hyperbolic function: Mathematical functions. (line 6) * I: Numbers. (line 46) * I/O: Input/output. (line 5) * idx (class): Indexed objects. (line 17) * imag(): Numbers. (line 191) * imag_part(): Built-in functions. (line 20) * indexed (class): Indexed objects. (line 16) * index_dimensions: Input/output. (line 118) * info(): Information about expressions. (line 9) * input of expressions: Input/output. (line 180) * installation: Installing GiNaC. (line 6) * integral (class): Integrals. (line 6) * inverse() (matrix): Matrices. (line 226) * inverse() (numeric): Numbers. (line 187) * iquo(): Numbers. (line 234) * irem(): Numbers. (line 231) * isqrt(): Numbers. (line 198) * is_a<...>(): Information about expressions. (line 9) * is_equal(): Information about expressions. (line 206) * is_equal_same_type(): Adding classes. (line 309) * is_exactly_a<...>(): Information about expressions. (line 9) * is_polynomial(): Polynomial arithmetic. (line 9) * is_zero(): Information about expressions. (line 206) * is_zero_matrix(): Matrices. (line 122) * iterators: Information about expressions. (line 124) * latex: Input/output. (line 98) * Laurent expansion: Series expansion. (line 6) * LCM: Polynomial arithmetic. (line 220) * lcm(): Polynomial arithmetic. (line 220) * ldegree(): Polynomial arithmetic. (line 92) * let_op(): Structures. (line 248) * let_op() <1>: Adding classes. (line 339) * lgamma(): Built-in functions. (line 54) * Li(): Built-in functions. (line 43) * Li2(): Built-in functions. (line 41) * link_ex: Input/output. (line 343) * lists: Lists. (line 6) * log(): Built-in functions. (line 38) * lorentz_eps(): Indexed objects. (line 585) * lorentz_g(): Indexed objects. (line 522) * lsolve(): Solving linear systems of equations. (line 6) * lst (class): Lists. (line 6) * lst_to_clifford(): Non-commutative objects. (line 327) * lst_to_matrix(): Matrices. (line 33) * Machin's formula: Series expansion. (line 38) * map(): Applying a function on subexpressions. (line 6) * match(): Pattern matching and advanced substitutions. (line 50) * matrix (class): Matrices. (line 6) * metric_tensor(): Indexed objects. (line 489) * mod(): Numbers. (line 227) * Monte Carlo integration: Input/output. (line 321) * mul: Fundamental containers. (line 6) * mul <1>: Internal representation of products and sums. (line 6) * multiple polylogarithm: Multiple polylogarithms. (line 6) * multiple zeta value: Multiple polylogarithms. (line 6) * ncmul (class): Non-commutative objects. (line 43) * Nielsen's generalized polylogarithm: Multiple polylogarithms. (line 6) * nops(): Lists. (line 6) * nops() <1>: Information about expressions. (line 112) * normal(): Rational expressions. (line 9) * no_index_dimensions: Input/output. (line 118) * numer(): Rational expressions. (line 42) * numerator: Rational expressions. (line 42) * numeric (class): Numbers. (line 6) * numer_denom(): Rational expressions. (line 42) * op(): Lists. (line 6) * op() <1>: Information about expressions. (line 112) * Order(): Series expansion. (line 6) * Order() <1>: Built-in functions. (line 62) * output of expressions: Input/output. (line 9) * pair-wise representation: Internal representation of products and sums. (line 16) * Pattern matching: Pattern matching and advanced substitutions. (line 6) * Pi: Constants. (line 6) * pole_error (class): Error handling. (line 6) * polylogarithm: Multiple polylogarithms. (line 6) * polynomial: Fundamental containers. (line 6) * polynomial <1>: Methods and functions. (line 6) * polynomial division: Polynomial arithmetic. (line 167) * polynomial factorization: Polynomial arithmetic. (line 300) * possymbol(): Symbols. (line 169) * pow(): Fundamental containers. (line 20) * power: Fundamental containers. (line 6) * power <1>: Internal representation of products and sums. (line 6) * prem(): Polynomial arithmetic. (line 167) * prepend(): Lists. (line 6) * primpart(): Polynomial arithmetic. (line 193) * print(): Printing. (line 52) * printing: Input/output. (line 9) * print_context (class): Printing. (line 13) * print_csrc (class): Printing. (line 13) * print_dflt (class): Printing. (line 13) * print_latex (class): Printing. (line 13) * print_tree (class): Printing. (line 13) * product rule: Symbolic differentiation. (line 6) * product rule <1>: Symbolic functions. (line 167) * pseries (class): Series expansion. (line 6) * pseudo-remainder: Polynomial arithmetic. (line 167) * pseudo-vector: Non-commutative objects. (line 337) * psi(): Built-in functions. (line 57) * quo(): Polynomial arithmetic. (line 167) * quotient: Polynomial arithmetic. (line 167) * radical: Internal representation of products and sums. (line 41) * rank(): Matrices. (line 200) * rational: Numbers. (line 6) * real(): Numbers. (line 190) * realsymbol(): Symbols. (line 158) * real_part(): Built-in functions. (line 19) * reduced_matrix(): Matrices. (line 62) * reference counting: Expressions are reference counted. (line 6) * REGISTER_FUNCTION: Symbolic functions. (line 10) * relational (class): Relations. (line 6) * relational (class) <1>: Information about expressions. (line 196) * rem(): Polynomial arithmetic. (line 167) * remainder: Polynomial arithmetic. (line 167) * remove_all(): Lists. (line 6) * remove_dirac_ONE(): Non-commutative objects. (line 402) * remove_first(): Lists. (line 6) * remove_last(): Lists. (line 6) * representation: Internal representation of products and sums. (line 6) * resultant: Polynomial arithmetic. (line 247) * resultant(): Polynomial arithmetic. (line 247) * return_type(): Non-commutative objects. (line 60) * return_type() <1>: Information about expressions. (line 9) * return_type_tinfo(): Non-commutative objects. (line 60) * return_type_tinfo() <1>: Information about expressions. (line 9) * rounding: Numbers. (line 104) * S(): Built-in functions. (line 47) * series(): Series expansion. (line 6) * simplification: Rational expressions. (line 9) * simplify_indexed(): Indexed objects. (line 401) * sin(): Built-in functions. (line 24) * sinh(): Built-in functions. (line 31) * smod(): Numbers. (line 229) * solve(): Matrices. (line 214) * spinidx (class): Indexed objects. (line 165) * spinor_metric(): Indexed objects. (line 545) * sqrfree(): Polynomial arithmetic. (line 276) * sqrt(): Built-in functions. (line 23) * square-free decomposition: Polynomial arithmetic. (line 276) * step(): Built-in functions. (line 17) * STL: Advantages. (line 14) * subs(): Symbols. (line 152) * subs() <1>: Mathematical functions. (line 17) * subs() <2>: Indexed objects. (line 205) * subs() <3>: Methods and functions. (line 18) * subs() <4>: Substituting expressions. (line 6) * subs() <5>: Pattern matching and advanced substitutions. (line 211) * sub_matrix(): Matrices. (line 62) * symbol (class): Symbols. (line 6) * symbolic_matrix(): Matrices. (line 41) * symmetrize(): Symmetrization. (line 6) * symmetrize_cyclic(): Symmetrization. (line 6) * symmetry (class): Indexed objects. (line 254) * sy_anti(): Indexed objects. (line 254) * sy_cycl(): Indexed objects. (line 254) * sy_none(): Indexed objects. (line 254) * sy_symm(): Indexed objects. (line 254) * tan(): Built-in functions. (line 26) * tanh(): Built-in functions. (line 33) * Taylor expansion: Series expansion. (line 6) * temporary replacement: Rational expressions. (line 9) * tensor (class): Indexed objects. (line 458) * tgamma(): Built-in functions. (line 53) * to_cl_N(): Numbers. (line 251) * to_double(): Numbers. (line 251) * to_int(): Numbers. (line 251) * to_long(): Numbers. (line 251) * to_polynomial(): Rational expressions. (line 59) * to_rational(): Rational expressions. (line 59) * trace(): Matrices. (line 200) * transpose(): Matrices. (line 126) * traverse(): Visitors and tree traversal. (line 6) * traverse_postorder(): Visitors and tree traversal. (line 6) * traverse_preorder(): Visitors and tree traversal. (line 6) * tree: Input/output. (line 79) * tree traversal: Applying a function on subexpressions. (line 6) * tree traversal <1>: Visitors and tree traversal. (line 6) * Tree traversal: Input/output. (line 136) * trigonometric function: Mathematical functions. (line 6) * unit(): Polynomial arithmetic. (line 193) * unitcontprim(): Polynomial arithmetic. (line 193) * unit_matrix(): Matrices. (line 41) * unlink_ex: Input/output. (line 361) * variance: Indexed objects. (line 23) * varidx (class): Indexed objects. (line 133) * viewgar: Input/output. (line 425) * visit(): Visitors and tree traversal. (line 6) * visitor (class): Visitors and tree traversal. (line 6) * wildcard (class): Pattern matching and advanced substitutions. (line 6) * Zeta function: What it can do for you. (line 124) * zeta(): Built-in functions. (line 50) * zeta() <1>: Built-in functions. (line 51)  Tag Table: Node: Top823 Node: Introduction1678 Node: A tour of GiNaC4872 Node: How to use it from within C++5307 Node: What it can do for you7630 Node: Installation13556 Node: Prerequisites14105 Node: Configuration15060 Ref: Configuration-Footnote-118553 Node: Building GiNaC18916 Node: Installing GiNaC20923 Ref: Installing GiNaC-Footnote-122333 Node: Basic concepts22801 Node: Expressions24096 Node: Automatic evaluation26396 Node: Error handling28818 Node: The class hierarchy30480 Node: Symbols32851 Node: Numbers39721 Node: Constants51163 Node: Fundamental containers51798 Node: Lists54630 Node: Mathematical functions58450 Node: Relations60341 Node: Integrals61702 Node: Matrices64295 Node: Indexed objects72680 Node: Non-commutative objects98632 Node: Methods and functions121340 Node: Information about expressions123908 Node: Numerical evaluation134646 Node: Substituting expressions135821 Node: Pattern matching and advanced substitutions139221 Node: Applying a function on subexpressions149738 Node: Visitors and tree traversal154270 Node: Polynomial arithmetic161160 Node: Rational expressions173893 Node: Symbolic differentiation178029 Node: Series expansion179941 Node: Symmetrization183500 Node: Built-in functions184795 Node: Multiple polylogarithms189501 Node: Complex expressions196001 Node: Solving linear systems of equations197823 Node: Input/output199244 Ref: csrc printing201531 Node: Extending GiNaC218925 Node: What does not belong into GiNaC219865 Node: Symbolic functions221050 Node: Printing233143 Node: Structures245153 Node: Adding classes256868 Ref: Adding classes-Footnote-1270873 Node: A comparison with other CAS270988 Node: Advantages271586 Node: Disadvantages274611 Ref: Disadvantages-Footnote-1275775 Node: Why C++?276104 Node: Internal structures276928 Node: Expressions are reference counted277205 Node: Internal representation of products and sums281010 Node: Package tools283502 Ref: Package tools-Footnote-1285519 Node: Configure script options285687 Node: Example package287051 Node: Bibliography289688 Node: Concept index290990  End Tag Table ginac-1.7.8.orig/doc/tutorial/ginac.texi0000644000000000000000000113235713541673420015042 0ustar \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename ginac.info @settitle GiNaC, an open framework for symbolic computation within the C++ programming language @setchapternewpage on @afourpaper @c For `info' only. @paragraphindent 0 @c For TeX only. @iftex @c I hate putting "@noindent" in front of every paragraph. @parindent=0pt @end iftex @c %**end of header @include version.texi @dircategory Mathematics @direntry * ginac: (ginac). C++ library for symbolic computation. @end direntry @ifinfo This is a tutorial that documents GiNaC @value{VERSION}, an open framework for symbolic computation within the C++ programming language. Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries copying permission notice identical to this one except for the removal of this paragraph @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. @end ifinfo @finalout @c finalout prevents ugly black rectangles on overfull hbox lines @titlepage @title GiNaC @value{VERSION} @subtitle An open framework for symbolic computation within the C++ programming language @subtitle @value{UPDATED} @author @uref{http://www.ginac.de} @page @vskip 0pt plus 1filll Copyright @copyright{} 1999-2019 Johannes Gutenberg University Mainz, Germany @sp 2 Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. @end titlepage @page @contents @page @node Top, Introduction, (dir), (dir) @c node-name, next, previous, up @top GiNaC This is a tutorial that documents GiNaC @value{VERSION}, an open framework for symbolic computation within the C++ programming language. @menu * Introduction:: GiNaC's purpose. * A tour of GiNaC:: A quick tour of the library. * Installation:: How to install the package. * Basic concepts:: Description of fundamental classes. * Methods and functions:: Algorithms for symbolic manipulations. * Extending GiNaC:: How to extend the library. * A comparison with other CAS:: Compares GiNaC to traditional CAS. * Internal structures:: Description of some internal structures. * Package tools:: Configuring packages to work with GiNaC. * Bibliography:: * Concept index:: @end menu @node Introduction, A tour of GiNaC, Top, Top @c node-name, next, previous, up @chapter Introduction @cindex history of GiNaC The motivation behind GiNaC derives from the observation that most present day computer algebra systems (CAS) are linguistically and semantically impoverished. Although they are quite powerful tools for learning math and solving particular problems they lack modern linguistic structures that allow for the creation of large-scale projects. GiNaC is an attempt to overcome this situation by extending a well established and standardized computer language (C++) by some fundamental symbolic capabilities, thus allowing for integrated systems that embed symbolic manipulations together with more established areas of computer science (like computation-intense numeric applications, graphical interfaces, etc.) under one roof. The particular problem that led to the writing of the GiNaC framework is still a very active field of research, namely the calculation of higher order corrections to elementary particle interactions. There, theoretical physicists are interested in matching present day theories against experiments taking place at particle accelerators. The computations involved are so complex they call for a combined symbolical and numerical approach. This turned out to be quite difficult to accomplish with the present day CAS we have worked with so far and so we tried to fill the gap by writing GiNaC. But of course its applications are in no way restricted to theoretical physics. This tutorial is intended for the novice user who is new to GiNaC but already has some background in C++ programming. However, since a hand-made documentation like this one is difficult to keep in sync with the development, the actual documentation is inside the sources in the form of comments. That documentation may be parsed by one of the many Javadoc-like documentation systems. If you fail at generating it you may access it from @uref{http://www.ginac.de/reference/, the GiNaC home page}. It is an invaluable resource not only for the advanced user who wishes to extend the system (or chase bugs) but for everybody who wants to comprehend the inner workings of GiNaC. This little tutorial on the other hand only covers the basic things that are unlikely to change in the near future. @section License The GiNaC framework for symbolic computation within the C++ programming language is Copyright @copyright{} 1999-2019 Johannes Gutenberg University Mainz, Germany. 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; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @node A tour of GiNaC, How to use it from within C++, Introduction, Top @c node-name, next, previous, up @chapter A Tour of GiNaC This quick tour of GiNaC wants to arise your interest in the subsequent chapters by showing off a bit. Please excuse us if it leaves many open questions. @menu * How to use it from within C++:: Two simple examples. * What it can do for you:: A Tour of GiNaC's features. @end menu @node How to use it from within C++, What it can do for you, A tour of GiNaC, A tour of GiNaC @c node-name, next, previous, up @section How to use it from within C++ The GiNaC open framework for symbolic computation within the C++ programming language does not try to define a language of its own as conventional CAS do. Instead, it extends the capabilities of C++ by symbolic manipulations. Here is how to generate and print a simple (and rather pointless) bivariate polynomial with some large coefficients: @example #include #include using namespace std; using namespace GiNaC; int main() @{ symbol x("x"), y("y"); ex poly; for (int i=0; i<3; ++i) poly += factorial(i+16)*pow(x,i)*pow(y,2-i); cout << poly << endl; return 0; @} @end example Assuming the file is called @file{hello.cc}, on our system we can compile and run it like this: @example $ c++ hello.cc -o hello -lginac -lcln $ ./hello 355687428096000*x*y+20922789888000*y^2+6402373705728000*x^2 @end example (@xref{Package tools}, for tools that help you when creating a software package that uses GiNaC.) @cindex Hermite polynomial Next, there is a more meaningful C++ program that calls a function which generates Hermite polynomials in a specified free variable. @example #include #include using namespace std; using namespace GiNaC; ex HermitePoly(const symbol & x, int n) @{ ex HKer=exp(-pow(x, 2)); // uses the identity H_n(x) == (-1)^n exp(x^2) (d/dx)^n exp(-x^2) return normal(pow(-1, n) * diff(HKer, x, n) / HKer); @} int main() @{ symbol z("z"); for (int i=0; i<6; ++i) cout << "H_" << i << "(z) == " << HermitePoly(z,i) << endl; return 0; @} @end example When run, this will type out @example H_0(z) == 1 H_1(z) == 2*z H_2(z) == 4*z^2-2 H_3(z) == -12*z+8*z^3 H_4(z) == -48*z^2+16*z^4+12 H_5(z) == 120*z-160*z^3+32*z^5 @end example This method of generating the coefficients is of course far from optimal for production purposes. In order to show some more examples of what GiNaC can do we will now use the @command{ginsh}, a simple GiNaC interactive shell that provides a convenient window into GiNaC's capabilities. @node What it can do for you, Installation, How to use it from within C++, A tour of GiNaC @c node-name, next, previous, up @section What it can do for you @cindex @command{ginsh} After invoking @command{ginsh} one can test and experiment with GiNaC's features much like in other Computer Algebra Systems except that it does not provide programming constructs like loops or conditionals. For a concise description of the @command{ginsh} syntax we refer to its accompanied man page. Suffice to say that assignments and comparisons in @command{ginsh} are written as they are in C, i.e. @code{=} assigns and @code{==} compares. It can manipulate arbitrary precision integers in a very fast way. Rational numbers are automatically converted to fractions of coprime integers: @example > x=3^150; 369988485035126972924700782451696644186473100389722973815184405301748249 > y=3^149; 123329495011708990974900260817232214728824366796574324605061468433916083 > x/y; 3 > y/x; 1/3 @end example Exact numbers are always retained as exact numbers and only evaluated as floating point numbers if requested. For instance, with numeric radicals is dealt pretty much as with symbols. Products of sums of them can be expanded: @example > expand((1+a^(1/5)-a^(2/5))^3); 1+3*a+3*a^(1/5)-5*a^(3/5)-a^(6/5) > expand((1+3^(1/5)-3^(2/5))^3); 10-5*3^(3/5) > evalf((1+3^(1/5)-3^(2/5))^3); 0.33408977534118624228 @end example The function @code{evalf} that was used above converts any number in GiNaC's expressions into floating point numbers. This can be done to arbitrary predefined accuracy: @example > evalf(1/7); 0.14285714285714285714 > Digits=150; 150 > evalf(1/7); 0.1428571428571428571428571428571428571428571428571428571428571428571428 5714285714285714285714285714285714285 @end example Exact numbers other than rationals that can be manipulated in GiNaC include predefined constants like Archimedes' @code{Pi}. They can both be used in symbolic manipulations (as an exact number) as well as in numeric expressions (as an inexact number): @example > a=Pi^2+x; x+Pi^2 > evalf(a); 9.869604401089358619+x > x=2; 2 > evalf(a); 11.869604401089358619 @end example Built-in functions evaluate immediately to exact numbers if this is possible. Conversions that can be safely performed are done immediately; conversions that are not generally valid are not done: @example > cos(42*Pi); 1 > cos(acos(x)); x > acos(cos(x)); acos(cos(x)) @end example (Note that converting the last input to @code{x} would allow one to conclude that @code{42*Pi} is equal to @code{0}.) Linear equation systems can be solved along with basic linear algebra manipulations over symbolic expressions. In C++ GiNaC offers a matrix class for this purpose but we can see what it can do using @command{ginsh}'s bracket notation to type them in: @example > lsolve(a+x*y==z,x); y^(-1)*(z-a); > lsolve(@{3*x+5*y == 7, -2*x+10*y == -5@}, @{x, y@}); @{x==19/8,y==-1/40@} > M = [ [1, 3], [-3, 2] ]; [[1,3],[-3,2]] > determinant(M); 11 > charpoly(M,lambda); lambda^2-3*lambda+11 > A = [ [1, 1], [2, -1] ]; [[1,1],[2,-1]] > A+2*M; [[1,1],[2,-1]]+2*[[1,3],[-3,2]] > evalm(%); [[3,7],[-4,3]] > B = [ [0, 0, a], [b, 1, -b], [-1/a, 0, 0] ]; > evalm(B^(2^12345)); [[1,0,0],[0,1,0],[0,0,1]] @end example Multivariate polynomials and rational functions may be expanded, collected and normalized (i.e. converted to a ratio of two coprime polynomials): @example > a = x^4 + 2*x^2*y^2 + 4*x^3*y + 12*x*y^3 - 3*y^4; 12*x*y^3+2*x^2*y^2+4*x^3*y-3*y^4+x^4 > b = x^2 + 4*x*y - y^2; 4*x*y-y^2+x^2 > expand(a*b); 8*x^5*y+17*x^4*y^2+43*x^2*y^4-24*x*y^5+16*x^3*y^3+3*y^6+x^6 > collect(a+b,x); 4*x^3*y-y^2-3*y^4+(12*y^3+4*y)*x+x^4+x^2*(1+2*y^2) > collect(a+b,y); 12*x*y^3-3*y^4+(-1+2*x^2)*y^2+(4*x+4*x^3)*y+x^2+x^4 > normal(a/b); 3*y^2+x^2 @end example You can differentiate functions and expand them as Taylor or Laurent series in a very natural syntax (the second argument of @code{series} is a relation defining the evaluation point, the third specifies the order): @cindex Zeta function @example > diff(tan(x),x); tan(x)^2+1 > series(sin(x),x==0,4); x-1/6*x^3+Order(x^4) > series(1/tan(x),x==0,4); x^(-1)-1/3*x+Order(x^2) > series(tgamma(x),x==0,3); x^(-1)-Euler+(1/12*Pi^2+1/2*Euler^2)*x+ (-1/3*zeta(3)-1/12*Pi^2*Euler-1/6*Euler^3)*x^2+Order(x^3) > evalf(%); x^(-1)-0.5772156649015328606+(0.9890559953279725555)*x -(0.90747907608088628905)*x^2+Order(x^3) > series(tgamma(2*sin(x)-2),x==Pi/2,6); -(x-1/2*Pi)^(-2)+(-1/12*Pi^2-1/2*Euler^2-1/240)*(x-1/2*Pi)^2 -Euler-1/12+Order((x-1/2*Pi)^3) @end example Here we have made use of the @command{ginsh}-command @code{%} to pop the previously evaluated element from @command{ginsh}'s internal stack. Often, functions don't have roots in closed form. Nevertheless, it's quite easy to compute a solution numerically, to arbitrary precision: @cindex fsolve @example > Digits=50: > fsolve(cos(x)==x,x,0,2); 0.7390851332151606416553120876738734040134117589007574649658 > f=exp(sin(x))-x: > X=fsolve(f,x,-10,10); 2.2191071489137460325957851882042901681753665565320678854155 > subs(f,x==X); -6.372367644529809108115521591070847222364418220770475144296E-58 @end example Notice how the final result above differs slightly from zero by about @math{6*10^(-58)}. This is because with 50 decimal digits precision the root cannot be represented more accurately than @code{X}. Such inaccuracies are to be expected when computing with finite floating point values. If you ever wanted to convert units in C or C++ and found this is cumbersome, here is the solution. Symbolic types can always be used as tags for different types of objects. Converting from wrong units to the metric system is now easy: @example > in=.0254*m; 0.0254*m > lb=.45359237*kg; 0.45359237*kg > 200*lb/in^2; 140613.91592783185568*kg*m^(-2) @end example @node Installation, Prerequisites, What it can do for you, Top @c node-name, next, previous, up @chapter Installation @cindex CLN GiNaC's installation follows the spirit of most GNU software. It is easily installed on your system by three steps: configuration, build, installation. @menu * Prerequisites:: Packages upon which GiNaC depends. * Configuration:: How to configure GiNaC. * Building GiNaC:: How to compile GiNaC. * Installing GiNaC:: How to install GiNaC on your system. @end menu @node Prerequisites, Configuration, Installation, Installation @c node-name, next, previous, up @section Prerequisites In order to install GiNaC on your system, some prerequisites need to be met. First of all, you need to have a C++-compiler adhering to the ISO standard @cite{ISO/IEC 14882:2011(E)}. We used GCC for development so if you have a different compiler you are on your own. For the configuration to succeed you need a Posix compliant shell installed in @file{/bin/sh}, GNU @command{bash} is fine. The pkg-config utility is required for the configuration, it can be downloaded from @uref{http://pkg-config.freedesktop.org}. Last but not least, the CLN library is used extensively and needs to be installed on your system. Please get it from @uref{http://www.ginac.de/CLN/} (it is licensed under the GPL) and install it prior to trying to install GiNaC. The configure script checks if it can find it and if it cannot, it will refuse to continue. @node Configuration, Building GiNaC, Prerequisites, Installation @c node-name, next, previous, up @section Configuration @cindex configuration @cindex Autoconf To configure GiNaC means to prepare the source distribution for building. It is done via a shell script called @command{configure} that is shipped with the sources and was originally generated by GNU Autoconf. Since a configure script generated by GNU Autoconf never prompts, all customization must be done either via command line parameters or environment variables. It accepts a list of parameters, the complete set of which can be listed by calling it with the @option{--help} option. The most important ones will be shortly described in what follows: @itemize @bullet @item @option{--disable-shared}: When given, this option switches off the build of a shared library, i.e. a @file{.so} file. This may be convenient when developing because it considerably speeds up compilation. @item @option{--prefix=@var{PREFIX}}: The directory where the compiled library and headers are installed. It defaults to @file{/usr/local} which means that the library is installed in the directory @file{/usr/local/lib}, the header files in @file{/usr/local/include/ginac} and the documentation (like this one) into @file{/usr/local/share/doc/GiNaC}. @item @option{--libdir=@var{LIBDIR}}: Use this option in case you want to have the library installed in some other directory than @file{@var{PREFIX}/lib/}. @item @option{--includedir=@var{INCLUDEDIR}}: Use this option in case you want to have the header files installed in some other directory than @file{@var{PREFIX}/include/ginac/}. For instance, if you specify @option{--includedir=/usr/include} you will end up with the header files sitting in the directory @file{/usr/include/ginac/}. Note that the subdirectory @file{ginac} is enforced by this process in order to keep the header files separated from others. This avoids some clashes and allows for an easier deinstallation of GiNaC. This ought to be considered A Good Thing (tm). @item @option{--datadir=@var{DATADIR}}: This option may be given in case you want to have the documentation installed in some other directory than @file{@var{PREFIX}/share/doc/GiNaC/}. @end itemize In addition, you may specify some environment variables. @env{CXX} holds the path and the name of the C++ compiler in case you want to override the default in your path. (The @command{configure} script searches your path for @command{c++}, @command{g++}, @command{gcc}, @command{CC}, @command{cxx} and @command{cc++} in that order.) It may be very useful to define some compiler flags with the @env{CXXFLAGS} environment variable, like optimization, debugging information and warning levels. If omitted, it defaults to @option{-g -O2}.@footnote{The @command{configure} script is itself generated from the file @file{configure.ac}. It is only distributed in packaged releases of GiNaC. If you got the naked sources, e.g. from git, you must generate @command{configure} along with the various @file{Makefile.in} by using the @command{autoreconf} utility. This will require a fair amount of support from your local toolchain, though.} The whole process is illustrated in the following two examples. (Substitute @command{setenv @var{VARIABLE} @var{value}} for @command{export @var{VARIABLE}=@var{value}} if the Berkeley C shell is your login shell.) Here is a simple configuration for a site-wide GiNaC library assuming everything is in default paths: @example $ export CXXFLAGS="-Wall -O2" $ ./configure @end example And here is a configuration for a private static GiNaC library with several components sitting in custom places (site-wide GCC and private CLN). The compiler is persuaded to be picky and full assertions and debugging information are switched on: @example $ export CXX=/usr/local/gnu/bin/c++ $ export CPPFLAGS="$(CPPFLAGS) -I$(HOME)/include" $ export CXXFLAGS="$(CXXFLAGS) -DDO_GINAC_ASSERT -ggdb -Wall -pedantic" $ export LDFLAGS="$(LDFLAGS) -L$(HOME)/lib" $ ./configure --disable-shared --prefix=$(HOME) @end example @node Building GiNaC, Installing GiNaC, Configuration, Installation @c node-name, next, previous, up @section Building GiNaC @cindex building GiNaC After proper configuration you should just build the whole library by typing @example $ make @end example at the command prompt and go for a cup of coffee. The exact time it takes to compile GiNaC depends not only on the speed of your machines but also on other parameters, for instance what value for @env{CXXFLAGS} you entered. Optimization may be very time-consuming. Just to make sure GiNaC works properly you may run a collection of regression tests by typing @example $ make check @end example This will compile some sample programs, run them and check the output for correctness. The regression tests fall in three categories. First, the so called @emph{exams} are performed, simple tests where some predefined input is evaluated (like a pupils' exam). Second, the @emph{checks} test the coherence of results among each other with possible random input. Third, some @emph{timings} are performed, which benchmark some predefined problems with different sizes and display the CPU time used in seconds. Each individual test should return a message @samp{passed}. This is mostly intended to be a QA-check if something was broken during development, not a sanity check of your system. Some of the tests in sections @emph{checks} and @emph{timings} may require insane amounts of memory and CPU time. Feel free to kill them if your machine catches fire. Another quite important intent is to allow people to fiddle around with optimization. By default, the only documentation that will be built is this tutorial in @file{.info} format. To build the GiNaC tutorial and reference manual in HTML, DVI, PostScript, or PDF formats, use one of @example $ make html $ make dvi $ make ps $ make pdf @end example Generally, the top-level Makefile runs recursively to the subdirectories. It is therefore safe to go into any subdirectory (@code{doc/}, @code{ginsh/}, @dots{}) and simply type @code{make} @var{target} there in case something went wrong. @node Installing GiNaC, Basic concepts, Building GiNaC, Installation @c node-name, next, previous, up @section Installing GiNaC @cindex installation To install GiNaC on your system, simply type @example $ make install @end example As described in the section about configuration the files will be installed in the following directories (the directories will be created if they don't already exist): @itemize @bullet @item @file{libginac.a} will go into @file{@var{PREFIX}/lib/} (or @file{@var{LIBDIR}}) which defaults to @file{/usr/local/lib/}. So will @file{libginac.so} unless the configure script was given the option @option{--disable-shared}. The proper symlinks will be established as well. @item All the header files will be installed into @file{@var{PREFIX}/include/ginac/} (or @file{@var{INCLUDEDIR}/ginac/}, if specified). @item All documentation (info) will be stuffed into @file{@var{PREFIX}/share/doc/GiNaC/} (or @file{@var{DATADIR}/doc/GiNaC/}, if @var{DATADIR} was specified). @end itemize For the sake of completeness we will list some other useful make targets: @command{make clean} deletes all files generated by @command{make}, i.e. all the object files. In addition @command{make distclean} removes all files generated by the configuration and @command{make maintainer-clean} goes one step further and deletes files that may require special tools to rebuild (like the @command{libtool} for instance). Finally @command{make uninstall} removes the installed library, header files and documentation@footnote{Uninstallation does not work after you have called @command{make distclean} since the @file{Makefile} is itself generated by the configuration from @file{Makefile.in} and hence deleted by @command{make distclean}. There are two obvious ways out of this dilemma. First, you can run the configuration again with the same @var{PREFIX} thus creating a @file{Makefile} with a working @samp{uninstall} target. Second, you can do it by hand since you now know where all the files went during installation.}. @node Basic concepts, Expressions, Installing GiNaC, Top @c node-name, next, previous, up @chapter Basic concepts This chapter will describe the different fundamental objects that can be handled by GiNaC. But before doing so, it is worthwhile introducing you to the more commonly used class of expressions, representing a flexible meta-class for storing all mathematical objects. @menu * Expressions:: The fundamental GiNaC class. * Automatic evaluation:: Evaluation and canonicalization. * Error handling:: How the library reports errors. * The class hierarchy:: Overview of GiNaC's classes. * Symbols:: Symbolic objects. * Numbers:: Numerical objects. * Constants:: Pre-defined constants. * Fundamental containers:: Sums, products and powers. * Lists:: Lists of expressions. * Mathematical functions:: Mathematical functions. * Relations:: Equality, Inequality and all that. * Integrals:: Symbolic integrals. * Matrices:: Matrices. * Indexed objects:: Handling indexed quantities. * Non-commutative objects:: Algebras with non-commutative products. @end menu @node Expressions, Automatic evaluation, Basic concepts, Basic concepts @c node-name, next, previous, up @section Expressions @cindex expression (class @code{ex}) @cindex @code{has()} The most common class of objects a user deals with is the expression @code{ex}, representing a mathematical object like a variable, number, function, sum, product, etc@dots{} Expressions may be put together to form new expressions, passed as arguments to functions, and so on. Here is a little collection of valid expressions: @example ex MyEx1 = 5; // simple number ex MyEx2 = x + 2*y; // polynomial in x and y ex MyEx3 = (x + 1)/(x - 1); // rational expression ex MyEx4 = sin(x + 2*y) + 3*z + 41; // containing a function ex MyEx5 = MyEx4 + 1; // similar to above @end example Expressions are handles to other more fundamental objects, that often contain other expressions thus creating a tree of expressions (@xref{Internal structures}, for particular examples). Most methods on @code{ex} therefore run top-down through such an expression tree. For example, the method @code{has()} scans recursively for occurrences of something inside an expression. Thus, if you have declared @code{MyEx4} as in the example above @code{MyEx4.has(y)} will find @code{y} inside the argument of @code{sin} and hence return @code{true}. The next sections will outline the general picture of GiNaC's class hierarchy and describe the classes of objects that are handled by @code{ex}. @subsection Note: Expressions and STL containers GiNaC expressions (@code{ex} objects) have value semantics (they can be assigned, reassigned and copied like integral types) but the operator @code{<} doesn't provide a well-defined ordering on them. In STL-speak, expressions are @samp{Assignable} but not @samp{LessThanComparable}. This implies that in order to use expressions in sorted containers such as @code{std::map<>} and @code{std::set<>} you have to supply a suitable comparison predicate. GiNaC provides such a predicate, called @code{ex_is_less}. For example, a set of expressions should be defined as @code{std::set}. Unsorted containers such as @code{std::vector<>} and @code{std::list<>} don't pose a problem. A @code{std::vector} works as expected. @xref{Information about expressions}, for more about comparing and ordering expressions. @node Automatic evaluation, Error handling, Expressions, Basic concepts @c node-name, next, previous, up @section Automatic evaluation and canonicalization of expressions @cindex evaluation GiNaC performs some automatic transformations on expressions, to simplify them and put them into a canonical form. Some examples: @example ex MyEx1 = 2*x - 1 + x; // 3*x-1 ex MyEx2 = x - x; // 0 ex MyEx3 = cos(2*Pi); // 1 ex MyEx4 = x*y/x; // y @end example This behavior is usually referred to as @dfn{automatic} or @dfn{anonymous evaluation}. GiNaC only performs transformations that are @itemize @bullet @item at most of complexity @tex $O(n\log n)$ @end tex @ifnottex @math{O(n log n)} @end ifnottex @item algebraically correct, possibly except for a set of measure zero (e.g. @math{x/x} is transformed to @math{1} although this is incorrect for @math{x=0}) @end itemize There are two types of automatic transformations in GiNaC that may not behave in an entirely obvious way at first glance: @itemize @item The terms of sums and products (and some other things like the arguments of symmetric functions, the indices of symmetric tensors etc.) are re-ordered into a canonical form that is deterministic, but not lexicographical or in any other way easy to guess (it almost always depends on the number and order of the symbols you define). However, constructing the same expression twice, either implicitly or explicitly, will always result in the same canonical form. @item Expressions of the form 'number times sum' are automatically expanded (this has to do with GiNaC's internal representation of sums and products). For example @example ex MyEx5 = 2*(x + y); // 2*x+2*y ex MyEx6 = z*(x + y); // z*(x+y) @end example @end itemize The general rule is that when you construct expressions, GiNaC automatically creates them in canonical form, which might differ from the form you typed in your program. This may create some awkward looking output (@samp{-y+x} instead of @samp{x-y}) but allows for more efficient operation and usually yields some immediate simplifications. @cindex @code{eval()} Internally, the anonymous evaluator in GiNaC is implemented by the methods @example ex ex::eval() const; ex basic::eval() const; @end example but unless you are extending GiNaC with your own classes or functions, there should never be any reason to call them explicitly. All GiNaC methods that transform expressions, like @code{subs()} or @code{normal()}, automatically re-evaluate their results. @node Error handling, The class hierarchy, Automatic evaluation, Basic concepts @c node-name, next, previous, up @section Error handling @cindex exceptions @cindex @code{pole_error} (class) GiNaC reports run-time errors by throwing C++ exceptions. All exceptions generated by GiNaC are subclassed from the standard @code{exception} class defined in the @file{} header. In addition to the predefined @code{logic_error}, @code{domain_error}, @code{out_of_range}, @code{invalid_argument}, @code{runtime_error}, @code{range_error} and @code{overflow_error} types, GiNaC also defines a @code{pole_error} exception that gets thrown when trying to evaluate a mathematical function at a singularity. The @code{pole_error} class has a member function @example int pole_error::degree() const; @end example that returns the order of the singularity (or 0 when the pole is logarithmic or the order is undefined). When using GiNaC it is useful to arrange for exceptions to be caught in the main program even if you don't want to do any special error handling. Otherwise whenever an error occurs in GiNaC, it will be delegated to the default exception handler of your C++ compiler's run-time system which usually only aborts the program without giving any information what went wrong. Here is an example for a @code{main()} function that catches and prints exceptions generated by GiNaC: @example #include #include #include using namespace std; using namespace GiNaC; int main() @{ try @{ ... // code using GiNaC ... @} catch (exception &p) @{ cerr << p.what() << endl; return 1; @} return 0; @} @end example @node The class hierarchy, Symbols, Error handling, Basic concepts @c node-name, next, previous, up @section The class hierarchy GiNaC's class hierarchy consists of several classes representing mathematical objects, all of which (except for @code{ex} and some helpers) are internally derived from one abstract base class called @code{basic}. You do not have to deal with objects of class @code{basic}, instead you'll be dealing with symbols, numbers, containers of expressions and so on. @cindex container @cindex atom To get an idea about what kinds of symbolic composites may be built we have a look at the most important classes in the class hierarchy and some of the relations among the classes: @ifnotinfo @image{classhierarchy} @end ifnotinfo @ifinfo @end ifinfo The abstract classes shown here (the ones without drop-shadow) are of no interest for the user. They are used internally in order to avoid code duplication if two or more classes derived from them share certain features. An example is @code{expairseq}, a container for a sequence of pairs each consisting of one expression and a number (@code{numeric}). What @emph{is} visible to the user are the derived classes @code{add} and @code{mul}, representing sums and products. @xref{Internal structures}, where these two classes are described in more detail. The following table shortly summarizes what kinds of mathematical objects are stored in the different classes: @cartouche @multitable @columnfractions .22 .78 @item @code{symbol} @tab Algebraic symbols @math{a}, @math{x}, @math{y}@dots{} @item @code{constant} @tab Constants like @tex $\pi$ @end tex @ifnottex @math{Pi} @end ifnottex @item @code{numeric} @tab All kinds of numbers, @math{42}, @math{7/3*I}, @math{3.14159}@dots{} @item @code{add} @tab Sums like @math{x+y} or @math{a-(2*b)+3} @item @code{mul} @tab Products like @math{x*y} or @math{2*a^2*(x+y+z)/b} @item @code{ncmul} @tab Products of non-commutative objects @item @code{power} @tab Exponentials such as @math{x^2}, @math{a^b}, @tex $\sqrt{2}$ @end tex @ifnottex @code{sqrt(}@math{2}@code{)} @end ifnottex @dots{} @item @code{pseries} @tab Power Series, e.g. @math{x-1/6*x^3+1/120*x^5+O(x^7)} @item @code{function} @tab A symbolic function like @tex $\sin 2x$ @end tex @ifnottex @math{sin(2*x)} @end ifnottex @item @code{lst} @tab Lists of expressions @{@math{x}, @math{2*y}, @math{3+z}@} @item @code{matrix} @tab @math{m}x@math{n} matrices of expressions @item @code{relational} @tab A relation like the identity @math{x}@code{==}@math{y} @item @code{indexed} @tab Indexed object like @math{A_ij} @item @code{tensor} @tab Special tensor like the delta and metric tensors @item @code{idx} @tab Index of an indexed object @item @code{varidx} @tab Index with variance @item @code{spinidx} @tab Index with variance and dot (used in Weyl-van-der-Waerden spinor formalism) @item @code{wildcard} @tab Wildcard for pattern matching @item @code{structure} @tab Template for user-defined classes @end multitable @end cartouche @node Symbols, Numbers, The class hierarchy, Basic concepts @c node-name, next, previous, up @section Symbols @cindex @code{symbol} (class) @cindex hierarchy of classes @cindex atom Symbolic indeterminates, or @dfn{symbols} for short, are for symbolic manipulation what atoms are for chemistry. A typical symbol definition looks like this: @example symbol x("x"); @end example This definition actually contains three very different things: @itemize @item a C++ variable named @code{x} @item a @code{symbol} object stored in this C++ variable; this object represents the symbol in a GiNaC expression @item the string @code{"x"} which is the name of the symbol, used (almost) exclusively for printing expressions holding the symbol @end itemize Symbols have an explicit name, supplied as a string during construction, because in C++, variable names can't be used as values, and the C++ compiler throws them away during compilation. It is possible to omit the symbol name in the definition: @example symbol x; @end example In this case, GiNaC will assign the symbol an internal, unique name of the form @code{symbolNNN}. This won't affect the usability of the symbol but the output of your calculations will become more readable if you give your symbols sensible names (for intermediate expressions that are only used internally such anonymous symbols can be quite useful, however). Now, here is one important property of GiNaC that differentiates it from other computer algebra programs you may have used: GiNaC does @emph{not} use the names of symbols to tell them apart, but a (hidden) serial number that is unique for each newly created @code{symbol} object. If you want to use one and the same symbol in different places in your program, you must only create one @code{symbol} object and pass that around. If you create another symbol, even if it has the same name, GiNaC will treat it as a different indeterminate. Observe: @example ex f(int n) @{ symbol x("x"); return pow(x, n); @} int main() @{ symbol x("x"); ex e = f(6); cout << e << endl; // prints "x^6" which looks right, but... cout << e.degree(x) << endl; // ...this doesn't work. The symbol "x" here is different from the one // in f() and in the expression returned by f(). Consequently, it // prints "0". @} @end example One possibility to ensure that @code{f()} and @code{main()} use the same symbol is to pass the symbol as an argument to @code{f()}: @example ex f(int n, const ex & x) @{ return pow(x, n); @} int main() @{ symbol x("x"); // Now, f() uses the same symbol. ex e = f(6, x); cout << e.degree(x) << endl; // prints "6", as expected @} @end example Another possibility would be to define a global symbol @code{x} that is used by both @code{f()} and @code{main()}. If you are using global symbols and multiple compilation units you must take special care, however. Suppose that you have a header file @file{globals.h} in your program that defines a @code{symbol x("x");}. In this case, every unit that includes @file{globals.h} would also get its own definition of @code{x} (because header files are just inlined into the source code by the C++ preprocessor), and hence you would again end up with multiple equally-named, but different, symbols. Instead, the @file{globals.h} header should only contain a @emph{declaration} like @code{extern symbol x;}, with the definition of @code{x} moved into a C++ source file such as @file{globals.cpp}. A different approach to ensuring that symbols used in different parts of your program are identical is to create them with a @emph{factory} function like this one: @example const symbol & get_symbol(const string & s) @{ static map directory; map::iterator i = directory.find(s); if (i != directory.end()) return i->second; else return directory.insert(make_pair(s, symbol(s))).first->second; @} @end example This function returns one newly constructed symbol for each name that is passed in, and it returns the same symbol when called multiple times with the same name. Using this symbol factory, we can rewrite our example like this: @example ex f(int n) @{ return pow(get_symbol("x"), n); @} int main() @{ ex e = f(6); // Both calls of get_symbol("x") yield the same symbol. cout << e.degree(get_symbol("x")) << endl; // prints "6" @} @end example Instead of creating symbols from strings we could also have @code{get_symbol()} take, for example, an integer number as its argument. In this case, we would probably want to give the generated symbols names that include this number, which can be accomplished with the help of an @code{ostringstream}. In general, if you're getting weird results from GiNaC such as an expression @samp{x-x} that is not simplified to zero, you should check your symbol definitions. As we said, the names of symbols primarily serve for purposes of expression output. But there are actually two instances where GiNaC uses the names for identifying symbols: When constructing an expression from a string, and when recreating an expression from an archive (@pxref{Input/output}). In addition to its name, a symbol may contain a special string that is used in LaTeX output: @example symbol x("x", "\\Box"); @end example This creates a symbol that is printed as "@code{x}" in normal output, but as "@code{\Box}" in LaTeX code (@xref{Input/output}, for more information about the different output formats of expressions in GiNaC). GiNaC automatically creates proper LaTeX code for symbols having names of greek letters (@samp{alpha}, @samp{mu}, etc.). You can retrieve the name and the LaTeX name of a symbol using the respective methods: @cindex @code{get_name()} @cindex @code{get_TeX_name()} @example symbol::get_name() const; symbol::get_TeX_name() const; @end example @cindex @code{subs()} Symbols in GiNaC can't be assigned values. If you need to store results of calculations and give them a name, use C++ variables of type @code{ex}. If you want to replace a symbol in an expression with something else, you can invoke the expression's @code{.subs()} method (@pxref{Substituting expressions}). @cindex @code{realsymbol()} By default, symbols are expected to stand in for complex values, i.e. they live in the complex domain. As a consequence, operations like complex conjugation, for example (@pxref{Complex expressions}), do @emph{not} evaluate if applied to such symbols. Likewise @code{log(exp(x))} does not evaluate to @code{x}, because of the unknown imaginary part of @code{x}. On the other hand, if you are sure that your symbols will hold only real values, you would like to have such functions evaluated. Therefore GiNaC allows you to specify the domain of the symbol. Instead of @code{symbol x("x");} you can write @code{realsymbol x("x");} to tell GiNaC that @code{x} stands in for real values. @cindex @code{possymbol()} Furthermore, it is also possible to declare a symbol as positive. This will, for instance, enable the automatic simplification of @code{abs(x)} into @code{x}. This is done by declaring the symbol as @code{possymbol x("x");}. @node Numbers, Constants, Symbols, Basic concepts @c node-name, next, previous, up @section Numbers @cindex @code{numeric} (class) @cindex GMP @cindex CLN @cindex rational @cindex fraction For storing numerical things, GiNaC uses Bruno Haible's library CLN. The classes therein serve as foundation classes for GiNaC. CLN stands for Class Library for Numbers or alternatively for Common Lisp Numbers. In order to find out more about CLN's internals, the reader is referred to the documentation of that library. @inforef{Introduction, , cln}, for more information. Suffice to say that it is by itself build on top of another library, the GNU Multiple Precision library GMP, which is an extremely fast library for arbitrary long integers and rationals as well as arbitrary precision floating point numbers. It is very commonly used by several popular cryptographic applications. CLN extends GMP by several useful things: First, it introduces the complex number field over either reals (i.e. floating point numbers with arbitrary precision) or rationals. Second, it automatically converts rationals to integers if the denominator is unity and complex numbers to real numbers if the imaginary part vanishes and also correctly treats algebraic functions. Third it provides good implementations of state-of-the-art algorithms for all trigonometric and hyperbolic functions as well as for calculation of some useful constants. The user can construct an object of class @code{numeric} in several ways. The following example shows the four most important constructors. It uses construction from C-integer, construction of fractions from two integers, construction from C-float and construction from a string: @example #include #include using namespace GiNaC; int main() @{ numeric two = 2; // exact integer 2 numeric r(2,3); // exact fraction 2/3 numeric e(2.71828); // floating point number numeric p = "3.14159265358979323846"; // constructor from string // Trott's constant in scientific notation: numeric trott("1.0841015122311136151E-2"); std::cout << two*p << std::endl; // floating point 6.283... ... @end example @cindex @code{I} @cindex complex numbers The imaginary unit in GiNaC is a predefined @code{numeric} object with the name @code{I}: @example ... numeric z1 = 2-3*I; // exact complex number 2-3i numeric z2 = 5.9+1.6*I; // complex floating point number @} @end example It may be tempting to construct fractions by writing @code{numeric r(3/2)}. This would, however, call C's built-in operator @code{/} for integers first and result in a numeric holding a plain integer 1. @strong{Never use the operator @code{/} on integers} unless you know exactly what you are doing! Use the constructor from two integers instead, as shown in the example above. Writing @code{numeric(1)/2} may look funny but works also. @cindex @code{Digits} @cindex accuracy We have seen now the distinction between exact numbers and floating point numbers. Clearly, the user should never have to worry about dynamically created exact numbers, since their `exactness' always determines how they ought to be handled, i.e. how `long' they are. The situation is different for floating point numbers. Their accuracy is controlled by one @emph{global} variable, called @code{Digits}. (For those readers who know about Maple: it behaves very much like Maple's @code{Digits}). All objects of class numeric that are constructed from then on will be stored with a precision matching that number of decimal digits: @example #include #include using namespace std; using namespace GiNaC; void foo() @{ numeric three(3.0), one(1.0); numeric x = one/three; cout << "in " << Digits << " digits:" << endl; cout << x << endl; cout << Pi.evalf() << endl; @} int main() @{ foo(); Digits = 60; foo(); return 0; @} @end example The above example prints the following output to screen: @example in 17 digits: 0.33333333333333333334 3.1415926535897932385 in 60 digits: 0.33333333333333333333333333333333333333333333333333333333333333333334 3.1415926535897932384626433832795028841971693993751058209749445923078 @end example @cindex rounding Note that the last number is not necessarily rounded as you would naively expect it to be rounded in the decimal system. But note also, that in both cases you got a couple of extra digits. This is because numbers are internally stored by CLN as chunks of binary digits in order to match your machine's word size and to not waste precision. Thus, on architectures with different word size, the above output might even differ with regard to actually computed digits. It should be clear that objects of class @code{numeric} should be used for constructing numbers or for doing arithmetic with them. The objects one deals with most of the time are the polymorphic expressions @code{ex}. @subsection Tests on numbers Once you have declared some numbers, assigned them to expressions and done some arithmetic with them it is frequently desired to retrieve some kind of information from them like asking whether that number is integer, rational, real or complex. For those cases GiNaC provides several useful methods. (Internally, they fall back to invocations of certain CLN functions.) As an example, let's construct some rational number, multiply it with some multiple of its denominator and test what comes out: @example #include #include using namespace std; using namespace GiNaC; // some very important constants: const numeric twentyone(21); const numeric ten(10); const numeric five(5); int main() @{ numeric answer = twentyone; answer /= five; cout << answer.is_integer() << endl; // false, it's 21/5 answer *= ten; cout << answer.is_integer() << endl; // true, it's 42 now! @} @end example Note that the variable @code{answer} is constructed here as an integer by @code{numeric}'s copy constructor, but in an intermediate step it holds a rational number represented as integer numerator and integer denominator. When multiplied by 10, the denominator becomes unity and the result is automatically converted to a pure integer again. Internally, the underlying CLN is responsible for this behavior and we refer the reader to CLN's documentation. Suffice to say that the same behavior applies to complex numbers as well as return values of certain functions. Complex numbers are automatically converted to real numbers if the imaginary part becomes zero. The full set of tests that can be applied is listed in the following table. @cartouche @multitable @columnfractions .30 .70 @item @strong{Method} @tab @strong{Returns true if the object is@dots{}} @item @code{.is_zero()} @tab @dots{}equal to zero @item @code{.is_positive()} @tab @dots{}not complex and greater than 0 @item @code{.is_negative()} @tab @dots{}not complex and smaller than 0 @item @code{.is_integer()} @tab @dots{}a (non-complex) integer @item @code{.is_pos_integer()} @tab @dots{}an integer and greater than 0 @item @code{.is_nonneg_integer()} @tab @dots{}an integer and greater equal 0 @item @code{.is_even()} @tab @dots{}an even integer @item @code{.is_odd()} @tab @dots{}an odd integer @item @code{.is_prime()} @tab @dots{}a prime integer (probabilistic primality test) @item @code{.is_rational()} @tab @dots{}an exact rational number (integers are rational, too) @item @code{.is_real()} @tab @dots{}a real integer, rational or float (i.e. is not complex) @item @code{.is_cinteger()} @tab @dots{}a (complex) integer (such as @math{2-3*I}) @item @code{.is_crational()} @tab @dots{}an exact (complex) rational number (such as @math{2/3+7/2*I}) @end multitable @end cartouche @page @subsection Numeric functions The following functions can be applied to @code{numeric} objects and will be evaluated immediately: @cartouche @multitable @columnfractions .30 .70 @item @strong{Name} @tab @strong{Function} @item @code{inverse(z)} @tab returns @math{1/z} @cindex @code{inverse()} (numeric) @item @code{pow(a, b)} @tab exponentiation @math{a^b} @item @code{abs(z)} @tab absolute value @item @code{real(z)} @tab real part @cindex @code{real()} @item @code{imag(z)} @tab imaginary part @cindex @code{imag()} @item @code{csgn(z)} @tab complex sign (returns an @code{int}) @item @code{step(x)} @tab step function (returns an @code{numeric}) @item @code{numer(z)} @tab numerator of rational or complex rational number @item @code{denom(z)} @tab denominator of rational or complex rational number @item @code{sqrt(z)} @tab square root @item @code{isqrt(n)} @tab integer square root @cindex @code{isqrt()} @item @code{sin(z)} @tab sine @item @code{cos(z)} @tab cosine @item @code{tan(z)} @tab tangent @item @code{asin(z)} @tab inverse sine @item @code{acos(z)} @tab inverse cosine @item @code{atan(z)} @tab inverse tangent @item @code{atan(y, x)} @tab inverse tangent with two arguments @item @code{sinh(z)} @tab hyperbolic sine @item @code{cosh(z)} @tab hyperbolic cosine @item @code{tanh(z)} @tab hyperbolic tangent @item @code{asinh(z)} @tab inverse hyperbolic sine @item @code{acosh(z)} @tab inverse hyperbolic cosine @item @code{atanh(z)} @tab inverse hyperbolic tangent @item @code{exp(z)} @tab exponential function @item @code{log(z)} @tab natural logarithm @item @code{Li2(z)} @tab dilogarithm @item @code{zeta(z)} @tab Riemann's zeta function @item @code{tgamma(z)} @tab gamma function @item @code{lgamma(z)} @tab logarithm of gamma function @item @code{psi(z)} @tab psi (digamma) function @item @code{psi(n, z)} @tab derivatives of psi function (polygamma functions) @item @code{factorial(n)} @tab factorial function @math{n!} @item @code{doublefactorial(n)} @tab double factorial function @math{n!!} @cindex @code{doublefactorial()} @item @code{binomial(n, k)} @tab binomial coefficients @item @code{bernoulli(n)} @tab Bernoulli numbers @cindex @code{bernoulli()} @item @code{fibonacci(n)} @tab Fibonacci numbers @cindex @code{fibonacci()} @item @code{mod(a, b)} @tab modulus in positive representation (in the range @code{[0, abs(b)-1]} with the sign of b, or zero) @cindex @code{mod()} @item @code{smod(a, b)} @tab modulus in symmetric representation (in the range @code{[-iquo(abs(b), 2), iquo(abs(b), 2)]}) @cindex @code{smod()} @item @code{irem(a, b)} @tab integer remainder (has the sign of @math{a}, or is zero) @cindex @code{irem()} @item @code{irem(a, b, q)} @tab integer remainder and quotient, @code{irem(a, b, q) == a-q*b} @item @code{iquo(a, b)} @tab integer quotient @cindex @code{iquo()} @item @code{iquo(a, b, r)} @tab integer quotient and remainder, @code{r == a-iquo(a, b)*b} @item @code{gcd(a, b)} @tab greatest common divisor @item @code{lcm(a, b)} @tab least common multiple @end multitable @end cartouche Most of these functions are also available as symbolic functions that can be used in expressions (@pxref{Mathematical functions}) or, like @code{gcd()}, as polynomial algorithms. @subsection Converting numbers Sometimes it is desirable to convert a @code{numeric} object back to a built-in arithmetic type (@code{int}, @code{double}, etc.). The @code{numeric} class provides a couple of methods for this purpose: @cindex @code{to_int()} @cindex @code{to_long()} @cindex @code{to_double()} @cindex @code{to_cl_N()} @example int numeric::to_int() const; long numeric::to_long() const; double numeric::to_double() const; cln::cl_N numeric::to_cl_N() const; @end example @code{to_int()} and @code{to_long()} only work when the number they are applied on is an exact integer. Otherwise the program will halt with a message like @samp{Not a 32-bit integer}. @code{to_double()} applied on a rational number will return a floating-point approximation. Both @code{to_int()/to_long()} and @code{to_double()} discard the imaginary part of complex numbers. Note the signature of the above methods, you may need to apply a type conversion and call @code{evalf()} as shown in the following example: @example ... ex e1 = 1, e2 = sin(Pi/5); cout << ex_to(e1).to_int() << endl << ex_to(e2.evalf()).to_double() << endl; ... @end example @node Constants, Fundamental containers, Numbers, Basic concepts @c node-name, next, previous, up @section Constants @cindex @code{constant} (class) @cindex @code{Pi} @cindex @code{Catalan} @cindex @code{Euler} @cindex @code{evalf()} Constants behave pretty much like symbols except that they return some specific number when the method @code{.evalf()} is called. The predefined known constants are: @cartouche @multitable @columnfractions .14 .32 .54 @item @strong{Name} @tab @strong{Common Name} @tab @strong{Numerical Value (to 35 digits)} @item @code{Pi} @tab Archimedes' constant @tab 3.14159265358979323846264338327950288 @item @code{Catalan} @tab Catalan's constant @tab 0.91596559417721901505460351493238411 @item @code{Euler} @tab Euler's (or Euler-Mascheroni) constant @tab 0.57721566490153286060651209008240243 @end multitable @end cartouche @node Fundamental containers, Lists, Constants, Basic concepts @c node-name, next, previous, up @section Sums, products and powers @cindex polynomial @cindex @code{add} @cindex @code{mul} @cindex @code{power} Simple rational expressions are written down in GiNaC pretty much like in other CAS or like expressions involving numerical variables in C. The necessary operators @code{+}, @code{-}, @code{*} and @code{/} have been overloaded to achieve this goal. When you run the following code snippet, the constructor for an object of type @code{mul} is automatically called to hold the product of @code{a} and @code{b} and then the constructor for an object of type @code{add} is called to hold the sum of that @code{mul} object and the number one: @example ... symbol a("a"), b("b"); ex MyTerm = 1+a*b; ... @end example @cindex @code{pow()} For exponentiation, you have already seen the somewhat clumsy (though C-ish) statement @code{pow(x,2);} to represent @code{x} squared. This direct construction is necessary since we cannot safely overload the constructor @code{^} in C++ to construct a @code{power} object. If we did, it would have several counterintuitive and undesired effects: @itemize @bullet @item Due to C's operator precedence, @code{2*x^2} would be parsed as @code{(2*x)^2}. @item Due to the binding of the operator @code{^}, @code{x^a^b} would result in @code{(x^a)^b}. This would be confusing since most (though not all) other CAS interpret this as @code{x^(a^b)}. @item Also, expressions involving integer exponents are very frequently used, which makes it even more dangerous to overload @code{^} since it is then hard to distinguish between the semantics as exponentiation and the one for exclusive or. (It would be embarrassing to return @code{1} where one has requested @code{2^3}.) @end itemize @cindex @command{ginsh} All effects are contrary to mathematical notation and differ from the way most other CAS handle exponentiation, therefore overloading @code{^} is ruled out for GiNaC's C++ part. The situation is different in @command{ginsh}, there the exponentiation-@code{^} exists. (Also note that the other frequently used exponentiation operator @code{**} does not exist at all in C++). To be somewhat more precise, objects of the three classes described here, are all containers for other expressions. An object of class @code{power} is best viewed as a container with two slots, one for the basis, one for the exponent. All valid GiNaC expressions can be inserted. However, basic transformations like simplifying @code{pow(pow(x,2),3)} to @code{x^6} automatically are only performed when this is mathematically possible. If we replace the outer exponent three in the example by some symbols @code{a}, the simplification is not safe and will not be performed, since @code{a} might be @code{1/2} and @code{x} negative. Objects of type @code{add} and @code{mul} are containers with an arbitrary number of slots for expressions to be inserted. Again, simple and safe simplifications are carried out like transforming @code{3*x+4-x} to @code{2*x+4}. @node Lists, Mathematical functions, Fundamental containers, Basic concepts @c node-name, next, previous, up @section Lists of expressions @cindex @code{lst} (class) @cindex lists @cindex @code{nops()} @cindex @code{op()} @cindex @code{append()} @cindex @code{prepend()} @cindex @code{remove_first()} @cindex @code{remove_last()} @cindex @code{remove_all()} The GiNaC class @code{lst} serves for holding a @dfn{list} of arbitrary expressions. They are not as ubiquitous as in many other computer algebra packages, but are sometimes used to supply a variable number of arguments of the same type to GiNaC methods such as @code{subs()} and some @code{matrix} constructors, so you should have a basic understanding of them. Lists can be constructed from an initializer list of expressions: @example @{ symbol x("x"), y("y"); lst l = @{x, 2, y, x+y@}; // now, l is a list holding the expressions 'x', '2', 'y', and 'x+y', // in that order ... @end example Use the @code{nops()} method to determine the size (number of expressions) of a list and the @code{op()} method or the @code{[]} operator to access individual elements: @example ... cout << l.nops() << endl; // prints '4' cout << l.op(2) << " " << l[0] << endl; // prints 'y x' ... @end example As with the standard @code{list} container, accessing random elements of a @code{lst} is generally an operation of order @math{O(N)}. Faster read-only sequential access to the elements of a list is possible with the iterator types provided by the @code{lst} class: @example typedef ... lst::const_iterator; typedef ... lst::const_reverse_iterator; lst::const_iterator lst::begin() const; lst::const_iterator lst::end() const; lst::const_reverse_iterator lst::rbegin() const; lst::const_reverse_iterator lst::rend() const; @end example For example, to print the elements of a list individually you can use: @example ... // O(N) for (lst::const_iterator i = l.begin(); i != l.end(); ++i) cout << *i << endl; ... @end example which is one order faster than @example ... // O(N^2) for (size_t i = 0; i < l.nops(); ++i) cout << l.op(i) << endl; ... @end example These iterators also allow you to use some of the algorithms provided by the C++ standard library: @example ... // print the elements of the list (requires #include ) std::copy(l.begin(), l.end(), ostream_iterator(cout, "\n")); // sum up the elements of the list (requires #include ) ex sum = std::accumulate(l.begin(), l.end(), ex(0)); cout << sum << endl; // prints '2+2*x+2*y' ... @end example @code{lst} is one of the few GiNaC classes that allow in-place modifications (the only other one is @code{matrix}). You can modify single elements: @example ... l[1] = 42; // l is now @{x, 42, y, x+y@} l.let_op(1) = 7; // l is now @{x, 7, y, x+y@} ... @end example You can append or prepend an expression to a list with the @code{append()} and @code{prepend()} methods: @example ... l.append(4*x); // l is now @{x, 7, y, x+y, 4*x@} l.prepend(0); // l is now @{0, x, 7, y, x+y, 4*x@} ... @end example You can remove the first or last element of a list with @code{remove_first()} and @code{remove_last()}: @example ... l.remove_first(); // l is now @{x, 7, y, x+y, 4*x@} l.remove_last(); // l is now @{x, 7, y, x+y@} ... @end example You can remove all the elements of a list with @code{remove_all()}: @example ... l.remove_all(); // l is now empty ... @end example You can bring the elements of a list into a canonical order with @code{sort()}: @example ... lst l1 = @{x, 2, y, x+y@}; lst l2 = @{2, x+y, x, y@}; l1.sort(); l2.sort(); // l1 and l2 are now equal ... @end example Finally, you can remove all but the first element of consecutive groups of elements with @code{unique()}: @example ... lst l3 = @{x, 2, 2, 2, y, x+y, y+x@}; l3.unique(); // l3 is now @{x, 2, y, x+y@} @} @end example @node Mathematical functions, Relations, Lists, Basic concepts @c node-name, next, previous, up @section Mathematical functions @cindex @code{function} (class) @cindex trigonometric function @cindex hyperbolic function There are quite a number of useful functions hard-wired into GiNaC. For instance, all trigonometric and hyperbolic functions are implemented (@xref{Built-in functions}, for a complete list). These functions (better called @emph{pseudofunctions}) are all objects of class @code{function}. They accept one or more expressions as arguments and return one expression. If the arguments are not numerical, the evaluation of the function may be halted, as it does in the next example, showing how a function returns itself twice and finally an expression that may be really useful: @cindex Gamma function @cindex @code{subs()} @example ... symbol x("x"), y("y"); ex foo = x+y/2; cout << tgamma(foo) << endl; // -> tgamma(x+(1/2)*y) ex bar = foo.subs(y==1); cout << tgamma(bar) << endl; // -> tgamma(x+1/2) ex foobar = bar.subs(x==7); cout << tgamma(foobar) << endl; // -> (135135/128)*Pi^(1/2) ... @end example Besides evaluation most of these functions allow differentiation, series expansion and so on. Read the next chapter in order to learn more about this. It must be noted that these pseudofunctions are created by inline functions, where the argument list is templated. This means that whenever you call @code{GiNaC::sin(1)} it is equivalent to @code{sin(ex(1))} and will therefore not result in a floating point number. Unless of course the function prototype is explicitly overridden -- which is the case for arguments of type @code{numeric} (not wrapped inside an @code{ex}). Hence, in order to obtain a floating point number of class @code{numeric} you should call @code{sin(numeric(1))}. This is almost the same as calling @code{sin(1).evalf()} except that the latter will return a numeric wrapped inside an @code{ex}. @node Relations, Integrals, Mathematical functions, Basic concepts @c node-name, next, previous, up @section Relations @cindex @code{relational} (class) Sometimes, a relation holding between two expressions must be stored somehow. The class @code{relational} is a convenient container for such purposes. A relation is by definition a container for two @code{ex} and a relation between them that signals equality, inequality and so on. They are created by simply using the C++ operators @code{==}, @code{!=}, @code{<}, @code{<=}, @code{>} and @code{>=} between two expressions. @xref{Mathematical functions}, for examples where various applications of the @code{.subs()} method show how objects of class relational are used as arguments. There they provide an intuitive syntax for substitutions. They are also used as arguments to the @code{ex::series} method, where the left hand side of the relation specifies the variable to expand in and the right hand side the expansion point. They can also be used for creating systems of equations that are to be solved for unknown variables. But the most common usage of objects of this class is rather inconspicuous in statements of the form @code{if (expand(pow(a+b,2))==a*a+2*a*b+b*b) @{...@}}. Here, an implicit conversion from @code{relational} to @code{bool} takes place. Note, however, that @code{==} here does not perform any simplifications, hence @code{expand()} must be called explicitly. @node Integrals, Matrices, Relations, Basic concepts @c node-name, next, previous, up @section Integrals @cindex @code{integral} (class) An object of class @dfn{integral} can be used to hold a symbolic integral. If you want to symbolically represent the integral of @code{x*x} from 0 to 1, you would write this as @example integral(x, 0, 1, x*x) @end example The first argument is the integration variable. It should be noted that GiNaC is not very good (yet?) at symbolically evaluating integrals. In fact, it can only integrate polynomials. An expression containing integrals can be evaluated symbolically by calling the @example .eval_integ() @end example method on it. Numerical evaluation is available by calling the @example .evalf() @end example method on an expression containing the integral. This will only evaluate integrals into a number if @code{subs}ing the integration variable by a number in the fourth argument of an integral and then @code{evalf}ing the result always results in a number. Of course, also the boundaries of the integration domain must @code{evalf} into numbers. It should be noted that trying to @code{evalf} a function with discontinuities in the integration domain is not recommended. The accuracy of the numeric evaluation of integrals is determined by the static member variable @example ex integral::relative_integration_error @end example of the class @code{integral}. The default value of this is 10^-8. The integration works by halving the interval of integration, until numeric stability of the answer indicates that the requested accuracy has been reached. The maximum depth of the halving can be set via the static member variable @example int integral::max_integration_level @end example The default value is 15. If this depth is exceeded, @code{evalf} will simply return the integral unevaluated. The function that performs the numerical evaluation, is also available as @example ex adaptivesimpson(const ex & x, const ex & a, const ex & b, const ex & f, const ex & error) @end example This function will throw an exception if the maximum depth is exceeded. The last parameter of the function is optional and defaults to the @code{relative_integration_error}. To make sure that we do not do too much work if an expression contains the same integral multiple times, a lookup table is used. If you know that an expression holds an integral, you can get the integration variable, the left boundary, right boundary and integrand by respectively calling @code{.op(0)}, @code{.op(1)}, @code{.op(2)}, and @code{.op(3)}. Differentiating integrals with respect to variables works as expected. Note that it makes no sense to differentiate an integral with respect to the integration variable. @node Matrices, Indexed objects, Integrals, Basic concepts @c node-name, next, previous, up @section Matrices @cindex @code{matrix} (class) A @dfn{matrix} is a two-dimensional array of expressions. The elements of a matrix with @math{m} rows and @math{n} columns are accessed with two @code{unsigned} indices, the first one in the range 0@dots{}@math{m-1}, the second one in the range 0@dots{}@math{n-1}. There are a couple of ways to construct matrices, with or without preset elements. The constructor @example matrix::matrix(unsigned r, unsigned c); @end example creates a matrix with @samp{r} rows and @samp{c} columns with all elements set to zero. The easiest way to create a matrix is using an initializer list of initializer lists, all of the same size: @example @{ matrix m = @{@{1, -a@}, @{a, 1@}@}; @} @end example You can also specify the elements as a (flat) list with @example matrix::matrix(unsigned r, unsigned c, const lst & l); @end example The function @cindex @code{lst_to_matrix()} @example ex lst_to_matrix(const lst & l); @end example constructs a matrix from a list of lists, each list representing a matrix row. There is also a set of functions for creating some special types of matrices: @cindex @code{diag_matrix()} @cindex @code{unit_matrix()} @cindex @code{symbolic_matrix()} @example ex diag_matrix(const lst & l); ex diag_matrix(initializer_list l); ex unit_matrix(unsigned x); ex unit_matrix(unsigned r, unsigned c); ex symbolic_matrix(unsigned r, unsigned c, const string & base_name); ex symbolic_matrix(unsigned r, unsigned c, const string & base_name, const string & tex_base_name); @end example @code{diag_matrix()} constructs a square diagonal matrix given the diagonal elements. @code{unit_matrix()} creates an @samp{x} by @samp{x} (or @samp{r} by @samp{c}) unit matrix. And finally, @code{symbolic_matrix} constructs a matrix filled with newly generated symbols made of the specified base name and the position of each element in the matrix. Matrices often arise by omitting elements of another matrix. For instance, the submatrix @code{S} of a matrix @code{M} takes a rectangular block from @code{M}. The reduced matrix @code{R} is defined by removing one row and one column from a matrix @code{M}. (The determinant of a reduced matrix is called a @emph{Minor} of @code{M} and can be used for computing the inverse using Cramer's rule.) @cindex @code{sub_matrix()} @cindex @code{reduced_matrix()} @example ex sub_matrix(const matrix&m, unsigned r, unsigned nr, unsigned c, unsigned nc); ex reduced_matrix(const matrix& m, unsigned r, unsigned c); @end example The function @code{sub_matrix()} takes a row offset @code{r} and a column offset @code{c} and takes a block of @code{nr} rows and @code{nc} columns. The function @code{reduced_matrix()} has two integer arguments that specify which row and column to remove: @example @{ matrix m = @{@{11, 12, 13@}, @{21, 22, 23@}, @{31, 32, 33@}@}; cout << reduced_matrix(m, 1, 1) << endl; // -> [[11,13],[31,33]] cout << sub_matrix(m, 1, 2, 1, 2) << endl; // -> [[22,23],[32,33]] @} @end example Matrix elements can be accessed and set using the parenthesis (function call) operator: @example const ex & matrix::operator()(unsigned r, unsigned c) const; ex & matrix::operator()(unsigned r, unsigned c); @end example It is also possible to access the matrix elements in a linear fashion with the @code{op()} method. But C++-style subscripting with square brackets @samp{[]} is not available. Here are a couple of examples for constructing matrices: @example @{ symbol a("a"), b("b"); matrix M = @{@{a, 0@}, @{0, b@}@}; cout << M << endl; // -> [[a,0],[0,b]] matrix M2(2, 2); M2(0, 0) = a; M2(1, 1) = b; cout << M2 << endl; // -> [[a,0],[0,b]] cout << matrix(2, 2, lst@{a, 0, 0, b@}) << endl; // -> [[a,0],[0,b]] cout << lst_to_matrix(lst@{lst@{a, 0@}, lst@{0, b@}@}) << endl; // -> [[a,0],[0,b]] cout << diag_matrix(lst@{a, b@}) << endl; // -> [[a,0],[0,b]] cout << unit_matrix(3) << endl; // -> [[1,0,0],[0,1,0],[0,0,1]] cout << symbolic_matrix(2, 3, "x") << endl; // -> [[x00,x01,x02],[x10,x11,x12]] @} @end example @cindex @code{is_zero_matrix()} The method @code{matrix::is_zero_matrix()} returns @code{true} only if all entries of the matrix are zeros. There is also method @code{ex::is_zero_matrix()} which returns @code{true} only if the expression is zero or a zero matrix. @cindex @code{transpose()} There are three ways to do arithmetic with matrices. The first (and most direct one) is to use the methods provided by the @code{matrix} class: @example matrix matrix::add(const matrix & other) const; matrix matrix::sub(const matrix & other) const; matrix matrix::mul(const matrix & other) const; matrix matrix::mul_scalar(const ex & other) const; matrix matrix::pow(const ex & expn) const; matrix matrix::transpose() const; @end example All of these methods return the result as a new matrix object. Here is an example that calculates @math{A*B-2*C} for three matrices @math{A}, @math{B} and @math{C}: @example @{ matrix A = @{@{ 1, 2@}, @{ 3, 4@}@}; matrix B = @{@{-1, 0@}, @{ 2, 1@}@}; matrix C = @{@{ 8, 4@}, @{ 2, 1@}@}; matrix result = A.mul(B).sub(C.mul_scalar(2)); cout << result << endl; // -> [[-13,-6],[1,2]] ... @} @end example @cindex @code{evalm()} The second (and probably the most natural) way is to construct an expression containing matrices with the usual arithmetic operators and @code{pow()}. For efficiency reasons, expressions with sums, products and powers of matrices are not automatically evaluated in GiNaC. You have to call the method @example ex ex::evalm() const; @end example to obtain the result: @example @{ ... ex e = A*B - 2*C; cout << e << endl; // -> [[1,2],[3,4]]*[[-1,0],[2,1]]-2*[[8,4],[2,1]] cout << e.evalm() << endl; // -> [[-13,-6],[1,2]] ... @} @end example The non-commutativity of the product @code{A*B} in this example is automatically recognized by GiNaC. There is no need to use a special operator here. @xref{Non-commutative objects}, for more information about dealing with non-commutative expressions. Finally, you can work with indexed matrices and call @code{simplify_indexed()} to perform the arithmetic: @example @{ ... idx i(symbol("i"), 2), j(symbol("j"), 2), k(symbol("k"), 2); e = indexed(A, i, k) * indexed(B, k, j) - 2 * indexed(C, i, j); cout << e << endl; // -> -2*[[8,4],[2,1]].i.j+[[-1,0],[2,1]].k.j*[[1,2],[3,4]].i.k cout << e.simplify_indexed() << endl; // -> [[-13,-6],[1,2]].i.j @} @end example Using indices is most useful when working with rectangular matrices and one-dimensional vectors because you don't have to worry about having to transpose matrices before multiplying them. @xref{Indexed objects}, for more information about using matrices with indices, and about indices in general. The @code{matrix} class provides a couple of additional methods for computing determinants, traces, characteristic polynomials and ranks: @cindex @code{determinant()} @cindex @code{trace()} @cindex @code{charpoly()} @cindex @code{rank()} @example ex matrix::determinant(unsigned algo=determinant_algo::automatic) const; ex matrix::trace() const; ex matrix::charpoly(const ex & lambda) const; unsigned matrix::rank(unsigned algo=solve_algo::automatic) const; @end example The optional @samp{algo} argument of @code{determinant()} and @code{rank()} functions allows to select between different algorithms for calculating the determinant and rank respectively. The asymptotic speed (as parametrized by the matrix size) can greatly differ between those algorithms, depending on the nature of the matrix' entries. The possible values are defined in the @file{flags.h} header file. By default, GiNaC uses a heuristic to automatically select an algorithm that is likely (but not guaranteed) to give the result most quickly. @cindex @code{solve()} Linear systems can be solved with: @example matrix matrix::solve(const matrix & vars, const matrix & rhs, unsigned algo=solve_algo::automatic) const; @end example Assuming the matrix object this method is applied on is an @code{m} times @code{n} matrix, then @code{vars} must be a @code{n} times @code{p} matrix of symbolic indeterminates and @code{rhs} a @code{m} times @code{p} matrix. The returned matrix then has dimension @code{n} times @code{p} and in the case of an underdetermined system will still contain some of the indeterminates from @code{vars}. If the system is overdetermined, an exception is thrown. @cindex @code{inverse()} (matrix) To invert a matrix, use the method: @example matrix matrix::inverse(unsigned algo=solve_algo::automatic) const; @end example The @samp{algo} argument is optional. If given, it must be one of @code{solve_algo} defined in @file{flags.h}. @node Indexed objects, Non-commutative objects, Matrices, Basic concepts @c node-name, next, previous, up @section Indexed objects GiNaC allows you to handle expressions containing general indexed objects in arbitrary spaces. It is also able to canonicalize and simplify such expressions and perform symbolic dummy index summations. There are a number of predefined indexed objects provided, like delta and metric tensors. There are few restrictions placed on indexed objects and their indices and it is easy to construct nonsense expressions, but our intention is to provide a general framework that allows you to implement algorithms with indexed quantities, getting in the way as little as possible. @cindex @code{idx} (class) @cindex @code{indexed} (class) @subsection Indexed quantities and their indices Indexed expressions in GiNaC are constructed of two special types of objects, @dfn{index objects} and @dfn{indexed objects}. @itemize @bullet @cindex contravariant @cindex covariant @cindex variance @item Index objects are of class @code{idx} or a subclass. Every index has a @dfn{value} and a @dfn{dimension} (which is the dimension of the space the index lives in) which can both be arbitrary expressions but are usually a number or a simple symbol. In addition, indices of class @code{varidx} have a @dfn{variance} (they can be co- or contravariant), and indices of class @code{spinidx} have a variance and can be @dfn{dotted} or @dfn{undotted}. @item Indexed objects are of class @code{indexed} or a subclass. They contain a @dfn{base expression} (which is the expression being indexed), and one or more indices. @end itemize @strong{Please notice:} when printing expressions, covariant indices and indices without variance are denoted @samp{.i} while contravariant indices are denoted @samp{~i}. Dotted indices have a @samp{*} in front of the index value. In the following, we are going to use that notation in the text so instead of @math{A^i_jk} we will write @samp{A~i.j.k}. Index dimensions are not visible in the output. A simple example shall illustrate the concepts: @example #include #include using namespace std; using namespace GiNaC; int main() @{ symbol i_sym("i"), j_sym("j"); idx i(i_sym, 3), j(j_sym, 3); symbol A("A"); cout << indexed(A, i, j) << endl; // -> A.i.j cout << index_dimensions << indexed(A, i, j) << endl; // -> A.i[3].j[3] cout << dflt; // reset cout to default output format (dimensions hidden) ... @end example The @code{idx} constructor takes two arguments, the index value and the index dimension. First we define two index objects, @code{i} and @code{j}, both with the numeric dimension 3. The value of the index @code{i} is the symbol @code{i_sym} (which prints as @samp{i}) and the value of the index @code{j} is the symbol @code{j_sym} (which prints as @samp{j}). Next we construct an expression containing one indexed object, @samp{A.i.j}. It has the symbol @code{A} as its base expression and the two indices @code{i} and @code{j}. The dimensions of indices are normally not visible in the output, but one can request them to be printed with the @code{index_dimensions} manipulator, as shown above. Note the difference between the indices @code{i} and @code{j} which are of class @code{idx}, and the index values which are the symbols @code{i_sym} and @code{j_sym}. The indices of indexed objects cannot directly be symbols or numbers but must be index objects. For example, the following is not correct and will raise an exception: @example symbol i("i"), j("j"); e = indexed(A, i, j); // ERROR: indices must be of type idx @end example You can have multiple indexed objects in an expression, index values can be numeric, and index dimensions symbolic: @example ... symbol B("B"), dim("dim"); cout << 4 * indexed(A, i) + indexed(B, idx(j_sym, 4), idx(2, 3), idx(i_sym, dim)) << endl; // -> B.j.2.i+4*A.i ... @end example @code{B} has a 4-dimensional symbolic index @samp{k}, a 3-dimensional numeric index of value 2, and a symbolic index @samp{i} with the symbolic dimension @samp{dim}. Note that GiNaC doesn't automatically notify you that the free indices of @samp{A} and @samp{B} in the sum don't match (you have to call @code{simplify_indexed()} for that, see below). In fact, base expressions, index values and index dimensions can be arbitrary expressions: @example ... cout << indexed(A+B, idx(2*i_sym+1, dim/2)) << endl; // -> (B+A).(1+2*i) ... @end example It's also possible to construct nonsense like @samp{Pi.sin(x)}. You will not get an error message from this but you will probably not be able to do anything useful with it. @cindex @code{get_value()} @cindex @code{get_dim()} The methods @example ex idx::get_value(); ex idx::get_dim(); @end example return the value and dimension of an @code{idx} object. If you have an index in an expression, such as returned by calling @code{.op()} on an indexed object, you can get a reference to the @code{idx} object with the function @code{ex_to()} on the expression. There are also the methods @example bool idx::is_numeric(); bool idx::is_symbolic(); bool idx::is_dim_numeric(); bool idx::is_dim_symbolic(); @end example for checking whether the value and dimension are numeric or symbolic (non-numeric). Using the @code{info()} method of an index (see @ref{Information about expressions}) returns information about the index value. @cindex @code{varidx} (class) If you need co- and contravariant indices, use the @code{varidx} class: @example ... symbol mu_sym("mu"), nu_sym("nu"); varidx mu(mu_sym, 4), nu(nu_sym, 4); // default is contravariant ~mu, ~nu varidx mu_co(mu_sym, 4, true); // covariant index .mu cout << indexed(A, mu, nu) << endl; // -> A~mu~nu cout << indexed(A, mu_co, nu) << endl; // -> A.mu~nu cout << indexed(A, mu.toggle_variance(), nu) << endl; // -> A.mu~nu ... @end example A @code{varidx} is an @code{idx} with an additional flag that marks it as co- or contravariant. The default is a contravariant (upper) index, but this can be overridden by supplying a third argument to the @code{varidx} constructor. The two methods @example bool varidx::is_covariant(); bool varidx::is_contravariant(); @end example allow you to check the variance of a @code{varidx} object (use @code{ex_to()} to get the object reference from an expression). There's also the very useful method @example ex varidx::toggle_variance(); @end example which makes a new index with the same value and dimension but the opposite variance. By using it you only have to define the index once. @cindex @code{spinidx} (class) The @code{spinidx} class provides dotted and undotted variant indices, as used in the Weyl-van-der-Waerden spinor formalism: @example ... symbol K("K"), C_sym("C"), D_sym("D"); spinidx C(C_sym, 2), D(D_sym); // default is 2-dimensional, // contravariant, undotted spinidx C_co(C_sym, 2, true); // covariant index spinidx D_dot(D_sym, 2, false, true); // contravariant, dotted spinidx D_co_dot(D_sym, 2, true, true); // covariant, dotted cout << indexed(K, C, D) << endl; // -> K~C~D cout << indexed(K, C_co, D_dot) << endl; // -> K.C~*D cout << indexed(K, D_co_dot, D) << endl; // -> K.*D~D ... @end example A @code{spinidx} is a @code{varidx} with an additional flag that marks it as dotted or undotted. The default is undotted but this can be overridden by supplying a fourth argument to the @code{spinidx} constructor. The two methods @example bool spinidx::is_dotted(); bool spinidx::is_undotted(); @end example allow you to check whether or not a @code{spinidx} object is dotted (use @code{ex_to()} to get the object reference from an expression). Finally, the two methods @example ex spinidx::toggle_dot(); ex spinidx::toggle_variance_dot(); @end example create a new index with the same value and dimension but opposite dottedness and the same or opposite variance. @subsection Substituting indices @cindex @code{subs()} Sometimes you will want to substitute one symbolic index with another symbolic or numeric index, for example when calculating one specific element of a tensor expression. This is done with the @code{.subs()} method, as it is done for symbols (see @ref{Substituting expressions}). You have two possibilities here. You can either substitute the whole index by another index or expression: @example ... ex e = indexed(A, mu_co); cout << e << " becomes " << e.subs(mu_co == nu) << endl; // -> A.mu becomes A~nu cout << e << " becomes " << e.subs(mu_co == varidx(0, 4)) << endl; // -> A.mu becomes A~0 cout << e << " becomes " << e.subs(mu_co == 0) << endl; // -> A.mu becomes A.0 ... @end example The third example shows that trying to replace an index with something that is not an index will substitute the index value instead. Alternatively, you can substitute the @emph{symbol} of a symbolic index by another expression: @example ... ex e = indexed(A, mu_co); cout << e << " becomes " << e.subs(mu_sym == nu_sym) << endl; // -> A.mu becomes A.nu cout << e << " becomes " << e.subs(mu_sym == 0) << endl; // -> A.mu becomes A.0 ... @end example As you see, with the second method only the value of the index will get substituted. Its other properties, including its dimension, remain unchanged. If you want to change the dimension of an index you have to substitute the whole index by another one with the new dimension. Finally, substituting the base expression of an indexed object works as expected: @example ... ex e = indexed(A, mu_co); cout << e << " becomes " << e.subs(A == A+B) << endl; // -> A.mu becomes (B+A).mu ... @end example @subsection Symmetries @cindex @code{symmetry} (class) @cindex @code{sy_none()} @cindex @code{sy_symm()} @cindex @code{sy_anti()} @cindex @code{sy_cycl()} Indexed objects can have certain symmetry properties with respect to their indices. Symmetries are specified as a tree of objects of class @code{symmetry} that is constructed with the helper functions @example symmetry sy_none(...); symmetry sy_symm(...); symmetry sy_anti(...); symmetry sy_cycl(...); @end example @code{sy_none()} stands for no symmetry, @code{sy_symm()} and @code{sy_anti()} specify fully symmetric or antisymmetric, respectively, and @code{sy_cycl()} represents a cyclic symmetry. Each of these functions accepts up to four arguments which can be either symmetry objects themselves or unsigned integer numbers that represent an index position (counting from 0). A symmetry specification that consists of only a single @code{sy_symm()}, @code{sy_anti()} or @code{sy_cycl()} with no arguments specifies the respective symmetry for all indices. Here are some examples of symmetry definitions: @example ... // No symmetry: e = indexed(A, i, j); e = indexed(A, sy_none(), i, j); // equivalent e = indexed(A, sy_none(0, 1), i, j); // equivalent // Symmetric in all three indices: e = indexed(A, sy_symm(), i, j, k); e = indexed(A, sy_symm(0, 1, 2), i, j, k); // equivalent e = indexed(A, sy_symm(2, 0, 1), i, j, k); // same symmetry, but yields a // different canonical order // Symmetric in the first two indices only: e = indexed(A, sy_symm(0, 1), i, j, k); e = indexed(A, sy_none(sy_symm(0, 1), 2), i, j, k); // equivalent // Antisymmetric in the first and last index only (index ranges need not // be contiguous): e = indexed(A, sy_anti(0, 2), i, j, k); e = indexed(A, sy_none(sy_anti(0, 2), 1), i, j, k); // equivalent // An example of a mixed symmetry: antisymmetric in the first two and // last two indices, symmetric when swapping the first and last index // pairs (like the Riemann curvature tensor): e = indexed(A, sy_symm(sy_anti(0, 1), sy_anti(2, 3)), i, j, k, l); // Cyclic symmetry in all three indices: e = indexed(A, sy_cycl(), i, j, k); e = indexed(A, sy_cycl(0, 1, 2), i, j, k); // equivalent // The following examples are invalid constructions that will throw // an exception at run time. // An index may not appear multiple times: e = indexed(A, sy_symm(0, 0, 1), i, j, k); // ERROR e = indexed(A, sy_none(sy_symm(0, 1), sy_anti(0, 2)), i, j, k); // ERROR // Every child of sy_symm(), sy_anti() and sy_cycl() must refer to the // same number of indices: e = indexed(A, sy_symm(sy_anti(0, 1), 2), i, j, k); // ERROR // And of course, you cannot specify indices which are not there: e = indexed(A, sy_symm(0, 1, 2, 3), i, j, k); // ERROR ... @end example If you need to specify more than four indices, you have to use the @code{.add()} method of the @code{symmetry} class. For example, to specify full symmetry in the first six indices you would write @code{sy_symm(0, 1, 2, 3).add(4).add(5)}. If an indexed object has a symmetry, GiNaC will automatically bring the indices into a canonical order which allows for some immediate simplifications: @example ... cout << indexed(A, sy_symm(), i, j) + indexed(A, sy_symm(), j, i) << endl; // -> 2*A.j.i cout << indexed(B, sy_anti(), i, j) + indexed(B, sy_anti(), j, i) << endl; // -> 0 cout << indexed(B, sy_anti(), i, j, k) - indexed(B, sy_anti(), j, k, i) << endl; // -> 0 ... @end example @cindex @code{get_free_indices()} @cindex dummy index @subsection Dummy indices GiNaC treats certain symbolic index pairs as @dfn{dummy indices} meaning that a summation over the index range is implied. Symbolic indices which are not dummy indices are called @dfn{free indices}. Numeric indices are neither dummy nor free indices. To be recognized as a dummy index pair, the two indices must be of the same class and their value must be the same single symbol (an index like @samp{2*n+1} is never a dummy index). If the indices are of class @code{varidx} they must also be of opposite variance; if they are of class @code{spinidx} they must be both dotted or both undotted. The method @code{.get_free_indices()} returns a vector containing the free indices of an expression. It also checks that the free indices of the terms of a sum are consistent: @example @{ symbol A("A"), B("B"), C("C"); symbol i_sym("i"), j_sym("j"), k_sym("k"), l_sym("l"); idx i(i_sym, 3), j(j_sym, 3), k(k_sym, 3), l(l_sym, 3); ex e = indexed(A, i, j) * indexed(B, j, k) + indexed(C, k, l, i, l); cout << exprseq(e.get_free_indices()) << endl; // -> (.i,.k) // 'j' and 'l' are dummy indices symbol mu_sym("mu"), nu_sym("nu"), rho_sym("rho"), sigma_sym("sigma"); varidx mu(mu_sym, 4), nu(nu_sym, 4), rho(rho_sym, 4), sigma(sigma_sym, 4); e = indexed(A, mu, nu) * indexed(B, nu.toggle_variance(), rho) + indexed(C, mu, sigma, rho, sigma.toggle_variance()); cout << exprseq(e.get_free_indices()) << endl; // -> (~mu,~rho) // 'nu' is a dummy index, but 'sigma' is not e = indexed(A, mu, mu); cout << exprseq(e.get_free_indices()) << endl; // -> (~mu) // 'mu' is not a dummy index because it appears twice with the same // variance e = indexed(A, mu, nu) + 42; cout << exprseq(e.get_free_indices()) << endl; // ERROR // this will throw an exception: // "add::get_free_indices: inconsistent indices in sum" @} @end example @cindex @code{expand_dummy_sum()} A dummy index summation like @tex $ a_i b^i$ @end tex @ifnottex a.i b~i @end ifnottex can be expanded for indices with numeric dimensions (e.g. 3) into the explicit sum like @tex $a_1b^1+a_2b^2+a_3b^3 $. @end tex @ifnottex a.1 b~1 + a.2 b~2 + a.3 b~3. @end ifnottex This is performed by the function @example ex expand_dummy_sum(const ex & e, bool subs_idx = false); @end example which takes an expression @code{e} and returns the expanded sum for all dummy indices with numeric dimensions. If the parameter @code{subs_idx} is set to @code{true} then all substitutions are made by @code{idx} class indices, i.e. without variance. In this case the above sum @tex $ a_i b^i$ @end tex @ifnottex a.i b~i @end ifnottex will be expanded to @tex $a_1b_1+a_2b_2+a_3b_3 $. @end tex @ifnottex a.1 b.1 + a.2 b.2 + a.3 b.3. @end ifnottex @cindex @code{simplify_indexed()} @subsection Simplifying indexed expressions In addition to the few automatic simplifications that GiNaC performs on indexed expressions (such as re-ordering the indices of symmetric tensors and calculating traces and convolutions of matrices and predefined tensors) there is the method @example ex ex::simplify_indexed(); ex ex::simplify_indexed(const scalar_products & sp); @end example that performs some more expensive operations: @itemize @bullet @item it checks the consistency of free indices in sums in the same way @code{get_free_indices()} does @item it tries to give dummy indices that appear in different terms of a sum the same name to allow simplifications like @math{a_i*b_i-a_j*b_j=0} @item it (symbolically) calculates all possible dummy index summations/contractions with the predefined tensors (this will be explained in more detail in the next section) @item it detects contractions that vanish for symmetry reasons, for example the contraction of a symmetric and a totally antisymmetric tensor @item as a special case of dummy index summation, it can replace scalar products of two tensors with a user-defined value @end itemize The last point is done with the help of the @code{scalar_products} class which is used to store scalar products with known values (this is not an arithmetic class, you just pass it to @code{simplify_indexed()}): @example @{ symbol A("A"), B("B"), C("C"), i_sym("i"); idx i(i_sym, 3); scalar_products sp; sp.add(A, B, 0); // A and B are orthogonal sp.add(A, C, 0); // A and C are orthogonal sp.add(A, A, 4); // A^2 = 4 (A has length 2) e = indexed(A + B, i) * indexed(A + C, i); cout << e << endl; // -> (B+A).i*(A+C).i cout << e.expand(expand_options::expand_indexed).simplify_indexed(sp) << endl; // -> 4+C.i*B.i @} @end example The @code{scalar_products} object @code{sp} acts as a storage for the scalar products added to it with the @code{.add()} method. This method takes three arguments: the two expressions of which the scalar product is taken, and the expression to replace it with. @cindex @code{expand()} The example above also illustrates a feature of the @code{expand()} method: if passed the @code{expand_indexed} option it will distribute indices over sums, so @samp{(A+B).i} becomes @samp{A.i+B.i}. @cindex @code{tensor} (class) @subsection Predefined tensors Some frequently used special tensors such as the delta, epsilon and metric tensors are predefined in GiNaC. They have special properties when contracted with other tensor expressions and some of them have constant matrix representations (they will evaluate to a number when numeric indices are specified). @cindex @code{delta_tensor()} @subsubsection Delta tensor The delta tensor takes two indices, is symmetric and has the matrix representation @code{diag(1, 1, 1, ...)}. It is constructed by the function @code{delta_tensor()}: @example @{ symbol A("A"), B("B"); idx i(symbol("i"), 3), j(symbol("j"), 3), k(symbol("k"), 3), l(symbol("l"), 3); ex e = indexed(A, i, j) * indexed(B, k, l) * delta_tensor(i, k) * delta_tensor(j, l); cout << e.simplify_indexed() << endl; // -> B.i.j*A.i.j cout << delta_tensor(i, i) << endl; // -> 3 @} @end example @cindex @code{metric_tensor()} @subsubsection General metric tensor The function @code{metric_tensor()} creates a general symmetric metric tensor with two indices that can be used to raise/lower tensor indices. The metric tensor is denoted as @samp{g} in the output and if its indices are of mixed variance it is automatically replaced by a delta tensor: @example @{ symbol A("A"); varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4), rho(symbol("rho"), 4); ex e = metric_tensor(mu, nu) * indexed(A, nu.toggle_variance(), rho); cout << e.simplify_indexed() << endl; // -> A~mu~rho e = delta_tensor(mu, nu.toggle_variance()) * metric_tensor(nu, rho); cout << e.simplify_indexed() << endl; // -> g~mu~rho e = metric_tensor(mu.toggle_variance(), nu.toggle_variance()) * metric_tensor(nu, rho); cout << e.simplify_indexed() << endl; // -> delta.mu~rho e = metric_tensor(nu.toggle_variance(), rho.toggle_variance()) * metric_tensor(mu, nu) * (delta_tensor(mu.toggle_variance(), rho) + indexed(A, mu.toggle_variance(), rho)); cout << e.simplify_indexed() << endl; // -> 4+A.rho~rho @} @end example @cindex @code{lorentz_g()} @subsubsection Minkowski metric tensor The Minkowski metric tensor is a special metric tensor with a constant matrix representation which is either @code{diag(1, -1, -1, ...)} (negative signature, the default) or @code{diag(-1, 1, 1, ...)} (positive signature). It is created with the function @code{lorentz_g()} (although it is output as @samp{eta}): @example @{ varidx mu(symbol("mu"), 4); e = delta_tensor(varidx(0, 4), mu.toggle_variance()) * lorentz_g(mu, varidx(0, 4)); // negative signature cout << e.simplify_indexed() << endl; // -> 1 e = delta_tensor(varidx(0, 4), mu.toggle_variance()) * lorentz_g(mu, varidx(0, 4), true); // positive signature cout << e.simplify_indexed() << endl; // -> -1 @} @end example @cindex @code{spinor_metric()} @subsubsection Spinor metric tensor The function @code{spinor_metric()} creates an antisymmetric tensor with two indices that is used to raise/lower indices of 2-component spinors. It is output as @samp{eps}: @example @{ symbol psi("psi"); spinidx A(symbol("A")), B(symbol("B")), C(symbol("C")); ex A_co = A.toggle_variance(), B_co = B.toggle_variance(); e = spinor_metric(A, B) * indexed(psi, B_co); cout << e.simplify_indexed() << endl; // -> psi~A e = spinor_metric(A, B) * indexed(psi, A_co); cout << e.simplify_indexed() << endl; // -> -psi~B e = spinor_metric(A_co, B_co) * indexed(psi, B); cout << e.simplify_indexed() << endl; // -> -psi.A e = spinor_metric(A_co, B_co) * indexed(psi, A); cout << e.simplify_indexed() << endl; // -> psi.B e = spinor_metric(A_co, B_co) * spinor_metric(A, B); cout << e.simplify_indexed() << endl; // -> 2 e = spinor_metric(A_co, B_co) * spinor_metric(B, C); cout << e.simplify_indexed() << endl; // -> -delta.A~C @} @end example The matrix representation of the spinor metric is @code{[[0, 1], [-1, 0]]}. @cindex @code{epsilon_tensor()} @cindex @code{lorentz_eps()} @subsubsection Epsilon tensor The epsilon tensor is totally antisymmetric, its number of indices is equal to the dimension of the index space (the indices must all be of the same numeric dimension), and @samp{eps.1.2.3...} (resp. @samp{eps~0~1~2...}) is defined to be 1. Its behavior with indices that have a variance also depends on the signature of the metric. Epsilon tensors are output as @samp{eps}. There are three functions defined to create epsilon tensors in 2, 3 and 4 dimensions: @example ex epsilon_tensor(const ex & i1, const ex & i2); ex epsilon_tensor(const ex & i1, const ex & i2, const ex & i3); ex lorentz_eps(const ex & i1, const ex & i2, const ex & i3, const ex & i4, bool pos_sig = false); @end example The first two functions create an epsilon tensor in 2 or 3 Euclidean dimensions, the last function creates an epsilon tensor in a 4-dimensional Minkowski space (the last @code{bool} argument specifies whether the metric has negative or positive signature, as in the case of the Minkowski metric tensor): @example @{ varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4), rho(symbol("rho"), 4), sig(symbol("sig"), 4), lam(symbol("lam"), 4), bet(symbol("bet"), 4); e = lorentz_eps(mu, nu, rho, sig) * lorentz_eps(mu.toggle_variance(), nu.toggle_variance(), lam, bet); cout << simplify_indexed(e) << endl; // -> 2*eta~bet~rho*eta~sig~lam-2*eta~sig~bet*eta~rho~lam idx i(symbol("i"), 3), j(symbol("j"), 3), k(symbol("k"), 3); symbol A("A"), B("B"); e = epsilon_tensor(i, j, k) * indexed(A, j) * indexed(B, k); cout << simplify_indexed(e) << endl; // -> -B.k*A.j*eps.i.k.j e = epsilon_tensor(i, j, k) * indexed(A, j) * indexed(A, k); cout << simplify_indexed(e) << endl; // -> 0 @} @end example @subsection Linear algebra The @code{matrix} class can be used with indices to do some simple linear algebra (linear combinations and products of vectors and matrices, traces and scalar products): @example @{ idx i(symbol("i"), 2), j(symbol("j"), 2); symbol x("x"), y("y"); // A is a 2x2 matrix, X is a 2x1 vector matrix A = @{@{1, 2@}, @{3, 4@}@}; matrix X = @{@{x, y@}@}; cout << indexed(A, i, i) << endl; // -> 5 ex e = indexed(A, i, j) * indexed(X, j); cout << e.simplify_indexed() << endl; // -> [[2*y+x],[4*y+3*x]].i e = indexed(A, i, j) * indexed(X, i) + indexed(X, j) * 2; cout << e.simplify_indexed() << endl; // -> [[3*y+3*x,6*y+2*x]].j @} @end example You can of course obtain the same results with the @code{matrix::add()}, @code{matrix::mul()} and @code{matrix::trace()} methods (@pxref{Matrices}) but with indices you don't have to worry about transposing matrices. Matrix indices always start at 0 and their dimension must match the number of rows/columns of the matrix. Matrices with one row or one column are vectors and can have one or two indices (it doesn't matter whether it's a row or a column vector). Other matrices must have two indices. You should be careful when using indices with variance on matrices. GiNaC doesn't look at the variance and doesn't know that @samp{F~mu~nu} and @samp{F.mu.nu} are different matrices. In this case you should use only one form for @samp{F} and explicitly multiply it with a matrix representation of the metric tensor. @node Non-commutative objects, Methods and functions, Indexed objects, Basic concepts @c node-name, next, previous, up @section Non-commutative objects GiNaC is equipped to handle certain non-commutative algebras. Three classes of non-commutative objects are built-in which are mostly of use in high energy physics: @itemize @item Clifford (Dirac) algebra (class @code{clifford}) @item su(3) Lie algebra (class @code{color}) @item Matrices (unindexed) (class @code{matrix}) @end itemize The @code{clifford} and @code{color} classes are subclasses of @code{indexed} because the elements of these algebras usually carry indices. The @code{matrix} class is described in more detail in @ref{Matrices}. Unlike most computer algebra systems, GiNaC does not primarily provide an operator (often denoted @samp{&*}) for representing inert products of arbitrary objects. Rather, non-commutativity in GiNaC is a property of the classes of objects involved, and non-commutative products are formed with the usual @samp{*} operator, as are ordinary products. GiNaC is capable of figuring out by itself which objects commutate and will group the factors by their class. Consider this example: @example ... varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4); idx a(symbol("a"), 8), b(symbol("b"), 8); ex e = -dirac_gamma(mu) * (2*color_T(a)) * 8 * color_T(b) * dirac_gamma(nu); cout << e << endl; // -> -16*(gamma~mu*gamma~nu)*(T.a*T.b) ... @end example As can be seen, GiNaC pulls out the overall commutative factor @samp{-16} and groups the non-commutative factors (the gammas and the su(3) generators) together while preserving the order of factors within each class (because Clifford objects commutate with color objects). The resulting expression is a @emph{commutative} product with two factors that are themselves non-commutative products (@samp{gamma~mu*gamma~nu} and @samp{T.a*T.b}). For clarification, parentheses are placed around the non-commutative products in the output. @cindex @code{ncmul} (class) Non-commutative products are internally represented by objects of the class @code{ncmul}, as opposed to commutative products which are handled by the @code{mul} class. You will normally not have to worry about this distinction, though. The advantage of this approach is that you never have to worry about using (or forgetting to use) a special operator when constructing non-commutative expressions. Also, non-commutative products in GiNaC are more intelligent than in other computer algebra systems; they can, for example, automatically canonicalize themselves according to rules specified in the implementation of the non-commutative classes. The drawback is that to work with other than the built-in algebras you have to implement new classes yourself. Both symbols and user-defined functions can be specified as being non-commutative. For symbols, this is done by subclassing class symbol; for functions, by explicitly setting the return type (@pxref{Symbolic functions}). @cindex @code{return_type()} @cindex @code{return_type_tinfo()} Information about the commutativity of an object or expression can be obtained with the two member functions @example unsigned ex::return_type() const; return_type_t ex::return_type_tinfo() const; @end example The @code{return_type()} function returns one of three values (defined in the header file @file{flags.h}), corresponding to three categories of expressions in GiNaC: @itemize @bullet @item @code{return_types::commutative}: Commutates with everything. Most GiNaC classes are of this kind. @item @code{return_types::noncommutative}: Non-commutative, belonging to a certain class of non-commutative objects which can be determined with the @code{return_type_tinfo()} method. Expressions of this category commutate with everything except @code{noncommutative} expressions of the same class. @item @code{return_types::noncommutative_composite}: Non-commutative, composed of non-commutative objects of different classes. Expressions of this category don't commutate with any other @code{noncommutative} or @code{noncommutative_composite} expressions. @end itemize The @code{return_type_tinfo()} method returns an object of type @code{return_type_t} that contains information about the type of the expression and, if given, its representation label (see section on dirac gamma matrices for more details). The objects of type @code{return_type_t} can be tested for equality to test whether two expressions belong to the same category and therefore may not commute. Here are a couple of examples: @cartouche @multitable @columnfractions .6 .4 @item @strong{Expression} @tab @strong{@code{return_type()}} @item @code{42} @tab @code{commutative} @item @code{2*x-y} @tab @code{commutative} @item @code{dirac_ONE()} @tab @code{noncommutative} @item @code{dirac_gamma(mu)*dirac_gamma(nu)} @tab @code{noncommutative} @item @code{2*color_T(a)} @tab @code{noncommutative} @item @code{dirac_ONE()*color_T(a)} @tab @code{noncommutative_composite} @end multitable @end cartouche A last note: With the exception of matrices, positive integer powers of non-commutative objects are automatically expanded in GiNaC. For example, @code{pow(a*b, 2)} becomes @samp{a*b*a*b} if @samp{a} and @samp{b} are non-commutative expressions). @cindex @code{clifford} (class) @subsection Clifford algebra Clifford algebras are supported in two flavours: Dirac gamma matrices (more physical) and generic Clifford algebras (more mathematical). @cindex @code{dirac_gamma()} @subsubsection Dirac gamma matrices Dirac gamma matrices (note that GiNaC doesn't treat them as matrices) are designated as @samp{gamma~mu} and satisfy @samp{gamma~mu*gamma~nu + gamma~nu*gamma~mu = 2*eta~mu~nu} where @samp{eta~mu~nu} is the Minkowski metric tensor. Dirac gammas are constructed by the function @example ex dirac_gamma(const ex & mu, unsigned char rl = 0); @end example which takes two arguments: the index and a @dfn{representation label} in the range 0 to 255 which is used to distinguish elements of different Clifford algebras (this is also called a @dfn{spin line index}). Gammas with different labels commutate with each other. The dimension of the index can be 4 or (in the framework of dimensional regularization) any symbolic value. Spinor indices on Dirac gammas are not supported in GiNaC. @cindex @code{dirac_ONE()} The unity element of a Clifford algebra is constructed by @example ex dirac_ONE(unsigned char rl = 0); @end example @strong{Please notice:} You must always use @code{dirac_ONE()} when referring to multiples of the unity element, even though it's customary to omit it. E.g. instead of @code{dirac_gamma(mu)*(dirac_slash(q,4)+m)} you have to write @code{dirac_gamma(mu)*(dirac_slash(q,4)+m*dirac_ONE())}. Otherwise, GiNaC will complain and/or produce incorrect results. @cindex @code{dirac_gamma5()} There is a special element @samp{gamma5} that commutates with all other gammas, has a unit square, and in 4 dimensions equals @samp{gamma~0 gamma~1 gamma~2 gamma~3}, provided by @example ex dirac_gamma5(unsigned char rl = 0); @end example @cindex @code{dirac_gammaL()} @cindex @code{dirac_gammaR()} The chiral projectors @samp{(1+/-gamma5)/2} are also available as proper objects, constructed by @example ex dirac_gammaL(unsigned char rl = 0); ex dirac_gammaR(unsigned char rl = 0); @end example They observe the relations @samp{gammaL^2 = gammaL}, @samp{gammaR^2 = gammaR}, and @samp{gammaL gammaR = gammaR gammaL = 0}. @cindex @code{dirac_slash()} Finally, the function @example ex dirac_slash(const ex & e, const ex & dim, unsigned char rl = 0); @end example creates a term that represents a contraction of @samp{e} with the Dirac Lorentz vector (it behaves like a term of the form @samp{e.mu gamma~mu} with a unique index whose dimension is given by the @code{dim} argument). Such slashed expressions are printed with a trailing backslash, e.g. @samp{e\}. In products of dirac gammas, superfluous unity elements are automatically removed, squares are replaced by their values, and @samp{gamma5}, @samp{gammaL} and @samp{gammaR} are moved to the front. The @code{simplify_indexed()} function performs contractions in gamma strings, for example @example @{ ... symbol a("a"), b("b"), D("D"); varidx mu(symbol("mu"), D); ex e = dirac_gamma(mu) * dirac_slash(a, D) * dirac_gamma(mu.toggle_variance()); cout << e << endl; // -> gamma~mu*a\*gamma.mu e = e.simplify_indexed(); cout << e << endl; // -> -D*a\+2*a\ cout << e.subs(D == 4) << endl; // -> -2*a\ ... @} @end example @cindex @code{dirac_trace()} To calculate the trace of an expression containing strings of Dirac gammas you use one of the functions @example ex dirac_trace(const ex & e, const std::set & rls, const ex & trONE = 4); ex dirac_trace(const ex & e, const lst & rll, const ex & trONE = 4); ex dirac_trace(const ex & e, unsigned char rl = 0, const ex & trONE = 4); @end example These functions take the trace over all gammas in the specified set @code{rls} or list @code{rll} of representation labels, or the single label @code{rl}; gammas with other labels are left standing. The last argument to @code{dirac_trace()} is the value to be returned for the trace of the unity element, which defaults to 4. The @code{dirac_trace()} function is a linear functional that is equal to the ordinary matrix trace only in @math{D = 4} dimensions. In particular, the functional is not cyclic in @tex $D \ne 4$ @end tex @ifnottex @math{D != 4} @end ifnottex dimensions when acting on expressions containing @samp{gamma5}, so it's not a proper trace. This @samp{gamma5} scheme is described in greater detail in the article @cite{The Role of gamma5 in Dimensional Regularization} (@ref{Bibliography}). The value of the trace itself is also usually different in 4 and in @tex $D \ne 4$ @end tex @ifnottex @math{D != 4} @end ifnottex dimensions: @example @{ // 4 dimensions varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4), rho(symbol("rho"), 4); ex e = dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(mu.toggle_variance()) * dirac_gamma(rho); cout << dirac_trace(e).simplify_indexed() << endl; // -> -8*eta~rho~nu @} ... @{ // D dimensions symbol D("D"); varidx mu(symbol("mu"), D), nu(symbol("nu"), D), rho(symbol("rho"), D); ex e = dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(mu.toggle_variance()) * dirac_gamma(rho); cout << dirac_trace(e).simplify_indexed() << endl; // -> 8*eta~rho~nu-4*eta~rho~nu*D @} @end example Here is an example for using @code{dirac_trace()} to compute a value that appears in the calculation of the one-loop vacuum polarization amplitude in QED: @example @{ symbol q("q"), l("l"), m("m"), ldotq("ldotq"), D("D"); varidx mu(symbol("mu"), D), nu(symbol("nu"), D); scalar_products sp; sp.add(l, l, pow(l, 2)); sp.add(l, q, ldotq); ex e = dirac_gamma(mu) * (dirac_slash(l, D) + dirac_slash(q, D) + m * dirac_ONE()) * dirac_gamma(mu.toggle_variance()) * (dirac_slash(l, D) + m * dirac_ONE()); e = dirac_trace(e).simplify_indexed(sp); e = e.collect(lst@{l, ldotq, m@}); cout << e << endl; // -> (8-4*D)*l^2+(8-4*D)*ldotq+4*D*m^2 @} @end example The @code{canonicalize_clifford()} function reorders all gamma products that appear in an expression to a canonical (but not necessarily simple) form. You can use this to compare two expressions or for further simplifications: @example @{ varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4); ex e = dirac_gamma(mu) * dirac_gamma(nu) + dirac_gamma(nu) * dirac_gamma(mu); cout << e << endl; // -> gamma~mu*gamma~nu+gamma~nu*gamma~mu e = canonicalize_clifford(e); cout << e << endl; // -> 2*ONE*eta~mu~nu @} @end example @cindex @code{clifford_unit()} @subsubsection A generic Clifford algebra A generic Clifford algebra, i.e. a @tex $2^n$ @end tex @ifnottex 2^n @end ifnottex dimensional algebra with generators @tex $e_k$ @end tex @ifnottex e_k @end ifnottex satisfying the identities @tex $e_i e_j + e_j e_i = M(i, j) + M(j, i)$ @end tex @ifnottex e~i e~j + e~j e~i = M(i, j) + M(j, i) @end ifnottex for some bilinear form (@code{metric}) @math{M(i, j)}, which may be non-symmetric (see arXiv:math.QA/9911180) and contain symbolic entries. Such generators are created by the function @example ex clifford_unit(const ex & mu, const ex & metr, unsigned char rl = 0); @end example where @code{mu} should be a @code{idx} (or descendant) class object indexing the generators. Parameter @code{metr} defines the metric @math{M(i, j)} and can be represented by a square @code{matrix}, @code{tensormetric} or @code{indexed} class object. In fact, any expression either with two free indices or without indices at all is admitted as @code{metr}. In the later case an @code{indexed} object with two newly created indices with @code{metr} as its @code{op(0)} will be used. Optional parameter @code{rl} allows to distinguish different Clifford algebras, which will commute with each other. Note that the call @code{clifford_unit(mu, minkmetric())} creates something very close to @code{dirac_gamma(mu)}, although @code{dirac_gamma} have more efficient simplification mechanism. @cindex @code{get_metric()} Also, the object created by @code{clifford_unit(mu, minkmetric())} is not aware about the symmetry of its metric, see the start of the previous paragraph. A more accurate analog of 'dirac_gamma(mu)' should be specifies as follows: @example clifford_unit(mu, indexed(minkmetric(),sy_symm(),varidx(symbol("i"),4),varidx(symbol("j"),4))); @end example The method @code{clifford::get_metric()} returns a metric defining this Clifford number. If the matrix @math{M(i, j)} is in fact symmetric you may prefer to create the Clifford algebra units with a call like that @example ex e = clifford_unit(mu, indexed(M, sy_symm(), i, j)); @end example since this may yield some further automatic simplifications. Again, for a metric defined through a @code{matrix} such a symmetry is detected automatically. Individual generators of a Clifford algebra can be accessed in several ways. For example @example @{ ... idx i(symbol("i"), 4); realsymbol s("s"); ex M = diag_matrix(lst@{1, -1, 0, s@}); ex e = clifford_unit(i, M); ex e0 = e.subs(i == 0); ex e1 = e.subs(i == 1); ex e2 = e.subs(i == 2); ex e3 = e.subs(i == 3); ... @} @end example will produce four anti-commuting generators of a Clifford algebra with properties @tex $e_0^2=1 $, $e_1^2=-1$, $e_2^2=0$ and $e_3^2=s$. @end tex @ifnottex @code{pow(e0, 2) = 1}, @code{pow(e1, 2) = -1}, @code{pow(e2, 2) = 0} and @code{pow(e3, 2) = s}. @end ifnottex @cindex @code{lst_to_clifford()} A similar effect can be achieved from the function @example ex lst_to_clifford(const ex & v, const ex & mu, const ex & metr, unsigned char rl = 0); ex lst_to_clifford(const ex & v, const ex & e); @end example which converts a list or vector @tex $v = (v^0, v^1, ..., v^n)$ @end tex @ifnottex @samp{v = (v~0, v~1, ..., v~n)} @end ifnottex into the Clifford number @tex $v^0 e_0 + v^1 e_1 + ... + v^n e_n$ @end tex @ifnottex @samp{v~0 e.0 + v~1 e.1 + ... + v~n e.n} @end ifnottex with @samp{e.k} directly supplied in the second form of the procedure. In the first form the Clifford unit @samp{e.k} is generated by the call of @code{clifford_unit(mu, metr, rl)}. @cindex pseudo-vector If the number of components supplied by @code{v} exceeds the dimensionality of the Clifford unit @code{e} by 1 then function @code{lst_to_clifford()} uses the following pseudo-vector representation: @tex $v^0 {\bf 1} + v^1 e_0 + v^2 e_1 + ... + v^{n+1} e_n$ @end tex @ifnottex @samp{v~0 ONE + v~1 e.0 + v~2 e.1 + ... + v~[n+1] e.n} @end ifnottex The previous code may be rewritten with the help of @code{lst_to_clifford()} as follows @example @{ ... idx i(symbol("i"), 4); realsymbol s("s"); ex M = diag_matrix(@{1, -1, 0, s@}); ex e0 = lst_to_clifford(lst@{1, 0, 0, 0@}, i, M); ex e1 = lst_to_clifford(lst@{0, 1, 0, 0@}, i, M); ex e2 = lst_to_clifford(lst@{0, 0, 1, 0@}, i, M); ex e3 = lst_to_clifford(lst@{0, 0, 0, 1@}, i, M); ... @} @end example @cindex @code{clifford_to_lst()} There is the inverse function @example lst clifford_to_lst(const ex & e, const ex & c, bool algebraic = true); @end example which takes an expression @code{e} and tries to find a list @tex $v = (v^0, v^1, ..., v^n)$ @end tex @ifnottex @samp{v = (v~0, v~1, ..., v~n)} @end ifnottex such that the expression is either vector @tex $e = v^0 c_0 + v^1 c_1 + ... + v^n c_n$ @end tex @ifnottex @samp{e = v~0 c.0 + v~1 c.1 + ... + v~n c.n} @end ifnottex or pseudo-vector @tex $v^0 {\bf 1} + v^1 e_0 + v^2 e_1 + ... + v^{n+1} e_n$ @end tex @ifnottex @samp{v~0 ONE + v~1 e.0 + v~2 e.1 + ... + v~[n+1] e.n} @end ifnottex with respect to the given Clifford units @code{c}. Here none of the @samp{v~k} should contain Clifford units @code{c} (of course, this may be impossible). This function can use an @code{algebraic} method (default) or a symbolic one. With the @code{algebraic} method the @samp{v~k} are calculated as @tex $(e c_k + c_k e)/c_k^2$. If $c_k^2$ @end tex @ifnottex @samp{(e c.k + c.k e)/pow(c.k, 2)}. If @samp{pow(c.k, 2)} @end ifnottex is zero or is not @code{numeric} for some @samp{k} then the method will be automatically changed to symbolic. The same effect is obtained by the assignment (@code{algebraic = false}) in the procedure call. @cindex @code{clifford_prime()} @cindex @code{clifford_star()} @cindex @code{clifford_bar()} There are several functions for (anti-)automorphisms of Clifford algebras: @example ex clifford_prime(const ex & e) inline ex clifford_star(const ex & e) inline ex clifford_bar(const ex & e) @end example The automorphism of a Clifford algebra @code{clifford_prime()} simply changes signs of all Clifford units in the expression. The reversion of a Clifford algebra @code{clifford_star()} reverses the order of Clifford units in any product. Finally the main anti-automorphism of a Clifford algebra @code{clifford_bar()} is the composition of the previous two, i.e. it makes the reversion and changes signs of all Clifford units in a product. These functions correspond to the notations @math{e'}, @tex $e^*$ @end tex @ifnottex e* @end ifnottex and @tex $\overline{e}$ @end tex @ifnottex @code{\bar@{e@}} @end ifnottex used in Clifford algebra textbooks. @cindex @code{clifford_norm()} The function @example ex clifford_norm(const ex & e); @end example @cindex @code{clifford_inverse()} calculates the norm of a Clifford number from the expression @tex $||e||^2 = e\overline{e}$. @end tex @ifnottex @code{||e||^2 = e \bar@{e@}} @end ifnottex The inverse of a Clifford expression is returned by the function @example ex clifford_inverse(const ex & e); @end example which calculates it as @tex $e^{-1} = \overline{e}/||e||^2$. @end tex @ifnottex @math{e^@{-1@} = \bar@{e@}/||e||^2} @end ifnottex If @tex $||e|| = 0$ @end tex @ifnottex @math{||e||=0} @end ifnottex then an exception is raised. @cindex @code{remove_dirac_ONE()} If a Clifford number happens to be a factor of @code{dirac_ONE()} then we can convert it to a ``real'' (non-Clifford) expression by the function @example ex remove_dirac_ONE(const ex & e); @end example @cindex @code{canonicalize_clifford()} The function @code{canonicalize_clifford()} works for a generic Clifford algebra in a similar way as for Dirac gammas. The next provided function is @cindex @code{clifford_moebius_map()} @example ex clifford_moebius_map(const ex & a, const ex & b, const ex & c, const ex & d, const ex & v, const ex & G, unsigned char rl = 0); ex clifford_moebius_map(const ex & M, const ex & v, const ex & G, unsigned char rl = 0); @end example It takes a list or vector @code{v} and makes the Moebius (conformal or linear-fractional) transformation @samp{v -> (av+b)/(cv+d)} defined by the matrix @samp{M = [[a, b], [c, d]]}. The parameter @code{G} defines the metric of the surrounding (pseudo-)Euclidean space. This can be an indexed object, tensormetric, matrix or a Clifford unit, in the later case the optional parameter @code{rl} is ignored even if supplied. Depending from the type of @code{v} the returned value of this function is either a vector or a list holding vector's components. @cindex @code{clifford_max_label()} Finally the function @example char clifford_max_label(const ex & e, bool ignore_ONE = false); @end example can detect a presence of Clifford objects in the expression @code{e}: if such objects are found it returns the maximal @code{representation_label} of them, otherwise @code{-1}. The optional parameter @code{ignore_ONE} indicates if @code{dirac_ONE} objects should be ignored during the search. LaTeX output for Clifford units looks like @code{\clifford[1]@{e@}^@{@{\nu@}@}}, where @code{1} is the @code{representation_label} and @code{\nu} is the index of the corresponding unit. This provides a flexible typesetting with a suitable definition of the @code{\clifford} command. For example, the definition @example \newcommand@{\clifford@}[1][]@{@} @end example typesets all Clifford units identically, while the alternative definition @example \newcommand@{\clifford@}[2][]@{\ifcase #1 #2\or \tilde@{#2@} \or \breve@{#2@} \fi@} @end example prints units with @code{representation_label=0} as @tex $e$, @end tex @ifnottex @code{e}, @end ifnottex with @code{representation_label=1} as @tex $\tilde{e}$ @end tex @ifnottex @code{\tilde@{e@}} @end ifnottex and with @code{representation_label=2} as @tex $\breve{e}$. @end tex @ifnottex @code{\breve@{e@}}. @end ifnottex @cindex @code{color} (class) @subsection Color algebra @cindex @code{color_T()} For computations in quantum chromodynamics, GiNaC implements the base elements and structure constants of the su(3) Lie algebra (color algebra). The base elements @math{T_a} are constructed by the function @example ex color_T(const ex & a, unsigned char rl = 0); @end example which takes two arguments: the index and a @dfn{representation label} in the range 0 to 255 which is used to distinguish elements of different color algebras. Objects with different labels commutate with each other. The dimension of the index must be exactly 8 and it should be of class @code{idx}, not @code{varidx}. @cindex @code{color_ONE()} The unity element of a color algebra is constructed by @example ex color_ONE(unsigned char rl = 0); @end example @strong{Please notice:} You must always use @code{color_ONE()} when referring to multiples of the unity element, even though it's customary to omit it. E.g. instead of @code{color_T(a)*(color_T(b)*indexed(X,b)+1)} you have to write @code{color_T(a)*(color_T(b)*indexed(X,b)+color_ONE())}. Otherwise, GiNaC may produce incorrect results. @cindex @code{color_d()} @cindex @code{color_f()} The functions @example ex color_d(const ex & a, const ex & b, const ex & c); ex color_f(const ex & a, const ex & b, const ex & c); @end example create the symmetric and antisymmetric structure constants @math{d_abc} and @math{f_abc} which satisfy @math{@{T_a, T_b@} = 1/3 delta_ab + d_abc T_c} and @math{[T_a, T_b] = i f_abc T_c}. These functions evaluate to their numerical values, if you supply numeric indices to them. The index values should be in the range from 1 to 8, not from 0 to 7. This departure from usual conventions goes along better with the notations used in physical literature. @cindex @code{color_h()} There's an additional function @example ex color_h(const ex & a, const ex & b, const ex & c); @end example which returns the linear combination @samp{color_d(a, b, c)+I*color_f(a, b, c)}. The function @code{simplify_indexed()} performs some simplifications on expressions containing color objects: @example @{ ... idx a(symbol("a"), 8), b(symbol("b"), 8), c(symbol("c"), 8), k(symbol("k"), 8), l(symbol("l"), 8); e = color_d(a, b, l) * color_f(a, b, k); cout << e.simplify_indexed() << endl; // -> 0 e = color_d(a, b, l) * color_d(a, b, k); cout << e.simplify_indexed() << endl; // -> 5/3*delta.k.l e = color_f(l, a, b) * color_f(a, b, k); cout << e.simplify_indexed() << endl; // -> 3*delta.k.l e = color_h(a, b, c) * color_h(a, b, c); cout << e.simplify_indexed() << endl; // -> -32/3 e = color_h(a, b, c) * color_T(b) * color_T(c); cout << e.simplify_indexed() << endl; // -> -2/3*T.a e = color_h(a, b, c) * color_T(a) * color_T(b) * color_T(c); cout << e.simplify_indexed() << endl; // -> -8/9*ONE e = color_T(k) * color_T(a) * color_T(b) * color_T(k); cout << e.simplify_indexed() << endl; // -> 1/4*delta.b.a*ONE-1/6*T.a*T.b ... @end example @cindex @code{color_trace()} To calculate the trace of an expression containing color objects you use one of the functions @example ex color_trace(const ex & e, const std::set & rls); ex color_trace(const ex & e, const lst & rll); ex color_trace(const ex & e, unsigned char rl = 0); @end example These functions take the trace over all color @samp{T} objects in the specified set @code{rls} or list @code{rll} of representation labels, or the single label @code{rl}; @samp{T}s with other labels are left standing. For example: @example ... e = color_trace(4 * color_T(a) * color_T(b) * color_T(c)); cout << e << endl; // -> -I*f.a.c.b+d.a.c.b @} @end example @node Methods and functions, Information about expressions, Non-commutative objects, Top @c node-name, next, previous, up @chapter Methods and functions @cindex polynomial In this chapter the most important algorithms provided by GiNaC will be described. Some of them are implemented as functions on expressions, others are implemented as methods provided by expression objects. If they are methods, there exists a wrapper function around it, so you can alternatively call it in a functional way as shown in the simple example: @example ... cout << "As method: " << sin(1).evalf() << endl; cout << "As function: " << evalf(sin(1)) << endl; ... @end example @cindex @code{subs()} The general rule is that wherever methods accept one or more parameters (@var{arg1}, @var{arg2}, @dots{}) the order of arguments the function wrapper accepts is the same but preceded by the object to act on (@var{object}, @var{arg1}, @var{arg2}, @dots{}). This approach is the most natural one in an OO model but it may lead to confusion for MapleV users because where they would type @code{A:=x+1; subs(x=2,A);} GiNaC would require @code{A=x+1; subs(A,x==2);} (after proper declaration of @code{A} and @code{x}). On the other hand, since MapleV returns 3 on @code{A:=x^2+3; coeff(A,x,0);} (GiNaC: @code{A=pow(x,2)+3; coeff(A,x,0);}) it is clear that MapleV is not trying to be consistent here. Also, users of MuPAD will in most cases feel more comfortable with GiNaC's convention. All function wrappers are implemented as simple inline functions which just call the corresponding method and are only provided for users uncomfortable with OO who are dead set to avoid method invocations. Generally, nested function wrappers are much harder to read than a sequence of methods and should therefore be avoided if possible. On the other hand, not everything in GiNaC is a method on class @code{ex} and sometimes calling a function cannot be avoided. @menu * Information about expressions:: * Numerical evaluation:: * Substituting expressions:: * Pattern matching and advanced substitutions:: * Applying a function on subexpressions:: * Visitors and tree traversal:: * Polynomial arithmetic:: Working with polynomials. * Rational expressions:: Working with rational functions. * Symbolic differentiation:: * Series expansion:: Taylor and Laurent expansion. * Symmetrization:: * Built-in functions:: List of predefined mathematical functions. * Multiple polylogarithms:: * Complex expressions:: * Solving linear systems of equations:: * Input/output:: Input and output of expressions. @end menu @node Information about expressions, Numerical evaluation, Methods and functions, Methods and functions @c node-name, next, previous, up @section Getting information about expressions @subsection Checking expression types @cindex @code{is_a<@dots{}>()} @cindex @code{is_exactly_a<@dots{}>()} @cindex @code{ex_to<@dots{}>()} @cindex Converting @code{ex} to other classes @cindex @code{info()} @cindex @code{return_type()} @cindex @code{return_type_tinfo()} Sometimes it's useful to check whether a given expression is a plain number, a sum, a polynomial with integer coefficients, or of some other specific type. GiNaC provides a couple of functions for this: @example bool is_a(const ex & e); bool is_exactly_a(const ex & e); bool ex::info(unsigned flag); unsigned ex::return_type() const; return_type_t ex::return_type_tinfo() const; @end example When the test made by @code{is_a()} returns true, it is safe to call one of the functions @code{ex_to()}, where @code{T} is one of the class names (@xref{The class hierarchy}, for a list of all classes). For example, assuming @code{e} is an @code{ex}: @example @{ @dots{} if (is_a(e)) numeric n = ex_to(e); @dots{} @} @end example @code{is_a(e)} allows you to check whether the top-level object of an expression @samp{e} is an instance of the GiNaC class @samp{T} (@xref{The class hierarchy}, for a list of all classes). This is most useful, e.g., for checking whether an expression is a number, a sum, or a product: @example @{ symbol x("x"); ex e1 = 42; ex e2 = 4*x - 3; is_a(e1); // true is_a(e2); // false is_a(e1); // false is_a(e2); // true is_a(e1); // false is_a(e2); // false @} @end example In contrast, @code{is_exactly_a(e)} allows you to check whether the top-level object of an expression @samp{e} is an instance of the GiNaC class @samp{T}, not including parent classes. The @code{info()} method is used for checking certain attributes of expressions. The possible values for the @code{flag} argument are defined in @file{ginac/flags.h}, the most important being explained in the following table: @cartouche @multitable @columnfractions .30 .70 @item @strong{Flag} @tab @strong{Returns true if the object is@dots{}} @item @code{numeric} @tab @dots{}a number (same as @code{is_a(...)}) @item @code{real} @tab @dots{}a real number, symbol or constant (i.e. is not complex) @item @code{rational} @tab @dots{}an exact rational number (integers are rational, too) @item @code{integer} @tab @dots{}a (non-complex) integer @item @code{crational} @tab @dots{}an exact (complex) rational number (such as @math{2/3+7/2*I}) @item @code{cinteger} @tab @dots{}a (complex) integer (such as @math{2-3*I}) @item @code{positive} @tab @dots{}not complex and greater than 0 @item @code{negative} @tab @dots{}not complex and less than 0 @item @code{nonnegative} @tab @dots{}not complex and greater than or equal to 0 @item @code{posint} @tab @dots{}an integer greater than 0 @item @code{negint} @tab @dots{}an integer less than 0 @item @code{nonnegint} @tab @dots{}an integer greater than or equal to 0 @item @code{even} @tab @dots{}an even integer @item @code{odd} @tab @dots{}an odd integer @item @code{prime} @tab @dots{}a prime integer (probabilistic primality test) @item @code{relation} @tab @dots{}a relation (same as @code{is_a(...)}) @item @code{relation_equal} @tab @dots{}a @code{==} relation @item @code{relation_not_equal} @tab @dots{}a @code{!=} relation @item @code{relation_less} @tab @dots{}a @code{<} relation @item @code{relation_less_or_equal} @tab @dots{}a @code{<=} relation @item @code{relation_greater} @tab @dots{}a @code{>} relation @item @code{relation_greater_or_equal} @tab @dots{}a @code{>=} relation @item @code{symbol} @tab @dots{}a symbol (same as @code{is_a(...)}) @item @code{list} @tab @dots{}a list (same as @code{is_a(...)}) @item @code{polynomial} @tab @dots{}a polynomial (i.e. only consists of sums and products of numbers and symbols with positive integer powers) @item @code{integer_polynomial} @tab @dots{}a polynomial with (non-complex) integer coefficients @item @code{cinteger_polynomial} @tab @dots{}a polynomial with (possibly complex) integer coefficients (such as @math{2-3*I}) @item @code{rational_polynomial} @tab @dots{}a polynomial with (non-complex) rational coefficients @item @code{crational_polynomial} @tab @dots{}a polynomial with (possibly complex) rational coefficients (such as @math{2/3+7/2*I}) @item @code{rational_function} @tab @dots{}a rational function (@math{x+y}, @math{z/(x+y)}) @end multitable @end cartouche To determine whether an expression is commutative or non-commutative and if so, with which other expressions it would commutate, you use the methods @code{return_type()} and @code{return_type_tinfo()}. @xref{Non-commutative objects}, for an explanation of these. @subsection Accessing subexpressions @cindex container Many GiNaC classes, like @code{add}, @code{mul}, @code{lst}, and @code{function}, act as containers for subexpressions. For example, the subexpressions of a sum (an @code{add} object) are the individual terms, and the subexpressions of a @code{function} are the function's arguments. @cindex @code{nops()} @cindex @code{op()} GiNaC provides several ways of accessing subexpressions. The first way is to use the two methods @example size_t ex::nops(); ex ex::op(size_t i); @end example @code{nops()} determines the number of subexpressions (operands) contained in the expression, while @code{op(i)} returns the @code{i}-th (0..@code{nops()-1}) subexpression. In the case of a @code{power} object, @code{op(0)} will return the basis and @code{op(1)} the exponent. For @code{indexed} objects, @code{op(0)} is the base expression and @code{op(i)}, @math{i>0} are the indices. @cindex iterators @cindex @code{const_iterator} The second way to access subexpressions is via the STL-style random-access iterator class @code{const_iterator} and the methods @example const_iterator ex::begin(); const_iterator ex::end(); @end example @code{begin()} returns an iterator referring to the first subexpression; @code{end()} returns an iterator which is one-past the last subexpression. If the expression has no subexpressions, then @code{begin() == end()}. These iterators can also be used in conjunction with non-modifying STL algorithms. Here is an example that (non-recursively) prints the subexpressions of a given expression in three different ways: @example @{ ex e = ... // with nops()/op() for (size_t i = 0; i != e.nops(); ++i) cout << e.op(i) << endl; // with iterators for (const_iterator i = e.begin(); i != e.end(); ++i) cout << *i << endl; // with iterators and STL copy() std::copy(e.begin(), e.end(), std::ostream_iterator(cout, "\n")); @} @end example @cindex @code{const_preorder_iterator} @cindex @code{const_postorder_iterator} @code{op()}/@code{nops()} and @code{const_iterator} only access an expression's immediate children. GiNaC provides two additional iterator classes, @code{const_preorder_iterator} and @code{const_postorder_iterator}, that iterate over all objects in an expression tree, in preorder or postorder, respectively. They are STL-style forward iterators, and are created with the methods @example const_preorder_iterator ex::preorder_begin(); const_preorder_iterator ex::preorder_end(); const_postorder_iterator ex::postorder_begin(); const_postorder_iterator ex::postorder_end(); @end example The following example illustrates the differences between @code{const_iterator}, @code{const_preorder_iterator}, and @code{const_postorder_iterator}: @example @{ symbol A("A"), B("B"), C("C"); ex e = lst@{lst@{A, B@}, C@}; std::copy(e.begin(), e.end(), std::ostream_iterator(cout, "\n")); // @{A,B@} // C std::copy(e.preorder_begin(), e.preorder_end(), std::ostream_iterator(cout, "\n")); // @{@{A,B@},C@} // @{A,B@} // A // B // C std::copy(e.postorder_begin(), e.postorder_end(), std::ostream_iterator(cout, "\n")); // A // B // @{A,B@} // C // @{@{A,B@},C@} @} @end example @cindex @code{relational} (class) Finally, the left-hand side and right-hand side expressions of objects of class @code{relational} (and only of these) can also be accessed with the methods @example ex ex::lhs(); ex ex::rhs(); @end example @subsection Comparing expressions @cindex @code{is_equal()} @cindex @code{is_zero()} Expressions can be compared with the usual C++ relational operators like @code{==}, @code{>}, and @code{<} but if the expressions contain symbols, the result is usually not determinable and the result will be @code{false}, except in the case of the @code{!=} operator. You should also be aware that GiNaC will only do the most trivial test for equality (subtracting both expressions), so something like @code{(pow(x,2)+x)/x==x+1} will return @code{false}. Actually, if you construct an expression like @code{a == b}, this will be represented by an object of the @code{relational} class (@pxref{Relations}) which is not evaluated until (explicitly or implicitly) cast to a @code{bool}. There are also two methods @example bool ex::is_equal(const ex & other); bool ex::is_zero(); @end example for checking whether one expression is equal to another, or equal to zero, respectively. See also the method @code{ex::is_zero_matrix()}, @pxref{Matrices}. @subsection Ordering expressions @cindex @code{ex_is_less} (class) @cindex @code{ex_is_equal} (class) @cindex @code{compare()} Sometimes it is necessary to establish a mathematically well-defined ordering on a set of arbitrary expressions, for example to use expressions as keys in a @code{std::map<>} container, or to bring a vector of expressions into a canonical order (which is done internally by GiNaC for sums and products). The operators @code{<}, @code{>} etc. described in the last section cannot be used for this, as they don't implement an ordering relation in the mathematical sense. In particular, they are not guaranteed to be antisymmetric: if @samp{a} and @samp{b} are different expressions, and @code{a < b} yields @code{false}, then @code{b < a} doesn't necessarily yield @code{true}. By default, STL classes and algorithms use the @code{<} and @code{==} operators to compare objects, which are unsuitable for expressions, but GiNaC provides two functors that can be supplied as proper binary comparison predicates to the STL: @example class ex_is_less @{ public: bool operator()(const ex &lh, const ex &rh) const; @}; class ex_is_equal @{ public: bool operator()(const ex &lh, const ex &rh) const; @}; @end example For example, to define a @code{map} that maps expressions to strings you have to use @example std::map myMap; @end example Omitting the @code{ex_is_less} template parameter will introduce spurious bugs because the map operates improperly. Other examples for the use of the functors: @example std::vector v; // fill vector ... // sort vector std::sort(v.begin(), v.end(), ex_is_less()); // count the number of expressions equal to '1' unsigned num_ones = std::count_if(v.begin(), v.end(), [](const ex& e) @{ return ex_is_equal()(e, 1); @}); @end example The implementation of @code{ex_is_less} uses the member function @example int ex::compare(const ex & other) const; @end example which returns @math{0} if @code{*this} and @code{other} are equal, @math{-1} if @code{*this} sorts before @code{other}, and @math{1} if @code{*this} sorts after @code{other}. @node Numerical evaluation, Substituting expressions, Information about expressions, Methods and functions @c node-name, next, previous, up @section Numerical evaluation @cindex @code{evalf()} GiNaC keeps algebraic expressions, numbers and constants in their exact form. To evaluate them using floating-point arithmetic you need to call @example ex ex::evalf() const; @end example @cindex @code{Digits} The accuracy of the evaluation is controlled by the global object @code{Digits} which can be assigned an integer value. The default value of @code{Digits} is 17. @xref{Numbers}, for more information and examples. To evaluate an expression to a @code{double} floating-point number you can call @code{evalf()} followed by @code{numeric::to_double()}, like this: @example @{ // Approximate sin(x/Pi) symbol x("x"); ex e = series(sin(x/Pi), x == 0, 6); // Evaluate numerically at x=0.1 ex f = evalf(e.subs(x == 0.1)); // ex_to is an unsafe cast, so check the type first if (is_a(f)) @{ double d = ex_to(f).to_double(); cout << d << endl; // -> 0.0318256 @} else // error @} @end example @node Substituting expressions, Pattern matching and advanced substitutions, Numerical evaluation, Methods and functions @c node-name, next, previous, up @section Substituting expressions @cindex @code{subs()} Algebraic objects inside expressions can be replaced with arbitrary expressions via the @code{.subs()} method: @example ex ex::subs(const ex & e, unsigned options = 0); ex ex::subs(const exmap & m, unsigned options = 0); ex ex::subs(const lst & syms, const lst & repls, unsigned options = 0); @end example In the first form, @code{subs()} accepts a relational of the form @samp{object == expression} or a @code{lst} of such relationals: @example @{ symbol x("x"), y("y"); ex e1 = 2*x*x-4*x+3; cout << "e1(7) = " << e1.subs(x == 7) << endl; // -> 73 ex e2 = x*y + x; cout << "e2(-2, 4) = " << e2.subs(lst@{x == -2, y == 4@}) << endl; // -> -10 @} @end example If you specify multiple substitutions, they are performed in parallel, so e.g. @code{subs(lst@{x == y, y == x@})} exchanges @samp{x} and @samp{y}. The second form of @code{subs()} takes an @code{exmap} object which is a pair associative container that maps expressions to expressions (currently implemented as a @code{std::map}). This is the most efficient one of the three @code{subs()} forms and should be used when the number of objects to be substituted is large or unknown. Using this form, the second example from above would look like this: @example @{ symbol x("x"), y("y"); ex e2 = x*y + x; exmap m; m[x] = -2; m[y] = 4; cout << "e2(-2, 4) = " << e2.subs(m) << endl; @} @end example The third form of @code{subs()} takes two lists, one for the objects to be replaced and one for the expressions to be substituted (both lists must contain the same number of elements). Using this form, you would write @example @{ symbol x("x"), y("y"); ex e2 = x*y + x; cout << "e2(-2, 4) = " << e2.subs(lst@{x, y@}, lst@{-2, 4@}) << endl; @} @end example The optional last argument to @code{subs()} is a combination of @code{subs_options} flags. There are three options available: @code{subs_options::no_pattern} disables pattern matching, which makes large @code{subs()} operations significantly faster if you are not using patterns. The second option, @code{subs_options::algebraic} enables algebraic substitutions in products and powers. @xref{Pattern matching and advanced substitutions}, for more information about patterns and algebraic substitutions. The third option, @code{subs_options::no_index_renaming} disables the feature that dummy indices are renamed if the substitution could give a result in which a dummy index occurs more than two times. This is sometimes necessary if you want to use @code{subs()} to rename your dummy indices. @code{subs()} performs syntactic substitution of any complete algebraic object; it does not try to match sub-expressions as is demonstrated by the following example: @example @{ symbol x("x"), y("y"), z("z"); ex e1 = pow(x+y, 2); cout << e1.subs(x+y == 4) << endl; // -> 16 ex e2 = sin(x)*sin(y)*cos(x); cout << e2.subs(sin(x) == cos(x)) << endl; // -> cos(x)^2*sin(y) ex e3 = x+y+z; cout << e3.subs(x+y == 4) << endl; // -> x+y+z // (and not 4+z as one might expect) @} @end example A more powerful form of substitution using wildcards is described in the next section. @node Pattern matching and advanced substitutions, Applying a function on subexpressions, Substituting expressions, Methods and functions @c node-name, next, previous, up @section Pattern matching and advanced substitutions @cindex @code{wildcard} (class) @cindex Pattern matching GiNaC allows the use of patterns for checking whether an expression is of a certain form or contains subexpressions of a certain form, and for substituting expressions in a more general way. A @dfn{pattern} is an algebraic expression that optionally contains wildcards. A @dfn{wildcard} is a special kind of object (of class @code{wildcard}) that represents an arbitrary expression. Every wildcard has a @dfn{label} which is an unsigned integer number to allow having multiple different wildcards in a pattern. Wildcards are printed as @samp{$label} (this is also the way they are specified in @command{ginsh}). In C++ code, wildcard objects are created with the call @example ex wild(unsigned label = 0); @end example which is simply a wrapper for the @code{wildcard()} constructor with a shorter name. Some examples for patterns: @multitable @columnfractions .5 .5 @item @strong{Constructed as} @tab @strong{Output as} @item @code{wild()} @tab @samp{$0} @item @code{pow(x,wild())} @tab @samp{x^$0} @item @code{atan2(wild(1),wild(2))} @tab @samp{atan2($1,$2)} @item @code{indexed(A,idx(wild(),3))} @tab @samp{A.$0} @end multitable Notes: @itemize @bullet @item Wildcards behave like symbols and are subject to the same algebraic rules. E.g., @samp{$0+2*$0} is automatically transformed to @samp{3*$0}. @item As shown in the last example, to use wildcards for indices you have to use them as the value of an @code{idx} object. This is because indices must always be of class @code{idx} (or a subclass). @item Wildcards only represent expressions or subexpressions. It is not possible to use them as placeholders for other properties like index dimension or variance, representation labels, symmetry of indexed objects etc. @item Because wildcards are commutative, it is not possible to use wildcards as part of noncommutative products. @item A pattern does not have to contain wildcards. @samp{x} and @samp{x+y} are also valid patterns. @end itemize @subsection Matching expressions @cindex @code{match()} The most basic application of patterns is to check whether an expression matches a given pattern. This is done by the function @example bool ex::match(const ex & pattern); bool ex::match(const ex & pattern, exmap& repls); @end example This function returns @code{true} when the expression matches the pattern and @code{false} if it doesn't. If used in the second form, the actual subexpressions matched by the wildcards get returned in the associative array @code{repls} with @samp{wildcard} as a key. If @code{match()} returns false, @code{repls} remains unmodified. The matching algorithm works as follows: @itemize @item A single wildcard matches any expression. If one wildcard appears multiple times in a pattern, it must match the same expression in all places (e.g. @samp{$0} matches anything, and @samp{$0*($0+1)} matches @samp{x*(x+1)} but not @samp{x*(y+1)}). @item If the expression is not of the same class as the pattern, the match fails (i.e. a sum only matches a sum, a function only matches a function, etc.). @item If the pattern is a function, it only matches the same function (i.e. @samp{sin($0)} matches @samp{sin(x)} but doesn't match @samp{exp(x)}). @item Except for sums and products, the match fails if the number of subexpressions (@code{nops()}) is not equal to the number of subexpressions of the pattern. @item If there are no subexpressions, the expressions and the pattern must be equal (in the sense of @code{is_equal()}). @item Except for sums and products, each subexpression (@code{op()}) must match the corresponding subexpression of the pattern. @end itemize Sums (@code{add}) and products (@code{mul}) are treated in a special way to account for their commutativity and associativity: @itemize @item If the pattern contains a term or factor that is a single wildcard, this one is used as the @dfn{global wildcard}. If there is more than one such wildcard, one of them is chosen as the global wildcard in a random way. @item Every term/factor of the pattern, except the global wildcard, is matched against every term of the expression in sequence. If no match is found, the whole match fails. Terms that did match are not considered in further matches. @item If there are no unmatched terms left, the match succeeds. Otherwise the match fails unless there is a global wildcard in the pattern, in which case this wildcard matches the remaining terms. @end itemize In general, having more than one single wildcard as a term of a sum or a factor of a product (such as @samp{a+$0+$1}) will lead to unpredictable or ambiguous results. Here are some examples in @command{ginsh} to demonstrate how it works (the @code{match()} function in @command{ginsh} returns @samp{FAIL} if the match fails, and the list of wildcard replacements otherwise): @example > match((x+y)^a,(x+y)^a); @{@} > match((x+y)^a,(x+y)^b); FAIL > match((x+y)^a,$1^$2); @{$1==x+y,$2==a@} > match((x+y)^a,$1^$1); FAIL > match((x+y)^(x+y),$1^$1); @{$1==x+y@} > match((x+y)^(x+y),$1^$2); @{$1==x+y,$2==x+y@} > match((a+b)*(a+c),($1+b)*($1+c)); @{$1==a@} > match((a+b)*(a+c),(a+$1)*(a+$2)); @{$1==b,$2==c@} (Unpredictable. The result might also be [$1==c,$2==b].) > match((a+b)*(a+c),($1+$2)*($1+$3)); (The result is undefined. Due to the sequential nature of the algorithm and the re-ordering of terms in GiNaC, the match for the first factor may be @{$1==a,$2==b@} in which case the match for the second factor succeeds, or it may be @{$1==b,$2==a@} which causes the second match to fail.) > match(a*(x+y)+a*z+b,a*$1+$2); (This is also ambiguous and may return either @{$1==z,$2==a*(x+y)+b@} or @{$1=x+y,$2=a*z+b@}.) > match(a+b+c+d+e+f,c); FAIL > match(a+b+c+d+e+f,c+$0); @{$0==a+e+b+f+d@} > match(a+b+c+d+e+f,c+e+$0); @{$0==a+b+f+d@} > match(a+b,a+b+$0); @{$0==0@} > match(a*b^2,a^$1*b^$2); FAIL (The matching is syntactic, not algebraic, and "a" doesn't match "a^$1" even though a==a^1.) > match(x*atan2(x,x^2),$0*atan2($0,$0^2)); @{$0==x@} > match(atan2(y,x^2),atan2(y,$0)); @{$0==x^2@} @end example @subsection Matching parts of expressions @cindex @code{has()} A more general way to look for patterns in expressions is provided by the member function @example bool ex::has(const ex & pattern); @end example This function checks whether a pattern is matched by an expression itself or by any of its subexpressions. Again some examples in @command{ginsh} for illustration (in @command{ginsh}, @code{has()} returns @samp{1} for @code{true} and @samp{0} for @code{false}): @example > has(x*sin(x+y+2*a),y); 1 > has(x*sin(x+y+2*a),x+y); 0 (This is because in GiNaC, "x+y" is not a subexpression of "x+y+2*a" (which has the subexpressions "x", "y" and "2*a".) > has(x*sin(x+y+2*a),x+y+$1); 1 (But this is possible.) > has(x*sin(2*(x+y)+2*a),x+y); 0 (This fails because "2*(x+y)" automatically gets converted to "2*x+2*y" of which "x+y" is not a subexpression.) > has(x+1,x^$1); 0 (Although x^1==x and x^0==1, neither "x" nor "1" are actually of the form "x^something".) > has(4*x^2-x+3,$1*x); 1 > has(4*x^2+x+3,$1*x); 0 (Another possible pitfall. The first expression matches because the term "-x" has the form "(-1)*x" in GiNaC. To check whether a polynomial contains a linear term you should use the coeff() function instead.) @end example @cindex @code{find()} The method @example bool ex::find(const ex & pattern, exset& found); @end example works a bit like @code{has()} but it doesn't stop upon finding the first match. Instead, it appends all found matches to the specified list. If there are multiple occurrences of the same expression, it is entered only once to the list. @code{find()} returns false if no matches were found (in @command{ginsh}, it returns an empty list): @example > find(1+x+x^2+x^3,x); @{x@} > find(1+x+x^2+x^3,y); @{@} > find(1+x+x^2+x^3,x^$1); @{x^3,x^2@} (Note the absence of "x".) > expand((sin(x)+sin(y))*(a+b)); sin(y)*a+sin(x)*b+sin(x)*a+sin(y)*b > find(%,sin($1)); @{sin(y),sin(x)@} @end example @subsection Substituting expressions @cindex @code{subs()} Probably the most useful application of patterns is to use them for substituting expressions with the @code{subs()} method. Wildcards can be used in the search patterns as well as in the replacement expressions, where they get replaced by the expressions matched by them. @code{subs()} doesn't know anything about algebra; it performs purely syntactic substitutions. Some examples: @example > subs(a^2+b^2+(x+y)^2,$1^2==$1^3); b^3+a^3+(x+y)^3 > subs(a^4+b^4+(x+y)^4,$1^2==$1^3); b^4+a^4+(x+y)^4 > subs((a+b+c)^2,a+b==x); (a+b+c)^2 > subs((a+b+c)^2,a+b+$1==x+$1); (x+c)^2 > subs(a+2*b,a+b==x); a+2*b > subs(4*x^3-2*x^2+5*x-1,x==a); -1+5*a-2*a^2+4*a^3 > subs(4*x^3-2*x^2+5*x-1,x^$0==a^$0); -1+5*x-2*a^2+4*a^3 > subs(sin(1+sin(x)),sin($1)==cos($1)); cos(1+cos(x)) > expand(subs(a*sin(x+y)^2+a*cos(x+y)^2+b,cos($1)^2==1-sin($1)^2)); a+b @end example The last example would be written in C++ in this way: @example @{ symbol a("a"), b("b"), x("x"), y("y"); e = a*pow(sin(x+y), 2) + a*pow(cos(x+y), 2) + b; e = e.subs(pow(cos(wild()), 2) == 1-pow(sin(wild()), 2)); cout << e.expand() << endl; // -> a+b @} @end example @subsection The option algebraic Both @code{has()} and @code{subs()} take an optional argument to pass them extra options. This section describes what happens if you give the former the option @code{has_options::algebraic} or the latter @code{subs_options::algebraic}. In that case the matching condition for powers and multiplications is changed in such a way that they become more intuitive. Intuition says that @code{x*y} is a part of @code{x*y*z}. If you use these options you will find that @code{(x*y*z).has(x*y, has_options::algebraic)} indeed returns true. Besides matching some of the factors of a product also powers match as often as is possible without getting negative exponents. For example @code{(x^5*y^2*z).subs(x^2*y^2==c, subs_options::algebraic)} will return @code{x*c^2*z}. This also works with negative powers: @code{(x^(-3)*y^(-2)*z).subs(1/(x*y)==c, subs_options::algebraic)} will return @code{x^(-1)*c^2*z}. @strong{Please notice:} this only works for multiplications and not for locating @code{x+y} within @code{x+y+z}. @node Applying a function on subexpressions, Visitors and tree traversal, Pattern matching and advanced substitutions, Methods and functions @c node-name, next, previous, up @section Applying a function on subexpressions @cindex tree traversal @cindex @code{map()} Sometimes you may want to perform an operation on specific parts of an expression while leaving the general structure of it intact. An example of this would be a matrix trace operation: the trace of a sum is the sum of the traces of the individual terms. That is, the trace should @dfn{map} on the sum, by applying itself to each of the sum's operands. It is possible to do this manually which usually results in code like this: @example ex calc_trace(ex e) @{ if (is_a(e)) return ex_to(e).trace(); else if (is_a(e)) @{ ex sum = 0; for (size_t i=0; i)(e)) @{ ... @} else @{ ... @} @} @end example This is, however, slightly inefficient (if the sum is very large it can take a long time to add the terms one-by-one), and its applicability is limited to a rather small class of expressions. If @code{calc_trace()} is called with a relation or a list as its argument, you will probably want the trace to be taken on both sides of the relation or of all elements of the list. GiNaC offers the @code{map()} method to aid in the implementation of such operations: @example ex ex::map(map_function & f) const; ex ex::map(ex (*f)(const ex & e)) const; @end example In the first (preferred) form, @code{map()} takes a function object that is subclassed from the @code{map_function} class. In the second form, it takes a pointer to a function that accepts and returns an expression. @code{map()} constructs a new expression of the same type, applying the specified function on all subexpressions (in the sense of @code{op()}), non-recursively. The use of a function object makes it possible to supply more arguments to the function that is being mapped, or to keep local state information. The @code{map_function} class declares a virtual function call operator that you can overload. Here is a sample implementation of @code{calc_trace()} that uses @code{map()} in a recursive fashion: @example struct calc_trace : public map_function @{ ex operator()(const ex &e) @{ if (is_a(e)) return ex_to(e).trace(); else if (is_a(e)) @{ ... @} else return e.map(*this); @} @}; @end example This function object could then be used like this: @example @{ ex M = ... // expression with matrices calc_trace do_trace; ex tr = do_trace(M); @} @end example Here is another example for you to meditate over. It removes quadratic terms in a variable from an expanded polynomial: @example struct map_rem_quad : public map_function @{ ex var; map_rem_quad(const ex & var_) : var(var_) @{@} ex operator()(const ex & e) @{ if (is_a(e) || is_a(e)) return e.map(*this); else if (is_a(e) && e.op(0).is_equal(var) && e.op(1).info(info_flags::even)) return 0; else return e; @} @}; ... @{ symbol x("x"), y("y"); ex e; for (int i=0; i<8; i++) e += pow(x, i) * pow(y, 8-i) * (i+1); cout << e << endl; // -> 4*y^5*x^3+5*y^4*x^4+8*y*x^7+7*y^2*x^6+2*y^7*x+6*y^3*x^5+3*y^6*x^2+y^8 map_rem_quad rem_quad(x); cout << rem_quad(e) << endl; // -> 4*y^5*x^3+8*y*x^7+2*y^7*x+6*y^3*x^5+y^8 @} @end example @command{ginsh} offers a slightly different implementation of @code{map()} that allows applying algebraic functions to operands. The second argument to @code{map()} is an expression containing the wildcard @samp{$0} which acts as the placeholder for the operands: @example > map(a*b,sin($0)); sin(a)*sin(b) > map(a+2*b,sin($0)); sin(a)+sin(2*b) > map(@{a,b,c@},$0^2+$0); @{a^2+a,b^2+b,c^2+c@} @end example Note that it is only possible to use algebraic functions in the second argument. You can not use functions like @samp{diff()}, @samp{op()}, @samp{subs()} etc. because these are evaluated immediately: @example > map(@{a,b,c@},diff($0,a)); @{0,0,0@} This is because "diff($0,a)" evaluates to "0", so the command is equivalent to "map(@{a,b,c@},0)". @end example @node Visitors and tree traversal, Polynomial arithmetic, Applying a function on subexpressions, Methods and functions @c node-name, next, previous, up @section Visitors and tree traversal @cindex tree traversal @cindex @code{visitor} (class) @cindex @code{accept()} @cindex @code{visit()} @cindex @code{traverse()} @cindex @code{traverse_preorder()} @cindex @code{traverse_postorder()} Suppose that you need a function that returns a list of all indices appearing in an arbitrary expression. The indices can have any dimension, and for indices with variance you always want the covariant version returned. You can't use @code{get_free_indices()} because you also want to include dummy indices in the list, and you can't use @code{find()} as it needs specific index dimensions (and it would require two passes: one for indices with variance, one for plain ones). The obvious solution to this problem is a tree traversal with a type switch, such as the following: @example void gather_indices_helper(const ex & e, lst & l) @{ if (is_a(e)) @{ const varidx & vi = ex_to(e); l.append(vi.is_covariant() ? vi : vi.toggle_variance()); @} else if (is_a(e)) @{ l.append(e); @} else @{ size_t n = e.nops(); for (size_t i = 0; i < n; ++i) gather_indices_helper(e.op(i), l); @} @} lst gather_indices(const ex & e) @{ lst l; gather_indices_helper(e, l); l.sort(); l.unique(); return l; @} @end example This works fine but fans of object-oriented programming will feel uncomfortable with the type switch. One reason is that there is a possibility for subtle bugs regarding derived classes. If we had, for example, written @example if (is_a(e)) @{ ... @} else if (is_a(e)) @{ ... @end example in @code{gather_indices_helper}, the code wouldn't have worked because the first line "absorbs" all classes derived from @code{idx}, including @code{varidx}, so the special case for @code{varidx} would never have been executed. Also, for a large number of classes, a type switch like the above can get unwieldy and inefficient (it's a linear search, after all). @code{gather_indices_helper} only checks for two classes, but if you had to write a function that required a different implementation for nearly every GiNaC class, the result would be very hard to maintain and extend. The cleanest approach to the problem would be to add a new virtual function to GiNaC's class hierarchy. In our example, there would be specializations for @code{idx} and @code{varidx} while the default implementation in @code{basic} performed the tree traversal. Unfortunately, in C++ it's impossible to add virtual member functions to existing classes without changing their source and recompiling everything. GiNaC comes with source, so you could actually do this, but for a small algorithm like the one presented this would be impractical. One solution to this dilemma is the @dfn{Visitor} design pattern, which is implemented in GiNaC (actually, Robert Martin's Acyclic Visitor variation, described in detail in @uref{http://objectmentor.com/publications/acv.pdf}). Instead of adding virtual functions to the class hierarchy to implement operations, GiNaC provides a single "bouncing" method @code{accept()} that takes an instance of a special @code{visitor} class and redirects execution to the one @code{visit()} virtual function of the visitor that matches the type of object that @code{accept()} was being invoked on. Visitors in GiNaC must derive from the global @code{visitor} class as well as from the class @code{T::visitor} of each class @code{T} they want to visit, and implement the member functions @code{void visit(const T &)} for each class. A call of @example void ex::accept(visitor & v) const; @end example will then dispatch to the correct @code{visit()} member function of the specified visitor @code{v} for the type of GiNaC object at the root of the expression tree (e.g. a @code{symbol}, an @code{idx} or a @code{mul}). Here is an example of a visitor: @example class my_visitor : public visitor, // this is required public add::visitor, // visit add objects public numeric::visitor, // visit numeric objects public basic::visitor // visit basic objects @{ void visit(const add & x) @{ cout << "called with an add object" << endl; @} void visit(const numeric & x) @{ cout << "called with a numeric object" << endl; @} void visit(const basic & x) @{ cout << "called with a basic object" << endl; @} @}; @end example which can be used as follows: @example ... symbol x("x"); ex e1 = 42; ex e2 = 4*x-3; ex e3 = 8*x; my_visitor v; e1.accept(v); // prints "called with a numeric object" e2.accept(v); // prints "called with an add object" e3.accept(v); // prints "called with a basic object" ... @end example The @code{visit(const basic &)} method gets called for all objects that are not @code{numeric} or @code{add} and acts as an (optional) default. From a conceptual point of view, the @code{visit()} methods of the visitor behave like a newly added virtual function of the visited hierarchy. In addition, visitors can store state in member variables, and they can be extended by deriving a new visitor from an existing one, thus building hierarchies of visitors. We can now rewrite our index example from above with a visitor: @example class gather_indices_visitor : public visitor, public idx::visitor, public varidx::visitor @{ lst l; void visit(const idx & i) @{ l.append(i); @} void visit(const varidx & vi) @{ l.append(vi.is_covariant() ? vi : vi.toggle_variance()); @} public: const lst & get_result() // utility function @{ l.sort(); l.unique(); return l; @} @}; @end example What's missing is the tree traversal. We could implement it in @code{visit(const basic &)}, but GiNaC has predefined methods for this: @example void ex::traverse_preorder(visitor & v) const; void ex::traverse_postorder(visitor & v) const; void ex::traverse(visitor & v) const; @end example @code{traverse_preorder()} visits a node @emph{before} visiting its subexpressions, while @code{traverse_postorder()} visits a node @emph{after} visiting its subexpressions. @code{traverse()} is a synonym for @code{traverse_preorder()}. Here is a new implementation of @code{gather_indices()} that uses the visitor and @code{traverse()}: @example lst gather_indices(const ex & e) @{ gather_indices_visitor v; e.traverse(v); return v.get_result(); @} @end example Alternatively, you could use pre- or postorder iterators for the tree traversal: @example lst gather_indices(const ex & e) @{ gather_indices_visitor v; for (const_preorder_iterator i = e.preorder_begin(); i != e.preorder_end(); ++i) @{ i->accept(v); @} return v.get_result(); @} @end example @node Polynomial arithmetic, Rational expressions, Visitors and tree traversal, Methods and functions @c node-name, next, previous, up @section Polynomial arithmetic @subsection Testing whether an expression is a polynomial @cindex @code{is_polynomial()} Testing whether an expression is a polynomial in one or more variables can be done with the method @example bool ex::is_polynomial(const ex & vars) const; @end example In the case of more than one variable, the variables are given as a list. @example (x*y*sin(y)).is_polynomial(x) // Returns true. (x*y*sin(y)).is_polynomial(lst@{x,y@}) // Returns false. @end example @subsection Expanding and collecting @cindex @code{expand()} @cindex @code{collect()} @cindex @code{collect_common_factors()} A polynomial in one or more variables has many equivalent representations. Some useful ones serve a specific purpose. Consider for example the trivariate polynomial @math{4*x*y + x*z + 20*y^2 + 21*y*z + 4*z^2} (written down here in output-style). It is equivalent to the factorized polynomial @math{(x + 5*y + 4*z)*(4*y + z)}. Other representations are the recursive ones where one collects for exponents in one of the three variable. Since the factors are themselves polynomials in the remaining two variables the procedure can be repeated. In our example, two possibilities would be @math{(4*y + z)*x + 20*y^2 + 21*y*z + 4*z^2} and @math{20*y^2 + (21*z + 4*x)*y + 4*z^2 + x*z}. To bring an expression into expanded form, its method @example ex ex::expand(unsigned options = 0); @end example may be called. In our example above, this corresponds to @math{4*x*y + x*z + 20*y^2 + 21*y*z + 4*z^2}. Again, since the canonical form in GiNaC is not easy to guess you should be prepared to see different orderings of terms in such sums! Another useful representation of multivariate polynomials is as a univariate polynomial in one of the variables with the coefficients being polynomials in the remaining variables. The method @code{collect()} accomplishes this task: @example ex ex::collect(const ex & s, bool distributed = false); @end example The first argument to @code{collect()} can also be a list of objects in which case the result is either a recursively collected polynomial, or a polynomial in a distributed form with terms like @math{c*x1^e1*...*xn^en}, as specified by the @code{distributed} flag. Note that the original polynomial needs to be in expanded form (for the variables concerned) in order for @code{collect()} to be able to find the coefficients properly. The following @command{ginsh} transcript shows an application of @code{collect()} together with @code{find()}: @example > a=expand((sin(x)+sin(y))*(1+p+q)*(1+d)); d*p*sin(x)+p*sin(x)+q*d*sin(x)+q*sin(y)+d*sin(x)+q*d*sin(y)+sin(y)+d*sin(y) +q*sin(x)+d*sin(y)*p+sin(x)+sin(y)*p > collect(a,@{p,q@}); d*sin(x)+(d*sin(x)+sin(y)+d*sin(y)+sin(x))*p +(d*sin(x)+sin(y)+d*sin(y)+sin(x))*q+sin(y)+d*sin(y)+sin(x) > collect(a,find(a,sin($1))); (1+q+d+q*d+d*p+p)*sin(y)+(1+q+d+q*d+d*p+p)*sin(x) > collect(a,@{find(a,sin($1)),p,q@}); (1+(1+d)*p+d+q*(1+d))*sin(x)+(1+(1+d)*p+d+q*(1+d))*sin(y) > collect(a,@{find(a,sin($1)),d@}); (1+q+d*(1+q+p)+p)*sin(y)+(1+q+d*(1+q+p)+p)*sin(x) @end example Polynomials can often be brought into a more compact form by collecting common factors from the terms of sums. This is accomplished by the function @example ex collect_common_factors(const ex & e); @end example This function doesn't perform a full factorization but only looks for factors which are already explicitly present: @example > collect_common_factors(a*x+a*y); (x+y)*a > collect_common_factors(a*x^2+2*a*x*y+a*y^2); a*(2*x*y+y^2+x^2) > collect_common_factors(a*(b*(a+c)*x+b*((a+c)*x+(a+c)*y)*y)); (c+a)*a*(x*y+y^2+x)*b @end example @subsection Degree and coefficients @cindex @code{degree()} @cindex @code{ldegree()} @cindex @code{coeff()} The degree and low degree of a polynomial in expanded form can be obtained using the two methods @example int ex::degree(const ex & s); int ex::ldegree(const ex & s); @end example These functions even work on rational functions, returning the asymptotic degree. By definition, the degree of zero is zero. To extract a coefficient with a certain power from an expanded polynomial you use @example ex ex::coeff(const ex & s, int n); @end example You can also obtain the leading and trailing coefficients with the methods @example ex ex::lcoeff(const ex & s); ex ex::tcoeff(const ex & s); @end example which are equivalent to @code{coeff(s, degree(s))} and @code{coeff(s, ldegree(s))}, respectively. An application is illustrated in the next example, where a multivariate polynomial is analyzed: @example @{ symbol x("x"), y("y"); ex PolyInp = 4*pow(x,3)*y + 5*x*pow(y,2) + 3*y - pow(x+y,2) + 2*pow(y+2,2) - 8; ex Poly = PolyInp.expand(); for (int i=Poly.ldegree(x); i<=Poly.degree(x); ++i) @{ cout << "The x^" << i << "-coefficient is " << Poly.coeff(x,i) << endl; @} cout << "As polynomial in y: " << Poly.collect(y) << endl; @} @end example When run, it returns an output in the following fashion: @example The x^0-coefficient is y^2+11*y The x^1-coefficient is 5*y^2-2*y The x^2-coefficient is -1 The x^3-coefficient is 4*y As polynomial in y: -x^2+(5*x+1)*y^2+(-2*x+4*x^3+11)*y @end example As always, the exact output may vary between different versions of GiNaC or even from run to run since the internal canonical ordering is not within the user's sphere of influence. @code{degree()}, @code{ldegree()}, @code{coeff()}, @code{lcoeff()}, @code{tcoeff()} and @code{collect()} can also be used to a certain degree with non-polynomial expressions as they not only work with symbols but with constants, functions and indexed objects as well: @example @{ symbol a("a"), b("b"), c("c"), x("x"); idx i(symbol("i"), 3); ex e = pow(sin(x) - cos(x), 4); cout << e.degree(cos(x)) << endl; // -> 4 cout << e.expand().coeff(sin(x), 3) << endl; // -> -4*cos(x) e = indexed(a+b, i) * indexed(b+c, i); e = e.expand(expand_options::expand_indexed); cout << e.collect(indexed(b, i)) << endl; // -> a.i*c.i+(a.i+c.i)*b.i+b.i^2 @} @end example @subsection Polynomial division @cindex polynomial division @cindex quotient @cindex remainder @cindex pseudo-remainder @cindex @code{quo()} @cindex @code{rem()} @cindex @code{prem()} @cindex @code{divide()} The two functions @example ex quo(const ex & a, const ex & b, const ex & x); ex rem(const ex & a, const ex & b, const ex & x); @end example compute the quotient and remainder of univariate polynomials in the variable @samp{x}. The results satisfy @math{a = b*quo(a, b, x) + rem(a, b, x)}. The additional function @example ex prem(const ex & a, const ex & b, const ex & x); @end example computes the pseudo-remainder of @samp{a} and @samp{b} which satisfies @math{c*a = b*q + prem(a, b, x)}, where @math{c = b.lcoeff(x) ^ (a.degree(x) - b.degree(x) + 1)}. Exact division of multivariate polynomials is performed by the function @example bool divide(const ex & a, const ex & b, ex & q); @end example If @samp{b} divides @samp{a} over the rationals, this function returns @code{true} and returns the quotient in the variable @code{q}. Otherwise it returns @code{false} in which case the value of @code{q} is undefined. @subsection Unit, content and primitive part @cindex @code{unit()} @cindex @code{content()} @cindex @code{primpart()} @cindex @code{unitcontprim()} The methods @example ex ex::unit(const ex & x); ex ex::content(const ex & x); ex ex::primpart(const ex & x); ex ex::primpart(const ex & x, const ex & c); @end example return the unit part, content part, and primitive polynomial of a multivariate polynomial with respect to the variable @samp{x} (the unit part being the sign of the leading coefficient, the content part being the GCD of the coefficients, and the primitive polynomial being the input polynomial divided by the unit and content parts). The second variant of @code{primpart()} expects the previously calculated content part of the polynomial in @code{c}, which enables it to work faster in the case where the content part has already been computed. The product of unit, content, and primitive part is the original polynomial. Additionally, the method @example void ex::unitcontprim(const ex & x, ex & u, ex & c, ex & p); @end example computes the unit, content, and primitive parts in one go, returning them in @code{u}, @code{c}, and @code{p}, respectively. @subsection GCD, LCM and resultant @cindex GCD @cindex LCM @cindex @code{gcd()} @cindex @code{lcm()} The functions for polynomial greatest common divisor and least common multiple have the synopsis @example ex gcd(const ex & a, const ex & b); ex lcm(const ex & a, const ex & b); @end example The functions @code{gcd()} and @code{lcm()} accept two expressions @code{a} and @code{b} as arguments and return a new expression, their greatest common divisor or least common multiple, respectively. If the polynomials @code{a} and @code{b} are coprime @code{gcd(a,b)} returns 1 and @code{lcm(a,b)} returns the product of @code{a} and @code{b}. Note that all the coefficients must be rationals. @example #include using namespace GiNaC; int main() @{ symbol x("x"), y("y"), z("z"); ex P_a = 4*x*y + x*z + 20*pow(y, 2) + 21*y*z + 4*pow(z, 2); ex P_b = x*y + 3*x*z + 5*pow(y, 2) + 19*y*z + 12*pow(z, 2); ex P_gcd = gcd(P_a, P_b); // x + 5*y + 4*z ex P_lcm = lcm(P_a, P_b); // 4*x*y^2 + 13*y*x*z + 20*y^3 + 81*y^2*z + 67*y*z^2 + 3*x*z^2 + 12*z^3 @} @end example @cindex resultant @cindex @code{resultant()} The resultant of two expressions only makes sense with polynomials. It is always computed with respect to a specific symbol within the expressions. The function has the interface @example ex resultant(const ex & a, const ex & b, const ex & s); @end example Resultants are symmetric in @code{a} and @code{b}. The following example computes the resultant of two expressions with respect to @code{x} and @code{y}, respectively: @example #include using namespace GiNaC; int main() @{ symbol x("x"), y("y"); ex e1 = x+pow(y,2), e2 = 2*pow(x,3)-1; // x+y^2, 2*x^3-1 ex r; r = resultant(e1, e2, x); // -> 1+2*y^6 r = resultant(e1, e2, y); // -> 1-4*x^3+4*x^6 @} @end example @subsection Square-free decomposition @cindex square-free decomposition @cindex factorization @cindex @code{sqrfree()} Square-free decomposition is available in GiNaC: @example ex sqrfree(const ex & a, const lst & l = lst@{@}); @end example Here is an example that by the way illustrates how the exact form of the result may slightly depend on the order of differentiation, calling for some care with subsequent processing of the result: @example ... symbol x("x"), y("y"); ex BiVarPol = expand(pow(2-2*y,3) * pow(1+x*y,2) * pow(x-2*y,2) * (x+y)); cout << sqrfree(BiVarPol, lst@{x,y@}) << endl; // -> 8*(1-y)^3*(y*x^2-2*y+x*(1-2*y^2))^2*(y+x) cout << sqrfree(BiVarPol, lst@{y,x@}) << endl; // -> 8*(1-y)^3*(-y*x^2+2*y+x*(-1+2*y^2))^2*(y+x) cout << sqrfree(BiVarPol) << endl; // -> depending on luck, any of the above ... @end example Note also, how factors with the same exponents are not fully factorized with this method. @subsection Polynomial factorization @cindex factorization @cindex polynomial factorization @cindex @code{factor()} Polynomials can also be fully factored with a call to the function @example ex factor(const ex & a, unsigned int options = 0); @end example The factorization works for univariate and multivariate polynomials with rational coefficients. The following code snippet shows its capabilities: @example ... cout << factor(pow(x,2)-1) << endl; // -> (1+x)*(-1+x) cout << factor(expand((x-y*z)*(x-pow(y,2)-pow(z,3))*(x+y+z))) << endl; // -> (y+z+x)*(y*z-x)*(y^2-x+z^3) cout << factor(pow(x,2)-1+sin(pow(x,2)-1)) << endl; // -> -1+sin(-1+x^2)+x^2 ... @end example The results are as expected except for the last one where no factorization seems to have been done. This is due to the default option @command{factor_options::polynomial} (equals zero) to @command{factor()}, which tells GiNaC to try a factorization only if the expression is a valid polynomial. In the shown example this is not the case, because one term is a function. There exists a second option @command{factor_options::all}, which tells GiNaC to ignore non-polynomial parts of an expression and also to look inside function arguments. With this option the example gives: @example ... cout << factor(pow(x,2)-1+sin(pow(x,2)-1), factor_options::all) << endl; // -> (-1+x)*(1+x)+sin((-1+x)*(1+x)) ... @end example GiNaC's factorization functions cannot handle algebraic extensions. Therefore the following example does not factor: @example ... cout << factor(pow(x,2)-2) << endl; // -> -2+x^2 and not (x-sqrt(2))*(x+sqrt(2)) ... @end example Factorization is useful in many applications. A lot of algorithms in computer algebra depend on the ability to factor a polynomial. Of course, factorization can also be used to simplify expressions, but it is costly and applying it to complicated expressions (high degrees or many terms) may consume far too much time. So usually, looking for a GCD at strategic points in a calculation is the cheaper and more appropriate alternative. @node Rational expressions, Symbolic differentiation, Polynomial arithmetic, Methods and functions @c node-name, next, previous, up @section Rational expressions @subsection The @code{normal} method @cindex @code{normal()} @cindex simplification @cindex temporary replacement Some basic form of simplification of expressions is called for frequently. GiNaC provides the method @code{.normal()}, which converts a rational function into an equivalent rational function of the form @samp{numerator/denominator} where numerator and denominator are coprime. If the input expression is already a fraction, it just finds the GCD of numerator and denominator and cancels it, otherwise it performs fraction addition and multiplication. @code{.normal()} can also be used on expressions which are not rational functions as it will replace all non-rational objects (like functions or non-integer powers) by temporary symbols to bring the expression to the domain of rational functions before performing the normalization, and re-substituting these symbols afterwards. This algorithm is also available as a separate method @code{.to_rational()}, described below. This means that both expressions @code{t1} and @code{t2} are indeed simplified in this little code snippet: @example @{ symbol x("x"); ex t1 = (pow(x,2) + 2*x + 1)/(x + 1); ex t2 = (pow(sin(x),2) + 2*sin(x) + 1)/(sin(x) + 1); std::cout << "t1 is " << t1.normal() << std::endl; std::cout << "t2 is " << t2.normal() << std::endl; @} @end example Of course this works for multivariate polynomials too, so the ratio of the sample-polynomials from the section about GCD and LCM above would be normalized to @code{P_a/P_b} = @code{(4*y+z)/(y+3*z)}. @subsection Numerator and denominator @cindex numerator @cindex denominator @cindex @code{numer()} @cindex @code{denom()} @cindex @code{numer_denom()} The numerator and denominator of an expression can be obtained with @example ex ex::numer(); ex ex::denom(); ex ex::numer_denom(); @end example These functions will first normalize the expression as described above and then return the numerator, denominator, or both as a list, respectively. If you need both numerator and denominator, call @code{numer_denom()}: it is faster than using @code{numer()} and @code{denom()} separately. And even more important: a separate evaluation of @code{numer()} and @code{denom()} may result in a spurious sign, e.g. for $x/(x^2-1)$ @code{numer()} may return $x$ and @code{denom()} $1-x^2$. @subsection Converting to a polynomial or rational expression @cindex @code{to_polynomial()} @cindex @code{to_rational()} Some of the methods described so far only work on polynomials or rational functions. GiNaC provides a way to extend the domain of these functions to general expressions by using the temporary replacement algorithm described above. You do this by calling @example ex ex::to_polynomial(exmap & m); @end example or @example ex ex::to_rational(exmap & m); @end example on the expression to be converted. The supplied @code{exmap} will be filled with the generated temporary symbols and their replacement expressions in a format that can be used directly for the @code{subs()} method. It can also already contain a list of replacements from an earlier application of @code{.to_polynomial()} or @code{.to_rational()}, so it's possible to use it on multiple expressions and get consistent results. The difference between @code{.to_polynomial()} and @code{.to_rational()} is probably best illustrated with an example: @example @{ symbol x("x"), y("y"); ex a = 2*x/sin(x) - y/(3*sin(x)); cout << a << endl; exmap mp; ex p = a.to_polynomial(mp); cout << " = " << p << "\n with " << mp << endl; // = symbol3*symbol2*y+2*symbol2*x // with @{symbol2==sin(x)^(-1),symbol3==-1/3@} exmap mr; ex r = a.to_rational(mr); cout << " = " << r << "\n with " << mr << endl; // = -1/3*symbol4^(-1)*y+2*symbol4^(-1)*x // with @{symbol4==sin(x)@} @} @end example The following more useful example will print @samp{sin(x)-cos(x)}: @example @{ symbol x("x"); ex a = pow(sin(x), 2) - pow(cos(x), 2); ex b = sin(x) + cos(x); ex q; exmap m; divide(a.to_polynomial(m), b.to_polynomial(m), q); cout << q.subs(m) << endl; @} @end example @node Symbolic differentiation, Series expansion, Rational expressions, Methods and functions @c node-name, next, previous, up @section Symbolic differentiation @cindex differentiation @cindex @code{diff()} @cindex chain rule @cindex product rule GiNaC's objects know how to differentiate themselves. Thus, a polynomial (class @code{add}) knows that its derivative is the sum of the derivatives of all the monomials: @example @{ symbol x("x"), y("y"), z("z"); ex P = pow(x, 5) + pow(x, 2) + y; cout << P.diff(x,2) << endl; // -> 20*x^3 + 2 cout << P.diff(y) << endl; // 1 // -> 1 cout << P.diff(z) << endl; // 0 // -> 0 @} @end example If a second integer parameter @var{n} is given, the @code{diff} method returns the @var{n}th derivative. If @emph{every} object and every function is told what its derivative is, all derivatives of composed objects can be calculated using the chain rule and the product rule. Consider, for instance the expression @code{1/cosh(x)}. Since the derivative of @code{cosh(x)} is @code{sinh(x)} and the derivative of @code{pow(x,-1)} is @code{-pow(x,-2)}, GiNaC can readily compute the composition. It turns out that the composition is the generating function for Euler Numbers, i.e. the so called @var{n}th Euler number is the coefficient of @code{x^n/n!} in the expansion of @code{1/cosh(x)}. We may use this identity to code a function that generates Euler numbers in just three lines: @cindex Euler numbers @example #include using namespace GiNaC; ex EulerNumber(unsigned n) @{ symbol x; const ex generator = pow(cosh(x),-1); return generator.diff(x,n).subs(x==0); @} int main() @{ for (unsigned i=0; i<11; i+=2) std::cout << EulerNumber(i) << std::endl; return 0; @} @end example When you run it, it produces the sequence @code{1}, @code{-1}, @code{5}, @code{-61}, @code{1385}, @code{-50521}. We increment the loop variable @code{i} by two since all odd Euler numbers vanish anyways. @node Series expansion, Symmetrization, Symbolic differentiation, Methods and functions @c node-name, next, previous, up @section Series expansion @cindex @code{series()} @cindex Taylor expansion @cindex Laurent expansion @cindex @code{pseries} (class) @cindex @code{Order()} Expressions know how to expand themselves as a Taylor series or (more generally) a Laurent series. As in most conventional Computer Algebra Systems, no distinction is made between those two. There is a class of its own for storing such series (@code{class pseries}) and a built-in function (called @code{Order}) for storing the order term of the series. As a consequence, if you want to work with series, i.e. multiply two series, you need to call the method @code{ex::series} again to convert it to a series object with the usual structure (expansion plus order term). A sample application from special relativity could read: @example #include using namespace std; using namespace GiNaC; int main() @{ symbol v("v"), c("c"); ex gamma = 1/sqrt(1 - pow(v/c,2)); ex mass_nonrel = gamma.series(v==0, 10); cout << "the relativistic mass increase with v is " << endl << mass_nonrel << endl; cout << "the inverse square of this series is " << endl << pow(mass_nonrel,-2).series(v==0, 10) << endl; @} @end example Only calling the series method makes the last output simplify to @math{1-v^2/c^2+O(v^10)}, without that call we would just have a long series raised to the power @math{-2}. @cindex Machin's formula As another instructive application, let us calculate the numerical value of Archimedes' constant @tex $\pi$ @end tex @ifnottex @math{Pi} @end ifnottex (for which there already exists the built-in constant @code{Pi}) using John Machin's amazing formula @tex $\pi=16$~atan~$\!\left(1 \over 5 \right)-4$~atan~$\!\left(1 \over 239 \right)$. @end tex @ifnottex @math{Pi==16*atan(1/5)-4*atan(1/239)}. @end ifnottex This equation (and similar ones) were used for over 200 years for computing digits of pi (see @cite{Pi Unleashed}). We may expand the arcus tangent around @code{0} and insert the fractions @code{1/5} and @code{1/239}. However, as we have seen, a series in GiNaC carries an order term with it and the question arises what the system is supposed to do when the fractions are plugged into that order term. The solution is to use the function @code{series_to_poly()} to simply strip the order term off: @example #include using namespace GiNaC; ex machin_pi(int degr) @{ symbol x; ex pi_expansion = series_to_poly(atan(x).series(x,degr)); ex pi_approx = 16*pi_expansion.subs(x==numeric(1,5)) -4*pi_expansion.subs(x==numeric(1,239)); return pi_approx; @} int main() @{ using std::cout; // just for fun, another way of... using std::endl; // ...dealing with this namespace std. ex pi_frac; for (int i=2; i<12; i+=2) @{ pi_frac = machin_pi(i); cout << i << ":\t" << pi_frac << endl << "\t" << pi_frac.evalf() << endl; @} return 0; @} @end example Note how we just called @code{.series(x,degr)} instead of @code{.series(x==0,degr)}. This is a simple shortcut for @code{ex}'s method @code{series()}: if the first argument is a symbol the expression is expanded in that symbol around point @code{0}. When you run this program, it will type out: @example 2: 3804/1195 3.1832635983263598326 4: 5359397032/1706489875 3.1405970293260603143 6: 38279241713339684/12184551018734375 3.141621029325034425 8: 76528487109180192540976/24359780855939418203125 3.141591772182177295 10: 327853873402258685803048818236/104359128170408663038552734375 3.1415926824043995174 @end example @node Symmetrization, Built-in functions, Series expansion, Methods and functions @c node-name, next, previous, up @section Symmetrization @cindex @code{symmetrize()} @cindex @code{antisymmetrize()} @cindex @code{symmetrize_cyclic()} The three methods @example ex ex::symmetrize(const lst & l); ex ex::antisymmetrize(const lst & l); ex ex::symmetrize_cyclic(const lst & l); @end example symmetrize an expression by returning the sum over all symmetric, antisymmetric or cyclic permutations of the specified list of objects, weighted by the number of permutations. The three additional methods @example ex ex::symmetrize(); ex ex::antisymmetrize(); ex ex::symmetrize_cyclic(); @end example symmetrize or antisymmetrize an expression over its free indices. Symmetrization is most useful with indexed expressions but can be used with almost any kind of object (anything that is @code{subs()}able): @example @{ idx i(symbol("i"), 3), j(symbol("j"), 3), k(symbol("k"), 3); symbol A("A"), B("B"), a("a"), b("b"), c("c"); cout << ex(indexed(A, i, j)).symmetrize() << endl; // -> 1/2*A.j.i+1/2*A.i.j cout << ex(indexed(A, i, j, k)).antisymmetrize(lst@{i, j@}) << endl; // -> -1/2*A.j.i.k+1/2*A.i.j.k cout << ex(lst@{a, b, c@}).symmetrize_cyclic(lst@{a, b, c@}) << endl; // -> 1/3*@{a,b,c@}+1/3*@{b,c,a@}+1/3*@{c,a,b@} @} @end example @page @node Built-in functions, Multiple polylogarithms, Symmetrization, Methods and functions @c node-name, next, previous, up @section Predefined mathematical functions @c @subsection Overview GiNaC contains the following predefined mathematical functions: @cartouche @multitable @columnfractions .30 .70 @item @strong{Name} @tab @strong{Function} @item @code{abs(x)} @tab absolute value @cindex @code{abs()} @item @code{step(x)} @tab step function @cindex @code{step()} @item @code{csgn(x)} @tab complex sign @cindex @code{conjugate()} @item @code{conjugate(x)} @tab complex conjugation @cindex @code{real_part()} @item @code{real_part(x)} @tab real part @cindex @code{imag_part()} @item @code{imag_part(x)} @tab imaginary part @item @code{sqrt(x)} @tab square root (not a GiNaC function, rather an alias for @code{pow(x, numeric(1, 2))}) @cindex @code{sqrt()} @item @code{sin(x)} @tab sine @cindex @code{sin()} @item @code{cos(x)} @tab cosine @cindex @code{cos()} @item @code{tan(x)} @tab tangent @cindex @code{tan()} @item @code{asin(x)} @tab inverse sine @cindex @code{asin()} @item @code{acos(x)} @tab inverse cosine @cindex @code{acos()} @item @code{atan(x)} @tab inverse tangent @cindex @code{atan()} @item @code{atan2(y, x)} @tab inverse tangent with two arguments @item @code{sinh(x)} @tab hyperbolic sine @cindex @code{sinh()} @item @code{cosh(x)} @tab hyperbolic cosine @cindex @code{cosh()} @item @code{tanh(x)} @tab hyperbolic tangent @cindex @code{tanh()} @item @code{asinh(x)} @tab inverse hyperbolic sine @cindex @code{asinh()} @item @code{acosh(x)} @tab inverse hyperbolic cosine @cindex @code{acosh()} @item @code{atanh(x)} @tab inverse hyperbolic tangent @cindex @code{atanh()} @item @code{exp(x)} @tab exponential function @cindex @code{exp()} @item @code{log(x)} @tab natural logarithm @cindex @code{log()} @item @code{eta(x,y)} @tab Eta function: @code{eta(x,y) = log(x*y) - log(x) - log(y)} @cindex @code{eta()} @item @code{Li2(x)} @tab dilogarithm @cindex @code{Li2()} @item @code{Li(m, x)} @tab classical polylogarithm as well as multiple polylogarithm @cindex @code{Li()} @item @code{G(a, y)} @tab multiple polylogarithm @cindex @code{G()} @item @code{G(a, s, y)} @tab multiple polylogarithm with explicit signs for the imaginary parts @cindex @code{G()} @item @code{S(n, p, x)} @tab Nielsen's generalized polylogarithm @cindex @code{S()} @item @code{H(m, x)} @tab harmonic polylogarithm @cindex @code{H()} @item @code{zeta(m)} @tab Riemann's zeta function as well as multiple zeta value @cindex @code{zeta()} @item @code{zeta(m, s)} @tab alternating Euler sum @cindex @code{zeta()} @item @code{zetaderiv(n, x)} @tab derivatives of Riemann's zeta function @item @code{tgamma(x)} @tab gamma function @cindex @code{tgamma()} @cindex gamma function @item @code{lgamma(x)} @tab logarithm of gamma function @cindex @code{lgamma()} @item @code{beta(x, y)} @tab beta function (@code{tgamma(x)*tgamma(y)/tgamma(x+y)}) @cindex @code{beta()} @item @code{psi(x)} @tab psi (digamma) function @cindex @code{psi()} @item @code{psi(n, x)} @tab derivatives of psi function (polygamma functions) @item @code{factorial(n)} @tab factorial function @math{n!} @cindex @code{factorial()} @item @code{binomial(n, k)} @tab binomial coefficients @cindex @code{binomial()} @item @code{Order(x)} @tab order term function in truncated power series @cindex @code{Order()} @end multitable @end cartouche @cindex branch cut For functions that have a branch cut in the complex plane, GiNaC follows the conventions of C/C++ for systems that do not support a signed zero. In particular: the natural logarithm (@code{log}) and the square root (@code{sqrt}) both have their branch cuts running along the negative real axis. The @code{asin}, @code{acos}, and @code{atanh} functions all have two branch cuts starting at +/-1 and running away towards infinity along the real axis. The @code{atan} and @code{asinh} functions have two branch cuts starting at +/-i and running away towards infinity along the imaginary axis. The @code{acosh} function has one branch cut starting at +1 and running towards -infinity. These functions are continuous as the branch cut is approached coming around the finite endpoint of the cut in a counter clockwise direction. @c @subsection Expanding functions @cindex expand trancedent functions @cindex @code{expand_options::expand_transcendental} @cindex @code{expand_options::expand_function_args} GiNaC knows several expansion laws for trancedent functions, e.g. @tex $e^{a+b}=e^a e^b$, $|zw|=|z|\cdot |w|$ @end tex @ifnottex @command{exp(a+b)=exp(a) exp(b), |zw|=|z| |w|} @end ifnottex or @tex $\log(c*d)=\log(c)+\log(d)$, @end tex @ifnottex @command{log(cd)=log(c)+log(d)} @end ifnottex (for positive @tex $c,\ d$ @end tex @ifnottex @command{c, d} @end ifnottex ). In order to use these rules you need to call @code{expand()} method with the option @code{expand_options::expand_transcendental}. Another relevant option is @code{expand_options::expand_function_args}. Their usage and interaction can be seen from the following example: @example @{ symbol x("x"), y("y"); ex e=exp(pow(x+y,2)); cout << e.expand() << endl; // -> exp((x+y)^2) cout << e.expand(expand_options::expand_transcendental) << endl; // -> exp((x+y)^2) cout << e.expand(expand_options::expand_function_args) << endl; // -> exp(2*x*y+x^2+y^2) cout << e.expand(expand_options::expand_function_args | expand_options::expand_transcendental) << endl; // -> exp(y^2)*exp(2*x*y)*exp(x^2) @} @end example If both flags are set (as in the last call), then GiNaC tries to get the maximal expansion. For example, for the exponent GiNaC firstly expands the argument and then the function. For the logarithm and absolute value, GiNaC uses the opposite order: firstly expands the function and then its argument. Of course, a user can fine-tune this behavior by sequential calls of several @code{expand()} methods with desired flags. @node Multiple polylogarithms, Complex expressions, Built-in functions, Methods and functions @c node-name, next, previous, up @subsection Multiple polylogarithms @cindex polylogarithm @cindex Nielsen's generalized polylogarithm @cindex harmonic polylogarithm @cindex multiple zeta value @cindex alternating Euler sum @cindex multiple polylogarithm The multiple polylogarithm is the most generic member of a family of functions, to which others like the harmonic polylogarithm, Nielsen's generalized polylogarithm and the multiple zeta value belong. Everyone of these functions can also be written as a multiple polylogarithm with specific parameters. This whole family of functions is therefore often referred to simply as multiple polylogarithms, containing @code{Li}, @code{G}, @code{H}, @code{S} and @code{zeta}. The multiple polylogarithm itself comes in two variants: @code{Li} and @code{G}. While @code{Li} and @code{G} in principle represent the same function, the different notations are more natural to the series representation or the integral representation, respectively. To facilitate the discussion of these functions we distinguish between indices and arguments as parameters. In the table above indices are printed as @code{m}, @code{s}, @code{n} or @code{p}, whereas arguments are printed as @code{x}, @code{a} and @code{y}. To define a @code{Li}, @code{H} or @code{zeta} with a depth greater than one, you have to pass a GiNaC @code{lst} for the indices @code{m} and @code{s}, and in the case of @code{Li} for the argument @code{x} as well. The parameter @code{a} of @code{G} must always be a @code{lst} containing the arguments in expanded form. If @code{G} is used with a third parameter @code{s}, @code{s} must have the same length as @code{a}. It contains then the signs of the imaginary parts of the arguments. If @code{s} is not given, the signs default to +1. Note that @code{Li} and @code{zeta} are polymorphic in this respect. They can stand in for the classical polylogarithm and Riemann's zeta function (if depth is one), as well as for the multiple polylogarithm and the multiple zeta value, respectively. Note also, that GiNaC doesn't check whether the @code{lst}s for two parameters do have the same length. It is up to the user to ensure this, otherwise evaluating will result in undefined behavior. The functions print in LaTeX format as @tex ${\rm Li\;\!}_{m_1,m_2,\ldots,m_k}(x_1,x_2,\ldots,x_k)$, @end tex @tex ${\rm S}_{n,p}(x)$, @end tex @tex ${\rm H\;\!}_{m_1,m_2,\ldots,m_k}(x)$ and @end tex @tex $\zeta(m_1,m_2,\ldots,m_k)$. @end tex @ifnottex @command{\mbox@{Li@}_@{m_1,m_2,...,m_k@}(x_1,x_2,...,x_k)}, @command{\mbox@{S@}_@{n,p@}(x)}, @command{\mbox@{H@}_@{m_1,m_2,...,m_k@}(x)} and @command{\zeta(m_1,m_2,...,m_k)} (with the dots replaced by actual parameters). @end ifnottex If @code{zeta} is an alternating zeta sum, i.e. @code{zeta(m,s)}, the indices with negative sign are printed with a line above, e.g. @tex $\zeta(5,\overline{2})$. @end tex @ifnottex @command{\zeta(5,\overline@{2@})}. @end ifnottex The order of indices and arguments in the GiNaC @code{lst}s and in the output is the same. Definitions and analytical as well as numerical properties of multiple polylogarithms are too numerous to be covered here. Instead, the user is referred to the publications listed at the end of this section. The implementation in GiNaC adheres to the definitions and conventions therein, except for a few differences which will be explicitly stated in the following. One difference is about the order of the indices and arguments. For GiNaC we adopt the convention that the indices and arguments are understood to be in the same order as in which they appear in the series representation. This means @tex ${\rm Li\;\!}_{m_1,m_2,m_3}(x,1,1) = {\rm H\;\!}_{m_1,m_2,m_3}(x)$ and @end tex @tex ${\rm Li\;\!}_{2,1}(1,1) = \zeta(2,1) = \zeta(3)$, but @end tex @tex $\zeta(1,2)$ evaluates to infinity. @end tex @ifnottex @code{Li_@{m_1,m_2,m_3@}(x,1,1) = H_@{m_1,m_2,m_3@}(x)} and @code{Li_@{2,1@}(1,1) = zeta(2,1) = zeta(3)}, but @code{zeta(1,2)} evaluates to infinity. @end ifnottex So in comparison to the older ones of the referenced publications the order of indices and arguments for @code{Li} is reversed. The functions only evaluate if the indices are integers greater than zero, except for the indices @code{s} in @code{zeta} and @code{G} as well as @code{m} in @code{H}. Since @code{s} will be interpreted as the sequence of signs for the corresponding indices @code{m} or the sign of the imaginary part for the corresponding arguments @code{a}, it must contain 1 or -1, e.g. @code{zeta(lst@{3,4@}, lst@{-1,1@})} means @tex $\zeta(\overline{3},4)$ @end tex @ifnottex @command{zeta(\overline@{3@},4)} @end ifnottex and @code{G(lst@{a,b@}, lst@{-1,1@}, c)} means @tex $G(a-0\epsilon,b+0\epsilon;c)$. @end tex @ifnottex @command{G(a-0\epsilon,b+0\epsilon;c)}. @end ifnottex The definition of @code{H} allows indices to be 0, 1 or -1 (in expanded notation) or equally to be any integer (in compact notation). With GiNaC expanded and compact notation can be mixed, e.g. @code{lst@{0,0,-1,0,1,0,0@}}, @code{lst@{0,0,-1,2,0,0@}} and @code{lst@{-3,2,0,0@}} are equivalent as indices. The anonymous evaluator @code{eval()} tries to reduce the functions, if possible, to the least-generic multiple polylogarithm. If all arguments are unit, it returns @code{zeta}. Arguments equal to zero get considered, too. Riemann's zeta function @code{zeta} (with depth one) evaluates also for negative integers and positive even integers. For example: @example > Li(@{3,1@},@{x,1@}); S(2,2,x) > H(@{-3,2@},1); -zeta(@{3,2@},@{-1,-1@}) > S(3,1,1); 1/90*Pi^4 @end example It is easy to tell for a given function into which other function it can be rewritten, may it be a less-generic or a more-generic one, except for harmonic polylogarithms @code{H} with negative indices or trailing zeros (the example above gives a hint). Signs can quickly be messed up, for example. Therefore GiNaC offers a C++ function @code{convert_H_to_Li()} to deal with the upgrade of a @code{H} to a multiple polylogarithm @code{Li} (@code{eval()} already cares for the possible downgrade): @example > convert_H_to_Li(@{0,-2,-1,3@},x); Li(@{3,1,3@},@{-x,1,-1@}) > convert_H_to_Li(@{2,-1,0@},x); -Li(@{2,1@},@{x,-1@})*log(x)+2*Li(@{3,1@},@{x,-1@})+Li(@{2,2@},@{x,-1@}) @end example Every function can be numerically evaluated for arbitrary real or complex arguments. The precision is arbitrary and can be set through the global variable @code{Digits}: @example > Digits=100; 100 > evalf(zeta(@{3,1,3,1@})); 0.005229569563530960100930652283899231589890420784634635522547448972148869544... @end example Note that the convention for arguments on the branch cut in GiNaC as stated above is different from the one Remiddi and Vermaseren have chosen for the harmonic polylogarithm. If a function evaluates to infinity, no exceptions are raised, but the function is returned unevaluated, e.g. @tex $\zeta(1)$. @end tex @ifnottex @command{zeta(1)}. @end ifnottex In long expressions this helps a lot with debugging, because you can easily spot the divergencies. But on the other hand, you have to make sure for yourself, that no illegal cancellations of divergencies happen. Useful publications: @cite{Nested Sums, Expansion of Transcendental Functions and Multi-Scale Multi-Loop Integrals}, S.Moch, P.Uwer, S.Weinzierl, hep-ph/0110083 @cite{Harmonic Polylogarithms}, E.Remiddi, J.A.M.Vermaseren, Int.J.Mod.Phys. A15 (2000), pp. 725-754 @cite{Special Values of Multiple Polylogarithms}, J.Borwein, D.Bradley, D.Broadhurst, P.Lisonek, Trans.Amer.Math.Soc. 353/3 (2001), pp. 907-941 @cite{Numerical Evaluation of Multiple Polylogarithms}, J.Vollinga, S.Weinzierl, hep-ph/0410259 @node Complex expressions, Solving linear systems of equations, Multiple polylogarithms, Methods and functions @c node-name, next, previous, up @section Complex expressions @c @cindex @code{conjugate()} For dealing with complex expressions there are the methods @example ex ex::conjugate(); ex ex::real_part(); ex ex::imag_part(); @end example that return respectively the complex conjugate, the real part and the imaginary part of an expression. Complex conjugation works as expected for all built-in functions and objects. Taking real and imaginary parts has not yet been implemented for all built-in functions. In cases where it is not known how to conjugate or take a real/imaginary part one of the functions @code{conjugate}, @code{real_part} or @code{imag_part} is returned. For instance, in case of a complex symbol @code{x} (symbols are complex by default), one could not simplify @code{conjugate(x)}. In the case of strings of gamma matrices, the @code{conjugate} method takes the Dirac conjugate. For example, @example @{ varidx a(symbol("a"), 4), b(symbol("b"), 4); symbol x("x"); realsymbol y("y"); cout << (3*I*x*y + sin(2*Pi*I*y)).conjugate() << endl; // -> -3*I*conjugate(x)*y+sin(-2*I*Pi*y) cout << (dirac_gamma(a)*dirac_gamma(b)*dirac_gamma5()).conjugate() << endl; // -> -gamma5*gamma~b*gamma~a @} @end example If you declare your own GiNaC functions and you want to conjugate them, you will have to supply a specialized conjugation method for them (see @ref{Symbolic functions} and the GiNaC source-code for @code{abs} as an example). GiNaC does not automatically conjugate user-supplied functions by conjugating their arguments because this would be incorrect on branch cuts. Also, specialized methods can be provided to take real and imaginary parts of user-defined functions. @node Solving linear systems of equations, Input/output, Complex expressions, Methods and functions @c node-name, next, previous, up @section Solving linear systems of equations @cindex @code{lsolve()} The function @code{lsolve()} provides a convenient wrapper around some matrix operations that comes in handy when a system of linear equations needs to be solved: @example ex lsolve(const ex & eqns, const ex & symbols, unsigned options = solve_algo::automatic); @end example Here, @code{eqns} is a @code{lst} of equalities (i.e. class @code{relational}) while @code{symbols} is a @code{lst} of indeterminates. (@xref{The class hierarchy}, for an exposition of class @code{lst}). It returns the @code{lst} of solutions as an expression. As an example, let us solve the two equations @code{a*x+b*y==3} and @code{x-y==b}: @example @{ symbol a("a"), b("b"), x("x"), y("y"); lst eqns = @{a*x+b*y==3, x-y==b@}; lst vars = @{x, y@}; cout << lsolve(eqns, vars) << endl; // -> @{x==(3+b^2)/(b+a),y==(3-b*a)/(b+a)@} @end example When the linear equations @code{eqns} are underdetermined, the solution will contain one or more tautological entries like @code{x==x}, depending on the rank of the system. When they are overdetermined, the solution will be an empty @code{lst}. Note the third optional parameter to @code{lsolve()}: it accepts the same parameters as @code{matrix::solve()}. This is because @code{lsolve} is just a wrapper around that method. @node Input/output, Extending GiNaC, Solving linear systems of equations, Methods and functions @c node-name, next, previous, up @section Input and output of expressions @cindex I/O @subsection Expression output @cindex printing @cindex output of expressions Expressions can simply be written to any stream: @example @{ symbol x("x"); ex e = 4.5*I+pow(x,2)*3/2; cout << e << endl; // prints '4.5*I+3/2*x^2' // ... @end example The default output format is identical to the @command{ginsh} input syntax and to that used by most computer algebra systems, but not directly pastable into a GiNaC C++ program (note that in the above example, @code{pow(x,2)} is printed as @samp{x^2}). It is possible to print expressions in a number of different formats with a set of stream manipulators; @example std::ostream & dflt(std::ostream & os); std::ostream & latex(std::ostream & os); std::ostream & tree(std::ostream & os); std::ostream & csrc(std::ostream & os); std::ostream & csrc_float(std::ostream & os); std::ostream & csrc_double(std::ostream & os); std::ostream & csrc_cl_N(std::ostream & os); std::ostream & index_dimensions(std::ostream & os); std::ostream & no_index_dimensions(std::ostream & os); @end example The @code{tree}, @code{latex} and @code{csrc} formats are also available in @command{ginsh} via the @code{print()}, @code{print_latex()} and @code{print_csrc()} functions, respectively. @cindex @code{dflt} All manipulators affect the stream state permanently. To reset the output format to the default, use the @code{dflt} manipulator: @example // ... cout << latex; // all output to cout will be in LaTeX format from // now on cout << e << endl; // prints '4.5 i+\frac@{3@}@{2@} x^@{2@}' cout << sin(x/2) << endl; // prints '\sin(\frac@{1@}@{2@} x)' cout << dflt; // revert to default output format cout << e << endl; // prints '4.5*I+3/2*x^2' // ... @end example If you don't want to affect the format of the stream you're working with, you can output to a temporary @code{ostringstream} like this: @example // ... ostringstream s; s << latex << e; // format of cout remains unchanged cout << s.str() << endl; // prints '4.5 i+\frac@{3@}@{2@} x^@{2@}' // ... @end example @anchor{csrc printing} @cindex @code{csrc} @cindex @code{csrc_float} @cindex @code{csrc_double} @cindex @code{csrc_cl_N} The @code{csrc} (an alias for @code{csrc_double}), @code{csrc_float}, @code{csrc_double} and @code{csrc_cl_N} manipulators set the output to a format that can be directly used in a C or C++ program. The three possible formats select the data types used for numbers (@code{csrc_cl_N} uses the classes provided by the CLN library): @example // ... cout << "f = " << csrc_float << e << ";\n"; cout << "d = " << csrc_double << e << ";\n"; cout << "n = " << csrc_cl_N << e << ";\n"; // ... @end example The above example will produce (note the @code{x^2} being converted to @code{x*x}): @example f = (3.0/2.0)*(x*x)+std::complex(0.0,4.5000000e+00); d = (3.0/2.0)*(x*x)+std::complex(0.0,4.5000000000000000e+00); n = cln::cl_RA("3/2")*(x*x)+cln::complex(cln::cl_I("0"),cln::cl_F("4.5_17")); @end example @cindex @code{tree} The @code{tree} manipulator allows dumping the internal structure of an expression for debugging purposes: @example // ... cout << tree << e; @} @end example produces @example add, hash=0x0, flags=0x3, nops=2 power, hash=0x0, flags=0x3, nops=2 x (symbol), serial=0, hash=0xc8d5bcdd, flags=0xf 2 (numeric), hash=0x6526b0fa, flags=0xf 3/2 (numeric), hash=0xf9828fbd, flags=0xf ----- overall_coeff 4.5L0i (numeric), hash=0xa40a97e0, flags=0xf ===== @end example @cindex @code{latex} The @code{latex} output format is for LaTeX parsing in mathematical mode. It is rather similar to the default format but provides some braces needed by LaTeX for delimiting boxes and also converts some common objects to conventional LaTeX names. It is possible to give symbols a special name for LaTeX output by supplying it as a second argument to the @code{symbol} constructor. For example, the code snippet @example @{ symbol x("x", "\\circ"); ex e = lgamma(x).series(x==0,3); cout << latex << e << endl; @} @end example will print @example @{(-\ln(\circ))@}+@{(-\gamma_E)@} \circ+@{(\frac@{1@}@{12@} \pi^@{2@})@} \circ^@{2@} +\mathcal@{O@}(\circ^@{3@}) @end example @cindex @code{index_dimensions} @cindex @code{no_index_dimensions} Index dimensions are normally hidden in the output. To make them visible, use the @code{index_dimensions} manipulator. The dimensions will be written in square brackets behind each index value in the default and LaTeX output formats: @example @{ symbol x("x"), y("y"); varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4); ex e = indexed(x, mu) * indexed(y, nu); cout << e << endl; // prints 'x~mu*y~nu' cout << index_dimensions << e << endl; // prints 'x~mu[4]*y~nu[4]' cout << no_index_dimensions << e << endl; // prints 'x~mu*y~nu' @} @end example @cindex Tree traversal If you need any fancy special output format, e.g. for interfacing GiNaC with other algebra systems or for producing code for different programming languages, you can always traverse the expression tree yourself: @example static void my_print(const ex & e) @{ if (is_a(e)) cout << ex_to(e).get_name(); else cout << ex_to(e).class_name(); cout << "("; size_t n = e.nops(); if (n) for (size_t i=0; i>} stream input operator. Instead, GiNaC lets you read an expression from a stream or a string, specifying the mapping between the input strings and symbols to be used: @example @{ symbol x, y; symtab table; table["x"] = x; table["y"] = y; parser reader(table); ex e = reader("2*x+sin(y)"); @} @end example The input syntax is the same as that used by @command{ginsh} and the stream output operator @code{<<}. Matching between the input strings and expressions is given by @samp{table}. The @samp{table} in this example instructs GiNaC to substitute any input substring ``x'' with symbol @code{x}. Likewise, the substring ``y'' will be replaced with symbol @code{y}. It's also possible to map input (sub)strings to arbitrary expressions: @example @{ symbol x, y; symtab table; table["x"] = x+log(y)+1; parser reader(table); ex e = reader("5*x^3 - x^2"); // e = 5*(x+log(y)+1)^3 - (x+log(y)+1)^2 @} @end example If no mapping is specified for a particular string GiNaC will create a symbol with corresponding name. Later on you can obtain all parser generated symbols with @code{get_syms()} method: @example @{ parser reader; ex e = reader("2*x+sin(y)"); symtab table = reader.get_syms(); symbol x = ex_to(table["x"]); symbol y = ex_to(table["y"]); @} @end example Sometimes you might want to prevent GiNaC from inserting these extra symbols (for example, you want treat an unexpected string in the input as an error). @example @{ symtab table; table["x"] = symbol(); parser reader(table); parser.strict = true; ex e; try @{ e = reader("2*x+sin(y)"); @} catch (parse_error& err) @{ cerr << err.what() << endl; // prints "unknown symbol "y" in the input" @} @} @end example With this parser, it's also easy to implement interactive GiNaC programs. When running the following program interactively, remember to send an EOF marker after the input, e.g. by pressing Ctrl-D on an empty line: @example #include #include #include #include using namespace std; using namespace GiNaC; int main() @{ cout << "Enter an expression containing 'x': " << flush; parser reader; try @{ ex e = reader(cin); symtab table = reader.get_syms(); symbol x = table.find("x") != table.end() ? ex_to(table["x"]) : symbol("x"); cout << "The derivative of " << e << " with respect to x is "; cout << e.diff(x) << "." << endl; @} catch (exception &p) @{ cerr << p.what() << endl; @} @} @end example @subsection Compiling expressions to C function pointers @cindex compiling expressions Numerical evaluation of algebraic expressions is seamlessly integrated into GiNaC by help of the CLN library. While CLN allows for very fast arbitrary precision numerics, which is more than sufficient for most users, sometimes only the speed of built-in floating point numbers is fast enough, e.g. for Monte Carlo integration. The only viable option then is the following: print the expression in C syntax format, manually add necessary C code, compile that program and run is as a separate application. This is not only cumbersome and involves a lot of manual intervention, but it also separates the algebraic and the numerical evaluation into different execution stages. GiNaC offers a couple of functions that help to avoid these inconveniences and problems. The functions automatically perform the printing of a GiNaC expression and the subsequent compiling of its associated C code. The created object code is then dynamically linked to the currently running program. A function pointer to the C function that performs the numerical evaluation is returned and can be used instantly. This all happens automatically, no user intervention is needed. The following example demonstrates the use of @code{compile_ex}: @example // ... symbol x("x"); ex myexpr = sin(x) / x; FUNCP_1P fp; compile_ex(myexpr, x, fp); cout << fp(3.2) << endl; // ... @end example The function @code{compile_ex} is called with the expression to be compiled and its only free variable @code{x}. Upon successful completion the third parameter contains a valid function pointer to the corresponding C code module. If called like in the last line only built-in double precision numerics is involved. @cindex FUNCP_1P @cindex FUNCP_2P @cindex FUNCP_CUBA The function pointer has to be defined in advance. GiNaC offers three function pointer types at the moment: @example typedef double (*FUNCP_1P) (double); typedef double (*FUNCP_2P) (double, double); typedef void (*FUNCP_CUBA) (const int*, const double[], const int*, double[]); @end example @cindex CUBA library @cindex Monte Carlo integration @code{FUNCP_2P} allows for two variables in the expression. @code{FUNCP_CUBA} is the correct type to be used with the CUBA library (@uref{http://www.feynarts.de/cuba}) for numerical integrations. The details for the parameters of @code{FUNCP_CUBA} are explained in the CUBA manual. @cindex compile_ex For every function pointer type there is a matching @code{compile_ex} available: @example void compile_ex(const ex& expr, const symbol& sym, FUNCP_1P& fp, const std::string filename = ""); void compile_ex(const ex& expr, const symbol& sym1, const symbol& sym2, FUNCP_2P& fp, const std::string filename = ""); void compile_ex(const lst& exprs, const lst& syms, FUNCP_CUBA& fp, const std::string filename = ""); @end example When the last parameter @code{filename} is not supplied, @code{compile_ex} will choose a unique random name for the intermediate source and object files it produces. On program termination these files will be deleted. If one wishes to keep the C code and the object files, one can supply the @code{filename} parameter. The intermediate files will use that filename and will not be deleted. @cindex link_ex @code{link_ex} is a function that allows to dynamically link an existing object file and to make it available via a function pointer. This is useful if you have already used @code{compile_ex} on an expression and want to avoid the compilation step to be performed over and over again when you restart your program. The precondition for this is of course, that you have chosen a filename when you did call @code{compile_ex}. For every above mentioned function pointer type there exists a corresponding @code{link_ex} function: @example void link_ex(const std::string filename, FUNCP_1P& fp); void link_ex(const std::string filename, FUNCP_2P& fp); void link_ex(const std::string filename, FUNCP_CUBA& fp); @end example The complete filename (including the suffix @code{.so}) of the object file has to be supplied. The function @cindex unlink_ex @example void unlink_ex(const std::string filename); @end example is supplied for the rare cases when one wishes to close the dynamically linked object files directly and have the intermediate files (only if filename has not been given) deleted. Normally one doesn't need this function, because all the clean-up will be done automatically upon (regular) program termination. All the described functions will throw an exception in case they cannot perform correctly, like for example when writing the file or starting the compiler fails. Since internally the same printing methods as described in section @ref{csrc printing} are used, only functions and objects that are available in standard C will compile successfully (that excludes polylogarithms for example at the moment). Another precondition for success is, of course, that it must be possible to evaluate the expression numerically. No free variables despite the ones supplied to @code{compile_ex} should appear in the expression. @cindex ginac-excompiler @code{compile_ex} uses the shell script @code{ginac-excompiler} to start the C compiler and produce the object files. This shell script comes with GiNaC and will be installed together with GiNaC in the configured @code{$LIBEXECDIR} (typically @code{$PREFIX/libexec} or @code{$PREFIX/lib/ginac}). You can also export additional compiler flags via the @env{$CXXFLAGS} variable: @example setenv("CXXFLAGS", "-O3 -fomit-frame-pointer -ffast-math", 1); compile_ex(...); @end example @subsection Archiving @cindex @code{archive} (class) @cindex archiving GiNaC allows creating @dfn{archives} of expressions which can be stored to or retrieved from files. To create an archive, you declare an object of class @code{archive} and archive expressions in it, giving each expression a unique name: @example #include using namespace std; #include using namespace GiNaC; int main() @{ symbol x("x"), y("y"), z("z"); ex foo = sin(x + 2*y) + 3*z + 41; ex bar = foo + 1; archive a; a.archive_ex(foo, "foo"); a.archive_ex(bar, "the second one"); // ... @end example The archive can then be written to a file: @example // ... ofstream out("foobar.gar", ios::binary); out << a; out.close(); // ... @end example The file @file{foobar.gar} contains all information that is needed to reconstruct the expressions @code{foo} and @code{bar}. The flag @code{ios::binary} prevents locales setting of your OS tampers the archive file structure. @cindex @command{viewgar} The tool @command{viewgar} that comes with GiNaC can be used to view the contents of GiNaC archive files: @example $ viewgar foobar.gar foo = 41+sin(x+2*y)+3*z the second one = 42+sin(x+2*y)+3*z @end example The point of writing archive files is of course that they can later be read in again: @example // ... archive a2; ifstream in("foobar.gar", ios::binary); in >> a2; // ... @end example And the stored expressions can be retrieved by their name: @example // ... lst syms = @{x, y@}; ex ex1 = a2.unarchive_ex(syms, "foo"); ex ex2 = a2.unarchive_ex(syms, "the second one"); cout << ex1 << endl; // prints "41+sin(x+2*y)+3*z" cout << ex2 << endl; // prints "42+sin(x+2*y)+3*z" cout << ex1.subs(x == 2) << endl; // prints "41+sin(2+2*y)+3*z" @} @end example Note that you have to supply a list of the symbols which are to be inserted in the expressions. Symbols in archives are stored by their name only and if you don't specify which symbols you have, unarchiving the expression will create new symbols with that name. E.g. if you hadn't included @code{x} in the @code{syms} list above, the @code{ex1.subs(x == 2)} statement would have had no effect because the @code{x} in @code{ex1} would have been a different symbol than the @code{x} which was defined at the beginning of the program, although both would appear as @samp{x} when printed. You can also use the information stored in an @code{archive} object to output expressions in a format suitable for exact reconstruction. The @code{archive} and @code{archive_node} classes have a couple of member functions that let you access the stored properties: @example static void my_print2(const archive_node & n) @{ string class_name; n.find_string("class", class_name); cout << class_name << "("; archive_node::propinfovector p; n.get_properties(p); size_t num = p.size(); for (size_t i=0; i 1) cout << "@}"; if (i != num-1) cout << ","; @} cout << ")"; @} int main() @{ ex e = pow(2, x) - y; archive ar(e, "e"); my_print2(ar.get_top_node(0)); cout << endl; return 0; @} @end example This will produce: @example add(rest=@{power(basis=numeric(number="2"),exponent=symbol(name="x")), symbol(name="y")@},coeff=@{numeric(number="1"),numeric(number="-1")@}, overall_coeff=numeric(number="0")) @end example Be warned, however, that the set of properties and their meaning for each class may change between GiNaC versions. @node Extending GiNaC, What does not belong into GiNaC, Input/output, Top @c node-name, next, previous, up @chapter Extending GiNaC By reading so far you should have gotten a fairly good understanding of GiNaC's design patterns. From here on you should start reading the sources. All we can do now is issue some recommendations how to tackle GiNaC's many loose ends in order to fulfill everybody's dreams. If you develop some useful extension please don't hesitate to contact the GiNaC authors---they will happily incorporate them into future versions. @menu * What does not belong into GiNaC:: What to avoid. * Symbolic functions:: Implementing symbolic functions. * Printing:: Adding new output formats. * Structures:: Defining new algebraic classes (the easy way). * Adding classes:: Defining new algebraic classes (the hard way). @end menu @node What does not belong into GiNaC, Symbolic functions, Extending GiNaC, Extending GiNaC @c node-name, next, previous, up @section What doesn't belong into GiNaC @cindex @command{ginsh} First of all, GiNaC's name must be read literally. It is designed to be a library for use within C++. The tiny @command{ginsh} accompanying GiNaC makes this even more clear: it doesn't even attempt to provide a language. There are no loops or conditional expressions in @command{ginsh}, it is merely a window into the library for the programmer to test stuff (or to show off). Still, the design of a complete CAS with a language of its own, graphical capabilities and all this on top of GiNaC is possible and is without doubt a nice project for the future. There are many built-in functions in GiNaC that do not know how to evaluate themselves numerically to a precision declared at runtime (using @code{Digits}). Some may be evaluated at certain points, but not generally. This ought to be fixed. However, doing numerical computations with GiNaC's quite abstract classes is doomed to be inefficient. For this purpose, the underlying foundation classes provided by CLN are much better suited. @node Symbolic functions, Printing, What does not belong into GiNaC, Extending GiNaC @c node-name, next, previous, up @section Symbolic functions The easiest and most instructive way to start extending GiNaC is probably to create your own symbolic functions. These are implemented with the help of two preprocessor macros: @cindex @code{DECLARE_FUNCTION} @cindex @code{REGISTER_FUNCTION} @example DECLARE_FUNCTION_P() REGISTER_FUNCTION(, ) @end example The @code{DECLARE_FUNCTION} macro will usually appear in a header file. It declares a C++ function with the given @samp{name} that takes exactly @samp{n} parameters of type @code{ex} and returns a newly constructed GiNaC @code{function} object that represents your function. The @code{REGISTER_FUNCTION} macro implements the function. It must be passed the same @samp{name} as the respective @code{DECLARE_FUNCTION} macro, and a set of options that associate the symbolic function with C++ functions you provide to implement the various methods such as evaluation, derivative, series expansion etc. They also describe additional attributes the function might have, such as symmetry and commutation properties, and a name for LaTeX output. Multiple options are separated by the member access operator @samp{.} and can be given in an arbitrary order. (By the way: in case you are worrying about all the macros above we can assure you that functions are GiNaC's most macro-intense classes. We have done our best to avoid macros where we can.) @subsection A minimal example Here is an example for the implementation of a function with two arguments that is not further evaluated: @example DECLARE_FUNCTION_2P(myfcn) REGISTER_FUNCTION(myfcn, dummy()) @end example Any code that has seen the @code{DECLARE_FUNCTION} line can use @code{myfcn()} in algebraic expressions: @example @{ ... symbol x("x"); ex e = 2*myfcn(42, 1+3*x) - x; cout << e << endl; // prints '2*myfcn(42,1+3*x)-x' ... @} @end example The @code{dummy()} option in the @code{REGISTER_FUNCTION} line signifies "no options". A function with no options specified merely acts as a kind of container for its arguments. It is a pure "dummy" function with no associated logic (which is, however, sometimes perfectly sufficient). Let's now have a look at the implementation of GiNaC's cosine function for an example of how to make an "intelligent" function. @subsection The cosine function The GiNaC header file @file{inifcns.h} contains the line @example DECLARE_FUNCTION_1P(cos) @end example which declares to all programs using GiNaC that there is a function @samp{cos} that takes one @code{ex} as an argument. This is all they need to know to use this function in expressions. The implementation of the cosine function is in @file{inifcns_trans.cpp}. Here is its @code{REGISTER_FUNCTION} line: @example REGISTER_FUNCTION(cos, eval_func(cos_eval). evalf_func(cos_evalf). derivative_func(cos_deriv). latex_name("\\cos")); @end example There are four options defined for the cosine function. One of them (@code{latex_name}) gives the function a proper name for LaTeX output; the other three indicate the C++ functions in which the "brains" of the cosine function are defined. @cindex @code{hold()} @cindex evaluation The @code{eval_func()} option specifies the C++ function that implements the @code{eval()} method, GiNaC's anonymous evaluator. This function takes the same number of arguments as the associated symbolic function (one in this case) and returns the (possibly transformed or in some way simplified) symbolically evaluated function (@xref{Automatic evaluation}, for a description of the automatic evaluation process). If no (further) evaluation is to take place, the @code{eval_func()} function must return the original function with @code{.hold()}, to avoid a potential infinite recursion. If your symbolic functions produce a segmentation fault or stack overflow when using them in expressions, you are probably missing a @code{.hold()} somewhere. The @code{eval_func()} function for the cosine looks something like this (actually, it doesn't look like this at all, but it should give you an idea what is going on): @example static ex cos_eval(const ex & x) @{ if ("x is a multiple of 2*Pi") return 1; else if ("x is a multiple of Pi") return -1; else if ("x is a multiple of Pi/2") return 0; // more rules... else if ("x has the form 'acos(y)'") return y; else if ("x has the form 'asin(y)'") return sqrt(1-y^2); // more rules... else return cos(x).hold(); @} @end example This function is called every time the cosine is used in a symbolic expression: @example @{ ... e = cos(Pi); // this calls cos_eval(Pi), and inserts its return value into // the actual expression cout << e << endl; // prints '-1' ... @} @end example In this way, @code{cos(4*Pi)} automatically becomes @math{1}, @code{cos(asin(a+b))} becomes @code{sqrt(1-(a+b)^2)}, etc. If no reasonable symbolic transformation can be done, the unmodified function is returned with @code{.hold()}. GiNaC doesn't automatically transform @code{cos(2)} to @samp{-0.416146...}. The user has to call @code{evalf()} for that. This is implemented in a different function: @example static ex cos_evalf(const ex & x) @{ if (is_a(x)) return cos(ex_to(x)); else return cos(x).hold(); @} @end example Since we are lazy we defer the problem of numeric evaluation to somebody else, in this case the @code{cos()} function for @code{numeric} objects, which in turn hands it over to the @code{cos()} function in CLN. The @code{.hold()} isn't really needed here, but reminds us that the corresponding @code{eval()} function would require it in this place. Differentiation will surely turn up and so we need to tell @code{cos} what its first derivative is (higher derivatives, @code{.diff(x,3)} for instance, are then handled automatically by @code{basic::diff} and @code{ex::diff}): @example static ex cos_deriv(const ex & x, unsigned diff_param) @{ return -sin(x); @} @end example @cindex product rule The second parameter is obligatory but uninteresting at this point. It specifies which parameter to differentiate in a partial derivative in case the function has more than one parameter, and its main application is for correct handling of the chain rule. Derivatives of some functions, for example @code{abs()} and @code{Order()}, could not be evaluated through the chain rule. In such cases the full derivative may be specified as shown for @code{Order()}: @example static ex Order_expl_derivative(const ex & arg, const symbol & s) @{ return Order(arg.diff(s)); @} @end example That is, we need to supply a procedure, which returns the expression of derivative with respect to the variable @code{s} for the argument @code{arg}. This procedure need to be registered with the function through the option @code{expl_derivative_func} (see the next Subsection). In contrast, a partial derivative, e.g. as was defined for @code{cos()} above, needs to be registered through the option @code{derivative_func}. An implementation of the series expansion is not needed for @code{cos()} as it doesn't have any poles and GiNaC can do Taylor expansion by itself (as long as it knows what the derivative of @code{cos()} is). @code{tan()}, on the other hand, does have poles and may need to do Laurent expansion: @example static ex tan_series(const ex & x, const relational & rel, int order, unsigned options) @{ // Find the actual expansion point const ex x_pt = x.subs(rel); if ("x_pt is not an odd multiple of Pi/2") throw do_taylor(); // tell function::series() to do Taylor expansion // On a pole, expand sin()/cos() return (sin(x)/cos(x)).series(rel, order+2, options); @} @end example The @code{series()} implementation of a function @emph{must} return a @code{pseries} object, otherwise your code will crash. @subsection Function options GiNaC functions understand several more options which are always specified as @code{.option(params)}. None of them are required, but you need to specify at least one option to @code{REGISTER_FUNCTION()}. There is a do-nothing option called @code{dummy()} which you can use to define functions without any special options. @example eval_func() evalf_func() derivative_func() expl_derivative_func() series_func() conjugate_func() @end example These specify the C++ functions that implement symbolic evaluation, numeric evaluation, partial derivatives, explicit derivative, and series expansion, respectively. They correspond to the GiNaC methods @code{eval()}, @code{evalf()}, @code{diff()} and @code{series()}. The @code{eval_func()} function needs to use @code{.hold()} if no further automatic evaluation is desired or possible. If no @code{series_func()} is given, GiNaC defaults to simple Taylor expansion, which is correct if there are no poles involved. If the function has poles in the complex plane, the @code{series_func()} needs to check whether the expansion point is on a pole and fall back to Taylor expansion if it isn't. Otherwise, the pole usually needs to be regularized by some suitable transformation. @example latex_name(const string & n) @end example specifies the LaTeX code that represents the name of the function in LaTeX output. The default is to put the function name in an @code{\mbox@{@}}. @example do_not_evalf_params() @end example This tells @code{evalf()} to not recursively evaluate the parameters of the function before calling the @code{evalf_func()}. @example set_return_type(unsigned return_type, const return_type_t * return_type_tinfo) @end example This allows you to explicitly specify the commutation properties of the function (@xref{Non-commutative objects}, for an explanation of (non)commutativity in GiNaC). For example, with an object of type @code{return_type_t} created like @example return_type_t my_type = make_return_type_t(); @end example you can use @code{set_return_type(return_types::noncommutative, &my_type)} to make GiNaC treat your function like a matrix. By default, functions inherit the commutation properties of their first argument. The utilized template function @code{make_return_type_t<>()} @example template inline return_type_t make_return_type_t(const unsigned rl = 0) @end example can also be called with an argument specifying the representation label of the non-commutative function (see section on dirac gamma matrices for more details). @example set_symmetry(const symmetry & s) @end example specifies the symmetry properties of the function with respect to its arguments. @xref{Indexed objects}, for an explanation of symmetry specifications. GiNaC will automatically rearrange the arguments of symmetric functions into a canonical order. Sometimes you may want to have finer control over how functions are displayed in the output. For example, the @code{abs()} function prints itself as @samp{abs(x)} in the default output format, but as @samp{|x|} in LaTeX mode, and @code{fabs(x)} in C source output. This is achieved with the @example print_func() @end example option which is explained in the next section. @subsection Functions with a variable number of arguments The @code{DECLARE_FUNCTION} and @code{REGISTER_FUNCTION} macros define functions with a fixed number of arguments. Sometimes, though, you may need to have a function that accepts a variable number of expressions. One way to accomplish this is to pass variable-length lists as arguments. The @code{Li()} function uses this method for multiple polylogarithms. It is also possible to define functions that accept a different number of parameters under the same function name, such as the @code{psi()} function which can be called either as @code{psi(z)} (the digamma function) or as @code{psi(n, z)} (polygamma functions). These are actually two different functions in GiNaC that, however, have the same name. Defining such functions is not possible with the macros but requires manually fiddling with GiNaC internals. If you are interested, please consult the GiNaC source code for the @code{psi()} function (@file{inifcns.h} and @file{inifcns_gamma.cpp}). @node Printing, Structures, Symbolic functions, Extending GiNaC @c node-name, next, previous, up @section GiNaC's expression output system GiNaC allows the output of expressions in a variety of different formats (@pxref{Input/output}). This section will explain how expression output is implemented internally, and how to define your own output formats or change the output format of built-in algebraic objects. You will also want to read this section if you plan to write your own algebraic classes or functions. @cindex @code{print_context} (class) @cindex @code{print_dflt} (class) @cindex @code{print_latex} (class) @cindex @code{print_tree} (class) @cindex @code{print_csrc} (class) All the different output formats are represented by a hierarchy of classes rooted in the @code{print_context} class, defined in the @file{print.h} header file: @table @code @item print_dflt the default output format @item print_latex output in LaTeX mathematical mode @item print_tree a dump of the internal expression structure (for debugging) @item print_csrc the base class for C source output @item print_csrc_float C source output using the @code{float} type @item print_csrc_double C source output using the @code{double} type @item print_csrc_cl_N C source output using CLN types @end table The @code{print_context} base class provides two public data members: @example class print_context @{ ... public: std::ostream & s; unsigned options; @}; @end example @code{s} is a reference to the stream to output to, while @code{options} holds flags and modifiers. Currently, there is only one flag defined: @code{print_options::print_index_dimensions} instructs the @code{idx} class to print the index dimension which is normally hidden. When you write something like @code{std::cout << e}, where @code{e} is an object of class @code{ex}, GiNaC will construct an appropriate @code{print_context} object (of a class depending on the selected output format), fill in the @code{s} and @code{options} members, and call @cindex @code{print()} @example void ex::print(const print_context & c, unsigned level = 0) const; @end example which in turn forwards the call to the @code{print()} method of the top-level algebraic object contained in the expression. Unlike other methods, GiNaC classes don't usually override their @code{print()} method to implement expression output. Instead, the default implementation @code{basic::print(c, level)} performs a run-time double dispatch to a function selected by the dynamic type of the object and the passed @code{print_context}. To this end, GiNaC maintains a separate method table for each class, similar to the virtual function table used for ordinary (single) virtual function dispatch. The method table contains one slot for each possible @code{print_context} type, indexed by the (internally assigned) serial number of the type. Slots may be empty, in which case GiNaC will retry the method lookup with the @code{print_context} object's parent class, possibly repeating the process until it reaches the @code{print_context} base class. If there's still no method defined, the method table of the algebraic object's parent class is consulted, and so on, until a matching method is found (eventually it will reach the combination @code{basic/print_context}, which prints the object's class name enclosed in square brackets). You can think of the print methods of all the different classes and output formats as being arranged in a two-dimensional matrix with one axis listing the algebraic classes and the other axis listing the @code{print_context} classes. Subclasses of @code{basic} can, of course, also overload @code{basic::print()} to implement printing, but then they won't get any of the benefits of the double dispatch mechanism (such as the ability for derived classes to inherit only certain print methods from its parent, or the replacement of methods at run-time). @subsection Print methods for classes The method table for a class is set up either in the definition of the class, by passing the appropriate @code{print_func()} option to @code{GINAC_IMPLEMENT_REGISTERED_CLASS_OPT()} (@xref{Adding classes}, for an example), or at run-time using @code{set_print_func()}. The latter can also be used to override existing methods dynamically. The argument to @code{print_func()} and @code{set_print_func()} can be a member function of the class (or one of its parent classes), a static member function, or an ordinary (global) C++ function. The @code{C} template parameter specifies the appropriate @code{print_context} type for which the method should be invoked, while, in the case of @code{set_print_func<>()}, the @code{T} parameter specifies the algebraic class (for @code{print_func<>()}, the class is the one being implemented by @code{GINAC_IMPLEMENT_REGISTERED_CLASS_OPT}). For print methods that are member functions, their first argument must be of a type convertible to a @code{const C &}, and the second argument must be an @code{unsigned}. For static members and global functions, the first argument must be of a type convertible to a @code{const T &}, the second argument must be of a type convertible to a @code{const C &}, and the third argument must be an @code{unsigned}. A global function will, of course, not have access to private and protected members of @code{T}. The @code{unsigned} argument of the print methods (and of @code{ex::print()} and @code{basic::print()}) is used for proper parenthesizing of the output (and by @code{print_tree} for proper indentation). It can be used for similar purposes if you write your own output formats. The explanations given above may seem complicated, but in practice it's really simple, as shown in the following example. Suppose that we want to display exponents in LaTeX output not as superscripts but with little upwards-pointing arrows. This can be achieved in the following way: @example void my_print_power_as_latex(const power & p, const print_latex & c, unsigned level) @{ // get the precedence of the 'power' class unsigned power_prec = p.precedence(); // if the parent operator has the same or a higher precedence // we need parentheses around the power if (level >= power_prec) c.s << '('; // print the basis and exponent, each enclosed in braces, and // separated by an uparrow c.s << '@{'; p.op(0).print(c, power_prec); c.s << "@}\\uparrow@{"; p.op(1).print(c, power_prec); c.s << '@}'; // don't forget the closing parenthesis if (level >= power_prec) c.s << ')'; @} int main() @{ // a sample expression symbol x("x"), y("y"); ex e = -3*pow(x, 3)*pow(y, -2) + pow(x+y, 2) - 1; // switch to LaTeX mode cout << latex; // this prints "-1+@{(y+x)@}^@{2@}-3 \frac@{x^@{3@}@}@{y^@{2@}@}" cout << e << endl; // now we replace the method for the LaTeX output of powers with // our own one set_print_func(my_print_power_as_latex); // this prints "-1+@{@{(y+x)@}@}\uparrow@{2@}-3 \frac@{@{x@}\uparrow@{3@}@}@{@{y@} // \uparrow@{2@}@}" cout << e << endl; @} @end example Some notes: @itemize @item The first argument of @code{my_print_power_as_latex} could also have been a @code{const basic &}, the second one a @code{const print_context &}. @item The above code depends on @code{mul} objects converting their operands to @code{power} objects for the purpose of printing. @item The output of products including negative powers as fractions is also controlled by the @code{mul} class. @item The @code{power/print_latex} method provided by GiNaC prints square roots using @code{\sqrt}, but the above code doesn't. @end itemize It's not possible to restore a method table entry to its previous or default value. Once you have called @code{set_print_func()}, you can only override it with another call to @code{set_print_func()}, but you can't easily go back to the default behavior again (you can, of course, dig around in the GiNaC sources, find the method that is installed at startup (@code{power::do_print_latex} in this case), and @code{set_print_func} that one; that is, after you circumvent the C++ member access control@dots{}). @subsection Print methods for functions Symbolic functions employ a print method dispatch mechanism similar to the one used for classes. The methods are specified with @code{print_func()} function options. If you don't specify any special print methods, the function will be printed with its name (or LaTeX name, if supplied), followed by a comma-separated list of arguments enclosed in parentheses. For example, this is what GiNaC's @samp{abs()} function is defined like: @example static ex abs_eval(const ex & arg) @{ ... @} static ex abs_evalf(const ex & arg) @{ ... @} static void abs_print_latex(const ex & arg, const print_context & c) @{ c.s << "@{|"; arg.print(c); c.s << "|@}"; @} static void abs_print_csrc_float(const ex & arg, const print_context & c) @{ c.s << "fabs("; arg.print(c); c.s << ")"; @} REGISTER_FUNCTION(abs, eval_func(abs_eval). evalf_func(abs_evalf). print_func(abs_print_latex). print_func(abs_print_csrc_float). print_func(abs_print_csrc_float)); @end example This will display @samp{abs(x)} as @samp{|x|} in LaTeX mode and @code{fabs(x)} in non-CLN C source output, but as @code{abs(x)} in all other formats. There is currently no equivalent of @code{set_print_func()} for functions. @subsection Adding new output formats Creating a new output format involves subclassing @code{print_context}, which is somewhat similar to adding a new algebraic class (@pxref{Adding classes}). There is a macro @code{GINAC_DECLARE_PRINT_CONTEXT} that needs to go into the class definition, and a corresponding macro @code{GINAC_IMPLEMENT_PRINT_CONTEXT} that has to appear at global scope. Every @code{print_context} class needs to provide a default constructor and a constructor from an @code{std::ostream} and an @code{unsigned} options value. Here is an example for a user-defined @code{print_context} class: @example class print_myformat : public print_dflt @{ GINAC_DECLARE_PRINT_CONTEXT(print_myformat, print_dflt) public: print_myformat(std::ostream & os, unsigned opt = 0) : print_dflt(os, opt) @{@} @}; print_myformat::print_myformat() : print_dflt(std::cout) @{@} GINAC_IMPLEMENT_PRINT_CONTEXT(print_myformat, print_dflt) @end example That's all there is to it. None of the actual expression output logic is implemented in this class. It merely serves as a selector for choosing a particular format. The algorithms for printing expressions in the new format are implemented as print methods, as described above. @code{print_myformat} is a subclass of @code{print_dflt}, so it behaves exactly like GiNaC's default output format: @example @{ symbol x("x"); ex e = pow(x, 2) + 1; // this prints "1+x^2" cout << e << endl; // this also prints "1+x^2" e.print(print_myformat()); cout << endl; ... @} @end example To fill @code{print_myformat} with life, we need to supply appropriate print methods with @code{set_print_func()}, like this: @example // This prints powers with '**' instead of '^'. See the LaTeX output // example above for explanations. void print_power_as_myformat(const power & p, const print_myformat & c, unsigned level) @{ unsigned power_prec = p.precedence(); if (level >= power_prec) c.s << '('; p.op(0).print(c, power_prec); c.s << "**"; p.op(1).print(c, power_prec); if (level >= power_prec) c.s << ')'; @} @{ ... // install a new print method for power objects set_print_func(print_power_as_myformat); // now this prints "1+x**2" e.print(print_myformat()); cout << endl; // but the default format is still "1+x^2" cout << e << endl; @} @end example @node Structures, Adding classes, Printing, Extending GiNaC @c node-name, next, previous, up @section Structures If you are doing some very specialized things with GiNaC, or if you just need some more organized way to store data in your expressions instead of anonymous lists, you may want to implement your own algebraic classes. ('algebraic class' means any class directly or indirectly derived from @code{basic} that can be used in GiNaC expressions). GiNaC offers two ways of accomplishing this: either by using the @code{structure} template class, or by rolling your own class from scratch. This section will discuss the @code{structure} template which is easier to use but more limited, while the implementation of custom GiNaC classes is the topic of the next section. However, you may want to read both sections because many common concepts and member functions are shared by both concepts, and it will also allow you to decide which approach is most suited to your needs. The @code{structure} template, defined in the GiNaC header file @file{structure.h}, wraps a type that you supply (usually a C++ @code{struct} or @code{class}) into a GiNaC object that can be used in expressions. @subsection Example: scalar products Let's suppose that we need a way to handle some kind of abstract scalar product of the form @samp{} in expressions. Objects of the scalar product class have to store their left and right operands, which can in turn be arbitrary expressions. Here is a possible way to represent such a product in a C++ @code{struct}: @example #include using namespace std; #include using namespace GiNaC; struct sprod_s @{ ex left, right; sprod_s() @{@} sprod_s(ex l, ex r) : left(l), right(r) @{@} @}; @end example The default constructor is required. Now, to make a GiNaC class out of this data structure, we need only one line: @example typedef structure sprod; @end example That's it. This line constructs an algebraic class @code{sprod} which contains objects of type @code{sprod_s}. We can now use @code{sprod} in expressions like any other GiNaC class: @example ... symbol a("a"), b("b"); ex e = sprod(sprod_s(a, b)); ... @end example Note the difference between @code{sprod} which is the algebraic class, and @code{sprod_s} which is the unadorned C++ structure containing the @code{left} and @code{right} data members. As shown above, an @code{sprod} can be constructed from an @code{sprod_s} object. If you find the nested @code{sprod(sprod_s())} constructor too unwieldy, you could define a little wrapper function like this: @example inline ex make_sprod(ex left, ex right) @{ return sprod(sprod_s(left, right)); @} @end example The @code{sprod_s} object contained in @code{sprod} can be accessed with the GiNaC @code{ex_to<>()} function followed by the @code{->} operator or @code{get_struct()}: @example ... cout << ex_to(e)->left << endl; // -> a cout << ex_to(e).get_struct().right << endl; // -> b ... @end example You only have read access to the members of @code{sprod_s}. The type definition of @code{sprod} is enough to write your own algorithms that deal with scalar products, for example: @example ex swap_sprod(ex p) @{ if (is_a(p)) @{ const sprod_s & sp = ex_to(p).get_struct(); return make_sprod(sp.right, sp.left); @} else return p; @} ... f = swap_sprod(e); // f is now ... @end example @subsection Structure output While the @code{sprod} type is useable it still leaves something to be desired, most notably proper output: @example ... cout << e << endl; // -> [structure object] ... @end example By default, any structure types you define will be printed as @samp{[structure object]}. To override this you can either specialize the template's @code{print()} member function, or specify print methods with @code{set_print_func<>()}, as described in @ref{Printing}. Unfortunately, it's not possible to supply class options like @code{print_func<>()} to structures, so for a self-contained structure type you need to resort to overriding the @code{print()} function, which is also what we will do here. The member functions of GiNaC classes are described in more detail in the next section, but it shouldn't be hard to figure out what's going on here: @example void sprod::print(const print_context & c, unsigned level) const @{ // tree debug output handled by superclass if (is_a(c)) inherited::print(c, level); // get the contained sprod_s object const sprod_s & sp = get_struct(); // print_context::s is a reference to an ostream c.s << "<" << sp.left << "|" << sp.right << ">"; @} @end example Now we can print expressions containing scalar products: @example ... cout << e << endl; // -> cout << swap_sprod(e) << endl; // -> ... @end example @subsection Comparing structures The @code{sprod} class defined so far still has one important drawback: all scalar products are treated as being equal because GiNaC doesn't know how to compare objects of type @code{sprod_s}. This can lead to some confusing and undesired behavior: @example ... cout << make_sprod(a, b) - make_sprod(a*a, b*b) << endl; // -> 0 cout << make_sprod(a, b) + make_sprod(a*a, b*b) << endl; // -> 2* or 2* (which one is undefined) ... @end example To remedy this, we first need to define the operators @code{==} and @code{<} for objects of type @code{sprod_s}: @example inline bool operator==(const sprod_s & lhs, const sprod_s & rhs) @{ return lhs.left.is_equal(rhs.left) && lhs.right.is_equal(rhs.right); @} inline bool operator<(const sprod_s & lhs, const sprod_s & rhs) @{ return lhs.left.compare(rhs.left) < 0 ? true : lhs.right.compare(rhs.right) < 0; @} @end example The ordering established by the @code{<} operator doesn't have to make any algebraic sense, but it needs to be well defined. Note that we can't use expressions like @code{lhs.left == rhs.left} or @code{lhs.left < rhs.left} in the implementation of these operators because they would construct GiNaC @code{relational} objects which in the case of @code{<} do not establish a well defined ordering (for arbitrary expressions, GiNaC can't decide which one is algebraically 'less'). Next, we need to change our definition of the @code{sprod} type to let GiNaC know that an ordering relation exists for the embedded objects: @example typedef structure sprod; @end example @code{sprod} objects then behave as expected: @example ... cout << make_sprod(a, b) - make_sprod(a*a, b*b) << endl; // -> - cout << make_sprod(a, b) + make_sprod(a*a, b*b) << endl; // -> + cout << make_sprod(a, b) - make_sprod(a, b) << endl; // -> 0 cout << make_sprod(a, b) + make_sprod(a, b) << endl; // -> 2* ... @end example The @code{compare_std_less} policy parameter tells GiNaC to use the @code{std::less} and @code{std::equal_to} functors to compare objects of type @code{sprod_s}. By default, these functors forward their work to the standard @code{<} and @code{==} operators, which we have overloaded. Alternatively, we could have specialized @code{std::less} and @code{std::equal_to} for class @code{sprod_s}. GiNaC provides two other comparison policies for @code{structure} objects: the default @code{compare_all_equal}, and @code{compare_bitwise} which does a bit-wise comparison of the contained @code{T} objects. This should be used with extreme care because it only works reliably with built-in integral types, and it also compares any padding (filler bytes of undefined value) that the @code{T} class might have. @subsection Subexpressions Our scalar product class has two subexpressions: the left and right operands. It might be a good idea to make them accessible via the standard @code{nops()} and @code{op()} methods: @example size_t sprod::nops() const @{ return 2; @} ex sprod::op(size_t i) const @{ switch (i) @{ case 0: return get_struct().left; case 1: return get_struct().right; default: throw std::range_error("sprod::op(): no such operand"); @} @} @end example Implementing @code{nops()} and @code{op()} for container types such as @code{sprod} has two other nice side effects: @itemize @bullet @item @code{has()} works as expected @item GiNaC generates better hash keys for the objects (the default implementation of @code{calchash()} takes subexpressions into account) @end itemize @cindex @code{let_op()} There is a non-const variant of @code{op()} called @code{let_op()} that allows replacing subexpressions: @example ex & sprod::let_op(size_t i) @{ // every non-const member function must call this ensure_if_modifiable(); switch (i) @{ case 0: return get_struct().left; case 1: return get_struct().right; default: throw std::range_error("sprod::let_op(): no such operand"); @} @} @end example Once we have provided @code{let_op()} we also get @code{subs()} and @code{map()} for free. In fact, every container class that returns a non-null @code{nops()} value must either implement @code{let_op()} or provide custom implementations of @code{subs()} and @code{map()}. In turn, the availability of @code{map()} enables the recursive behavior of a couple of other default method implementations, in particular @code{evalf()}, @code{evalm()}, @code{normal()}, @code{diff()} and @code{expand()}. Although we probably want to provide our own version of @code{expand()} for scalar products that turns expressions like @samp{} into @samp{+}. This is left as an exercise for the reader. The @code{structure} template defines many more member functions that you can override by specialization to customize the behavior of your structures. You are referred to the next section for a description of some of these (especially @code{eval()}). There is, however, one topic that shall be addressed here, as it demonstrates one peculiarity of the @code{structure} template: archiving. @subsection Archiving structures If you don't know how the archiving of GiNaC objects is implemented, you should first read the next section and then come back here. You're back? Good. To implement archiving for structures it is not enough to provide specializations for the @code{archive()} member function and the unarchiving constructor (the @code{unarchive()} function has a default implementation). You also need to provide a unique name (as a string literal) for each structure type you define. This is because in GiNaC archives, the class of an object is stored as a string, the class name. By default, this class name (as returned by the @code{class_name()} member function) is @samp{structure} for all structure classes. This works as long as you have only defined one structure type, but if you use two or more you need to provide a different name for each by specializing the @code{get_class_name()} member function. Here is a sample implementation for enabling archiving of the scalar product type defined above: @example const char *sprod::get_class_name() @{ return "sprod"; @} void sprod::archive(archive_node & n) const @{ inherited::archive(n); n.add_ex("left", get_struct().left); n.add_ex("right", get_struct().right); @} sprod::structure(const archive_node & n, lst & sym_lst) : inherited(n, sym_lst) @{ n.find_ex("left", get_struct().left, sym_lst); n.find_ex("right", get_struct().right, sym_lst); @} @end example Note that the unarchiving constructor is @code{sprod::structure} and not @code{sprod::sprod}, and that we don't need to supply an @code{sprod::unarchive()} function. @node Adding classes, A comparison with other CAS, Structures, Extending GiNaC @c node-name, next, previous, up @section Adding classes The @code{structure} template provides an way to extend GiNaC with custom algebraic classes that is easy to use but has its limitations, the most severe of which being that you can't add any new member functions to structures. To be able to do this, you need to write a new class definition from scratch. This section will explain how to implement new algebraic classes in GiNaC by giving the example of a simple 'string' class. After reading this section you will know how to properly declare a GiNaC class and what the minimum required member functions are that you have to implement. We only cover the implementation of a 'leaf' class here (i.e. one that doesn't contain subexpressions). Creating a container class like, for example, a class representing tensor products is more involved but this section should give you enough information so you can consult the source to GiNaC's predefined classes if you want to implement something more complicated. @subsection Hierarchy of algebraic classes. @cindex hierarchy of classes All algebraic classes (that is, all classes that can appear in expressions) in GiNaC are direct or indirect subclasses of the class @code{basic}. So a @code{basic *} represents a generic pointer to an algebraic class. Working with such pointers directly is cumbersome (think of memory management), hence GiNaC wraps them into @code{ex} (@pxref{Expressions are reference counted}). To make such wrapping possible every algebraic class has to implement several methods. Visitors (@pxref{Visitors and tree traversal}), printing, and (un)archiving (@pxref{Input/output}) require helper methods too. But don't worry, most of the work is simplified by the following macros (defined in @file{registrar.h}): @itemize @bullet @item @code{GINAC_DECLARE_REGISTERED_CLASS} @item @code{GINAC_IMPLEMENT_REGISTERED_CLASS} @item @code{GINAC_IMPLEMENT_REGISTERED_CLASS_OPT} @end itemize The @code{GINAC_DECLARE_REGISTERED_CLASS} macro inserts declarations required for memory management, visitors, printing, and (un)archiving. It takes the name of the class and its direct superclass as arguments. The @code{GINAC_DECLARE_REGISTERED_CLASS} should be the first line after the opening brace of the class definition. @code{GINAC_IMPLEMENT_REGISTERED_CLASS} takes the same arguments as @code{GINAC_DECLARE_REGISTERED_CLASS}. It initializes certain static members of a class so that printing and (un)archiving works. The @code{GINAC_IMPLEMENT_REGISTERED_CLASS} may appear anywhere else in the source (at global scope, of course, not inside a function). @code{GINAC_IMPLEMENT_REGISTERED_CLASS_OPT} is a variant of @code{GINAC_IMPLEMENT_REGISTERED_CLASS}. It allows specifying additional options, such as custom printing functions. @subsection A minimalistic example Now we will start implementing a new class @code{mystring} that allows placing character strings in algebraic expressions (this is not very useful, but it's just an example). This class will be a direct subclass of @code{basic}. You can use this sample implementation as a starting point for your own classes @footnote{The self-contained source for this example is included in GiNaC, see the @file{doc/examples/mystring.cpp} file.}. The code snippets given here assume that you have included some header files as follows: @example #include #include #include using namespace std; #include using namespace GiNaC; @end example Now we can write down the class declaration. The class stores a C++ @code{string} and the user shall be able to construct a @code{mystring} object from a string: @example class mystring : public basic @{ GINAC_DECLARE_REGISTERED_CLASS(mystring, basic) public: mystring(const string & s); private: string str; @}; GINAC_IMPLEMENT_REGISTERED_CLASS(mystring, basic) @end example The @code{GINAC_DECLARE_REGISTERED_CLASS} macro insert declarations required for memory management, visitors, printing, and (un)archiving. @code{GINAC_IMPLEMENT_REGISTERED_CLASS} initializes certain static members of a class so that printing and (un)archiving works. Now there are three member functions we have to implement to get a working class: @itemize @item @code{mystring()}, the default constructor. @item @cindex @code{compare_same_type()} @code{int compare_same_type(const basic & other)}, which is used internally by GiNaC to establish a canonical sort order for terms. It returns 0, +1 or -1, depending on the relative order of this object and the @code{other} object. If it returns 0, the objects are considered equal. @strong{Please notice:} This has nothing to do with the (numeric) ordering relationship expressed by @code{<}, @code{>=} etc (which cannot be defined for non-numeric classes). For example, @code{numeric(1).compare_same_type(numeric(2))} may return +1 even though 1 is clearly smaller than 2. Every GiNaC class must provide a @code{compare_same_type()} function, even those representing objects for which no reasonable algebraic ordering relationship can be defined. @item And, of course, @code{mystring(const string& s)} which is the constructor we declared. @end itemize Let's proceed step-by-step. The default constructor looks like this: @example mystring::mystring() @{ @} @end example In the default constructor you should set all other member variables to reasonable default values (we don't need that here since our @code{str} member gets set to an empty string automatically). Our @code{compare_same_type()} function uses a provided function to compare the string members: @example int mystring::compare_same_type(const basic & other) const @{ const mystring &o = static_cast(other); int cmpval = str.compare(o.str); if (cmpval == 0) return 0; else if (cmpval < 0) return -1; else return 1; @} @end example Although this function takes a @code{basic &}, it will always be a reference to an object of exactly the same class (objects of different classes are not comparable), so the cast is safe. If this function returns 0, the two objects are considered equal (in the sense that @math{A-B=0}), so you should compare all relevant member variables. Now the only thing missing is our constructor: @example mystring::mystring(const string& s) : str(s) @{ @} @end example No surprises here. We set the @code{str} member from the argument. That's it! We now have a minimal working GiNaC class that can store strings in algebraic expressions. Let's confirm that the RTTI works: @example ex e = mystring("Hello, world!"); cout << is_a(e) << endl; // -> 1 (true) cout << ex_to(e).class_name() << endl; // -> mystring @end example Obviously it does. Let's see what the expression @code{e} looks like: @example cout << e << endl; // -> [mystring object] @end example Hm, not exactly what we expect, but of course the @code{mystring} class doesn't yet know how to print itself. This can be done either by implementing the @code{print()} member function, or, preferably, by specifying a @code{print_func<>()} class option. Let's say that we want to print the string surrounded by double quotes: @example class mystring : public basic @{ ... protected: void do_print(const print_context & c, unsigned level = 0) const; ... @}; void mystring::do_print(const print_context & c, unsigned level) const @{ // print_context::s is a reference to an ostream c.s << '\"' << str << '\"'; @} @end example The @code{level} argument is only required for container classes to correctly parenthesize the output. Now we need to tell GiNaC that @code{mystring} objects should use the @code{do_print()} member function for printing themselves. For this, we replace the line @example GINAC_IMPLEMENT_REGISTERED_CLASS(mystring, basic) @end example with @example GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(mystring, basic, print_func(&mystring::do_print)) @end example Let's try again to print the expression: @example cout << e << endl; // -> "Hello, world!" @end example Much better. If we wanted to have @code{mystring} objects displayed in a different way depending on the output format (default, LaTeX, etc.), we would have supplied multiple @code{print_func<>()} options with different template parameters (@code{print_dflt}, @code{print_latex}, etc.), separated by dots. This is similar to the way options are specified for symbolic functions. @xref{Printing}, for a more in-depth description of the way expression output is implemented in GiNaC. The @code{mystring} class can be used in arbitrary expressions: @example e += mystring("GiNaC rulez"); cout << e << endl; // -> "GiNaC rulez"+"Hello, world!" @end example (GiNaC's automatic term reordering is in effect here), or even @example e = pow(mystring("One string"), 2*sin(Pi-mystring("Another string"))); cout << e << endl; // -> "One string"^(2*sin(-"Another string"+Pi)) @end example Whether this makes sense is debatable but remember that this is only an example. At least it allows you to implement your own symbolic algorithms for your objects. Note that GiNaC's algebraic rules remain unchanged: @example e = mystring("Wow") * mystring("Wow"); cout << e << endl; // -> "Wow"^2 e = pow(mystring("First")-mystring("Second"), 2); cout << e.expand() << endl; // -> -2*"First"*"Second"+"First"^2+"Second"^2 @end example There's no way to, for example, make GiNaC's @code{add} class perform string concatenation. You would have to implement this yourself. @subsection Automatic evaluation @cindex evaluation @cindex @code{eval()} @cindex @code{hold()} When dealing with objects that are just a little more complicated than the simple string objects we have implemented, chances are that you will want to have some automatic simplifications or canonicalizations performed on them. This is done in the evaluation member function @code{eval()}. Let's say that we wanted all strings automatically converted to lowercase with non-alphabetic characters stripped, and empty strings removed: @example class mystring : public basic @{ ... public: ex eval() const override; ... @}; ex mystring::eval() const @{ string new_str; for (size_t i=0; i= 'A' && c <= 'Z') new_str += tolower(c); else if (c >= 'a' && c <= 'z') new_str += c; @} if (new_str.length() == 0) return 0; return mystring(new_str).hold(); @} @end example The @code{hold()} member function sets a flag in the object that prevents further evaluation. Otherwise we might end up in an endless loop. When you want to return the object unmodified, use @code{return this->hold();}. If our class had subobjects, we would have to evaluate them first (unless they are all of type @code{ex}, which are automatically evaluated). We don't have any subexpressions in the @code{mystring} class, so we are not concerned with this. Let's confirm that it works: @example ex e = mystring("Hello, world!") + mystring("!?#"); cout << e << endl; // -> "helloworld" e = mystring("Wow!") + mystring("WOW") + mystring(" W ** o ** W"); cout << e << endl; // -> 3*"wow" @end example @subsection Optional member functions We have implemented only a small set of member functions to make the class work in the GiNaC framework. There are two functions that are not strictly required but will make operations with objects of the class more efficient: @cindex @code{calchash()} @cindex @code{is_equal_same_type()} @example unsigned calchash() const override; bool is_equal_same_type(const basic & other) const override; @end example The @code{calchash()} method returns an @code{unsigned} hash value for the object which will allow GiNaC to compare and canonicalize expressions much more efficiently. You should consult the implementation of some of the built-in GiNaC classes for examples of hash functions. The default implementation of @code{calchash()} calculates a hash value out of the @code{tinfo_key} of the class and all subexpressions that are accessible via @code{op()}. @code{is_equal_same_type()} works like @code{compare_same_type()} but only tests for equality without establishing an ordering relation, which is often faster. The default implementation of @code{is_equal_same_type()} just calls @code{compare_same_type()} and tests its result for zero. @subsection Other member functions For a real algebraic class, there are probably some more functions that you might want to provide: @example bool info(unsigned inf) const override; ex evalf() const override; ex series(const relational & r, int order, unsigned options = 0) const override; ex derivative(const symbol & s) const override; @end example If your class stores sub-expressions (see the scalar product example in the previous section) you will probably want to override @cindex @code{let_op()} @example size_t nops() const override; ex op(size_t i) const override; ex & let_op(size_t i) override; ex subs(const lst & ls, const lst & lr, unsigned options = 0) const override; ex map(map_function & f) const override; @end example @code{let_op()} is a variant of @code{op()} that allows write access. The default implementations of @code{subs()} and @code{map()} use it, so you have to implement either @code{let_op()}, or @code{subs()} and @code{map()}. You can, of course, also add your own new member functions. Remember that the RTTI may be used to get information about what kinds of objects you are dealing with (the position in the class hierarchy) and that you can always extract the bare object from an @code{ex} by stripping the @code{ex} off using the @code{ex_to(e)} function when that should become a need. That's it. May the source be with you! @subsection Upgrading extension classes from older version of GiNaC GiNaC used to use a custom run time type information system (RTTI). It was removed from GiNaC. Thus, one needs to rewrite constructors which set @code{tinfo_key} (which does not exist any more). For example, @example myclass::myclass() : inherited(&myclass::tinfo_static) @{@} @end example needs to be rewritten as @example myclass::myclass() @{@} @end example @node A comparison with other CAS, Advantages, Adding classes, Top @c node-name, next, previous, up @chapter A Comparison With Other CAS @cindex advocacy This chapter will give you some information on how GiNaC compares to other, traditional Computer Algebra Systems, like @emph{Maple}, @emph{Mathematica} or @emph{Reduce}, where it has advantages and disadvantages over these systems. @menu * Advantages:: Strengths of the GiNaC approach. * Disadvantages:: Weaknesses of the GiNaC approach. * Why C++?:: Attractiveness of C++. @end menu @node Advantages, Disadvantages, A comparison with other CAS, A comparison with other CAS @c node-name, next, previous, up @section Advantages GiNaC has several advantages over traditional Computer Algebra Systems, like @itemize @bullet @item familiar language: all common CAS implement their own proprietary grammar which you have to learn first (and maybe learn again when your vendor decides to `enhance' it). With GiNaC you can write your program in common C++, which is standardized. @cindex STL @item structured data types: you can build up structured data types using @code{struct}s or @code{class}es together with STL features instead of using unnamed lists of lists of lists. @item strongly typed: in CAS, you usually have only one kind of variables which can hold contents of an arbitrary type. This 4GL like feature is nice for novice programmers, but dangerous. @item development tools: powerful development tools exist for C++, like fancy editors (e.g. with automatic indentation and syntax highlighting), debuggers, visualization tools, documentation generators@dots{} @item modularization: C++ programs can easily be split into modules by separating interface and implementation. @item price: GiNaC is distributed under the GNU Public License which means that it is free and available with source code. And there are excellent C++-compilers for free, too. @item extendable: you can add your own classes to GiNaC, thus extending it on a very low level. Compare this to a traditional CAS that you can usually only extend on a high level by writing in the language defined by the parser. In particular, it turns out to be almost impossible to fix bugs in a traditional system. @item multiple interfaces: Though real GiNaC programs have to be written in some editor, then be compiled, linked and executed, there are more ways to work with the GiNaC engine. Many people want to play with expressions interactively, as in traditional CASs: The tiny @command{ginsh} that comes with the distribution exposes many, but not all, of GiNaC's types to a command line. @item seamless integration: it is somewhere between difficult and impossible to call CAS functions from within a program written in C++ or any other programming language and vice versa. With GiNaC, your symbolic routines are part of your program. You can easily call third party libraries, e.g. for numerical evaluation or graphical interaction. All other approaches are much more cumbersome: they range from simply ignoring the problem (i.e. @emph{Maple}) to providing a method for `embedding' the system (i.e. @emph{Yacas}). @item efficiency: often large parts of a program do not need symbolic calculations at all. Why use large integers for loop variables or arbitrary precision arithmetics where @code{int} and @code{double} are sufficient? For pure symbolic applications, GiNaC is comparable in speed with other CAS. @end itemize @node Disadvantages, Why C++?, Advantages, A comparison with other CAS @c node-name, next, previous, up @section Disadvantages Of course it also has some disadvantages: @itemize @bullet @item advanced features: GiNaC cannot compete with a program like @emph{Reduce} which exists for more than 30 years now or @emph{Maple} which grows since 1981 by the work of dozens of programmers, with respect to mathematical features. Integration, non-trivial simplifications, limits etc. are missing in GiNaC (and are not planned for the near future). @item portability: While the GiNaC library itself is designed to avoid any platform dependent features (it should compile on any ANSI compliant C++ compiler), the currently used version of the CLN library (fast large integer and arbitrary precision arithmetics) can only by compiled without hassle on systems with the C++ compiler from the GNU Compiler Collection (GCC).@footnote{This is because CLN uses PROVIDE/REQUIRE like macros to let the compiler gather all static initializations, which works for GNU C++ only. Feel free to contact the authors in case you really believe that you need to use a different compiler. We have occasionally used other compilers and may be able to give you advice.} GiNaC uses recent language features like explicit constructors, mutable members, RTTI, @code{dynamic_cast}s and STL, so ANSI compliance is meant literally. @end itemize @node Why C++?, Internal structures, Disadvantages, A comparison with other CAS @c node-name, next, previous, up @section Why C++? Why did we choose to implement GiNaC in C++ instead of Java or any other language? C++ is not perfect: type checking is not strict (casting is possible), separation between interface and implementation is not complete, object oriented design is not enforced. The main reason is the often scolded feature of operator overloading in C++. While it may be true that operating on classes with a @code{+} operator is rarely meaningful, it is perfectly suited for algebraic expressions. Writing @math{3x+5y} as @code{3*x+5*y} instead of @code{x.times(3).plus(y.times(5))} looks much more natural. Furthermore, the main developers are more familiar with C++ than with any other programming language. @node Internal structures, Expressions are reference counted, Why C++? , Top @c node-name, next, previous, up @appendix Internal structures @menu * Expressions are reference counted:: * Internal representation of products and sums:: @end menu @node Expressions are reference counted, Internal representation of products and sums, Internal structures, Internal structures @c node-name, next, previous, up @appendixsection Expressions are reference counted @cindex reference counting @cindex copy-on-write @cindex garbage collection In GiNaC, there is an @emph{intrusive reference-counting} mechanism at work where the counter belongs to the algebraic objects derived from class @code{basic} but is maintained by the smart pointer class @code{ptr}, of which @code{ex} contains an instance. If you understood that, you can safely skip the rest of this passage. Expressions are extremely light-weight since internally they work like handles to the actual representation. They really hold nothing more than a pointer to some other object. What this means in practice is that whenever you create two @code{ex} and set the second equal to the first no copying process is involved. Instead, the copying takes place as soon as you try to change the second. Consider the simple sequence of code: @example #include #include using namespace std; using namespace GiNaC; int main() @{ symbol x("x"), y("y"), z("z"); ex e1, e2; e1 = sin(x + 2*y) + 3*z + 41; e2 = e1; // e2 points to same object as e1 cout << e2 << endl; // prints sin(x+2*y)+3*z+41 e2 += 1; // e2 is copied into a new object cout << e2 << endl; // prints sin(x+2*y)+3*z+42 @} @end example The line @code{e2 = e1;} creates a second expression pointing to the object held already by @code{e1}. The time involved for this operation is therefore constant, no matter how large @code{e1} was. Actual copying, however, must take place in the line @code{e2 += 1;} because @code{e1} and @code{e2} are not handles for the same object any more. This concept is called @dfn{copy-on-write semantics}. It increases performance considerably whenever one object occurs multiple times and represents a simple garbage collection scheme because when an @code{ex} runs out of scope its destructor checks whether other expressions handle the object it points to too and deletes the object from memory if that turns out not to be the case. A slightly less trivial example of differentiation using the chain-rule should make clear how powerful this can be: @example @{ symbol x("x"), y("y"); ex e1 = x + 3*y; ex e2 = pow(e1, 3); ex e3 = diff(sin(e2), x); // first derivative of sin(e2) by x cout << e1 << endl // prints x+3*y << e2 << endl // prints (x+3*y)^3 << e3 << endl; // prints 3*(x+3*y)^2*cos((x+3*y)^3) @} @end example Here, @code{e1} will actually be referenced three times while @code{e2} will be referenced two times. When the power of an expression is built, that expression needs not be copied. Likewise, since the derivative of a power of an expression can be easily expressed in terms of that expression, no copying of @code{e1} is involved when @code{e3} is constructed. So, when @code{e3} is constructed it will print as @code{3*(x+3*y)^2*cos((x+3*y)^3)} but the argument of @code{cos()} only holds a reference to @code{e2} and the factor in front is just @code{3*e1^2}. As a user of GiNaC, you cannot see this mechanism of copy-on-write semantics. When you insert an expression into a second expression, the result behaves exactly as if the contents of the first expression were inserted. But it may be useful to remember that this is not what happens. Knowing this will enable you to write much more efficient code. If you still have an uncertain feeling with copy-on-write semantics, we recommend you have a look at the @uref{http://www.parashift.com/c++-faq-lite/, C++-FAQ lite} by Marshall Cline. Chapter 16 covers this issue and presents an implementation which is pretty close to the one in GiNaC. @node Internal representation of products and sums, Package tools, Expressions are reference counted, Internal structures @c node-name, next, previous, up @appendixsection Internal representation of products and sums @cindex representation @cindex @code{add} @cindex @code{mul} @cindex @code{power} Although it should be completely transparent for the user of GiNaC a short discussion of this topic helps to understand the sources and also explain performance to a large degree. Consider the unexpanded symbolic expression @tex $2d^3 \left( 4a + 5b - 3 \right)$ @end tex @ifnottex @math{2*d^3*(4*a+5*b-3)} @end ifnottex which could naively be represented by a tree of linear containers for addition and multiplication, one container for exponentiation with base and exponent and some atomic leaves of symbols and numbers in this fashion: @ifnotinfo @image{repnaive} @end ifnotinfo @ifinfo @end ifinfo @cindex pair-wise representation However, doing so results in a rather deeply nested tree which will quickly become inefficient to manipulate. We can improve on this by representing the sum as a sequence of terms, each one being a pair of a purely numeric multiplicative coefficient and its rest. In the same spirit we can store the multiplication as a sequence of terms, each having a numeric exponent and a possibly complicated base, the tree becomes much more flat: @ifnotinfo @image{reppair} @end ifnotinfo @ifinfo @end ifinfo The number @code{3} above the symbol @code{d} shows that @code{mul} objects are treated similarly where the coefficients are interpreted as @emph{exponents} now. Addition of sums of terms or multiplication of products with numerical exponents can be coded to be very efficient with such a pair-wise representation. Internally, this handling is performed by most CAS in this way. It typically speeds up manipulations by an order of magnitude. The overall multiplicative factor @code{2} and the additive term @code{-3} look somewhat out of place in this representation, however, since they are still carrying a trivial exponent and multiplicative factor @code{1} respectively. Within GiNaC, this is avoided by adding a field that carries an overall numeric coefficient. This results in the realistic picture of internal representation for @tex $2d^3 \left( 4a + 5b - 3 \right)$: @end tex @ifnottex @math{2*d^3*(4*a+5*b-3)}: @end ifnottex @ifnotinfo @image{repreal} @end ifnotinfo @ifinfo @end ifinfo @cindex radical This also allows for a better handling of numeric radicals, since @code{sqrt(2)} can now be carried along calculations. Now it should be clear, why both classes @code{add} and @code{mul} are derived from the same abstract class: the data representation is the same, only the semantics differs. In the class hierarchy, methods for polynomial expansion and the like are reimplemented for @code{add} and @code{mul}, but the data structure is inherited from @code{expairseq}. @node Package tools, Configure script options, Internal representation of products and sums, Top @c node-name, next, previous, up @appendix Package tools If you are creating a software package that uses the GiNaC library, setting the correct command line options for the compiler and linker can be difficult. The @command{pkg-config} utility makes this process easier. GiNaC supplies all necessary data in @file{ginac.pc} (installed into @code{/usr/local/lib/pkgconfig} by default). To compile a simple program use @footnote{If GiNaC is installed into some non-standard directory @var{prefix} one should set the @var{PKG_CONFIG_PATH} environment variable to @var{prefix}/lib/pkgconfig for this to work.} @example g++ -o simple `pkg-config --cflags --libs ginac` simple.cpp @end example This command line might expand to (for example): @example g++ -o simple -lginac -lcln simple.cpp @end example Not only is the form using @command{pkg-config} easier to type, it will work on any system, no matter how GiNaC was configured. For packages configured using GNU automake, @command{pkg-config} also provides the @code{PKG_CHECK_MODULES} macro to automate the process of checking for libraries @example PKG_CHECK_MODULES(MYAPP, ginac >= MINIMUM_VERSION, [@var{ACTION-IF-FOUND}], [@var{ACTION-IF-NOT-FOUND}]) @end example This macro: @itemize @bullet @item Determines the location of GiNaC using data from @file{ginac.pc}, which is either found in the default @command{pkg-config} search path, or from the environment variable @env{PKG_CONFIG_PATH}. @item Tests the installed libraries to make sure that their version is later than @var{MINIMUM-VERSION}. @item If the required version was found, sets the @env{MYAPP_CFLAGS} variable to the output of @command{pkg-config --cflags ginac} and the @env{MYAPP_LIBS} variable to the output of @command{pkg-config --libs ginac}, and calls @samp{AC_SUBST()} for these variables so they can be used in generated makefiles, and then executes @var{ACTION-IF-FOUND}. @item If the required version was not found, executes @var{ACTION-IF-NOT-FOUND}. @end itemize @menu * Configure script options:: Configuring a package that uses GiNaC * Example package:: Example of a package using GiNaC @end menu @node Configure script options, Example package, Package tools, Package tools @c node-name, next, previous, up @appendixsection Configuring a package that uses GiNaC The directory where the GiNaC libraries are installed needs to be found by your system's dynamic linkers (both compile- and run-time ones). See the documentation of your system linker for details. Also make sure that @file{ginac.pc} is in @command{pkg-config}'s search path, @xref{pkg-config, ,pkg-config, *manpages*}. The short summary below describes how to do this on a GNU/Linux system. Suppose GiNaC is installed into the directory @samp{PREFIX}. To tell the linkers where to find the library one should @itemize @bullet @item edit @file{/etc/ld.so.conf} and run @command{ldconfig}. For example, @example # echo PREFIX/lib >> /etc/ld.so.conf # ldconfig @end example @item or set the environment variables @env{LD_LIBRARY_PATH} and @env{LD_RUN_PATH} @example $ export LD_LIBRARY_PATH=PREFIX/lib $ export LD_RUN_PATH=PREFIX/lib @end example @item or give a @samp{-L} and @samp{--rpath} flags when running configure, for instance: @example $ LDFLAGS='-Wl,-LPREFIX/lib -Wl,--rpath=PREFIX/lib' ./configure @end example @end itemize To tell @command{pkg-config} where the @file{ginac.pc} file is, set the @env{PKG_CONFIG_PATH} environment variable: @example $ export PKG_CONFIG_PATH=PREFIX/lib/pkgconfig @end example Finally, run the @command{configure} script @example $ ./configure @end example @c There are many other ways to do the same, @xref{Options, ,Command Line Options, ld, GNU ld manual}. @node Example package, Bibliography, Configure script options, Package tools @c node-name, next, previous, up @appendixsection Example of a package using GiNaC The following shows how to build a simple package using automake and the @samp{PKG_CHECK_MODULES} macro. The program used here is @file{simple.cpp}: @example #include #include int main() @{ GiNaC::symbol x("x"); GiNaC::ex a = GiNaC::sin(x); std::cout << "Derivative of " << a << " is " << a.diff(x) << std::endl; return 0; @} @end example You should first read the introductory portions of the automake Manual, if you are not already familiar with it. Two files are needed, @file{configure.ac}, which is used to build the configure script: @example dnl Process this file with autoreconf to produce a configure script. AC_INIT([simple], 1.0.0, bogus@@example.net) AC_CONFIG_SRCDIR(simple.cpp) AM_INIT_AUTOMAKE([foreign 1.8]) AC_PROG_CXX AC_PROG_INSTALL AC_LANG([C++]) PKG_CHECK_MODULES(SIMPLE, ginac >= 1.3.7) AC_OUTPUT(Makefile) @end example The @samp{PKG_CHECK_MODULES} macro does the following: If a GiNaC version greater or equal than 1.3.7 is found, then it defines @var{SIMPLE_CFLAGS} and @var{SIMPLE_LIBS}. Otherwise, it dies with the error message like @example configure: error: Package requirements (ginac >= 1.3.7) were not met: Requested 'ginac >= 1.3.7' but version of GiNaC is 1.3.5 Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables SIMPLE_CFLAGS and SIMPLE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. @end example And the @file{Makefile.am}, which will be used to build the Makefile. @example ## Process this file with automake to produce Makefile.in bin_PROGRAMS = simple simple_SOURCES = simple.cpp simple_CPPFLAGS = $(SIMPLE_CFLAGS) simple_LDADD = $(SIMPLE_LIBS) @end example This @file{Makefile.am}, says that we are building a single executable, from a single source file @file{simple.cpp}. Since every program we are building uses GiNaC we could have simply added @var{SIMPLE_CFLAGS} to @var{CPPFLAGS} and @var{SIMPLE_LIBS} to @var{LIBS}. However, it is more flexible to specify libraries and complier options on a per-program basis. To try this example out, create a new directory and add the three files above to it. Now execute the following command: @example $ autoreconf -i @end example You now have a package that can be built in the normal fashion @example $ ./configure $ make $ make install @end example @node Bibliography, Concept index, Example package, Top @c node-name, next, previous, up @appendix Bibliography @itemize @minus{} @item @cite{ISO/IEC 14882:2011: Programming Languages: C++} @item @cite{CLN: A Class Library for Numbers}, @email{haible@@ilog.fr, Bruno Haible} @item @cite{The C++ Programming Language}, Bjarne Stroustrup, 3rd Edition, ISBN 0-201-88954-4, Addison Wesley @item @cite{C++ FAQs}, Marshall Cline, ISBN 0-201-58958-3, 1995, Addison Wesley @item @cite{Algorithms for Computer Algebra}, Keith O. Geddes, Stephen R. Czapor, and George Labahn, ISBN 0-7923-9259-0, 1992, Kluwer Academic Publishers, Norwell, Massachusetts @item @cite{Computer Algebra: Systems and Algorithms for Algebraic Computation}, James H. Davenport, Yvon Siret and Evelyne Tournier, ISBN 0-12-204230-1, 1988, Academic Press, London @item @cite{Computer Algebra Systems - A Practical Guide}, Michael J. Wester (editor), ISBN 0-471-98353-5, 1999, Wiley, Chichester @item @cite{The Art of Computer Programming, Vol 2: Seminumerical Algorithms}, Donald E. Knuth, ISBN 0-201-89684-2, 1998, Addison Wesley @item @cite{Pi Unleashed}, J@"org Arndt and Christoph Haenel, ISBN 3-540-66572-2, 2001, Springer, Heidelberg @item @cite{The Role of gamma5 in Dimensional Regularization}, Dirk Kreimer, hep-ph/9401354 @end itemize @node Concept index, , Bibliography, Top @c node-name, next, previous, up @unnumbered Concept index @printindex cp @bye ginac-1.7.8.orig/doc/tutorial/mdate-sh0000644000000000000000000000517313457611471014511 0ustar #!/bin/sh # Get modification time of a file or directory and pretty-print it. # Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. # written by Ulrich Drepper , June 1995 # # 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. # Prevent date giving response in another language. LANG=C export LANG LC_ALL=C export LC_ALL LC_TIME=C export LC_TIME # Get the extended ls output of the file or directory. # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. if ls -L /dev/null 1>/dev/null 2>&1; then set - x`ls -L -l -d $1` else set - x`ls -l -d $1` fi # The month is at least the fourth argument # (3 shifts here, the next inside the loop). shift shift shift # Find the month. Next argument is day, followed by the year or time. month= until test $month do shift case $1 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac done day=$2 # Here we have to deal with the problem that the ls output gives either # the time of day or the year. case $3 in *:*) set `date`; eval year=\$$# case $2 in Jan) nummonthtod=1;; Feb) nummonthtod=2;; Mar) nummonthtod=3;; Apr) nummonthtod=4;; May) nummonthtod=5;; Jun) nummonthtod=6;; Jul) nummonthtod=7;; Aug) nummonthtod=8;; Sep) nummonthtod=9;; Oct) nummonthtod=10;; Nov) nummonthtod=11;; Dec) nummonthtod=12;; esac # For the first six month of the year the time notation can also # be used for files modified in the last year. if (expr $nummonth \> $nummonthtod) > /dev/null; then year=`expr $year - 1` fi;; *) year=$3;; esac # The result. echo $day $month $year ginac-1.7.8.orig/doc/tutorial/repnaive.fig0000644000000000000000000001036113457611471015357 0ustar #FIG 3.2 Landscape Center Metric A4 100.00 Single -2 1200 2 6 1260 2700 1890 3060 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 1260 2700 1890 2700 1890 2970 1260 2970 1260 2700 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 1260 2970 1890 2970 1890 3060 1260 3060 1260 2970 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1575 3060 1575 2970 4 1 0 99 0 0 14 0.0000 4 150 555 1575 2906 power\001 -6 6 3465 3375 4095 3735 6 3465 3375 4095 3645 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 3465 3375 4095 3375 4095 3645 3465 3645 3465 3375 4 1 0 99 0 0 14 0.0000 4 150 315 3780 3581 mul\001 -6 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 3465 3645 4095 3645 4095 3735 3465 3735 3465 3645 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3780 3645 3780 3735 -6 6 1080 3330 1440 3690 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 1275 3525 165 165 1275 3525 1440 3520 4 1 0 99 0 0 14 0.0000 4 150 105 1275 3595 d\001 -6 6 1620 3330 1980 3690 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 1815 3525 165 165 1815 3525 1980 3520 4 1 0 99 0 0 14 0.0000 4 150 105 1815 3595 3\001 -6 6 2385 3375 3015 3735 6 2385 3375 3015 3645 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 2385 3375 3015 3375 3015 3645 2385 3645 2385 3375 4 1 0 99 0 0 14 0.0000 4 150 315 2700 3581 mul\001 -6 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 2385 3645 3015 3645 3015 3735 2385 3735 2385 3645 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2700 3645 2700 3735 -6 6 225 2655 585 3015 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 390 2850 165 165 390 2850 555 2845 4 1 0 99 0 0 14 0.0000 4 150 105 390 2920 2\001 -6 6 4680 3330 5040 3690 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 4845 3525 165 165 4845 3525 5010 3520 4 1 0 99 0 0 14 0.0000 4 150 240 4845 3595 -3\001 -6 6 2205 4005 2565 4365 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 2400 4200 165 165 2400 4200 2565 4195 4 1 0 99 0 0 14 0.0000 4 150 105 2400 4270 4\001 -6 6 2745 4005 3105 4365 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 2940 4200 165 165 2940 4200 3105 4195 4 1 0 99 0 0 14 0.0000 4 105 105 2940 4270 a\001 -6 6 3285 4005 3645 4365 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 3480 4200 165 165 3480 4200 3645 4195 4 1 0 99 0 0 14 0.0000 4 150 105 3480 4270 5\001 -6 6 3825 4005 4185 4365 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 4020 4200 165 165 4020 4200 4185 4195 4 1 0 99 0 0 14 0.0000 4 150 105 4020 4270 b\001 -6 6 3330 2700 3960 2970 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 3330 2700 3960 2700 3960 2970 3330 2970 3330 2700 4 1 0 99 0 0 14 0.0000 4 150 315 3645 2906 add\001 -6 6 3330 2970 3960 3060 6 3330 2970 3960 3060 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 3330 2970 3960 2970 3960 3060 3330 3060 3330 2970 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 3330 2970 3540 2970 3540 3060 3330 3060 3330 2970 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 3750 2970 3960 2970 3960 3060 3750 3060 3750 2970 -6 -6 6 1620 2295 2250 2385 6 1620 2295 2250 2385 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 1620 2295 2250 2295 2250 2385 1620 2385 1620 2295 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 1620 2295 1830 2295 1830 2385 1620 2385 1620 2295 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 2040 2295 2250 2295 2250 2385 2040 2385 2040 2295 -6 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 3420 3060 2790 3375 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 3645 3060 3780 3375 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 2160 2385 3375 2700 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1710 2385 495 2700 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1935 2385 1575 2700 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1710 3060 1800 3375 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1446 3058 1350 3375 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 2835 3735 2925 4050 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 2571 3733 2475 4050 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 3915 3735 4005 4050 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 3651 3733 3555 4050 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 3870 3060 4770 3375 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 1620 2025 2250 2025 2250 2295 1620 2295 1620 2025 2 2 0 1 0 7 101 0 20 0.000 0 0 -1 0 0 5 1620 2295 2250 2295 2250 2385 1620 2385 1620 2295 4 1 0 99 0 0 14 0.0000 4 150 315 1935 2231 mul\001 ginac-1.7.8.orig/doc/tutorial/reppair.fig0000644000000000000000000001141113457611471015205 0ustar #FIG 3.2 Landscape Center Metric A4 100.00 Single -2 1200 2 6 1260 495 1890 585 2 2 0 1 0 7 99 0 20 0.000 0 0 -1 0 0 5 1260 495 1470 495 1470 585 1260 585 1260 495 2 2 0 1 0 7 99 0 20 0.000 0 0 -1 0 0 5 1680 495 1890 495 1890 585 1680 585 1680 495 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 1260 495 1890 495 1890 585 1260 585 1260 495 -6 6 1260 405 1890 495 2 2 0 1 0 7 99 0 20 0.000 0 0 -1 0 0 5 1260 405 1470 405 1470 495 1260 495 1260 405 2 2 0 1 0 7 99 0 20 0.000 0 0 -1 0 0 5 1680 405 1890 405 1890 495 1680 495 1680 405 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 1260 405 1890 405 1890 495 1260 495 1260 405 -6 6 90 900 630 1755 6 180 900 540 1260 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 345 1095 165 165 345 1095 510 1090 4 1 0 99 0 0 14 0.0000 4 150 105 345 1165 1\001 -6 6 180 1350 540 1710 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 345 1545 165 165 345 1545 510 1540 4 1 0 99 0 0 14 0.0000 4 150 105 345 1615 2\001 -6 2 1 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 2 90 1305 630 1305 2 2 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 5 90 900 630 900 630 1755 90 1755 90 900 -6 6 3060 900 3420 1260 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 3225 1095 165 165 3225 1095 3390 1090 4 1 0 99 0 0 14 0.0000 4 150 105 3225 1165 1\001 -6 6 2925 1350 3555 1800 6 2925 1350 3555 1620 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 2925 1350 3555 1350 3555 1620 2925 1620 2925 1350 4 1 0 99 0 0 14 0.0000 4 150 315 3240 1556 add\001 -6 6 2925 1620 3555 1710 2 2 0 1 0 7 99 0 20 0.000 0 0 -1 0 0 5 2925 1620 3135 1620 3135 1710 2925 1710 2925 1620 2 2 0 1 0 7 99 0 20 0.000 0 0 -1 0 0 5 3345 1620 3555 1620 3555 1710 3345 1710 3345 1620 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 2925 1620 3555 1620 3555 1710 2925 1710 2925 1620 -6 6 2925 1710 3555 1800 2 2 0 1 0 7 99 0 20 0.000 0 0 -1 0 0 5 2925 1710 3135 1710 3135 1800 2925 1800 2925 1710 2 2 0 1 0 7 99 0 20 0.000 0 0 -1 0 0 5 3345 1710 3555 1710 3555 1800 3345 1800 3345 1710 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 2925 1710 3555 1710 3555 1800 2925 1800 2925 1710 -6 -6 6 2970 2025 3510 2880 6 3060 2475 3420 2835 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 3225 2670 165 165 3225 2670 3390 2665 4 1 0 99 0 0 14 0.0000 4 150 105 3225 2740 b\001 -6 6 3060 2025 3420 2385 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 3225 2220 165 165 3225 2220 3390 2215 4 1 0 99 0 0 14 0.0000 4 150 105 3225 2290 5\001 -6 2 1 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 2 2970 2430 3510 2430 2 2 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 5 2970 2025 3510 2025 3510 2880 2970 2880 2970 2025 -6 6 2205 2025 2745 2880 6 2295 2475 2655 2835 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 2460 2670 165 165 2460 2670 2625 2665 4 1 0 99 0 0 14 0.0000 4 105 105 2460 2740 a\001 -6 6 2295 2025 2655 2385 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 2460 2220 165 165 2460 2220 2625 2215 4 1 0 99 0 0 14 0.0000 4 150 105 2460 2290 4\001 -6 2 1 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 2 2205 2430 2745 2430 2 2 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 5 2205 2025 2745 2025 2745 2880 2205 2880 2205 2025 -6 6 3735 2025 4275 2880 6 3825 2475 4185 2835 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 3990 2670 165 165 3990 2670 4155 2665 4 1 0 99 0 0 14 0.0000 4 150 240 3990 2740 -3\001 -6 6 3825 2025 4185 2385 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 3990 2220 165 165 3990 2220 4155 2215 4 1 0 99 0 0 14 0.0000 4 150 105 3990 2290 1\001 -6 2 1 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 2 3735 2430 4275 2430 2 2 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 5 3735 2025 4275 2025 4275 2880 3735 2880 3735 2025 -6 6 1305 900 1845 1755 6 1395 1350 1755 1710 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 1560 1545 165 165 1560 1545 1725 1540 4 1 0 99 0 0 14 0.0000 4 150 105 1560 1615 d\001 -6 6 1395 900 1755 1260 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 1560 1095 165 165 1560 1095 1725 1090 4 1 0 99 0 0 14 0.0000 4 150 105 1560 1165 3\001 -6 2 1 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 2 1305 1305 1845 1305 2 2 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 5 1305 900 1845 900 1845 1755 1305 1755 1305 900 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1351 587 496 902 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1803 577 2880 900 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 1260 135 1890 135 1890 405 1260 405 1260 135 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 1260 405 1890 405 1890 495 1260 495 1260 405 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 1260 495 1890 495 1890 585 1260 585 1260 495 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1578 591 1575 900 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 3015 1800 2520 2025 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 3465 1800 3960 2025 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 3240 1800 3240 2025 2 1 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 2 2835 1305 3645 1305 2 2 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 5 2835 900 3645 900 3645 1845 2835 1845 2835 900 4 1 0 99 0 0 14 0.0000 4 150 315 1575 341 mul\001 ginac-1.7.8.orig/doc/tutorial/repreal.fig0000644000000000000000000000656513457611471015213 0ustar #FIG 3.2 Landscape Center Metric A4 100.00 Single -2 1200 2 6 225 900 765 1755 6 315 1350 675 1710 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 480 1545 165 165 480 1545 645 1540 4 1 0 99 0 0 14 0.0000 4 150 105 480 1615 d\001 -6 6 315 900 675 1260 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 480 1095 165 165 480 1095 645 1090 4 1 0 99 0 0 14 0.0000 4 150 105 480 1165 3\001 -6 2 1 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 2 225 1305 765 1305 2 2 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 5 225 900 765 900 765 1755 225 1755 225 900 -6 6 1575 900 1935 1260 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 1740 1095 165 165 1740 1095 1905 1090 4 1 0 99 0 0 14 0.0000 4 150 105 1740 1165 1\001 -6 6 1485 2025 2025 2880 6 1575 2475 1935 2835 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 1740 2670 165 165 1740 2670 1905 2665 4 1 0 99 0 0 14 0.0000 4 150 105 1740 2740 b\001 -6 6 1575 2025 1935 2385 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 1740 2220 165 165 1740 2220 1905 2215 4 1 0 99 0 0 14 0.0000 4 150 105 1740 2290 5\001 -6 2 1 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 2 1485 2430 2025 2430 2 2 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 5 1485 2025 2025 2025 2025 2880 1485 2880 1485 2025 -6 6 1440 1620 2070 1800 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 1440 1620 2070 1620 2070 1800 1440 1800 1440 1620 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1440 1710 1890 1710 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1890 1800 1890 1620 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1665 1800 1665 1620 -6 6 720 2025 1260 2880 6 810 2475 1170 2835 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 975 2670 165 165 975 2670 1140 2665 4 1 0 99 0 0 14 0.0000 4 105 105 975 2740 a\001 -6 6 810 2025 1170 2385 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 975 2220 165 165 975 2220 1140 2215 4 1 0 99 0 0 14 0.0000 4 150 105 975 2290 4\001 -6 2 1 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 2 720 2430 1260 2430 2 2 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 5 720 2025 1260 2025 1260 2880 720 2880 720 2025 -6 6 2385 1980 2745 2340 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 2550 2175 165 165 2550 2175 2715 2170 4 1 0 99 0 0 14 0.0000 4 150 240 2550 2245 -3\001 -6 6 2880 855 3240 1215 1 3 0 1 0 7 100 0 20 0.000 1 0.0000 3045 1050 165 165 3045 1050 3210 1045 4 1 0 99 0 0 14 0.0000 4 150 105 3045 1120 2\001 -6 6 1440 135 2070 585 6 1440 405 2070 585 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 1440 405 2070 405 2070 585 1440 585 1440 405 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1440 495 1890 495 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1890 585 1890 405 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1665 585 1665 405 -6 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 1440 135 2070 135 2070 405 1440 405 1440 135 4 1 0 99 0 0 14 0.0000 4 150 315 1755 341 mul\001 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1530 585 496 902 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1980 585 2925 900 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1755 585 1755 900 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1530 1800 1035 2025 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1980 1800 2475 2025 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1755 1800 1755 2025 2 1 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 2 1350 1305 2160 1305 2 2 2 1 0 7 100 0 -1 3.000 0 0 -1 0 0 5 1350 900 2160 900 2160 1845 1350 1845 1350 900 2 2 0 1 0 7 100 0 20 0.000 0 0 -1 0 0 5 1440 1350 2070 1350 2070 1620 1440 1620 1440 1350 4 1 0 99 0 0 14 0.0000 4 150 315 1755 1556 add\001 ginac-1.7.8.orig/doc/tutorial/stamp-vti0000644000000000000000000000014713546714215014726 0ustar @set UPDATED 22 September 2019 @set UPDATED-MONTH September 2019 @set EDITION 1.7.8 @set VERSION 1.7.8 ginac-1.7.8.orig/doc/tutorial/version.texi0000644000000000000000000000014713546714215015437 0ustar @set UPDATED 22 September 2019 @set UPDATED-MONTH September 2019 @set EDITION 1.7.8 @set VERSION 1.7.8 ginac-1.7.8.orig/doc/tutorial/version.texi.cmake0000644000000000000000000000007213457611471016514 0ustar @set VERSION @GINAC_VERSION@ @set EDITION @GINAC_VERSION@ ginac-1.7.8.orig/ginac/0000755000000000000000000000000013546717364011536 5ustar ginac-1.7.8.orig/ginac/CMakeLists.txt0000644000000000000000000001023413457611471014267 0ustar cmake_minimum_required(VERSION 2.6) set(ginaclib_sources add.cpp archive.cpp basic.cpp clifford.cpp color.cpp constant.cpp excompiler.cpp ex.cpp expair.cpp expairseq.cpp exprseq.cpp factor.cpp fail.cpp fderivative.cpp function.cpp idx.cpp indexed.cpp inifcns.cpp inifcns_gamma.cpp inifcns_nstdsums.cpp inifcns_trans.cpp integral.cpp lst.cpp matrix.cpp mul.cpp ncmul.cpp normal.cpp numeric.cpp operators.cpp parser/default_reader.cpp parser/lexer.cpp parser/parse_binop_rhs.cpp parser/parse_context.cpp parser/parser_compat.cpp parser/parser.cpp polynomial/chinrem_gcd.cpp polynomial/collect_vargs.cpp polynomial/cra_garner.cpp polynomial/divide_in_z_p.cpp polynomial/gcd_uvar.cpp polynomial/mgcd.cpp polynomial/mod_gcd.cpp polynomial/normalize.cpp polynomial/optimal_vars_finder.cpp polynomial/pgcd.cpp polynomial/primpart_content.cpp polynomial/remainder.cpp polynomial/upoly_io.cpp power.cpp print.cpp pseries.cpp registrar.cpp relational.cpp remember.cpp symbol.cpp symmetry.cpp tensor.cpp utils.cpp wildcard.cpp ) set(ginaclib_public_headers ginac.h add.h archive.h assertion.h basic.h class_info.h clifford.h color.h compiler.h constant.h container.h ex.h excompiler.h expair.h expairseq.h exprseq.h fail.h factor.h fderivative.h flags.h ${CMAKE_CURRENT_BINARY_DIR}/function.h hash_map.h idx.h indexed.h inifcns.h integral.h lst.h matrix.h mul.h ncmul.h normal.h numeric.h operators.h power.h print.h pseries.h ptr.h registrar.h relational.h structure.h symbol.h symmetry.h tensor.h version.h wildcard.h parser/parser.h parser/parse_context.h ) set(ginaclib_private_headers remember.h utils.h crc32.h hash_seed.h parser/lexer.h parser/debug.h polynomial/gcd_euclid.h polynomial/remainder.h polynomial/normalize.h polynomial/upoly.h polynomial/ring_traits.h polynomial/mod_gcd.h polynomial/cra_garner.h polynomial/upoly_io.h polynomial/prem_uvar.h polynomial/eval_uvar.h polynomial/interpolate_padic_uvar.h polynomial/sr_gcd_uvar.h polynomial/heur_gcd_uvar.h polynomial/chinrem_gcd.h polynomial/collect_vargs.h polynomial/divide_in_z_p.h polynomial/euclid_gcd_wrap.h polynomial/eval_point_finder.h polynomial/newton_interpolate.h polynomial/optimal_vars_finder.h polynomial/pgcd.h polynomial/poly_cra.h polynomial/primes_factory.h polynomial/smod_helpers.h polynomial/debug.h ) add_library(ginac ${ginaclib_sources}) add_definitions(-DLIBEXECDIR="${LIBEXECDIR}/") set_target_properties(ginac PROPERTIES SOVERSION ${ginaclib_soversion} VERSION ${ginaclib_version}) target_link_libraries(ginac ${CLN_LIBRARIES}) include_directories(${CMAKE_SOURCE_DIR}/ginac) if (NOT BUILD_SHARED_LIBS) set_target_properties(ginac PROPERTIES OUTPUT_NAME "ginac") # Avoid the static library vs import library conflict (necessary for # m$ toolchain). set_target_properties(ginac PROPERTIES PREFIX "lib") endif() install(TARGETS ginac LIBRARY DESTINATION "${LIB_INSTALL_DIR}" RUNTIME DESTINATION "${BIN_INSTALL_DIR}" ARCHIVE DESTINATION "${LIB_INSTALL_DIR}") install(FILES ${ginaclib_public_headers} DESTINATION "${INCLUDE_INSTALL_DIR}/ginac") add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/function.h COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/function.py -o ${CMAKE_CURRENT_BINARY_DIR}/function.h ${CMAKE_CURRENT_SOURCE_DIR}/function.hppy DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/function.hppy ${CMAKE_CURRENT_SOURCE_DIR}/function.py) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/function.cpp COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/function.py -o ${CMAKE_CURRENT_BINARY_DIR}/function.cpp ${CMAKE_CURRENT_SOURCE_DIR}/function.cppy DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/function.h ${CMAKE_CURRENT_SOURCE_DIR}/function.cppy ${CMAKE_CURRENT_SOURCE_DIR}/function.py) ginac-1.7.8.orig/ginac/Makefile.am0000644000000000000000000000560613457611471013572 0ustar ## Process this file with automake to produce Makefile.in lib_LTLIBRARIES = libginac.la libginac_la_SOURCES = add.cpp archive.cpp basic.cpp clifford.cpp color.cpp \ constant.cpp ex.cpp excompiler.cpp expair.cpp expairseq.cpp exprseq.cpp \ fail.cpp factor.cpp fderivative.cpp function.cpp idx.cpp indexed.cpp inifcns.cpp \ inifcns_trans.cpp inifcns_gamma.cpp inifcns_nstdsums.cpp \ integral.cpp lst.cpp matrix.cpp mul.cpp ncmul.cpp normal.cpp numeric.cpp \ operators.cpp power.cpp registrar.cpp relational.cpp remember.cpp \ pseries.cpp print.cpp symbol.cpp symmetry.cpp tensor.cpp \ utils.cpp wildcard.cpp \ remember.h utils.h crc32.h hash_seed.h \ parser/parse_binop_rhs.cpp \ parser/parser.cpp \ parser/parse_context.cpp \ parser/default_reader.cpp \ parser/lexer.cpp \ parser/lexer.h \ parser/parser_compat.cpp \ parser/debug.h \ polynomial/mod_gcd.cpp \ polynomial/cra_garner.cpp \ polynomial/gcd_euclid.h \ polynomial/remainder.cpp \ polynomial/remainder.h \ polynomial/normalize.cpp \ polynomial/normalize.h \ polynomial/upoly.h \ polynomial/ring_traits.h \ polynomial/mod_gcd.h \ polynomial/cra_garner.h \ polynomial/upoly_io.h \ polynomial/upoly_io.cpp \ polynomial/prem_uvar.h \ polynomial/eval_uvar.h \ polynomial/interpolate_padic_uvar.h \ polynomial/sr_gcd_uvar.h \ polynomial/heur_gcd_uvar.h \ polynomial/gcd_uvar.cpp \ polynomial/chinrem_gcd.cpp \ polynomial/chinrem_gcd.h \ polynomial/collect_vargs.cpp \ polynomial/collect_vargs.h \ polynomial/divide_in_z_p.cpp \ polynomial/divide_in_z_p.h \ polynomial/euclid_gcd_wrap.h \ polynomial/eval_point_finder.h \ polynomial/mgcd.cpp \ polynomial/newton_interpolate.h \ polynomial/optimal_vars_finder.cpp \ polynomial/optimal_vars_finder.h \ polynomial/pgcd.cpp \ polynomial/pgcd.h \ polynomial/poly_cra.h \ polynomial/primes_factory.h \ polynomial/primpart_content.cpp \ polynomial/smod_helpers.h \ polynomial/debug.h libginac_la_LDFLAGS = -version-info $(LT_VERSION_INFO) libginac_la_CPPFLAGS = -DLIBEXECDIR='"$(libexecdir)/"' libginac_la_LIBADD = $(DL_LIBS) ginacincludedir = $(includedir)/ginac ginacinclude_HEADERS = ginac.h add.h archive.h assertion.h basic.h class_info.h \ clifford.h color.h constant.h container.h ex.h excompiler.h expair.h expairseq.h \ exprseq.h fail.h factor.h fderivative.h flags.h function.h hash_map.h idx.h indexed.h \ inifcns.h integral.h lst.h matrix.h mul.h ncmul.h normal.h numeric.h operators.h \ power.h print.h pseries.h ptr.h registrar.h relational.h structure.h \ symbol.h symmetry.h tensor.h version.h wildcard.h compiler.h \ parser/parser.h \ parser/parse_context.h EXTRA_DIST = function.py function.hppy function.cppy CMakeLists.txt BUILT_SOURCES = function.cpp function.h EXTRA_DIST += function.cpp function.h $(srcdir)/function.cpp: function.cppy function.py $(PYTHON) $(srcdir)/function.py -o $@ $< $(srcdir)/function.h: function.hppy function.py $(PYTHON) $(srcdir)/function.py -o $@ $< ginac-1.7.8.orig/ginac/Makefile.in0000644000000000000000000033277013541765075013614 0ustar # Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = ginac ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(ginacinclude_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(ginacincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libginac_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__dirstamp = $(am__leading_dot)dirstamp am_libginac_la_OBJECTS = libginac_la-add.lo libginac_la-archive.lo \ libginac_la-basic.lo libginac_la-clifford.lo \ libginac_la-color.lo libginac_la-constant.lo libginac_la-ex.lo \ libginac_la-excompiler.lo libginac_la-expair.lo \ libginac_la-expairseq.lo libginac_la-exprseq.lo \ libginac_la-fail.lo libginac_la-factor.lo \ libginac_la-fderivative.lo libginac_la-function.lo \ libginac_la-idx.lo libginac_la-indexed.lo \ libginac_la-inifcns.lo libginac_la-inifcns_trans.lo \ libginac_la-inifcns_gamma.lo libginac_la-inifcns_nstdsums.lo \ libginac_la-integral.lo libginac_la-lst.lo \ libginac_la-matrix.lo libginac_la-mul.lo libginac_la-ncmul.lo \ libginac_la-normal.lo libginac_la-numeric.lo \ libginac_la-operators.lo libginac_la-power.lo \ libginac_la-registrar.lo libginac_la-relational.lo \ libginac_la-remember.lo libginac_la-pseries.lo \ libginac_la-print.lo libginac_la-symbol.lo \ libginac_la-symmetry.lo libginac_la-tensor.lo \ libginac_la-utils.lo libginac_la-wildcard.lo \ parser/libginac_la-parse_binop_rhs.lo \ parser/libginac_la-parser.lo \ parser/libginac_la-parse_context.lo \ parser/libginac_la-default_reader.lo \ parser/libginac_la-lexer.lo \ parser/libginac_la-parser_compat.lo \ polynomial/libginac_la-mod_gcd.lo \ polynomial/libginac_la-cra_garner.lo \ polynomial/libginac_la-remainder.lo \ polynomial/libginac_la-normalize.lo \ polynomial/libginac_la-upoly_io.lo \ polynomial/libginac_la-gcd_uvar.lo \ polynomial/libginac_la-chinrem_gcd.lo \ polynomial/libginac_la-collect_vargs.lo \ polynomial/libginac_la-divide_in_z_p.lo \ polynomial/libginac_la-mgcd.lo \ polynomial/libginac_la-optimal_vars_finder.lo \ polynomial/libginac_la-pgcd.lo \ polynomial/libginac_la-primpart_content.lo libginac_la_OBJECTS = $(am_libginac_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libginac_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libginac_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libginac_la-add.Plo \ ./$(DEPDIR)/libginac_la-archive.Plo \ ./$(DEPDIR)/libginac_la-basic.Plo \ ./$(DEPDIR)/libginac_la-clifford.Plo \ ./$(DEPDIR)/libginac_la-color.Plo \ ./$(DEPDIR)/libginac_la-constant.Plo \ ./$(DEPDIR)/libginac_la-ex.Plo \ ./$(DEPDIR)/libginac_la-excompiler.Plo \ ./$(DEPDIR)/libginac_la-expair.Plo \ ./$(DEPDIR)/libginac_la-expairseq.Plo \ ./$(DEPDIR)/libginac_la-exprseq.Plo \ ./$(DEPDIR)/libginac_la-factor.Plo \ ./$(DEPDIR)/libginac_la-fail.Plo \ ./$(DEPDIR)/libginac_la-fderivative.Plo \ ./$(DEPDIR)/libginac_la-function.Plo \ ./$(DEPDIR)/libginac_la-idx.Plo \ ./$(DEPDIR)/libginac_la-indexed.Plo \ ./$(DEPDIR)/libginac_la-inifcns.Plo \ ./$(DEPDIR)/libginac_la-inifcns_gamma.Plo \ ./$(DEPDIR)/libginac_la-inifcns_nstdsums.Plo \ ./$(DEPDIR)/libginac_la-inifcns_trans.Plo \ ./$(DEPDIR)/libginac_la-integral.Plo \ ./$(DEPDIR)/libginac_la-lst.Plo \ ./$(DEPDIR)/libginac_la-matrix.Plo \ ./$(DEPDIR)/libginac_la-mul.Plo \ ./$(DEPDIR)/libginac_la-ncmul.Plo \ ./$(DEPDIR)/libginac_la-normal.Plo \ ./$(DEPDIR)/libginac_la-numeric.Plo \ ./$(DEPDIR)/libginac_la-operators.Plo \ ./$(DEPDIR)/libginac_la-power.Plo \ ./$(DEPDIR)/libginac_la-print.Plo \ ./$(DEPDIR)/libginac_la-pseries.Plo \ ./$(DEPDIR)/libginac_la-registrar.Plo \ ./$(DEPDIR)/libginac_la-relational.Plo \ ./$(DEPDIR)/libginac_la-remember.Plo \ ./$(DEPDIR)/libginac_la-symbol.Plo \ ./$(DEPDIR)/libginac_la-symmetry.Plo \ ./$(DEPDIR)/libginac_la-tensor.Plo \ ./$(DEPDIR)/libginac_la-utils.Plo \ ./$(DEPDIR)/libginac_la-wildcard.Plo \ parser/$(DEPDIR)/libginac_la-default_reader.Plo \ parser/$(DEPDIR)/libginac_la-lexer.Plo \ parser/$(DEPDIR)/libginac_la-parse_binop_rhs.Plo \ parser/$(DEPDIR)/libginac_la-parse_context.Plo \ parser/$(DEPDIR)/libginac_la-parser.Plo \ parser/$(DEPDIR)/libginac_la-parser_compat.Plo \ polynomial/$(DEPDIR)/libginac_la-chinrem_gcd.Plo \ polynomial/$(DEPDIR)/libginac_la-collect_vargs.Plo \ polynomial/$(DEPDIR)/libginac_la-cra_garner.Plo \ polynomial/$(DEPDIR)/libginac_la-divide_in_z_p.Plo \ polynomial/$(DEPDIR)/libginac_la-gcd_uvar.Plo \ polynomial/$(DEPDIR)/libginac_la-mgcd.Plo \ polynomial/$(DEPDIR)/libginac_la-mod_gcd.Plo \ polynomial/$(DEPDIR)/libginac_la-normalize.Plo \ polynomial/$(DEPDIR)/libginac_la-optimal_vars_finder.Plo \ polynomial/$(DEPDIR)/libginac_la-pgcd.Plo \ polynomial/$(DEPDIR)/libginac_la-primpart_content.Plo \ polynomial/$(DEPDIR)/libginac_la-remainder.Plo \ polynomial/$(DEPDIR)/libginac_la-upoly_io.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libginac_la_SOURCES) DIST_SOURCES = $(libginac_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(ginacinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLN_CFLAGS = @CLN_CFLAGS@ CLN_LIBS = @CLN_LIBS@ CLN_RPATH = @CLN_RPATH@ CONFIG_EXCOMPILER = @CONFIG_EXCOMPILER@ CONFIG_RUSAGE = @CONFIG_RUSAGE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVIPS = @DVIPS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FIG2DEV = @FIG2DEV@ GINACLIB_RPATH = @GINACLIB_RPATH@ GINSH_LIBS = @GINSH_LIBS@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LATEX = @LATEX@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAKEINDEX = @MAKEINDEX@ 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@ PDFLATEX = @PDFLATEX@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YACCEXE = @YACCEXE@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libginac.la libginac_la_SOURCES = add.cpp archive.cpp basic.cpp clifford.cpp color.cpp \ constant.cpp ex.cpp excompiler.cpp expair.cpp expairseq.cpp exprseq.cpp \ fail.cpp factor.cpp fderivative.cpp function.cpp idx.cpp indexed.cpp inifcns.cpp \ inifcns_trans.cpp inifcns_gamma.cpp inifcns_nstdsums.cpp \ integral.cpp lst.cpp matrix.cpp mul.cpp ncmul.cpp normal.cpp numeric.cpp \ operators.cpp power.cpp registrar.cpp relational.cpp remember.cpp \ pseries.cpp print.cpp symbol.cpp symmetry.cpp tensor.cpp \ utils.cpp wildcard.cpp \ remember.h utils.h crc32.h hash_seed.h \ parser/parse_binop_rhs.cpp \ parser/parser.cpp \ parser/parse_context.cpp \ parser/default_reader.cpp \ parser/lexer.cpp \ parser/lexer.h \ parser/parser_compat.cpp \ parser/debug.h \ polynomial/mod_gcd.cpp \ polynomial/cra_garner.cpp \ polynomial/gcd_euclid.h \ polynomial/remainder.cpp \ polynomial/remainder.h \ polynomial/normalize.cpp \ polynomial/normalize.h \ polynomial/upoly.h \ polynomial/ring_traits.h \ polynomial/mod_gcd.h \ polynomial/cra_garner.h \ polynomial/upoly_io.h \ polynomial/upoly_io.cpp \ polynomial/prem_uvar.h \ polynomial/eval_uvar.h \ polynomial/interpolate_padic_uvar.h \ polynomial/sr_gcd_uvar.h \ polynomial/heur_gcd_uvar.h \ polynomial/gcd_uvar.cpp \ polynomial/chinrem_gcd.cpp \ polynomial/chinrem_gcd.h \ polynomial/collect_vargs.cpp \ polynomial/collect_vargs.h \ polynomial/divide_in_z_p.cpp \ polynomial/divide_in_z_p.h \ polynomial/euclid_gcd_wrap.h \ polynomial/eval_point_finder.h \ polynomial/mgcd.cpp \ polynomial/newton_interpolate.h \ polynomial/optimal_vars_finder.cpp \ polynomial/optimal_vars_finder.h \ polynomial/pgcd.cpp \ polynomial/pgcd.h \ polynomial/poly_cra.h \ polynomial/primes_factory.h \ polynomial/primpart_content.cpp \ polynomial/smod_helpers.h \ polynomial/debug.h libginac_la_LDFLAGS = -version-info $(LT_VERSION_INFO) libginac_la_CPPFLAGS = -DLIBEXECDIR='"$(libexecdir)/"' libginac_la_LIBADD = $(DL_LIBS) ginacincludedir = $(includedir)/ginac ginacinclude_HEADERS = ginac.h add.h archive.h assertion.h basic.h class_info.h \ clifford.h color.h constant.h container.h ex.h excompiler.h expair.h expairseq.h \ exprseq.h fail.h factor.h fderivative.h flags.h function.h hash_map.h idx.h indexed.h \ inifcns.h integral.h lst.h matrix.h mul.h ncmul.h normal.h numeric.h operators.h \ power.h print.h pseries.h ptr.h registrar.h relational.h structure.h \ symbol.h symmetry.h tensor.h version.h wildcard.h compiler.h \ parser/parser.h \ parser/parse_context.h EXTRA_DIST = function.py function.hppy function.cppy CMakeLists.txt \ function.cpp function.h BUILT_SOURCES = function.cpp function.h all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ginac/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu ginac/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } parser/$(am__dirstamp): @$(MKDIR_P) parser @: > parser/$(am__dirstamp) parser/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) parser/$(DEPDIR) @: > parser/$(DEPDIR)/$(am__dirstamp) parser/libginac_la-parse_binop_rhs.lo: parser/$(am__dirstamp) \ parser/$(DEPDIR)/$(am__dirstamp) parser/libginac_la-parser.lo: parser/$(am__dirstamp) \ parser/$(DEPDIR)/$(am__dirstamp) parser/libginac_la-parse_context.lo: parser/$(am__dirstamp) \ parser/$(DEPDIR)/$(am__dirstamp) parser/libginac_la-default_reader.lo: parser/$(am__dirstamp) \ parser/$(DEPDIR)/$(am__dirstamp) parser/libginac_la-lexer.lo: parser/$(am__dirstamp) \ parser/$(DEPDIR)/$(am__dirstamp) parser/libginac_la-parser_compat.lo: parser/$(am__dirstamp) \ parser/$(DEPDIR)/$(am__dirstamp) polynomial/$(am__dirstamp): @$(MKDIR_P) polynomial @: > polynomial/$(am__dirstamp) polynomial/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) polynomial/$(DEPDIR) @: > polynomial/$(DEPDIR)/$(am__dirstamp) polynomial/libginac_la-mod_gcd.lo: polynomial/$(am__dirstamp) \ polynomial/$(DEPDIR)/$(am__dirstamp) polynomial/libginac_la-cra_garner.lo: polynomial/$(am__dirstamp) \ polynomial/$(DEPDIR)/$(am__dirstamp) polynomial/libginac_la-remainder.lo: polynomial/$(am__dirstamp) \ polynomial/$(DEPDIR)/$(am__dirstamp) polynomial/libginac_la-normalize.lo: polynomial/$(am__dirstamp) \ polynomial/$(DEPDIR)/$(am__dirstamp) polynomial/libginac_la-upoly_io.lo: polynomial/$(am__dirstamp) \ polynomial/$(DEPDIR)/$(am__dirstamp) polynomial/libginac_la-gcd_uvar.lo: polynomial/$(am__dirstamp) \ polynomial/$(DEPDIR)/$(am__dirstamp) polynomial/libginac_la-chinrem_gcd.lo: polynomial/$(am__dirstamp) \ polynomial/$(DEPDIR)/$(am__dirstamp) polynomial/libginac_la-collect_vargs.lo: polynomial/$(am__dirstamp) \ polynomial/$(DEPDIR)/$(am__dirstamp) polynomial/libginac_la-divide_in_z_p.lo: polynomial/$(am__dirstamp) \ polynomial/$(DEPDIR)/$(am__dirstamp) polynomial/libginac_la-mgcd.lo: polynomial/$(am__dirstamp) \ polynomial/$(DEPDIR)/$(am__dirstamp) polynomial/libginac_la-optimal_vars_finder.lo: \ polynomial/$(am__dirstamp) \ polynomial/$(DEPDIR)/$(am__dirstamp) polynomial/libginac_la-pgcd.lo: polynomial/$(am__dirstamp) \ polynomial/$(DEPDIR)/$(am__dirstamp) polynomial/libginac_la-primpart_content.lo: \ polynomial/$(am__dirstamp) \ polynomial/$(DEPDIR)/$(am__dirstamp) libginac.la: $(libginac_la_OBJECTS) $(libginac_la_DEPENDENCIES) $(EXTRA_libginac_la_DEPENDENCIES) $(AM_V_CXXLD)$(libginac_la_LINK) -rpath $(libdir) $(libginac_la_OBJECTS) $(libginac_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f parser/*.$(OBJEXT) -rm -f parser/*.lo -rm -f polynomial/*.$(OBJEXT) -rm -f polynomial/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-add.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-archive.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-basic.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-clifford.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-color.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-constant.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-ex.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-excompiler.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-expair.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-expairseq.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-exprseq.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-factor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-fail.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-fderivative.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-function.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-idx.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-indexed.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-inifcns.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-inifcns_gamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-inifcns_nstdsums.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-inifcns_trans.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-integral.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-lst.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-matrix.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-mul.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-ncmul.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-normal.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-numeric.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-operators.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-power.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-print.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-pseries.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-registrar.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-relational.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-remember.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-symbol.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-symmetry.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-tensor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libginac_la-wildcard.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@parser/$(DEPDIR)/libginac_la-default_reader.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@parser/$(DEPDIR)/libginac_la-lexer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@parser/$(DEPDIR)/libginac_la-parse_binop_rhs.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@parser/$(DEPDIR)/libginac_la-parse_context.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@parser/$(DEPDIR)/libginac_la-parser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@parser/$(DEPDIR)/libginac_la-parser_compat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@polynomial/$(DEPDIR)/libginac_la-chinrem_gcd.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@polynomial/$(DEPDIR)/libginac_la-collect_vargs.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@polynomial/$(DEPDIR)/libginac_la-cra_garner.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@polynomial/$(DEPDIR)/libginac_la-divide_in_z_p.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@polynomial/$(DEPDIR)/libginac_la-gcd_uvar.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@polynomial/$(DEPDIR)/libginac_la-mgcd.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@polynomial/$(DEPDIR)/libginac_la-mod_gcd.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@polynomial/$(DEPDIR)/libginac_la-normalize.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@polynomial/$(DEPDIR)/libginac_la-optimal_vars_finder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@polynomial/$(DEPDIR)/libginac_la-pgcd.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@polynomial/$(DEPDIR)/libginac_la-primpart_content.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@polynomial/$(DEPDIR)/libginac_la-remainder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@polynomial/$(DEPDIR)/libginac_la-upoly_io.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libginac_la-add.lo: add.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-add.lo -MD -MP -MF $(DEPDIR)/libginac_la-add.Tpo -c -o libginac_la-add.lo `test -f 'add.cpp' || echo '$(srcdir)/'`add.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-add.Tpo $(DEPDIR)/libginac_la-add.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='add.cpp' object='libginac_la-add.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-add.lo `test -f 'add.cpp' || echo '$(srcdir)/'`add.cpp libginac_la-archive.lo: archive.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-archive.lo -MD -MP -MF $(DEPDIR)/libginac_la-archive.Tpo -c -o libginac_la-archive.lo `test -f 'archive.cpp' || echo '$(srcdir)/'`archive.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-archive.Tpo $(DEPDIR)/libginac_la-archive.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='archive.cpp' object='libginac_la-archive.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-archive.lo `test -f 'archive.cpp' || echo '$(srcdir)/'`archive.cpp libginac_la-basic.lo: basic.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-basic.lo -MD -MP -MF $(DEPDIR)/libginac_la-basic.Tpo -c -o libginac_la-basic.lo `test -f 'basic.cpp' || echo '$(srcdir)/'`basic.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-basic.Tpo $(DEPDIR)/libginac_la-basic.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='basic.cpp' object='libginac_la-basic.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-basic.lo `test -f 'basic.cpp' || echo '$(srcdir)/'`basic.cpp libginac_la-clifford.lo: clifford.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-clifford.lo -MD -MP -MF $(DEPDIR)/libginac_la-clifford.Tpo -c -o libginac_la-clifford.lo `test -f 'clifford.cpp' || echo '$(srcdir)/'`clifford.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-clifford.Tpo $(DEPDIR)/libginac_la-clifford.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='clifford.cpp' object='libginac_la-clifford.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-clifford.lo `test -f 'clifford.cpp' || echo '$(srcdir)/'`clifford.cpp libginac_la-color.lo: color.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-color.lo -MD -MP -MF $(DEPDIR)/libginac_la-color.Tpo -c -o libginac_la-color.lo `test -f 'color.cpp' || echo '$(srcdir)/'`color.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-color.Tpo $(DEPDIR)/libginac_la-color.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='color.cpp' object='libginac_la-color.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-color.lo `test -f 'color.cpp' || echo '$(srcdir)/'`color.cpp libginac_la-constant.lo: constant.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-constant.lo -MD -MP -MF $(DEPDIR)/libginac_la-constant.Tpo -c -o libginac_la-constant.lo `test -f 'constant.cpp' || echo '$(srcdir)/'`constant.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-constant.Tpo $(DEPDIR)/libginac_la-constant.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='constant.cpp' object='libginac_la-constant.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-constant.lo `test -f 'constant.cpp' || echo '$(srcdir)/'`constant.cpp libginac_la-ex.lo: ex.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-ex.lo -MD -MP -MF $(DEPDIR)/libginac_la-ex.Tpo -c -o libginac_la-ex.lo `test -f 'ex.cpp' || echo '$(srcdir)/'`ex.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-ex.Tpo $(DEPDIR)/libginac_la-ex.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ex.cpp' object='libginac_la-ex.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-ex.lo `test -f 'ex.cpp' || echo '$(srcdir)/'`ex.cpp libginac_la-excompiler.lo: excompiler.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-excompiler.lo -MD -MP -MF $(DEPDIR)/libginac_la-excompiler.Tpo -c -o libginac_la-excompiler.lo `test -f 'excompiler.cpp' || echo '$(srcdir)/'`excompiler.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-excompiler.Tpo $(DEPDIR)/libginac_la-excompiler.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='excompiler.cpp' object='libginac_la-excompiler.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-excompiler.lo `test -f 'excompiler.cpp' || echo '$(srcdir)/'`excompiler.cpp libginac_la-expair.lo: expair.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-expair.lo -MD -MP -MF $(DEPDIR)/libginac_la-expair.Tpo -c -o libginac_la-expair.lo `test -f 'expair.cpp' || echo '$(srcdir)/'`expair.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-expair.Tpo $(DEPDIR)/libginac_la-expair.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='expair.cpp' object='libginac_la-expair.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-expair.lo `test -f 'expair.cpp' || echo '$(srcdir)/'`expair.cpp libginac_la-expairseq.lo: expairseq.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-expairseq.lo -MD -MP -MF $(DEPDIR)/libginac_la-expairseq.Tpo -c -o libginac_la-expairseq.lo `test -f 'expairseq.cpp' || echo '$(srcdir)/'`expairseq.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-expairseq.Tpo $(DEPDIR)/libginac_la-expairseq.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='expairseq.cpp' object='libginac_la-expairseq.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-expairseq.lo `test -f 'expairseq.cpp' || echo '$(srcdir)/'`expairseq.cpp libginac_la-exprseq.lo: exprseq.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-exprseq.lo -MD -MP -MF $(DEPDIR)/libginac_la-exprseq.Tpo -c -o libginac_la-exprseq.lo `test -f 'exprseq.cpp' || echo '$(srcdir)/'`exprseq.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-exprseq.Tpo $(DEPDIR)/libginac_la-exprseq.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='exprseq.cpp' object='libginac_la-exprseq.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-exprseq.lo `test -f 'exprseq.cpp' || echo '$(srcdir)/'`exprseq.cpp libginac_la-fail.lo: fail.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-fail.lo -MD -MP -MF $(DEPDIR)/libginac_la-fail.Tpo -c -o libginac_la-fail.lo `test -f 'fail.cpp' || echo '$(srcdir)/'`fail.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-fail.Tpo $(DEPDIR)/libginac_la-fail.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='fail.cpp' object='libginac_la-fail.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-fail.lo `test -f 'fail.cpp' || echo '$(srcdir)/'`fail.cpp libginac_la-factor.lo: factor.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-factor.lo -MD -MP -MF $(DEPDIR)/libginac_la-factor.Tpo -c -o libginac_la-factor.lo `test -f 'factor.cpp' || echo '$(srcdir)/'`factor.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-factor.Tpo $(DEPDIR)/libginac_la-factor.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='factor.cpp' object='libginac_la-factor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-factor.lo `test -f 'factor.cpp' || echo '$(srcdir)/'`factor.cpp libginac_la-fderivative.lo: fderivative.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-fderivative.lo -MD -MP -MF $(DEPDIR)/libginac_la-fderivative.Tpo -c -o libginac_la-fderivative.lo `test -f 'fderivative.cpp' || echo '$(srcdir)/'`fderivative.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-fderivative.Tpo $(DEPDIR)/libginac_la-fderivative.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='fderivative.cpp' object='libginac_la-fderivative.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-fderivative.lo `test -f 'fderivative.cpp' || echo '$(srcdir)/'`fderivative.cpp libginac_la-function.lo: function.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-function.lo -MD -MP -MF $(DEPDIR)/libginac_la-function.Tpo -c -o libginac_la-function.lo `test -f 'function.cpp' || echo '$(srcdir)/'`function.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-function.Tpo $(DEPDIR)/libginac_la-function.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='function.cpp' object='libginac_la-function.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-function.lo `test -f 'function.cpp' || echo '$(srcdir)/'`function.cpp libginac_la-idx.lo: idx.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-idx.lo -MD -MP -MF $(DEPDIR)/libginac_la-idx.Tpo -c -o libginac_la-idx.lo `test -f 'idx.cpp' || echo '$(srcdir)/'`idx.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-idx.Tpo $(DEPDIR)/libginac_la-idx.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='idx.cpp' object='libginac_la-idx.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-idx.lo `test -f 'idx.cpp' || echo '$(srcdir)/'`idx.cpp libginac_la-indexed.lo: indexed.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-indexed.lo -MD -MP -MF $(DEPDIR)/libginac_la-indexed.Tpo -c -o libginac_la-indexed.lo `test -f 'indexed.cpp' || echo '$(srcdir)/'`indexed.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-indexed.Tpo $(DEPDIR)/libginac_la-indexed.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='indexed.cpp' object='libginac_la-indexed.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-indexed.lo `test -f 'indexed.cpp' || echo '$(srcdir)/'`indexed.cpp libginac_la-inifcns.lo: inifcns.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-inifcns.lo -MD -MP -MF $(DEPDIR)/libginac_la-inifcns.Tpo -c -o libginac_la-inifcns.lo `test -f 'inifcns.cpp' || echo '$(srcdir)/'`inifcns.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-inifcns.Tpo $(DEPDIR)/libginac_la-inifcns.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='inifcns.cpp' object='libginac_la-inifcns.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-inifcns.lo `test -f 'inifcns.cpp' || echo '$(srcdir)/'`inifcns.cpp libginac_la-inifcns_trans.lo: inifcns_trans.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-inifcns_trans.lo -MD -MP -MF $(DEPDIR)/libginac_la-inifcns_trans.Tpo -c -o libginac_la-inifcns_trans.lo `test -f 'inifcns_trans.cpp' || echo '$(srcdir)/'`inifcns_trans.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-inifcns_trans.Tpo $(DEPDIR)/libginac_la-inifcns_trans.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='inifcns_trans.cpp' object='libginac_la-inifcns_trans.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-inifcns_trans.lo `test -f 'inifcns_trans.cpp' || echo '$(srcdir)/'`inifcns_trans.cpp libginac_la-inifcns_gamma.lo: inifcns_gamma.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-inifcns_gamma.lo -MD -MP -MF $(DEPDIR)/libginac_la-inifcns_gamma.Tpo -c -o libginac_la-inifcns_gamma.lo `test -f 'inifcns_gamma.cpp' || echo '$(srcdir)/'`inifcns_gamma.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-inifcns_gamma.Tpo $(DEPDIR)/libginac_la-inifcns_gamma.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='inifcns_gamma.cpp' object='libginac_la-inifcns_gamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-inifcns_gamma.lo `test -f 'inifcns_gamma.cpp' || echo '$(srcdir)/'`inifcns_gamma.cpp libginac_la-inifcns_nstdsums.lo: inifcns_nstdsums.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-inifcns_nstdsums.lo -MD -MP -MF $(DEPDIR)/libginac_la-inifcns_nstdsums.Tpo -c -o libginac_la-inifcns_nstdsums.lo `test -f 'inifcns_nstdsums.cpp' || echo '$(srcdir)/'`inifcns_nstdsums.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-inifcns_nstdsums.Tpo $(DEPDIR)/libginac_la-inifcns_nstdsums.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='inifcns_nstdsums.cpp' object='libginac_la-inifcns_nstdsums.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-inifcns_nstdsums.lo `test -f 'inifcns_nstdsums.cpp' || echo '$(srcdir)/'`inifcns_nstdsums.cpp libginac_la-integral.lo: integral.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-integral.lo -MD -MP -MF $(DEPDIR)/libginac_la-integral.Tpo -c -o libginac_la-integral.lo `test -f 'integral.cpp' || echo '$(srcdir)/'`integral.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-integral.Tpo $(DEPDIR)/libginac_la-integral.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='integral.cpp' object='libginac_la-integral.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-integral.lo `test -f 'integral.cpp' || echo '$(srcdir)/'`integral.cpp libginac_la-lst.lo: lst.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-lst.lo -MD -MP -MF $(DEPDIR)/libginac_la-lst.Tpo -c -o libginac_la-lst.lo `test -f 'lst.cpp' || echo '$(srcdir)/'`lst.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-lst.Tpo $(DEPDIR)/libginac_la-lst.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='lst.cpp' object='libginac_la-lst.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-lst.lo `test -f 'lst.cpp' || echo '$(srcdir)/'`lst.cpp libginac_la-matrix.lo: matrix.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-matrix.lo -MD -MP -MF $(DEPDIR)/libginac_la-matrix.Tpo -c -o libginac_la-matrix.lo `test -f 'matrix.cpp' || echo '$(srcdir)/'`matrix.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-matrix.Tpo $(DEPDIR)/libginac_la-matrix.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='matrix.cpp' object='libginac_la-matrix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-matrix.lo `test -f 'matrix.cpp' || echo '$(srcdir)/'`matrix.cpp libginac_la-mul.lo: mul.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-mul.lo -MD -MP -MF $(DEPDIR)/libginac_la-mul.Tpo -c -o libginac_la-mul.lo `test -f 'mul.cpp' || echo '$(srcdir)/'`mul.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-mul.Tpo $(DEPDIR)/libginac_la-mul.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='mul.cpp' object='libginac_la-mul.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-mul.lo `test -f 'mul.cpp' || echo '$(srcdir)/'`mul.cpp libginac_la-ncmul.lo: ncmul.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-ncmul.lo -MD -MP -MF $(DEPDIR)/libginac_la-ncmul.Tpo -c -o libginac_la-ncmul.lo `test -f 'ncmul.cpp' || echo '$(srcdir)/'`ncmul.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-ncmul.Tpo $(DEPDIR)/libginac_la-ncmul.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ncmul.cpp' object='libginac_la-ncmul.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-ncmul.lo `test -f 'ncmul.cpp' || echo '$(srcdir)/'`ncmul.cpp libginac_la-normal.lo: normal.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-normal.lo -MD -MP -MF $(DEPDIR)/libginac_la-normal.Tpo -c -o libginac_la-normal.lo `test -f 'normal.cpp' || echo '$(srcdir)/'`normal.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-normal.Tpo $(DEPDIR)/libginac_la-normal.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='normal.cpp' object='libginac_la-normal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-normal.lo `test -f 'normal.cpp' || echo '$(srcdir)/'`normal.cpp libginac_la-numeric.lo: numeric.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-numeric.lo -MD -MP -MF $(DEPDIR)/libginac_la-numeric.Tpo -c -o libginac_la-numeric.lo `test -f 'numeric.cpp' || echo '$(srcdir)/'`numeric.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-numeric.Tpo $(DEPDIR)/libginac_la-numeric.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='numeric.cpp' object='libginac_la-numeric.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-numeric.lo `test -f 'numeric.cpp' || echo '$(srcdir)/'`numeric.cpp libginac_la-operators.lo: operators.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-operators.lo -MD -MP -MF $(DEPDIR)/libginac_la-operators.Tpo -c -o libginac_la-operators.lo `test -f 'operators.cpp' || echo '$(srcdir)/'`operators.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-operators.Tpo $(DEPDIR)/libginac_la-operators.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='operators.cpp' object='libginac_la-operators.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-operators.lo `test -f 'operators.cpp' || echo '$(srcdir)/'`operators.cpp libginac_la-power.lo: power.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-power.lo -MD -MP -MF $(DEPDIR)/libginac_la-power.Tpo -c -o libginac_la-power.lo `test -f 'power.cpp' || echo '$(srcdir)/'`power.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-power.Tpo $(DEPDIR)/libginac_la-power.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='power.cpp' object='libginac_la-power.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-power.lo `test -f 'power.cpp' || echo '$(srcdir)/'`power.cpp libginac_la-registrar.lo: registrar.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-registrar.lo -MD -MP -MF $(DEPDIR)/libginac_la-registrar.Tpo -c -o libginac_la-registrar.lo `test -f 'registrar.cpp' || echo '$(srcdir)/'`registrar.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-registrar.Tpo $(DEPDIR)/libginac_la-registrar.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='registrar.cpp' object='libginac_la-registrar.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-registrar.lo `test -f 'registrar.cpp' || echo '$(srcdir)/'`registrar.cpp libginac_la-relational.lo: relational.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-relational.lo -MD -MP -MF $(DEPDIR)/libginac_la-relational.Tpo -c -o libginac_la-relational.lo `test -f 'relational.cpp' || echo '$(srcdir)/'`relational.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-relational.Tpo $(DEPDIR)/libginac_la-relational.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='relational.cpp' object='libginac_la-relational.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-relational.lo `test -f 'relational.cpp' || echo '$(srcdir)/'`relational.cpp libginac_la-remember.lo: remember.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-remember.lo -MD -MP -MF $(DEPDIR)/libginac_la-remember.Tpo -c -o libginac_la-remember.lo `test -f 'remember.cpp' || echo '$(srcdir)/'`remember.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-remember.Tpo $(DEPDIR)/libginac_la-remember.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='remember.cpp' object='libginac_la-remember.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-remember.lo `test -f 'remember.cpp' || echo '$(srcdir)/'`remember.cpp libginac_la-pseries.lo: pseries.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-pseries.lo -MD -MP -MF $(DEPDIR)/libginac_la-pseries.Tpo -c -o libginac_la-pseries.lo `test -f 'pseries.cpp' || echo '$(srcdir)/'`pseries.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-pseries.Tpo $(DEPDIR)/libginac_la-pseries.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='pseries.cpp' object='libginac_la-pseries.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-pseries.lo `test -f 'pseries.cpp' || echo '$(srcdir)/'`pseries.cpp libginac_la-print.lo: print.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-print.lo -MD -MP -MF $(DEPDIR)/libginac_la-print.Tpo -c -o libginac_la-print.lo `test -f 'print.cpp' || echo '$(srcdir)/'`print.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-print.Tpo $(DEPDIR)/libginac_la-print.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='print.cpp' object='libginac_la-print.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-print.lo `test -f 'print.cpp' || echo '$(srcdir)/'`print.cpp libginac_la-symbol.lo: symbol.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-symbol.lo -MD -MP -MF $(DEPDIR)/libginac_la-symbol.Tpo -c -o libginac_la-symbol.lo `test -f 'symbol.cpp' || echo '$(srcdir)/'`symbol.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-symbol.Tpo $(DEPDIR)/libginac_la-symbol.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='symbol.cpp' object='libginac_la-symbol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-symbol.lo `test -f 'symbol.cpp' || echo '$(srcdir)/'`symbol.cpp libginac_la-symmetry.lo: symmetry.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-symmetry.lo -MD -MP -MF $(DEPDIR)/libginac_la-symmetry.Tpo -c -o libginac_la-symmetry.lo `test -f 'symmetry.cpp' || echo '$(srcdir)/'`symmetry.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-symmetry.Tpo $(DEPDIR)/libginac_la-symmetry.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='symmetry.cpp' object='libginac_la-symmetry.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-symmetry.lo `test -f 'symmetry.cpp' || echo '$(srcdir)/'`symmetry.cpp libginac_la-tensor.lo: tensor.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-tensor.lo -MD -MP -MF $(DEPDIR)/libginac_la-tensor.Tpo -c -o libginac_la-tensor.lo `test -f 'tensor.cpp' || echo '$(srcdir)/'`tensor.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-tensor.Tpo $(DEPDIR)/libginac_la-tensor.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tensor.cpp' object='libginac_la-tensor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-tensor.lo `test -f 'tensor.cpp' || echo '$(srcdir)/'`tensor.cpp libginac_la-utils.lo: utils.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-utils.lo -MD -MP -MF $(DEPDIR)/libginac_la-utils.Tpo -c -o libginac_la-utils.lo `test -f 'utils.cpp' || echo '$(srcdir)/'`utils.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-utils.Tpo $(DEPDIR)/libginac_la-utils.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='utils.cpp' object='libginac_la-utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-utils.lo `test -f 'utils.cpp' || echo '$(srcdir)/'`utils.cpp libginac_la-wildcard.lo: wildcard.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libginac_la-wildcard.lo -MD -MP -MF $(DEPDIR)/libginac_la-wildcard.Tpo -c -o libginac_la-wildcard.lo `test -f 'wildcard.cpp' || echo '$(srcdir)/'`wildcard.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libginac_la-wildcard.Tpo $(DEPDIR)/libginac_la-wildcard.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='wildcard.cpp' object='libginac_la-wildcard.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libginac_la-wildcard.lo `test -f 'wildcard.cpp' || echo '$(srcdir)/'`wildcard.cpp parser/libginac_la-parse_binop_rhs.lo: parser/parse_binop_rhs.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT parser/libginac_la-parse_binop_rhs.lo -MD -MP -MF parser/$(DEPDIR)/libginac_la-parse_binop_rhs.Tpo -c -o parser/libginac_la-parse_binop_rhs.lo `test -f 'parser/parse_binop_rhs.cpp' || echo '$(srcdir)/'`parser/parse_binop_rhs.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) parser/$(DEPDIR)/libginac_la-parse_binop_rhs.Tpo parser/$(DEPDIR)/libginac_la-parse_binop_rhs.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='parser/parse_binop_rhs.cpp' object='parser/libginac_la-parse_binop_rhs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o parser/libginac_la-parse_binop_rhs.lo `test -f 'parser/parse_binop_rhs.cpp' || echo '$(srcdir)/'`parser/parse_binop_rhs.cpp parser/libginac_la-parser.lo: parser/parser.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT parser/libginac_la-parser.lo -MD -MP -MF parser/$(DEPDIR)/libginac_la-parser.Tpo -c -o parser/libginac_la-parser.lo `test -f 'parser/parser.cpp' || echo '$(srcdir)/'`parser/parser.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) parser/$(DEPDIR)/libginac_la-parser.Tpo parser/$(DEPDIR)/libginac_la-parser.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='parser/parser.cpp' object='parser/libginac_la-parser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o parser/libginac_la-parser.lo `test -f 'parser/parser.cpp' || echo '$(srcdir)/'`parser/parser.cpp parser/libginac_la-parse_context.lo: parser/parse_context.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT parser/libginac_la-parse_context.lo -MD -MP -MF parser/$(DEPDIR)/libginac_la-parse_context.Tpo -c -o parser/libginac_la-parse_context.lo `test -f 'parser/parse_context.cpp' || echo '$(srcdir)/'`parser/parse_context.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) parser/$(DEPDIR)/libginac_la-parse_context.Tpo parser/$(DEPDIR)/libginac_la-parse_context.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='parser/parse_context.cpp' object='parser/libginac_la-parse_context.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o parser/libginac_la-parse_context.lo `test -f 'parser/parse_context.cpp' || echo '$(srcdir)/'`parser/parse_context.cpp parser/libginac_la-default_reader.lo: parser/default_reader.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT parser/libginac_la-default_reader.lo -MD -MP -MF parser/$(DEPDIR)/libginac_la-default_reader.Tpo -c -o parser/libginac_la-default_reader.lo `test -f 'parser/default_reader.cpp' || echo '$(srcdir)/'`parser/default_reader.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) parser/$(DEPDIR)/libginac_la-default_reader.Tpo parser/$(DEPDIR)/libginac_la-default_reader.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='parser/default_reader.cpp' object='parser/libginac_la-default_reader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o parser/libginac_la-default_reader.lo `test -f 'parser/default_reader.cpp' || echo '$(srcdir)/'`parser/default_reader.cpp parser/libginac_la-lexer.lo: parser/lexer.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT parser/libginac_la-lexer.lo -MD -MP -MF parser/$(DEPDIR)/libginac_la-lexer.Tpo -c -o parser/libginac_la-lexer.lo `test -f 'parser/lexer.cpp' || echo '$(srcdir)/'`parser/lexer.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) parser/$(DEPDIR)/libginac_la-lexer.Tpo parser/$(DEPDIR)/libginac_la-lexer.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='parser/lexer.cpp' object='parser/libginac_la-lexer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o parser/libginac_la-lexer.lo `test -f 'parser/lexer.cpp' || echo '$(srcdir)/'`parser/lexer.cpp parser/libginac_la-parser_compat.lo: parser/parser_compat.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT parser/libginac_la-parser_compat.lo -MD -MP -MF parser/$(DEPDIR)/libginac_la-parser_compat.Tpo -c -o parser/libginac_la-parser_compat.lo `test -f 'parser/parser_compat.cpp' || echo '$(srcdir)/'`parser/parser_compat.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) parser/$(DEPDIR)/libginac_la-parser_compat.Tpo parser/$(DEPDIR)/libginac_la-parser_compat.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='parser/parser_compat.cpp' object='parser/libginac_la-parser_compat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o parser/libginac_la-parser_compat.lo `test -f 'parser/parser_compat.cpp' || echo '$(srcdir)/'`parser/parser_compat.cpp polynomial/libginac_la-mod_gcd.lo: polynomial/mod_gcd.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT polynomial/libginac_la-mod_gcd.lo -MD -MP -MF polynomial/$(DEPDIR)/libginac_la-mod_gcd.Tpo -c -o polynomial/libginac_la-mod_gcd.lo `test -f 'polynomial/mod_gcd.cpp' || echo '$(srcdir)/'`polynomial/mod_gcd.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) polynomial/$(DEPDIR)/libginac_la-mod_gcd.Tpo polynomial/$(DEPDIR)/libginac_la-mod_gcd.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='polynomial/mod_gcd.cpp' object='polynomial/libginac_la-mod_gcd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o polynomial/libginac_la-mod_gcd.lo `test -f 'polynomial/mod_gcd.cpp' || echo '$(srcdir)/'`polynomial/mod_gcd.cpp polynomial/libginac_la-cra_garner.lo: polynomial/cra_garner.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT polynomial/libginac_la-cra_garner.lo -MD -MP -MF polynomial/$(DEPDIR)/libginac_la-cra_garner.Tpo -c -o polynomial/libginac_la-cra_garner.lo `test -f 'polynomial/cra_garner.cpp' || echo '$(srcdir)/'`polynomial/cra_garner.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) polynomial/$(DEPDIR)/libginac_la-cra_garner.Tpo polynomial/$(DEPDIR)/libginac_la-cra_garner.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='polynomial/cra_garner.cpp' object='polynomial/libginac_la-cra_garner.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o polynomial/libginac_la-cra_garner.lo `test -f 'polynomial/cra_garner.cpp' || echo '$(srcdir)/'`polynomial/cra_garner.cpp polynomial/libginac_la-remainder.lo: polynomial/remainder.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT polynomial/libginac_la-remainder.lo -MD -MP -MF polynomial/$(DEPDIR)/libginac_la-remainder.Tpo -c -o polynomial/libginac_la-remainder.lo `test -f 'polynomial/remainder.cpp' || echo '$(srcdir)/'`polynomial/remainder.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) polynomial/$(DEPDIR)/libginac_la-remainder.Tpo polynomial/$(DEPDIR)/libginac_la-remainder.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='polynomial/remainder.cpp' object='polynomial/libginac_la-remainder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o polynomial/libginac_la-remainder.lo `test -f 'polynomial/remainder.cpp' || echo '$(srcdir)/'`polynomial/remainder.cpp polynomial/libginac_la-normalize.lo: polynomial/normalize.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT polynomial/libginac_la-normalize.lo -MD -MP -MF polynomial/$(DEPDIR)/libginac_la-normalize.Tpo -c -o polynomial/libginac_la-normalize.lo `test -f 'polynomial/normalize.cpp' || echo '$(srcdir)/'`polynomial/normalize.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) polynomial/$(DEPDIR)/libginac_la-normalize.Tpo polynomial/$(DEPDIR)/libginac_la-normalize.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='polynomial/normalize.cpp' object='polynomial/libginac_la-normalize.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o polynomial/libginac_la-normalize.lo `test -f 'polynomial/normalize.cpp' || echo '$(srcdir)/'`polynomial/normalize.cpp polynomial/libginac_la-upoly_io.lo: polynomial/upoly_io.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT polynomial/libginac_la-upoly_io.lo -MD -MP -MF polynomial/$(DEPDIR)/libginac_la-upoly_io.Tpo -c -o polynomial/libginac_la-upoly_io.lo `test -f 'polynomial/upoly_io.cpp' || echo '$(srcdir)/'`polynomial/upoly_io.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) polynomial/$(DEPDIR)/libginac_la-upoly_io.Tpo polynomial/$(DEPDIR)/libginac_la-upoly_io.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='polynomial/upoly_io.cpp' object='polynomial/libginac_la-upoly_io.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o polynomial/libginac_la-upoly_io.lo `test -f 'polynomial/upoly_io.cpp' || echo '$(srcdir)/'`polynomial/upoly_io.cpp polynomial/libginac_la-gcd_uvar.lo: polynomial/gcd_uvar.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT polynomial/libginac_la-gcd_uvar.lo -MD -MP -MF polynomial/$(DEPDIR)/libginac_la-gcd_uvar.Tpo -c -o polynomial/libginac_la-gcd_uvar.lo `test -f 'polynomial/gcd_uvar.cpp' || echo '$(srcdir)/'`polynomial/gcd_uvar.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) polynomial/$(DEPDIR)/libginac_la-gcd_uvar.Tpo polynomial/$(DEPDIR)/libginac_la-gcd_uvar.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='polynomial/gcd_uvar.cpp' object='polynomial/libginac_la-gcd_uvar.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o polynomial/libginac_la-gcd_uvar.lo `test -f 'polynomial/gcd_uvar.cpp' || echo '$(srcdir)/'`polynomial/gcd_uvar.cpp polynomial/libginac_la-chinrem_gcd.lo: polynomial/chinrem_gcd.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT polynomial/libginac_la-chinrem_gcd.lo -MD -MP -MF polynomial/$(DEPDIR)/libginac_la-chinrem_gcd.Tpo -c -o polynomial/libginac_la-chinrem_gcd.lo `test -f 'polynomial/chinrem_gcd.cpp' || echo '$(srcdir)/'`polynomial/chinrem_gcd.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) polynomial/$(DEPDIR)/libginac_la-chinrem_gcd.Tpo polynomial/$(DEPDIR)/libginac_la-chinrem_gcd.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='polynomial/chinrem_gcd.cpp' object='polynomial/libginac_la-chinrem_gcd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o polynomial/libginac_la-chinrem_gcd.lo `test -f 'polynomial/chinrem_gcd.cpp' || echo '$(srcdir)/'`polynomial/chinrem_gcd.cpp polynomial/libginac_la-collect_vargs.lo: polynomial/collect_vargs.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT polynomial/libginac_la-collect_vargs.lo -MD -MP -MF polynomial/$(DEPDIR)/libginac_la-collect_vargs.Tpo -c -o polynomial/libginac_la-collect_vargs.lo `test -f 'polynomial/collect_vargs.cpp' || echo '$(srcdir)/'`polynomial/collect_vargs.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) polynomial/$(DEPDIR)/libginac_la-collect_vargs.Tpo polynomial/$(DEPDIR)/libginac_la-collect_vargs.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='polynomial/collect_vargs.cpp' object='polynomial/libginac_la-collect_vargs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o polynomial/libginac_la-collect_vargs.lo `test -f 'polynomial/collect_vargs.cpp' || echo '$(srcdir)/'`polynomial/collect_vargs.cpp polynomial/libginac_la-divide_in_z_p.lo: polynomial/divide_in_z_p.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT polynomial/libginac_la-divide_in_z_p.lo -MD -MP -MF polynomial/$(DEPDIR)/libginac_la-divide_in_z_p.Tpo -c -o polynomial/libginac_la-divide_in_z_p.lo `test -f 'polynomial/divide_in_z_p.cpp' || echo '$(srcdir)/'`polynomial/divide_in_z_p.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) polynomial/$(DEPDIR)/libginac_la-divide_in_z_p.Tpo polynomial/$(DEPDIR)/libginac_la-divide_in_z_p.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='polynomial/divide_in_z_p.cpp' object='polynomial/libginac_la-divide_in_z_p.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o polynomial/libginac_la-divide_in_z_p.lo `test -f 'polynomial/divide_in_z_p.cpp' || echo '$(srcdir)/'`polynomial/divide_in_z_p.cpp polynomial/libginac_la-mgcd.lo: polynomial/mgcd.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT polynomial/libginac_la-mgcd.lo -MD -MP -MF polynomial/$(DEPDIR)/libginac_la-mgcd.Tpo -c -o polynomial/libginac_la-mgcd.lo `test -f 'polynomial/mgcd.cpp' || echo '$(srcdir)/'`polynomial/mgcd.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) polynomial/$(DEPDIR)/libginac_la-mgcd.Tpo polynomial/$(DEPDIR)/libginac_la-mgcd.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='polynomial/mgcd.cpp' object='polynomial/libginac_la-mgcd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o polynomial/libginac_la-mgcd.lo `test -f 'polynomial/mgcd.cpp' || echo '$(srcdir)/'`polynomial/mgcd.cpp polynomial/libginac_la-optimal_vars_finder.lo: polynomial/optimal_vars_finder.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT polynomial/libginac_la-optimal_vars_finder.lo -MD -MP -MF polynomial/$(DEPDIR)/libginac_la-optimal_vars_finder.Tpo -c -o polynomial/libginac_la-optimal_vars_finder.lo `test -f 'polynomial/optimal_vars_finder.cpp' || echo '$(srcdir)/'`polynomial/optimal_vars_finder.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) polynomial/$(DEPDIR)/libginac_la-optimal_vars_finder.Tpo polynomial/$(DEPDIR)/libginac_la-optimal_vars_finder.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='polynomial/optimal_vars_finder.cpp' object='polynomial/libginac_la-optimal_vars_finder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o polynomial/libginac_la-optimal_vars_finder.lo `test -f 'polynomial/optimal_vars_finder.cpp' || echo '$(srcdir)/'`polynomial/optimal_vars_finder.cpp polynomial/libginac_la-pgcd.lo: polynomial/pgcd.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT polynomial/libginac_la-pgcd.lo -MD -MP -MF polynomial/$(DEPDIR)/libginac_la-pgcd.Tpo -c -o polynomial/libginac_la-pgcd.lo `test -f 'polynomial/pgcd.cpp' || echo '$(srcdir)/'`polynomial/pgcd.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) polynomial/$(DEPDIR)/libginac_la-pgcd.Tpo polynomial/$(DEPDIR)/libginac_la-pgcd.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='polynomial/pgcd.cpp' object='polynomial/libginac_la-pgcd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o polynomial/libginac_la-pgcd.lo `test -f 'polynomial/pgcd.cpp' || echo '$(srcdir)/'`polynomial/pgcd.cpp polynomial/libginac_la-primpart_content.lo: polynomial/primpart_content.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT polynomial/libginac_la-primpart_content.lo -MD -MP -MF polynomial/$(DEPDIR)/libginac_la-primpart_content.Tpo -c -o polynomial/libginac_la-primpart_content.lo `test -f 'polynomial/primpart_content.cpp' || echo '$(srcdir)/'`polynomial/primpart_content.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) polynomial/$(DEPDIR)/libginac_la-primpart_content.Tpo polynomial/$(DEPDIR)/libginac_la-primpart_content.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='polynomial/primpart_content.cpp' object='polynomial/libginac_la-primpart_content.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libginac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o polynomial/libginac_la-primpart_content.lo `test -f 'polynomial/primpart_content.cpp' || echo '$(srcdir)/'`polynomial/primpart_content.cpp mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf parser/.libs parser/_libs -rm -rf polynomial/.libs polynomial/_libs install-ginacincludeHEADERS: $(ginacinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(ginacinclude_HEADERS)'; test -n "$(ginacincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(ginacincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ginacincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(ginacincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(ginacincludedir)" || exit $$?; \ done uninstall-ginacincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(ginacinclude_HEADERS)'; test -n "$(ginacincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ginacincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(ginacincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f parser/$(DEPDIR)/$(am__dirstamp) -rm -f parser/$(am__dirstamp) -rm -f polynomial/$(DEPDIR)/$(am__dirstamp) -rm -f polynomial/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libginac_la-add.Plo -rm -f ./$(DEPDIR)/libginac_la-archive.Plo -rm -f ./$(DEPDIR)/libginac_la-basic.Plo -rm -f ./$(DEPDIR)/libginac_la-clifford.Plo -rm -f ./$(DEPDIR)/libginac_la-color.Plo -rm -f ./$(DEPDIR)/libginac_la-constant.Plo -rm -f ./$(DEPDIR)/libginac_la-ex.Plo -rm -f ./$(DEPDIR)/libginac_la-excompiler.Plo -rm -f ./$(DEPDIR)/libginac_la-expair.Plo -rm -f ./$(DEPDIR)/libginac_la-expairseq.Plo -rm -f ./$(DEPDIR)/libginac_la-exprseq.Plo -rm -f ./$(DEPDIR)/libginac_la-factor.Plo -rm -f ./$(DEPDIR)/libginac_la-fail.Plo -rm -f ./$(DEPDIR)/libginac_la-fderivative.Plo -rm -f ./$(DEPDIR)/libginac_la-function.Plo -rm -f ./$(DEPDIR)/libginac_la-idx.Plo -rm -f ./$(DEPDIR)/libginac_la-indexed.Plo -rm -f ./$(DEPDIR)/libginac_la-inifcns.Plo -rm -f ./$(DEPDIR)/libginac_la-inifcns_gamma.Plo -rm -f ./$(DEPDIR)/libginac_la-inifcns_nstdsums.Plo -rm -f ./$(DEPDIR)/libginac_la-inifcns_trans.Plo -rm -f ./$(DEPDIR)/libginac_la-integral.Plo -rm -f ./$(DEPDIR)/libginac_la-lst.Plo -rm -f ./$(DEPDIR)/libginac_la-matrix.Plo -rm -f ./$(DEPDIR)/libginac_la-mul.Plo -rm -f ./$(DEPDIR)/libginac_la-ncmul.Plo -rm -f ./$(DEPDIR)/libginac_la-normal.Plo -rm -f ./$(DEPDIR)/libginac_la-numeric.Plo -rm -f ./$(DEPDIR)/libginac_la-operators.Plo -rm -f ./$(DEPDIR)/libginac_la-power.Plo -rm -f ./$(DEPDIR)/libginac_la-print.Plo -rm -f ./$(DEPDIR)/libginac_la-pseries.Plo -rm -f ./$(DEPDIR)/libginac_la-registrar.Plo -rm -f ./$(DEPDIR)/libginac_la-relational.Plo -rm -f ./$(DEPDIR)/libginac_la-remember.Plo -rm -f ./$(DEPDIR)/libginac_la-symbol.Plo -rm -f ./$(DEPDIR)/libginac_la-symmetry.Plo -rm -f ./$(DEPDIR)/libginac_la-tensor.Plo -rm -f ./$(DEPDIR)/libginac_la-utils.Plo -rm -f ./$(DEPDIR)/libginac_la-wildcard.Plo -rm -f parser/$(DEPDIR)/libginac_la-default_reader.Plo -rm -f parser/$(DEPDIR)/libginac_la-lexer.Plo -rm -f parser/$(DEPDIR)/libginac_la-parse_binop_rhs.Plo -rm -f parser/$(DEPDIR)/libginac_la-parse_context.Plo -rm -f parser/$(DEPDIR)/libginac_la-parser.Plo -rm -f parser/$(DEPDIR)/libginac_la-parser_compat.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-chinrem_gcd.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-collect_vargs.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-cra_garner.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-divide_in_z_p.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-gcd_uvar.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-mgcd.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-mod_gcd.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-normalize.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-optimal_vars_finder.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-pgcd.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-primpart_content.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-remainder.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-upoly_io.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-ginacincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libginac_la-add.Plo -rm -f ./$(DEPDIR)/libginac_la-archive.Plo -rm -f ./$(DEPDIR)/libginac_la-basic.Plo -rm -f ./$(DEPDIR)/libginac_la-clifford.Plo -rm -f ./$(DEPDIR)/libginac_la-color.Plo -rm -f ./$(DEPDIR)/libginac_la-constant.Plo -rm -f ./$(DEPDIR)/libginac_la-ex.Plo -rm -f ./$(DEPDIR)/libginac_la-excompiler.Plo -rm -f ./$(DEPDIR)/libginac_la-expair.Plo -rm -f ./$(DEPDIR)/libginac_la-expairseq.Plo -rm -f ./$(DEPDIR)/libginac_la-exprseq.Plo -rm -f ./$(DEPDIR)/libginac_la-factor.Plo -rm -f ./$(DEPDIR)/libginac_la-fail.Plo -rm -f ./$(DEPDIR)/libginac_la-fderivative.Plo -rm -f ./$(DEPDIR)/libginac_la-function.Plo -rm -f ./$(DEPDIR)/libginac_la-idx.Plo -rm -f ./$(DEPDIR)/libginac_la-indexed.Plo -rm -f ./$(DEPDIR)/libginac_la-inifcns.Plo -rm -f ./$(DEPDIR)/libginac_la-inifcns_gamma.Plo -rm -f ./$(DEPDIR)/libginac_la-inifcns_nstdsums.Plo -rm -f ./$(DEPDIR)/libginac_la-inifcns_trans.Plo -rm -f ./$(DEPDIR)/libginac_la-integral.Plo -rm -f ./$(DEPDIR)/libginac_la-lst.Plo -rm -f ./$(DEPDIR)/libginac_la-matrix.Plo -rm -f ./$(DEPDIR)/libginac_la-mul.Plo -rm -f ./$(DEPDIR)/libginac_la-ncmul.Plo -rm -f ./$(DEPDIR)/libginac_la-normal.Plo -rm -f ./$(DEPDIR)/libginac_la-numeric.Plo -rm -f ./$(DEPDIR)/libginac_la-operators.Plo -rm -f ./$(DEPDIR)/libginac_la-power.Plo -rm -f ./$(DEPDIR)/libginac_la-print.Plo -rm -f ./$(DEPDIR)/libginac_la-pseries.Plo -rm -f ./$(DEPDIR)/libginac_la-registrar.Plo -rm -f ./$(DEPDIR)/libginac_la-relational.Plo -rm -f ./$(DEPDIR)/libginac_la-remember.Plo -rm -f ./$(DEPDIR)/libginac_la-symbol.Plo -rm -f ./$(DEPDIR)/libginac_la-symmetry.Plo -rm -f ./$(DEPDIR)/libginac_la-tensor.Plo -rm -f ./$(DEPDIR)/libginac_la-utils.Plo -rm -f ./$(DEPDIR)/libginac_la-wildcard.Plo -rm -f parser/$(DEPDIR)/libginac_la-default_reader.Plo -rm -f parser/$(DEPDIR)/libginac_la-lexer.Plo -rm -f parser/$(DEPDIR)/libginac_la-parse_binop_rhs.Plo -rm -f parser/$(DEPDIR)/libginac_la-parse_context.Plo -rm -f parser/$(DEPDIR)/libginac_la-parser.Plo -rm -f parser/$(DEPDIR)/libginac_la-parser_compat.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-chinrem_gcd.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-collect_vargs.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-cra_garner.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-divide_in_z_p.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-gcd_uvar.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-mgcd.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-mod_gcd.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-normalize.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-optimal_vars_finder.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-pgcd.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-primpart_content.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-remainder.Plo -rm -f polynomial/$(DEPDIR)/libginac_la-upoly_io.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-ginacincludeHEADERS uninstall-libLTLIBRARIES .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ ctags ctags-am 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-ginacincludeHEADERS 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 maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-ginacincludeHEADERS uninstall-libLTLIBRARIES .PRECIOUS: Makefile $(srcdir)/function.cpp: function.cppy function.py $(PYTHON) $(srcdir)/function.py -o $@ $< $(srcdir)/function.h: function.hppy function.py $(PYTHON) $(srcdir)/function.py -o $@ $< # 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: ginac-1.7.8.orig/ginac/add.cpp0000644000000000000000000003403713457611471012772 0ustar /** @file add.cpp * * Implementation of GiNaC's sums of expressions. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "add.h" #include "mul.h" #include "archive.h" #include "operators.h" #include "matrix.h" #include "utils.h" #include "clifford.h" #include "ncmul.h" #include "compiler.h" #include #include #include #include namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(add, expairseq, print_func(&add::do_print). print_func(&add::do_print_latex). print_func(&add::do_print_csrc). print_func(&add::do_print_tree). print_func(&add::do_print_python_repr)) ////////// // default constructor ////////// add::add() { } ////////// // other constructors ////////// // public add::add(const ex & lh, const ex & rh) { overall_coeff = _ex0; construct_from_2_ex(lh,rh); GINAC_ASSERT(is_canonical()); } add::add(const exvector & v) { overall_coeff = _ex0; construct_from_exvector(v); GINAC_ASSERT(is_canonical()); } add::add(const epvector & v) { overall_coeff = _ex0; construct_from_epvector(v); GINAC_ASSERT(is_canonical()); } add::add(const epvector & v, const ex & oc) { overall_coeff = oc; construct_from_epvector(v); GINAC_ASSERT(is_canonical()); } add::add(epvector && vp) { overall_coeff = _ex0; construct_from_epvector(std::move(vp)); GINAC_ASSERT(is_canonical()); } add::add(epvector && vp, const ex & oc) { overall_coeff = oc; construct_from_epvector(std::move(vp)); GINAC_ASSERT(is_canonical()); } ////////// // archiving ////////// GINAC_BIND_UNARCHIVER(add); ////////// // functions overriding virtual functions from base classes ////////// // public void add::print_add(const print_context & c, const char *openbrace, const char *closebrace, const char *mul_sym, unsigned level) const { if (precedence() <= level) c.s << openbrace << '('; numeric coeff; bool first = true; // First print the overall numeric coefficient, if present if (!overall_coeff.is_zero()) { overall_coeff.print(c, 0); first = false; } // Then proceed with the remaining factors for (auto & it : seq) { coeff = ex_to(it.coeff); if (!first) { if (coeff.csgn() == -1) c.s << '-'; else c.s << '+'; } else { if (coeff.csgn() == -1) c.s << '-'; first = false; } if (!coeff.is_equal(*_num1_p) && !coeff.is_equal(*_num_1_p)) { if (coeff.is_rational()) { if (coeff.is_negative()) (-coeff).print(c); else coeff.print(c); } else { if (coeff.csgn() == -1) (-coeff).print(c, precedence()); else coeff.print(c, precedence()); } c.s << mul_sym; } it.rest.print(c, precedence()); } if (precedence() <= level) c.s << ')' << closebrace; } void add::do_print(const print_context & c, unsigned level) const { print_add(c, "", "", "*", level); } void add::do_print_latex(const print_latex & c, unsigned level) const { print_add(c, "{", "}", " ", level); } void add::do_print_csrc(const print_csrc & c, unsigned level) const { if (precedence() <= level) c.s << "("; // Print arguments, separated by "+" or "-" char separator = ' '; for (auto & it : seq) { // If the coefficient is negative, separator is "-" if (it.coeff.is_equal(_ex_1) || ex_to(it.coeff).numer().is_equal(*_num_1_p)) separator = '-'; c.s << separator; if (it.coeff.is_equal(_ex1) || it.coeff.is_equal(_ex_1)) { it.rest.print(c, precedence()); } else if (ex_to(it.coeff).numer().is_equal(*_num1_p) || ex_to(it.coeff).numer().is_equal(*_num_1_p)) { it.rest.print(c, precedence()); c.s << '/'; ex_to(it.coeff).denom().print(c, precedence()); } else { it.coeff.print(c, precedence()); c.s << '*'; it.rest.print(c, precedence()); } separator = '+'; } if (!overall_coeff.is_zero()) { if (overall_coeff.info(info_flags::positive) || is_a(c) || !overall_coeff.info(info_flags::real)) // sign inside ctor argument c.s << '+'; overall_coeff.print(c, precedence()); } if (precedence() <= level) c.s << ")"; } void add::do_print_python_repr(const print_python_repr & c, unsigned level) const { c.s << class_name() << '('; op(0).print(c); for (size_t i=1; i::min(); if (!overall_coeff.is_zero()) deg = 0; // Find maximum of degrees of individual terms for (auto & i : seq) { int cur_deg = i.rest.degree(s); if (cur_deg > deg) deg = cur_deg; } return deg; } int add::ldegree(const ex & s) const { int deg = std::numeric_limits::max(); if (!overall_coeff.is_zero()) deg = 0; // Find minimum of degrees of individual terms for (auto & i : seq) { int cur_deg = i.rest.ldegree(s); if (cur_deg < deg) deg = cur_deg; } return deg; } ex add::coeff(const ex & s, int n) const { epvector coeffseq; epvector coeffseq_cliff; int rl = clifford_max_label(s); bool do_clifford = (rl != -1); bool nonscalar = false; // Calculate sum of coefficients in each term for (auto & i : seq) { ex restcoeff = i.rest.coeff(s, n); if (!restcoeff.is_zero()) { if (do_clifford) { if (clifford_max_label(restcoeff) == -1) { coeffseq_cliff.push_back(expair(ncmul(restcoeff, dirac_ONE(rl)), i.coeff)); } else { coeffseq_cliff.push_back(expair(restcoeff, i.coeff)); nonscalar = true; } } coeffseq.push_back(expair(restcoeff, i.coeff)); } } return dynallocate(nonscalar ? std::move(coeffseq_cliff) : std::move(coeffseq), n==0 ? overall_coeff : _ex0); } /** Perform automatic term rewriting rules in this class. In the following * x stands for a symbolic variables of type ex and c stands for such * an expression that contain a plain number. * - +(;c) -> c * - +(x;0) -> x */ ex add::eval() const { if (flags & status_flags::evaluated) { GINAC_ASSERT(seq.size()>0); GINAC_ASSERT(seq.size()>1 || !overall_coeff.is_zero()); return *this; } const epvector evaled = evalchildren(); if (unlikely(!evaled.empty())) { // start over evaluating a new object return dynallocate(std::move(evaled), overall_coeff); } #ifdef DO_GINAC_ASSERT for (auto & i : seq) { GINAC_ASSERT(!is_exactly_a(i.rest)); } #endif // def DO_GINAC_ASSERT size_t seq_size = seq.size(); if (seq_size == 0) { // +(;c) -> c return overall_coeff; } else if (seq_size == 1 && overall_coeff.is_zero()) { // +(x;0) -> x return recombine_pair_to_ex(*(seq.begin())); } else if (!overall_coeff.is_zero() && seq[0].rest.return_type() != return_types::commutative) { throw (std::logic_error("add::eval(): sum of non-commutative objects has non-zero numeric term")); } return this->hold(); } ex add::evalm() const { // Evaluate children first and add up all matrices. Stop if there's one // term that is not a matrix. epvector s; s.reserve(seq.size()); bool all_matrices = true; bool first_term = true; matrix sum; for (auto & it : seq) { const ex &m = recombine_pair_to_ex(it).evalm(); s.push_back(split_ex_to_pair(m)); if (is_a(m)) { if (first_term) { sum = ex_to(m); first_term = false; } else sum = sum.add(ex_to(m)); } else all_matrices = false; } if (all_matrices) return sum + overall_coeff; else return dynallocate(std::move(s), overall_coeff); } ex add::conjugate() const { std::unique_ptr v(nullptr); for (size_t i=0; ipush_back(op(i).conjugate()); continue; } ex term = op(i); ex ccterm = term.conjugate(); if (are_ex_trivially_equal(term, ccterm)) continue; v.reset(new exvector); v->reserve(nops()); for (size_t j=0; jpush_back(op(j)); v->push_back(ccterm); } if (v) { return add(std::move(*v)); } return *this; } ex add::real_part() const { epvector v; v.reserve(seq.size()); for (auto & it : seq) if (it.coeff.info(info_flags::real)) { ex rp = it.rest.real_part(); if (!rp.is_zero()) v.push_back(expair(rp, it.coeff)); } else { ex rp = recombine_pair_to_ex(it).real_part(); if (!rp.is_zero()) v.push_back(split_ex_to_pair(rp)); } return dynallocate(std::move(v), overall_coeff.real_part()); } ex add::imag_part() const { epvector v; v.reserve(seq.size()); for (auto & it : seq) if (it.coeff.info(info_flags::real)) { ex ip = it.rest.imag_part(); if (!ip.is_zero()) v.push_back(expair(ip, it.coeff)); } else { ex ip = recombine_pair_to_ex(it).imag_part(); if (!ip.is_zero()) v.push_back(split_ex_to_pair(ip)); } return dynallocate(std::move(v), overall_coeff.imag_part()); } ex add::eval_ncmul(const exvector & v) const { if (seq.empty()) return inherited::eval_ncmul(v); else return seq.begin()->rest.eval_ncmul(v); } // protected /** Implementation of ex::diff() for a sum. It differentiates each term. * @see ex::diff */ ex add::derivative(const symbol & y) const { epvector s; s.reserve(seq.size()); // Only differentiate the "rest" parts of the expairs. This is faster // than the default implementation in basic::derivative() although // if performs the same function (differentiate each term). for (auto & it : seq) s.push_back(expair(it.rest.diff(y), it.coeff)); return dynallocate(std::move(s)); } int add::compare_same_type(const basic & other) const { return inherited::compare_same_type(other); } unsigned add::return_type() const { if (seq.empty()) return return_types::commutative; else return seq.begin()->rest.return_type(); } return_type_t add::return_type_tinfo() const { if (seq.empty()) return make_return_type_t(); else return seq.begin()->rest.return_type_tinfo(); } // Note: do_index_renaming is ignored because it makes no sense for an add. ex add::thisexpairseq(const epvector & v, const ex & oc, bool do_index_renaming) const { return dynallocate(v, oc); } // Note: do_index_renaming is ignored because it makes no sense for an add. ex add::thisexpairseq(epvector && vp, const ex & oc, bool do_index_renaming) const { return dynallocate(std::move(vp), oc); } expair add::split_ex_to_pair(const ex & e) const { if (is_exactly_a(e)) { const mul &mulref(ex_to(e)); const ex &numfactor = mulref.overall_coeff; if (numfactor.is_equal(_ex1)) return expair(e, _ex1); mul & mulcopy = dynallocate(mulref); mulcopy.overall_coeff = _ex1; mulcopy.clearflag(status_flags::evaluated | status_flags::hash_calculated); return expair(mulcopy, numfactor); } return expair(e,_ex1); } expair add::combine_ex_with_coeff_to_pair(const ex & e, const ex & c) const { GINAC_ASSERT(is_exactly_a(c)); if (is_exactly_a(e)) { const mul &mulref(ex_to(e)); const ex &numfactor = mulref.overall_coeff; if (likely(numfactor.is_equal(_ex1))) return expair(e, c); mul & mulcopy = dynallocate(mulref); mulcopy.overall_coeff = _ex1; mulcopy.clearflag(status_flags::evaluated | status_flags::hash_calculated); if (c.is_equal(_ex1)) return expair(mulcopy, numfactor); else return expair(mulcopy, ex_to(numfactor).mul_dyn(ex_to(c))); } else if (is_exactly_a(e)) { if (c.is_equal(_ex1)) return expair(e, _ex1); if (e.is_equal(_ex1)) return expair(c, _ex1); return expair(ex_to(e).mul_dyn(ex_to(c)), _ex1); } return expair(e, c); } expair add::combine_pair_with_coeff_to_pair(const expair & p, const ex & c) const { GINAC_ASSERT(is_exactly_a(p.coeff)); GINAC_ASSERT(is_exactly_a(c)); if (is_exactly_a(p.rest)) { GINAC_ASSERT(ex_to(p.coeff).is_equal(*_num1_p)); // should be normalized return expair(ex_to(p.rest).mul_dyn(ex_to(c)),_ex1); } return expair(p.rest,ex_to(p.coeff).mul_dyn(ex_to(c))); } ex add::recombine_pair_to_ex(const expair & p) const { if (ex_to(p.coeff).is_equal(*_num1_p)) return p.rest; else return dynallocate(p.rest, p.coeff); } ex add::expand(unsigned options) const { epvector expanded = expandchildren(options); if (expanded.empty()) return (options == 0) ? setflag(status_flags::expanded) : *this; return dynallocate(std::move(expanded), overall_coeff).setflag(options == 0 ? status_flags::expanded : 0); } } // namespace GiNaC ginac-1.7.8.orig/ginac/add.h0000644000000000000000000000666413457611471012444 0ustar /** @file add.h * * Interface to GiNaC's sums of expressions. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #ifndef GINAC_ADD_H #define GINAC_ADD_H #include "expairseq.h" namespace GiNaC { /** Sum of expressions. */ class add : public expairseq { GINAC_DECLARE_REGISTERED_CLASS(add, expairseq) friend class mul; friend class power; // other constructors public: add(const ex & lh, const ex & rh); add(const exvector & v); add(const epvector & v); add(const epvector & v, const ex & oc); add(epvector && v); add(epvector && v, const ex & oc); // functions overriding virtual functions from base classes public: unsigned precedence() const override {return 40;} bool info(unsigned inf) const override; bool is_polynomial(const ex & var) const override; int degree(const ex & s) const override; int ldegree(const ex & s) const override; ex coeff(const ex & s, int n=1) const override; ex eval() const override; ex evalm() const override; ex series(const relational & r, int order, unsigned options = 0) const override; ex normal(exmap & repl, exmap & rev_lookup) const override; numeric integer_content() const override; ex smod(const numeric &xi) const override; numeric max_coefficient() const override; ex conjugate() const override; ex real_part() const override; ex imag_part() const override; exvector get_free_indices() const override; ex eval_ncmul(const exvector & v) const override; protected: ex derivative(const symbol & s) const override; unsigned return_type() const override; return_type_t return_type_tinfo() const override; ex thisexpairseq(const epvector & v, const ex & oc, bool do_index_renaming = false) const override; ex thisexpairseq(epvector && vp, const ex & oc, bool do_index_renaming = false) const override; expair split_ex_to_pair(const ex & e) const override; expair combine_ex_with_coeff_to_pair(const ex & e, const ex & c) const override; expair combine_pair_with_coeff_to_pair(const expair & p, const ex & c) const override; ex recombine_pair_to_ex(const expair & p) const override; ex expand(unsigned options=0) const override; // non-virtual functions in this class protected: void print_add(const print_context & c, const char *openbrace, const char *closebrace, const char *mul_sym, unsigned level) const; void do_print(const print_context & c, unsigned level) const; void do_print_latex(const print_latex & c, unsigned level) const; void do_print_csrc(const print_csrc & c, unsigned level) const; void do_print_python_repr(const print_python_repr & c, unsigned level) const; }; GINAC_DECLARE_UNARCHIVER(add); } // namespace GiNaC #endif // ndef GINAC_ADD_H ginac-1.7.8.orig/ginac/archive.cpp0000644000000000000000000004332713541765057013671 0ustar /** @file archive.cpp * * Archiving of GiNaC expressions. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "archive.h" #include "registrar.h" #include "ex.h" #include "lst.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "version.h" #include #include namespace GiNaC { void archive::archive_ex(const ex &e, const char *name) { // Create root node (which recursively archives the whole expression tree) // and add it to the archive archive_node_id id = add_node(archive_node(*this, e)); // Add root node ID to list of archived expressions archived_ex ae = archived_ex(atomize(name), id); exprs.emplace_back(ae); } /** Add archive_node to archive if the corresponding expression is * not already archived. * @return ID of archived node */ archive_node_id archive::add_node(const archive_node &n) { // Look if expression is known to be in some node already. if (n.has_ex()) { auto i = exprtable.find(n.get_ex()); if (i != exprtable.end()) return i->second; nodes.push_back(n); exprtable[n.get_ex()] = nodes.size() - 1; return nodes.size() - 1; } // Not found, add archive_node to nodes vector nodes.push_back(n); return nodes.size()-1; } /** Retrieve archive_node by ID. */ archive_node &archive::get_node(archive_node_id id) { if (id >= nodes.size()) throw (std::range_error("archive::get_node(): archive node ID out of range")); return nodes[id]; } ex archive::unarchive_ex(const lst &sym_lst, const char *name) const { // Find root node std::string name_string = name; archive_atom id = atomize(name_string); auto i = exprs.begin(), iend = exprs.end(); while (i != iend) { if (i->name == id) goto found; i++; } throw (std::runtime_error("expression with name '" + name_string + "' not found in archive")); found: // Recursively unarchive all nodes, starting at the root node lst sym_lst_copy = sym_lst; return nodes[i->root].unarchive(sym_lst_copy); } ex archive::unarchive_ex(const lst &sym_lst, unsigned index) const { if (index >= exprs.size()) throw (std::range_error("index of archived expression out of range")); // Recursively unarchive all nodes, starting at the root node lst sym_lst_copy = sym_lst; return nodes[exprs[index].root].unarchive(sym_lst_copy); } ex archive::unarchive_ex(const lst &sym_lst, std::string &name, unsigned index) const { if (index >= exprs.size()) throw (std::range_error("index of archived expression out of range")); // Return expression name name = unatomize(exprs[index].name); // Recursively unarchive all nodes, starting at the root node lst sym_lst_copy = sym_lst; return nodes[exprs[index].root].unarchive(sym_lst_copy); } unsigned archive::num_expressions() const { return exprs.size(); } const archive_node &archive::get_top_node(unsigned index) const { if (index >= exprs.size()) throw (std::range_error("index of archived expression out of range")); return nodes[exprs[index].root]; } /* * Archive file format * * - 4 bytes signature 'GARC' * - unsigned version number * - unsigned number of atoms * - atom strings (each zero-terminated) * - unsigned number of expressions * - unsigned name atom * - unsigned root node ID * - unsigned number of nodes * - unsigned number of properties * - unsigned containing type (PTYPE_*) in its lower 3 bits and * name atom in the upper bits * - unsigned property value * * Unsigned quantities are stored in a compressed format: * - numbers in the range 0x00..0x7f are stored verbatim (1 byte) * - numbers larger than 0x7f are stored in 7-bit packets (1 byte per * packet), starting with the LSBs; all bytes except the last one have * their upper bit set * * Examples: * 0x00 = 0x00 * .. .. * 0x7f = 0x7f * 0x80 0x01 = 0x80 * .. .. .. * 0xff 0x01 = 0xff * 0x80 0x02 = 0x100 * .. .. .. * 0xff 0x02 = 0x17f * 0x80 0x03 = 0x180 * .. .. .. * 0xff 0x7f = 0x3fff * 0x80 0x80 0x01 = 0x4000 * .. .. .. .. */ /** Write unsigned integer quantity to stream. */ static void write_unsigned(std::ostream &os, unsigned val) { while (val >= 0x80) { os.put((val & 0x7f) | 0x80); val >>= 7; } os.put(val); } /** Read unsigned integer quantity from stream. */ static unsigned read_unsigned(std::istream &is) { unsigned char b; unsigned ret = 0; unsigned shift = 0; do { char b2; is.get(b2); b = b2; ret |= (b & 0x7f) << shift; shift += 7; } while (b & 0x80); return ret; } /** Write archive_node to binary data stream. */ std::ostream &operator<<(std::ostream &os, const archive_node &n) { // Write properties unsigned num_props = n.props.size(); write_unsigned(os, num_props); for (unsigned i=0; i>(std::istream &is, archive_node &n) { // Read properties unsigned num_props = read_unsigned(is); n.props.resize(num_props); for (unsigned i=0; i> 3; n.props[i].value = read_unsigned(is); } return is; } /** Read archive from binary data stream. */ std::istream &operator>>(std::istream &is, archive &ar) { // Read header char c1, c2, c3, c4; is.get(c1); is.get(c2); is.get(c3); is.get(c4); if (c1 != 'G' || c2 != 'A' || c3 != 'R' || c4 != 'C') throw (std::runtime_error("not a GiNaC archive (signature not found)")); constexpr unsigned max_version = GINACLIB_ARCHIVE_VERSION; constexpr unsigned min_version = GINACLIB_ARCHIVE_VERSION - GINACLIB_ARCHIVE_AGE; unsigned version = read_unsigned(is); if ((version > max_version) || (version < min_version)) throw (std::runtime_error("archive version " + std::to_string(version) + " cannot be read by this GiNaC library (which supports versions " + std::to_string(min_version) + " thru " + std::to_string(max_version))); // Read atoms unsigned num_atoms = read_unsigned(is); ar.atoms.resize(num_atoms); for (unsigned i=0; i> ar.nodes[i]; return is; } /** Atomize a string (i.e. convert it into an ID number that uniquely * represents the string). */ archive_atom archive::atomize(const std::string &s) const { // Search for string in inverse_atoms map. inv_at_cit i = inverse_atoms.find(s); if (i!=inverse_atoms.end()) return i->second; // Not found, add to atoms vector archive_atom id = atoms.size(); atoms.push_back(s); inverse_atoms[s] = id; return id; } /** Unatomize a string (i.e. convert the ID number back to the string). */ const std::string &archive::unatomize(archive_atom id) const { if (id >= atoms.size()) throw (std::range_error("archive::unatomize(): atom ID out of range")); return atoms[id]; } /** Assignment operator of archive_node. */ const archive_node &archive_node::operator=(const archive_node &other) { if (this != &other) { // archive &a member doesn't get copied props = other.props; has_expression = other.has_expression; e = other.e; } return *this; } /** Recursively construct archive node from expression. */ archive_node::archive_node(archive &ar, const ex &expr) : a(ar), has_expression(true), e(expr) { expr.bp->archive(*this); } /** Check if the archive_node stores the same expression as another * archive_node. * @return "true" if expressions are the same */ bool archive_node::has_same_ex_as(const archive_node &other) const { if (!has_expression || !other.has_expression) return false; return e.bp == other.e.bp; } archive_node::archive_node_cit archive_node::find_first(const std::string &name) const { archive_atom name_atom = a.atomize(name); for (auto i=props.begin(); i!=props.end(); ++i) if (i->name == name_atom) return i; return props.end(); } archive_node::archive_node_cit archive_node::find_last(const std::string &name) const { archive_atom name_atom = a.atomize(name); for (auto i=props.end(); i!=props.begin();) { --i; if (i->name == name_atom) return i; } return props.end(); } archive_node::archive_node_cit_range archive_node::find_property_range(const std::string &name1, const std::string &name2) const { archive_atom name1_atom = a.atomize(name1), name2_atom = a.atomize(name2); archive_node_cit_range range = {props.end(), props.end()}; for (auto i=props.begin(); i!=props.end(); ++i) { if (i->name == name1_atom && range.begin == props.end()) { range.begin = i; } if (i->name == name2_atom && range.begin != props.end()) { range.end = i + 1; } } return range; } void archive_node::add_bool(const std::string &name, bool value) { props.emplace_back(property(a.atomize(name), PTYPE_BOOL, value)); } void archive_node::add_unsigned(const std::string &name, unsigned value) { props.emplace_back(property(a.atomize(name), PTYPE_UNSIGNED, value)); } void archive_node::add_string(const std::string &name, const std::string &value) { props.emplace_back(property(a.atomize(name), PTYPE_STRING, a.atomize(value))); } void archive_node::add_ex(const std::string &name, const ex &value) { // Recursively create an archive_node and add its ID to the properties of this node archive_node_id id = a.add_node(archive_node(a, value)); props.emplace_back(property(a.atomize(name), PTYPE_NODE, id)); } bool archive_node::find_bool(const std::string &name, bool &ret, unsigned index) const { archive_atom name_atom = a.atomize(name); auto i = props.begin(), iend = props.end(); unsigned found_index = 0; while (i != iend) { if (i->type == PTYPE_BOOL && i->name == name_atom) { if (found_index == index) { ret = i->value; return true; } found_index++; } i++; } return false; } bool archive_node::find_unsigned(const std::string &name, unsigned &ret, unsigned index) const { archive_atom name_atom = a.atomize(name); auto i = props.begin(), iend = props.end(); unsigned found_index = 0; while (i != iend) { if (i->type == PTYPE_UNSIGNED && i->name == name_atom) { if (found_index == index) { ret = i->value; return true; } found_index++; } i++; } return false; } bool archive_node::find_string(const std::string &name, std::string &ret, unsigned index) const { archive_atom name_atom = a.atomize(name); auto i = props.begin(), iend = props.end(); unsigned found_index = 0; while (i != iend) { if (i->type == PTYPE_STRING && i->name == name_atom) { if (found_index == index) { ret = a.unatomize(i->value); return true; } found_index++; } i++; } return false; } void archive_node::find_ex_by_loc(archive_node_cit loc, ex &ret, lst &sym_lst) const { ret = a.get_node(loc->value).unarchive(sym_lst); } bool archive_node::find_ex(const std::string &name, ex &ret, lst &sym_lst, unsigned index) const { archive_atom name_atom = a.atomize(name); auto i = props.begin(), iend = props.end(); unsigned found_index = 0; while (i != iend) { if (i->type == PTYPE_NODE && i->name == name_atom) { if (found_index == index) { ret = a.get_node(i->value).unarchive(sym_lst); return true; } found_index++; } i++; } return false; } const archive_node &archive_node::find_ex_node(const std::string &name, unsigned index) const { archive_atom name_atom = a.atomize(name); auto i = props.begin(), iend = props.end(); unsigned found_index = 0; while (i != iend) { if (i->type == PTYPE_NODE && i->name == name_atom) { if (found_index == index) return a.get_node(i->value); found_index++; } i++; } throw (std::runtime_error("property with name '" + name + "' not found in archive node")); } void archive_node::get_properties(propinfovector &v) const { v.clear(); auto i = props.begin(), iend = props.end(); while (i != iend) { property_type type = i->type; std::string name = a.unatomize(i->name); auto a = v.begin(), aend = v.end(); bool found = false; while (a != aend) { if (a->type == type && a->name == name) { a->count++; found = true; break; } ++a; } if (!found) v.emplace_back(property_info(type, name)); i++; } } static synthesize_func find_factory_fcn(const std::string& name) { static unarchive_table_t the_table; synthesize_func ret = the_table.find(name); return ret; } /** Convert archive node to GiNaC expression. */ ex archive_node::unarchive(lst &sym_lst) const { // Already unarchived? Then return cached unarchived expression. if (has_expression) return e; // Find instantiation function for class specified in node std::string class_name; if (!find_string("class", class_name)) throw (std::runtime_error("archive node contains no class name")); // Call instantiation function synthesize_func factory_fcn = find_factory_fcn(class_name); ptr obj(factory_fcn()); obj->setflag(status_flags::dynallocated); obj->read_archive(*this, sym_lst); e = ex(*obj); has_expression = true; return e; } int unarchive_table_t::usecount = 0; unarchive_map_t* unarchive_table_t::unarch_map = nullptr; unarchive_table_t::unarchive_table_t() { if (usecount == 0) unarch_map = new unarchive_map_t(); ++usecount; } synthesize_func unarchive_table_t::find(const std::string& classname) const { unarchive_map_t::const_iterator i = unarch_map->find(classname); if (i != unarch_map->end()) return i->second; throw std::runtime_error(std::string("no unarchiving function for \"") + classname + "\" class"); } void unarchive_table_t::insert(const std::string& classname, synthesize_func f) { if (unarch_map->find(classname) != unarch_map->end()) throw std::runtime_error(std::string("Class \"" + classname + "\" is already registered")); unarch_map->operator[](classname) = f; } unarchive_table_t::~unarchive_table_t() { if (--usecount == 0) delete unarch_map; } void archive::clear() { atoms.clear(); inverse_atoms.clear(); exprs.clear(); nodes.clear(); exprtable.clear(); } /** Delete cached unarchived expressions in all archive_nodes (mainly for debugging). */ void archive::forget() { for_each(nodes.begin(), nodes.end(), std::mem_fun_ref(&archive_node::forget)); } /** Delete cached unarchived expressions from node (for debugging). */ void archive_node::forget() { has_expression = false; e = 0; } /** Print archive to stream in ugly raw format (for debugging). */ void archive::printraw(std::ostream &os) const { // Dump atoms os << "Atoms:\n"; { std::vector::const_iterator i = atoms.begin(), iend = atoms.end(); archive_atom id = 0; while (i != iend) { os << " " << id << " " << *i << std::endl; i++; id++; } } os << std::endl; // Dump expressions os << "Expressions:\n"; { auto i = exprs.begin(), iend = exprs.end(); unsigned index = 0; while (i != iend) { os << " " << index << " \"" << unatomize(i->name) << "\" root node " << i->root << std::endl; i++; index++; } } os << std::endl; // Dump nodes os << "Nodes:\n"; { auto i = nodes.begin(), iend = nodes.end(); archive_node_id id = 0; while (i != iend) { os << " " << id << " "; i->printraw(os); i++; id++; } } } /** Output archive_node to stream in ugly raw format (for debugging). */ void archive_node::printraw(std::ostream &os) const { // Dump cached unarchived expression if (has_expression) os << "(basic * " << e.bp << " = " << e << ")\n"; else os << "\n"; // Dump properties auto i = props.begin(), iend = props.end(); while (i != iend) { os << " "; switch (i->type) { case PTYPE_BOOL: os << "bool"; break; case PTYPE_UNSIGNED: os << "unsigned"; break; case PTYPE_STRING: os << "string"; break; case PTYPE_NODE: os << "node"; break; default: os << ""; break; } os << " \"" << a.unatomize(i->name) << "\" " << i->value << std::endl; i++; } } } // namespace GiNaC ginac-1.7.8.orig/ginac/archive.h0000644000000000000000000002745113541760644013333 0ustar /** @file archive.h * * Archiving of GiNaC expressions. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #ifndef GINAC_ARCHIVE_H #define GINAC_ARCHIVE_H #include "ex.h" #include #include #include #include namespace GiNaC { class archive; /** Numerical ID value to refer to an archive_node. */ typedef unsigned archive_node_id; /** Numerical ID value to refer to a string. */ typedef unsigned archive_atom; /** This class stores all properties needed to record/retrieve the state * of one object of class basic (or a derived class). Each property is * addressed by its name and data type. */ class archive_node { friend std::ostream &operator<<(std::ostream &os, const archive_node &ar); friend std::istream &operator>>(std::istream &is, archive_node &ar); public: /** Property data types */ enum property_type { PTYPE_BOOL, PTYPE_UNSIGNED, PTYPE_STRING, PTYPE_NODE }; /** Information about a stored property. A vector of these structures * is returned by get_properties(). * @see get_properties */ struct property_info { property_info() {} property_info(property_type t, const std::string &n, unsigned c = 1) : type(t), name(n), count(c) {} property_type type; /**< Data type of property. */ std::string name; /**< Name of property. */ unsigned count; /**< Number of occurrences. */ }; typedef std::vector propinfovector; /** Archived property (data type, name and associated data) */ struct property { property() {} property(archive_atom n, property_type t, unsigned v) : type(t), name(n), value(v) {} property_type type; /**< Data type of property. */ archive_atom name; /**< Name of property. */ unsigned value; /**< Stored value. */ }; typedef std::vector::const_iterator archive_node_cit; struct archive_node_cit_range { archive_node_cit begin, end; }; archive_node(archive &ar) : a(ar), has_expression(false) {} archive_node(archive &ar, const ex &expr); const archive_node &operator=(const archive_node &other); /** Add property of type "bool" to node. */ void add_bool(const std::string &name, bool value); /** Add property of type "unsigned int" to node. */ void add_unsigned(const std::string &name, unsigned value); /** Add property of type "string" to node. */ void add_string(const std::string &name, const std::string &value); /** Add property of type "ex" to node. */ void add_ex(const std::string &name, const ex &value); /** Retrieve property of type "bool" from node. * @return "true" if property was found, "false" otherwise */ bool find_bool(const std::string &name, bool &ret, unsigned index = 0) const; /** Retrieve property of type "unsigned" from node. * @return "true" if property was found, "false" otherwise */ bool find_unsigned(const std::string &name, unsigned &ret, unsigned index = 0) const; /** Retrieve property of type "string" from node. * @return "true" if property was found, "false" otherwise */ bool find_string(const std::string &name, std::string &ret, unsigned index = 0) const; /** Find the location in the vector of properties of the first/last * property with a given name. */ archive_node_cit find_first(const std::string &name) const; archive_node_cit find_last(const std::string &name) const; /** Find a range of locations in the vector of properties. The result * begins at the first property with name1 and ends one past the last * property with name2. */ archive_node_cit_range find_property_range(const std::string &name1, const std::string &name2) const; /** Retrieve property of type "ex" from node. * @return "true" if property was found, "false" otherwise */ bool find_ex(const std::string &name, ex &ret, lst &sym_lst, unsigned index = 0) const; /** Retrieve property of type "ex" from the node if it is known * that this node in fact contains such a property at the given * location. This is much more efficient than the preceding function. */ void find_ex_by_loc(archive_node_cit loc, ex &ret, lst &sym_lst) const; /** Retrieve property of type "ex" from node, returning the node of * the sub-expression. */ const archive_node &find_ex_node(const std::string &name, unsigned index = 0) const; /** Return vector of properties stored in node. */ void get_properties(propinfovector &v) const; ex unarchive(lst &sym_lst) const; bool has_same_ex_as(const archive_node &other) const; bool has_ex() const {return has_expression;} ex get_ex() const {return e;} void forget(); void printraw(std::ostream &os) const; private: /** Reference to the archive to which this node belongs. */ archive &a; /** Vector of stored properties. */ std::vector props; /** Flag indicating whether a cached unarchived representation of this node exists. */ mutable bool has_expression; /** The cached unarchived representation of this node (if any). */ mutable ex e; }; typedef basic* (*synthesize_func)(); typedef std::map unarchive_map_t; class unarchive_table_t { static int usecount; static unarchive_map_t* unarch_map; public: unarchive_table_t(); ~unarchive_table_t(); synthesize_func find(const std::string& classname) const; void insert(const std::string& classname, synthesize_func f); }; static unarchive_table_t unarch_table_instance; /** Helper macros to register a class with (un)archiving (a.k.a. * (de)serialization). * * Usage: put * * GINAC_DECLARE_UNARCHIVER(myclass); * * into the header file (in the global or namespace scope), and * * GINAC_BIND_UNARCHIVER(myclass); * * into the source file. * * Effect: the `myclass' (being a class derived directly or indirectly * from GiNaC::basic) can be archived and unarchived. * * Note: you need to use GINAC_{DECLARE,BIND}_UNARCHIVER incantations * in order to make your class (un)archivable _even if your class does * not overload `read_archive' method_. Sorry for inconvenience. * * How it works: * * The `basic' class has a `read_archive' virtual method which reads an * expression from archive. Derived classes can overload that method. * There's a small problem, though. On unarchiving all we have is a set * of named byte streams. In C++ the class name (as written in the source * code) has nothing to do with its actual type. Thus, we need establish * a correspondence ourselves. To do so we maintain a `class_name' => * `function_pointer' table (see the unarchive_table_t class above). * Every function in this table is supposed to create a new object of * the `class_name' type. The `archive_node' class uses that table to * construct an object of correct type. Next it invokes read_archive * virtual method of newly created object, which does the actual job. * * Note: this approach is very simple-minded (it does not handle classes * with same names from different namespaces, multiple inheritance, etc), * but it happens to work surprisingly well. */ #define GINAC_DECLARE_UNARCHIVER(classname) \ class classname ## _unarchiver \ { \ static int usecount; \ public: \ static GiNaC::basic* create(); \ classname ## _unarchiver(); \ ~ classname ## _unarchiver(); \ }; \ static classname ## _unarchiver classname ## _unarchiver_instance #define GINAC_BIND_UNARCHIVER(classname) \ classname ## _unarchiver::classname ## _unarchiver() \ { \ static GiNaC::unarchive_table_t table; \ if (usecount++ == 0) { \ table.insert(std::string(#classname), \ &(classname ## _unarchiver::create)); \ } \ } \ GiNaC::basic* classname ## _unarchiver::create() \ { \ return new classname(); \ } \ classname ## _unarchiver::~ classname ## _unarchiver() { } \ int classname ## _unarchiver::usecount = 0 /** This class holds archived versions of GiNaC expressions (class ex). * An archive can be constructed from an expression and then written to * a stream; or it can be read from a stream and then unarchived, yielding * back the expression. Archives can hold multiple expressions which can * be referred to by name or index number. The main component of the * archive class is a vector of archive_nodes which each store one object * of class basic (or a derived class). */ class archive { friend std::ostream &operator<<(std::ostream &os, const archive &ar); friend std::istream &operator>>(std::istream &is, archive &ar); public: archive() {} ~archive() {} /** Construct archive from expression using the default name "ex". */ archive(const ex &e) {archive_ex(e, "ex");} /** Construct archive from expression using the specified name. */ archive(const ex &e, const char *n) {archive_ex(e, n);} /** Archive an expression. * @param e the expression to be archived * @param name name under which the expression is stored */ void archive_ex(const ex &e, const char *name); /** Retrieve expression from archive by name. * @param sym_lst list of pre-defined symbols * @param name name of expression */ ex unarchive_ex(const lst &sym_lst, const char *name) const; /** Retrieve expression from archive by index. * @param sym_lst list of pre-defined symbols * @param index index of expression * @see count_expressions */ ex unarchive_ex(const lst &sym_lst, unsigned index = 0) const; /** Retrieve expression and its name from archive by index. * @param sym_lst list of pre-defined symbols * @param name receives the name of the expression * @param index index of expression * @see count_expressions */ ex unarchive_ex(const lst &sym_lst, std::string &name, unsigned index = 0) const; /** Return number of archived expressions. */ unsigned num_expressions() const; /** Return reference to top node of an expression specified by index. */ const archive_node &get_top_node(unsigned index = 0) const; /** Clear all archived expressions. */ void clear(); archive_node_id add_node(const archive_node &n); archive_node &get_node(archive_node_id id); void forget(); void printraw(std::ostream &os) const; private: /** Vector of archived nodes. */ std::vector nodes; /** Archived expression descriptor. */ struct archived_ex { archived_ex() {} archived_ex(archive_atom n, archive_node_id node) : name(n), root(node) {} archive_atom name; /**< Name of expression. */ archive_node_id root; /**< ID of root node. */ }; /** Vector of archived expression descriptors. */ std::vector exprs; public: archive_atom atomize(const std::string &s) const; const std::string &unatomize(archive_atom id) const; private: /** Vector of atomized strings (using a vector allows faster unarchiving). */ mutable std::vector atoms; /** The map of from strings to indices of the atoms vectors allows for * faster archiving. */ typedef std::map::const_iterator inv_at_cit; mutable std::map inverse_atoms; /** Map of stored expressions to nodes for faster archiving */ mutable std::map exprtable; }; std::ostream &operator<<(std::ostream &os, const archive &ar); std::istream &operator>>(std::istream &is, archive &ar); } // namespace GiNaC #endif // ndef GINAC_ARCHIVE_H ginac-1.7.8.orig/ginac/assertion.h0000644000000000000000000000231413457611471013707 0ustar /** @file assertion.h * * Assertion macro definition. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #ifndef GINAC_ASSERTION_H #define GINAC_ASSERTION_H #if !defined(GINAC_ASSERT) #if defined(DO_GINAC_ASSERT) #include /** Assertion macro for checking invariances. */ #define GINAC_ASSERT(X) assert(X) #else /** Assertion macro for checking invariances. */ #define GINAC_ASSERT(X) ((void)0) #endif #endif #endif // ndef GINAC_ASSERTION_H ginac-1.7.8.orig/ginac/basic.cpp0000644000000000000000000006465113457611471013330 0ustar /** @file basic.cpp * * Implementation of GiNaC's ABC. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "basic.h" #include "ex.h" #include "numeric.h" #include "power.h" #include "add.h" #include "symbol.h" #include "lst.h" #include "ncmul.h" #include "relational.h" #include "operators.h" #include "wildcard.h" #include "archive.h" #include "utils.h" #include "hash_seed.h" #include "inifcns.h" #include #include #include namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(basic, void, print_func(&basic::do_print). print_func(&basic::do_print_tree). print_func(&basic::do_print_python_repr)) ////////// // default constructor, destructor, copy constructor and assignment operator ////////// // public /** basic copy constructor: implicitly assumes that the other class is of * the exact same type (as it's used by duplicate()), so it can copy the * tinfo_key and the hash value. */ basic::basic(const basic & other) : flags(other.flags & ~status_flags::dynallocated), hashvalue(other.hashvalue) { } /** basic assignment operator: the other object might be of a derived class. */ const basic & basic::operator=(const basic & other) { unsigned fl = other.flags & ~status_flags::dynallocated; if (typeid(*this) != typeid(other)) { // The other object is of a derived class, so clear the flags as they // might no longer apply (especially hash_calculated). Oh, and don't // copy the tinfo_key: it is already set correctly for this object. fl &= ~(status_flags::evaluated | status_flags::expanded | status_flags::hash_calculated); } else { // The objects are of the exact same class, so copy the hash value. hashvalue = other.hashvalue; } flags = fl; set_refcount(0); return *this; } // protected // none (all inlined) ////////// // other constructors ////////// // none (all inlined) ////////// // archiving ////////// /** Construct object from archive_node. */ void basic::read_archive(const archive_node& n, lst& syms) { } /** Archive the object. */ void basic::archive(archive_node &n) const { n.add_string("class", class_name()); } ////////// // new virtual functions which can be overridden by derived classes ////////// // public /** Output to stream. This performs double dispatch on the dynamic type of * *this and the dynamic type of the supplied print context. * @param c print context object that describes the output formatting * @param level value that is used to identify the precedence or indentation * level for placing parentheses and formatting */ void basic::print(const print_context & c, unsigned level) const { print_dispatch(get_class_info(), c, level); } /** Like print(), but dispatch to the specified class. Can be used by * implementations of print methods to dispatch to the method of the * superclass. * * @see basic::print */ void basic::print_dispatch(const registered_class_info & ri, const print_context & c, unsigned level) const { // Double dispatch on object type and print_context type const registered_class_info * reg_info = &ri; const print_context_class_info * pc_info = &c.get_class_info(); next_class: const std::vector & pdt = reg_info->options.get_print_dispatch_table(); next_context: unsigned id = pc_info->options.get_id(); if (id >= pdt.size() || !(pdt[id].is_valid())) { // Method not found, try parent print_context class const print_context_class_info * parent_pc_info = pc_info->get_parent(); if (parent_pc_info) { pc_info = parent_pc_info; goto next_context; } // Method still not found, try parent class const registered_class_info * parent_reg_info = reg_info->get_parent(); if (parent_reg_info) { reg_info = parent_reg_info; pc_info = &c.get_class_info(); goto next_class; } // Method still not found. This shouldn't happen because basic (the // base class of the algebraic hierarchy) registers a method for // print_context (the base class of the print context hierarchy), // so if we end up here, there's something wrong with the class // registry. throw (std::runtime_error(std::string("basic::print(): method for ") + class_name() + "/" + c.class_name() + " not found")); } else { // Call method pdt[id](*this, c, level); } } /** Default output to stream. */ void basic::do_print(const print_context & c, unsigned level) const { c.s << "[" << class_name() << " object]"; } /** Tree output to stream. */ void basic::do_print_tree(const print_tree & c, unsigned level) const { c.s << std::string(level, ' ') << class_name() << " @" << this << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec; if (nops()) c.s << ", nops=" << nops(); c.s << std::endl; for (size_t i=0; iprint(print_dflt(std::cerr)); std::cerr << std::endl; } /** Little wrapper around printtree to be called within a debugger. * * @see basic::dbgprint */ void basic::dbgprinttree() const { this->print(print_tree(std::cerr)); } /** Return relative operator precedence (for parenthezing output). */ unsigned basic::precedence() const { return 70; } /** Information about the object. * * @see class info_flags */ bool basic::info(unsigned inf) const { // all possible properties are false for basic objects return false; } /** Number of operands/members. */ size_t basic::nops() const { // iterating from 0 to nops() on atomic objects should be an empty loop, // and accessing their elements is a range error. Container objects should // override this. return 0; } /** Return operand/member at position i. */ ex basic::op(size_t i) const { throw(std::range_error(std::string("basic::op(): ") + class_name() + std::string(" has no operands"))); } /** Return modifiable operand/member at position i. */ ex & basic::let_op(size_t i) { ensure_if_modifiable(); throw(std::range_error(std::string("basic::let_op(): ") + class_name() + std::string(" has no operands"))); } ex basic::operator[](const ex & index) const { if (is_exactly_a(index)) return op(static_cast(ex_to(index).to_int())); throw(std::invalid_argument(std::string("non-numeric indices not supported by ") + class_name())); } ex basic::operator[](size_t i) const { return op(i); } ex & basic::operator[](const ex & index) { if (is_exactly_a(index)) return let_op(ex_to(index).to_int()); throw(std::invalid_argument(std::string("non-numeric indices not supported by ") + class_name())); } ex & basic::operator[](size_t i) { return let_op(i); } /** Test for occurrence of a pattern. An object 'has' a pattern if it matches * the pattern itself or one of the children 'has' it. As a consequence * (according to the definition of children) given e=x+y+z, e.has(x) is true * but e.has(x+y) is false. */ bool basic::has(const ex & pattern, unsigned options) const { exmap repl_lst; if (match(pattern, repl_lst)) return true; for (size_t i=0; ilet_op(i) = n; } } if (copy) { copy->clearflag(status_flags::hash_calculated | status_flags::expanded); return *copy; } else return *this; } /** Check whether this is a polynomial in the given variables. */ bool basic::is_polynomial(const ex & var) const { return !has(var) || is_equal(ex_to(var)); } /** Return degree of highest power in object s. */ int basic::degree(const ex & s) const { return is_equal(ex_to(s)) ? 1 : 0; } /** Return degree of lowest power in object s. */ int basic::ldegree(const ex & s) const { return is_equal(ex_to(s)) ? 1 : 0; } /** Return coefficient of degree n in object s. */ ex basic::coeff(const ex & s, int n) const { if (is_equal(ex_to(s))) return n==1 ? _ex1 : _ex0; else return n==0 ? *this : _ex0; } /** Sort expanded expression in terms of powers of some object(s). * @param s object(s) to sort in * @param distributed recursive or distributed form (only used when s is a list) */ ex basic::collect(const ex & s, bool distributed) const { ex x; if (is_a(s)) { // List of objects specified if (s.nops() == 0) return *this; if (s.nops() == 1) return collect(s.op(0)); else if (distributed) { x = this->expand(); if (! is_a(x)) return x; const lst& l(ex_to(s)); exmap cmap; cmap[_ex1] = _ex0; for (const auto & xi : x) { ex key = _ex1; ex pre_coeff = xi; for (auto & li : l) { int cexp = pre_coeff.degree(li); pre_coeff = pre_coeff.coeff(li, cexp); key *= pow(li, cexp); } auto ci = cmap.find(key); if (ci != cmap.end()) ci->second += pre_coeff; else cmap.insert(exmap::value_type(key, pre_coeff)); } exvector resv; for (auto & mi : cmap) resv.push_back((mi.first)*(mi.second)); return dynallocate(resv); } else { // Recursive form x = *this; size_t n = s.nops() - 1; while (true) { x = x.collect(s[n]); if (n == 0) break; n--; } } } else { // Only one object specified for (int n=this->ldegree(s); n<=this->degree(s); ++n) x += this->coeff(s,n)*power(s,n); } // correct for lost fractional arguments and return return x + (*this - x).expand(); } /** Perform automatic non-interruptive term rewriting rules. */ ex basic::eval() const { // There is nothing to do for basic objects: return hold(); } /** Function object to be applied by basic::evalf(). */ struct evalf_map_function : public map_function { ex operator()(const ex & e) override { return evalf(e); } }; /** Evaluate object numerically. */ ex basic::evalf() const { if (nops() == 0) return *this; else { evalf_map_function map_evalf; return map(map_evalf); } } /** Function object to be applied by basic::evalm(). */ struct evalm_map_function : public map_function { ex operator()(const ex & e) override { return evalm(e); } } map_evalm; /** Evaluate sums, products and integer powers of matrices. */ ex basic::evalm() const { if (nops() == 0) return *this; else return map(map_evalm); } /** Function object to be applied by basic::eval_integ(). */ struct eval_integ_map_function : public map_function { ex operator()(const ex & e) override { return eval_integ(e); } } map_eval_integ; /** Evaluate integrals, if result is known. */ ex basic::eval_integ() const { if (nops() == 0) return *this; else return map(map_eval_integ); } /** Perform automatic symbolic evaluations on indexed expression that * contains this object as the base expression. */ ex basic::eval_indexed(const basic & i) const // this function can't take a "const ex & i" because that would result // in an infinite eval() loop { // There is nothing to do for basic objects return i.hold(); } /** Add two indexed expressions. They are guaranteed to be of class indexed * (or a subclass) and their indices are compatible. This function is used * internally by simplify_indexed(). * * @param self First indexed expression; its base object is *this * @param other Second indexed expression * @return sum of self and other * @see ex::simplify_indexed() */ ex basic::add_indexed(const ex & self, const ex & other) const { return self + other; } /** Multiply an indexed expression with a scalar. This function is used * internally by simplify_indexed(). * * @param self Indexed expression; its base object is *this * @param other Numeric value * @return product of self and other * @see ex::simplify_indexed() */ ex basic::scalar_mul_indexed(const ex & self, const numeric & other) const { return self * other; } /** Try to contract two indexed expressions that appear in the same product. * If a contraction exists, the function overwrites one or both of the * expressions and returns true. Otherwise it returns false. It is * guaranteed that both expressions are of class indexed (or a subclass) * and that at least one dummy index has been found. This functions is * used internally by simplify_indexed(). * * @param self Pointer to first indexed expression; its base object is *this * @param other Pointer to second indexed expression * @param v The complete vector of factors * @return true if the contraction was successful, false otherwise * @see ex::simplify_indexed() */ bool basic::contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const { // Do nothing return false; } /** Check whether the expression matches a given pattern. For every wildcard * object in the pattern, a pair with the wildcard as a key and matching * expression as a value is added to repl_lst. */ bool basic::match(const ex & pattern, exmap& repl_lst) const { /* Sweet sweet shapes, sweet sweet shapes, That's the key thing, right right. Feed feed face, feed feed shapes, But who is the king tonight? Who is the king tonight? Pattern is the thing, the key thing-a-ling, But who is the king of Pattern? But who is the king, the king thing-a-ling, Who is the king of Pattern? Bog is the king, the king thing-a-ling, Bog is the king of Pattern. Ba bu-bu-bu-bu bu-bu-bu-bu-bu-bu bu-bu Bog is the king of Pattern. */ if (is_exactly_a(pattern)) { // Wildcard matches anything, but check whether we already have found // a match for that wildcard first (if so, the earlier match must be // the same expression) for (auto & it : repl_lst) { if (it.first.is_equal(pattern)) return is_equal(ex_to(it.second)); } repl_lst[pattern] = *this; return true; } else { // Expression must be of the same type as the pattern if (typeid(*this) != typeid(ex_to(pattern))) return false; // Number of subexpressions must match if (nops() != pattern.nops()) return false; // No subexpressions? Then just compare the objects (there can't be // wildcards in the pattern) if (nops() == 0) return is_equal_same_type(ex_to(pattern)); // Check whether attributes that are not subexpressions match if (!match_same_type(ex_to(pattern))) return false; // Even if the expression does not match the pattern, some of // its subexpressions could match it. For example, x^5*y^(-1) // does not match the pattern $0^5, but its subexpression x^5 // does. So, save repl_lst in order to not add bogus entries. exmap tmp_repl = repl_lst; // Otherwise the subexpressions must match one-to-one for (size_t i=0; isecond; return thisex; } else { for (auto & it : m) { exmap repl_lst; if (match(ex_to(it.first), repl_lst)) return it.second.subs(repl_lst, options | subs_options::no_pattern); // avoid infinite recursion when re-substituting the wildcards } } return *this; } /** Substitute a set of objects by arbitrary expressions. The ex returned * will already be evaluated. */ ex basic::subs(const exmap & m, unsigned options) const { size_t num = nops(); if (num) { // Substitute in subexpressions for (size_t i=0; iclearflag(status_flags::hash_calculated | status_flags::expanded); // Substitute the changed operand copy->let_op(i++) = subsed_op; // Substitute the other operands for (; ilet_op(i) = op(i).subs(m, options); // Perform substitutions on the new object as a whole return copy->subs_one_level(m, options); } } } // Nothing changed or no subexpressions return subs_one_level(m, options); } /** Default interface of nth derivative ex::diff(s, n). It should be called * instead of ::derivative(s) for first derivatives and for nth derivatives it * just recurses down. * * @param s symbol to differentiate in * @param nth order of differentiation * @see ex::diff */ ex basic::diff(const symbol & s, unsigned nth) const { // trivial: zeroth derivative if (nth==0) return ex(*this); // evaluate unevaluated *this before differentiating if (!(flags & status_flags::evaluated)) return ex(*this).diff(s, nth); ex ndiff = this->derivative(s); while (!ndiff.is_zero() && // stop differentiating zeros nth>1) { ndiff = ndiff.diff(s); --nth; } return ndiff; } /** Return a vector containing the free indices of an expression. */ exvector basic::get_free_indices() const { return exvector(); // return an empty exvector } ex basic::conjugate() const { return *this; } ex basic::real_part() const { return real_part_function(*this).hold(); } ex basic::imag_part() const { return imag_part_function(*this).hold(); } ex basic::eval_ncmul(const exvector & v) const { return hold_ncmul(v); } // protected /** Function object to be applied by basic::derivative(). */ struct derivative_map_function : public map_function { const symbol &s; derivative_map_function(const symbol &sym) : s(sym) {} ex operator()(const ex & e) override { return diff(e, s); } }; /** Default implementation of ex::diff(). It maps the operation on the * operands (or returns 0 when the object has no operands). * * @see ex::diff */ ex basic::derivative(const symbol & s) const { if (nops() == 0) return _ex0; else { derivative_map_function map_derivative(s); return map(map_derivative); } } /** Returns order relation between two objects of same type. This needs to be * implemented by each class. It may never return anything else than 0, * signalling equality, or +1 and -1 signalling inequality and determining * the canonical ordering. (Perl hackers will wonder why C++ doesn't feature * the spaceship operator <=> for denoting just this.) */ int basic::compare_same_type(const basic & other) const { return compare_pointers(this, &other); } /** Returns true if two objects of same type are equal. Normally needs * not be reimplemented as long as it wasn't overwritten by some parent * class, since it just calls compare_same_type(). The reason why this * function exists is that sometimes it is easier to determine equality * than an order relation and then it can be overridden. */ bool basic::is_equal_same_type(const basic & other) const { return compare_same_type(other)==0; } /** Returns true if the attributes of two objects are similar enough for * a match. This function must not match subexpressions (this is already * done by basic::match()). Only attributes not accessible by op() should * be compared. This is also the reason why this function doesn't take the * wildcard replacement list from match() as an argument: only subexpressions * are subject to wildcard matches. Also, this function only needs to be * implemented for container classes because is_equal_same_type() is * automatically used instead of match_same_type() if nops() == 0. * * @see basic::match */ bool basic::match_same_type(const basic & other) const { // The default is to only consider subexpressions, but not any other // attributes return true; } unsigned basic::return_type() const { return return_types::commutative; } return_type_t basic::return_type_tinfo() const { return_type_t rt; rt.tinfo = &typeid(*this); rt.rl = 0; return rt; } /** Compute the hash value of an object and if it makes sense to store it in * the objects status_flags, do so. The method inherited from class basic * computes a hash value based on the type and hash values of possible * members. For this reason it is well suited for container classes but * atomic classes should override this implementation because otherwise they * would all end up with the same hashvalue. */ unsigned basic::calchash() const { unsigned v = make_hash_seed(typeid(*this)); for (size_t i=0; iop(i).gethash(); } // store calculated hash value only if object is already evaluated if (flags & status_flags::evaluated) { setflag(status_flags::hash_calculated); hashvalue = v; } return v; } /** Function object to be applied by basic::expand(). */ struct expand_map_function : public map_function { unsigned options; expand_map_function(unsigned o) : options(o) {} ex operator()(const ex & e) override { return e.expand(options); } }; /** Expand expression, i.e. multiply it out and return the result as a new * expression. */ ex basic::expand(unsigned options) const { if (nops() == 0) return (options == 0) ? setflag(status_flags::expanded) : *this; else { expand_map_function map_expand(options); return ex_to(map(map_expand)).setflag(options == 0 ? status_flags::expanded : 0); } } ////////// // non-virtual functions in this class ////////// // public /** Compare objects syntactically to establish canonical ordering. * All compare functions return: -1 for *this less than other, 0 equal, * 1 greater. */ int basic::compare(const basic & other) const { #ifdef GINAC_COMPARE_STATISTICS compare_statistics.total_basic_compares++; #endif const unsigned hash_this = gethash(); const unsigned hash_other = other.gethash(); if (hash_thishash_other) return 1; #ifdef GINAC_COMPARE_STATISTICS compare_statistics.compare_same_hashvalue++; #endif const std::type_info& typeid_this = typeid(*this); const std::type_info& typeid_other = typeid(other); if (typeid_this == typeid_other) { // int cmpval = compare_same_type(other); // if (cmpval!=0) { // std::cout << "hash collision, same type: " // << *this << " and " << other << std::endl; // this->print(print_tree(std::cout)); // std::cout << " and "; // other.print(print_tree(std::cout)); // std::cout << std::endl; // } // return cmpval; #ifdef GINAC_COMPARE_STATISTICS compare_statistics.compare_same_type++; #endif return compare_same_type(other); } else { // std::cout << "hash collision, different types: " // << *this << " and " << other << std::endl; // this->print(print_tree(std::cout)); // std::cout << " and "; // other.print(print_tree(std::cout)); // std::cout << std::endl; return (typeid_this.before(typeid_other) ? -1 : 1); } } /** Test for syntactic equality. * This is only a quick test, meaning objects should be in the same domain. * You might have to .expand(), .normal() objects first, depending on the * domain of your computation, to get a more reliable answer. * * @see is_equal_same_type */ bool basic::is_equal(const basic & other) const { #ifdef GINAC_COMPARE_STATISTICS compare_statistics.total_basic_is_equals++; #endif if (this->gethash()!=other.gethash()) return false; #ifdef GINAC_COMPARE_STATISTICS compare_statistics.is_equal_same_hashvalue++; #endif if (typeid(*this) != typeid(other)) return false; #ifdef GINAC_COMPARE_STATISTICS compare_statistics.is_equal_same_type++; #endif return is_equal_same_type(other); } // protected /** Stop further evaluation. * * @see basic::eval */ const basic & basic::hold() const { return setflag(status_flags::evaluated); } /** Ensure the object may be modified without hurting others, throws if this * is not the case. */ void basic::ensure_if_modifiable() const { if (get_refcount() > 1) throw(std::runtime_error("cannot modify multiply referenced object")); clearflag(status_flags::hash_calculated | status_flags::evaluated); } ////////// // global variables ////////// #ifdef GINAC_COMPARE_STATISTICS compare_statistics_t::~compare_statistics_t() { std::clog << "ex::compare() called " << total_compares << " times" << std::endl; std::clog << "nontrivial compares: " << nontrivial_compares << " times" << std::endl; std::clog << "basic::compare() called " << total_basic_compares << " times" << std::endl; std::clog << "same hashvalue in compare(): " << compare_same_hashvalue << " times" << std::endl; std::clog << "compare_same_type() called " << compare_same_type << " times" << std::endl; std::clog << std::endl; std::clog << "ex::is_equal() called " << total_is_equals << " times" << std::endl; std::clog << "nontrivial is_equals: " << nontrivial_is_equals << " times" << std::endl; std::clog << "basic::is_equal() called " << total_basic_is_equals << " times" << std::endl; std::clog << "same hashvalue in is_equal(): " << is_equal_same_hashvalue << " times" << std::endl; std::clog << "is_equal_same_type() called " << is_equal_same_type << " times" << std::endl; std::clog << std::endl; std::clog << "basic::gethash() called " << total_gethash << " times" << std::endl; std::clog << "used cached hashvalue " << gethash_cached << " times" << std::endl; } compare_statistics_t compare_statistics; #endif } // namespace GiNaC ginac-1.7.8.orig/ginac/basic.h0000644000000000000000000002474013457611471012770 0ustar /** @file basic.h * * Interface to GiNaC's ABC. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #ifndef GINAC_BASIC_H #define GINAC_BASIC_H #include "flags.h" #include "ptr.h" #include "assertion.h" #include "registrar.h" #include // for size_t #include #include #include // for typeid #include #include namespace GiNaC { class ex; struct ex_is_less; class symbol; class numeric; class relational; class archive_node; class print_context; typedef std::vector exvector; typedef std::set exset; typedef std::map exmap; // Define this to enable some statistical output for comparisons and hashing #undef GINAC_COMPARE_STATISTICS #ifdef GINAC_COMPARE_STATISTICS class compare_statistics_t { public: compare_statistics_t() : total_compares(0), nontrivial_compares(0), total_basic_compares(0), compare_same_hashvalue(0), compare_same_type(0), total_is_equals(0), nontrivial_is_equals(0), total_basic_is_equals(0), is_equal_same_hashvalue(0), is_equal_same_type(0), total_gethash(0), gethash_cached(0) {} ~compare_statistics_t(); unsigned long total_compares; unsigned long nontrivial_compares; unsigned long total_basic_compares; unsigned long compare_same_hashvalue; unsigned long compare_same_type; unsigned long total_is_equals; unsigned long nontrivial_is_equals; unsigned long total_basic_is_equals; unsigned long is_equal_same_hashvalue; unsigned long is_equal_same_type; unsigned long total_gethash; unsigned long gethash_cached; }; extern compare_statistics_t compare_statistics; #endif /** Function object for map(). */ struct map_function { virtual ~map_function() {} typedef const ex & argument_type; typedef ex result_type; virtual ex operator()(const ex & e) = 0; }; /** Degenerate base class for visitors. basic and derivative classes * support Robert C. Martin's Acyclic Visitor pattern (cf. * http://condor.depaul.edu/dmumaugh/OOT/Design-Principles/acv.pdf * or chapter 10 of Andrei Alexandrescu's "Modern C++ Design"). */ class visitor { protected: virtual ~visitor() {} }; /** This class is the ABC (abstract base class) of GiNaC's class hierarchy. */ class basic : public refcounted { GINAC_DECLARE_REGISTERED_CLASS_NO_CTORS(basic, void) friend class ex; // default constructor, destructor, copy constructor and assignment operator protected: basic() : flags(0) {} public: /** basic destructor, virtual because class ex will delete objects of * derived classes via a basic*. */ virtual ~basic() { GINAC_ASSERT((!(flags & status_flags::dynallocated)) || (get_refcount() == 0)); } basic(const basic & other); const basic & operator=(const basic & other); protected: // new virtual functions which can be overridden by derived classes public: // only const functions please (may break reference counting) /** Create a clone of this object on the heap. One can think of this as * simulating a virtual copy constructor which is needed for instance by * the refcounted construction of an ex from a basic. */ virtual basic * duplicate() const { basic * bp = new basic(*this); bp->setflag(status_flags::dynallocated); return bp; } // evaluation virtual ex eval() const; virtual ex evalf() const; virtual ex evalm() const; virtual ex eval_integ() const; protected: virtual ex eval_ncmul(const exvector & v) const; public: virtual ex eval_indexed(const basic & i) const; // printing virtual void print(const print_context & c, unsigned level = 0) const; virtual void dbgprint() const; virtual void dbgprinttree() const; virtual unsigned precedence() const; // info virtual bool info(unsigned inf) const; // operand access virtual size_t nops() const; virtual ex op(size_t i) const; virtual ex operator[](const ex & index) const; virtual ex operator[](size_t i) const; virtual ex & let_op(size_t i); virtual ex & operator[](const ex & index); virtual ex & operator[](size_t i); // pattern matching virtual bool has(const ex & other, unsigned options = 0) const; virtual bool match(const ex & pattern, exmap & repls) const; protected: virtual bool match_same_type(const basic & other) const; public: // substitutions virtual ex subs(const exmap & m, unsigned options = 0) const; // function mapping virtual ex map(map_function & f) const; // visitors and tree traversal virtual void accept(GiNaC::visitor & v) const { if (visitor *p = dynamic_cast(&v)) p->visit(*this); } // degree/coeff virtual bool is_polynomial(const ex & var) const; virtual int degree(const ex & s) const; virtual int ldegree(const ex & s) const; virtual ex coeff(const ex & s, int n = 1) const; // expand/collect virtual ex expand(unsigned options = 0) const; virtual ex collect(const ex & s, bool distributed = false) const; // differentiation and series expansion protected: virtual ex derivative(const symbol & s) const; public: virtual ex series(const relational & r, int order, unsigned options = 0) const; // rational functions virtual ex normal(exmap & repl, exmap & rev_lookup) const; virtual ex to_rational(exmap & repl) const; virtual ex to_polynomial(exmap & repl) const; // polynomial algorithms virtual numeric integer_content() const; virtual ex smod(const numeric &xi) const; virtual numeric max_coefficient() const; // indexed objects virtual exvector get_free_indices() const; virtual ex add_indexed(const ex & self, const ex & other) const; virtual ex scalar_mul_indexed(const ex & self, const numeric & other) const; virtual bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const; // noncommutativity virtual unsigned return_type() const; virtual return_type_t return_type_tinfo() const; // functions for complex expressions virtual ex conjugate() const; virtual ex real_part() const; virtual ex imag_part() const; // functions that should be called from class ex only protected: virtual int compare_same_type(const basic & other) const; virtual bool is_equal_same_type(const basic & other) const; virtual unsigned calchash() const; // non-virtual functions in this class public: /** Like print(), but dispatch to the specified class. Can be used by * implementations of print methods to dispatch to the method of the * superclass. * * @see basic::print */ template void print_dispatch(const print_context & c, unsigned level) const { print_dispatch(T::get_class_info_static(), c, level); } void print_dispatch(const registered_class_info & ri, const print_context & c, unsigned level) const; /** Save (serialize) the object into archive node. * * Losely speaking, this method turns an expression into a byte * stream (which can be saved and restored later on, or sent via * network, etc.) */ virtual void archive(archive_node& n) const; /** Load (deserialize) the object from an archive node. * * @note This method is essentially a constructor. However, * constructors can't be virtual. So, if unarchiving routines * are implemented as constructors one would need to define such * a constructor in every class, even if all it does is simply * calling constructor of a superclass. */ virtual void read_archive(const archive_node& n, lst& syms); // no const ex subs_one_level(const exmap & m, unsigned options) const; ex diff(const symbol & s, unsigned nth = 1) const; int compare(const basic & other) const; bool is_equal(const basic & other) const; const basic & hold() const; unsigned gethash() const { #ifdef GINAC_COMPARE_STATISTICS compare_statistics.total_gethash++; #endif if (flags & status_flags::hash_calculated) { #ifdef GINAC_COMPARE_STATISTICS compare_statistics.gethash_cached++; #endif return hashvalue; } else { return calchash(); } } /** Set some status_flags. */ const basic & setflag(unsigned f) const {flags |= f; return *this;} /** Clear some status_flags. */ const basic & clearflag(unsigned f) const {flags &= ~f; return *this;} protected: void ensure_if_modifiable() const; void do_print(const print_context & c, unsigned level) const; void do_print_tree(const print_tree & c, unsigned level) const; void do_print_python_repr(const print_python_repr & c, unsigned level) const; // member variables protected: mutable unsigned flags; ///< of type status_flags mutable unsigned hashvalue; ///< hash value }; // global variables // convenience type checker template functions /** Check if obj is a T, including base classes. */ template inline bool is_a(const basic &obj) { return dynamic_cast(&obj) != nullptr; } /** Check if obj is a T, not including base classes. */ template inline bool is_exactly_a(const basic & obj) { return typeid(T) == typeid(obj); } /** Constructs a new (class basic or derived) B object on the heap. * * This function picks the object's ctor based on the given argument types. * * This helps the constructor of ex from basic (or a derived class B) because * then the constructor doesn't have to duplicate the object onto the heap. * See ex::construct_from_basic(const basic &) for more information. */ template inline B & dynallocate(Args &&... args) { return const_cast(static_cast((new B(std::forward(args)...))->setflag(status_flags::dynallocated))); } /** Constructs a new (class basic or derived) B object on the heap. * * This function is needed for GiNaC classes which have public ctors from * initializer lists of expressions (which are not a type and not captured * by the variadic template version). */ template inline B & dynallocate(std::initializer_list il) { return const_cast(static_cast((new B(il))->setflag(status_flags::dynallocated))); } } // namespace GiNaC #endif // ndef GINAC_BASIC_H ginac-1.7.8.orig/ginac/class_info.h0000644000000000000000000001261313457611471014023 0ustar /** @file class_info.h * * Helper templates to provide per-class information for class hierarchies. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #ifndef GINAC_CLASS_INFO_H #define GINAC_CLASS_INFO_H #include // for size_t #include #include #include #include #include #include #include namespace GiNaC { // OPT is the class that stores the actual per-class data. It must provide // get_name(), get_parent_name() and get_id() members. template class class_info { public: class_info(const OPT & o) : options(o), next(first), parent(nullptr) { first = this; parents_identified = false; } /** Get pointer to class_info of parent class (or nullptr). */ class_info *get_parent() const { identify_parents(); return parent; } /** Find class_info by name. */ static const class_info *find(const std::string &class_name); /** Dump class hierarchy to std::cout. */ static void dump_hierarchy(bool verbose = false); OPT options; private: struct tree_node { tree_node(class_info *i) : info(i) {} void add_child(tree_node *n) { children.push_back(n); } std::vector children; class_info *info; }; static void dump_tree(tree_node *n, const std::string & prefix, bool verbose); static void identify_parents(); static class_info *first; class_info *next; mutable class_info *parent; static bool parents_identified; }; template const class_info *class_info::find(const std::string &class_name) { // Use a map for faster lookup. The registered_class_info list doesn't // change at run-time, so it's sufficient to construct the map once // on the first trip through this function. typedef std::map name_map_type; static name_map_type name_map; static bool name_map_initialized = false; if (!name_map_initialized) { // Construct map const class_info *p = first; while (p) { name_map[p->options.get_name()] = p; p = p->next; } name_map_initialized = true; } typename name_map_type::const_iterator it = name_map.find(class_name); if (it == name_map.end()) throw (std::runtime_error("class '" + class_name + "' not registered")); else return it->second; } template void class_info::dump_tree(tree_node *n, const std::string & prefix, bool verbose) { std::string name = n->info->options.get_name(); std::cout << name; if (verbose) std::cout << " [ID 0x" << std::hex << std::setw(8) << std::setfill('0') << n->info->options.get_id() << std::dec << "]" << std::endl; size_t num_children = n->children.size(); if (num_children) { for (size_t i = 0; i < num_children; ++i) { if (verbose) { std::cout << prefix << " +- "; if (i == num_children - 1) dump_tree(n->children[i], prefix + " ", verbose); else dump_tree(n->children[i], prefix + " | ", verbose); } else { std::string spaces(name.size(), ' '); if (i > 0) std::cout << prefix << spaces; if (num_children == 1) std::cout << " --- "; else if (i > 0) std::cout << " +- "; else std::cout << " -+- "; if (i == num_children - 1) dump_tree(n->children[i], prefix + spaces + " ", verbose); else dump_tree(n->children[i], prefix + spaces + " | ", verbose); } } } else if (!verbose) std::cout << std::endl; } template void class_info::dump_hierarchy(bool verbose) { identify_parents(); // Create tree nodes for all class_infos std::vector tree; for (class_info *p = first; p; p = p->next) tree.push_back(tree_node(p)); // Identify children for all nodes and find the root tree_node *root = nullptr; for (typename std::vector::iterator i = tree.begin(); i != tree.end(); ++i) { class_info *p = i->info->get_parent(); if (p) { for (typename std::vector::iterator j = tree.begin(); j != tree.end(); ++j) { if (j->info == p) { j->add_child(&*i); break; } } } else root = &*i; } // Print hierarchy tree starting at the root dump_tree(root, "", verbose); } template void class_info::identify_parents() { if (!parents_identified) { for (class_info *p = first; p; p = p->next) { const char *parent_name = p->options.get_parent_name(); for (class_info *q = first; q; q = q->next) { if (std::strcmp(q->options.get_name(), parent_name) == 0) { p->parent = q; break; } } } parents_identified = true; } } template class_info *class_info::first = nullptr; template bool class_info::parents_identified = false; } // namespace GiNaC #endif // ndef GINAC_CLASS_INFO_H ginac-1.7.8.orig/ginac/clifford.cpp0000644000000000000000000013050113457611471014023 0ustar /** @file clifford.cpp * * Implementation of GiNaC's clifford algebra (Dirac gamma) objects. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "clifford.h" #include "ex.h" #include "idx.h" #include "ncmul.h" #include "symbol.h" #include "numeric.h" // for I #include "symmetry.h" #include "lst.h" #include "relational.h" #include "operators.h" #include "add.h" #include "mul.h" #include "power.h" #include "matrix.h" #include "archive.h" #include "utils.h" #include namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(clifford, indexed, print_func(&clifford::do_print_dflt). print_func(&clifford::do_print_latex). print_func(&clifford::do_print_tree)) GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(diracone, tensor, print_func(&diracone::do_print). print_func(&diracone::do_print_latex)) GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(cliffordunit, tensor, print_func(&cliffordunit::do_print). print_func(&cliffordunit::do_print_latex)) GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(diracgamma, cliffordunit, print_func(&diracgamma::do_print). print_func(&diracgamma::do_print_latex)) GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(diracgamma5, tensor, print_func(&diracgamma5::do_print). print_func(&diracgamma5::do_print_latex)) GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(diracgammaL, tensor, print_func(&diracgammaL::do_print). print_func(&diracgammaL::do_print_latex)) GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(diracgammaR, tensor, print_func(&diracgammaR::do_print). print_func(&diracgammaR::do_print_latex)) ////////// // default constructors ////////// clifford::clifford() : representation_label(0), metric(0), commutator_sign(-1) { } DEFAULT_CTOR(diracone) DEFAULT_CTOR(cliffordunit) DEFAULT_CTOR(diracgamma) DEFAULT_CTOR(diracgamma5) DEFAULT_CTOR(diracgammaL) DEFAULT_CTOR(diracgammaR) ////////// // other constructors ////////// /** Construct object without any indices. This constructor is for internal * use only. Use the dirac_ONE() function instead. * @see dirac_ONE */ clifford::clifford(const ex & b, unsigned char rl) : inherited(b), representation_label(rl), metric(0), commutator_sign(-1) { } /** Construct object with one Lorentz index. This constructor is for internal * use only. Use the clifford_unit() or dirac_gamma() functions instead. * @see clifford_unit * @see dirac_gamma */ clifford::clifford(const ex & b, const ex & mu, const ex & metr, unsigned char rl, int comm_sign) : inherited(b, mu), representation_label(rl), metric(metr), commutator_sign(comm_sign) { GINAC_ASSERT(is_a(mu)); } clifford::clifford(unsigned char rl, const ex & metr, int comm_sign, const exvector & v) : inherited(not_symmetric(), v), representation_label(rl), metric(metr), commutator_sign(comm_sign) { } clifford::clifford(unsigned char rl, const ex & metr, int comm_sign, exvector && v) : inherited(not_symmetric(), std::move(v)), representation_label(rl), metric(metr), commutator_sign(comm_sign) { } return_type_t clifford::return_type_tinfo() const { return make_return_type_t(representation_label); } ////////// // archiving ////////// void clifford::read_archive(const archive_node& n, lst& sym_lst) { inherited::read_archive(n, sym_lst); unsigned rl; n.find_unsigned("label", rl); representation_label = rl; n.find_ex("metric", metric, sym_lst); n.find_unsigned("commutator_sign+1", rl); commutator_sign = rl - 1; } void clifford::archive(archive_node & n) const { inherited::archive(n); n.add_unsigned("label", representation_label); n.add_ex("metric", metric); n.add_unsigned("commutator_sign+1", commutator_sign+1); } GINAC_BIND_UNARCHIVER(clifford); GINAC_BIND_UNARCHIVER(cliffordunit); GINAC_BIND_UNARCHIVER(diracone); GINAC_BIND_UNARCHIVER(diracgamma); GINAC_BIND_UNARCHIVER(diracgamma5); GINAC_BIND_UNARCHIVER(diracgammaL); GINAC_BIND_UNARCHIVER(diracgammaR); ex clifford::get_metric(const ex & i, const ex & j, bool symmetrised) const { if (is_a(metric)) { if (symmetrised && !(ex_to(ex_to(metric).get_symmetry()).has_symmetry())) { if (is_a(metric.op(0))) { return indexed((ex_to(metric.op(0)).add(ex_to(metric.op(0)).transpose())).mul(numeric(1, 2)), symmetric2(), i, j); } else { return simplify_indexed(indexed(metric.op(0)*_ex1_2, i, j) + indexed(metric.op(0)*_ex1_2, j, i)); } } else { return metric.subs(lst{metric.op(1) == i, metric.op(2) == j}, subs_options::no_pattern); } } else { exvector indices = metric.get_free_indices(); if (symmetrised) return _ex1_2*simplify_indexed(metric.subs(lst{indices[0] == i, indices[1] == j}, subs_options::no_pattern) + metric.subs(lst{indices[0] == j, indices[1] == i}, subs_options::no_pattern)); else return metric.subs(lst{indices[0] == i, indices[1] == j}, subs_options::no_pattern); } } bool clifford::same_metric(const ex & other) const { ex metr; if (is_a(other)) metr = ex_to(other).get_metric(); else metr = other; if (is_a(metr)) return metr.op(0).is_equal(get_metric().op(0)); else { exvector indices = metr.get_free_indices(); return (indices.size() == 2) && simplify_indexed(get_metric(indices[0], indices[1])-metr).is_zero(); } } ////////// // functions overriding virtual functions from base classes ////////// ex clifford::op(size_t i) const { GINAC_ASSERT(i(subsed)) { ex prevmetric = ex_to(subsed).metric; ex newmetric = prevmetric.subs(m, options); if(!are_ex_trivially_equal(prevmetric, newmetric)) { clifford c = ex_to(subsed); c.metric = newmetric; subsed = c; } } return subsed; } int clifford::compare_same_type(const basic & other) const { GINAC_ASSERT(is_a(other)); const clifford &o = static_cast(other); if (representation_label != o.representation_label) { // different representation label return representation_label < o.representation_label ? -1 : 1; } return inherited::compare_same_type(other); } bool clifford::match_same_type(const basic & other) const { GINAC_ASSERT(is_a(other)); const clifford &o = static_cast(other); return ((representation_label == o.representation_label) && (commutator_sign == o.get_commutator_sign()) && same_metric(o)); } static bool is_dirac_slash(const ex & seq0) { return !is_a(seq0) && !is_a(seq0) && !is_a(seq0) && !is_a(seq0) && !is_a(seq0); } void clifford::do_print_dflt(const print_dflt & c, unsigned level) const { // dirac_slash() object is printed differently if (is_dirac_slash(seq[0])) { seq[0].print(c, precedence()); c.s << "\\"; } else { // We do not print representation label if it is 0 if (representation_label == 0) { this->print_dispatch(c, level); } else { // otherwise we put it before indices in square brackets; the code is borrowed from indexed.cpp if (precedence() <= level) { c.s << '('; } seq[0].print(c, precedence()); c.s << '[' << int(representation_label) << ']'; printindices(c, level); if (precedence() <= level) { c.s << ')'; } } } } void clifford::do_print_latex(const print_latex & c, unsigned level) const { // dirac_slash() object is printed differently if (is_dirac_slash(seq[0])) { c.s << "{"; seq[0].print(c, precedence()); c.s << "\\hspace{-1.0ex}/}"; } else { c.s << "\\clifford[" << int(representation_label) << "]"; this->print_dispatch(c, level); } } void clifford::do_print_tree(const print_tree & c, unsigned level) const { c.s << std::string(level, ' ') << class_name() << " @" << this << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec << ", " << seq.size()-1 << " indices" << ", symmetry=" << symtree << std::endl; metric.print(c, level + c.delta_indent); seq[0].print(c, level + c.delta_indent); printindices(c, level + c.delta_indent); } DEFAULT_COMPARE(diracone) DEFAULT_COMPARE(cliffordunit) DEFAULT_COMPARE(diracgamma) DEFAULT_COMPARE(diracgamma5) DEFAULT_COMPARE(diracgammaL) DEFAULT_COMPARE(diracgammaR) DEFAULT_PRINT_LATEX(diracone, "ONE", "\\mathbf{1}") DEFAULT_PRINT_LATEX(cliffordunit, "e", "e") DEFAULT_PRINT_LATEX(diracgamma, "gamma", "\\gamma") DEFAULT_PRINT_LATEX(diracgamma5, "gamma5", "{\\gamma^5}") DEFAULT_PRINT_LATEX(diracgammaL, "gammaL", "{\\gamma_L}") DEFAULT_PRINT_LATEX(diracgammaR, "gammaR", "{\\gamma_R}") /** This function decomposes gamma~mu -> (1, mu) and a\ -> (a.ix, ix) */ static void base_and_index(const ex & c, ex & b, ex & i) { GINAC_ASSERT(is_a(c)); GINAC_ASSERT(c.nops() == 2+1); if (is_a(c.op(0))) { // proper dirac gamma object or clifford unit i = c.op(1); b = _ex1; } else if (is_a(c.op(0)) || is_a(c.op(0)) || is_a(c.op(0))) { // gamma5/L/R i = _ex0; b = _ex1; } else { // slash object, generate new dummy index varidx ix(dynallocate(), ex_to(c.op(1)).get_dim()); b = indexed(c.op(0), ix.toggle_variance()); i = ix; } } /** Predicate for finding non-clifford objects. */ struct is_not_a_clifford { bool operator()(const ex & e) { return !is_a(e); } }; /** Contraction of a gamma matrix with something else. */ bool diracgamma::contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const { GINAC_ASSERT(is_a(*self)); GINAC_ASSERT(is_a(*other)); GINAC_ASSERT(is_a(self->op(0))); unsigned char rl = ex_to(*self).get_representation_label(); ex dim = ex_to(self->op(1)).get_dim(); if (other->nops() > 1) dim = minimal_dim(dim, ex_to(other->op(1)).get_dim()); if (is_a(*other)) { // Contraction only makes sense if the representation labels are equal if (ex_to(*other).get_representation_label() != rl) return false; size_t num = other - self; // gamma~mu gamma.mu = dim ONE if (num == 1) { *self = dim; *other = dirac_ONE(rl); return true; // gamma~mu gamma~alpha gamma.mu = (2-dim) gamma~alpha } else if (num == 2 && is_a(self[1])) { *self = 2 - dim; *other = _ex1; return true; // gamma~mu gamma~alpha gamma~beta gamma.mu = 4 g~alpha~beta + (dim-4) gamam~alpha gamma~beta } else if (num == 3 && is_a(self[1]) && is_a(self[2])) { ex b1, i1, b2, i2; base_and_index(self[1], b1, i1); base_and_index(self[2], b2, i2); *self = 4 * lorentz_g(i1, i2) * b1 * b2 * dirac_ONE(rl) + (dim - 4) * self[1] * self[2]; self[1] = _ex1; self[2] = _ex1; *other = _ex1; return true; // gamma~mu gamma~alpha gamma~beta gamma~delta gamma.mu = -2 gamma~delta gamma~beta gamma~alpha - (dim-4) gamam~alpha gamma~beta gamma~delta } else if (num == 4 && is_a(self[1]) && is_a(self[2]) && is_a(self[3])) { *self = -2 * self[3] * self[2] * self[1] - (dim - 4) * self[1] * self[2] * self[3]; self[1] = _ex1; self[2] = _ex1; self[3] = _ex1; *other = _ex1; return true; // gamma~mu Sodd gamma.mu = -2 Sodd_R // (Chisholm identity in 4 dimensions) } else if (!((other - self) & 1) && dim.is_equal(4)) { if (std::find_if(self + 1, other, is_not_a_clifford()) != other) return false; *self = ncmul(exvector(std::reverse_iterator(other), std::reverse_iterator(self + 1))); std::fill(self + 1, other, _ex1); *other = _ex_2; return true; // gamma~mu Sodd gamma~alpha gamma.mu = 2 gamma~alpha Sodd + 2 Sodd_R gamma~alpha // (commutate contracted indices towards each other, then use // Chisholm identity in 4 dimensions) } else if (((other - self) & 1) && dim.is_equal(4)) { if (std::find_if(self + 1, other, is_not_a_clifford()) != other) return false; auto next_to_last = other - 1; ex S = ncmul(exvector(self + 1, next_to_last)); ex SR = ncmul(exvector(std::reverse_iterator(next_to_last), std::reverse_iterator(self + 1))); *self = (*next_to_last) * S + SR * (*next_to_last); std::fill(self + 1, other, _ex1); *other = _ex2; return true; // gamma~mu S gamma~alpha gamma.mu = 2 gamma~alpha S - gamma~mu S gamma.mu gamma~alpha // (commutate contracted indices towards each other, simplify_indexed() // will re-expand and re-run the simplification) } else { if (std::find_if(self + 1, other, is_not_a_clifford()) != other) return false; auto next_to_last = other - 1; ex S = ncmul(exvector(self + 1, next_to_last)); *self = 2 * (*next_to_last) * S - (*self) * S * (*other) * (*next_to_last); std::fill(self + 1, other + 1, _ex1); return true; } } else if (is_a(other->op(0)) && other->nops() == 2) { // x.mu gamma~mu -> x-slash *self = dirac_slash(other->op(0), dim, rl); *other = _ex1; return true; } return false; } /** Contraction of a Clifford unit with something else. */ bool cliffordunit::contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const { GINAC_ASSERT(is_a(*self)); GINAC_ASSERT(is_a(*other)); GINAC_ASSERT(is_a(self->op(0))); clifford unit = ex_to(*self); unsigned char rl = unit.get_representation_label(); if (is_a(*other)) { // Contraction only makes sense if the representation labels are equal // and the metrics are the same if ((ex_to(*other).get_representation_label() != rl) && unit.same_metric(*other)) return false; auto before_other = other - 1; ex mu = self->op(1); ex mu_toggle = other->op(1); ex alpha = before_other->op(1); // e~mu e.mu = Tr ONE if (other - self == 1) { *self = unit.get_metric(mu, mu_toggle, true); *other = dirac_ONE(rl); return true; } else if (other - self == 2) { if (is_a(*before_other) && ex_to(*before_other).get_representation_label() == rl) { // e~mu e~alpha e.mu = 2*e~mu B(alpha, mu.toggle_variance())-Tr(B) e~alpha *self = 2 * (*self) * unit.get_metric(alpha, mu_toggle, true) - unit.get_metric(mu, mu_toggle, true) * (*before_other); *before_other = _ex1; *other = _ex1; return true; } else { // e~mu S e.mu = Tr S ONE *self = unit.get_metric(mu, mu_toggle, true); *other = dirac_ONE(rl); return true; } } else { // e~mu S e~alpha e.mu = 2 e~mu S B(alpha, mu.toggle_variance()) - e~mu S e.mu e~alpha // (commutate contracted indices towards each other, simplify_indexed() // will re-expand and re-run the simplification) if (std::find_if(self + 1, other, is_not_a_clifford()) != other) { return false; } ex S = ncmul(exvector(self + 1, before_other)); if (is_a(*before_other) && ex_to(*before_other).get_representation_label() == rl) { *self = 2 * (*self) * S * unit.get_metric(alpha, mu_toggle, true) - (*self) * S * (*other) * (*before_other); } else { // simply commutes *self = (*self) * S * (*other) * (*before_other); } std::fill(self + 1, other + 1, _ex1); return true; } } return false; } /** Perform automatic simplification on noncommutative product of clifford * objects. This removes superfluous ONEs, permutes gamma5/L/R's to the front * and removes squares of gamma objects. */ ex clifford::eval_ncmul(const exvector & v) const { exvector s; s.reserve(v.size()); // Remove superfluous ONEs for (auto & it : v) { if (!is_a(it) || !is_a(it.op(0))) s.push_back(it); } bool something_changed = false; int sign = 1; // Anticommutate gamma5/L/R's to the front if (s.size() >= 2) { auto first = s.begin(), next_to_last = s.end() - 2; while (true) { auto it = next_to_last; while (true) { auto it2 = it + 1; if (is_a(*it) && is_a(*it2)) { ex e1 = it->op(0), e2 = it2->op(0); if (is_a(e2)) { if (is_a(e1) || is_a(e1)) { // gammaL/R gamma5 -> gamma5 gammaL/R it->swap(*it2); something_changed = true; } else if (!is_a(e1)) { // gamma5 gamma5 -> gamma5 gamma5 (do nothing) // x gamma5 -> -gamma5 x it->swap(*it2); sign = -sign; something_changed = true; } } else if (is_a(e2)) { if (is_a(e1)) { // gammaR gammaL -> 0 return _ex0; } else if (!is_a(e1) && !is_a(e1)) { // gammaL gammaL -> gammaL gammaL (do nothing) // gamma5 gammaL -> gamma5 gammaL (do nothing) // x gammaL -> gammaR x it->swap(*it2); *it = clifford(diracgammaR(), ex_to(*it).get_representation_label()); something_changed = true; } } else if (is_a(e2)) { if (is_a(e1)) { // gammaL gammaR -> 0 return _ex0; } else if (!is_a(e1) && !is_a(e1)) { // gammaR gammaR -> gammaR gammaR (do nothing) // gamma5 gammaR -> gamma5 gammaR (do nothing) // x gammaR -> gammaL x it->swap(*it2); *it = clifford(diracgammaL(), ex_to(*it).get_representation_label()); something_changed = true; } } } if (it == first) break; --it; } if (next_to_last == first) break; --next_to_last; } } // Remove equal adjacent gammas if (s.size() >= 2) { exvector::iterator it, itend = s.end() - 1; for (it = s.begin(); it != itend; ++it) { ex & a = it[0]; ex & b = it[1]; if (!is_a(a) || !is_a(b)) continue; const ex & ag = a.op(0); const ex & bg = b.op(0); bool a_is_cliffordunit = is_a(ag); bool b_is_cliffordunit = is_a(bg); if (a_is_cliffordunit && b_is_cliffordunit && ex_to(a).same_metric(b) && (ex_to(a).get_commutator_sign() == -1)) { // This is done only for Clifford algebras const ex & ia = a.op(1); const ex & ib = b.op(1); if (ia.is_equal(ib)) { // gamma~alpha gamma~alpha -> g~alpha~alpha a = ex_to(a).get_metric(ia, ib, true); b = dirac_ONE(representation_label); something_changed = true; } } else if ((is_a(ag) && is_a(bg))) { // Remove squares of gamma5 a = dirac_ONE(representation_label); b = dirac_ONE(representation_label); something_changed = true; } else if ((is_a(ag) && is_a(bg)) || (is_a(ag) && is_a(bg))) { // Remove squares of gammaL/R b = dirac_ONE(representation_label); something_changed = true; } else if (is_a(ag) && is_a(bg)) { // gammaL and gammaR are orthogonal return _ex0; } else if (is_a(ag) && is_a(bg)) { // gamma5 gammaL -> -gammaL a = dirac_ONE(representation_label); sign = -sign; something_changed = true; } else if (is_a(ag) && is_a(bg)) { // gamma5 gammaR -> gammaR a = dirac_ONE(representation_label); something_changed = true; } else if (!a_is_cliffordunit && !b_is_cliffordunit && ag.is_equal(bg)) { // a\ a\ -> a^2 varidx ix(dynallocate(), ex_to(a.op(1)).minimal_dim(ex_to(b.op(1)))); a = indexed(ag, ix) * indexed(ag, ix.toggle_variance()); b = dirac_ONE(representation_label); something_changed = true; } } } if (s.empty()) return dirac_ONE(representation_label) * sign; if (something_changed) return reeval_ncmul(s) * sign; else return hold_ncmul(s) * sign; } ex clifford::thiscontainer(const exvector & v) const { return clifford(representation_label, metric, commutator_sign, v); } ex clifford::thiscontainer(exvector && v) const { return clifford(representation_label, metric, commutator_sign, std::move(v)); } ex diracgamma5::conjugate() const { return _ex_1 * (*this); } ex diracgammaL::conjugate() const { return dynallocate(); } ex diracgammaR::conjugate() const { return dynallocate(); } ////////// // global functions ////////// ex dirac_ONE(unsigned char rl) { static ex ONE = dynallocate(); return clifford(ONE, rl); } static unsigned get_dim_uint(const ex& e) { if (!is_a(e)) throw std::invalid_argument("get_dim_uint: argument is not an index"); ex dim = ex_to(e).get_dim(); if (!dim.info(info_flags::posint)) throw std::invalid_argument("get_dim_uint: dimension of index should be a positive integer"); unsigned d = ex_to(dim).to_int(); return d; } ex clifford_unit(const ex & mu, const ex & metr, unsigned char rl) { ex unit = dynallocate(); if (!is_a(mu)) throw(std::invalid_argument("clifford_unit(): index of Clifford unit must be of type idx or varidx")); exvector indices = metr.get_free_indices(); if (indices.size() == 2) { return clifford(unit, mu, metr, rl); } else if (is_a(metr)) { matrix M = ex_to(metr); unsigned n = M.rows(); bool symmetric = true; //static idx xi(dynallocate(), n), // chi(dynallocate(), n); idx xi(dynallocate(), n), chi(dynallocate(), n); if ((n == M.cols()) && (n == get_dim_uint(mu))) { for (unsigned i = 0; i < n; i++) { for (unsigned j = i+1; j < n; j++) { if (!M(i, j).is_equal(M(j, i))) { symmetric = false; } } } return clifford(unit, mu, indexed(metr, symmetric?symmetric2():not_symmetric(), xi, chi), rl); } else { throw(std::invalid_argument("clifford_unit(): metric for Clifford unit must be a square matrix with the same dimensions as index")); } } else if (indices.size() == 0) { // a tensor or other expression without indices //static varidx xi(dynallocate(), ex_to(mu).get_dim()), // chi(dynallocate(), ex_to(mu).get_dim()); varidx xi(dynallocate(), ex_to(mu).get_dim()), chi(dynallocate(), ex_to(mu).get_dim()); return clifford(unit, mu, indexed(metr, xi, chi), rl); } else throw(std::invalid_argument("clifford_unit(): metric for Clifford unit must be of type tensor, matrix or an expression with two free indices")); } ex dirac_gamma(const ex & mu, unsigned char rl) { static ex gamma = dynallocate(); if (!is_a(mu)) throw(std::invalid_argument("dirac_gamma(): index of Dirac gamma must be of type varidx")); static varidx xi(dynallocate(), ex_to(mu).get_dim()), chi(dynallocate(), ex_to(mu).get_dim()); return clifford(gamma, mu, indexed(dynallocate(), symmetric2(), xi, chi), rl); } ex dirac_gamma5(unsigned char rl) { static ex gamma5 = dynallocate(); return clifford(gamma5, rl); } ex dirac_gammaL(unsigned char rl) { static ex gammaL = dynallocate(); return clifford(gammaL, rl); } ex dirac_gammaR(unsigned char rl) { static ex gammaR = dynallocate(); return clifford(gammaR, rl); } ex dirac_slash(const ex & e, const ex & dim, unsigned char rl) { // Slashed vectors are actually stored as a clifford object with the // vector as its base expression and a (dummy) index that just serves // for storing the space dimensionality static varidx xi(dynallocate(), dim), chi(dynallocate(), dim); return clifford(e, varidx(0, dim), indexed(dynallocate(), symmetric2(), xi, chi), rl); } /** Extract representation label from tinfo key (as returned by * return_type_tinfo()). */ static unsigned char get_representation_label(const return_type_t& ti) { return (unsigned char)ti.rl; } /** Take trace of a string of an even number of Dirac gammas given a vector * of indices. */ static ex trace_string(exvector::const_iterator ix, size_t num) { // Tr gamma.mu gamma.nu = 4 g.mu.nu if (num == 2) return lorentz_g(ix[0], ix[1]); // Tr gamma.mu gamma.nu gamma.rho gamma.sig = 4 (g.mu.nu g.rho.sig + g.nu.rho g.mu.sig - g.mu.rho g.nu.sig ) else if (num == 4) return lorentz_g(ix[0], ix[1]) * lorentz_g(ix[2], ix[3]) + lorentz_g(ix[1], ix[2]) * lorentz_g(ix[0], ix[3]) - lorentz_g(ix[0], ix[2]) * lorentz_g(ix[1], ix[3]); // Traces of 6 or more gammas are computed recursively: // Tr gamma.mu1 gamma.mu2 ... gamma.mun = // + g.mu1.mu2 * Tr gamma.mu3 ... gamma.mun // - g.mu1.mu3 * Tr gamma.mu2 gamma.mu4 ... gamma.mun // + g.mu1.mu4 * Tr gamma.mu3 gamma.mu3 gamma.mu5 ... gamma.mun // - ... // + g.mu1.mun * Tr gamma.mu2 ... gamma.mu(n-1) exvector v(num - 2); int sign = 1; ex result; for (size_t i=1; i & rls, const ex & trONE) { if (is_a(e)) { unsigned char rl = ex_to(e).get_representation_label(); // Are we taking the trace over this object's representation label? if (rls.find(rl) == rls.end()) return e; // Yes, all elements are traceless, except for dirac_ONE and dirac_L/R const ex & g = e.op(0); if (is_a(g)) return trONE; else if (is_a(g) || is_a(g)) return trONE/2; else return _ex0; } else if (is_exactly_a(e)) { // Trace of product: pull out non-clifford factors ex prod = _ex1; for (size_t i=0; i(e)) { unsigned char rl = get_representation_label(e.return_type_tinfo()); // Are we taking the trace over this string's representation label? if (rls.find(rl) == rls.end()) return e; // Substitute gammaL/R and expand product, if necessary ex e_expanded = e.subs(lst{ dirac_gammaL(rl) == (dirac_ONE(rl)-dirac_gamma5(rl))/2, dirac_gammaR(rl) == (dirac_ONE(rl)+dirac_gamma5(rl))/2 }, subs_options::no_pattern).expand(); if (!is_a(e_expanded)) return dirac_trace(e_expanded, rls, trONE); // gamma5 gets moved to the front so this check is enough bool has_gamma5 = is_a(e.op(0).op(0)); size_t num = e.nops(); if (has_gamma5) { // Trace of gamma5 * odd number of gammas and trace of // gamma5 * gamma.mu * gamma.nu are zero if ((num & 1) == 0 || num == 3) return _ex0; // Tr gamma5 gamma.mu gamma.nu gamma.rho gamma.sigma = 4I * epsilon(mu, nu, rho, sigma) // (the epsilon is always 4-dimensional) if (num == 5) { ex b1, i1, b2, i2, b3, i3, b4, i4; base_and_index(e.op(1), b1, i1); base_and_index(e.op(2), b2, i2); base_and_index(e.op(3), b3, i3); base_and_index(e.op(4), b4, i4); return trONE * I * (lorentz_eps(ex_to(i1).replace_dim(_ex4), ex_to(i2).replace_dim(_ex4), ex_to(i3).replace_dim(_ex4), ex_to(i4).replace_dim(_ex4)) * b1 * b2 * b3 * b4).simplify_indexed(); } // Tr gamma5 S_2k = // I/4! * epsilon0123.mu1.mu2.mu3.mu4 * Tr gamma.mu1 gamma.mu2 gamma.mu3 gamma.mu4 S_2k // (the epsilon is always 4-dimensional) exvector ix(num-1), bv(num-1); for (size_t i=1; i(idx1).replace_dim(_ex4), ex_to(idx2).replace_dim(_ex4), ex_to(idx3).replace_dim(_ex4), ex_to(idx4).replace_dim(_ex4)) * trace_string(v.begin(), num - 4); } } } } delete[] iv; return trONE * I * result * mul(bv); } else { // no gamma5 // Trace of odd number of gammas is zero if ((num & 1) == 1) return _ex0; // Tr gamma.mu gamma.nu = 4 g.mu.nu if (num == 2) { ex b1, i1, b2, i2; base_and_index(e.op(0), b1, i1); base_and_index(e.op(1), b2, i2); return trONE * (lorentz_g(i1, i2) * b1 * b2).simplify_indexed(); } exvector iv(num), bv(num); for (size_t i=0; i 0) { // Trace maps to all other container classes (this includes sums) pointer_to_map_function_2args &, const ex &> fcn(dirac_trace, rls, trONE); return e.map(fcn); } else return _ex0; } ex dirac_trace(const ex & e, const lst & rll, const ex & trONE) { // Convert list to set std::set rls; for (const auto & i : rll) { if (i.info(info_flags::nonnegint)) rls.insert(ex_to(i).to_int()); } return dirac_trace(e, rls, trONE); } ex dirac_trace(const ex & e, unsigned char rl, const ex & trONE) { // Convert label to set std::set rls; rls.insert(rl); return dirac_trace(e, rls, trONE); } ex canonicalize_clifford(const ex & e_) { pointer_to_map_function fcn(canonicalize_clifford); if (is_a(e_) // || is_a(e) || is_a(e) || e_.info(info_flags::list)) { return e_.map(fcn); } else { ex e=simplify_indexed(e_); // Scan for any ncmul objects exmap srl; ex aux = e.to_rational(srl); for (auto & i : srl) { ex lhs = i.first; ex rhs = i.second; if (is_exactly_a(rhs) && rhs.return_type() == return_types::noncommutative && is_clifford_tinfo(rhs.return_type_tinfo())) { // Expand product, if necessary ex rhs_expanded = rhs.expand(); if (!is_a(rhs_expanded)) { i.second = canonicalize_clifford(rhs_expanded); continue; } else if (!is_a(rhs.op(0))) continue; exvector v; v.reserve(rhs.nops()); for (size_t j=0; j(it->op(0)) || is_a(it->op(0)) || is_a(it->op(0))) ++it; while (it != next_to_last) { if (it[0].compare(it[1]) > 0) { ex save0 = it[0], save1 = it[1]; ex b1, i1, b2, i2; base_and_index(it[0], b1, i1); base_and_index(it[1], b2, i2); // for Clifford algebras (commutator_sign == -1) metric should be symmetrised it[0] = (ex_to(save0).get_metric(i1, i2, ex_to(save0).get_commutator_sign() == -1) * b1 * b2).simplify_indexed(); it[1] = v.size() ? _ex2 * dirac_ONE(ex_to(save0).get_representation_label()) : _ex2; ex sum = ncmul(v); it[0] = save1; it[1] = save0; sum += ex_to(save0).get_commutator_sign() * ncmul(std::move(v)); i.second = canonicalize_clifford(sum); goto next_sym; } ++it; } next_sym: ; } } return aux.subs(srl, subs_options::no_pattern).simplify_indexed(); } } ex clifford_star_bar(const ex & e, bool do_bar, unsigned options) { pointer_to_map_function_2args fcn(clifford_star_bar, do_bar, options | 1); // is a child, no need to expand ex e1= (options & 1 ? e : e.expand()); if (is_a(e1) ) { // reversing order of clifford units exvector ev, cv; ev.reserve(e1.nops()); cv.reserve(e1.nops()); // separate clifford and non-clifford entries for (int i= 0; i < e1.nops(); ++i) { if (is_a(e1.op(i)) && is_a(e1.op(i).op(0))) cv.push_back(e1.op(i)); else ev.push_back(e1.op(i)); } for (auto i=cv.rbegin(); i!=cv.rend(); ++i) { // reverse order of Clifford units ev.push_back(i->conjugate()); } // For clifford_bar an odd number of clifford units reverts the sign if (do_bar && (cv.size() % 2 == 1)) return -dynallocate(std::move(ev)); else return dynallocate(std::move(ev)); } else if (is_a(e1) && is_a(e1.op(0))) { if (do_bar) return -e; else return e; } else if (is_a(e1)) { // apply the procedure to the base of a power return pow(clifford_star_bar(e1.op(0), do_bar, 0), e1.op(1)); } else if (is_a(e1) || is_a(e1) || e.info(info_flags::list)) { // recurse into subexpressions return e1.map(fcn); } else // nothing meaningful can be done return e; } ex clifford_prime(const ex & e) { pointer_to_map_function fcn(clifford_prime); if (is_a(e) && is_a(e.op(0))) { return -e; } else if (is_a(e) || is_a(e) || is_a(e) //|| is_a(e) || is_a(e) || is_a(e) || e.info(info_flags::list)) { return e.map(fcn); } else if (is_a(e)) { return pow(clifford_prime(e.op(0)), e.op(1)); } else return e; } ex remove_dirac_ONE(const ex & e, unsigned char rl, unsigned options) { pointer_to_map_function_2args fcn(remove_dirac_ONE, rl, options | 1); bool need_reevaluation = false; ex e1 = e; if (! (options & 1) ) { // is not a child if (options & 2) e1 = expand_dummy_sum(e, true); e1 = canonicalize_clifford(e1); } if (is_a(e1) && ex_to(e1).get_representation_label() >= rl) { if (is_a(e1.op(0))) return 1; else throw(std::invalid_argument("remove_dirac_ONE(): expression is a non-scalar Clifford number!")); } else if (is_a(e1) || is_a(e1) || is_a(e1) || is_a(e1) || e1.info(info_flags::list)) { if (options & 3) // is a child or was already expanded return e1.map(fcn); else try { return e1.map(fcn); } catch (std::exception &p) { need_reevaluation = true; } } else if (is_a(e1)) { if (options & 3) // is a child or was already expanded return pow(remove_dirac_ONE(e1.op(0), rl, options | 1), e1.op(1)); else try { return pow(remove_dirac_ONE(e1.op(0), rl, options | 1), e1.op(1)); } catch (std::exception &p) { need_reevaluation = true; } } if (need_reevaluation) return remove_dirac_ONE(e, rl, options | 2); return e1; } int clifford_max_label(const ex & e, bool ignore_ONE) { if (is_a(e)) if (ignore_ONE && is_a(e.op(0))) return -1; else return ex_to(e).get_representation_label(); else { int rl = -1; for (size_t i=0; i < e.nops(); i++) rl = (rl > clifford_max_label(e.op(i), ignore_ONE)) ? rl : clifford_max_label(e.op(i), ignore_ONE); return rl; } } ex clifford_norm(const ex & e) { return sqrt(remove_dirac_ONE(e * clifford_bar(e))); } ex clifford_inverse(const ex & e) { ex norm = clifford_norm(e); if (!norm.is_zero()) return clifford_bar(e) / pow(norm, 2); else throw(std::invalid_argument("clifford_inverse(): cannot find inverse of Clifford number with zero norm!")); } ex lst_to_clifford(const ex & v, const ex & mu, const ex & metr, unsigned char rl) { if (!ex_to(mu).is_dim_numeric()) throw(std::invalid_argument("lst_to_clifford(): Index should have a numeric dimension")); ex e = clifford_unit(mu, metr, rl); return lst_to_clifford(v, e); } ex lst_to_clifford(const ex & v, const ex & e) { unsigned min, max; if (is_a(e)) { ex mu = e.op(1); ex mu_toggle = is_a(mu) ? ex_to(mu).toggle_variance() : mu; unsigned dim = get_dim_uint(mu); if (is_a(v)) { if (ex_to(v).cols() > ex_to(v).rows()) { min = ex_to(v).rows(); max = ex_to(v).cols(); } else { min = ex_to(v).cols(); max = ex_to(v).rows(); } if (min == 1) { if (dim == max) return indexed(v, mu_toggle) * e; else if (max - dim == 1) { if (ex_to(v).cols() > ex_to(v).rows()) return v.op(0) * dirac_ONE(ex_to(e).get_representation_label()) + indexed(sub_matrix(ex_to(v), 0, 1, 1, dim), mu_toggle) * e; else return v.op(0) * dirac_ONE(ex_to(e).get_representation_label()) + indexed(sub_matrix(ex_to(v), 1, dim, 0, 1), mu_toggle) * e; } else throw(std::invalid_argument("lst_to_clifford(): dimensions of vector and clifford unit mismatch")); } else throw(std::invalid_argument("lst_to_clifford(): first argument should be a vector (nx1 or 1xn matrix)")); } else if (v.info(info_flags::list)) { if (dim == ex_to(v).nops()) return indexed(matrix(dim, 1, ex_to(v)), mu_toggle) * e; else if (ex_to(v).nops() - dim == 1) return v.op(0) * dirac_ONE(ex_to(e).get_representation_label()) + indexed(sub_matrix(matrix(dim+1, 1, ex_to(v)), 1, dim, 0, 1), mu_toggle) * e; else throw(std::invalid_argument("lst_to_clifford(): list length and dimension of clifford unit mismatch")); } else throw(std::invalid_argument("lst_to_clifford(): cannot construct from anything but list or vector")); } else throw(std::invalid_argument("lst_to_clifford(): the second argument should be a Clifford unit")); } /** Auxiliary structure to define a function for striping one Clifford unit * from vectors. Used in clifford_to_lst(). */ static ex get_clifford_comp(const ex & e, const ex & c, bool root=true) { // make expansion on the top-level call only ex e1=(root? e.expand() : e); pointer_to_map_function_2args fcn(get_clifford_comp, c, false); int ival = ex_to(ex_to(c.op(1)).get_value()).to_int(); int rl=ex_to(c).get_representation_label(); if ( (is_a(e1) || e1.info(info_flags::list) || is_a(e1))) { return e1.map(fcn); } else if (is_a(e1) || is_a(e1)) { // searches are done within products only exvector ev, all_dummy=get_all_dummy_indices(e1); bool found=false, same_value_found=false; ex dummy_ind=0; ev.reserve(e1.nops()); for (int i=0; i < e1.nops();++i) { // look for a Clifford unit with the same metric and representation label, // if found remember its index if (is_a(e1.op(i)) && ex_to(e1.op(i)).get_representation_label() == rl && is_a(e1.op(i).op(0)) && ex_to(e1.op(i)).same_metric(c)) { // same Clifford unit if (found) throw(std::invalid_argument("get_clifford_comp(): expression is a Clifford multi-vector")); found=true; if (ex_to(e1.op(i).op(1)).is_numeric() && (ival == ex_to(ex_to(e1.op(i).op(1)).get_value()).to_int())) { same_value_found = true; // desired index value is found } else if ((std::find(all_dummy.begin(), all_dummy.end(), e1.op(i).op(1)) != all_dummy.end()) || (is_a(e1.op(i).op(1)) && std::find(all_dummy.begin(), all_dummy.end(), ex_to(e1.op(i).op(1)).toggle_variance()) != all_dummy.end())) { dummy_ind=(e1.op(i).op(1)); // suitable dummy index found } else ev.push_back(e.op(i)); // another index value } else ev.push_back(e1.op(i)); } if (! found) // no Clifford units found at all throw(std::invalid_argument("get_clifford_comp(): expression is not a Clifford vector to the given units")); ex res=dynallocate(std::move(ev)); if (same_value_found) { return res; } else if (! dummy_ind.is_zero()) { // a dummy index was found if (is_a(dummy_ind)) dummy_ind = ex_to(dummy_ind).toggle_variance(); return res.subs(dummy_ind==ival, subs_options::no_pattern); } else // found a Clifford unit with another index return 0; } else if (e1.is_zero()) { return 0; } else if (is_a(e1) && is_a(e1.op(0)) && ex_to(e1).same_metric(c)) { if (ex_to(e1.op(1)).is_numeric() && (ival == ex_to(ex_to(e1.op(1)).get_value()).to_int()) ) return 1; else return 0; } else throw(std::invalid_argument("get_clifford_comp(): expression is not usable as a Clifford vector")); } lst clifford_to_lst(const ex & e, const ex & c, bool algebraic) { GINAC_ASSERT(is_a(c)); ex mu = c.op(1); if (! ex_to(mu).is_dim_numeric()) throw(std::invalid_argument("clifford_to_lst(): index should have a numeric dimension")); unsigned int D = ex_to(ex_to(mu).get_dim()).to_int(); if (algebraic) // check if algebraic method is applicable for (unsigned int i = 0; i < D; i++) if (pow(c.subs(mu == i, subs_options::no_pattern), 2).is_zero() || (! is_a(pow(c.subs(mu == i, subs_options::no_pattern), 2)))) algebraic = false; lst V; ex v0 = remove_dirac_ONE(canonicalize_clifford(e+clifford_prime(e)))/2; if (! v0.is_zero()) V.append(v0); ex e1 = canonicalize_clifford(e - v0 * dirac_ONE(ex_to(c).get_representation_label())); if (algebraic) { for (unsigned int i = 0; i < D; i++) V.append(remove_dirac_ONE( simplify_indexed(canonicalize_clifford(e1 * c.subs(mu == i, subs_options::no_pattern) + c.subs(mu == i, subs_options::no_pattern) * e1)) / (2*pow(c.subs(mu == i, subs_options::no_pattern), 2)))); } else { try { for (unsigned int i = 0; i < D; i++) V.append(get_clifford_comp(e1, c.subs(c.op(1) == i, subs_options::no_pattern))); } catch (std::exception &p) { /* Try to expand dummy summations to simplify the expression*/ e1 = canonicalize_clifford(expand_dummy_sum(e, true)); V.remove_all(); v0 = remove_dirac_ONE(canonicalize_clifford(e1+clifford_prime(e1)))/2; if (! v0.is_zero()) { V.append(v0); e1 = canonicalize_clifford(e1 - v0 * dirac_ONE(ex_to(c).get_representation_label())); } for (unsigned int i = 0; i < D; i++) V.append(get_clifford_comp(e1, c.subs(c.op(1) == i, subs_options::no_pattern))); } } return V; } ex clifford_moebius_map(const ex & a, const ex & b, const ex & c, const ex & d, const ex & v, const ex & G, unsigned char rl) { ex x, D, cu; if (! is_a(v) && ! v.info(info_flags::list)) throw(std::invalid_argument("clifford_moebius_map(): parameter v should be either vector or list")); if (is_a(G)) { cu = G; } else { if (is_a(G)) { D = ex_to(G.op(1)).get_dim(); varidx mu(dynallocate(), D); cu = clifford_unit(mu, G, rl); } else if (is_a(G)) { D = ex_to(G).rows(); idx mu(dynallocate(), D); cu = clifford_unit(mu, G, rl); } else throw(std::invalid_argument("clifford_moebius_map(): metric should be an indexed object, matrix, or a Clifford unit")); } x = lst_to_clifford(v, cu); ex e = clifford_to_lst(simplify_indexed(canonicalize_clifford((a * x + b) * clifford_inverse(c * x + d))), cu, false); return (is_a(v) ? matrix(ex_to(v).rows(), ex_to(v).cols(), ex_to(e)) : e); } ex clifford_moebius_map(const ex & M, const ex & v, const ex & G, unsigned char rl) { if (is_a(M) && (ex_to(M).rows() == 2) && (ex_to(M).cols() == 2)) return clifford_moebius_map(M.op(0), M.op(1), M.op(2), M.op(3), v, G, rl); else throw(std::invalid_argument("clifford_moebius_map(): parameter M should be a 2x2 matrix")); } } // namespace GiNaC ginac-1.7.8.orig/ginac/clifford.h0000644000000000000000000003445013457611471013476 0ustar /** @file clifford.h * * Interface to GiNaC's clifford algebra (Dirac gamma) objects. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #ifndef GINAC_CLIFFORD_H #define GINAC_CLIFFORD_H #include "indexed.h" #include "tensor.h" #include "symbol.h" #include "idx.h" #include namespace GiNaC { /** This class holds an object representing an element of the Clifford * algebra (the Dirac gamma matrices). These objects only carry Lorentz * indices. Spinor indices are hidden. A representation label (an unsigned * 8-bit integer) is used to distinguish elements from different Clifford * algebras (objects with different labels commutate). */ class clifford : public indexed { GINAC_DECLARE_REGISTERED_CLASS(clifford, indexed) // other constructors public: clifford(const ex & b, unsigned char rl = 0); clifford(const ex & b, const ex & mu, const ex & metr, unsigned char rl = 0, int comm_sign = -1); // internal constructors clifford(unsigned char rl, const ex & metr, int comm_sign, const exvector & v); clifford(unsigned char rl, const ex & metr, int comm_sign, exvector && v); // functions overriding virtual functions from base classes public: unsigned precedence() const override { return 65; } void archive(archive_node& n) const override; void read_archive(const archive_node& n, lst& sym_lst) override; protected: ex eval_ncmul(const exvector & v) const override; bool match_same_type(const basic & other) const override; ex thiscontainer(const exvector & v) const override; ex thiscontainer(exvector && v) const override; unsigned return_type() const override { return return_types::noncommutative; } return_type_t return_type_tinfo() const override; // non-virtual functions in this class public: unsigned char get_representation_label() const { return representation_label; } ex get_metric() const { return metric; } virtual ex get_metric(const ex & i, const ex & j, bool symmetrised = false) const; bool same_metric(const ex & other) const; int get_commutator_sign() const { return commutator_sign; } //**< See the member variable commutator_sign */ inline size_t nops() const override {return inherited::nops() + 1; } ex op(size_t i) const override; ex & let_op(size_t i) override; ex subs(const exmap & m, unsigned options = 0) const override; protected: void do_print_dflt(const print_dflt & c, unsigned level) const; void do_print_latex(const print_latex & c, unsigned level) const; void do_print_tree(const print_tree & c, unsigned level) const; // member variables protected: unsigned char representation_label; /**< Representation label to distinguish independent spin lines */ ex metric; /**< Metric of the space, all constructors make it an indexed object */ int commutator_sign; /**< It is the sign in the definition e~i e~j +/- e~j e~i = B(i, j) + B(j, i)*/ }; GINAC_DECLARE_UNARCHIVER(clifford); /** This class represents the Clifford algebra unity element. */ class diracone : public tensor { GINAC_DECLARE_REGISTERED_CLASS(diracone, tensor) // non-virtual functions in this class protected: void do_print(const print_context & c, unsigned level) const; void do_print_latex(const print_latex & c, unsigned level) const; }; GINAC_DECLARE_UNARCHIVER(diracone); /** This class represents the Clifford algebra generators (units). */ class cliffordunit : public tensor { GINAC_DECLARE_REGISTERED_CLASS(cliffordunit, tensor) // functions overriding virtual functions from base classes public: bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override; // non-virtual functions in this class protected: void do_print(const print_context & c, unsigned level) const; void do_print_latex(const print_latex & c, unsigned level) const; }; GINAC_DECLARE_UNARCHIVER(cliffordunit); /** This class represents the Dirac gamma Lorentz vector. */ class diracgamma : public cliffordunit { GINAC_DECLARE_REGISTERED_CLASS(diracgamma, cliffordunit) // functions overriding virtual functions from base classes public: bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override; // non-virtual functions in this class protected: void do_print(const print_context & c, unsigned level) const; void do_print_latex(const print_latex & c, unsigned level) const; }; GINAC_DECLARE_UNARCHIVER(diracgamma); /** This class represents the Dirac gamma5 object which anticommutates with * all other gammas. */ class diracgamma5 : public tensor { GINAC_DECLARE_REGISTERED_CLASS(diracgamma5, tensor) // functions overriding virtual functions from base classes ex conjugate() const override; // non-virtual functions in this class protected: void do_print(const print_context & c, unsigned level) const; void do_print_latex(const print_latex & c, unsigned level) const; }; GINAC_DECLARE_UNARCHIVER(diracgamma5); /** This class represents the Dirac gammaL object which behaves like * 1/2 (1-gamma5). */ class diracgammaL : public tensor { GINAC_DECLARE_REGISTERED_CLASS(diracgammaL, tensor) // functions overriding virtual functions from base classes ex conjugate() const override; // non-virtual functions in this class protected: void do_print(const print_context & c, unsigned level) const; void do_print_latex(const print_latex & c, unsigned level) const; }; GINAC_DECLARE_UNARCHIVER(diracgammaL); /** This class represents the Dirac gammaL object which behaves like * 1/2 (1+gamma5). */ class diracgammaR : public tensor { GINAC_DECLARE_REGISTERED_CLASS(diracgammaR, tensor) // functions overriding virtual functions from base classes ex conjugate() const override; // non-virtual functions in this class protected: void do_print(const print_context & c, unsigned level) const; void do_print_latex(const print_latex & c, unsigned level) const; }; GINAC_DECLARE_UNARCHIVER(diracgammaR); // global functions /** Check whether a given return_type_t object (as returned by return_type_tinfo() * is that of a clifford object (with an arbitrary representation label). * * @param ti tinfo key */ inline bool is_clifford_tinfo(const return_type_t& ti) { return *(ti.tinfo) == typeid(clifford); } /** Create a Clifford unity object. * * @param rl Representation label * @return newly constructed object */ ex dirac_ONE(unsigned char rl = 0); /** Create a Clifford unit object. * * @param mu Index (must be of class varidx or a derived class) * @param metr Metric (should be indexed, tensmetric or a derived class, or a matrix) * @param rl Representation label * @return newly constructed Clifford unit object */ ex clifford_unit(const ex & mu, const ex & metr, unsigned char rl = 0); /** Create a Dirac gamma object. * * @param mu Index (must be of class varidx or a derived class) * @param rl Representation label * @return newly constructed gamma object */ ex dirac_gamma(const ex & mu, unsigned char rl = 0); /** Create a Dirac gamma5 object. * * @param rl Representation label * @return newly constructed object */ ex dirac_gamma5(unsigned char rl = 0); /** Create a Dirac gammaL object. * * @param rl Representation label * @return newly constructed object */ ex dirac_gammaL(unsigned char rl = 0); /** Create a Dirac gammaR object. * * @param rl Representation label * @return newly constructed object */ ex dirac_gammaR(unsigned char rl = 0); /** Create a term of the form e_mu * gamma~mu with a unique index mu. * * @param e Original expression * @param dim Dimension of index * @param rl Representation label */ ex dirac_slash(const ex & e, const ex & dim, unsigned char rl = 0); /** Calculate dirac traces over the specified set of representation labels. * The computed trace is a linear functional that is equal to the usual * trace only in D = 4 dimensions. In particular, the functional is not * always cyclic in D != 4 dimensions when gamma5 is involved. * * @param e Expression to take the trace of * @param rls Set of representation labels * @param trONE Expression to be returned as the trace of the unit matrix */ ex dirac_trace(const ex & e, const std::set & rls, const ex & trONE = 4); /** Calculate dirac traces over the specified list of representation labels. * The computed trace is a linear functional that is equal to the usual * trace only in D = 4 dimensions. In particular, the functional is not * always cyclic in D != 4 dimensions when gamma5 is involved. * * @param e Expression to take the trace of * @param rll List of representation labels * @param trONE Expression to be returned as the trace of the unit matrix */ ex dirac_trace(const ex & e, const lst & rll, const ex & trONE = 4); /** Calculate the trace of an expression containing gamma objects with * a specified representation label. The computed trace is a linear * functional that is equal to the usual trace only in D = 4 dimensions. * In particular, the functional is not always cyclic in D != 4 dimensions * when gamma5 is involved. * * @param e Expression to take the trace of * @param rl Representation label * @param trONE Expression to be returned as the trace of the unit matrix */ ex dirac_trace(const ex & e, unsigned char rl = 0, const ex & trONE = 4); /** Bring all products of clifford objects in an expression into a canonical * order. This is not necessarily the most simple form but it will allow * to check two expressions for equality. */ ex canonicalize_clifford(const ex & e); /** Automorphism of the Clifford algebra, simply changes signs of all * clifford units. */ ex clifford_prime(const ex & e); /** An auxillary function performing clifford_star() and clifford_bar().*/ ex clifford_star_bar(const ex & e, bool do_bar, unsigned options); /** Main anti-automorphism of the Clifford algebra: makes reversion * and changes signs of all clifford units. */ inline ex clifford_bar(const ex & e) { return clifford_star_bar(e, true, 0); } /** Reversion of the Clifford algebra, reverse the order of all clifford units * in ncmul. */ inline ex clifford_star(const ex & e) { return clifford_star_bar(e, false, 0); } /** Replaces dirac_ONE's (with a representation_label no less than rl) in e with 1. * For the default value rl = 0 remove all of them. Aborts if e contains any * clifford_unit with representation_label to be removed. * * @param e Expression to be processed * @param rl Value of representation label * @param options Defines some internal use */ ex remove_dirac_ONE(const ex & e, unsigned char rl = 0, unsigned options = 0); /** Returns the maximal representation label of a clifford object * if e contains at least one, otherwise returns -1 * * @param e Expression to be processed * @ignore_ONE defines if clifford_ONE should be ignored in the search*/ int clifford_max_label(const ex & e, bool ignore_ONE = false); /** Calculation of the norm in the Clifford algebra. */ ex clifford_norm(const ex & e); /** Calculation of the inverse in the Clifford algebra. */ ex clifford_inverse(const ex & e); /** List or vector conversion into the Clifford vector. * * @param v List or vector of coordinates * @param mu Index (must be of class varidx or a derived class) * @param metr Metric (should be indexed, tensmetric or a derived class, or a matrix) * @param rl Representation label * @param e Clifford unit object * @return Clifford vector with given components */ ex lst_to_clifford(const ex & v, const ex & mu, const ex & metr, unsigned char rl = 0); ex lst_to_clifford(const ex & v, const ex & e); /** An inverse function to lst_to_clifford(). For given Clifford vector extracts * its components with respect to given Clifford unit. Obtained components may * contain Clifford units with a different metric. Extraction is based on * the algebraic formula (e * c.i + c.i * e)/ pow(e.i, 2) for non-degenerate cases * (i.e. neither pow(e.i, 2) = 0). * * @param e Clifford expression to be decomposed into components * @param c Clifford unit defining the metric for splitting (should have numeric dimension of indices) * @param algebraic Use algebraic or symbolic algorithm for extractions * @return List of components of a Clifford vector*/ lst clifford_to_lst(const ex & e, const ex & c, bool algebraic=true); /** Calculations of Moebius transformations (conformal map) defined by a 2x2 Clifford matrix * (a b\\c d) in linear spaces with arbitrary signature. The expression is * (a * x + b)/(c * x + d), where x is a vector build from list v with metric G. * (see Jan Cnops. An introduction to {D}irac operators on manifolds, v.24 of * Progress in Mathematical Physics. Birkhauser Boston Inc., Boston, MA, 2002.) * * @param a (1,1) entry of the defining matrix * @param b (1,2) entry of the defining matrix * @param c (2,1) entry of the defining matrix * @param d (2,2) entry of the defining matrix * @param v Vector to be transformed * @param G Metric of the surrounding space, may be a Clifford unit then the next parameter is ignored * @param rl Representation label * @return List of components of the transformed vector*/ ex clifford_moebius_map(const ex & a, const ex & b, const ex & c, const ex & d, const ex & v, const ex & G, unsigned char rl = 0); /** The second form of Moebius transformations defined by a 2x2 Clifford matrix M * This function takes the transformation matrix M as a single entity. * * @param M the defining matrix * @param v Vector to be transformed * @param G Metric of the surrounding space, may be a Clifford unit then the next parameter is ignored * @param rl Representation label * @return List of components of the transformed vector*/ ex clifford_moebius_map(const ex & M, const ex & v, const ex & G, unsigned char rl = 0); } // namespace GiNaC #endif // ndef GINAC_CLIFFORD_H ginac-1.7.8.orig/ginac/color.cpp0000644000000000000000000004304413457611471013356 0ustar /** @file color.cpp * * Implementation of GiNaC's color (SU(3) Lie algebra) objects. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "color.h" #include "idx.h" #include "ncmul.h" #include "symmetry.h" #include "operators.h" #include "numeric.h" #include "mul.h" #include "power.h" // for sqrt() #include "symbol.h" #include "archive.h" #include "utils.h" #include #include namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS(color, indexed) GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(su3one, tensor, print_func(&su3one::do_print). print_func(&su3one::do_print_latex)) GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(su3t, tensor, print_func(&su3t::do_print). print_func(&su3t::do_print)) GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(su3f, tensor, print_func(&su3f::do_print). print_func(&su3f::do_print)) GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(su3d, tensor, print_func(&su3d::do_print). print_func(&su3d::do_print)) ////////// // default constructors ////////// color::color() : representation_label(0) { } DEFAULT_CTOR(su3one) DEFAULT_CTOR(su3t) DEFAULT_CTOR(su3f) DEFAULT_CTOR(su3d) ////////// // other constructors ////////// /** Construct object without any color index. This constructor is for * internal use only. Use the color_ONE() function instead. * @see color_ONE */ color::color(const ex & b, unsigned char rl) : inherited(b), representation_label(rl) { } /** Construct object with one color index. This constructor is for internal * use only. Use the color_T() function instead. * @see color_T */ color::color(const ex & b, const ex & i1, unsigned char rl) : inherited(b, i1), representation_label(rl) { } color::color(unsigned char rl, const exvector & v) : inherited(not_symmetric(), v), representation_label(rl) { } color::color(unsigned char rl, exvector && v) : inherited(not_symmetric(), std::move(v)), representation_label(rl) { } return_type_t color::return_type_tinfo() const { return make_return_type_t(representation_label); } ////////// // archiving ////////// void color::read_archive(const archive_node& n, lst& sym_lst) { inherited::read_archive(n, sym_lst); unsigned rl; n.find_unsigned("label", rl); representation_label = rl; } void color::archive(archive_node &n) const { inherited::archive(n); n.add_unsigned("label", representation_label); } GINAC_BIND_UNARCHIVER(color); GINAC_BIND_UNARCHIVER(su3one); GINAC_BIND_UNARCHIVER(su3t); GINAC_BIND_UNARCHIVER(su3f); GINAC_BIND_UNARCHIVER(su3d); ////////// // functions overriding virtual functions from base classes ////////// int color::compare_same_type(const basic & other) const { GINAC_ASSERT(is_a(other)); const color &o = static_cast(other); if (representation_label != o.representation_label) { // different representation label return representation_label < o.representation_label ? -1 : 1; } return inherited::compare_same_type(other); } bool color::match_same_type(const basic & other) const { GINAC_ASSERT(is_a(other)); const color &o = static_cast(other); return representation_label == o.representation_label; } DEFAULT_COMPARE(su3one) DEFAULT_COMPARE(su3t) DEFAULT_COMPARE(su3f) DEFAULT_COMPARE(su3d) DEFAULT_PRINT_LATEX(su3one, "ONE", "\\mathbb{1}") DEFAULT_PRINT(su3t, "T") DEFAULT_PRINT(su3f, "f") DEFAULT_PRINT(su3d, "d") /** Perform automatic simplification on noncommutative product of color * objects. This removes superfluous ONEs. */ ex color::eval_ncmul(const exvector & v) const { exvector s; s.reserve(v.size()); // Remove superfluous ONEs for (auto & it : v) { if (!is_a(it.op(0))) s.push_back(it); } if (s.empty()) return color(su3one(), representation_label); else return hold_ncmul(s); } ex color::thiscontainer(const exvector & v) const { return color(representation_label, v); } ex color::thiscontainer(exvector && v) const { return color(representation_label, std::move(v)); } /** Given a vector iv3 of three indices and a vector iv2 of two indices that * is a subset of iv3, return the (free) index that is in iv3 but not in * iv2 and the sign introduced by permuting that index to the front. * * @param iv3 Vector of 3 indices * @param iv2 Vector of 2 indices, must be a subset of iv3 * @param sig Returns sign introduced by index permutation * @return the free index (the one that is in iv3 but not in iv2) */ static ex permute_free_index_to_front(const exvector & iv3, const exvector & iv2, int & sig) { GINAC_ASSERT(iv3.size() == 3); GINAC_ASSERT(iv2.size() == 2); sig = 1; #define TEST_PERMUTATION(A,B,C,P) \ if (iv3[B].is_equal(iv2[0]) && iv3[C].is_equal(iv2[1])) { \ sig = P; \ return iv3[A]; \ } TEST_PERMUTATION(0,1,2, 1); TEST_PERMUTATION(0,2,1, -1); TEST_PERMUTATION(1,0,2, -1); TEST_PERMUTATION(1,2,0, 1); TEST_PERMUTATION(2,0,1, 1); TEST_PERMUTATION(2,1,0, -1); throw(std::logic_error("permute_free_index_to_front(): no valid permutation found")); } /** Automatic symbolic evaluation of indexed symmetric structure constant. */ ex su3d::eval_indexed(const basic & i) const { GINAC_ASSERT(is_a(i)); GINAC_ASSERT(i.nops() == 4); GINAC_ASSERT(is_a(i.op(0))); // Convolutions are zero if (!(static_cast(i).get_dummy_indices().empty())) return _ex0; // Numeric evaluation if (static_cast(i).all_index_values_are(info_flags::nonnegint)) { // Sort indices int v[3]; for (unsigned j=0; j<3; j++) v[j] = ex_to(ex_to(i.op(j + 1)).get_value()).to_int(); if (v[0] > v[1]) std::swap(v[0], v[1]); if (v[0] > v[2]) std::swap(v[0], v[2]); if (v[1] > v[2]) std::swap(v[1], v[2]); #define CMPINDICES(A,B,C) ((v[0] == (A)) && (v[1] == (B)) && (v[2] == (C))) // Check for non-zero elements if (CMPINDICES(1,4,6) || CMPINDICES(1,5,7) || CMPINDICES(2,5,6) || CMPINDICES(3,4,4) || CMPINDICES(3,5,5)) return _ex1_2; else if (CMPINDICES(2,4,7) || CMPINDICES(3,6,6) || CMPINDICES(3,7,7)) return _ex_1_2; else if (CMPINDICES(1,1,8) || CMPINDICES(2,2,8) || CMPINDICES(3,3,8)) return sqrt(_ex3)*_ex1_3; else if (CMPINDICES(8,8,8)) return sqrt(_ex3)*_ex_1_3; else if (CMPINDICES(4,4,8) || CMPINDICES(5,5,8) || CMPINDICES(6,6,8) || CMPINDICES(7,7,8)) return sqrt(_ex3)/_ex_6; else return _ex0; } // No further simplifications return i.hold(); } /** Automatic symbolic evaluation of indexed antisymmetric structure constant. */ ex su3f::eval_indexed(const basic & i) const { GINAC_ASSERT(is_a(i)); GINAC_ASSERT(i.nops() == 4); GINAC_ASSERT(is_a(i.op(0))); // Numeric evaluation if (static_cast(i).all_index_values_are(info_flags::nonnegint)) { // Sort indices, remember permutation sign int v[3]; for (unsigned j=0; j<3; j++) v[j] = ex_to(ex_to(i.op(j + 1)).get_value()).to_int(); int sign = 1; if (v[0] > v[1]) { std::swap(v[0], v[1]); sign = -sign; } if (v[0] > v[2]) { std::swap(v[0], v[2]); sign = -sign; } if (v[1] > v[2]) { std::swap(v[1], v[2]); sign = -sign; } // Check for non-zero elements if (CMPINDICES(1,2,3)) return sign; else if (CMPINDICES(1,4,7) || CMPINDICES(2,4,6) || CMPINDICES(2,5,7) || CMPINDICES(3,4,5)) return _ex1_2 * sign; else if (CMPINDICES(1,5,6) || CMPINDICES(3,6,7)) return _ex_1_2 * sign; else if (CMPINDICES(4,5,8) || CMPINDICES(6,7,8)) return sqrt(_ex3)/2 * sign; else return _ex0; } // No further simplifications return i.hold(); } /** Contraction of generator with something else. */ bool su3t::contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const { GINAC_ASSERT(is_a(*self)); GINAC_ASSERT(is_a(*other)); GINAC_ASSERT(self->nops() == 2); GINAC_ASSERT(is_a(self->op(0))); unsigned char rl = ex_to(*self).get_representation_label(); if (is_exactly_a(other->op(0))) { // Contraction only makes sense if the representation labels are equal GINAC_ASSERT(is_a(*other)); if (ex_to(*other).get_representation_label() != rl) return false; // T.a T.a = 4/3 ONE if (other - self == 1) { *self = numeric(4, 3); *other = color_ONE(rl); return true; // T.a T.b T.a = -1/6 T.b } else if (other - self == 2 && is_a(self[1])) { *self = numeric(-1, 6); *other = _ex1; return true; // T.a S T.a = 1/2 Tr(S) - 1/6 S } else { auto it = self + 1; while (it != other) { if (!is_a(*it)) { return false; } it++; } it = self + 1; ex S = _ex1; while (it != other) { S *= *it; *it++ = _ex1; } *self = color_trace(S, rl) * color_ONE(rl) / 2 - S / 6; *other = _ex1; return true; } } return false; } /** Contraction of an indexed symmetric structure constant with something else. */ bool su3d::contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const { GINAC_ASSERT(is_a(*self)); GINAC_ASSERT(is_a(*other)); GINAC_ASSERT(self->nops() == 4); GINAC_ASSERT(is_a(self->op(0))); if (is_exactly_a(other->op(0))) { // Find the dummy indices of the contraction exvector self_indices = ex_to(*self).get_indices(); exvector other_indices = ex_to(*other).get_indices(); exvector all_indices = self_indices; all_indices.insert(all_indices.end(), other_indices.begin(), other_indices.end()); exvector free_indices, dummy_indices; find_free_and_dummy(all_indices, free_indices, dummy_indices); // d.abc d.abc = 40/3 if (dummy_indices.size() == 3) { *self = numeric(40, 3); *other = _ex1; return true; // d.akl d.bkl = 5/3 delta.ab } else if (dummy_indices.size() == 2) { exvector a; std::back_insert_iterator ita(a); ita = set_difference(self_indices.begin(), self_indices.end(), dummy_indices.begin(), dummy_indices.end(), ita, ex_is_less()); ita = set_difference(other_indices.begin(), other_indices.end(), dummy_indices.begin(), dummy_indices.end(), ita, ex_is_less()); GINAC_ASSERT(a.size() == 2); *self = numeric(5, 3) * delta_tensor(a[0], a[1]); *other = _ex1; return true; } } else if (is_exactly_a(other->op(0))) { // d.abc T.b T.c = 5/6 T.a if (other+1 != v.end() && is_exactly_a(other[1].op(0)) && ex_to(*self).has_dummy_index_for(other[1].op(1))) { exvector self_indices = ex_to(*self).get_indices(); exvector dummy_indices = {other[0].op(1), other[1].op(1)}; int sig; ex a = permute_free_index_to_front(self_indices, dummy_indices, sig); *self = numeric(5, 6); other[0] = color_T(a, ex_to(other[0]).get_representation_label()); other[1] = _ex1; return true; } } return false; } /** Contraction of an indexed antisymmetric structure constant with something else. */ bool su3f::contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const { GINAC_ASSERT(is_a(*self)); GINAC_ASSERT(is_a(*other)); GINAC_ASSERT(self->nops() == 4); GINAC_ASSERT(is_a(self->op(0))); if (is_exactly_a(other->op(0))) { // f*d is handled by su3d class // Find the dummy indices of the contraction exvector dummy_indices; dummy_indices = ex_to(*self).get_dummy_indices(ex_to(*other)); // f.abc f.abc = 24 if (dummy_indices.size() == 3) { *self = 24; *other = _ex1; return true; // f.akl f.bkl = 3 delta.ab } else if (dummy_indices.size() == 2) { int sign1, sign2; ex a = permute_free_index_to_front(ex_to(*self).get_indices(), dummy_indices, sign1); ex b = permute_free_index_to_front(ex_to(*other).get_indices(), dummy_indices, sign2); *self = sign1 * sign2 * 3 * delta_tensor(a, b); *other = _ex1; return true; } } else if (is_exactly_a(other->op(0))) { // f.abc T.b T.c = 3/2 I T.a if (other+1 != v.end() && is_exactly_a(other[1].op(0)) && ex_to(*self).has_dummy_index_for(other[1].op(1))) { exvector self_indices = ex_to(*self).get_indices(); exvector dummy_indices = {other[0].op(1), other[1].op(1)}; int sig; ex a = permute_free_index_to_front(self_indices, dummy_indices, sig); *self = numeric(3, 2) * sig * I; other[0] = color_T(a, ex_to(other[0]).get_representation_label()); other[1] = _ex1; return true; } } return false; } ////////// // global functions ////////// ex color_ONE(unsigned char rl) { static ex ONE = dynallocate(); return color(ONE, rl); } ex color_T(const ex & a, unsigned char rl) { static ex t = dynallocate(); if (!is_a(a)) throw(std::invalid_argument("indices of color_T must be of type idx")); if (!ex_to(a).get_dim().is_equal(8)) throw(std::invalid_argument("index dimension for color_T must be 8")); return color(t, a, rl); } ex color_f(const ex & a, const ex & b, const ex & c) { static ex f = dynallocate(); if (!is_a(a) || !is_a(b) || !is_a(c)) throw(std::invalid_argument("indices of color_f must be of type idx")); if (!ex_to(a).get_dim().is_equal(8) || !ex_to(b).get_dim().is_equal(8) || !ex_to(c).get_dim().is_equal(8)) throw(std::invalid_argument("index dimension for color_f must be 8")); return indexed(f, antisymmetric3(), a, b, c); } ex color_d(const ex & a, const ex & b, const ex & c) { static ex d = dynallocate(); if (!is_a(a) || !is_a(b) || !is_a(c)) throw(std::invalid_argument("indices of color_d must be of type idx")); if (!ex_to(a).get_dim().is_equal(8) || !ex_to(b).get_dim().is_equal(8) || !ex_to(c).get_dim().is_equal(8)) throw(std::invalid_argument("index dimension for color_d must be 8")); return indexed(d, symmetric3(), a, b, c); } ex color_h(const ex & a, const ex & b, const ex & c) { return color_d(a, b, c) + I * color_f(a, b, c); } /** Check whether a given tinfo key (as returned by return_type_tinfo() * is that of a color object (with an arbitrary representation label). */ static bool is_color_tinfo(const return_type_t& ti) { return *(ti.tinfo) == typeid(color); } /** Extract representation label from tinfo key (as returned by * return_type_tinfo()). */ static unsigned char get_representation_label(const return_type_t& ti) { return (unsigned char)ti.rl; } ex color_trace(const ex & e, const std::set & rls) { if (is_a(e)) { unsigned char rl = ex_to(e).get_representation_label(); // Are we taking the trace over this object's representation label? if (rls.find(rl) == rls.end()) return e; // Yes, all generators are traceless, except for color_ONE if (is_a(e.op(0))) return _ex3; else return _ex0; } else if (is_exactly_a(e)) { // Trace of product: pull out non-color factors ex prod = _ex1; for (size_t i=0; i(e)) { unsigned char rl = get_representation_label(e.return_type_tinfo()); // Are we taking the trace over this string's representation label? if (rls.find(rl) == rls.end()) return e; // Yes, expand product if necessary ex e_expanded = e.expand(); if (!is_a(e_expanded)) return color_trace(e_expanded, rls); size_t num = e.nops(); if (num == 2) { // Tr T_a T_b = 1/2 delta_a_b return delta_tensor(e.op(0).op(1), e.op(1).op(1)) / 2; } else if (num == 3) { // Tr T_a T_b T_c = 1/4 h_a_b_c return color_h(e.op(0).op(1), e.op(1).op(1), e.op(2).op(1)) / 4; } else { // Traces of 4 or more generators are computed recursively: // Tr T_a1 .. T_an = // 1/6 delta_a(n-1)_an Tr T_a1 .. T_a(n-2) // + 1/2 h_a(n-1)_an_k Tr T_a1 .. T_a(n-2) T_k const ex &last_index = e.op(num - 1).op(1); const ex &next_to_last_index = e.op(num - 2).op(1); idx summation_index(dynallocate(), 8); exvector v1; v1.reserve(num - 2); for (size_t i=0; i 0) { // Trace maps to all other container classes (this includes sums) pointer_to_map_function_1arg &> fcn(color_trace, rls); return e.map(fcn); } else return _ex0; } ex color_trace(const ex & e, const lst & rll) { // Convert list to set std::set rls; for (auto & it : rll) { if (it.info(info_flags::nonnegint)) rls.insert(ex_to(it).to_int()); } return color_trace(e, rls); } ex color_trace(const ex & e, unsigned char rl) { // Convert label to set std::set rls; rls.insert(rl); return color_trace(e, rls); } } // namespace GiNaC ginac-1.7.8.orig/ginac/color.h0000644000000000000000000001510613457611471013021 0ustar /** @file color.h * * Interface to GiNaC's color (SU(3) Lie algebra) objects. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #ifndef GINAC_COLOR_H #define GINAC_COLOR_H #include "indexed.h" #include "tensor.h" #include namespace GiNaC { /** This class holds a generator T_a or the unity element of the Lie algebra * of SU(3), as used for calculations in quantum chromodynamics. A * representation label (an unsigned 8-bit integer) is used to distinguish * elements from different Lie algebras (objects with different labels * commutate). These objects implement an abstract representation of the * group, not a specific matrix representation. The indices used for color * objects should not have a variance. */ class color : public indexed { GINAC_DECLARE_REGISTERED_CLASS(color, indexed) // other constructors public: color(const ex & b, unsigned char rl = 0); color(const ex & b, const ex & i1, unsigned char rl = 0); // internal constructors color(unsigned char rl, const exvector & v); color(unsigned char rl, exvector && v); void archive(archive_node& n) const override; void read_archive(const archive_node& n, lst& sym_lst) override; // functions overriding virtual functions from base classes protected: ex eval_ncmul(const exvector & v) const override; bool match_same_type(const basic & other) const override; ex thiscontainer(const exvector & v) const override; ex thiscontainer(exvector && v) const override; unsigned return_type() const override { return return_types::noncommutative; } return_type_t return_type_tinfo() const override; // non-virtual functions in this class public: unsigned char get_representation_label() const {return representation_label;} // member variables private: unsigned char representation_label; /**< Representation label to distinguish independent color matrices coming from separated fermion lines */ }; GINAC_DECLARE_UNARCHIVER(color); /** This class represents the su(3) unity element. */ class su3one : public tensor { GINAC_DECLARE_REGISTERED_CLASS(su3one, tensor) // non-virtual functions in this class protected: void do_print(const print_context & c, unsigned level) const; void do_print_latex(const print_latex & c, unsigned level) const; }; GINAC_DECLARE_UNARCHIVER(su3one); /** This class represents an su(3) generator. */ class su3t : public tensor { GINAC_DECLARE_REGISTERED_CLASS(su3t, tensor) // functions overriding virtual functions from base classes public: bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override; // non-virtual functions in this class protected: void do_print(const print_context & c, unsigned level) const; void do_print_latex(const print_latex & c, unsigned level) const; }; GINAC_DECLARE_UNARCHIVER(su3t); /** This class represents the tensor of antisymmetric su(3) structure * constants. */ class su3f : public tensor { GINAC_DECLARE_REGISTERED_CLASS(su3f, tensor) // functions overriding virtual functions from base classes public: ex eval_indexed(const basic & i) const override; bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override; protected: unsigned return_type() const override { return return_types::commutative; } // non-virtual functions in this class protected: void do_print(const print_context & c, unsigned level) const; void do_print_latex(const print_latex & c, unsigned level) const; }; GINAC_DECLARE_UNARCHIVER(su3f); /** This class represents the tensor of symmetric su(3) structure constants. */ class su3d : public tensor { GINAC_DECLARE_REGISTERED_CLASS(su3d, tensor) // functions overriding virtual functions from base classes public: ex eval_indexed(const basic & i) const override; bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const override; protected: unsigned return_type() const override { return return_types::commutative; } // non-virtual functions in this class protected: void do_print(const print_context & c, unsigned level) const; void do_print_latex(const print_latex & c, unsigned level) const; }; GINAC_DECLARE_UNARCHIVER(su3d); // global functions /** Create the su(3) unity element. This is an indexed object, although it * has no indices. * * @param rl Representation label * @return newly constructed unity element */ ex color_ONE(unsigned char rl = 0); /** Create an su(3) generator. * * @param a Index * @param rl Representation label * @return newly constructed unity generator */ ex color_T(const ex & a, unsigned char rl = 0); /** Create an su(3) antisymmetric structure constant. * * @param a First index * @param b Second index * @param c Third index * @return newly constructed structure constant */ ex color_f(const ex & a, const ex & b, const ex & c); /** Create an su(3) symmetric structure constant. * * @param a First index * @param b Second index * @param c Third index * @return newly constructed structure constant */ ex color_d(const ex & a, const ex & b, const ex & c); /** This returns the linear combination d.a.b.c+I*f.a.b.c. */ ex color_h(const ex & a, const ex & b, const ex & c); /** Calculate color traces over the specified set of representation labels. * * @param e Expression to take the trace of * @param rls Set of representation labels */ ex color_trace(const ex & e, const std::set & rls); /** Calculate color traces over the specified list of representation labels. * * @param e Expression to take the trace of * @param rll List of representation labels */ ex color_trace(const ex & e, const lst & rll); /** Calculate the trace of an expression containing color objects with a * specified representation label. * * @param e Expression to take the trace of * @param rl Representation label */ ex color_trace(const ex & e, unsigned char rl = 0); } // namespace GiNaC #endif // ndef GINAC_COLOR_H ginac-1.7.8.orig/ginac/compiler.h0000644000000000000000000000233613457611471013516 0ustar /** @file compiler.h * * Definition of optimizing macros. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #ifndef GINAC_COMPILER_H #define GINAC_COMPILER_H #ifdef __GNUC__ #define unlikely(cond) __builtin_expect((cond), 0) #define likely(cond) __builtin_expect((cond), 1) #define attribute_deprecated __attribute__ ((deprecated)) #else #define unlikely(cond) (cond) #define likely(cond) (cond) #define attribute_deprecated #endif #endif // ndef GINAC_COMPILER_DEP_H ginac-1.7.8.orig/ginac/constant.cpp0000644000000000000000000001446513457611471014076 0ustar /** @file constant.cpp * * Implementation of GiNaC's constant types and some special constants. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #include "constant.h" #include "numeric.h" #include "ex.h" #include "archive.h" #include "utils.h" #include "inifcns.h" #include #include #include namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(constant, basic, print_func(&constant::do_print). print_func(&constant::do_print_latex). print_func(&constant::do_print_tree). print_func(&constant::do_print_python_repr)) ////////// // default constructor ////////// // public constant::constant() : ef(nullptr), serial(next_serial++), domain(domain::complex) { setflag(status_flags::evaluated | status_flags::expanded); } ////////// // other constructors ////////// // public constant::constant(const std::string & initname, evalffunctype efun, const std::string & texname, unsigned dm) : name(initname), ef(efun), serial(next_serial++), domain(dm) { if (texname.empty()) TeX_name = "\\mathrm{" + name + "}"; else TeX_name = texname; setflag(status_flags::evaluated | status_flags::expanded); } constant::constant(const std::string & initname, const numeric & initnumber, const std::string & texname, unsigned dm) : name(initname), ef(nullptr), number(initnumber), serial(next_serial++), domain(dm) { if (texname.empty()) TeX_name = "\\mathrm{" + name + "}"; else TeX_name = texname; setflag(status_flags::evaluated | status_flags::expanded); } ////////// // archiving ////////// void constant::read_archive(const archive_node &n, lst &sym_lst) { // Find constant by name (!! this is bad: 'twould be better if there // was a list of all global constants that we could search) std::string s; if (n.find_string("name", s)) { if (s == Pi.name) *this = Pi; else if (s == Catalan.name) *this = Catalan; else if (s == Euler.name) *this = Euler; else throw (std::runtime_error("unknown constant '" + s + "' in archive")); } else throw (std::runtime_error("unnamed constant in archive")); } GINAC_BIND_UNARCHIVER(constant); void constant::archive(archive_node &n) const { inherited::archive(n); n.add_string("name", name); } ////////// // functions overriding virtual functions from base classes ////////// // public void constant::do_print(const print_context & c, unsigned level) const { c.s << name; } void constant::do_print_tree(const print_tree & c, unsigned level) const { c.s << std::string(level, ' ') << name << " (" << class_name() << ")" << " @" << this << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec << std::endl; } void constant::do_print_latex(const print_latex & c, unsigned level) const { c.s << TeX_name; } void constant::do_print_python_repr(const print_python_repr & c, unsigned level) const { c.s << class_name() << "('" << name << "'"; if (TeX_name != "\\mathrm{" + name + "}") c.s << ",TeX_name='" << TeX_name << "'"; c.s << ')'; } bool constant::info(unsigned inf) const { if (inf == info_flags::polynomial) return true; if (inf == info_flags::real) return domain==domain::real || domain==domain::positive ; if (inf==info_flags::positive || inf==info_flags::nonnegative) return domain == domain::positive; else return inherited::info(inf); } ex constant::evalf() const { if (ef!=nullptr) { return ef(); } else { return number.evalf(); } return *this; } bool constant::is_polynomial(const ex & var) const { return true; } ex constant::conjugate() const { if ( domain==domain::real || domain==domain::positive ) return *this; return conjugate_function(*this).hold(); } ex constant::real_part() const { if ( domain==domain::real || domain==domain::positive ) return *this; return real_part_function(*this).hold(); } ex constant::imag_part() const { if ( domain==domain::real || domain==domain::positive ) return 0; return imag_part_function(*this).hold(); } // protected /** Implementation of ex::diff() for a constant always returns 0. * * @see ex::diff */ ex constant::derivative(const symbol & s) const { return _ex0; } int constant::compare_same_type(const basic & other) const { GINAC_ASSERT(is_exactly_a(other)); const constant &o = static_cast(other); if (serial == o.serial) return 0; else return serial < o.serial ? -1 : 1; } bool constant::is_equal_same_type(const basic & other) const { GINAC_ASSERT(is_exactly_a(other)); const constant &o = static_cast(other); return serial == o.serial; } unsigned constant::calchash() const { const void* typeid_this = (const void*)typeid(*this).name(); hashvalue = golden_ratio_hash((uintptr_t)typeid_this ^ serial); setflag(status_flags::hash_calculated); return hashvalue; } ////////// // new virtual functions which can be overridden by derived classes ////////// // none ////////// // non-virtual functions in this class ////////// // none ////////// // static member variables ////////// unsigned constant::next_serial = 0; ////////// // global constants ////////// /** Pi. (3.14159...) Diverts straight into CLN for evalf(). */ const constant Pi("Pi", PiEvalf, "\\pi", domain::positive); /** Euler's constant. (0.57721...) Sometimes called Euler-Mascheroni constant. * Diverts straight into CLN for evalf(). */ const constant Euler("Euler", EulerEvalf, "\\gamma_E", domain::positive); /** Catalan's constant. (0.91597...) Diverts straight into CLN for evalf(). */ const constant Catalan("Catalan", CatalanEvalf, "G", domain::positive); } // namespace GiNaC ginac-1.7.8.orig/ginac/constant.h0000644000000000000000000000617413457611471013541 0ustar /** @file constant.h * * Interface to GiNaC's constant types and some special constants. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #ifndef GINAC_CONSTANT_H #define GINAC_CONSTANT_H #include "basic.h" #include "ex.h" #include "archive.h" #include namespace GiNaC { typedef ex (*evalffunctype)(); /** This class holds constants, symbols with specific numerical value. Each * object of this class must either provide their own function to evaluate it * to class numeric or provide the constant as a numeric (if it's an exact * number). */ class constant : public basic { GINAC_DECLARE_REGISTERED_CLASS(constant, basic) // other constructors public: constant(const std::string & initname, evalffunctype efun = nullptr, const std::string & texname = std::string(), unsigned domain = domain::complex); constant(const std::string & initname, const numeric & initnumber, const std::string & texname = std::string(), unsigned domain = domain::complex); // functions overriding virtual functions from base classes public: bool info(unsigned inf) const override; ex evalf() const override; bool is_polynomial(const ex & var) const override; ex conjugate() const override; ex real_part() const override; ex imag_part() const override; void archive(archive_node& n) const override; void read_archive(const archive_node& n, lst& syms) override; protected: ex derivative(const symbol & s) const override; bool is_equal_same_type(const basic & other) const override; unsigned calchash() const override; // non-virtual functions in this class protected: void do_print(const print_context & c, unsigned level) const; void do_print_tree(const print_tree & c, unsigned level) const; void do_print_latex(const print_latex & c, unsigned level) const; void do_print_python_repr(const print_python_repr & c, unsigned level) const; // member variables private: std::string name; ///< printname of this constant std::string TeX_name; ///< LaTeX name evalffunctype ef; ex number; ///< numerical value this constant evalf()s to unsigned serial; ///< unique serial number for comparison static unsigned next_serial; unsigned domain; ///< numerical value this constant evalf()s to }; GINAC_DECLARE_UNARCHIVER(constant); extern const constant Pi; extern const constant Catalan; extern const constant Euler; } // namespace GiNaC #endif // ndef GINAC_CONSTANT_H ginac-1.7.8.orig/ginac/container.h0000644000000000000000000005642613541760644013700 0ustar /** @file container.h * * Wrapper template for making GiNaC classes out of STL containers. */ /* * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany * * 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 */ #ifndef GINAC_CONTAINER_H #define GINAC_CONTAINER_H #include "ex.h" #include "print.h" #include "archive.h" #include "assertion.h" #include "compiler.h" #include #include #include #include #include #include namespace GiNaC { /** Helper template for encapsulating the reserve() mechanics of STL containers. */ template