From 0b6d754acb198daae1a02d265a2ea6c6d6d23d7d Mon Sep 17 00:00:00 2001 From: Tim Greaves Date: Thu, 31 Jan 2019 11:49:33 +0000 Subject: [PATCH 1/6] Remove libspud subtree --- libspud/AUTHORS | 24 - libspud/COPYING | 44 - libspud/LGPL-2.1 | 510 - libspud/Makefile.in | 131 - libspud/README.md | 17 - libspud/aclocal.m4 | 8444 ----- libspud/config.guess | 1501 - libspud/config.sub | 1705 - libspud/configure | 25889 ---------------- libspud/configure.in | 307 - libspud/debian/changelog | 272 - libspud/debian/compat | 1 - libspud/debian/control | 73 - libspud/debian/diamond.copyright | 43 - libspud/debian/diamond.dirs | 2 - libspud/debian/diamond.docs | 1 - libspud/debian/install.diamond | 1 - libspud/debian/libspud-dev.copyright | 39 - libspud/debian/libspud-dev.dirs | 2 - libspud/debian/libspud-dev.docs | 2 - libspud/debian/postinst | 2 - libspud/debian/python-spud.copyright | 39 - libspud/debian/rules | 156 - libspud/debian/spudtools.copyright | 39 - libspud/debian/spudtools.dirs | 1 - libspud/diamond/COPYING | 43 - libspud/diamond/GPL-3 | 676 - libspud/diamond/MANIFEST.in | 4 - libspud/diamond/README.txt | 8 - libspud/diamond/diamond/TextBufferMarkup.py | 406 - libspud/diamond/diamond/__init__.py | 0 libspud/diamond/diamond/attributewidget.py | 341 - libspud/diamond/diamond/choice.py | 186 - libspud/diamond/diamond/commentwidget.py | 146 - libspud/diamond/diamond/config.py | 103 - libspud/diamond/diamond/databuttonswidget.py | 47 - libspud/diamond/diamond/datatype.py | 75 - libspud/diamond/diamond/datawidget.py | 512 - libspud/diamond/diamond/debug.py | 152 - libspud/diamond/diamond/descriptionwidget.py | 192 - libspud/diamond/diamond/dialogs.py | 283 - libspud/diamond/diamond/diffview.py | 548 - libspud/diamond/diamond/interface.py | 1983 -- libspud/diamond/diamond/mixedtree.py | 236 - libspud/diamond/diamond/plist.py | 58 - libspud/diamond/diamond/plugins.py.in | 78 - libspud/diamond/diamond/preprocess.py.in | 157 - libspud/diamond/diamond/pygtkconsole.py | 333 - libspud/diamond/diamond/schema.py | 890 - libspud/diamond/diamond/schemausage.py | 114 - libspud/diamond/diamond/scherror.py | 259 - libspud/diamond/diamond/sliceview.py | 117 - libspud/diamond/diamond/tree.py | 564 - libspud/diamond/diamond/triangle_reader.py | 275 - libspud/diamond/diamond/useview.py | 182 - libspud/diamond/doc/main.xml | 1521 - libspud/diamond/gui/diamond.png | Bin 3566 -> 0 bytes libspud/diamond/gui/diamond.svg | 446 - libspud/diamond/gui/gui.glade | 564 - libspud/diamond/macosx/Info.plist | 26 - libspud/diamond/macosx/PkgInfo | 1 - libspud/diamond/macosx/diamond | 10 - libspud/diamond/macosx/diamond.icns | Bin 262454 -> 0 bytes libspud/diamond/macosx/mac_bundle.sh | 191 - libspud/diamond/macosx/pango_rc | 2 - libspud/diamond/misc/diamond-bash-completion | 29 - .../flml/show_triangle_mesh.py.disabled | 66 - libspud/diamond/plugins/test.py | 16 - libspud/diamond/setup.py.in | 87 - libspud/diamond/tests/plist/plist.py | 40 - .../tests/read_xml/find_hidden_xmldata.py | 12 - libspud/diamond/tests/schema/first.rnc | 6 - libspud/diamond/tests/schema/first.rng | 14 - .../diamond/tests/schema/test_cb_methods.py | 16 - .../tests/schema/test_references_schema.py | 0 .../tests/schema/test_simple_schema.py | 23 - libspud/diamond/tests/to_test.txt | 14 - libspud/diamond/todo.txt | 1 - libspud/doc/Makefile | 15 - libspud/doc/diamond_manual.tex | 163 - libspud/doc/spud_manual.pdf | Bin 290244 -> 0 bytes libspud/doc/spud_manual.tex | 1421 - libspud/dxdiff/COPYING | 15 - libspud/dxdiff/GPL-3 | 676 - libspud/dxdiff/dxdiff/__init__.py | 0 libspud/dxdiff/dxdiff/bimap.py | 49 - libspud/dxdiff/dxdiff/diff.py | 26 - libspud/dxdiff/dxdiff/dxdiff | 87 - libspud/dxdiff/dxdiff/editscript.py | 79 - libspud/dxdiff/dxdiff/fmes.py | 473 - libspud/dxdiff/dxdiff/lcs.py | 284 - libspud/dxdiff/dxdiff/utils.py | 172 - libspud/dxdiff/setup.py | 21 - libspud/examples/Makefile.in | 55 - libspud/examples/README | 66 - libspud/examples/ballistics.F90 | 206 - libspud/examples/ballistics.rnc | 75 - libspud/examples/ballistics.rng | 93 - libspud/examples/ballistics.xml | 41 - libspud/examples/show_ballistics | 35 - libspud/include/spud | 553 - libspud/include/spud.h | 76 - libspud/include/spud_enums.h | 66 - libspud/include/tinystr.h | 319 - libspud/include/tinyxml.h | 1804 -- libspud/install-sh | 520 - libspud/ltmain.sh | 9636 ------ libspud/python/libspud.c | 875 - libspud/python/libspud.py.ctypes | 307 - libspud/python/setup.py | 9 - libspud/python/test.flml | 382 - libspud/python/test_libspud.py | 124 - libspud/schema/spud_base.rnc | 226 - libspud/schema/spud_base.rng | 391 - libspud/src/fspud.f90 | 1183 - libspud/src/spud.cpp | 1875 -- libspud/src/spud_interfaces.cpp | 288 - libspud/src/tests/Makefile.in | 75 - libspud/src/tests/test_fspud.f90 | 964 - libspud/src/tests/test_main.cpp | 50 - libspud/src/tests/unittest_tools.f90 | 88 - libspud/src/tinystr.cpp | 116 - libspud/src/tinyxml.cpp | 1888 -- libspud/src/tinyxmlerror.cpp | 53 - libspud/src/tinyxmlparser.cpp | 1638 - 125 files changed, 78856 deletions(-) delete mode 100644 libspud/AUTHORS delete mode 100644 libspud/COPYING delete mode 100644 libspud/LGPL-2.1 delete mode 100644 libspud/Makefile.in delete mode 100644 libspud/README.md delete mode 100644 libspud/aclocal.m4 delete mode 100644 libspud/config.guess delete mode 100644 libspud/config.sub delete mode 100755 libspud/configure delete mode 100644 libspud/configure.in delete mode 100644 libspud/debian/changelog delete mode 100644 libspud/debian/compat delete mode 100644 libspud/debian/control delete mode 100644 libspud/debian/diamond.copyright delete mode 100644 libspud/debian/diamond.dirs delete mode 100644 libspud/debian/diamond.docs delete mode 100644 libspud/debian/install.diamond delete mode 100644 libspud/debian/libspud-dev.copyright delete mode 100644 libspud/debian/libspud-dev.dirs delete mode 100644 libspud/debian/libspud-dev.docs delete mode 100644 libspud/debian/postinst delete mode 100644 libspud/debian/python-spud.copyright delete mode 100755 libspud/debian/rules delete mode 100644 libspud/debian/spudtools.copyright delete mode 100644 libspud/debian/spudtools.dirs delete mode 100644 libspud/diamond/COPYING delete mode 100644 libspud/diamond/GPL-3 delete mode 100644 libspud/diamond/MANIFEST.in delete mode 100644 libspud/diamond/README.txt delete mode 100644 libspud/diamond/diamond/TextBufferMarkup.py delete mode 100644 libspud/diamond/diamond/__init__.py delete mode 100644 libspud/diamond/diamond/attributewidget.py delete mode 100644 libspud/diamond/diamond/choice.py delete mode 100644 libspud/diamond/diamond/commentwidget.py delete mode 100644 libspud/diamond/diamond/config.py delete mode 100644 libspud/diamond/diamond/databuttonswidget.py delete mode 100644 libspud/diamond/diamond/datatype.py delete mode 100644 libspud/diamond/diamond/datawidget.py delete mode 100644 libspud/diamond/diamond/debug.py delete mode 100644 libspud/diamond/diamond/descriptionwidget.py delete mode 100644 libspud/diamond/diamond/dialogs.py delete mode 100644 libspud/diamond/diamond/diffview.py delete mode 100644 libspud/diamond/diamond/interface.py delete mode 100644 libspud/diamond/diamond/mixedtree.py delete mode 100644 libspud/diamond/diamond/plist.py delete mode 100644 libspud/diamond/diamond/plugins.py.in delete mode 100644 libspud/diamond/diamond/preprocess.py.in delete mode 100644 libspud/diamond/diamond/pygtkconsole.py delete mode 100644 libspud/diamond/diamond/schema.py delete mode 100755 libspud/diamond/diamond/schemausage.py delete mode 100644 libspud/diamond/diamond/scherror.py delete mode 100644 libspud/diamond/diamond/sliceview.py delete mode 100644 libspud/diamond/diamond/tree.py delete mode 100644 libspud/diamond/diamond/triangle_reader.py delete mode 100644 libspud/diamond/diamond/useview.py delete mode 100644 libspud/diamond/doc/main.xml delete mode 100644 libspud/diamond/gui/diamond.png delete mode 100644 libspud/diamond/gui/diamond.svg delete mode 100644 libspud/diamond/gui/gui.glade delete mode 100644 libspud/diamond/macosx/Info.plist delete mode 100644 libspud/diamond/macosx/PkgInfo delete mode 100755 libspud/diamond/macosx/diamond delete mode 100644 libspud/diamond/macosx/diamond.icns delete mode 100755 libspud/diamond/macosx/mac_bundle.sh delete mode 100644 libspud/diamond/macosx/pango_rc delete mode 100644 libspud/diamond/misc/diamond-bash-completion delete mode 100644 libspud/diamond/plugins/flml/show_triangle_mesh.py.disabled delete mode 100644 libspud/diamond/plugins/test.py delete mode 100644 libspud/diamond/setup.py.in delete mode 100644 libspud/diamond/tests/plist/plist.py delete mode 100644 libspud/diamond/tests/read_xml/find_hidden_xmldata.py delete mode 100644 libspud/diamond/tests/schema/first.rnc delete mode 100644 libspud/diamond/tests/schema/first.rng delete mode 100644 libspud/diamond/tests/schema/test_cb_methods.py delete mode 100644 libspud/diamond/tests/schema/test_references_schema.py delete mode 100644 libspud/diamond/tests/schema/test_simple_schema.py delete mode 100644 libspud/diamond/tests/to_test.txt delete mode 100644 libspud/diamond/todo.txt delete mode 100644 libspud/doc/Makefile delete mode 100644 libspud/doc/diamond_manual.tex delete mode 100644 libspud/doc/spud_manual.pdf delete mode 100644 libspud/doc/spud_manual.tex delete mode 100644 libspud/dxdiff/COPYING delete mode 100644 libspud/dxdiff/GPL-3 delete mode 100644 libspud/dxdiff/dxdiff/__init__.py delete mode 100644 libspud/dxdiff/dxdiff/bimap.py delete mode 100644 libspud/dxdiff/dxdiff/diff.py delete mode 100755 libspud/dxdiff/dxdiff/dxdiff delete mode 100644 libspud/dxdiff/dxdiff/editscript.py delete mode 100644 libspud/dxdiff/dxdiff/fmes.py delete mode 100644 libspud/dxdiff/dxdiff/lcs.py delete mode 100644 libspud/dxdiff/dxdiff/utils.py delete mode 100644 libspud/dxdiff/setup.py delete mode 100644 libspud/examples/Makefile.in delete mode 100644 libspud/examples/README delete mode 100644 libspud/examples/ballistics.F90 delete mode 100644 libspud/examples/ballistics.rnc delete mode 100644 libspud/examples/ballistics.rng delete mode 100644 libspud/examples/ballistics.xml delete mode 100644 libspud/examples/show_ballistics delete mode 100644 libspud/include/spud delete mode 100644 libspud/include/spud.h delete mode 100644 libspud/include/spud_enums.h delete mode 100644 libspud/include/tinystr.h delete mode 100644 libspud/include/tinyxml.h delete mode 100644 libspud/install-sh delete mode 100644 libspud/ltmain.sh delete mode 100644 libspud/python/libspud.c delete mode 100644 libspud/python/libspud.py.ctypes delete mode 100644 libspud/python/setup.py delete mode 100644 libspud/python/test.flml delete mode 100644 libspud/python/test_libspud.py delete mode 100644 libspud/schema/spud_base.rnc delete mode 100644 libspud/schema/spud_base.rng delete mode 100644 libspud/src/fspud.f90 delete mode 100644 libspud/src/spud.cpp delete mode 100644 libspud/src/spud_interfaces.cpp delete mode 100644 libspud/src/tests/Makefile.in delete mode 100644 libspud/src/tests/test_fspud.f90 delete mode 100644 libspud/src/tests/test_main.cpp delete mode 100644 libspud/src/tests/unittest_tools.f90 delete mode 100644 libspud/src/tinystr.cpp delete mode 100644 libspud/src/tinyxml.cpp delete mode 100644 libspud/src/tinyxmlerror.cpp delete mode 100644 libspud/src/tinyxmlparser.cpp diff --git a/libspud/AUTHORS b/libspud/AUTHORS deleted file mode 100644 index dab5150b53..0000000000 --- a/libspud/AUTHORS +++ /dev/null @@ -1,24 +0,0 @@ -Spud has been contributed to by the following authors: - -Institutions ------------- - -Imperial College London -University of Oxford - -Individuals ------------ - -Adam Candy -Gareth Collins -Colin Cotter -Patrick Farrell -Gerard Gorman -David Ham -Stephan Kramer -James Maddison -Matthew Piggott -Jemma Shipton -Adrian Umpleby -Fraser Waters -Cian Wilson diff --git a/libspud/COPYING b/libspud/COPYING deleted file mode 100644 index 645e441e5b..0000000000 --- a/libspud/COPYING +++ /dev/null @@ -1,44 +0,0 @@ -Except as noted below, Spud is copyright (C) 2007 Imperial College -London and others. For a full list of contributors see the AUTHORS -file. - -Spud is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -The complete text of the GNU Lesser General Public License can be -found in the file `LGPL-2.1'. - ------ - -Copyright and licence information for Diamond is to be found in the -file Diamond/COPYING. - ------ - -Tinyxml is copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. \ No newline at end of file diff --git a/libspud/LGPL-2.1 b/libspud/LGPL-2.1 deleted file mode 100644 index 2d2d780e60..0000000000 --- a/libspud/LGPL-2.1 +++ /dev/null @@ -1,510 +0,0 @@ - - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin St, 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. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations -below. - - When we speak of free software, we are referring to freedom of use, -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 and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it -becomes a de-facto standard. To achieve this, non-free programs must -be allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, 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 library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete 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 distribute a copy of this License along with the -Library. - - 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 Library or any portion -of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -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 Library, 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 Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you 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. - - If distribution of 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 satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at least - three years, to give the same user the materials specified in - Subsection 6a, above, for a charge no more than the cost of - performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be 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. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library 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. - - 9. 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 Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -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 with -this License. - - 11. 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 Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library 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 Library. - -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. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library 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. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser 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 Library -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 Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -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 - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "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 -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. 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 LIBRARY 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 -LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms -of the ordinary General Public License). - - To apply these terms, attach the following notices to the library. -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 library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or -your school, if any, to sign a "copyright disclaimer" for the library, -if necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James - Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/libspud/Makefile.in b/libspud/Makefile.in deleted file mode 100644 index 30d5cb6dc9..0000000000 --- a/libspud/Makefile.in +++ /dev/null @@ -1,131 +0,0 @@ -# -# Please see the AUTHORS file in the main source directory for a full list -# of copyright holders. -# -# Applied Modelling and Computation Group -# Department of Earth Science and Engineering -# Imperial College London -# -# David.Ham@Imperial.ac.uk -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation, -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA - -SHELL = /bin/sh - -FC = @FC@ -FCFLAGS = -Iinclude @CPPFLAGS@ @FCFLAGS@ - -CXX = @CXX@ -CXXFLAGS= -Iinclude @CPPFLAGS@ @CXXFLAGS@ - -MAKE = @MAKE@ -AR = @AR@ -ARFLAGS = @ARFLAGS@ - -LIB = libspud.la -LIBS = $(shell echo @LIBS@ | sed 's/-L /-L/g') - -HEADERS = include/spud.h include/spud include/spud_enums.h include/tinystr.h include/tinyxml.h -MODS = spud.mod -OBJS = spud.lo spud_interfaces.lo tinystr.lo tinyxml.lo tinyxmlerror.lo tinyxmlparser.lo fspud.lo - -VPATH = src/ - -.SUFFIXES: .f90 .F90 .c .cpp .lo .la - -.f90.lo: - ./libtool --mode=compile --tag=FC $(FC) $(FCFLAGS) -c $< -.cpp.lo: - ./libtool --mode=compile --tag=CXX $(CXX) $(CXXFLAGS) -c $< - -default: libspud.la build-diamond - -libspud.la: $(OBJS) - ./libtool --mode=link --tag=FC $(FC) $(FCFLAGS) -o $(LIB) $(OBJS) $(LIBS) -rpath @prefix@/lib - if test -f .libs/libspud.a; then cp .libs/libspud.a .; fi - (if test -f .libs/libspud.so; then cp .libs/libspud.so ./libspud.so.0; ln -s libspud.so.0 libspud.so; fi) || true - -build-diamond: - cd diamond; python setup.py build; cd .. - -test: unittest - -unittest: libspud.la - @cd src/tests; $(MAKE) - -.PHONY:doc - -doc: - @cd doc; $(MAKE) spud_manual.pdf - -install: install-libspud install-spudtools install-diamond install-pyspud install-dxdiff - -install-libspud: libspud.la - @INSTALL@ -d $(DESTDIR)@prefix@/lib - @INSTALL@ -d $(DESTDIR)@prefix@/include - @INSTALL@ libspud.a $(DESTDIR)@prefix@/lib - (if test -f libspud.so.0; then @INSTALL@ libspud.so.0 $(DESTDIR)@prefix@/lib; fi) || true - (if test -f libspud.so; then cd $(DESTDIR)@prefix@/lib/; ln -s libspud.so.0 libspud.so; cd -; fi) || true - @INSTALL@ $(MODS) $(DESTDIR)@prefix@/include - @INSTALL@ $(HEADERS) $(DESTDIR)@prefix@/include - -install-spudtools: - @INSTALL@ -d $(DESTDIR)@prefix@/share/spud - @INSTALL@ -d $(DESTDIR)@prefix@/bin - @INSTALL@ -m755 bin/spud-preprocess $(DESTDIR)@prefix@/bin - @INSTALL@ -m755 bin/spud-set $(DESTDIR)@prefix@/bin - @INSTALL@ -m755 bin/spud-update-options $(DESTDIR)@prefix@/bin - @INSTALL@ -m644 schema/spud_base.rnc $(DESTDIR)@prefix@/share/spud - @INSTALL@ -m644 schema/spud_base.rng $(DESTDIR)@prefix@/share/spud - -install-diamond: - cd diamond; python setup.py install --prefix=$(DESTDIR)@prefix@; cd .. - -install-pyspud: -ifeq ($(origin BUILDING_DEBIAN),undefined) - cd python; python setup.py install --prefix=$(DESTDIR)@prefix@; cd .. -else - cd python; for python in $(shell pyversions -r); do $$python setup.py install --prefix=$(DESTDIR)@prefix@ --install-layout=deb; done; cd .. -endif - -install-dxdiff: -ifeq ($(origin BUILDING_DEBIAN),undefined) - cd dxdiff; python setup.py install --prefix=$(DESTDIR)@prefix@; cd .. -else - cd dxdiff; for python in $(shell pyversions -r); do $$python setup.py install --prefix=$(DESTDIR)@prefix@ --install-layout=deb; done; cd .. -endif - -clean: - @cd doc; $(MAKE) clean - rm -f *.o libspud.a libspud.so* *.o *.la *.mod *.lo - rm -rf .libs - @cd src/tests; $(MAKE) clean - @cd diamond; rm -rf build; cd .. - @cd python; rm -rf build; cd .. - @cd dxdiff; rm -rf build; cd .. - - -distclean: clean - @cd src/tests; $(MAKE) distclean - rm -fr config.log config.status libtool autom4te.cache Makefile - rm -f Makefile src/tests/Makefile examples/Makefile - rm -f bin/spud-preprocess - rm -f diamond/setup.py diamond/diamond/plugins.py diamond/diamond/preprocess.py - rm -fr debian/diamond debian/python-dxdiff debian/python-spud - rm -fr debian/spudtools debian/libspud-dev - rm -rf diamond/diamond.egg-info/ - rm -f debian/*.debhelper* debian/*.substvars - rm -f build-* debian/files diff --git a/libspud/README.md b/libspud/README.md deleted file mode 100644 index 1e02f8e1f6..0000000000 --- a/libspud/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Spud - -Spud is a generic system for defining, writing and processing options files for scientific computer models. - -The interfaces to scientific computer models are frequently primitive, under-documented and ad-hoc text files. This makes using and developing the model in question difficult and error-prone. - -With Spud, the model developer need only write a rules file (schema) which defines the options which the model takes and the relationship between them. The Spud component Diamond then provides an automatically generated graphical user interface which guides the user and validates the user's input against the schema. Diamond writes out an xml options file for use in Spud. - -The developer then uses libspud to read the options file into the model. Libspud can read any valid options file without further code modifications and makes the options available at any point in the model code at which they are required. - -Spud further provides the facility for the schema to be self-documenting and Diamond presents this documentation to the model user in a context-sensitive manner. - -## Documentation - -For installation and usage instructions, please see doc/spud_manual.pdf. - -For an example of spud and diamond usage, see the examples directory. diff --git a/libspud/aclocal.m4 b/libspud/aclocal.m4 deleted file mode 100644 index de630d85b4..0000000000 --- a/libspud/aclocal.m4 +++ /dev/null @@ -1,8444 +0,0 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# 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. - -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -]) - -# serial 57 LT_INIT - - -# LT_PREREQ(VERSION) -# ------------------ -# Complain and exit if this libtool version is less that VERSION. -m4_defun([LT_PREREQ], -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, - [m4_default([$3], - [m4_fatal([Libtool version $1 or higher is required], - 63)])], - [$2])]) - - -# _LT_CHECK_BUILDDIR -# ------------------ -# Complain if the absolute build directory name contains unusual characters -m4_defun([_LT_CHECK_BUILDDIR], -[case `pwd` in - *\ * | *\ *) - AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; -esac -]) - - -# LT_INIT([OPTIONS]) -# ------------------ -AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -AC_BEFORE([$0], [LT_LANG])dnl -AC_BEFORE([$0], [LT_OUTPUT])dnl -AC_BEFORE([$0], [LTDL_INIT])dnl -m4_require([_LT_CHECK_BUILDDIR])dnl - -dnl Autoconf doesn't catch unexpanded LT_ macros by default: -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 -dnl unless we require an AC_DEFUNed macro: -AC_REQUIRE([LTOPTIONS_VERSION])dnl -AC_REQUIRE([LTSUGAR_VERSION])dnl -AC_REQUIRE([LTVERSION_VERSION])dnl -AC_REQUIRE([LTOBSOLETE_VERSION])dnl -m4_require([_LT_PROG_LTMAIN])dnl - -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) - -dnl Parse OPTIONS -_LT_SET_OPTIONS([$0], [$1]) - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -_LT_SETUP - -# Only expand once: -m4_define([LT_INIT]) -])# LT_INIT - -# Old names: -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PROG_LIBTOOL], []) -dnl AC_DEFUN([AM_PROG_LIBTOOL], []) - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -]) - - -# _LT_FILEUTILS_DEFAULTS -# ---------------------- -# It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. -m4_defun([_LT_FILEUTILS_DEFAULTS], -[: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -])# _LT_FILEUTILS_DEFAULTS - - -# _LT_SETUP -# --------- -m4_defun([_LT_SETUP], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl - -_LT_DECL([], [host_alias], [0], [The host system])dnl -_LT_DECL([], [host], [0])dnl -_LT_DECL([], [host_os], [0])dnl -dnl -_LT_DECL([], [build_alias], [0], [The build system])dnl -_LT_DECL([], [build], [0])dnl -_LT_DECL([], [build_os], [0])dnl -dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -test -z "$LN_S" && LN_S="ln -s" -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl -dnl -AC_REQUIRE([LT_CMD_MAX_LEN])dnl -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl -dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl -m4_require([_LT_CMD_RELOAD])dnl -m4_require([_LT_CHECK_MAGIC_METHOD])dnl -m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl -m4_require([_LT_CMD_OLD_ARCHIVE])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_WITH_SYSROOT])dnl - -_LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi -]) -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -_LT_CHECK_OBJDIR - -m4_require([_LT_TAG_COMPILER])dnl - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - _LT_PATH_MAGIC - fi - ;; -esac - -# Use C for the default configuration in the libtool script -LT_SUPPORTED_TAG([CC]) -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_LT_CONFIG_COMMANDS -])# _LT_SETUP - - -# _LT_PREPARE_SED_QUOTE_VARS -# -------------------------- -# Define a few sed substitution that help us do robust quoting. -m4_defun([_LT_PREPARE_SED_QUOTE_VARS], -[# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' -]) - -# _LT_PROG_LTMAIN -# --------------- -# Note that this code is called both from `configure', and `config.status' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -m4_defun([_LT_PROG_LTMAIN], -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" -])# _LT_PROG_LTMAIN - - - -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' -# label. - - -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) - - -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# ----------------------------------------------------- -m4_defun([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) - - -# _LT_FORMAT_COMMENT([COMMENT]) -# ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) - - -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) -# --------------------------------------------------------- -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) - - -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# -------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_dquote_varnames], -[_lt_decl_filter([value], [2], $@)]) - - -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_varnames_tagged], -[m4_assert([$# <= 2])dnl -_$0(m4_quote(m4_default([$1], [[, ]])), - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) -m4_define([_lt_decl_varnames_tagged], -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) - - -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_all_varnames], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_if([$2], [], - m4_quote(lt_decl_varnames), - m4_quote(m4_shift($@))))[]dnl -]) -m4_define([_lt_decl_all_varnames], -[lt_join($@, lt_decl_varnames_tagged([$1], - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl -]) - - -# _LT_CONFIG_STATUS_DECLARE([VARNAME]) -# ------------------------------------ -# Quote a variable value, and forward it to `config.status' so that its -# declaration there will have the same value as in `configure'. VARNAME -# must have a single quote delimited value for this to work. -m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) - - -# _LT_CONFIG_STATUS_DECLARATIONS -# ------------------------------ -# We delimit libtool config variables with single quotes, so when -# we write them to config.status, we have to be sure to quote all -# embedded single quotes properly. In configure, this macro expands -# each variable declared with _LT_DECL (and _LT_TAGDECL) into: -# -# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), - [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAGS -# ---------------- -# Output comment and list of tags supported by the script -m4_defun([_LT_LIBTOOL_TAGS], -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags="_LT_TAGS"dnl -]) - - -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) -# ----------------------------------- -# Extract the dictionary values for VARNAME (optionally with TAG) and -# expand to a commented shell variable setting: -# -# # Some comment about what VAR is for. -# visible_name=$lt_internal_name -m4_define([_LT_LIBTOOL_DECLARE], -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], - [description])))[]dnl -m4_pushdef([_libtool_name], - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), - [0], [_libtool_name=[$]$1], - [1], [_libtool_name=$lt_[]$1], - [2], [_libtool_name=$lt_[]$1], - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl -]) - - -# _LT_LIBTOOL_CONFIG_VARS -# ----------------------- -# Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG -# section) are produced by _LT_LIBTOOL_TAG_VARS. -m4_defun([_LT_LIBTOOL_CONFIG_VARS], -[m4_foreach([_lt_var], - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAG_VARS(TAG) -# ------------------------- -m4_define([_LT_LIBTOOL_TAG_VARS], -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) - - -# _LT_TAGVAR(VARNAME, [TAGNAME]) -# ------------------------------ -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) - - -# _LT_CONFIG_COMMANDS -# ------------------- -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of -# variables for single and double quote escaping we saved from calls -# to _LT_DECL, we can put quote escaped variables declarations -# into `config.status', and then the shell code to quote escape them in -# for loops in `config.status'. Finally, any additional code accumulated -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. -m4_defun([_LT_CONFIG_COMMANDS], -[AC_PROVIDE_IFELSE([LT_OUTPUT], - dnl If the libtool generation code has been placed in $CONFIG_LT, - dnl instead of duplicating it all over again into config.status, - dnl then we will have config.status run $CONFIG_LT later, so it - dnl needs to know what name is stored there: - [AC_CONFIG_COMMANDS([libtool], - [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], - dnl If the libtool generation code is destined for config.status, - dnl expand the accumulated commands and init code now: - [AC_CONFIG_COMMANDS([libtool], - [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) -])#_LT_CONFIG_COMMANDS - - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], -[ - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -_LT_CONFIG_STATUS_DECLARATIONS -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$[]1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -_LT_OUTPUT_LIBTOOL_INIT -]) - -# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) -# ------------------------------------ -# Generate a child script FILE with all initialization necessary to -# reuse the environment learned by the parent script, and make the -# file executable. If COMMENT is supplied, it is inserted after the -# `#!' sequence but before initialization text begins. After this -# macro, additional text can be appended to FILE to form the body of -# the child script. The macro ends with non-zero status if the -# file could not be fully written (such as if the disk is full). -m4_ifdef([AS_INIT_GENERATED], -[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], -[m4_defun([_LT_GENERATED_FILE_INIT], -[m4_require([AS_PREPARE])]dnl -[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl -[lt_write_fail=0 -cat >$1 <<_ASEOF || lt_write_fail=1 -#! $SHELL -# Generated by $as_me. -$2 -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$1 <<\_ASEOF || lt_write_fail=1 -AS_SHELL_SANITIZE -_AS_PREPARE -exec AS_MESSAGE_FD>&1 -_ASEOF -test $lt_write_fail = 0 && chmod +x $1[]dnl -m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT - -# LT_OUTPUT -# --------- -# This macro allows early generation of the libtool script (before -# AC_OUTPUT is called), incase it is used in configure for compilation -# tests. -AC_DEFUN([LT_OUTPUT], -[: ${CONFIG_LT=./config.lt} -AC_MSG_NOTICE([creating $CONFIG_LT]) -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], -[# Run this file to recreate a libtool stub with the current configuration.]) - -cat >>"$CONFIG_LT" <<\_LTEOF -lt_cl_silent=false -exec AS_MESSAGE_LOG_FD>>config.log -{ - echo - AS_BOX([Running $as_me.]) -} >&AS_MESSAGE_LOG_FD - -lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. - -Usage: $[0] [[OPTIONS]] - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - -Report bugs to ." - -lt_cl_version="\ -m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl -m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) -configured by $[0], generated by m4_PACKAGE_STRING. - -Copyright (C) 2010 Free Software Foundation, Inc. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." - -while test $[#] != 0 -do - case $[1] in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; - - -*) AC_MSG_ERROR([unrecognized option: $[1] -Try \`$[0] --help' for more information.]) ;; - - *) AC_MSG_ERROR([unrecognized argument: $[1] -Try \`$[0] --help' for more information.]) ;; - esac - shift -done - -if $lt_cl_silent; then - exec AS_MESSAGE_FD>/dev/null -fi -_LTEOF - -cat >>"$CONFIG_LT" <<_LTEOF -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AC_MSG_NOTICE([creating $ofile]) -_LT_OUTPUT_LIBTOOL_COMMANDS -AS_EXIT(0) -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# appending to config.log, which fails on DOS, as config.log is still kept -# open by configure. Here we exec the FD to /dev/null, effectively closing -# config.log, so it can be properly (re)opened and appended to by config.lt. -lt_cl_success=: -test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" -exec AS_MESSAGE_LOG_FD>/dev/null -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false -exec AS_MESSAGE_LOG_FD>>config.log -$lt_cl_success || AS_EXIT(1) -])# LT_OUTPUT - - -# _LT_CONFIG(TAG) -# --------------- -# If TAG is the built-in tag, create an initial libtool script with a -# default configuration from the untagged config vars. Otherwise add code -# to config.status for appending the configuration named by TAG from the -# matching tagged config vars. -m4_defun([_LT_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_CONFIG_SAVE_COMMANDS([ - m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl - m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -_LT_COPYING -_LT_LIBTOOL_TAGS - -# ### BEGIN LIBTOOL CONFIG -_LT_LIBTOOL_CONFIG_VARS -_LT_LIBTOOL_TAG_VARS -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - _LT_PROG_LTMAIN - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - _LT_PROG_REPLACE_SHELLFNS - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -], -[cat <<_LT_EOF >> "$ofile" - -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded -dnl in a comment (ie after a #). -# ### BEGIN LIBTOOL TAG CONFIG: $1 -_LT_LIBTOOL_TAG_VARS(_LT_TAG) -# ### END LIBTOOL TAG CONFIG: $1 -_LT_EOF -])dnl /m4_if -], -[m4_if([$1], [], [ - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile'], []) -])dnl /_LT_CONFIG_SAVE_COMMANDS -])# _LT_CONFIG - - -# LT_SUPPORTED_TAG(TAG) -# --------------------- -# Trace this macro to discover what tags are supported by the libtool -# --tag option, using: -# autoconf --trace 'LT_SUPPORTED_TAG:$1' -AC_DEFUN([LT_SUPPORTED_TAG], []) - - -# C support is built-in for now -m4_define([_LT_LANG_C_enabled], []) -m4_define([_LT_TAGS], []) - - -# LT_LANG(LANG) -# ------------- -# Enable libtool support for the given language if not already enabled. -AC_DEFUN([LT_LANG], -[AC_BEFORE([$0], [LT_OUTPUT])dnl -m4_case([$1], - [C], [_LT_LANG(C)], - [C++], [_LT_LANG(CXX)], - [Java], [_LT_LANG(GCJ)], - [Fortran 77], [_LT_LANG(F77)], - [Fortran], [_LT_LANG(FC)], - [Windows Resource], [_LT_LANG(RC)], - [m4_ifdef([_LT_LANG_]$1[_CONFIG], - [_LT_LANG($1)], - [m4_fatal([$0: unsupported language: "$1"])])])dnl -])# LT_LANG - - -# _LT_LANG(LANGNAME) -# ------------------ -m4_defun([_LT_LANG], -[m4_ifdef([_LT_LANG_]$1[_enabled], [], - [LT_SUPPORTED_TAG([$1])dnl - m4_append([_LT_TAGS], [$1 ])dnl - m4_define([_LT_LANG_]$1[_enabled], [])dnl - _LT_LANG_$1_CONFIG($1)])dnl -])# _LT_LANG - - -# _LT_LANG_DEFAULT_CONFIG -# ----------------------- -m4_defun([_LT_LANG_DEFAULT_CONFIG], -[AC_PROVIDE_IFELSE([AC_PROG_CXX], - [LT_LANG(CXX)], - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) - -AC_PROVIDE_IFELSE([AC_PROG_F77], - [LT_LANG(F77)], - [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) - -AC_PROVIDE_IFELSE([AC_PROG_FC], - [LT_LANG(FC)], - [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) - -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal -dnl pulling things in needlessly. -AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([LT_PROG_GCJ], - [LT_LANG(GCJ)], - [m4_ifdef([AC_PROG_GCJ], - [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([A][M_PROG_GCJ], - [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([LT_PROG_GCJ], - [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) - -AC_PROVIDE_IFELSE([LT_PROG_RC], - [LT_LANG(RC)], - [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) -])# _LT_LANG_DEFAULT_CONFIG - -# Obsolete macros: -AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) -AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) -AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) -AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) -AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_CXX], []) -dnl AC_DEFUN([AC_LIBTOOL_F77], []) -dnl AC_DEFUN([AC_LIBTOOL_FC], []) -dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) -dnl AC_DEFUN([AC_LIBTOOL_RC], []) - - -# _LT_TAG_COMPILER -# ---------------- -m4_defun([_LT_TAG_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_TAG_COMPILER - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -m4_defun([_LT_COMPILER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -m4_defun([_LT_LINKER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* -])# _LT_LINKER_BOILERPLATE - -# _LT_REQUIRED_DARWIN_CHECKS -# ------------------------- -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - AC_CHECK_TOOL([LIPO], [lipo], [:]) - AC_CHECK_TOOL([OTOOL], [otool], [:]) - AC_CHECK_TOOL([OTOOL64], [otool64], [:]) - _LT_DECL([], [DSYMUTIL], [1], - [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) - _LT_DECL([], [NMEDIT], [1], - [Tool to change global to local symbols on Mac OS X]) - _LT_DECL([], [LIPO], [1], - [Tool to manipulate fat objects and archives on Mac OS X]) - _LT_DECL([], [OTOOL], [1], - [ldd/readelf like tool for Mach-O binaries on Mac OS X]) - _LT_DECL([], [OTOOL64], [1], - [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi]) - AC_CACHE_CHECK([for -exported_symbols_list linker flag], - [lt_cv_ld_exported_symbols_list], - [lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [lt_cv_ld_exported_symbols_list=yes], - [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS="$save_LDFLAGS" - ]) - AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], - [lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD - echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD - $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - ]) - case $host_os in - rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac -]) - - -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- -# Checks for linker and compiler features on darwin -m4_defun([_LT_DARWIN_LINKER_FEATURES], -[ - m4_require([_LT_REQUIRED_DARWIN_CHECKS]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_automatic, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='' - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - m4_if([$1], [CXX], -[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" - fi -],[]) - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi -]) - -# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) -# ---------------------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -# Store the results from the different compilers for each TAGNAME. -# Allow to override them for all tags through lt_cv_aix_libpath. -m4_defun([_LT_SYS_MODULE_PATH_AIX], -[m4_require([_LT_DECL_SED])dnl -if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], - [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ - lt_aix_libpath_sed='[ - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }]' - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi],[]) - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" - fi - ]) - aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) -fi -])# _LT_SYS_MODULE_PATH_AIX - - -# _LT_SHELL_INIT(ARG) -# ------------------- -m4_define([_LT_SHELL_INIT], -[m4_divert_text([M4SH-INIT], [$1 -])])# _LT_SHELL_INIT - - - -# _LT_PROG_ECHO_BACKSLASH -# ----------------------- -# Find how we can fake an echo command that does not interpret backslash. -# In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script which will find a shell with a builtin -# printf (which we can use as an echo command). -m4_defun([_LT_PROG_ECHO_BACKSLASH], -[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -AC_MSG_CHECKING([how to print strings]) -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$[]1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -case "$ECHO" in - printf*) AC_MSG_RESULT([printf]) ;; - print*) AC_MSG_RESULT([print -r]) ;; - *) AC_MSG_RESULT([cat]) ;; -esac - -m4_ifdef([_AS_DETECT_SUGGESTED], -[_AS_DETECT_SUGGESTED([ - test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test "X`printf %s $ECHO`" = "X$ECHO" \ - || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) - -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) -])# _LT_PROG_ECHO_BACKSLASH - - -# _LT_WITH_SYSROOT -# ---------------- -AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) -AC_ARG_WITH([sysroot], -[ --with-sysroot[=DIR] Search for dependent libraries within DIR - (or the compiler's sysroot if not specified).], -[], [with_sysroot=no]) - -dnl lt_sysroot will always be passed unquoted. We quote it here -dnl in case the user passed a directory name. -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - AC_MSG_RESULT([${with_sysroot}]) - AC_MSG_ERROR([The sysroot must be an absolute path.]) - ;; -esac - - AC_MSG_RESULT([${lt_sysroot:-no}]) -_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and in which our libraries should be installed.])]) - -# _LT_ENABLE_LOCK -# --------------- -m4_defun([_LT_ENABLE_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AS_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks="$enable_libtool_lock" -])# _LT_ENABLE_LOCK - - -# _LT_PROG_AR -# ----------- -m4_defun([_LT_PROG_AR], -[AC_CHECK_TOOLS(AR, [ar], false) -: ${AR=ar} -: ${AR_FLAGS=cru} -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) - -AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], - [lt_cv_ar_at_file=no - AC_COMPILE_IFELSE([AC_LANG_PROGRAM], - [echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - ]) - ]) - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi -_LT_DECL([], [archiver_list_spec], [1], - [How to feed a file listing to the archiver]) -])# _LT_PROG_AR - - -# _LT_CMD_OLD_ARCHIVE -# ------------------- -m4_defun([_LT_CMD_OLD_ARCHIVE], -[_LT_PROG_AR - -AC_CHECK_TOOL(STRIP, strip, :) -test -z "$STRIP" && STRIP=: -_LT_DECL([], [STRIP], [1], [A symbol stripping program]) - -AC_CHECK_TOOL(RANLIB, ranlib, :) -test -z "$RANLIB" && RANLIB=: -_LT_DECL([], [RANLIB], [1], - [Commands used to install an old-style archive]) - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac -_LT_DECL([], [old_postinstall_cmds], [2]) -_LT_DECL([], [old_postuninstall_cmds], [2]) -_LT_TAGDECL([], [old_archive_cmds], [2], - [Commands used to build an old-style archive]) -_LT_DECL([], [lock_old_archive_extraction], [0], - [Whether to use a lock for old archive extraction]) -])# _LT_CMD_OLD_ARCHIVE - - -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([_LT_COMPILER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $RM conftest* -]) - -if test x"[$]$2" = xyes; then - m4_if([$5], , :, [$5]) -else - m4_if([$6], , :, [$6]) -fi -])# _LT_COMPILER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) - - -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------- -# Check whether the given linker option works -AC_DEFUN([_LT_LINKER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - m4_if([$4], , :, [$4]) -else - m4_if([$5], , :, [$5]) -fi -])# _LT_LINKER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) - - -# LT_CMD_MAX_LEN -#--------------- -AC_DEFUN([LT_CMD_MAX_LEN], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -max_cmd_len=$lt_cv_sys_max_cmd_len -_LT_DECL([], [max_cmd_len], [0], - [What is the maximum length of a command?]) -])# LT_CMD_MAX_LEN - -# Old name: -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) - - -# _LT_HEADER_DLFCN -# ---------------- -m4_defun([_LT_HEADER_DLFCN], -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl -])# _LT_HEADER_DLFCN - - -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ---------------------------------------------------------------- -m4_defun([_LT_TRY_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -[#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -}] -_LT_EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_TRY_DLOPEN_SELF - - -# LT_SYS_DLOPEN_SELF -# ------------------ -AC_DEFUN([LT_SYS_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -_LT_DECL([dlopen_support], [enable_dlopen], [0], - [Whether dlopen is supported]) -_LT_DECL([dlopen_self], [enable_dlopen_self], [0], - [Whether dlopen of programs is supported]) -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], - [Whether dlopen of statically linked programs is supported]) -])# LT_SYS_DLOPEN_SELF - -# Old name: -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) - - -# _LT_COMPILER_C_O([TAGNAME]) -# --------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler. -# This macro does not hard code the compiler like AC_PROG_CC_C_O. -m4_defun([_LT_COMPILER_C_O], -[m4_require([_LT_DECL_SED])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* -]) -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], - [Does compiler simultaneously support -c and -o options?]) -])# _LT_COMPILER_C_O - - -# _LT_COMPILER_FILE_LOCKS([TAGNAME]) -# ---------------------------------- -# Check to see if we can do hard links to lock some files if needed -m4_defun([_LT_COMPILER_FILE_LOCKS], -[m4_require([_LT_ENABLE_LOCK])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_COMPILER_C_O([$1]) - -hard_links="nottested" -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) -])# _LT_COMPILER_FILE_LOCKS - - -# _LT_CHECK_OBJDIR -# ---------------- -m4_defun([_LT_CHECK_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -_LT_DECL([], [objdir], [0], - [The name of the directory that contains temporary libtool files])dnl -m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", - [Define to the sub-directory in which libtool stores uninstalled libraries.]) -])# _LT_CHECK_OBJDIR - - -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) -# -------------------------------------- -# Check hardcoding attributes. -m4_defun([_LT_LINKER_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || - test -n "$_LT_TAGVAR(runpath_var, $1)" || - test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || - test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -_LT_TAGDECL([], [hardcode_action], [0], - [How to hardcode a shared library path into an executable]) -])# _LT_LINKER_HARDCODE_LIBPATH - - -# _LT_CMD_STRIPLIB -# ---------------- -m4_defun([_LT_CMD_STRIPLIB], -[m4_require([_LT_DECL_EGREP]) -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) -_LT_DECL([], [striplib], [1]) -])# _LT_CMD_STRIPLIB - - -# _LT_SYS_DYNAMIC_LINKER([TAG]) -# ----------------------------- -# PORTME Fill in your ld.so characteristics -m4_defun([_LT_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_OBJDUMP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -AC_MSG_CHECKING([dynamic linker characteristics]) -m4_if([$1], - [], [ -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[[lt_foo]]++; } - if (lt_freq[[lt_foo]] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[[4-9]]*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[123]]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ - freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[[3-9]]*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], - [lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [lt_cv_shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - ]) - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $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' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - -_LT_DECL([], [variables_saved_for_relink], [1], - [Variables whose values should be saved in libtool wrapper scripts and - restored at link time]) -_LT_DECL([], [need_lib_prefix], [0], - [Do we need the "lib" prefix for modules?]) -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) -_LT_DECL([], [version_type], [0], [Library versioning type]) -_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) -_LT_DECL([], [shlibpath_overrides_runpath], [0], - [Is shlibpath searched before the hard-coded library search path?]) -_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) -_LT_DECL([], [library_names_spec], [1], - [[List of archive names. First name is the real one, the rest are links. - The last name is the one that the linker finds with -lNAME]]) -_LT_DECL([], [soname_spec], [1], - [[The coded name of the library, if different from the real name]]) -_LT_DECL([], [install_override_mode], [1], - [Permission mode override for installation of shared libraries]) -_LT_DECL([], [postinstall_cmds], [2], - [Command to use after installation of a shared archive]) -_LT_DECL([], [postuninstall_cmds], [2], - [Command to use after uninstallation of a shared archive]) -_LT_DECL([], [finish_cmds], [2], - [Commands used to finish a libtool library installation in a directory]) -_LT_DECL([], [finish_eval], [1], - [[As "finish_cmds", except a single script fragment to be evaled but - not shown]]) -_LT_DECL([], [hardcode_into_libs], [0], - [Whether we should hardcode library paths into libraries]) -_LT_DECL([], [sys_lib_search_path_spec], [2], - [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) -])# _LT_SYS_DYNAMIC_LINKER - - -# _LT_PATH_TOOL_PREFIX(TOOL) -# -------------------------- -# find a file program which can recognize shared library -AC_DEFUN([_LT_PATH_TOOL_PREFIX], -[m4_require([_LT_DECL_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="m4_if([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -_LT_DECL([], [MAGIC_CMD], [0], - [Used to examine libraries when file_magic_cmd begins with "file"])dnl -])# _LT_PATH_TOOL_PREFIX - -# Old name: -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) - - -# _LT_PATH_MAGIC -# -------------- -# find a file program which can recognize a shared library -m4_defun([_LT_PATH_MAGIC], -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# _LT_PATH_MAGIC - - -# LT_PATH_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([LT_PATH_LD], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PROG_ECHO_BACKSLASH])dnl - -AC_ARG_WITH([gnu-ld], - [AS_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no])dnl - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[[3-9]]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -_LT_DECL([], [deplibs_check_method], [1], - [Method to check whether dependent libraries are shared objects]) -_LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method = "file_magic"]) -_LT_DECL([], [file_magic_glob], [1], - [How to find potential files when deplibs_check_method = "file_magic"]) -_LT_DECL([], [want_nocaseglob], [1], - [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) -])# _LT_CHECK_MAGIC_METHOD - - -# LT_PATH_NM -# ---------- -# find the pathname to a BSD- or MS-compatible name lister -AC_DEFUN([LT_PATH_NM], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi]) -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi - AC_SUBST([DUMPBIN]) - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm -AC_SUBST([NM]) -_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl - -AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], - [lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) - cat conftest.out >&AS_MESSAGE_LOG_FD - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest*]) -])# LT_PATH_NM - -# Old names: -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_PROG_NM], []) -dnl AC_DEFUN([AC_PROG_NM], []) - -# _LT_CHECK_SHAREDLIB_FROM_LINKLIB -# -------------------------------- -# how to determine the name of the shared library -# associated with a specific link library. -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], -[m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) -m4_require([_LT_DECL_DLLTOOL]) -AC_CACHE_CHECK([how to associate runtime and link libraries], -lt_cv_sharedlib_from_linklib_cmd, -[lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac -]) -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - -_LT_DECL([], [sharedlib_from_linklib_cmd], [1], - [Command to associate shared and link libraries]) -])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB - - -# _LT_PATH_MANIFEST_TOOL -# ---------------------- -# locate the manifest tool -m4_defun([_LT_PATH_MANIFEST_TOOL], -[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], - [lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&AS_MESSAGE_LOG_FD - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest*]) -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi -_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl -])# _LT_PATH_MANIFEST_TOOL - - -# LT_LIB_M -# -------- -# check for math library -AC_DEFUN([LT_LIB_M], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -AC_SUBST([LIBM]) -])# LT_LIB_M - -# Old name: -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_CHECK_LIBM], []) - - -# _LT_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------- -m4_defun([_LT_COMPILER_NO_RTTI], -[m4_require([_LT_TAG_COMPILER])dnl - -_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; - *) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; - esac - - _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], - [Compiler flag to turn off builtin functions]) -])# _LT_COMPILER_NO_RTTI - - -# _LT_CMD_GLOBAL_SYMBOLS -# ---------------------- -m4_defun([_LT_CMD_GLOBAL_SYMBOLS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([LT_PATH_NM])dnl -AC_REQUIRE([LT_PATH_LD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_TAG_COMPILER])dnl - -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris*) - symcode='[[BDRT]]' - ;; -sco3.2v5*) - symcode='[[DT]]' - ;; -sysv4.2uw2*) - symcode='[[DT]]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[[ABDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK ['"\ -" {last_section=section; section=\$ 3};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx]" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if AC_TRY_EVAL(ac_compile); then - # Now try to grab the symbols. - nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT@&t@_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT@&t@_DLSYM_CONST -#else -# define LT@&t@_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT@&t@_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[[]] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - -_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], - [Take the output of nm and produce a listing of raw symbols and C names]) -_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], - [Transform the output of nm in a proper C declaration]) -_LT_DECL([global_symbol_to_c_name_address], - [lt_cv_sys_global_symbol_to_c_name_address], [1], - [Transform the output of nm in a C name address pair]) -_LT_DECL([global_symbol_to_c_name_address_lib_prefix], - [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], - [Transform the output of nm in a C name address pair when lib prefix is needed]) -_LT_DECL([], [nm_file_list_spec], [1], - [Specify filename containing input files for $NM]) -]) # _LT_CMD_GLOBAL_SYMBOLS - - -# _LT_COMPILER_PIC([TAGNAME]) -# --------------------------- -m4_defun([_LT_COMPILER_PIC], -[m4_require([_LT_TAG_COMPILER])dnl -_LT_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_TAGVAR(lt_prog_compiler_static, $1)= - -m4_if([$1], [CXX], [ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix[[4-9]]*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - hpux9* | hpux10* | hpux11*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' - ;; - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - *Sun\ C*) - # Sun C 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - esac - ;; - - newsos6) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - rdos*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" - ;; -esac - -AC_CACHE_CHECK([for $compiler option to produce PIC], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], - [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], - [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], - [Additional compiler flags for building library objects]) - -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) -# -# Check to make sure the static flag actually works. -# -wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" -_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], - [Compiler flag to prevent dynamic linking]) -])# _LT_COMPILER_PIC - - -# _LT_LINKER_SHLIBS([TAGNAME]) -# ---------------------------- -# See if the linker supports building shared libraries. -m4_defun([_LT_LINKER_SHLIBS], -[AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -m4_if([$1], [CXX], [ - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - case $host_os in - aix[[4-9]]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - ;; - esac - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -], [ - runpath_var= - _LT_TAGVAR(allow_undefined_flag, $1)= - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(archive_cmds, $1)= - _LT_TAGVAR(archive_expsym_cmds, $1)= - _LT_TAGVAR(compiler_needs_object, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(hardcode_automatic, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_TAGVAR(hardcode_libdir_separator, $1)= - _LT_TAGVAR(hardcode_minus_L, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(inherit_rpath, $1)=no - _LT_TAGVAR(link_all_deplibs, $1)=unknown - _LT_TAGVAR(module_cmds, $1)= - _LT_TAGVAR(module_expsym_cmds, $1)= - _LT_TAGVAR(old_archive_from_new_cmds, $1)= - _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_TAGVAR(thread_safe_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. -dnl Note also adjust exclude_expsyms for C++ above. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - _LT_TAGVAR(ld_shlibs, $1)=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; - *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[[3-9]]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - _LT_TAGVAR(whole_archive_flag_spec, $1)= - tmp_sharedflag='--shared' ;; - xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix[[4-9]]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - bsdi[[45]]*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - esac - ;; - - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - m4_if($1, [], [ - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - _LT_LINKER_OPTION([if $CC understands -b], - _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], - [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) - ;; - esac - fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], - [lt_cv_irix_exported_symbol], - [save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE( - [AC_LANG_SOURCE( - [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], - [C++], [[int foo (void) { return 0; }]], - [Fortran 77], [[ - subroutine foo - end]], - [Fortran], [[ - subroutine foo - end]])])], - [lt_cv_irix_exported_symbol=yes], - [lt_cv_irix_exported_symbol=no]) - LDFLAGS="$save_LDFLAGS"]) - if test "$lt_cv_irix_exported_symbol" = yes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - fi - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' - ;; - esac - fi - fi -]) -AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld - -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl -_LT_DECL([], [extract_expsyms_cmds], [2], - [The commands to extract the exported symbol list from a shared archive]) - -# -# Do we need to explicitly link libc? -# -case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_CACHE_CHECK([whether -lc should be explicitly linked in], - [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), - [$RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - ]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) - ;; - esac - fi - ;; -esac - -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], - [Whether or not to add -lc for building shared libraries]) -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], - [enable_shared_with_static_runtimes], [0], - [Whether or not to disallow shared libs when runtime libs are static]) -_LT_TAGDECL([], [export_dynamic_flag_spec], [1], - [Compiler flag to allow reflexive dlopens]) -_LT_TAGDECL([], [whole_archive_flag_spec], [1], - [Compiler flag to generate shared objects directly from archives]) -_LT_TAGDECL([], [compiler_needs_object], [1], - [Whether the compiler copes with passing no objects directly]) -_LT_TAGDECL([], [old_archive_from_new_cmds], [2], - [Create an old-style archive from a shared archive]) -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], - [Create a temporary old-style archive to link instead of a shared archive]) -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) -_LT_TAGDECL([], [archive_expsym_cmds], [2]) -_LT_TAGDECL([], [module_cmds], [2], - [Commands used to build a loadable module if different from building - a shared archive.]) -_LT_TAGDECL([], [module_expsym_cmds], [2]) -_LT_TAGDECL([], [with_gnu_ld], [1], - [Whether we are building with GNU ld or not]) -_LT_TAGDECL([], [allow_undefined_flag], [1], - [Flag that allows shared libraries with undefined symbols to be built]) -_LT_TAGDECL([], [no_undefined_flag], [1], - [Flag that enforces no undefined symbols]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], - [Flag to hardcode $libdir into a binary during linking. - This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) -_LT_TAGDECL([], [hardcode_libdir_separator], [1], - [Whether we need a single "-rpath" flag with a separated argument]) -_LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary]) -_LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting ${shlibpath_var} if the - library is relocated]) -_LT_TAGDECL([], [hardcode_minus_L], [0], - [Set to "yes" if using the -LDIR flag during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_shlibpath_var], [0], - [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_automatic], [0], - [Set to "yes" if building a shared library automatically hardcodes DIR - into the library and all subsequent libraries and executables linked - against it]) -_LT_TAGDECL([], [inherit_rpath], [0], - [Set to yes if linker adds runtime paths of dependent libraries - to runtime path list]) -_LT_TAGDECL([], [link_all_deplibs], [0], - [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [always_export_symbols], [0], - [Set to "yes" if exported symbols are required]) -_LT_TAGDECL([], [export_symbols_cmds], [2], - [The commands to list exported symbols]) -_LT_TAGDECL([], [exclude_expsyms], [1], - [Symbols that should not be listed in the preloaded symbols]) -_LT_TAGDECL([], [include_expsyms], [1], - [Symbols that must always be exported]) -_LT_TAGDECL([], [prelink_cmds], [2], - [Commands necessary for linking programs (against libraries) with templates]) -_LT_TAGDECL([], [postlink_cmds], [2], - [Commands necessary for finishing linking programs]) -_LT_TAGDECL([], [file_list_spec], [1], - [Specify filename containing input files]) -dnl FIXME: Not yet implemented -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], -dnl [Compiler flag to generate thread safe objects]) -])# _LT_LINKER_SHLIBS - - -# _LT_LANG_C_CONFIG([TAG]) -# ------------------------ -# Ensure that the configuration variables for a C compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_C_CONFIG], -[m4_require([_LT_DECL_EGREP])dnl -lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - -_LT_TAG_COMPILER -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - LT_SYS_DLOPEN_SELF - _LT_CMD_STRIPLIB - - # Report which library types will actually be built - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_CONFIG($1) -fi -AC_LANG_POP -CC="$lt_save_CC" -])# _LT_LANG_C_CONFIG - - -# _LT_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a C++ compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_CXX_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi - -AC_LANG_PUSH(C++) -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(compiler_needs_object, $1)=no -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test "$GXX" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - else - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - fi - - if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - LT_PATH_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) - _LT_TAGVAR(ld_shlibs, $1)=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aix[[4-9]]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - - if test "$GXX" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty - # executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - freebsd-elf*) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - gnu*) - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' - fi - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) - _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - - *nto* | *qnx*) - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - openbsd2*) - # C++ shared libraries are fairly broken - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd=func_echo_all - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - case $host in - osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - ;; - *) - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - case $host in - osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - fi - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" - _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - - _LT_TAGVAR(GCC, $1)="$GXX" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes - -AC_LANG_POP -])# _LT_LANG_CXX_CONFIG - - -# _LT_FUNC_STRIPNAME_CNF -# ---------------------- -# func_stripname_cnf prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# -# This function is identical to the (non-XSI) version of func_stripname, -# except this one can be used by m4 code that may be executed by configure, -# rather than the libtool script. -m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl -AC_REQUIRE([_LT_DECL_SED]) -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) -func_stripname_cnf () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname_cnf -])# _LT_FUNC_STRIPNAME_CNF - -# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) -# --------------------------------- -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -m4_defun([_LT_SYS_HIDDEN_LIBDEPS], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl -# Dependencies to place before and after the object being linked: -_LT_TAGVAR(predep_objects, $1)= -_LT_TAGVAR(postdep_objects, $1)= -_LT_TAGVAR(predeps, $1)= -_LT_TAGVAR(postdeps, $1)= -_LT_TAGVAR(compiler_lib_search_path, $1)= - -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF -int a; -void foo (void) { a = 0; } -_LT_EOF -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -_LT_EOF -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer a - a=0 - return - end -_LT_EOF -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -_LT_EOF -]) - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -esac - -dnl Parse the compiler output and extract the necessary -dnl objects, libraries and library flags. -if AC_TRY_EVAL(ac_compile); then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" || - test $p = "-R"; then - prev=$p - continue - fi - - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" - else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)="${prev}${p}" - else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" - fi - fi - prev= - ;; - - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)="$p" - else - _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" - fi - else - if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)="$p" - else - _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling $1 test program" -fi - -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS - -# PORTME: override above test on systems where it is broken -m4_if([$1], [CXX], -[case $host_os in -interix[[3-9]]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - _LT_TAGVAR(predep_objects,$1)= - _LT_TAGVAR(postdep_objects,$1)= - _LT_TAGVAR(postdeps,$1)= - ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; -esac -]) - -case " $_LT_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac - _LT_TAGVAR(compiler_lib_search_dirs, $1)= -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi -_LT_TAGDECL([], [compiler_lib_search_dirs], [1], - [The directories searched by this compiler when creating a shared library]) -_LT_TAGDECL([], [predep_objects], [1], - [Dependencies to place before and after the objects being linked to - create a shared library]) -_LT_TAGDECL([], [postdep_objects], [1]) -_LT_TAGDECL([], [predeps], [1]) -_LT_TAGDECL([], [postdeps], [1]) -_LT_TAGDECL([], [compiler_lib_search_path], [1], - [The library search path used internally by the compiler when linking - a shared library]) -])# _LT_SYS_HIDDEN_LIBDEPS - - -# _LT_LANG_F77_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a Fortran 77 compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_F77_CONFIG], -[AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the F77 compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_F77" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${F77-"f77"} - CFLAGS=$FFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - GCC=$G77 - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$G77" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC="$lt_save_CC" - CFLAGS="$lt_save_CFLAGS" -fi # test "$_lt_disable_F77" != yes - -AC_LANG_POP -])# _LT_LANG_F77_CONFIG - - -# _LT_LANG_FC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for a Fortran compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_FC_CONFIG], -[AC_LANG_PUSH(Fortran) - -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} - -# Object file extension for compiled fc test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the FC compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_FC" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${FC-"f95"} - CFLAGS=$FCFLAGS - compiler=$CC - GCC=$ac_cv_fc_compiler_gnu - - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test "$_lt_disable_FC" != yes - -AC_LANG_POP -])# _LT_LANG_FC_CONFIG - - -# _LT_LANG_GCJ_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Java Compiler compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_GCJ_CONFIG], -[AC_REQUIRE([LT_PROG_GCJ])dnl -AC_LANG_SAVE - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GCJ-"gcj"} -CFLAGS=$GCJFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" -_LT_CC_BASENAME([$compiler]) - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GCJ_CONFIG - - -# _LT_LANG_RC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for the Windows resource compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_RC_CONFIG], -[AC_REQUIRE([LT_PROG_RC])dnl -AC_LANG_SAVE - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC= -CC=${RC-"windres"} -CFLAGS= -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - -if test -n "$compiler"; then - : - _LT_CONFIG($1) -fi - -GCC=$lt_save_GCC -AC_LANG_RESTORE -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_RC_CONFIG - - -# LT_PROG_GCJ -# ----------- -AC_DEFUN([LT_PROG_GCJ], -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], - [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], - [AC_CHECK_TOOL(GCJ, gcj,) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS)])])[]dnl -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_GCJ], []) - - -# LT_PROG_RC -# ---------- -AC_DEFUN([LT_PROG_RC], -[AC_CHECK_TOOL(RC, windres,) -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_RC], []) - - -# _LT_DECL_EGREP -# -------------- -# If we don't have a new enough Autoconf to choose the best grep -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_EGREP], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_FGREP])dnl -test -z "$GREP" && GREP=grep -_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) -_LT_DECL([], [EGREP], [1], [An ERE matcher]) -_LT_DECL([], [FGREP], [1], [A literal string matcher]) -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too -AC_SUBST([GREP]) -]) - - -# _LT_DECL_OBJDUMP -# -------------- -# If we don't have a new enough Autoconf to choose the best objdump -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_OBJDUMP], -[AC_CHECK_TOOL(OBJDUMP, objdump, false) -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) -AC_SUBST([OBJDUMP]) -]) - -# _LT_DECL_DLLTOOL -# ---------------- -# Ensure DLLTOOL variable is set. -m4_defun([_LT_DECL_DLLTOOL], -[AC_CHECK_TOOL(DLLTOOL, dlltool, false) -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) -AC_SUBST([DLLTOOL]) -]) - -# _LT_DECL_SED -# ------------ -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -m4_defun([_LT_DECL_SED], -[AC_PROG_SED -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" -_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) -_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], - [Sed that helps us avoid accidentally triggering echo(1) options like -n]) -])# _LT_DECL_SED - -m4_ifndef([AC_PROG_SED], [ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # - -m4_defun([AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_SUBST([SED]) -AC_MSG_RESULT([$SED]) -])#AC_PROG_SED -])#m4_ifndef - -# Old name: -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_SED], []) - - -# _LT_CHECK_SHELL_FEATURES -# ------------------------ -# Find out whether the shell is Bourne or XSI compatible, -# or has some other useful features. -m4_defun([_LT_CHECK_SHELL_FEATURES], -[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -AC_MSG_RESULT([$xsi_shell]) -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) - -AC_MSG_CHECKING([whether the shell understands "+="]) -lt_shell_append=no -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -AC_MSG_RESULT([$lt_shell_append]) -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi -_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac -_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl -_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl -])# _LT_CHECK_SHELL_FEATURES - - -# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) -# ------------------------------------------------------ -# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and -# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. -m4_defun([_LT_PROG_FUNCTION_REPLACE], -[dnl { -sed -e '/^$1 ()$/,/^} # $1 /c\ -$1 ()\ -{\ -m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) -} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: -]) - - -# _LT_PROG_REPLACE_SHELLFNS -# ------------------------- -# Replace existing portable implementations of several shell functions with -# equivalent extended shell implementations where those features are available.. -m4_defun([_LT_PROG_REPLACE_SHELLFNS], -[if test x"$xsi_shell" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl - func_split_long_opt_name=${1%%=*} - func_split_long_opt_arg=${1#*=}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) - - _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) - - _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) - - _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) -fi - -if test x"$lt_shell_append" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) - - _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl - func_quote_for_eval "${2}" -dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ - eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) -fi -]) - -# _LT_PATH_CONVERSION_FUNCTIONS -# ----------------------------- -# Determine which file name conversion functions should be used by -# func_to_host_file (and, implicitly, by func_to_host_path). These are needed -# for certain cross-compile configurations and native mingw. -m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_MSG_CHECKING([how to convert $build file names to $host format]) -AC_CACHE_VAL(lt_cv_to_host_file_cmd, -[case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac -]) -to_host_file_cmd=$lt_cv_to_host_file_cmd -AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) -_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], - [0], [convert $build file names to $host format])dnl - -AC_MSG_CHECKING([how to convert $build file names to toolchain format]) -AC_CACHE_VAL(lt_cv_to_tool_file_cmd, -[#assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac -]) -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) -_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], - [0], [convert $build files to toolchain format])dnl -])# _LT_PATH_CONVERSION_FUNCTIONS - -# Helper functions for option handling. -*- Autoconf -*- -# -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 7 ltoptions.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) - - -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) -# ------------------------------------------ -m4_define([_LT_MANGLE_OPTION], -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) - - -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) -# --------------------------------------- -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a -# matching handler defined, dispatch to it. Other OPTION-NAMEs are -# saved as a flag. -m4_define([_LT_SET_OPTION], -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), - _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option `$2'])])[]dnl -]) - - -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) -# ------------------------------------------------------------ -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -m4_define([_LT_IF_OPTION], -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) - - -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) -# ------------------------------------------------------- -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME -# are set. -m4_define([_LT_UNLESS_OPTIONS], -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), - [m4_define([$0_found])])])[]dnl -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 -])[]dnl -]) - - -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) -# ---------------------------------------- -# OPTION-LIST is a space-separated list of Libtool options associated -# with MACRO-NAME. If any OPTION has a matching handler declared with -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about -# the unknown option and exit. -m4_defun([_LT_SET_OPTIONS], -[# Set options -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [_LT_SET_OPTION([$1], _LT_Option)]) - -m4_if([$1],[LT_INIT],[ - dnl - dnl Simply set some default values (i.e off) if boolean options were not - dnl specified: - _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no - ]) - _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no - ]) - dnl - dnl If no reference was made to various pairs of opposing options, then - dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared - dnl archives by default: - _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) - _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) - ]) -])# _LT_SET_OPTIONS - - - -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) -# ----------------------------------------- -m4_define([_LT_MANGLE_DEFUN], -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) - - -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) -# ----------------------------------------------- -m4_define([LT_OPTION_DEFINE], -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl -])# LT_OPTION_DEFINE - - -# dlopen -# ------ -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes -]) - -AU_DEFUN([AC_LIBTOOL_DLOPEN], -[_LT_SET_OPTION([LT_INIT], [dlopen]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) - - -# win32-dll -# --------- -# Declare package support for building win32 dll's. -LT_OPTION_DEFINE([LT_INIT], [win32-dll], -[enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -esac - -test -z "$AS" && AS=as -_LT_DECL([], [AS], [1], [Assembler program])dnl - -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl - -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl -])# win32-dll - -AU_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -_LT_SET_OPTION([LT_INIT], [win32-dll]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) - - -# _LT_ENABLE_SHARED([DEFAULT]) -# ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_SHARED], -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([shared], - [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) - - _LT_DECL([build_libtool_libs], [enable_shared], [0], - [Whether or not to build shared libraries]) -])# _LT_ENABLE_SHARED - -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) -]) - -AC_DEFUN([AC_DISABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], [disable-shared]) -]) - -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_SHARED], []) -dnl AC_DEFUN([AM_DISABLE_SHARED], []) - - - -# _LT_ENABLE_STATIC([DEFAULT]) -# ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_STATIC], -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([static], - [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]_LT_ENABLE_STATIC_DEFAULT) - - _LT_DECL([build_old_libs], [enable_static], [0], - [Whether or not to build static libraries]) -])# _LT_ENABLE_STATIC - -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) -]) - -AC_DEFUN([AC_DISABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], [disable-static]) -]) - -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_STATIC], []) -dnl AC_DEFUN([AM_DISABLE_STATIC], []) - - - -# _LT_ENABLE_FAST_INSTALL([DEFAULT]) -# ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_FAST_INSTALL], -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([fast-install], - [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) - -_LT_DECL([fast_install], [enable_fast_install], [0], - [Whether or not to optimize for fast installation])dnl -])# _LT_ENABLE_FAST_INSTALL - -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.]) -]) - -AU_DEFUN([AC_DISABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) - - -# _LT_WITH_PIC([MODE]) -# -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' -# LT_INIT options. -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -m4_define([_LT_WITH_PIC], -[AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) - -test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) - -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl -])# _LT_WITH_PIC - -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) - -# Old name: -AU_DEFUN([AC_LIBTOOL_PICMODE], -[_LT_SET_OPTION([LT_INIT], [pic-only]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `pic-only' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) - - -m4_define([_LTDL_MODE], []) -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], - [m4_define([_LTDL_MODE], [nonrecursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [recursive], - [m4_define([_LTDL_MODE], [recursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [subproject], - [m4_define([_LTDL_MODE], [subproject])]) - -m4_define([_LTDL_TYPE], []) -LT_OPTION_DEFINE([LTDL_INIT], [installable], - [m4_define([_LTDL_TYPE], [installable])]) -LT_OPTION_DEFINE([LTDL_INIT], [convenience], - [m4_define([_LTDL_TYPE], [convenience])]) - -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 6 ltsugar.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) - - -# lt_join(SEP, ARG1, [ARG2...]) -# ----------------------------- -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their -# associated separator. -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier -# versions in m4sugar had bugs. -m4_define([lt_join], -[m4_if([$#], [1], [], - [$#], [2], [[$2]], - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) -m4_define([_lt_join], -[m4_if([$#$2], [2], [], - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) - - -# lt_car(LIST) -# lt_cdr(LIST) -# ------------ -# Manipulate m4 lists. -# These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. -m4_define([lt_car], [[$1]]) -m4_define([lt_cdr], -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], - [$#], 1, [], - [m4_dquote(m4_shift($@))])]) -m4_define([lt_unquote], $1) - - -# lt_append(MACRO-NAME, STRING, [SEPARATOR]) -# ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. -# Note that neither SEPARATOR nor STRING are expanded; they are appended -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). -# No SEPARATOR is output if MACRO-NAME was previously undefined (different -# than defined and empty). -# -# This macro is needed until we can rely on Autoconf 2.62, since earlier -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. -m4_define([lt_append], -[m4_define([$1], - m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) - - - -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) -# ---------------------------------------------------------- -# Produce a SEP delimited list of all paired combinations of elements of -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list -# has the form PREFIXmINFIXSUFFIXn. -# Needed until we can rely on m4_combine added in Autoconf 2.62. -m4_define([lt_combine], -[m4_if(m4_eval([$# > 3]), [1], - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl -[[m4_foreach([_Lt_prefix], [$2], - [m4_foreach([_Lt_suffix], - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) - - -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) -# ----------------------------------------------------------------------- -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. -m4_define([lt_if_append_uniq], -[m4_ifdef([$1], - [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], - [lt_append([$1], [$2], [$3])$4], - [$5])], - [lt_append([$1], [$2], [$3])$4])]) - - -# lt_dict_add(DICT, KEY, VALUE) -# ----------------------------- -m4_define([lt_dict_add], -[m4_define([$1($2)], [$3])]) - - -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) -# -------------------------------------------- -m4_define([lt_dict_add_subkey], -[m4_define([$1($2:$3)], [$4])]) - - -# lt_dict_fetch(DICT, KEY, [SUBKEY]) -# ---------------------------------- -m4_define([lt_dict_fetch], -[m4_ifval([$3], - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) - - -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------------------- -m4_define([lt_if_dict_fetch], -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], - [$5], - [$6])]) - - -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) -# -------------------------------------------------------------- -m4_define([lt_dict_filter], -[m4_if([$5], [], [], - [lt_join(m4_quote(m4_default([$4], [[, ]])), - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), - [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl -]) - -# ltversion.m4 -- version numbers -*- Autoconf -*- -# -# Copyright (C) 2004 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# @configure_input@ - -# serial 3293 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.4]) -m4_define([LT_PACKAGE_REVISION], [1.3293]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4' -macro_revision='1.3293' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -]) - -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004. -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 5 lt~obsolete.m4 - -# These exist entirely to fool aclocal when bootstrapping libtool. -# -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) -# which have later been changed to m4_define as they aren't part of the -# exported API, or moved to Autoconf or Automake where they belong. -# -# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us -# using a macro with the same name in our local m4/libtool.m4 it'll -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define -# and doesn't know about Autoconf macros at all.) -# -# So we provide this file, which has a silly filename so it's always -# included after everything else. This provides aclocal with the -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything -# because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. -# -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. -# Yes, that means every name once taken will need to remain here until -# we give up compatibility with versions before 1.7, at which point -# we need to keep only those names which we still refer to. - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) - -m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) -m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) -m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) -m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) -m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) -m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) -m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) -m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) -m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) -m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) -m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) -m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) -m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) -m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) -m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) -m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) -m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) -m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) -m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) -m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) -m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) -m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) -m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) -m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) -m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) -m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) -m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) -m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) -m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) -m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) -m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) -m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) -m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) -m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) -m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) -m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) -m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) -m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) - diff --git a/libspud/config.guess b/libspud/config.guess deleted file mode 100644 index dc84c68ef7..0000000000 --- a/libspud/config.guess +++ /dev/null @@ -1,1501 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. - -timestamp='2009-11-20' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - 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:*:[456]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-gnu - else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-gnu - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/libspud/config.sub b/libspud/config.sub deleted file mode 100644 index 2a55a50751..0000000000 --- a/libspud/config.sub +++ /dev/null @@ -1,1705 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. - -timestamp='2009-11-20' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -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*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nios | nios2 \ - | ns16k | ns32k \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e \ - | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - 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) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze) - basic_machine=microblaze-xilinx - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - 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) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tile*) - basic_machine=tile-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/libspud/configure b/libspud/configure deleted file mode 100755 index d4e6bf9eba..0000000000 --- a/libspud/configure +++ /dev/null @@ -1,25889 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67. -# -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# 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. -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 - -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 - - test -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 : - # 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. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -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; } - - # 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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - -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= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= -PACKAGE_URL= - -ac_unique_file="include/spud.h" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='LTLIBOBJS -LIBOBJS -LINKER -ARFLAGS -PROFILING_FLAG -MAKE -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -FCLIBS -FLIBS -ac_ct_F77 -FFLAGS -F77 -ac_ct_FC -FCFLAGS -FC -CXXCPP -ac_ct_CXX -CXXFLAGS -CXX -CPP -OTOOL64 -OTOOL -LIPO -NMEDIT -DSYMUTIL -MANIFEST_TOOL -AWK -RANLIB -STRIP -ac_ct_AR -AR -DLLTOOL -OBJDUMP -LN_S -NM -ac_ct_DUMPBIN -DUMPBIN -LD -FGREP -EGREP -GREP -SED -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -LIBTOOL -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_shared -enable_static -with_pic -enable_fast_install -with_gnu_ld -with_sysroot -enable_libtool_lock -enable_debugging -enable_verbose -enable_profiling -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP -CXX -CXXFLAGS -CCC -CXXCPP -FC -FCFLAGS -F77 -FFLAGS' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_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 this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) - --enable-debugging turns on debugging flags - --enable-verbose turns on super verbosity - --enable-profiling enable gprof profiling - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic try to use only PIC/non-PIC objects [default=use - both] - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - CXX C++ compiler command - CXXFLAGS C++ compiler flags - CXXCPP C++ preprocessor - FC Fortran compiler command - FCFLAGS Fortran compiler flags - F77 Fortran 77 compiler command - FFLAGS Fortran 77 compiler flags - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.67 - -Copyright (C) 2010 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; 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 "test \"\${$3+set}\"" = set; 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; test "x$as_lineno_stack" = x && { as_lineno=; 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; test "x$as_lineno_stack" = x && { as_lineno=; 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; test "x$as_lineno_stack" = x && { as_lineno=; 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 "test \"\${$3+set}\"" = set; 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_func - -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_cpp - -# ac_fn_cxx_try_link LINENO -# ------------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_link - -# ac_fn_fc_try_compile LINENO -# --------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_fc_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_fc_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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_fc_try_compile - -# ac_fn_fc_try_link LINENO -# ------------------------ -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_fc_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_fc_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_fc_try_link - -# ac_fn_f77_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_f77_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_f77_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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_f77_try_compile - -# ac_fn_f77_try_link LINENO -# ------------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_f77_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_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_f77_try_link - -# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -# -------------------------------------------- -# Tries to find the compile-time value of EXPR in a program that includes -# INCLUDES, setting VAR accordingly. Returns whether the value could be -# computed -ac_fn_c_compute_int () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in #(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - echo >>conftest.val; read $3 config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.67. 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 "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -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' -macro_revision='1.3293' - - - - - - - - - - - - - -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 test "${ac_cv_build+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_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 test "${ac_cv_host+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_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 test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${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 test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${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 test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${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 test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5 ; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5 ; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5 ; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5 ; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; 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 test "${ac_cv_c_compiler_gnu+set}" = set; 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 test "${ac_cv_prog_cc_g+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat 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 test "${ac_cv_prog_cc_c89+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -{ $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 test "${ac_cv_path_SED+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - 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 test "${ac_cv_path_EGREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - 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 test "${ac_cv_path_FGREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - -test -z "$GREP" && GREP=grep - - - - - - - - - - - - - - - - - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if test "${lt_cv_path_LD+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${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 test "${lt_cv_prog_gnu_ld+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - - -{ $as_echo "$as_me:${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 test "${lt_cv_path_NM+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DUMPBIN+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_DUMPBIN" && break -done - - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DUMPBIN=$ac_ct_DUMPBIN - fi -fi - - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi - - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if test "${lt_cv_nm_interface+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$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 test "${lt_cv_sys_max_cmd_len+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } -fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - - - - - -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } - - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi - - - - - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if test "${lt_cv_to_host_file_cmd+set}" = set; 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 test "${lt_cv_to_tool_file_cmd+set}" = set; 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 test "${lt_cv_ld_reload_flag+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${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 test "${lt_cv_deplibs_check_method+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - - - - - - - - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DLLTOOL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - - - - - - - - -if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="$ac_tool_prefix$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 test "${ac_cv_prog_ac_ct_AR+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="$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 test "${lt_cv_ar_at_file+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${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 test "${ac_cv_prog_RANLIB+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: - - - - - - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - - - - - - - - - - - - - - - - -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 test "${ac_cv_prog_AWK+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${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 - - - - - - - - - - - - - - - - - - - -# 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 test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } - -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; -else - with_sysroot=no -fi - - -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } - - - - - -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : - enableval=$enable_libtool_lock; -fi - -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_cc_needs_belf=yes -else - lt_cv_cc_needs_belf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -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 test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi - -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if test "${lt_cv_path_mainfest_tool+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi - - - - - - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${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 test "${ac_cv_prog_NMEDIT+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${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 test "${ac_cv_prog_LIPO+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${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 test "${ac_cv_prog_OTOOL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${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 test "${ac_cv_prog_OTOOL64+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${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 test "${lt_cv_apple_cc_single_mod+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ $as_echo "$as_me:${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 test "${lt_cv_ld_exported_symbols_list+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat 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 test "${lt_cv_ld_force_load+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat 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 test "${ac_cv_header_stdc+set}" = set; 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" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi - -done - - - - - -# Set options - - - - enable_dlopen=no - - - enable_win32_dll=no - - - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=yes -fi - - - - - - - - - - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=yes -fi - - - - - - - - - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : - withval=$with_pic; pic_mode="$withval" -else - pic_mode=default -fi - - -test -z "$pic_mode" && pic_mode=default - - - - - - - - # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_fast_install=yes -fi - - - - - - - - - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - - - - - - - - - - - - - - - - - - - - - - - - - - -test -z "$LN_S" && LN_S="ln -s" - - - - - - - - - - - - - - -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if test "${lt_cv_objdir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF - - - - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${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 test "${lt_cv_path_MAGIC_CMD+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${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* - - -if test -n "$compiler"; then - -lt_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - - - - - - - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - - - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - lt_prog_compiler_pic='-Xcompiler -fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - esac - ;; - esac - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi - -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if test "${lt_cv_prog_compiler_pic+set}" = set; 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 test "${lt_cv_prog_compiler_pic_works+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } - -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi - -fi - - - - - - - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test "${lt_cv_prog_compiler_static_works+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } - -if test x"$lt_cv_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$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 test "${lt_cv_prog_compiler_c_o+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - ld_shlibs=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi - ;; - - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - export_dynamic_flag_spec='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if test "${lt_cv_aix_libpath_+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if test "${lt_cv_aix_libpath_+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac - ;; - - darwin* | rhapsody*) - - - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - whole_archive_flag_spec='' - fi - link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - - else - ld_shlibs=no - fi - - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if test "${lt_cv_prog_compiler__b+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } - -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if test "${lt_cv_irix_exported_symbol+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo (void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs=no - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' - ;; - esac - fi - fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no - -with_gnu_ld=$with_gnu_ld - - - - - - - - - - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if test "${lt_cv_archive_cmds_need_lc+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } - -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[4-9]*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - - 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 - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; 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 - - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $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' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } - -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat 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" = x""yes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = x""yes; 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 test "${ac_cv_lib_dld_shl_load+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat 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" = x""yes; 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" = x""yes; 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 test "${ac_cv_lib_dl_dlopen+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat 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" = x""yes; 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 test "${ac_cv_lib_svld_dlopen+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat 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" = x""yes; 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 test "${ac_cv_lib_dld_dld_link+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat 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" = x""yes; then : - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - - - - - - - - - - - - - - - - -striplib= -old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -fi - - - - - - - - - - - - - # Report which library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } - - - - -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - - - - - - - - - - - - - ac_config_commands="$ac_config_commands libtool" - - - - -# Only expand once: - - -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 test "${ac_cv_prog_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; 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 test "${ac_cv_prog_cxx_g+set}" = set; 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 - - - - -func_stripname_cnf () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname_cnf - - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; 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_flag_spec_ld_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_shlibpath_var_CXX=unsupported -hardcode_automatic_CXX=no -inherit_rpath_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -reload_flag_CXX=$reload_flag -reload_cmds_CXX=$reload_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - - # save warnings/boilerplate of simple test code - ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - - ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS - compiler=$CC - compiler_CXX=$CC - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - - - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' - else - lt_prog_compiler_no_builtin_flag_CXX= - fi - - if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if test "${lt_cv_path_LD+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${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 test "${lt_cv_prog_gnu_ld+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_CXX= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - ld_shlibs_CXX=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds_CXX='' - hardcode_direct_CXX=yes - hardcode_direct_absolute_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - file_list_spec_CXX='${wl}-f,' - - if test "$GXX" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct_CXX=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - export_dynamic_flag_spec_CXX='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - always_export_symbols_CXX=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_CXX='-berok' - # Determine the default libpath from the value encoded in an empty - # executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if test "${lt_cv_aix_libpath__CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__CXX -fi - - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if test "${lt_cv_aix_libpath__CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__CXX -fi - - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - fi - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_CXX=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_CXX=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_CXX=' ' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=yes - file_list_spec_CXX='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' - enable_shared_with_static_runtimes_CXX=yes - # Don't use ranlib - old_postinstall_cmds_CXX='chmod 644 $oldlib' - postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; - esac - ;; - darwin* | rhapsody*) - - - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - whole_archive_flag_spec_CXX='' - fi - link_all_deplibs_CXX=yes - allow_undefined_flag_CXX="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - if test "$lt_cv_apple_cc_single_mod" != "yes"; then - archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" - fi - - else - ld_shlibs_CXX=no - fi - - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - ld_shlibs_CXX=no - ;; - - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - - gnu*) - ;; - - haiku*) - archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs_CXX=yes - ;; - - hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - export_dynamic_flag_spec_CXX='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - *) - hardcode_direct_CXX=yes - hardcode_direct_absolute_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - - interix[3-9]*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - inherit_rpath_CXX=yes - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [1-5].* | *pgcpp\ [1-5].*) - prelink_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - old_archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - archive_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - esac - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object_CXX=yes - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - - *nto* | *qnx*) - ld_shlibs_CXX=yes - ;; - - openbsd2*) - # C++ shared libraries are fairly broken - ld_shlibs_CXX=no - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - hardcode_direct_absolute_CXX=yes - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd=func_echo_all - else - ld_shlibs_CXX=no - fi - ;; - - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - case $host in - osf3*) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - ;; - *) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - ;; - esac - - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - case $host in - osf3*) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - *) - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - esac - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - archive_cmds_need_lc_CXX=yes - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' - ;; - esac - link_all_deplibs_CXX=yes - - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - fi - - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='${wl}-z,text' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_CXX='${wl}-z,text' - allow_undefined_flag_CXX='${wl}-z,nodefs' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ - '"$old_archive_cmds_CXX" - reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ - '"$reload_cmds_CXX" - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -$as_echo "$ld_shlibs_CXX" >&6; } - test "$ld_shlibs_CXX" = no && can_build_shared=no - - GCC_CXX="$GXX" - LD_CXX="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - # Dependencies to place before and after the object being linked: -predep_objects_CXX= -postdep_objects_CXX= -predeps_CXX= -postdeps_CXX= -compiler_lib_search_path_CXX= - -cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF - - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -esac - -if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" || - test $p = "-R"; then - prev=$p - continue - fi - - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" - else - postdeps_CXX="${postdeps_CXX} ${prev}${p}" - fi - fi - prev= - ;; - - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$predep_objects_CXX"; then - predep_objects_CXX="$p" - else - predep_objects_CXX="$predep_objects_CXX $p" - fi - else - if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX="$p" - else - postdep_objects_CXX="$postdep_objects_CXX $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling CXX test program" -fi - -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS - -# PORTME: override above test on systems where it is broken -case $host_os in -interix[3-9]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - predep_objects_CXX= - postdep_objects_CXX= - postdeps_CXX= - ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test "$solaris_use_stlport4" != yes; then - postdeps_CXX='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - postdeps_CXX='-library=Cstd -library=Crun' - fi - ;; - esac - ;; -esac - - -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac - compiler_lib_search_dirs_CXX= -if test -n "${compiler_lib_search_path_CXX}"; then - compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= - - - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic_CXX='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static_CXX= - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_CXX='-fPIC -shared' - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - else - case $host_os in - aix[4-9]*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - dgux*) - case $cc_basename in - ec++*) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fpic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-qpic' - lt_prog_compiler_static_CXX='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_CXX='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx*) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc*) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; - esac - fi - -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= - ;; - *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if test "${lt_cv_prog_compiler_pic_CXX+set}" = set; 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 test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works_CXX=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } - -if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no -fi - -fi - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works_CXX=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works_CXX=yes - fi - else - lt_cv_prog_compiler_static_works_CXX=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } - -if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then - : -else - lt_prog_compiler_static_CXX= -fi - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; 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 test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } - - - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - case $host_os in - aix[4-9]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) ;; - *) - 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 - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -$as_echo "$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no - -with_gnu_ld_CXX=$with_gnu_ld - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_CXX" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_CXX=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_CXX in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if test "${lt_cv_archive_cmds_need_lc_CXX+set}" = set; 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 - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[4-9]*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - - ;; - 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 - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; 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 - - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $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' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || - test -n "$runpath_var_CXX" || - test "X$hardcode_automatic_CXX" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct_CXX" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 -$as_echo "$hardcode_action_CXX" >&6; } - -if test "$hardcode_action_CXX" = relink || - test "$inherit_rpath_CXX" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - - fi # test -n "$compiler" - - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 - 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 test "${ac_cv_prog_FC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$FC"; then - ac_cv_prog_FC="$FC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_FC="$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 -FC=$ac_cv_prog_FC -if test -n "$FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 -$as_echo "$FC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$FC" && break - done -fi -if test -z "$FC"; then - ac_ct_FC=$FC - for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 -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 test "${ac_cv_prog_ac_ct_FC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_FC"; then - ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_FC="$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_FC=$ac_cv_prog_ac_ct_FC -if test -n "$ac_ct_FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 -$as_echo "$ac_ct_FC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_FC" && break -done - - if test "x$ac_ct_FC" = x; then - FC="" - 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 - FC=$ac_ct_FC - fi -fi - - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 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 -rm -f a.out - -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5 -$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; } -if test "${ac_cv_fc_compiler_gnu+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_ACEOF -if ac_fn_fc_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_fc_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 -$as_echo "$ac_cv_fc_compiler_gnu" >&6; } -ac_ext=$ac_save_ext -ac_test_FCFLAGS=${FCFLAGS+set} -ac_save_FCFLAGS=$FCFLAGS -FCFLAGS= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 -$as_echo_n "checking whether $FC accepts -g... " >&6; } -if test "${ac_cv_prog_fc_g+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - FCFLAGS=-g -cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : - ac_cv_prog_fc_g=yes -else - ac_cv_prog_fc_g=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 -$as_echo "$ac_cv_prog_fc_g" >&6; } -if test "$ac_test_FCFLAGS" = set; then - FCFLAGS=$ac_save_FCFLAGS -elif test $ac_cv_prog_fc_g = yes; then - if test "x$ac_cv_fc_compiler_gnu" = xyes; then - FCFLAGS="-g -O2" - else - FCFLAGS="-g" - fi -else - if test "x$ac_cv_fc_compiler_gnu" = xyes; then - FCFLAGS="-O2" - else - FCFLAGS= - fi -fi - -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu - - - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu - - -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi - -archive_cmds_need_lc_FC=no -allow_undefined_flag_FC= -always_export_symbols_FC=no -archive_expsym_cmds_FC= -export_dynamic_flag_spec_FC= -hardcode_direct_FC=no -hardcode_direct_absolute_FC=no -hardcode_libdir_flag_spec_FC= -hardcode_libdir_flag_spec_ld_FC= -hardcode_libdir_separator_FC= -hardcode_minus_L_FC=no -hardcode_automatic_FC=no -inherit_rpath_FC=no -module_cmds_FC= -module_expsym_cmds_FC= -link_all_deplibs_FC=unknown -old_archive_cmds_FC=$old_archive_cmds -reload_flag_FC=$reload_flag -reload_cmds_FC=$reload_cmds -no_undefined_flag_FC= -whole_archive_flag_spec_FC= -enable_shared_with_static_runtimes_FC=no - -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} - -# Object file extension for compiled fc test sources. -objext=o -objext_FC=$objext - -# No sense in running all these tests if we already determined that -# the FC compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_FC" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - - - - - - -# 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_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${FC-"f95"} - CFLAGS=$FCFLAGS - compiler=$CC - GCC=$ac_cv_fc_compiler_gnu - - compiler_FC=$CC - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - - - if test -n "$compiler"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } - - GCC_FC="$ac_cv_fc_compiler_gnu" - LD_FC="$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_FC= -postdep_objects_FC= -predeps_FC= -postdeps_FC= -compiler_lib_search_path_FC= - -cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer a - a=0 - return - end -_LT_EOF - - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -esac - -if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" || - test $p = "-R"; then - prev=$p - continue - fi - - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_FC"; then - compiler_lib_search_path_FC="${prev}${p}" - else - compiler_lib_search_path_FC="${compiler_lib_search_path_FC} ${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_FC"; then - postdeps_FC="${prev}${p}" - else - postdeps_FC="${postdeps_FC} ${prev}${p}" - fi - fi - prev= - ;; - - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$predep_objects_FC"; then - predep_objects_FC="$p" - else - predep_objects_FC="$predep_objects_FC $p" - fi - else - if test -z "$postdep_objects_FC"; then - postdep_objects_FC="$p" - else - postdep_objects_FC="$postdep_objects_FC $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling FC test program" -fi - -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS - -# PORTME: override above test on systems where it is broken - - -case " $postdeps_FC " in -*" -lc "*) archive_cmds_need_lc_FC=no ;; -esac - compiler_lib_search_dirs_FC= -if test -n "${compiler_lib_search_path_FC}"; then - compiler_lib_search_dirs_FC=`echo " ${compiler_lib_search_path_FC}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi - - - - - - - - - - - - - - lt_prog_compiler_wl_FC= -lt_prog_compiler_pic_FC= -lt_prog_compiler_static_FC= - - - if test "$GCC" = yes; then - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_static_FC='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_FC='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic_FC='-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_FC='-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_FC='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_FC='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static_FC= - ;; - - 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_FC='-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_FC=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_FC='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_FC=-Kconform_pic - fi - ;; - - *) - lt_prog_compiler_pic_FC='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl_FC='-Xlinker ' - lt_prog_compiler_pic_FC='-Xcompiler -fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_FC='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_FC='-Bstatic' - else - lt_prog_compiler_static_FC='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_FC='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_FC='-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_FC='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_FC='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_FC='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_FC='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='-fPIC' - lt_prog_compiler_static_FC='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='--shared' - lt_prog_compiler_static_FC='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl_FC='-Wl,-Wl,,' - lt_prog_compiler_pic_FC='-PIC' - lt_prog_compiler_static_FC='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='-fpic' - lt_prog_compiler_static_FC='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_FC='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_FC='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='-qpic' - lt_prog_compiler_static_FC='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-Bstatic' - lt_prog_compiler_wl_FC='' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-Bstatic' - lt_prog_compiler_wl_FC='-Wl,' - ;; - esac - ;; - esac - ;; - - newsos6) - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_FC='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_FC='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_FC='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static_FC='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl_FC='-Qoption ld ';; - *) - lt_prog_compiler_wl_FC='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl_FC='-Qoption ld ' - lt_prog_compiler_pic_FC='-PIC' - lt_prog_compiler_static_FC='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_FC='-Kconform_pic' - lt_prog_compiler_static_FC='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_pic_FC='-KPIC' - lt_prog_compiler_static_FC='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_FC='-Wl,' - lt_prog_compiler_can_build_shared_FC=no - ;; - - uts4*) - lt_prog_compiler_pic_FC='-pic' - lt_prog_compiler_static_FC='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_FC=no - ;; - esac - fi - -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_FC= - ;; - *) - lt_prog_compiler_pic_FC="$lt_prog_compiler_pic_FC" - ;; -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 test "${lt_cv_prog_compiler_pic_FC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_FC=$lt_prog_compiler_pic_FC -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_FC" >&5 -$as_echo "$lt_cv_prog_compiler_pic_FC" >&6; } -lt_prog_compiler_pic_FC=$lt_cv_prog_compiler_pic_FC - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_FC works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_FC works... " >&6; } -if test "${lt_cv_prog_compiler_pic_works_FC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works_FC=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_FC" - # 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_FC=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_FC" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works_FC" >&6; } - -if test x"$lt_cv_prog_compiler_pic_works_FC" = xyes; then - case $lt_prog_compiler_pic_FC in - "" | " "*) ;; - *) lt_prog_compiler_pic_FC=" $lt_prog_compiler_pic_FC" ;; - esac -else - lt_prog_compiler_pic_FC= - lt_prog_compiler_can_build_shared_FC=no -fi - -fi - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_FC eval lt_tmp_static_flag=\"$lt_prog_compiler_static_FC\" -{ $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 test "${lt_cv_prog_compiler_static_works_FC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works_FC=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_FC=yes - fi - else - lt_cv_prog_compiler_static_works_FC=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_FC" >&5 -$as_echo "$lt_cv_prog_compiler_static_works_FC" >&6; } - -if test x"$lt_cv_prog_compiler_static_works_FC" = xyes; then - : -else - lt_prog_compiler_static_FC= -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 test "${lt_cv_prog_compiler_c_o_FC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o_FC=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_FC=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_FC" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_FC" >&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 test "${lt_cv_prog_compiler_c_o_FC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o_FC=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_FC=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_FC" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; } - - - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_FC" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - runpath_var= - allow_undefined_flag_FC= - always_export_symbols_FC=no - archive_cmds_FC= - archive_expsym_cmds_FC= - compiler_needs_object_FC=no - enable_shared_with_static_runtimes_FC=no - export_dynamic_flag_spec_FC= - export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic_FC=no - hardcode_direct_FC=no - hardcode_direct_absolute_FC=no - hardcode_libdir_flag_spec_FC= - hardcode_libdir_flag_spec_ld_FC= - hardcode_libdir_separator_FC= - hardcode_minus_L_FC=no - hardcode_shlibpath_var_FC=unsupported - inherit_rpath_FC=no - link_all_deplibs_FC=unknown - module_cmds_FC= - module_expsym_cmds_FC= - old_archive_from_new_cmds_FC= - old_archive_from_expsyms_cmds_FC= - thread_safe_flag_spec_FC= - whole_archive_flag_spec_FC= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_FC= - # 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_FC='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - ld_shlibs_FC=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec_FC='${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_FC="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_FC= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_FC=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_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_FC='' - ;; - m68k) - archive_cmds_FC='$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_FC='-L$libdir' - hardcode_minus_L_FC=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_FC=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_FC='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_FC=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, FC) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_FC='-L$libdir' - export_dynamic_flag_spec_FC='${wl}--export-all-symbols' - allow_undefined_flag_FC=unsupported - always_export_symbols_FC=no - enable_shared_with_static_runtimes_FC=yes - export_symbols_cmds_FC='$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_FC='[_]+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_FC='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_FC='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_FC=no - fi - ;; - - haiku*) - archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs_FC=yes - ;; - - interix[3-9]*) - hardcode_direct_FC=no - hardcode_shlibpath_var_FC=no - hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir' - export_dynamic_flag_spec_FC='${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_FC='$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_FC='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_FC='${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_FC='${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_FC= - tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec_FC='${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_FC=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec_FC='${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_FC=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds_FC='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec_FC='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec_FC= - hardcode_libdir_flag_spec_ld_FC='-rpath $libdir' - archive_cmds_FC='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds_FC='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_FC=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds_FC='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_FC='$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_FC=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_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_FC=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_FC=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' - archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_FC=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds_FC='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_FC=yes - hardcode_shlibpath_var_FC=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_FC=no - fi - ;; - esac - - if test "$ld_shlibs_FC" = no; then - runpath_var= - hardcode_libdir_flag_spec_FC= - export_dynamic_flag_spec_FC= - whole_archive_flag_spec_FC= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_FC=unsupported - always_export_symbols_FC=yes - archive_expsym_cmds_FC='$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_FC=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_FC=unsupported - fi - ;; - - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_FC='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_FC='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds_FC='' - hardcode_direct_FC=yes - hardcode_direct_absolute_FC=yes - hardcode_libdir_separator_FC=':' - link_all_deplibs_FC=yes - file_list_spec_FC='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct_FC=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_FC=yes - hardcode_libdir_flag_spec_FC='-L$libdir' - hardcode_libdir_separator_FC= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - export_dynamic_flag_spec_FC='${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_FC=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_FC='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if test "${lt_cv_aix_libpath__FC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -if ac_fn_fc_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__FC=`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__FC"; then - lt_cv_aix_libpath__FC=`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__FC"; then - lt_cv_aix_libpath__FC="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__FC -fi - - hardcode_libdir_flag_spec_FC='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_FC='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_FC='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_FC="-z nodefs" - archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if test "${lt_cv_aix_libpath__FC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -if ac_fn_fc_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__FC=`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__FC"; then - lt_cv_aix_libpath__FC=`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__FC"; then - lt_cv_aix_libpath__FC="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__FC -fi - - hardcode_libdir_flag_spec_FC='${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_FC=' ${wl}-bernotok' - allow_undefined_flag_FC=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec_FC='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_FC='$convenience' - fi - archive_cmds_need_lc_FC=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_FC='' - ;; - m68k) - archive_cmds_FC='$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_FC='-L$libdir' - hardcode_minus_L_FC=yes - ;; - esac - ;; - - bsdi[45]*) - export_dynamic_flag_spec_FC=-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_FC=' ' - allow_undefined_flag_FC=unsupported - always_export_symbols_FC=yes - file_list_spec_FC='@' - # 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_FC='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds_FC='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, FC)='true' - enable_shared_with_static_runtimes_FC=yes - export_symbols_cmds_FC='$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_FC='chmod 644 $oldlib' - postlink_cmds_FC='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_FC=' ' - allow_undefined_flag_FC=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_FC='$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_FC='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_FC='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes_FC=yes - ;; - esac - ;; - - darwin* | rhapsody*) - - - archive_cmds_need_lc_FC=no - hardcode_direct_FC=no - hardcode_automatic_FC=yes - hardcode_shlibpath_var_FC=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec_FC='`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_FC='' - fi - link_all_deplibs_FC=yes - allow_undefined_flag_FC="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds_FC="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds_FC="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds_FC="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_FC="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_FC=no - fi - - ;; - - dgux*) - archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_FC='-L$libdir' - hardcode_shlibpath_var_FC=no - ;; - - freebsd1*) - ld_shlibs_FC=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_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_FC='-R$libdir' - hardcode_direct_FC=yes - hardcode_shlibpath_var_FC=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_FC=yes - hardcode_minus_L_FC=yes - hardcode_shlibpath_var_FC=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_FC='-R$libdir' - hardcode_direct_FC=yes - hardcode_shlibpath_var_FC=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_FC='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_FC='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_FC=: - hardcode_direct_FC=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_FC=yes - export_dynamic_flag_spec_FC='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds_FC='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_FC='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld_FC='+b $libdir' - hardcode_libdir_separator_FC=: - hardcode_direct_FC=yes - hardcode_direct_absolute_FC=yes - export_dynamic_flag_spec_FC='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_FC=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_FC='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_FC='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_FC='$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_FC='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_FC=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_FC=no - hardcode_shlibpath_var_FC=no - ;; - *) - hardcode_direct_FC=yes - hardcode_direct_absolute_FC=yes - export_dynamic_flag_spec_FC='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_FC=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_FC='$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 test "${lt_cv_irix_exported_symbol+set}" = set; 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 > conftest.$ac_ext <<_ACEOF - - subroutine foo - end -_ACEOF -if ac_fn_fc_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - archive_cmds_FC='$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_FC='$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_FC='no' - hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_FC=: - inherit_rpath_FC=yes - link_all_deplibs_FC=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_FC='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_FC='-R$libdir' - hardcode_direct_FC=yes - hardcode_shlibpath_var_FC=no - ;; - - newsos6) - archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_FC=yes - hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_FC=: - hardcode_shlibpath_var_FC=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_FC=yes - hardcode_shlibpath_var_FC=no - hardcode_direct_absolute_FC=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir' - export_dynamic_flag_spec_FC='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_FC='-R$libdir' - ;; - *) - archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs_FC=no - fi - ;; - - os2*) - hardcode_libdir_flag_spec_FC='-L$libdir' - hardcode_minus_L_FC=yes - allow_undefined_flag_FC=unsupported - archive_cmds_FC='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds_FC='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_FC=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_FC='$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_FC=' -expect_unresolved \*' - archive_cmds_FC='$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_FC='no' - hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_FC=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_FC=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_FC='$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_FC='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_FC=' -expect_unresolved \*' - archive_cmds_FC='$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_FC='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_FC='-rpath $libdir' - fi - archive_cmds_need_lc_FC='no' - hardcode_libdir_separator_FC=: - ;; - - solaris*) - no_undefined_flag_FC=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_FC='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_FC='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_FC='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_FC='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_FC='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_FC='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_FC='-R$libdir' - hardcode_shlibpath_var_FC=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec_FC='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec_FC='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs_FC=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_FC='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_FC='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_FC='-L$libdir' - hardcode_direct_FC=yes - hardcode_minus_L_FC=yes - hardcode_shlibpath_var_FC=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_FC=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_FC='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_FC='$CC -r -o $output$reload_objs' - hardcode_direct_FC=no - ;; - motorola) - archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_FC=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_FC=no - ;; - - sysv4.3*) - archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_FC=no - export_dynamic_flag_spec_FC='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_FC=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_FC=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_FC='${wl}-z,text' - archive_cmds_need_lc_FC=no - hardcode_shlibpath_var_FC=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_FC='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_FC='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_FC='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_FC='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_FC='${wl}-z,text' - allow_undefined_flag_FC='${wl}-z,nodefs' - archive_cmds_need_lc_FC=no - hardcode_shlibpath_var_FC=no - hardcode_libdir_flag_spec_FC='${wl}-R,$libdir' - hardcode_libdir_separator_FC=':' - link_all_deplibs_FC=yes - export_dynamic_flag_spec_FC='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_FC='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_FC='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_FC='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_FC='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_FC='-L$libdir' - hardcode_shlibpath_var_FC=no - ;; - - *) - ld_shlibs_FC=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec_FC='${wl}-Blargedynsym' - ;; - esac - fi - fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_FC" >&5 -$as_echo "$ld_shlibs_FC" >&6; } -test "$ld_shlibs_FC" = no && can_build_shared=no - -with_gnu_ld_FC=$with_gnu_ld - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_FC" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_FC=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_FC 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 test "${lt_cv_archive_cmds_need_lc_FC+set}" = set; 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_FC - pic_flag=$lt_prog_compiler_pic_FC - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_FC - allow_undefined_flag_FC= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds_FC 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_FC=no - else - lt_cv_archive_cmds_need_lc_FC=yes - fi - allow_undefined_flag_FC=$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_FC" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc_FC" >&6; } - archive_cmds_need_lc_FC=$lt_cv_archive_cmds_need_lc_FC - ;; - 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 - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[4-9]*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - - ;; - 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 - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; 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_FC\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_FC\"" - cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -if ac_fn_fc_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 - - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $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' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action_FC= -if test -n "$hardcode_libdir_flag_spec_FC" || - test -n "$runpath_var_FC" || - test "X$hardcode_automatic_FC" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct_FC" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, FC)" != no && - test "$hardcode_minus_L_FC" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_FC=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_FC=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_FC=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_FC" >&5 -$as_echo "$hardcode_action_FC" >&6; } - -if test "$hardcode_action_FC" = relink || - test "$inherit_rpath_FC" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test "$_lt_disable_FC" != yes - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -# This is to get around some odd behavious of some fortran compilers -FCFLAGS="$FCFLAGS -I/usr/include" - -# -# Name spud -# -# Check whether --enable-debugging was given. -if test "${enable_debugging+set}" = set; then : - enableval=$enable_debugging; -fi - - -# Check system type - - -# Find compilers -{ $as_echo "$as_me:${as_lineno-$LINENO}: *** Fishing for legacy fortran compiler." >&5 -$as_echo "$as_me: *** Fishing for legacy fortran compiler." >&6;} -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in ifort ifc efc sunf95 gfortran pgf95 pathf95 g95 f90 - 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 test "${ac_cv_prog_F77+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$F77"; then - ac_cv_prog_F77="$F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_F77="$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 -F77=$ac_cv_prog_F77 -if test -n "$F77"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $F77" >&5 -$as_echo "$F77" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$F77" && break - done -fi -if test -z "$F77"; then - ac_ct_F77=$F77 - for ac_prog in ifort ifc efc sunf95 gfortran pgf95 pathf95 g95 f90 -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 test "${ac_cv_prog_ac_ct_F77+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_F77"; then - ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_F77="$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_F77=$ac_cv_prog_ac_ct_F77 -if test -n "$ac_ct_F77"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_F77" >&5 -$as_echo "$ac_ct_F77" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_F77" && break -done - - if test "x$ac_ct_F77" = x; then - F77="" - 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 - F77=$ac_ct_F77 - fi -fi - - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 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 -rm -f a.out - -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran 77 compiler" >&5 -$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; } -if test "${ac_cv_f77_compiler_gnu+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_ACEOF -if ac_fn_f77_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_f77_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_compiler_gnu" >&5 -$as_echo "$ac_cv_f77_compiler_gnu" >&6; } -ac_ext=$ac_save_ext -ac_test_FFLAGS=${FFLAGS+set} -ac_save_FFLAGS=$FFLAGS -FFLAGS= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -g" >&5 -$as_echo_n "checking whether $F77 accepts -g... " >&6; } -if test "${ac_cv_prog_f77_g+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - FFLAGS=-g -cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -if ac_fn_f77_try_compile "$LINENO"; then : - ac_cv_prog_f77_g=yes -else - ac_cv_prog_f77_g=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_g" >&5 -$as_echo "$ac_cv_prog_f77_g" >&6; } -if test "$ac_test_FFLAGS" = set; then - FFLAGS=$ac_save_FFLAGS -elif test $ac_cv_prog_f77_g = yes; then - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-g -O2" - else - FFLAGS="-g" - fi -else - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-O2" - else - FFLAGS= - fi -fi - -if test $ac_compiler_gnu = yes; then - G77=yes -else - G77= -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=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi - -archive_cmds_need_lc_F77=no -allow_undefined_flag_F77= -always_export_symbols_F77=no -archive_expsym_cmds_F77= -export_dynamic_flag_spec_F77= -hardcode_direct_F77=no -hardcode_direct_absolute_F77=no -hardcode_libdir_flag_spec_F77= -hardcode_libdir_flag_spec_ld_F77= -hardcode_libdir_separator_F77= -hardcode_minus_L_F77=no -hardcode_automatic_F77=no -inherit_rpath_F77=no -module_cmds_F77= -module_expsym_cmds_F77= -link_all_deplibs_F77=unknown -old_archive_cmds_F77=$old_archive_cmds -reload_flag_F77=$reload_flag -reload_cmds_F77=$reload_cmds -no_undefined_flag_F77= -whole_archive_flag_spec_F77= -enable_shared_with_static_runtimes_F77=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -objext_F77=$objext - -# No sense in running all these tests if we already determined that -# the F77 compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_F77" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - - - - - - -# 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_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${F77-"f77"} - CFLAGS=$FFLAGS - compiler=$CC - compiler_F77=$CC - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - - GCC=$G77 - if test -n "$compiler"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } - - GCC_F77="$G77" - LD_F77="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - lt_prog_compiler_wl_F77= -lt_prog_compiler_pic_F77= -lt_prog_compiler_static_F77= - - - if test "$GCC" = yes; then - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_static_F77='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic_F77='-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_F77='-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_F77='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_F77='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static_F77= - ;; - - 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_F77='-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_F77=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_F77='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_F77=-Kconform_pic - fi - ;; - - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl_F77='-Xlinker ' - lt_prog_compiler_pic_F77='-Xcompiler -fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_F77='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - else - lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_F77='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_F77='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_F77='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_F77='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-fPIC' - lt_prog_compiler_static_F77='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='--shared' - lt_prog_compiler_static_F77='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl_F77='-Wl,-Wl,,' - lt_prog_compiler_pic_F77='-PIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-fpic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_F77='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-qpic' - lt_prog_compiler_static_F77='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - lt_prog_compiler_wl_F77='' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - lt_prog_compiler_wl_F77='-Wl,' - ;; - esac - ;; - esac - ;; - - newsos6) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic_F77='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_F77='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static_F77='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl_F77='-Qoption ld ';; - *) - lt_prog_compiler_wl_F77='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl_F77='-Qoption ld ' - lt_prog_compiler_pic_F77='-PIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_F77='-Kconform_pic' - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_can_build_shared_F77=no - ;; - - uts4*) - lt_prog_compiler_pic_F77='-pic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_F77=no - ;; - esac - fi - -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_F77= - ;; - *) - lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" - ;; -esac - -{ $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 test "${lt_cv_prog_compiler_pic_F77+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_F77=$lt_prog_compiler_pic_F77 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_F77" >&5 -$as_echo "$lt_cv_prog_compiler_pic_F77" >&6; } -lt_prog_compiler_pic_F77=$lt_cv_prog_compiler_pic_F77 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_F77"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; } -if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works_F77=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_F77" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$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_F77=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_F77" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works_F77" >&6; } - -if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then - case $lt_prog_compiler_pic_F77 in - "" | " "*) ;; - *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; - esac -else - lt_prog_compiler_pic_F77= - lt_prog_compiler_can_build_shared_F77=no -fi - -fi - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" -{ $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 test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works_F77=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_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_F77=yes - fi - else - lt_cv_prog_compiler_static_works_F77=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_F77" >&5 -$as_echo "$lt_cv_prog_compiler_static_works_F77" >&6; } - -if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then - : -else - lt_prog_compiler_static_F77= -fi - - - - - { $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 test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o_F77=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$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_F77=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_F77" >&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 test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o_F77=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$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_F77=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; } - - - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - runpath_var= - allow_undefined_flag_F77= - always_export_symbols_F77=no - archive_cmds_F77= - archive_expsym_cmds_F77= - compiler_needs_object_F77=no - enable_shared_with_static_runtimes_F77=no - export_dynamic_flag_spec_F77= - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic_F77=no - hardcode_direct_F77=no - hardcode_direct_absolute_F77=no - hardcode_libdir_flag_spec_F77= - hardcode_libdir_flag_spec_ld_F77= - hardcode_libdir_separator_F77= - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=unsupported - inherit_rpath_F77=no - link_all_deplibs_F77=unknown - module_cmds_F77= - module_expsym_cmds_F77= - old_archive_from_new_cmds_F77= - old_archive_from_expsyms_cmds_F77= - thread_safe_flag_spec_F77= - whole_archive_flag_spec_F77= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_F77= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - - 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_F77=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec_F77='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_F77= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_F77=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_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='' - ;; - m68k) - archive_cmds_F77='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_F77=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_F77='-L$libdir' - export_dynamic_flag_spec_F77='${wl}--export-all-symbols' - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=no - enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_F77='[_]+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_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_F77=no - fi - ;; - - haiku*) - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs_F77=yes - ;; - - interix[3-9]*) - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_F77='${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_F77='${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_F77= - tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec_F77='${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_F77=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object_F77=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds_F77='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec_F77='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec_F77= - hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' - archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds_F77='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs_F77=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$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_F77=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_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_F77=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # 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_F77='${wl}-rpath ${wl}$libdir' - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - - if test "$ld_shlibs_F77" = no; then - runpath_var= - hardcode_libdir_flag_spec_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=yes - archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L_F77=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_F77=unsupported - fi - ;; - - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds_F77='' - hardcode_direct_F77=yes - hardcode_direct_absolute_F77=yes - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - file_list_spec_F77='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct_F77=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_F77=yes - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_libdir_separator_F77= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - export_dynamic_flag_spec_F77='${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_F77=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_F77='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if test "${lt_cv_aix_libpath__F77+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -if ac_fn_f77_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__F77=`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__F77"; then - lt_cv_aix_libpath__F77=`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__F77"; then - lt_cv_aix_libpath__F77="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__F77 -fi - - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_F77='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_F77="-z nodefs" - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if test "${lt_cv_aix_libpath__F77+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -if ac_fn_f77_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__F77=`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__F77"; then - lt_cv_aix_libpath__F77=`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__F77"; then - lt_cv_aix_libpath__F77="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__F77 -fi - - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_F77=' ${wl}-bernotok' - allow_undefined_flag_F77=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec_F77='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_F77='$convenience' - fi - archive_cmds_need_lc_F77=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='' - ;; - m68k) - archive_cmds_F77='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - ;; - esac - ;; - - bsdi[45]*) - export_dynamic_flag_spec_F77=-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_F77=' ' - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=yes - file_list_spec_F77='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_F77='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, F77)='true' - enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$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_F77='chmod 644 $oldlib' - postlink_cmds_F77='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_F77=' ' - allow_undefined_flag_F77=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `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_F77='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes_F77=yes - ;; - esac - ;; - - darwin* | rhapsody*) - - - archive_cmds_need_lc_F77=no - hardcode_direct_F77=no - hardcode_automatic_F77=yes - hardcode_shlibpath_var_F77=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec_F77='`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_F77='' - fi - link_all_deplibs_F77=yes - allow_undefined_flag_F77="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - - else - ld_shlibs_F77=no - fi - - ;; - - dgux*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - freebsd1*) - ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_F77='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_F77='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds_F77='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld_F77='+b $libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - hardcode_direct_absolute_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$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_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - ;; - *) - hardcode_direct_F77=yes - hardcode_direct_absolute_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared $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 test "${lt_cv_irix_exported_symbol+set}" = set; 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 > conftest.$ac_ext <<_ACEOF - - subroutine foo - end -_ACEOF -if ac_fn_f77_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - archive_cmds_F77='$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_F77='$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_F77='no' - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - inherit_rpath_F77=yes - link_all_deplibs_F77=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - newsos6) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_shlibpath_var_F77=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - hardcode_direct_absolute_F77=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs_F77=no - fi - ;; - - os2*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - allow_undefined_flag_F77=unsupported - archive_cmds_F77='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$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_F77='no' - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $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_F77='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$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_F77='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_F77='-rpath $libdir' - fi - archive_cmds_need_lc_F77='no' - hardcode_libdir_separator_F77=: - ;; - - solaris*) - no_undefined_flag_F77=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_F77='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $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_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - archive_cmds_F77='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_shlibpath_var_F77=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs_F77=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_F77='$CC -r -o $output$reload_objs' - hardcode_direct_F77=no - ;; - motorola) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; - - sysv4.3*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_F77=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_F77='${wl}-z,text' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_F77='${wl}-z,text' - allow_undefined_flag_F77='${wl}-z,nodefs' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='${wl}-R,$libdir' - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - export_dynamic_flag_spec_F77='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - *) - ld_shlibs_F77=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec_F77='${wl}-Blargedynsym' - ;; - esac - fi - fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_F77" >&5 -$as_echo "$ld_shlibs_F77" >&6; } -test "$ld_shlibs_F77" = no && can_build_shared=no - -with_gnu_ld_F77=$with_gnu_ld - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_F77" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_F77=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_F77 in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $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 test "${lt_cv_archive_cmds_need_lc_F77+set}" = set; 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_F77 - pic_flag=$lt_prog_compiler_pic_F77 - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_F77 - allow_undefined_flag_F77= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_F77 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds_F77 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc_F77=no - else - lt_cv_archive_cmds_need_lc_F77=yes - fi - allow_undefined_flag_F77=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_F77" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc_F77" >&6; } - archive_cmds_need_lc_F77=$lt_cv_archive_cmds_need_lc_F77 - ;; - 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 - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[4-9]*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - - ;; - 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 - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; 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_F77\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_F77\"" - cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -if ac_fn_f77_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 - - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $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' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action_F77= -if test -n "$hardcode_libdir_flag_spec_F77" || - test -n "$runpath_var_F77" || - test "X$hardcode_automatic_F77" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct_F77" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, F77)" != no && - test "$hardcode_minus_L_F77" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_F77=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_F77=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_F77=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_F77" >&5 -$as_echo "$hardcode_action_F77" >&6; } - -if test "$hardcode_action_F77" = relink || - test "$inherit_rpath_F77" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC="$lt_save_CC" - CFLAGS="$lt_save_CFLAGS" -fi # test "$_lt_disable_F77" != yes - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $F77" >&5 -$as_echo_n "checking how to get verbose linking output from $F77... " >&6; } -if test "${ac_cv_prog_f77_v+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -if ac_fn_f77_try_compile "$LINENO"; then : - ac_cv_prog_f77_v= -# Try some options frequently used verbose output -for ac_verb in -v -verbose --verbose -V -\#\#\#; do - cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF - -# Compile and link our simple test program by passing a flag (argument -# 1 to this macro) to the Fortran compiler in order to get -# "verbose" output that we can then parse for the Fortran linker -# flags. -ac_save_FFLAGS=$FFLAGS -FFLAGS="$FFLAGS $ac_verb" -eval "set x $ac_link" -shift -$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 -# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, -# LIBRARY_PATH; skip all such settings. -ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | - grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="` -$as_echo "$ac_f77_v_output" >&5 -FFLAGS=$ac_save_FFLAGS - -rm -rf conftest* - -# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where -# /foo, /bar, and /baz are search directories for the Fortran linker. -# Here, we change these into -L/foo -L/bar -L/baz (and put it first): -ac_f77_v_output="`echo $ac_f77_v_output | - grep 'LPATH is:' | - sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output" - -# FIXME: we keep getting bitten by quoted arguments; a more general fix -# that detects unbalanced quotes in FLIBS should be implemented -# and (ugh) tested at some point. -case $ac_f77_v_output in - # If we are using xlf then replace all the commas with spaces. - *xlfentry*) - ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;; - - # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted - # $LIBS confuse us, and the libraries appear later in the output anyway). - *mGLOB_options_string*) - ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; - - # Portland Group compiler has singly- or doubly-quoted -cmdline argument - # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. - # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". - *-cmdline\ * | *-ignore\ * | *-def\ *) - ac_f77_v_output=`echo $ac_f77_v_output | sed "\ - s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g - s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g - s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; - - # If we are using Cray Fortran then delete quotes. - *cft90*) - ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;; -esac - - - # look for -l* and *.a constructs in the output - for ac_arg in $ac_f77_v_output; do - case $ac_arg in - [\\/]*.a | ?:[\\/]*.a | -[lLRu]*) - ac_cv_prog_f77_v=$ac_verb - break 2 ;; - esac - done -done -if test -z "$ac_cv_prog_f77_v"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $F77" >&5 -$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;} -fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 -$as_echo "$as_me: WARNING: compilation failed" >&2;} -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_v" >&5 -$as_echo "$ac_cv_prog_f77_v" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 libraries of $F77" >&5 -$as_echo_n "checking for Fortran 77 libraries of $F77... " >&6; } -if test "${ac_cv_f77_libs+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "x$FLIBS" != "x"; then - ac_cv_f77_libs="$FLIBS" # Let the user override the test. -else - -cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF - -# Compile and link our simple test program by passing a flag (argument -# 1 to this macro) to the Fortran compiler in order to get -# "verbose" output that we can then parse for the Fortran linker -# flags. -ac_save_FFLAGS=$FFLAGS -FFLAGS="$FFLAGS $ac_cv_prog_f77_v" -eval "set x $ac_link" -shift -$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 -# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, -# LIBRARY_PATH; skip all such settings. -ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | - grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="` -$as_echo "$ac_f77_v_output" >&5 -FFLAGS=$ac_save_FFLAGS - -rm -rf conftest* - -# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where -# /foo, /bar, and /baz are search directories for the Fortran linker. -# Here, we change these into -L/foo -L/bar -L/baz (and put it first): -ac_f77_v_output="`echo $ac_f77_v_output | - grep 'LPATH is:' | - sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output" - -# FIXME: we keep getting bitten by quoted arguments; a more general fix -# that detects unbalanced quotes in FLIBS should be implemented -# and (ugh) tested at some point. -case $ac_f77_v_output in - # If we are using xlf then replace all the commas with spaces. - *xlfentry*) - ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;; - - # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted - # $LIBS confuse us, and the libraries appear later in the output anyway). - *mGLOB_options_string*) - ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; - - # Portland Group compiler has singly- or doubly-quoted -cmdline argument - # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. - # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". - *-cmdline\ * | *-ignore\ * | *-def\ *) - ac_f77_v_output=`echo $ac_f77_v_output | sed "\ - s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g - s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g - s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; - - # If we are using Cray Fortran then delete quotes. - *cft90*) - ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;; -esac - - - -ac_cv_f77_libs= - -# Save positional arguments (if any) -ac_save_positional="$@" - -set X $ac_f77_v_output -while test $# != 1; do - shift - ac_arg=$1 - case $ac_arg in - [\\/]*.a | ?:[\\/]*.a) - ac_exists=false - for ac_i in $ac_cv_f77_libs; do - if test x"$ac_arg" = x"$ac_i"; then - ac_exists=true - break - fi - done - - if test x"$ac_exists" = xtrue; then : - -else - ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" -fi - ;; - -bI:*) - ac_exists=false - for ac_i in $ac_cv_f77_libs; do - if test x"$ac_arg" = x"$ac_i"; then - ac_exists=true - break - fi - done - - if test x"$ac_exists" = xtrue; then : - -else - if test "$ac_compiler_gnu" = yes; then - for ac_link_opt in $ac_arg; do - ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt" - done -else - ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" -fi -fi - ;; - # Ignore these flags. - -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \ - |-LANG:=* | -LIST:* | -LNO:* | -link) - ;; - -lkernel32) - test x"$CYGWIN" != xyes && ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" - ;; - -[LRuYz]) - # These flags, when seen by themselves, take an argument. - # We remove the space between option and argument and re-iterate - # unless we find an empty arg or a new option (starting with -) - case $2 in - "" | -*);; - *) - ac_arg="$ac_arg$2" - shift; shift - set X $ac_arg "$@" - ;; - esac - ;; - -YP,*) - for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do - ac_exists=false - for ac_i in $ac_cv_f77_libs; do - if test x"$ac_j" = x"$ac_i"; then - ac_exists=true - break - fi - done - - if test x"$ac_exists" = xtrue; then : - -else - ac_arg="$ac_arg $ac_j" - ac_cv_f77_libs="$ac_cv_f77_libs $ac_j" -fi - done - ;; - -[lLR]*) - ac_exists=false - for ac_i in $ac_cv_f77_libs; do - if test x"$ac_arg" = x"$ac_i"; then - ac_exists=true - break - fi - done - - if test x"$ac_exists" = xtrue; then : - -else - ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" -fi - ;; - -zallextract*| -zdefaultextract) - ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" - ;; - # Ignore everything else. - esac -done -# restore positional arguments -set X $ac_save_positional; shift - -# We only consider "LD_RUN_PATH" on Solaris systems. If this is seen, -# then we insist that the "run path" must be an absolute path (i.e. it -# must begin with a "/"). -case `(uname -sr) 2>/dev/null` in - "SunOS 5"*) - ac_ld_run_path=`$as_echo "$ac_f77_v_output" | - sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'` - test "x$ac_ld_run_path" != x && - if test "$ac_compiler_gnu" = yes; then - for ac_link_opt in $ac_ld_run_path; do - ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt" - done -else - ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path" -fi - ;; -esac -fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_libs" >&5 -$as_echo "$ac_cv_f77_libs" >&6; } -FLIBS="$ac_cv_f77_libs" - - -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 - -fcompiler=`basename $F77` - -{ $as_echo "$as_me:${as_lineno-$LINENO}: *** Fishing for modern Fortran compiler" >&5 -$as_echo "$as_me: *** Fishing for modern Fortran compiler" >&6;} -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in ifort ifc efc sunf95 gfortran pgf95 pathf95 g95 f90 - 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 test "${ac_cv_prog_FC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$FC"; then - ac_cv_prog_FC="$FC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_FC="$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 -FC=$ac_cv_prog_FC -if test -n "$FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 -$as_echo "$FC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$FC" && break - done -fi -if test -z "$FC"; then - ac_ct_FC=$FC - for ac_prog in ifort ifc efc sunf95 gfortran pgf95 pathf95 g95 f90 -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 test "${ac_cv_prog_ac_ct_FC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_FC"; then - ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_FC="$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_FC=$ac_cv_prog_ac_ct_FC -if test -n "$ac_ct_FC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 -$as_echo "$ac_ct_FC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_FC" && break -done - - if test "x$ac_ct_FC" = x; then - FC="" - 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 - FC=$ac_ct_FC - fi -fi - - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 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 -rm -f a.out - -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5 -$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; } -if test "${ac_cv_fc_compiler_gnu+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_ACEOF -if ac_fn_fc_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_fc_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 -$as_echo "$ac_cv_fc_compiler_gnu" >&6; } -ac_ext=$ac_save_ext -ac_test_FCFLAGS=${FCFLAGS+set} -ac_save_FCFLAGS=$FCFLAGS -FCFLAGS= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 -$as_echo_n "checking whether $FC accepts -g... " >&6; } -if test "${ac_cv_prog_fc_g+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - FCFLAGS=-g -cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : - ac_cv_prog_fc_g=yes -else - ac_cv_prog_fc_g=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 -$as_echo "$ac_cv_prog_fc_g" >&6; } -if test "$ac_test_FCFLAGS" = set; then - FCFLAGS=$ac_save_FCFLAGS -elif test $ac_cv_prog_fc_g = yes; then - if test "x$ac_cv_fc_compiler_gnu" = xyes; then - FCFLAGS="-g -O2" - else - FCFLAGS="-g" - fi -else - if test "x$ac_cv_fc_compiler_gnu" = xyes; then - FCFLAGS="-O2" - else - FCFLAGS= - 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 - -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $FC" >&5 -$as_echo_n "checking how to get verbose linking output from $FC... " >&6; } -if test "${ac_cv_prog_fc_v+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : - ac_cv_prog_fc_v= -# Try some options frequently used verbose output -for ac_verb in -v -verbose --verbose -V -\#\#\#; do - cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF - -# Compile and link our simple test program by passing a flag (argument -# 1 to this macro) to the Fortran compiler in order to get -# "verbose" output that we can then parse for the Fortran linker -# flags. -ac_save_FCFLAGS=$FCFLAGS -FCFLAGS="$FCFLAGS $ac_verb" -eval "set x $ac_link" -shift -$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 -# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, -# LIBRARY_PATH; skip all such settings. -ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | - grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="` -$as_echo "$ac_fc_v_output" >&5 -FCFLAGS=$ac_save_FCFLAGS - -rm -rf conftest* - -# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where -# /foo, /bar, and /baz are search directories for the Fortran linker. -# Here, we change these into -L/foo -L/bar -L/baz (and put it first): -ac_fc_v_output="`echo $ac_fc_v_output | - grep 'LPATH is:' | - sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output" - -# FIXME: we keep getting bitten by quoted arguments; a more general fix -# that detects unbalanced quotes in FLIBS should be implemented -# and (ugh) tested at some point. -case $ac_fc_v_output in - # If we are using xlf then replace all the commas with spaces. - *xlfentry*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/,/ /g'` ;; - - # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted - # $LIBS confuse us, and the libraries appear later in the output anyway). - *mGLOB_options_string*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; - - # Portland Group compiler has singly- or doubly-quoted -cmdline argument - # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. - # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". - *-cmdline\ * | *-ignore\ * | *-def\ *) - ac_fc_v_output=`echo $ac_fc_v_output | sed "\ - s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g - s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g - s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; - - # If we are using Cray Fortran then delete quotes. - *cft90*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;; -esac - - - # look for -l* and *.a constructs in the output - for ac_arg in $ac_fc_v_output; do - case $ac_arg in - [\\/]*.a | ?:[\\/]*.a | -[lLRu]*) - ac_cv_prog_fc_v=$ac_verb - break 2 ;; - esac - done -done -if test -z "$ac_cv_prog_fc_v"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $FC" >&5 -$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $FC" >&2;} -fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 -$as_echo "$as_me: WARNING: compilation failed" >&2;} -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_v" >&5 -$as_echo "$ac_cv_prog_fc_v" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran libraries of $FC" >&5 -$as_echo_n "checking for Fortran libraries of $FC... " >&6; } -if test "${ac_cv_fc_libs+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "x$FCLIBS" != "x"; then - ac_cv_fc_libs="$FCLIBS" # Let the user override the test. -else - -cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF - -# Compile and link our simple test program by passing a flag (argument -# 1 to this macro) to the Fortran compiler in order to get -# "verbose" output that we can then parse for the Fortran linker -# flags. -ac_save_FCFLAGS=$FCFLAGS -FCFLAGS="$FCFLAGS $ac_cv_prog_fc_v" -eval "set x $ac_link" -shift -$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 -# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, -# LIBRARY_PATH; skip all such settings. -ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | - grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="` -$as_echo "$ac_fc_v_output" >&5 -FCFLAGS=$ac_save_FCFLAGS - -rm -rf conftest* - -# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where -# /foo, /bar, and /baz are search directories for the Fortran linker. -# Here, we change these into -L/foo -L/bar -L/baz (and put it first): -ac_fc_v_output="`echo $ac_fc_v_output | - grep 'LPATH is:' | - sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output" - -# FIXME: we keep getting bitten by quoted arguments; a more general fix -# that detects unbalanced quotes in FLIBS should be implemented -# and (ugh) tested at some point. -case $ac_fc_v_output in - # If we are using xlf then replace all the commas with spaces. - *xlfentry*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/,/ /g'` ;; - - # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted - # $LIBS confuse us, and the libraries appear later in the output anyway). - *mGLOB_options_string*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; - - # Portland Group compiler has singly- or doubly-quoted -cmdline argument - # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. - # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". - *-cmdline\ * | *-ignore\ * | *-def\ *) - ac_fc_v_output=`echo $ac_fc_v_output | sed "\ - s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g - s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g - s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; - - # If we are using Cray Fortran then delete quotes. - *cft90*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;; -esac - - - -ac_cv_fc_libs= - -# Save positional arguments (if any) -ac_save_positional="$@" - -set X $ac_fc_v_output -while test $# != 1; do - shift - ac_arg=$1 - case $ac_arg in - [\\/]*.a | ?:[\\/]*.a) - ac_exists=false - for ac_i in $ac_cv_fc_libs; do - if test x"$ac_arg" = x"$ac_i"; then - ac_exists=true - break - fi - done - - if test x"$ac_exists" = xtrue; then : - -else - ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" -fi - ;; - -bI:*) - ac_exists=false - for ac_i in $ac_cv_fc_libs; do - if test x"$ac_arg" = x"$ac_i"; then - ac_exists=true - break - fi - done - - if test x"$ac_exists" = xtrue; then : - -else - if test "$ac_compiler_gnu" = yes; then - for ac_link_opt in $ac_arg; do - ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt" - done -else - ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" -fi -fi - ;; - # Ignore these flags. - -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \ - |-LANG:=* | -LIST:* | -LNO:* | -link) - ;; - -lkernel32) - test x"$CYGWIN" != xyes && ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" - ;; - -[LRuYz]) - # These flags, when seen by themselves, take an argument. - # We remove the space between option and argument and re-iterate - # unless we find an empty arg or a new option (starting with -) - case $2 in - "" | -*);; - *) - ac_arg="$ac_arg$2" - shift; shift - set X $ac_arg "$@" - ;; - esac - ;; - -YP,*) - for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do - ac_exists=false - for ac_i in $ac_cv_fc_libs; do - if test x"$ac_j" = x"$ac_i"; then - ac_exists=true - break - fi - done - - if test x"$ac_exists" = xtrue; then : - -else - ac_arg="$ac_arg $ac_j" - ac_cv_fc_libs="$ac_cv_fc_libs $ac_j" -fi - done - ;; - -[lLR]*) - ac_exists=false - for ac_i in $ac_cv_fc_libs; do - if test x"$ac_arg" = x"$ac_i"; then - ac_exists=true - break - fi - done - - if test x"$ac_exists" = xtrue; then : - -else - ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" -fi - ;; - -zallextract*| -zdefaultextract) - ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" - ;; - # Ignore everything else. - esac -done -# restore positional arguments -set X $ac_save_positional; shift - -# We only consider "LD_RUN_PATH" on Solaris systems. If this is seen, -# then we insist that the "run path" must be an absolute path (i.e. it -# must begin with a "/"). -case `(uname -sr) 2>/dev/null` in - "SunOS 5"*) - ac_ld_run_path=`$as_echo "$ac_fc_v_output" | - sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'` - test "x$ac_ld_run_path" != x && - if test "$ac_compiler_gnu" = yes; then - for ac_link_opt in $ac_ld_run_path; do - ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt" - done -else - ac_cv_fc_libs="$ac_cv_fc_libs $ac_ld_run_path" -fi - ;; -esac -fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_libs" >&5 -$as_echo "$ac_cv_fc_libs" >&6; } -FCLIBS="$ac_cv_fc_libs" - - -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 - -fccompiler=`basename $FC` - -if test "$fcompiler" = "sunf95" ; then - MODINC_FLAG="-M" - FFLAGS="-M../include $FFLAGS" - FCFLAGS="-M../include $FCFLAGS" -else - MODINC_FLAG="-I" -fi - -if test "$F77" = "$FC" ; then - smart_fortran="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: *** Assuming that $FC can process both free and fixed form fortran files." >&5 -$as_echo "$as_me: *** Assuming that $FC can process both free and fixed form fortran files." >&6;} -else - { $as_echo "$as_me:${as_lineno-$LINENO}: *** Assuming that $FC cannot process both free and fixed form fortran files (silly fortran)." >&5 -$as_echo "$as_me: *** Assuming that $FC cannot process both free and fixed form fortran files (silly fortran)." >&6;} - smart_fortran="no" -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in icpc icc ecc sunCC pgCC g++ CC - 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 test "${ac_cv_prog_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in icpc icc ecc sunCC pgCC g++ CC -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 test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; 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 test "${ac_cv_prog_cxx_g+set}" = set; 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 - -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 test "${ac_cv_prog_CPP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat 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 - -LINKER=$CXX - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long int" >&5 -$as_echo_n "checking size of long int... " >&6; } -if test "${ac_cv_sizeof_long_int+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long int))" "ac_cv_sizeof_long_int" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_long_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long int) -See \`config.log' for more details" "$LINENO" 5 ; } - else - ac_cv_sizeof_long_int=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_int" >&5 -$as_echo "$ac_cv_sizeof_long_int" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_INT $ac_cv_sizeof_long_int -_ACEOF - - -test $ac_cv_sizeof_long_int = 8 && - -$as_echo "#define LONG_64_BITS 1" >>confdefs.h - - - -# Find fortran libraries required when linking with C++ main. -ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $FC" >&5 -$as_echo_n "checking how to get verbose linking output from $FC... " >&6; } -if test "${ac_cv_prog_fc_v+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : - ac_cv_prog_fc_v= -# Try some options frequently used verbose output -for ac_verb in -v -verbose --verbose -V -\#\#\#; do - cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF - -# Compile and link our simple test program by passing a flag (argument -# 1 to this macro) to the Fortran compiler in order to get -# "verbose" output that we can then parse for the Fortran linker -# flags. -ac_save_FCFLAGS=$FCFLAGS -FCFLAGS="$FCFLAGS $ac_verb" -eval "set x $ac_link" -shift -$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 -# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, -# LIBRARY_PATH; skip all such settings. -ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | - grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="` -$as_echo "$ac_fc_v_output" >&5 -FCFLAGS=$ac_save_FCFLAGS - -rm -rf conftest* - -# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where -# /foo, /bar, and /baz are search directories for the Fortran linker. -# Here, we change these into -L/foo -L/bar -L/baz (and put it first): -ac_fc_v_output="`echo $ac_fc_v_output | - grep 'LPATH is:' | - sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output" - -# FIXME: we keep getting bitten by quoted arguments; a more general fix -# that detects unbalanced quotes in FLIBS should be implemented -# and (ugh) tested at some point. -case $ac_fc_v_output in - # If we are using xlf then replace all the commas with spaces. - *xlfentry*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/,/ /g'` ;; - - # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted - # $LIBS confuse us, and the libraries appear later in the output anyway). - *mGLOB_options_string*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; - - # Portland Group compiler has singly- or doubly-quoted -cmdline argument - # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. - # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". - *-cmdline\ * | *-ignore\ * | *-def\ *) - ac_fc_v_output=`echo $ac_fc_v_output | sed "\ - s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g - s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g - s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; - - # If we are using Cray Fortran then delete quotes. - *cft90*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;; -esac - - - # look for -l* and *.a constructs in the output - for ac_arg in $ac_fc_v_output; do - case $ac_arg in - [\\/]*.a | ?:[\\/]*.a | -[lLRu]*) - ac_cv_prog_fc_v=$ac_verb - break 2 ;; - esac - done -done -if test -z "$ac_cv_prog_fc_v"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $FC" >&5 -$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $FC" >&2;} -fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 -$as_echo "$as_me: WARNING: compilation failed" >&2;} -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_v" >&5 -$as_echo "$ac_cv_prog_fc_v" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran libraries of $FC" >&5 -$as_echo_n "checking for Fortran libraries of $FC... " >&6; } -if test "${ac_cv_fc_libs+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "x$FCLIBS" != "x"; then - ac_cv_fc_libs="$FCLIBS" # Let the user override the test. -else - -cat > conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF - -# Compile and link our simple test program by passing a flag (argument -# 1 to this macro) to the Fortran compiler in order to get -# "verbose" output that we can then parse for the Fortran linker -# flags. -ac_save_FCFLAGS=$FCFLAGS -FCFLAGS="$FCFLAGS $ac_cv_prog_fc_v" -eval "set x $ac_link" -shift -$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 -# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, -# LIBRARY_PATH; skip all such settings. -ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | - grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="` -$as_echo "$ac_fc_v_output" >&5 -FCFLAGS=$ac_save_FCFLAGS - -rm -rf conftest* - -# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where -# /foo, /bar, and /baz are search directories for the Fortran linker. -# Here, we change these into -L/foo -L/bar -L/baz (and put it first): -ac_fc_v_output="`echo $ac_fc_v_output | - grep 'LPATH is:' | - sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output" - -# FIXME: we keep getting bitten by quoted arguments; a more general fix -# that detects unbalanced quotes in FLIBS should be implemented -# and (ugh) tested at some point. -case $ac_fc_v_output in - # If we are using xlf then replace all the commas with spaces. - *xlfentry*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/,/ /g'` ;; - - # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted - # $LIBS confuse us, and the libraries appear later in the output anyway). - *mGLOB_options_string*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; - - # Portland Group compiler has singly- or doubly-quoted -cmdline argument - # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. - # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". - *-cmdline\ * | *-ignore\ * | *-def\ *) - ac_fc_v_output=`echo $ac_fc_v_output | sed "\ - s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g - s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g - s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; - - # If we are using Cray Fortran then delete quotes. - *cft90*) - ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;; -esac - - - -ac_cv_fc_libs= - -# Save positional arguments (if any) -ac_save_positional="$@" - -set X $ac_fc_v_output -while test $# != 1; do - shift - ac_arg=$1 - case $ac_arg in - [\\/]*.a | ?:[\\/]*.a) - ac_exists=false - for ac_i in $ac_cv_fc_libs; do - if test x"$ac_arg" = x"$ac_i"; then - ac_exists=true - break - fi - done - - if test x"$ac_exists" = xtrue; then : - -else - ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" -fi - ;; - -bI:*) - ac_exists=false - for ac_i in $ac_cv_fc_libs; do - if test x"$ac_arg" = x"$ac_i"; then - ac_exists=true - break - fi - done - - if test x"$ac_exists" = xtrue; then : - -else - if test "$ac_compiler_gnu" = yes; then - for ac_link_opt in $ac_arg; do - ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt" - done -else - ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" -fi -fi - ;; - # Ignore these flags. - -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \ - |-LANG:=* | -LIST:* | -LNO:* | -link) - ;; - -lkernel32) - test x"$CYGWIN" != xyes && ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" - ;; - -[LRuYz]) - # These flags, when seen by themselves, take an argument. - # We remove the space between option and argument and re-iterate - # unless we find an empty arg or a new option (starting with -) - case $2 in - "" | -*);; - *) - ac_arg="$ac_arg$2" - shift; shift - set X $ac_arg "$@" - ;; - esac - ;; - -YP,*) - for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do - ac_exists=false - for ac_i in $ac_cv_fc_libs; do - if test x"$ac_j" = x"$ac_i"; then - ac_exists=true - break - fi - done - - if test x"$ac_exists" = xtrue; then : - -else - ac_arg="$ac_arg $ac_j" - ac_cv_fc_libs="$ac_cv_fc_libs $ac_j" -fi - done - ;; - -[lLR]*) - ac_exists=false - for ac_i in $ac_cv_fc_libs; do - if test x"$ac_arg" = x"$ac_i"; then - ac_exists=true - break - fi - done - - if test x"$ac_exists" = xtrue; then : - -else - ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" -fi - ;; - -zallextract*| -zdefaultextract) - ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" - ;; - # Ignore everything else. - esac -done -# restore positional arguments -set X $ac_save_positional; shift - -# We only consider "LD_RUN_PATH" on Solaris systems. If this is seen, -# then we insist that the "run path" must be an absolute path (i.e. it -# must begin with a "/"). -case `(uname -sr) 2>/dev/null` in - "SunOS 5"*) - ac_ld_run_path=`$as_echo "$ac_fc_v_output" | - sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'` - test "x$ac_ld_run_path" != x && - if test "$ac_compiler_gnu" = yes; then - for ac_link_opt in $ac_ld_run_path; do - ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt" - done -else - ac_cv_fc_libs="$ac_cv_fc_libs $ac_ld_run_path" -fi - ;; -esac -fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_libs" >&5 -$as_echo "$ac_cv_fc_libs" >&6; } -FCLIBS="$ac_cv_fc_libs" - - -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=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dummy main to link with Fortran 77 libraries" >&5 -$as_echo_n "checking for dummy main to link with Fortran 77 libraries... " >&6; } -if test "${ac_cv_f77_dummy_main+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_f77_dm_save_LIBS=$LIBS - LIBS="$LIBS $FLIBS" - ac_fortran_dm_var=F77_DUMMY_MAIN - 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 - - # First, try linking without a dummy main: - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef F77_DUMMY_MAIN - -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } - -#endif -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_fortran_dummy_main=none -else - ac_cv_fortran_dummy_main=unknown -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - if test $ac_cv_fortran_dummy_main = unknown; then - for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define $ac_fortran_dm_var $ac_func -#ifdef F77_DUMMY_MAIN - -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } - -#endif -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_fortran_dummy_main=$ac_func; break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done - fi - ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - ac_cv_f77_dummy_main=$ac_cv_fortran_dummy_main - rm -rf conftest* - LIBS=$ac_f77_dm_save_LIBS - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_dummy_main" >&5 -$as_echo "$ac_cv_f77_dummy_main" >&6; } -F77_DUMMY_MAIN=$ac_cv_f77_dummy_main -if test "$F77_DUMMY_MAIN" != unknown; then : - if test $F77_DUMMY_MAIN != none; then - -cat >>confdefs.h <<_ACEOF -#define F77_DUMMY_MAIN $F77_DUMMY_MAIN -_ACEOF - - if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then - -$as_echo "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h - - fi -fi -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "linking to Fortran libraries from C fails -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 - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 name-mangling scheme" >&5 -$as_echo_n "checking for Fortran 77 name-mangling scheme... " >&6; } -if test "${ac_cv_f77_mangling+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.$ac_ext <<_ACEOF - subroutine foobar() - return - end - subroutine foo_bar() - return - end -_ACEOF -if ac_fn_f77_try_compile "$LINENO"; then : - mv conftest.$ac_objext cfortran_test.$ac_objext - - ac_save_LIBS=$LIBS - LIBS="cfortran_test.$ac_objext $LIBS $FLIBS" - - 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_success=no - for ac_foobar in foobar FOOBAR; do - for ac_underscore in "" "_"; do - ac_func="$ac_foobar$ac_underscore" - 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 $ac_func (); -#ifdef F77_DUMMY_MAIN - -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } - -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_success=yes; break 2 -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done - done - ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - - if test "$ac_success" = "yes"; then - case $ac_foobar in - foobar) - ac_case=lower - ac_foo_bar=foo_bar - ;; - FOOBAR) - ac_case=upper - ac_foo_bar=FOO_BAR - ;; - 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 - ac_success_extra=no - for ac_extra in "" "_"; do - ac_func="$ac_foo_bar$ac_underscore$ac_extra" - 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 $ac_func (); -#ifdef F77_DUMMY_MAIN - -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } - -#endif -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_success_extra=yes; break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done - ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - - if test "$ac_success_extra" = "yes"; then - ac_cv_f77_mangling="$ac_case case" - if test -z "$ac_underscore"; then - ac_cv_f77_mangling="$ac_cv_f77_mangling, no underscore" - else - ac_cv_f77_mangling="$ac_cv_f77_mangling, underscore" - fi - if test -z "$ac_extra"; then - ac_cv_f77_mangling="$ac_cv_f77_mangling, no extra underscore" - else - ac_cv_f77_mangling="$ac_cv_f77_mangling, extra underscore" - fi - else - ac_cv_f77_mangling="unknown" - fi - else - ac_cv_f77_mangling="unknown" - fi - - LIBS=$ac_save_LIBS - rm -rf conftest* - rm -f cfortran_test* -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 compile a simple Fortran program -See \`config.log' for more details" "$LINENO" 5 ; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_mangling" >&5 -$as_echo "$ac_cv_f77_mangling" >&6; } - -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=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -case $ac_cv_f77_mangling in - "lower case, no underscore, no extra underscore") - $as_echo "#define F77_FUNC(name,NAME) name" >>confdefs.h - - $as_echo "#define F77_FUNC_(name,NAME) name" >>confdefs.h - ;; - "lower case, no underscore, extra underscore") - $as_echo "#define F77_FUNC(name,NAME) name" >>confdefs.h - - $as_echo "#define F77_FUNC_(name,NAME) name ## _" >>confdefs.h - ;; - "lower case, underscore, no extra underscore") - $as_echo "#define F77_FUNC(name,NAME) name ## _" >>confdefs.h - - $as_echo "#define F77_FUNC_(name,NAME) name ## _" >>confdefs.h - ;; - "lower case, underscore, extra underscore") - $as_echo "#define F77_FUNC(name,NAME) name ## _" >>confdefs.h - - $as_echo "#define F77_FUNC_(name,NAME) name ## __" >>confdefs.h - ;; - "upper case, no underscore, no extra underscore") - $as_echo "#define F77_FUNC(name,NAME) NAME" >>confdefs.h - - $as_echo "#define F77_FUNC_(name,NAME) NAME" >>confdefs.h - ;; - "upper case, no underscore, extra underscore") - $as_echo "#define F77_FUNC(name,NAME) NAME" >>confdefs.h - - $as_echo "#define F77_FUNC_(name,NAME) NAME ## _" >>confdefs.h - ;; - "upper case, underscore, no extra underscore") - $as_echo "#define F77_FUNC(name,NAME) NAME ## _" >>confdefs.h - - $as_echo "#define F77_FUNC_(name,NAME) NAME ## _" >>confdefs.h - ;; - "upper case, underscore, extra underscore") - $as_echo "#define F77_FUNC(name,NAME) NAME ## _" >>confdefs.h - - $as_echo "#define F77_FUNC_(name,NAME) NAME ## __" >>confdefs.h - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown Fortran name-mangling scheme" >&5 -$as_echo "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;} - ;; -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 - - -# Check for standard libraries -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 main in -lstdc++" >&5 -$as_echo_n "checking for main in -lstdc++... " >&6; } -if test "${ac_cv_lib_stdcpp_main+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lstdc++ $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef F77_DUMMY_MAIN - -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } - -#endif -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_stdcpp_main=yes -else - ac_cv_lib_stdcpp_main=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_stdcpp_main" >&5 -$as_echo "$ac_cv_lib_stdcpp_main" >&6; } -if test "x$ac_cv_lib_stdcpp_main" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSTDC__ 1 -_ACEOF - - LIBS="-lstdc++ $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5 -$as_echo_n "checking for main in -lm... " >&6; } -if test "${ac_cv_lib_m_main+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef F77_DUMMY_MAIN - -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } - -#endif -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_main=yes -else - ac_cv_lib_m_main=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5 -$as_echo "$ac_cv_lib_m_main" >&6; } -if test "x$ac_cv_lib_m_main" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF - - LIBS="-lm $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5 -$as_echo_n "checking for main in -lpthread... " >&6; } -if test "${ac_cv_lib_pthread_main+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef F77_DUMMY_MAIN - -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } - -#endif -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pthread_main=yes -else - ac_cv_lib_pthread_main=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_pthread_main" >&5 -$as_echo "$ac_cv_lib_pthread_main" >&6; } -if test "x$ac_cv_lib_pthread_main" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPTHREAD 1 -_ACEOF - - LIBS="-lpthread $LIBS" - -fi - - -LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FCLIBS $FLIBS" - -LINKER=$CXX - -## -## what compiler options work -## -if test "$FC" = "g95"; then - FCFLAGS="-ffast-math -fno-second-underscore $FCFLAGS" -fi - -if test "$FC" = "gfortran"; then - if test "$enable_debugging" = "yes" ; then - FCFLAGS="-frecord-marker=4 $FCFLAGS" - else - FCFLAGS="-ffast-math -frecord-marker=4 $FCFLAGS" - fi - CPPFLAGS="$CPPFLAGS -DUSING_GFORTRAN=1" -fi - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how do we get fortran 77 to allow long lines" >&5 -$as_echo_n "checking how do we get fortran 77 to allow long lines... " >&6; } -old_FLAGS="$FFLAGS" -extended_source_flag=none -cat > conftest.$ac_ext <<_ACEOF - program main - - PRINT*, "hello world " - end -_ACEOF -if ac_fn_f77_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no extra flags required" >&5 -$as_echo "no extra flags required" >&6; } - extended_source_flag=happy - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test "$extended_source_flag" != happy ; then -if test "$extended_source_flag" = none ; then - FFLAGS="-extend_source" - cat > conftest.$ac_ext <<_ACEOF - program main - - PRINT*, "hello world " - end -_ACEOF -if ac_fn_f77_try_compile "$LINENO"; then : - - extended_source_flag=$FFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FFLAGS" >&5 -$as_echo "$FFLAGS" >&6; } - FFLAGS="$old_FLAGS $FFLAGS" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-132" - cat > conftest.$ac_ext <<_ACEOF - program main - - PRINT*, "hello world " - end -_ACEOF -if ac_fn_f77_try_compile "$LINENO"; then : - - extended_source_flag=$FFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FFLAGS" >&5 -$as_echo "$FFLAGS" >&6; } - FFLAGS="$old_FLAGS $FFLAGS" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-ffree-line-length-none -ffixed-line-length-none" - cat > conftest.$ac_ext <<_ACEOF - program main - - PRINT*, "hello world " - end -_ACEOF -if ac_fn_f77_try_compile "$LINENO"; then : - - extended_source_flag=$FFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FFLAGS" >&5 -$as_echo "$FFLAGS" >&6; } - FFLAGS="$old_FLAGS $FFLAGS" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-ffixed-line-length-huge -ffree-line-length-huge" - cat > conftest.$ac_ext <<_ACEOF - program main - - PRINT*, "hello world " - end -_ACEOF -if ac_fn_f77_try_compile "$LINENO"; then : - - extended_source_flag=$FFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FFLAGS" >&5 -$as_echo "$FFLAGS" >&6; } - FFLAGS="$old_FLAGS $FFLAGS" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-ffixed-line-length-132 -ffree-line-length-huge" - cat > conftest.$ac_ext <<_ACEOF - program main - - PRINT*, "hello world " - end -_ACEOF -if ac_fn_f77_try_compile "$LINENO"; then : - - extended_source_flag=$FFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FFLAGS" >&5 -$as_echo "$FFLAGS" >&6; } - FFLAGS="$old_FLAGS $FFLAGS" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-ffixed-line-length-132" - cat > conftest.$ac_ext <<_ACEOF - program main - - PRINT*, "hello world " - end -_ACEOF -if ac_fn_f77_try_compile "$LINENO"; then : - - extended_source_flag=$FFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FFLAGS" >&5 -$as_echo "$FFLAGS" >&6; } - FFLAGS="$old_FLAGS $FFLAGS" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-Mextend" - cat > conftest.$ac_ext <<_ACEOF - program main - - PRINT*, "hello world " - end -_ACEOF -if ac_fn_f77_try_compile "$LINENO"; then : - - extended_source_flag=$FFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FFLAGS" >&5 -$as_echo "$FFLAGS" >&6; } - FFLAGS="$old_FLAGS $FFLAGS" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-qfixed=256" - cat > conftest.$ac_ext <<_ACEOF - program main - - PRINT*, "hello world " - end -_ACEOF -if ac_fn_f77_try_compile "$LINENO"; then : - - extended_source_flag=$FFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FFLAGS" >&5 -$as_echo "$FFLAGS" >&6; } - FFLAGS="$old_FLAGS $FFLAGS" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-e" - cat > conftest.$ac_ext <<_ACEOF - program main - - PRINT*, "hello world " - end -_ACEOF -if ac_fn_f77_try_compile "$LINENO"; then : - - extended_source_flag=$FFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FFLAGS" >&5 -$as_echo "$FFLAGS" >&6; } - FFLAGS="$old_FLAGS $FFLAGS" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -if test "$extended_source_flag" = none ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: we cannot" >&5 -$as_echo "we cannot" >&6; } -else - FCFLAGS="$FCFLAGS $extended_source_flag" -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 - - -# 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 test "${ac_cv_path_install+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${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' - -# Extract the first word of "gmake", so it can be a program name with args. -set dummy gmake; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_MAKE+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MAKE"; then - ac_cv_prog_MAKE="$MAKE" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MAKE="gmake" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_MAKE" && ac_cv_prog_MAKE="make" -fi -fi -MAKE=$ac_cv_prog_MAKE -if test -n "$MAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 -$as_echo "$MAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - -# Set default for ARFLAGS, since autoconf does not have a macro for -# it. This allows people to set it when running configure or make. -# Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="ar" - $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 "$ARFLAGS" || ARFLAGS="cr" -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 test "${ac_cv_prog_RANLIB+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${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 - - -# Check whether --enable-verbose was given. -if test "${enable_verbose+set}" = set; then : - enableval=$enable_verbose; -fi - - -if test "$enable_verbose" = "yes" ; then - CPPFLAGS="$CPPFLAGS -DVERBOSE_MESSAGES=1" -fi - -if test "$enable_debugging" = "yes" ; then - CXXFLAGS="-g -O0 `echo $CXXFLAGS | sed 's/-O2//g'`" - FCFLAGS="-g -O0 `echo $FCFLAGS | sed 's/-O2//g'`" - - if test "$fcompiler" = "ifort" ; then - FCFLAGS="-C -traceback -check nooutput_conversion -check noarg_temp_created ${FCFLAGS}" - CXXFLAGS="-fno-omit-frame-pointer ${CXXFLAGS}" - elif test "$fcompiler" = "gfortran" ; then - FCFLAGS="-fbounds-check -Wall ${FCFLAGS}" - CXXFLAGS="-fbounds-check -Wall ${CXXFLAGS}" - LDFLAGS="-rdynamic ${LDFLAGS}" - elif test "$fcompiler" = "g95" ; then - FCFLAGS="-fbounds-check -ftrace=full ${FCFLAGS}" - elif test "$fcompiler" = "sunf95" ; then - FCFLAGS="-C -ftrap=invalid -fpover ${FCFLAGS}" - CXXFLAGS="-ftrap=invalid ${CXXFLAGS}" - else - FCFLAGS="-C ${FCFLAGS}" - fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting optimisation flags" >&5 -$as_echo "$as_me: Setting optimisation flags" >&6;} - CPPFLAGS="$CPPFLAGS -DNDEBUG=1" - FCFLAGS="-O3 `echo $FCFLAGS | sed 's/-g -O2//g'`" - CXXFLAGS="-O3 `echo $CXXFLAGS | sed 's/-g -O2//g'`" -fi - -if test "$FC" = "ifc" ; then - FCFLAGS="-implicitnone -w95 $FCFLAGS" -fi - -############################################################## -# enable gprof profiling - -# Check whether --enable-profiling was given. -if test "${enable_profiling+set}" = set; then : - enableval=$enable_profiling; -fi - - -if test "$enable_profiling" = "yes" ; then - PROFILING_FLAG="-pg" - CPPFLAGS="-pg $CPPFLAGS" - FCFLAGS="-pg $FCFLAGS" - - LINKER="$LINKER -pg" -else - PROFILING_FLAG="" -fi - - - - - - - -ac_config_files="$ac_config_files Makefile src/tests/Makefile examples/Makefile bin/spud-preprocess diamond/setup.py diamond/diamond/plugins.py diamond/diamond/preprocess.py" - -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 - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - 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}' - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -ac_script=' -:mline -/\\$/{ - N - s,\\\n,, - b mline -} -t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g -t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g -t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.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 - - - -: ${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. -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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# 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 - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## 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 $as_me, which was -generated by GNU Autoconf 2.67. 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 - - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -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 - -Configuration files: -$config_files - -Configuration commands: -$config_commands - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.67, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2010 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -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;; - --he | --h | --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 -# - - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' -SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' -ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' -lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' -file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' -want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' -sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' -AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' -GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' -lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' -objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' -finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' -predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' -postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' -predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' -postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' -LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' -LD_FC='`$ECHO "$LD_FC" | $SED "$delay_single_quote_subst"`' -LD_F77='`$ECHO "$LD_F77" | $SED "$delay_single_quote_subst"`' -reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' -reload_flag_FC='`$ECHO "$reload_flag_FC" | $SED "$delay_single_quote_subst"`' -reload_flag_F77='`$ECHO "$reload_flag_F77" | $SED "$delay_single_quote_subst"`' -reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' -reload_cmds_FC='`$ECHO "$reload_cmds_FC" | $SED "$delay_single_quote_subst"`' -reload_cmds_F77='`$ECHO "$reload_cmds_F77" | $SED "$delay_single_quote_subst"`' -old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_cmds_FC='`$ECHO "$old_archive_cmds_FC" | $SED "$delay_single_quote_subst"`' -old_archive_cmds_F77='`$ECHO "$old_archive_cmds_F77" | $SED "$delay_single_quote_subst"`' -compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' -compiler_FC='`$ECHO "$compiler_FC" | $SED "$delay_single_quote_subst"`' -compiler_F77='`$ECHO "$compiler_F77" | $SED "$delay_single_quote_subst"`' -GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' -GCC_FC='`$ECHO "$GCC_FC" | $SED "$delay_single_quote_subst"`' -GCC_F77='`$ECHO "$GCC_F77" | $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_no_builtin_flag_FC='`$ECHO "$lt_prog_compiler_no_builtin_flag_FC" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag_F77='`$ECHO "$lt_prog_compiler_no_builtin_flag_F77" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic_FC='`$ECHO "$lt_prog_compiler_pic_FC" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic_F77='`$ECHO "$lt_prog_compiler_pic_F77" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl_FC='`$ECHO "$lt_prog_compiler_wl_FC" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl_F77='`$ECHO "$lt_prog_compiler_wl_F77" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static_FC='`$ECHO "$lt_prog_compiler_static_FC" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static_F77='`$ECHO "$lt_prog_compiler_static_F77" | $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"`' -lt_cv_prog_compiler_c_o_FC='`$ECHO "$lt_cv_prog_compiler_c_o_FC" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o_F77='`$ECHO "$lt_cv_prog_compiler_c_o_F77" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc_FC='`$ECHO "$archive_cmds_need_lc_FC" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc_F77='`$ECHO "$archive_cmds_need_lc_F77" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes_FC='`$ECHO "$enable_shared_with_static_runtimes_FC" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes_F77='`$ECHO "$enable_shared_with_static_runtimes_F77" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec_FC='`$ECHO "$export_dynamic_flag_spec_FC" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec_F77='`$ECHO "$export_dynamic_flag_spec_F77" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec_FC='`$ECHO "$whole_archive_flag_spec_FC" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec_F77='`$ECHO "$whole_archive_flag_spec_F77" | $SED "$delay_single_quote_subst"`' -compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' -compiler_needs_object_FC='`$ECHO "$compiler_needs_object_FC" | $SED "$delay_single_quote_subst"`' -compiler_needs_object_F77='`$ECHO "$compiler_needs_object_F77" | $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_new_cmds_FC='`$ECHO "$old_archive_from_new_cmds_FC" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds_F77='`$ECHO "$old_archive_from_new_cmds_F77" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds_FC='`$ECHO "$old_archive_from_expsyms_cmds_FC" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds_F77='`$ECHO "$old_archive_from_expsyms_cmds_F77" | $SED "$delay_single_quote_subst"`' -archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' -archive_cmds_FC='`$ECHO "$archive_cmds_FC" | $SED "$delay_single_quote_subst"`' -archive_cmds_F77='`$ECHO "$archive_cmds_F77" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds_FC='`$ECHO "$archive_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds_F77='`$ECHO "$archive_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`' -module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' -module_cmds_FC='`$ECHO "$module_cmds_FC" | $SED "$delay_single_quote_subst"`' -module_cmds_F77='`$ECHO "$module_cmds_F77" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds_FC='`$ECHO "$module_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds_F77='`$ECHO "$module_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`' -with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' -with_gnu_ld_FC='`$ECHO "$with_gnu_ld_FC" | $SED "$delay_single_quote_subst"`' -with_gnu_ld_F77='`$ECHO "$with_gnu_ld_F77" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag_FC='`$ECHO "$allow_undefined_flag_FC" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag_F77='`$ECHO "$allow_undefined_flag_F77" | $SED "$delay_single_quote_subst"`' -no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' -no_undefined_flag_FC='`$ECHO "$no_undefined_flag_FC" | $SED "$delay_single_quote_subst"`' -no_undefined_flag_F77='`$ECHO "$no_undefined_flag_F77" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_FC='`$ECHO "$hardcode_libdir_flag_spec_FC" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_F77='`$ECHO "$hardcode_libdir_flag_spec_F77" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld_FC='`$ECHO "$hardcode_libdir_flag_spec_ld_FC" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld_F77='`$ECHO "$hardcode_libdir_flag_spec_ld_F77" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator_FC='`$ECHO "$hardcode_libdir_separator_FC" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator_F77='`$ECHO "$hardcode_libdir_separator_F77" | $SED "$delay_single_quote_subst"`' -hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_direct_FC='`$ECHO "$hardcode_direct_FC" | $SED "$delay_single_quote_subst"`' -hardcode_direct_F77='`$ECHO "$hardcode_direct_F77" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute_FC='`$ECHO "$hardcode_direct_absolute_FC" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute_F77='`$ECHO "$hardcode_direct_absolute_F77" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L_FC='`$ECHO "$hardcode_minus_L_FC" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L_F77='`$ECHO "$hardcode_minus_L_F77" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var_FC='`$ECHO "$hardcode_shlibpath_var_FC" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var_F77='`$ECHO "$hardcode_shlibpath_var_F77" | $SED "$delay_single_quote_subst"`' -hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_automatic_FC='`$ECHO "$hardcode_automatic_FC" | $SED "$delay_single_quote_subst"`' -hardcode_automatic_F77='`$ECHO "$hardcode_automatic_F77" | $SED "$delay_single_quote_subst"`' -inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' -inherit_rpath_FC='`$ECHO "$inherit_rpath_FC" | $SED "$delay_single_quote_subst"`' -inherit_rpath_F77='`$ECHO "$inherit_rpath_F77" | $SED "$delay_single_quote_subst"`' -link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' -link_all_deplibs_FC='`$ECHO "$link_all_deplibs_FC" | $SED "$delay_single_quote_subst"`' -link_all_deplibs_F77='`$ECHO "$link_all_deplibs_F77" | $SED "$delay_single_quote_subst"`' -always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' -always_export_symbols_FC='`$ECHO "$always_export_symbols_FC" | $SED "$delay_single_quote_subst"`' -always_export_symbols_F77='`$ECHO "$always_export_symbols_F77" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds_FC='`$ECHO "$export_symbols_cmds_FC" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds_F77='`$ECHO "$export_symbols_cmds_F77" | $SED "$delay_single_quote_subst"`' -exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' -exclude_expsyms_FC='`$ECHO "$exclude_expsyms_FC" | $SED "$delay_single_quote_subst"`' -exclude_expsyms_F77='`$ECHO "$exclude_expsyms_F77" | $SED "$delay_single_quote_subst"`' -include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' -include_expsyms_FC='`$ECHO "$include_expsyms_FC" | $SED "$delay_single_quote_subst"`' -include_expsyms_F77='`$ECHO "$include_expsyms_F77" | $SED "$delay_single_quote_subst"`' -prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' -prelink_cmds_FC='`$ECHO "$prelink_cmds_FC" | $SED "$delay_single_quote_subst"`' -prelink_cmds_F77='`$ECHO "$prelink_cmds_F77" | $SED "$delay_single_quote_subst"`' -postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' -postlink_cmds_FC='`$ECHO "$postlink_cmds_FC" | $SED "$delay_single_quote_subst"`' -postlink_cmds_F77='`$ECHO "$postlink_cmds_F77" | $SED "$delay_single_quote_subst"`' -file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' -file_list_spec_FC='`$ECHO "$file_list_spec_FC" | $SED "$delay_single_quote_subst"`' -file_list_spec_F77='`$ECHO "$file_list_spec_F77" | $SED "$delay_single_quote_subst"`' -hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_action_FC='`$ECHO "$hardcode_action_FC" | $SED "$delay_single_quote_subst"`' -hardcode_action_F77='`$ECHO "$hardcode_action_F77" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs_FC='`$ECHO "$compiler_lib_search_dirs_FC" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs_F77='`$ECHO "$compiler_lib_search_dirs_F77" | $SED "$delay_single_quote_subst"`' -predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' -predep_objects_FC='`$ECHO "$predep_objects_FC" | $SED "$delay_single_quote_subst"`' -predep_objects_F77='`$ECHO "$predep_objects_F77" | $SED "$delay_single_quote_subst"`' -postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' -postdep_objects_FC='`$ECHO "$postdep_objects_FC" | $SED "$delay_single_quote_subst"`' -postdep_objects_F77='`$ECHO "$postdep_objects_F77" | $SED "$delay_single_quote_subst"`' -predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' -predeps_FC='`$ECHO "$predeps_FC" | $SED "$delay_single_quote_subst"`' -predeps_F77='`$ECHO "$predeps_F77" | $SED "$delay_single_quote_subst"`' -postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' -postdeps_FC='`$ECHO "$postdeps_FC" | $SED "$delay_single_quote_subst"`' -postdeps_F77='`$ECHO "$postdeps_F77" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path_FC='`$ECHO "$compiler_lib_search_path_FC" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path_F77='`$ECHO "$compiler_lib_search_path_F77" | $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 \ -SED \ -GREP \ -EGREP \ -FGREP \ -LD \ -NM \ -LN_S \ -lt_SP2NL \ -lt_NL2SP \ -reload_flag \ -OBJDUMP \ -deplibs_check_method \ -file_magic_cmd \ -file_magic_glob \ -want_nocaseglob \ -DLLTOOL \ -sharedlib_from_linklib_cmd \ -AR \ -AR_FLAGS \ -archiver_list_spec \ -STRIP \ -RANLIB \ -CC \ -CFLAGS \ -compiler \ -lt_cv_sys_global_symbol_pipe \ -lt_cv_sys_global_symbol_to_cdecl \ -lt_cv_sys_global_symbol_to_c_name_address \ -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -nm_file_list_spec \ -lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_pic \ -lt_prog_compiler_wl \ -lt_prog_compiler_static \ -lt_cv_prog_compiler_c_o \ -need_locks \ -MANIFEST_TOOL \ -DSYMUTIL \ -NMEDIT \ -LIPO \ -OTOOL \ -OTOOL64 \ -shrext_cmds \ -export_dynamic_flag_spec \ -whole_archive_flag_spec \ -compiler_needs_object \ -with_gnu_ld \ -allow_undefined_flag \ -no_undefined_flag \ -hardcode_libdir_flag_spec \ -hardcode_libdir_flag_spec_ld \ -hardcode_libdir_separator \ -exclude_expsyms \ -include_expsyms \ -file_list_spec \ -variables_saved_for_relink \ -libname_spec \ -library_names_spec \ -soname_spec \ -install_override_mode \ -finish_eval \ -old_striplib \ -striplib \ -compiler_lib_search_dirs \ -predep_objects \ -postdep_objects \ -predeps \ -postdeps \ -compiler_lib_search_path \ -LD_CXX \ -LD_FC \ -LD_F77 \ -reload_flag_CXX \ -reload_flag_FC \ -reload_flag_F77 \ -compiler_CXX \ -compiler_FC \ -compiler_F77 \ -lt_prog_compiler_no_builtin_flag_CXX \ -lt_prog_compiler_no_builtin_flag_FC \ -lt_prog_compiler_no_builtin_flag_F77 \ -lt_prog_compiler_pic_CXX \ -lt_prog_compiler_pic_FC \ -lt_prog_compiler_pic_F77 \ -lt_prog_compiler_wl_CXX \ -lt_prog_compiler_wl_FC \ -lt_prog_compiler_wl_F77 \ -lt_prog_compiler_static_CXX \ -lt_prog_compiler_static_FC \ -lt_prog_compiler_static_F77 \ -lt_cv_prog_compiler_c_o_CXX \ -lt_cv_prog_compiler_c_o_FC \ -lt_cv_prog_compiler_c_o_F77 \ -export_dynamic_flag_spec_CXX \ -export_dynamic_flag_spec_FC \ -export_dynamic_flag_spec_F77 \ -whole_archive_flag_spec_CXX \ -whole_archive_flag_spec_FC \ -whole_archive_flag_spec_F77 \ -compiler_needs_object_CXX \ -compiler_needs_object_FC \ -compiler_needs_object_F77 \ -with_gnu_ld_CXX \ -with_gnu_ld_FC \ -with_gnu_ld_F77 \ -allow_undefined_flag_CXX \ -allow_undefined_flag_FC \ -allow_undefined_flag_F77 \ -no_undefined_flag_CXX \ -no_undefined_flag_FC \ -no_undefined_flag_F77 \ -hardcode_libdir_flag_spec_CXX \ -hardcode_libdir_flag_spec_FC \ -hardcode_libdir_flag_spec_F77 \ -hardcode_libdir_flag_spec_ld_CXX \ -hardcode_libdir_flag_spec_ld_FC \ -hardcode_libdir_flag_spec_ld_F77 \ -hardcode_libdir_separator_CXX \ -hardcode_libdir_separator_FC \ -hardcode_libdir_separator_F77 \ -exclude_expsyms_CXX \ -exclude_expsyms_FC \ -exclude_expsyms_F77 \ -include_expsyms_CXX \ -include_expsyms_FC \ -include_expsyms_F77 \ -file_list_spec_CXX \ -file_list_spec_FC \ -file_list_spec_F77 \ -compiler_lib_search_dirs_CXX \ -compiler_lib_search_dirs_FC \ -compiler_lib_search_dirs_F77 \ -predep_objects_CXX \ -predep_objects_FC \ -predep_objects_F77 \ -postdep_objects_CXX \ -postdep_objects_FC \ -postdep_objects_F77 \ -predeps_CXX \ -predeps_FC \ -predeps_F77 \ -postdeps_CXX \ -postdeps_FC \ -postdeps_F77 \ -compiler_lib_search_path_CXX \ -compiler_lib_search_path_FC \ -compiler_lib_search_path_F77; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in reload_cmds \ -old_postinstall_cmds \ -old_postuninstall_cmds \ -old_archive_cmds \ -extract_expsyms_cmds \ -old_archive_from_new_cmds \ -old_archive_from_expsyms_cmds \ -archive_cmds \ -archive_expsym_cmds \ -module_cmds \ -module_expsym_cmds \ -export_symbols_cmds \ -prelink_cmds \ -postlink_cmds \ -postinstall_cmds \ -postuninstall_cmds \ -finish_cmds \ -sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec \ -reload_cmds_CXX \ -reload_cmds_FC \ -reload_cmds_F77 \ -old_archive_cmds_CXX \ -old_archive_cmds_FC \ -old_archive_cmds_F77 \ -old_archive_from_new_cmds_CXX \ -old_archive_from_new_cmds_FC \ -old_archive_from_new_cmds_F77 \ -old_archive_from_expsyms_cmds_CXX \ -old_archive_from_expsyms_cmds_FC \ -old_archive_from_expsyms_cmds_F77 \ -archive_cmds_CXX \ -archive_cmds_FC \ -archive_cmds_F77 \ -archive_expsym_cmds_CXX \ -archive_expsym_cmds_FC \ -archive_expsym_cmds_F77 \ -module_cmds_CXX \ -module_cmds_FC \ -module_cmds_F77 \ -module_expsym_cmds_CXX \ -module_expsym_cmds_FC \ -module_expsym_cmds_F77 \ -export_symbols_cmds_CXX \ -export_symbols_cmds_FC \ -export_symbols_cmds_F77 \ -prelink_cmds_CXX \ -prelink_cmds_FC \ -prelink_cmds_F77 \ -postlink_cmds_CXX \ -postlink_cmds_FC \ -postlink_cmds_F77; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -ac_aux_dir='$ac_aux_dir' -xsi_shell='$xsi_shell' -lt_shell_append='$lt_shell_append' - -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - - - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile' - - - - - - - - - - -_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 - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/tests/Makefile" ;; - "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; - "bin/spud-preprocess") CONFIG_FILES="$CONFIG_FILES bin/spud-preprocess" ;; - "diamond/setup.py") CONFIG_FILES="$CONFIG_FILES diamond/setup.py" ;; - "diamond/diamond/plugins.py") CONFIG_FILES="$CONFIG_FILES diamond/diamond/plugins.py" ;; - "diamond/diamond/preprocess.py") CONFIG_FILES="$CONFIG_FILES diamond/diamond/preprocess.py" ;; - - *) 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_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '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 -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 - -# 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 {' >"$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 >>"\$tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_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" - - -eval set X " :F $CONFIG_FILES :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="$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 >"$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 -_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 -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$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' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$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 "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - - - :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 - "libtool":C) - - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -# The names of the tagged configurations supported by this script. -available_tags="CXX FC F77 " - -# ### BEGIN LIBTOOL CONFIG - -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# What type of objects to build. -pic_mode=$pic_mode - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="\$SED -e 1s/^X//" - -# A grep program that handles long lines. -GREP=$lt_GREP - -# An ERE matcher. -EGREP=$lt_EGREP - -# A literal string matcher. -FGREP=$lt_FGREP - -# A BSD- or MS-compatible name lister. -NM=$lt_NM - -# Whether we need soft or hard links. -LN_S=$lt_LN_S - -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len - -# Object file suffix (normally "o"). -objext=$ac_objext - -# Executable file suffix (normally ""). -exeext=$exeext - -# whether the shell understands "unset". -lt_unset=$lt_unset - -# turn spaces into newlines. -SP2NL=$lt_lt_SP2NL - -# turn newlines into spaces. -NL2SP=$lt_lt_NL2SP - -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd - -# An object symbol dumper. -OBJDUMP=$lt_OBJDUMP - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method = "file_magic". -file_magic_cmd=$lt_file_magic_cmd - -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob=$lt_file_magic_glob - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob=$lt_want_nocaseglob - -# DLL creation program. -DLLTOOL=$lt_DLLTOOL - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - -# The archiver. -AR=$lt_AR - -# Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS - -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - -# A symbol stripping program. -STRIP=$lt_STRIP - -# Commands used to install an old-style archive. -RANLIB=$lt_RANLIB -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - -# A C compiler. -LTCC=$lt_CC - -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - -# Specify filename containing input files for \$NM. -nm_file_list_spec=$lt_nm_file_list_spec - -# The root where to search for dependent libraries,and in which our libraries should be installed. -lt_sysroot=$lt_sysroot - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL - -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 - -# Old archive suffix (normally "a"). -libext=$libext - -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink - -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Library versioning type. -version_type=$version_type - -# Shared library runtime path variable. -runpath_var=$runpath_var - -# Shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - - -# The linker used to build libraries. -LD=$lt_LD - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds - -# A language specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU compiler? -with_gcc=$GCC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs - -# Dependencies to place before and after the objects being linked to -# create a shared library. -predep_objects=$lt_predep_objects -postdep_objects=$lt_postdep_objects -predeps=$lt_predeps -postdeps=$lt_postdeps - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path - -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - -ltmain="$ac_aux_dir/ltmain.sh" - - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - if test x"$xsi_shell" = xyes; then - sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ -func_dirname ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_basename ()$/,/^} # func_basename /c\ -func_basename ()\ -{\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ -func_dirname_and_basename ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ -func_stripname ()\ -{\ -\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ -\ # positional parameters, so assign one to ordinary parameter first.\ -\ func_stripname_result=${3}\ -\ func_stripname_result=${func_stripname_result#"${1}"}\ -\ func_stripname_result=${func_stripname_result%"${2}"}\ -} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ -func_split_long_opt ()\ -{\ -\ func_split_long_opt_name=${1%%=*}\ -\ func_split_long_opt_arg=${1#*=}\ -} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ -func_split_short_opt ()\ -{\ -\ func_split_short_opt_arg=${1#??}\ -\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ -} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ -func_lo2o ()\ -{\ -\ case ${1} in\ -\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ -\ *) func_lo2o_result=${1} ;;\ -\ esac\ -} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_xform ()$/,/^} # func_xform /c\ -func_xform ()\ -{\ - func_xform_result=${1%.*}.lo\ -} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_arith ()$/,/^} # func_arith /c\ -func_arith ()\ -{\ - func_arith_result=$(( $* ))\ -} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_len ()$/,/^} # func_len /c\ -func_len ()\ -{\ - func_len_result=${#1}\ -} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - -fi - -if test x"$lt_shell_append" = xyes; then - sed -e '/^func_append ()$/,/^} # func_append /c\ -func_append ()\ -{\ - eval "${1}+=\\${2}"\ -} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ -func_append_quoted ()\ -{\ -\ func_quote_for_eval "${2}"\ -\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ -} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 -$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} -fi - - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - - - cat <<_LT_EOF >> "$ofile" - -# ### BEGIN LIBTOOL TAG CONFIG: CXX - -# The linker used to build libraries. -LD=$lt_LD_CXX - -# How to create reloadable object files. -reload_flag=$lt_reload_flag_CXX -reload_cmds=$lt_reload_cmds_CXX - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds_CXX - -# A language specific compiler. -CC=$lt_compiler_CXX - -# Is the compiler the GNU compiler? -with_gcc=$GCC_CXX - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_CXX - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object_CXX - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld_CXX - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX - -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct_CXX - -# Set to "yes" if using 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 - - - cat <<_LT_EOF >> "$ofile" - -# ### BEGIN LIBTOOL TAG CONFIG: FC - -# The linker used to build libraries. -LD=$lt_LD_FC - -# How to create reloadable object files. -reload_flag=$lt_reload_flag_FC -reload_cmds=$lt_reload_cmds_FC - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds_FC - -# A language specific compiler. -CC=$lt_compiler_FC - -# Is the compiler the GNU compiler? -with_gcc=$GCC_FC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_FC - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_FC - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_FC - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_FC - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_FC - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_FC - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_FC - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_FC - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_FC - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object_FC - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_FC - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_FC - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds_FC -archive_expsym_cmds=$lt_archive_expsym_cmds_FC - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds_FC -module_expsym_cmds=$lt_module_expsym_cmds_FC - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld_FC - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_FC - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_FC - -# 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_FC - -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_FC - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_FC - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct_FC - -# 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_FC - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L_FC - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_FC - -# 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_FC - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath_FC - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_FC - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols_FC - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_FC - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_FC - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_FC - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds_FC - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds_FC - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec_FC - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_FC - -# The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_FC - -# Dependencies to place before and after the objects being linked to -# create a shared library. -predep_objects=$lt_predep_objects_FC -postdep_objects=$lt_postdep_objects_FC -predeps=$lt_predeps_FC -postdeps=$lt_postdeps_FC - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_FC - -# ### END LIBTOOL TAG CONFIG: FC -_LT_EOF - - - cat <<_LT_EOF >> "$ofile" - -# ### BEGIN LIBTOOL TAG CONFIG: F77 - -# The linker used to build libraries. -LD=$lt_LD_F77 - -# How to create reloadable object files. -reload_flag=$lt_reload_flag_F77 -reload_cmds=$lt_reload_cmds_F77 - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds_F77 - -# A language specific compiler. -CC=$lt_compiler_F77 - -# Is the compiler the GNU compiler? -with_gcc=$GCC_F77 - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_F77 - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_F77 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_F77 - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_F77 - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object_F77 - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds_F77 -archive_expsym_cmds=$lt_archive_expsym_cmds_F77 - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds_F77 -module_expsym_cmds=$lt_module_expsym_cmds_F77 - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld_F77 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_F77 - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_F77 - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 - -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct_F77 - -# Set to "yes" if using 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_F77 - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L_F77 - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic_F77 - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath_F77 - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_F77 - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols_F77 - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_F77 - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_F77 - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_F77 - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds_F77 - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds_F77 - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec_F77 - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_F77 - -# The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77 - -# Dependencies to place before and after the objects being linked to -# create a shared library. -predep_objects=$lt_predep_objects_F77 -postdep_objects=$lt_postdep_objects_F77 -predeps=$lt_predeps_F77 -postdeps=$lt_postdeps_F77 - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_F77 - -# ### END LIBTOOL TAG CONFIG: F77 -_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 - diff --git a/libspud/configure.in b/libspud/configure.in deleted file mode 100644 index 6ba516dfa5..0000000000 --- a/libspud/configure.in +++ /dev/null @@ -1,307 +0,0 @@ -# Copyright (C) 2006 Imperial College London and others. -# -# Please see the AUTHORS file in the main source directory for a full list -# of copyright holders. -# -# Prof. C Pain -# Applied Modelling and Computation Group -# Department of Earth Science and Engineering -# Imperial College London -# -# C.Pain@Imperial.ac.uk -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation, -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA - -dnl Process this file with autoconf to produce a configure script. -AC_INIT(include/spud.h) - -LT_INIT -LT_LANG([CXX]) -LT_LANG([FC]) - -# This is to get around some odd behavious of some fortran compilers -FCFLAGS="$FCFLAGS -I/usr/include" - -# -# Name spud -# -AC_ARG_ENABLE(debugging, -[AC_HELP_STRING([--enable-debugging], -[turns on debugging flags])]) - -# Check system type -AC_CANONICAL_HOST - -# Find compilers -AC_MSG_NOTICE([*** Fishing for legacy fortran compiler.]) -AC_PROG_F77(ifort ifc efc sunf95 gfortran pgf95 pathf95 g95 f90,,f90,$PATH) -AC_F77_LIBRARY_LDFLAGS -fcompiler=`basename $F77` - -AC_MSG_NOTICE([*** Fishing for modern Fortran compiler]) -AC_PROG_FC(ifort ifc efc sunf95 gfortran pgf95 pathf95 g95 f90,,f90,$PATH) -AC_FC_LIBRARY_LDFLAGS -fccompiler=`basename $FC` - -if test "$fcompiler" = "sunf95" ; then - MODINC_FLAG="-M" - FFLAGS="-M../include $FFLAGS" - FCFLAGS="-M../include $FCFLAGS" -else - MODINC_FLAG="-I" -fi - -if test "$F77" = "$FC" ; then - smart_fortran="yes" - AC_MSG_NOTICE([*** Assuming that $FC can process both free and fixed form fortran files.]) -else - AC_MSG_NOTICE([*** Assuming that $FC cannot process both free and fixed form fortran files (silly fortran).]) - smart_fortran="no" -fi - -AC_PROG_CXX(icpc icc ecc sunCC pgCC g++ CC) -AC_PROG_CPP -LINKER=$CXX - -AC_LONG_64_BITS - -# Find fortran libraries required when linking with C++ main. -AC_FC_LIBRARY_LDFLAGS - -AC_F77_WRAPPERS - -# Check for standard libraries -AC_LANG_PUSH([C]) -AC_CHECK_LIB(stdc++,main,,) -AC_CHECK_LIB(m,main,,) -AC_CHECK_LIB(pthread,main,,) - -LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FCLIBS $FLIBS" - -LINKER=$CXX - -## -## what compiler options work -## -if test "$FC" = "g95"; then - FCFLAGS="-ffast-math -fno-second-underscore $FCFLAGS" -fi - -if test "$FC" = "gfortran"; then - if test "$enable_debugging" = "yes" ; then - FCFLAGS="-frecord-marker=4 $FCFLAGS" - else - FCFLAGS="-ffast-math -frecord-marker=4 $FCFLAGS" - fi - CPPFLAGS="$CPPFLAGS -DUSING_GFORTRAN=1" -fi - -AC_LANG_PUSH(Fortran 77) -AC_MSG_CHECKING([how do we get fortran 77 to allow long lines]) -old_FLAGS="$FFLAGS" -extended_source_flag=none -AC_TRY_COMPILE([], - [ - PRINT*, "hello world "], - [ - AC_MSG_RESULT(no extra flags required) - extended_source_flag=happy - ],[]) - -if test "$extended_source_flag" != happy ; then -if test "$extended_source_flag" = none ; then - FFLAGS="-extend_source" - AC_TRY_COMPILE([], - [ - PRINT*, "hello world "], - [ - extended_source_flag=$FFLAGS - AC_MSG_RESULT([$FFLAGS]) - FFLAGS="$old_FLAGS $FFLAGS" - ],[]) -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-132" - AC_TRY_COMPILE([], - [ - PRINT*, "hello world "], - [ - extended_source_flag=$FFLAGS - AC_MSG_RESULT([$FFLAGS]) - FFLAGS="$old_FLAGS $FFLAGS" - ],[]) -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-ffree-line-length-none -ffixed-line-length-none" - AC_TRY_COMPILE([], - [ - PRINT*, "hello world "], - [ - extended_source_flag=$FFLAGS - AC_MSG_RESULT([$FFLAGS]) - FFLAGS="$old_FLAGS $FFLAGS" - ],[]) -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-ffixed-line-length-huge -ffree-line-length-huge" - AC_TRY_COMPILE([], - [ - PRINT*, "hello world "], - [ - extended_source_flag=$FFLAGS - AC_MSG_RESULT([$FFLAGS]) - FFLAGS="$old_FLAGS $FFLAGS" - ],[]) -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-ffixed-line-length-132 -ffree-line-length-huge" - AC_TRY_COMPILE([], - [ - PRINT*, "hello world "], - [ - extended_source_flag=$FFLAGS - AC_MSG_RESULT([$FFLAGS]) - FFLAGS="$old_FLAGS $FFLAGS" - ],[]) -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-ffixed-line-length-132" - AC_TRY_COMPILE([], - [ - PRINT*, "hello world "], - [ - extended_source_flag=$FFLAGS - AC_MSG_RESULT([$FFLAGS]) - FFLAGS="$old_FLAGS $FFLAGS" - ],[]) -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-Mextend" - AC_TRY_COMPILE([], - [ - PRINT*, "hello world "], - [ - extended_source_flag=$FFLAGS - AC_MSG_RESULT([$FFLAGS]) - FFLAGS="$old_FLAGS $FFLAGS" - ],[]) -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-qfixed=256" - AC_TRY_COMPILE([], - [ - PRINT*, "hello world "], - [ - extended_source_flag=$FFLAGS - AC_MSG_RESULT([$FFLAGS]) - FFLAGS="$old_FLAGS $FFLAGS" - ],[]) -fi -if test "$extended_source_flag" = none ; then - FFLAGS="-e" - AC_TRY_COMPILE([], - [ - PRINT*, "hello world "], - [ - extended_source_flag=$FFLAGS - AC_MSG_RESULT([$FFLAGS]) - FFLAGS="$old_FLAGS $FFLAGS" - ],[]) -fi - -if test "$extended_source_flag" = none ; then - AC_MSG_RESULT([we cannot]) -else - FCFLAGS="$FCFLAGS $extended_source_flag" -fi -fi - -AC_LANG_POP([Fortran 77]) - -AC_PROG_INSTALL -AC_CHECK_PROG(MAKE, gmake, gmake, make, $PATH) - -# Set default for ARFLAGS, since autoconf does not have a macro for -# it. This allows people to set it when running configure or make. -AC_CHECK_PROG(AR, ar, ar, ,$PATH) -test -n "$ARFLAGS" || ARFLAGS="cr" -AC_PROG_RANLIB - -AC_ARG_ENABLE(verbose, -[AC_HELP_STRING([--enable-verbose], -[turns on super verbosity])]) - -if test "$enable_verbose" = "yes" ; then - CPPFLAGS="$CPPFLAGS -DVERBOSE_MESSAGES=1" -fi - -if test "$enable_debugging" = "yes" ; then - CXXFLAGS="-g -O0 `echo $CXXFLAGS | sed 's/-O2//g'`" - FCFLAGS="-g -O0 `echo $FCFLAGS | sed 's/-O2//g'`" - - if test "$fcompiler" = "ifort" ; then - FCFLAGS="-C -traceback -check nooutput_conversion -check noarg_temp_created ${FCFLAGS}" - CXXFLAGS="-fno-omit-frame-pointer ${CXXFLAGS}" - elif test "$fcompiler" = "gfortran" ; then - FCFLAGS="-fbounds-check -Wall ${FCFLAGS}" - CXXFLAGS="-fbounds-check -Wall ${CXXFLAGS}" - LDFLAGS="-rdynamic ${LDFLAGS}" - elif test "$fcompiler" = "g95" ; then - FCFLAGS="-fbounds-check -ftrace=full ${FCFLAGS}" - elif test "$fcompiler" = "sunf95" ; then - FCFLAGS="-C -ftrap=invalid -fpover ${FCFLAGS}" - CXXFLAGS="-ftrap=invalid ${CXXFLAGS}" - else - FCFLAGS="-C ${FCFLAGS}" - fi - -else - AC_MSG_NOTICE([Setting optimisation flags]) - CPPFLAGS="$CPPFLAGS -DNDEBUG=1" - FCFLAGS="-O3 `echo $FCFLAGS | sed 's/-g -O2//g'`" - CXXFLAGS="-O3 `echo $CXXFLAGS | sed 's/-g -O2//g'`" -fi - -if test "$FC" = "ifc" ; then - FCFLAGS="-implicitnone -w95 $FCFLAGS" -fi - -############################################################## -# enable gprof profiling - -AC_ARG_ENABLE(profiling, -[AC_HELP_STRING([--enable-profiling], -[enable gprof profiling])]) - -if test "$enable_profiling" = "yes" ; then - PROFILING_FLAG="-pg" - CPPFLAGS="-pg $CPPFLAGS" - FCFLAGS="-pg $FCFLAGS" - - LINKER="$LINKER -pg" -else - PROFILING_FLAG="" -fi -AC_SUBST(PROFILING_FLAG) - -AC_SUBST(ARFLAGS) -AC_SUBST(LINKER) -AC_SUBST(MAKE) -AC_SUBST(LIBS) - -AC_OUTPUT(Makefile src/tests/Makefile examples/Makefile - bin/spud-preprocess - diamond/setup.py diamond/diamond/plugins.py diamond/diamond/preprocess.py) diff --git a/libspud/debian/changelog b/libspud/debian/changelog deleted file mode 100644 index 8be45c7ab5..0000000000 --- a/libspud/debian/changelog +++ /dev/null @@ -1,272 +0,0 @@ -spud (1.1.5) precise; urgency=low - - * Point-release to formally include bugfixes from 2012-03/04 - - -- Tim Greaves Tue, 19 Jun 2012 12:30:17 +0100 - -spud (1.1.4) natty; urgency=low - - * Release for Cian's syntax highlighting changes - r.521 of lp:spud - - -- Tim Greaves Sat, 10 Mar 2012 22:49:30 +0000 - -spud (1.1.3) natty; urgency=low - - * Fix a bug in the setting of tensor data. - - -- Patrick Farrell Fri, 29 Jul 2011 11:32:38 +0100 - -spud (1.1.2) natty; urgency=low - - * Bugfixes for the bugs caused by the major reorganisation of the code. - - -- Patrick Farrell Fri, 29 Jul 2011 10:03:50 +0100 - -spud (1.1.1) natty; urgency=low - - * Offer two major new features in Diamond: slice view and group view. - * Slicing shows all instances of a particular entry, along with its - data and attributes. - * Grouping modifies the treeview to only show all instances of a - particular entry. - - -- Patrick Farrell Tue, 26 Jul 2011 17:37:17 +0100 - -spud (1.1.0) natty; urgency=low - - * Refactor the Fortran calls to C to use iso_c_binding - * Clean up the C interface to remove old Fortran interface hacks. - * Modify interfaces so that almost every routine returns an error status. - * Consequential changes to the manual. - * Cause bash completion for diamond to be installed by the package. - * Include Fraser's first week of work on Diamond. - - -- David A Ham Tue, 12 Jul 2011 09:56:34 +0100 - -spud (1.0.24) natty; urgency=low - - * Update the manual to reflect the move to Launchpad. - - -- David A Ham Tue, 28 Jun 2011 18:24:02 +0100 - -spud (1.0.23) maverick; urgency=low - - * Include the latest diamond updates - - -- Patrick Farrell Thu, 03 Feb 2011 12:10:17 +0000 - -spud (1.0.22) maverick; urgency=low - - * Schema for ICOM-Fluidity now points to 4.0-release. - - -- Tim Bond Thu, 11 Nov 2010 14:10:30 +0000 - -spud (1.0.21) maverick; urgency=low - - * Schema for ICOM-Fluidity now points to release-candidate in a schemas directory. - - -- Tim Bond Wed, 27 Oct 2010 15:32:51 +0100 - -spud (1.0.20) unstable; urgency=low - - * Various interface bug fixes. - - -- David Ham Wed, 07 Apr 2010 14:01:17 +0100 - -spud (1.0.19) unstable; urgency=low - - * Version 1.0.18 was broken on some platforms (karmic, debian unstable) - due to missing sym-links (see commit 505). - * Entry of python code in diamond is now done in a gedit widget - with syntax highlighting and a monospaced font. - - -- Stephan Kramer Sat, 27 Feb 2010 14:46:46 +0000 - -spud (1.0.18) unstable; urgency=low - - * Update to set_option to insert __value elements when needed. - * utf-8 in xml headers rather than utf8. - - -- David Ham Wed, 24 Feb 2010 18:03:40 +0000 - -spud (1.0.17) karmic; urgency=low - - * Use libtool to build a static and shared library - - -- Patrick Farrell Thu, 10 Dec 2009 11:05:15 +0000 - -spud (1.0.16) intrepid; urgency=low - - * Various bugfixes including to diamond validation. - - -- David Ham Thu, 25 Jun 2009 15:17:07 +0100 - -spud (1.0.15) intrepid; urgency=low - - * We need a new release for various minor bugs. - - -- Patrick Farrell Fri, 19 Jun 2009 13:30:53 +0100 - -spud (1.0.14) intrepid; urgency=low - - * We need a new release for various minor bugs. - - -- Patrick Farrell Mon, 01 Jun 2009 14:08:04 +0100 - -spud (1.0.13) unstable; urgency=low - - * Fix the None bug which prevents opening files with lost elements. - * Bugfix for included files when opening remotely. - - -- David Ham Wed, 15 Apr 2009 09:56:03 +0100 - -spud (1.0.12) unstable; urgency=low - - * Of course, as soon as you release you spot a bug. - Optional entries, when activated by double clicking, - are now populated. - - -- Patrick Farrell Mon, 30 Mar 2009 16:04:38 +0100 - -spud (1.0.11) unstable; urgency=low - - * Make the schema parsing about 10x faster. - This is done by loading elements from the schema as they - are needed rather than all at initialisation. - * This necessitates the disabling of the find dialog for now. - - -- Patrick Farrell Mon, 30 Mar 2009 15:29:35 +0100 - -spud (1.0.10) unstable; urgency=low - - * Diamond now has the capability to pull schemas from the web. This also removes the need for many users to have .diamond/schemata/flml files as diamond automatically knows about the current Fluidity trunk schema. - - -- David Ham Fri, 27 Feb 2009 13:14:50 +0000 - -spud (1.0.9) unstable; urgency=low - - * Include single precision Fortran interfaces for get_option and set_option. - - -- David Ham Thu, 26 Feb 2009 14:48:10 +0000 - -spud (1.0.8) unstable; urgency=low - - * Include new formatting of whitespace in comments. - - -- David Ham Mon, 02 Feb 2009 15:25:33 +0000 - -spud (1.0.7) unstable; urgency=low - - * Include spud-set and related changes to Diamond and the manual. - - -- David Ham Thu, 08 Jan 2009 17:52:43 +0000 - -spud (1.0.6) unstable; urgency=low - - * Cause spudtools to conflict with older libspud-dev - - -- David Ham Mon, 15 Sep 2008 17:33:46 +0100 - -spud (1.0.5) unstable; urgency=low - - * Split out the schema and spud-preprocess into a separate package. - - -- David Ham Mon, 15 Sep 2008 17:06:27 +0100 - -spud (1.0.4) unstable; urgency=low - - * Diamond plugins now work. - * Added examples directory and ballistics example. - - -- David Ham Mon, 15 Sep 2008 13:56:52 +0100 - -spud (1.0.3) hardy; urgency=low - - * Move the GDK thread initialisation call. - * If you think you understand threads, you don't - understand threads. - - -- Patrick Farrell Thu, 14 Aug 2008 17:27:52 +0100 - -spud (1.0.2) hardy; urgency=low - - * Fix infinite loop on load due to awkward schema changes. - - -- Patrick Farrell Thu, 14 Aug 2008 11:29:18 +0100 - -spud (1.0.1) hardy; urgency=low - - * Fix a few bugs. - - -- Patrick Farrell Tue, 29 Jul 2008 14:50:07 +0100 - -spud (1.0) unstable; urgency=low - - * Initial release! - - -- David Ham Thu, 26 Jun 2008 18:05:51 +0100 - -spud (0.99) unstable; urgency=low - - * Release candidate - - -- David Ham Thu, 26 Jun 2008 15:48:25 +0100 - -spud (0.9.1) unstable; urgency=low - - * Fix for file reading bug. - - -- David Ham Tue, 24 Jun 2008 18:20:19 +0100 - -spud (0.9) unstable; urgency=low - - * Version with merged in new xml parser. - - -- David Ham Mon, 23 Jun 2008 18:19:33 +0100 - -spud (0.2.5) unstable; urgency=low - - * Bugfix for setting of rank and shape - - -- David Ham Mon, 02 Jun 2008 16:24:00 +0100 - -spud (0.2.4) unstable; urgency=low - - * Various diamond bugs reverted. - * Interface changes to libspud. - * Spud is now all double precision independent of compiler options. - - -- David Ham Tue, 27 May 2008 15:14:08 +0100 - -spud (0.2.3) unstable; urgency=low - - * Changed python2.5 dependency to python - * Added spud-preprocess - - -- David Ham Fri, 23 May 2008 17:45:54 +0100 - -spud (0.2.1) unstable; urgency=low - - * Caused package to conflict with and replace python-diamond. - - -- David Ham Thu, 15 May 2008 12:11:37 +0100 - -spud (0.2) unstable; urgency=low - - * Transition to spud source package producing libspud-dev - and diamond binary packages. - - -- David Ham Tue, 13 May 2008 16:15:09 +0100 - -spud (0.1b-1) gutsy; urgency=low - - * Bundle the modified Xvif parser with diamond. - * Lots of bugfixes and new features. - - -- Patrick Farrell Mon, 10 Dec 2007 12:21:46 +0000 - -spud (0.1a-1) unstable; urgency=low - - * source package automatically created by stdeb 0.2.a1 - - -- Patrick Farrell Mon, 03 Dec 2007 13:26:28 +0000 diff --git a/libspud/debian/compat b/libspud/debian/compat deleted file mode 100644 index 7ed6ff82de..0000000000 --- a/libspud/debian/compat +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/libspud/debian/control b/libspud/debian/control deleted file mode 100644 index 8a484575ee..0000000000 --- a/libspud/debian/control +++ /dev/null @@ -1,73 +0,0 @@ -Source: spud -Maintainer: The ICOM team -Uploaders: David Ham -Section: science -Priority: extra -Build-Depends: gfortran (>=4.2), g++ (>=4.2), python-setuptools (>= 0.6b3-1), python-all-dev (>= 2.3.5-11), debhelper (>= 5.0.38), dh-python, texlive, python-support -Standards-Version: 3.8.0 -XS-Python-Version: >= 2.5 - -Package: diamond -Architecture: all -Depends: python-gtk2, python-lxml, libxml2-utils, python, spudtools, python-gtksourceview2, python-dxdiff, python-glade2, python-rsvg -Recommends: python-psyco -Suggests: -Conflicts: python-diamond -Replaces: python-diamond -Provides: ${python:Provides} -X-Python-Version: ${python:Versions} -Description: A schema-driven interface for writing XML documents - Diamond is a dynamic schema-driven graphical user interface for writing - XML documents. The interface is automatically generated from a schema - written in RELAX NG describing an XML language. The interface is optimised - for configuring models for solving problems in computational mechanics, - though the technology is generic to any sort of XML document creation. - -Package: libspud-dev -Architecture: any -Depends: ${shlibs:Depends}, spudtools, libtinyxml-dev -Recommends: diamond -Section: libdevel -Suggests: -Description: An automatic options system for scientific models. - Spud is an automatic options system which reads an xml options file - into a dictionary for immediate access from within the model. The xml - file is generated using a spud-compatible RELAX NG schema and a - schema-aware editor such as Diamond. - -Package: spudtools -Architecture: all -Depends: ${shlibs:Depends}, trang (>= 20091111-1) -Recommends: diamond -Conflicts: libspud-dev (<1.0.6) -Replaces: libspud-dev (<1.0.6) -Section: science -Suggests: -Description: An automatic options system for scientific models. - Spud is an automatic options system which reads an xml options file - into a dictionary for immediate access from within the model. The xml - file is generated using a spud-compatible RELAX NG schema and a - schema-aware editor such as Diamond. Spudtools contains the schema - for the spud base language and the spud-preprocess script for - converting schemas between the compact and xml syntaxes. - -Package: python-spud -Section: python -Architecture: any -X-Python-Version: ${python:Versions} -Depends: libspud-dev (= ${binary:Version}), ${python:Depends}, ${misc:Depends} -Description: An automatic options system for scientific models (python interface). - Spud is an automatic options system which reads an xml options file - into a dictionary for immediate access from within the model. The xml - file is generated using a spud-compatible RELAX NG schema and a - schema-aware editor such as Diamond. This package contains the Python - bindings for libspud. - -Package: python-dxdiff -Section: python -Architecture: all -X-Python-Version: ${python:Versions} -Depends: ${python:Depends}, ${misc:Depends} -Description: An XML aware diff tool. - DXdiff (Diamond Xml diff) is an XML aware diff tool for finding edit scripts - between two XML files. diff --git a/libspud/debian/diamond.copyright b/libspud/debian/diamond.copyright deleted file mode 100644 index eefc5a9ed0..0000000000 --- a/libspud/debian/diamond.copyright +++ /dev/null @@ -1,43 +0,0 @@ -Except as noted below, Diamond is copyright (C) 2007 Imperial College -London and others. For a full list of contributors see the AUTHORS -file. - -Diamond is free software: you can 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. - -On Debian systems, the complete text of the GNU General Public -License can be found in the file `/usr/share/common-licenses/GPL-3'. - ------ - -pygtkconsole.py is copyright (C) 2003, Jon Anderson -Copyright (C) 2007 Imperial College London and others. -Please see the AUTHORS file for a full list of contributors. - -See www.python.org/2.2/license.htm for license details. - ------ - -TextBufferMarkup.py is copyright (C) 2005 Thomas M. Hinkle -Copyright (C) 2007 Imperial College London and others. For a full list -of contributors see the AUTHORS file. - -TextBufferMarkup.py is free software: you can 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. - -On Debian systems, the complete text of the GNU General Public -License can be found in the file `/usr/share/common-licenses/GPL-3'. diff --git a/libspud/debian/diamond.dirs b/libspud/debian/diamond.dirs deleted file mode 100644 index de7b707282..0000000000 --- a/libspud/debian/diamond.dirs +++ /dev/null @@ -1,2 +0,0 @@ -etc/diamond -etc/diamond/schemata \ No newline at end of file diff --git a/libspud/debian/diamond.docs b/libspud/debian/diamond.docs deleted file mode 100644 index 61cc726c89..0000000000 --- a/libspud/debian/diamond.docs +++ /dev/null @@ -1 +0,0 @@ -AUTHORS \ No newline at end of file diff --git a/libspud/debian/install.diamond b/libspud/debian/install.diamond deleted file mode 100644 index fe14180c7e..0000000000 --- a/libspud/debian/install.diamond +++ /dev/null @@ -1 +0,0 @@ -diamond/misc/diamond-bash-completion /etc/bash_completion.d/ \ No newline at end of file diff --git a/libspud/debian/libspud-dev.copyright b/libspud/debian/libspud-dev.copyright deleted file mode 100644 index 399848ab84..0000000000 --- a/libspud/debian/libspud-dev.copyright +++ /dev/null @@ -1,39 +0,0 @@ -Except as noted below, Spud is copyright (C) 2007 Imperial College -London and others. For a full list of contributors see the AUTHORS -file. - -Spud is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -On Debian systems, the complete text of the GNU Lesser General Public -License can be found in the file `/usr/share/common-licenses/LGPL-2.1'. - ------ - -Tinyxml is copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. \ No newline at end of file diff --git a/libspud/debian/libspud-dev.dirs b/libspud/debian/libspud-dev.dirs deleted file mode 100644 index 44188162ec..0000000000 --- a/libspud/debian/libspud-dev.dirs +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib -usr/include diff --git a/libspud/debian/libspud-dev.docs b/libspud/debian/libspud-dev.docs deleted file mode 100644 index 0a57cdd051..0000000000 --- a/libspud/debian/libspud-dev.docs +++ /dev/null @@ -1,2 +0,0 @@ -doc/spud_manual.pdf -AUTHORS \ No newline at end of file diff --git a/libspud/debian/postinst b/libspud/debian/postinst deleted file mode 100644 index 4a4a245870..0000000000 --- a/libspud/debian/postinst +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -ldconfig diff --git a/libspud/debian/python-spud.copyright b/libspud/debian/python-spud.copyright deleted file mode 100644 index 399848ab84..0000000000 --- a/libspud/debian/python-spud.copyright +++ /dev/null @@ -1,39 +0,0 @@ -Except as noted below, Spud is copyright (C) 2007 Imperial College -London and others. For a full list of contributors see the AUTHORS -file. - -Spud is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -On Debian systems, the complete text of the GNU Lesser General Public -License can be found in the file `/usr/share/common-licenses/LGPL-2.1'. - ------ - -Tinyxml is copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. \ No newline at end of file diff --git a/libspud/debian/rules b/libspud/debian/rules deleted file mode 100755 index a40ba724ad..0000000000 --- a/libspud/debian/rules +++ /dev/null @@ -1,156 +0,0 @@ -#!/usr/bin/make -f - -PACKAGE_NAME=diamond -MODULE_NAME=diamond -DEB_UPSTREAM_VERSION=1.0 - -PYVERS=$(shell pyversions -dv) - -# These are used for cross-compiling and for saving the configure script -# from having to guess our platform (since we know it already) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) - - -config.status: configure - dh_testdir - # Add here commands to configure the package. - -ifneq "$(wildcard /usr/share/misc/config.sub)" "" - cp -f /usr/share/misc/config.sub config.sub -endif -ifneq "$(wildcard /usr/share/misc/config.guess)" "" - cp -f /usr/share/misc/config.guess config.guess -endif - ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" - -build-libspud: build-libspud-stamp -build-libspud-stamp: - touch $@ - -build-libspud: config.status - dh_testdir - - # Add here commands to compile the package. - $(MAKE) libspud.la - #docbook-to-man debian/fluidity.sgml > fluidity.1 - $(MAKE) doc - - -build-diamond: build-diamond-stamp -build-diamond-stamp: $(PYVERS:%=build-python%) - touch $@ -build-python%: config.status -# Force setuptools, but reset sys.argv[0] to 'setup.py' because setup.py files expect that. - cd diamond;python$* -c "import setuptools,sys;f='setup.py';sys.argv[0]=f;execfile(f,{'__file__':f,'__name__':'__main__'})" build - touch $@ -clean: - dh_testdir - dh_testroot - rm -f *-stamp - rm -rf dist build - -find -name '*.py[co]' | xargs rm -f - $(MAKE) clean || true -# find . -name *.pyc -exec rm {} \; - dh_clean - -install-libspud: build-libspud install-prereq - $(MAKE) install-libspud DESTDIR=$(CURDIR)/debian/libspud-dev - rm -f $(CURDIR)/debian/libspud-dev/usr/include/tiny*h - -install-spudtools: install-prereq - $(MAKE) install-spudtools DESTDIR=$(CURDIR)/debian/spudtools - -install-diamond: build-diamond install-prereq $(PYVERS:%=install-python%) - dh_install -install-prereq: - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs -a - -install-python%: -# Force setuptools, but reset sys.argv[0] to 'setup.py' because setup.py files expect that. - cd diamond;python$* -c "import setuptools,sys;f='setup.py';sys.argv[0]=f;execfile(f,{'__file__':f,'__name__':'__main__'})" install --prefix=/usr --no-compile --single-version-externally-managed --root=$(CURDIR)/debian/${PACKAGE_NAME} - if [ -d debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages/${MODULE_NAME}-${DEB_UPSTREAM_VERSION}.egg-info ]; then \ - mv debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages debian/${PACKAGE_NAME}/usr/lib/python$*/dist-packages ; \ - mv debian/${PACKAGE_NAME}/usr/lib/python$*/dist-packages/${MODULE_NAME}-${DEB_UPSTREAM_VERSION}.egg-info debian/${PACKAGE_NAME}/usr/lib/python$*/dist-packages/${MODULE_NAME}.egg-info ; \ - elif [ -d debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages/${MODULE_NAME}-${DEB_UPSTREAM_VERSION}-py$*.egg-info ]; then \ - mv debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages debian/${PACKAGE_NAME}/usr/lib/python$*/dist-packages ; \ - mv debian/${PACKAGE_NAME}/usr/lib/python$*/dist-packages/${MODULE_NAME}-${DEB_UPSTREAM_VERSION}-py$*.egg-info debian/${PACKAGE_NAME}/usr/lib/python$*/dist-packages/${MODULE_NAME}.egg-info ; \ - else \ - echo "Failed to locate python egg, was it built correctly?" && exit 1 ; \ - fi - -install-pyspud: - $(MAKE) install-pyspud DESTDIR=$(CURDIR)/debian/python-spud BUILDING_DEBIAN=yes - -install-dxdiff: - $(MAKE) install-dxdiff DESTDIR=$(CURDIR)/debian/python-dxdiff - -binary-arch: build-libspud install-libspud install-spudtools install-pyspud - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_installexamples -# dh_install -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime - dh_python2 -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_perl - dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary-indep: build-diamond install-diamond build-libspud install-libspud install-spudtools install-dxdiff - dh_testdir -i - dh_testroot -i - dh_python2 -i - dh_installdocs -i - dh_installdirs -i - dh_installexamples -i - dh_strip -i - dh_compress -i -X.py - dh_fixperms -i - : # Replace all '#!' calls to python with $(PYTHON) - : # and make them executable - for i in \ - `find debian/diamond/usr/bin -type f` \ - `find debian/diamond/usr/lib -type f`; \ - do \ - case "$$i" in *-[0-9].[0-9]) continue; esac; \ - sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python\1,' \ - $$i > $$i.temp; \ - if cmp --quiet $$i $$i.temp; then \ - rm -f $$i.temp; \ - else \ - mv -f $$i.temp $$i; \ - chmod 755 $$i; \ - echo "fixed interpreter: $$i"; \ - fi; \ - done - dh_installdeb -i - dh_gencontrol -i - dh_md5sums -i - dh_builddeb -i - -binary: binary-indep binary-arch - - -.PHONY: build clean binary-indep binary-arch binary-diamond binary-libspud install configure diff --git a/libspud/debian/spudtools.copyright b/libspud/debian/spudtools.copyright deleted file mode 100644 index 399848ab84..0000000000 --- a/libspud/debian/spudtools.copyright +++ /dev/null @@ -1,39 +0,0 @@ -Except as noted below, Spud is copyright (C) 2007 Imperial College -London and others. For a full list of contributors see the AUTHORS -file. - -Spud is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -On Debian systems, the complete text of the GNU Lesser General Public -License can be found in the file `/usr/share/common-licenses/LGPL-2.1'. - ------ - -Tinyxml is copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. \ No newline at end of file diff --git a/libspud/debian/spudtools.dirs b/libspud/debian/spudtools.dirs deleted file mode 100644 index e772481755..0000000000 --- a/libspud/debian/spudtools.dirs +++ /dev/null @@ -1 +0,0 @@ -usr/bin diff --git a/libspud/diamond/COPYING b/libspud/diamond/COPYING deleted file mode 100644 index f3ee2fe69d..0000000000 --- a/libspud/diamond/COPYING +++ /dev/null @@ -1,43 +0,0 @@ -Except as noted below, Diamond is copyright (C) 2007 Imperial College -London and others. For a full list of contributors see the AUTHORS -file. - -Diamond is free software: you can 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. - -The complete text of the GNU General Public License can be found -in the file `GPL-3'. - ------ - -pygtkconsole.py is copyright (C) 2003, Jon Anderson -Copyright (C) 2007 Imperial College London and others. -Please see the AUTHORS file for a full list of contributors. - -See www.python.org/2.2/license.htm for license details. - ------ - -TextBufferMarkup.py is copyright (C) 2005 Thomas M. Hinkle -Copyright (C) 2007 Imperial College London and others. For a full list -of contributors see the AUTHORS file. - -TextBufferMarkup.py is free software: you can 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. - -The complete text of the GNU General Public License can be found -in the file `GPL-3'. diff --git a/libspud/diamond/GPL-3 b/libspud/diamond/GPL-3 deleted file mode 100644 index 4432540474..0000000000 --- a/libspud/diamond/GPL-3 +++ /dev/null @@ -1,676 +0,0 @@ - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. - diff --git a/libspud/diamond/MANIFEST.in b/libspud/diamond/MANIFEST.in deleted file mode 100644 index b82013f065..0000000000 --- a/libspud/diamond/MANIFEST.in +++ /dev/null @@ -1,4 +0,0 @@ -include MANIFEST MANIFEST.in README.txt -include setup.py -include parse_rnc.py - diff --git a/libspud/diamond/README.txt b/libspud/diamond/README.txt deleted file mode 100644 index 87d09eef21..0000000000 --- a/libspud/diamond/README.txt +++ /dev/null @@ -1,8 +0,0 @@ -Diamond: -http://amcg.ese.ic.ac.uk/index.php?title=Local:Diamond - -The new Fluidity options system: -http://amcg.ese.ic.ac.uk/index.php?title=Local:Options - -Running Fluidity from new options: -http://amcg.ese.ic.ac.uk/index.php?title=Local:Running_Fluidity_from_new_options diff --git a/libspud/diamond/diamond/TextBufferMarkup.py b/libspud/diamond/diamond/TextBufferMarkup.py deleted file mode 100644 index e3f21dc0f4..0000000000 --- a/libspud/diamond/diamond/TextBufferMarkup.py +++ /dev/null @@ -1,406 +0,0 @@ -### Copyright (C) 2005 Thomas M. Hinkle -### Copyright (C) 2007 Imperial College London and others. -### Please see the AUTHORS file for a full list of contributors. -### -### This library is free software; you can 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 library is distributed in the hope that it will be useful, -### but WITHOUT ANY WARRANTY; without even the implied warranty of -### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -### General Public License for more details. -### -### You should have received a copy of the GNU General Public License -### along with this library; if not, write to the Free Software -### Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -### 02111-1307, USA. - -import pango,gtk, xml.sax.saxutils - -import debug - -class PangoBuffer (gtk.TextBuffer): - desc_to_attr_table = { - 'family':[pango.AttrFamily,""], - 'style':[pango.AttrStyle,pango.STYLE_NORMAL], - 'variant':[pango.AttrVariant,pango.VARIANT_NORMAL], - 'weight':[pango.AttrWeight,pango.WEIGHT_NORMAL], - 'stretch':[pango.AttrStretch,pango.STRETCH_NORMAL], - } - pango_translation_properties={ - # pango ATTR TYPE : (pango attr property / tag property) - pango.ATTR_SIZE : 'size', - pango.ATTR_WEIGHT: 'weight', - pango.ATTR_UNDERLINE: 'underline', - pango.ATTR_STRETCH: 'stretch', - pango.ATTR_VARIANT: 'variant', - pango.ATTR_STYLE: 'style', - pango.ATTR_SCALE: 'scale', - pango.ATTR_STRIKETHROUGH: 'strikethrough', - pango.ATTR_RISE: 'rise', - } - attval_to_markup={ - 'underline':{pango.UNDERLINE_SINGLE:'single', - pango.UNDERLINE_DOUBLE:'double', - pango.UNDERLINE_LOW:'low', - pango.UNDERLINE_NONE:'none'}, - 'stretch':{pango.STRETCH_ULTRA_EXPANDED:'ultraexpanded', - pango.STRETCH_EXPANDED:'expanded', - pango.STRETCH_EXTRA_EXPANDED:'extraexpanded', - pango.STRETCH_EXTRA_CONDENSED:'extracondensed', - pango.STRETCH_ULTRA_CONDENSED:'ultracondensed', - pango.STRETCH_CONDENSED:'condensed', - pango.STRETCH_NORMAL:'normal', - }, - 'variant':{pango.VARIANT_NORMAL:'normal', - pango.VARIANT_SMALL_CAPS:'smallcaps', - }, - 'style':{pango.STYLE_NORMAL:'normal', - pango.STYLE_OBLIQUE:'oblique', - pango.STYLE_ITALIC:'italic', - }, - 'stikethrough':{1:'true', - True:'true', - 0:'false', - False:'false'}, - } - def __init__ (self): - self.tagdict = {} - self.tags = {} - #self.buf = buf - #self.set_text(txt) - gtk.TextBuffer.__init__(self) - - def set_text (self, txt): - gtk.TextBuffer.set_text(self,"") - try: - self.parsed,self.txt,self.separator = pango.parse_markup(txt,u'\x00') - except: - debug.deprint('Escaping text, we seem to have a problem here!', 2) - txt=xml.sax.saxutils.escape(txt) - self.parsed,self.txt,self.separator = pango.parse_markup(txt,u'\x00') - self.attrIter = self.parsed.get_iterator() - self.add_iter_to_buffer() - while self.attrIter.next(): - self.add_iter_to_buffer() - - def add_iter_to_buffer (self): - range=self.attrIter.range() - font,lang,attrs = self.attrIter.get_font() - tags = self.get_tags_from_attrs(font,lang,attrs) - text = self.txt[range[0]:range[1]] - if tags: self.insert_with_tags(self.get_end_iter(),text,*tags) - else: self.insert_with_tags(self.get_end_iter(),text) - - def get_tags_from_attrs (self, font,lang,attrs): - tags = [] - if font: - font,fontattrs = self.fontdesc_to_attrs(font) - fontdesc = font.to_string() - if fontattrs: - attrs.extend(fontattrs) - if fontdesc and fontdesc!='Normal': - if not self.tags.has_key(font.to_string()): - tag=self.create_tag() - tag.set_property('font-desc',font) - if not self.tagdict.has_key(tag): self.tagdict[tag]={} - self.tagdict[tag]['font_desc']=font.to_string() - self.tags[font.to_string()]=tag - tags.append(self.tags[font.to_string()]) - if lang: - if not self.tags.has_key(lang): - tag = self.create_tag() - tag.set_property('language',lang) - self.tags[lang]=tag - tags.append(self.tags[lang]) - if attrs: - for a in attrs: - if a.type == pango.ATTR_FOREGROUND: - gdkcolor = self.pango_color_to_gdk(a.color) - key = 'foreground%s'%self.color_to_hex(gdkcolor) - if not self.tags.has_key(key): - self.tags[key]=self.create_tag() - self.tags[key].set_property('foreground-gdk',gdkcolor) - self.tagdict[self.tags[key]]={} - self.tagdict[self.tags[key]]['foreground']="#%s"%self.color_to_hex(gdkcolor) - tags.append(self.tags[key]) - if a.type == pango.ATTR_BACKGROUND: - gdkcolor = self.pango_color_to_gdk(a.color) - key = 'background%s'%self.color_to_hex(gdkcolor) - if not self.tags.has_key(key): - self.tags[key]=self.create_tag() - self.tags[key].set_property('background-gdk',gdkcolor) - self.tagdict[self.tags[key]]={} - self.tagdict[self.tags[key]]['background']="#%s"%self.color_to_hex(gdkcolor) - tags.append(self.tags[key]) - if self.pango_translation_properties.has_key(a.type): - prop=self.pango_translation_properties[a.type] - #print 'setting property %s of %s (type: %s)'%(prop,a,a.type) - val=getattr(a,'value') - #tag.set_property(prop,val) - mval = val - if self.attval_to_markup.has_key(prop): - #print 'converting ',prop,' in ',val - if self.attval_to_markup[prop].has_key(val): - mval = self.attval_to_markup[prop][val] - else: - debug.deprint("hmmm, didn't know what to do with value %s"%val, 2) - key="%s%s"%(prop,val) - if not self.tags.has_key(key): - self.tags[key]=self.create_tag() - self.tags[key].set_property(prop,val) - self.tagdict[self.tags[key]]={} - self.tagdict[self.tags[key]][prop]=mval - tags.append(self.tags[key]) - return tags - - def get_tags (self): - tagdict = {} - for pos in range(self.get_char_count()): - iter=self.get_iter_at_offset(pos) - for tag in iter.get_tags(): - if tagdict.has_key(tag): - if tagdict[tag][-1][1] == pos - 1: - tagdict[tag][-1] = (tagdict[tag][-1][0],pos) - else: - tagdict[tag].append((pos,pos)) - else: - tagdict[tag]=[(pos,pos)] - return tagdict - - def get_text (self, start=None, end=None, include_hidden_chars=True): - tagdict=self.get_tags() - if not start: start=self.get_start_iter() - if not end: end=self.get_end_iter() - txt = unicode(gtk.TextBuffer.get_text(self,start,end)) - cuts = {} - for k,v in tagdict.items(): - stag,etag = self.tag_to_markup(k) - for st,e in v: - if cuts.has_key(st): cuts[st].append(stag) #add start tags second - else: cuts[st]=[stag] - if cuts.has_key(e+1): cuts[e+1]=[etag]+cuts[e+1] #add end tags first - else: cuts[e+1]=[etag] - last_pos = 0 - outbuff = "" - cut_indices = cuts.keys() - cut_indices.sort() - soffset = start.get_offset() - eoffset = end.get_offset() - cut_indices = filter(lambda i: eoffset >= i >= soffset, cut_indices) - for c in cut_indices: - if not last_pos==c: - outbuff += xml.sax.saxutils.escape(txt[last_pos:c]) - last_pos = c - for tag in cuts[c]: - outbuff += tag - outbuff += xml.sax.saxutils.escape(txt[last_pos:]) - return outbuff - - def tag_to_markup (self, tag): - stag = "" - - def fontdesc_to_attrs (self,font): - nicks = font.get_set_fields().value_nicks - attrs = [] - for n in nicks: - if self.desc_to_attr_table.has_key(n): - Attr,norm = self.desc_to_attr_table[n] - # create an attribute with our current value - attrs.append(Attr(getattr(font,'get_%s'%n)())) - # unset our font's value - getattr(font,'set_%s'%n)(norm) - return font,attrs - - def pango_color_to_gdk (self, pc): - return gtk.gdk.Color(pc.red,pc.green,pc.blue) - - def color_to_hex (self, color): - hexstring = "" - for col in 'red','green','blue': - hexfrag = hex(getattr(color,col)/(16*16)).split("x")[1] - if len(hexfrag)<2: hexfrag = "0" + hexfrag - hexstring += hexfrag - return hexstring - - def apply_font_and_attrs (self, font, attrs): - tags = self.get_tags_from_attrs(font,None,attrs) - for t in tags: self.apply_tag_to_selection(t) - - def remove_font_and_attrs (self, font, attrs): - tags = self.get_tags_from_attrs(font,None,attrs) - for t in tags: self.remove_tag_from_selection(t) - - def setup_default_tags (self): - self.italics = self.get_tags_from_attrs(None,None,[pango.AttrStyle('italic')])[0] - self.bold = self.get_tags_from_attrs(None,None,[pango.AttrWeight('bold')])[0] - self.underline = self.get_tags_from_attrs(None,None,[pango.AttrUnderline('single')])[0] - - def get_selection (self): - bounds = self.get_selection_bounds() - if not bounds: - iter=self.get_iter_at_mark(self.get_insert()) - if iter.inside_word(): - start_pos = iter.get_offset() - iter.forward_word_end() - word_end = iter.get_offset() - iter.backward_word_start() - word_start = iter.get_offset() - iter.set_offset(start_pos) - bounds = (self.get_iter_at_offset(word_start), - self.get_iter_at_offset(word_end+1)) - else: - bounds = (iter,self.get_iter_at_offset(iter.get_offset()+1)) - return bounds - - def apply_tag_to_selection (self, tag): - selection = self.get_selection() - if selection: - self.apply_tag(tag,*selection) - - def remove_tag_from_selection (self, tag): - selection = self.get_selection() - if selection: - self.remove_tag(tag,*selection) - - def remove_all_tags (self): - selection = self.get_selection() - if selection: - for t in self.tags.values(): - self.remove_tag(t,*selection) - -class InteractivePangoBuffer (PangoBuffer): - def __init__ (self, - normal_button=None, - toggle_widget_alist=[]): - """An interactive interface to allow marking up a gtk.TextBuffer. - txt is initial text, with markup. - buf is the gtk.TextBuffer - normal_button is a widget whose clicked signal will make us normal - toggle_widget_alist is a list that looks like this: - [(widget, (font,attr)), - (widget2, (font,attr))] - """ - PangoBuffer.__init__(self) - if normal_button: normal_button.connect('clicked',lambda *args: self.remove_all_tags()) - self.tag_widgets = {} - self.internal_toggle = False - self.insert = self.get_insert() - self.connect('mark-set',self._mark_set_cb) - self.connect('changed',self._changed_cb) - for w,tup in toggle_widget_alist: - self.setup_widget(w,*tup) - - def setup_widget_from_pango (self, widg, markupstring): - """setup widget from a pango markup string""" - #font = pango.FontDescription(fontstring) - a,t,s = pango.parse_markup(markupstring,u'\x00') - ai=a.get_iterator() - font,lang,attrs=ai.get_font() - return self.setup_widget(widg,font,attrs) - - def setup_widget (self, widg, font, attr): - tags=self.get_tags_from_attrs(font,None,attr) - self.tag_widgets[tuple(tags)]=widg - return widg.connect('toggled',self._toggle,tags) - - def _toggle (self, widget, tags): - if self.internal_toggle: return - if widget.get_active(): - for t in tags: self.apply_tag_to_selection(t) - else: - for t in tags: self.remove_tag_from_selection(t) - - def _mark_set_cb (self, buffer, iter, mark, *params): - # Every time the cursor moves, update our widgets that reflect - # the state of the text. - if hasattr(self,'_in_mark_set') and self._in_mark_set: return - self._in_mark_set = True - if mark.get_name()=='insert': - for tags,widg in self.tag_widgets.items(): - active = True - for t in tags: - if not iter.has_tag(t): - active=False - self.internal_toggle=True - widg.set_active(active) - self.internal_toggle=False - if hasattr(self,'last_mark'): - self.move_mark(self.last_mark,iter) - else: - self.last_mark = self.create_mark('last',iter,left_gravity=True) - self._in_mark_set = False - - def _changed_cb (self, tb): - if not hasattr(self,'last_mark'): return - # If our insertion point has a mark, we want to apply the tag - # each time the user types... - old_itr = self.get_iter_at_mark(self.last_mark) - insert_itr = self.get_iter_at_mark(self.insert) - if old_itr!=insert_itr: - # Use the state of our widgets to determine what - # properties to apply... - for tags,w in self.tag_widgets.items(): - if w.get_active(): - #print 'apply tags...',tags - for t in tags: self.apply_tag(t,old_itr,insert_itr) - - - - - -class SimpleEditor: - def __init__ (self): - self.w = gtk.Window() - self.vb = gtk.VBox() - self.editBox = gtk.HButtonBox() - self.nb = gtk.Button('Normal') - self.editBox.add(self.nb) - self.sw = gtk.ScrolledWindow() - self.tv = gtk.TextView() - self.sw.add(self.tv) - self.ipb = InteractivePangoBuffer( - normal_button=self.nb) - self.ipb.set_text("""This is bold. This is italic - This is bold, italic, and underlined! - This is a test of bg color - This is a test of fg color - This is a test of fg and bg color - """) - # Here are some more: 1-2, 2-3, 3-4, 10-20, 30-40, 50-60 - # This is blue, red and green""") - #self.ipb.set_text("""This is a numerical range (three hundred and fifty to four hundred) 350-400 which may get messed up. - #Here are some more: 1-2, 2-3, 3-4, 10-20, 30-40, 50-60""") - - self.tv.set_buffer(self.ipb) - for lab,stock,font in [('gtk-italic',True,'italic'), - ('gtk-bold',True,'bold'), - ('gtk-underline',True,'underline'), - ('Blue',True,'blue'), - ('Red',False,'smallcaps'), - ]: - button = gtk.ToggleButton(lab) - self.editBox.add(button) - if stock: button.set_use_stock(True) - self.ipb.setup_widget_from_pango(button,font) - self.vb.add(self.editBox) - self.vb.add(self.sw) - self.actionBox = gtk.HButtonBox() - self.qb = gtk.Button(stock='quit') - self.pmbut = gtk.Button('Print markup') - self.pmbut.connect('clicked',self.print_markup) - self.qb.connect('clicked',lambda *args: self.w.destroy() or gtk.main_quit()) - self.actionBox.add(self.pmbut) - self.actionBox.add(self.qb) - self.vb.add(self.actionBox) - self.w.add(self.vb) - self.w.show_all() - - def print_markup (self,*args): - debug.dprint(self.ipb.get_text(), 0) diff --git a/libspud/diamond/diamond/__init__.py b/libspud/diamond/diamond/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libspud/diamond/diamond/attributewidget.py b/libspud/diamond/diamond/attributewidget.py deleted file mode 100644 index c6128bfecd..0000000000 --- a/libspud/diamond/diamond/attributewidget.py +++ /dev/null @@ -1,341 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import gobject -import gtk - -import datatype -import dialogs - -class AttributeWidget(gtk.Frame): - - __gsignals__ = { "on-store" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), - "update-name" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ())} - - def __init__(self): - gtk.Frame.__init__(self) - - scrolledWindow = gtk.ScrolledWindow() - scrolledWindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) - - treeview = self.treeview = gtk.TreeView() - - model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT) - treeview.set_model(model) - treeview.connect("motion-notify-event", self.treeview_mouse_over) - - key_renderer = gtk.CellRendererText() - key_renderer.set_property("editable", False) - - column1 = gtk.TreeViewColumn("Name", key_renderer, text = 0) - column1.set_cell_data_func(key_renderer, self.key_data_func) - column1.set_property("min-width", 75) - - entry_renderer = gtk.CellRendererText() - entry_renderer.connect("edited", self.entry_edited) - entry_renderer.connect("editing-started", self.entry_edit_start) - - combo_renderer = gtk.CellRendererCombo() - combo_renderer.set_property("text-column", 0) - combo_renderer.connect("edited", self.combo_selected) - combo_renderer.connect("editing-started", self.combo_edit_start) - - column2 = gtk.TreeViewColumn("Value", entry_renderer, text = 1) - column2.pack_start(combo_renderer) - column2.set_attributes(combo_renderer, text = 1) - column2.set_cell_data_func(entry_renderer, self.entry_data_func) - column2.set_cell_data_func(combo_renderer, self.combo_data_func) - column2.set_property("expand", True) - column2.set_property("min-width", 75) - - icon_renderer = gtk.CellRendererPixbuf() - - column3 = gtk.TreeViewColumn("", icon_renderer) - column3.set_cell_data_func(icon_renderer, self.icon_data_func) - - treeview.append_column(column1) - treeview.append_column(column2) - treeview.append_column(column3) - - scrolledWindow.add(treeview) - - label = gtk.Label() - label.set_markup("Attributes") - - self.set_label_widget(label) - self.set_shadow_type(gtk.SHADOW_NONE) - self.add(scrolledWindow) - - def update(self, node): - - self.treeview.get_model().clear() - - self.node = node - - if node is None or node.all_attrs_fixed(): - self.set_property("visible", False) - else: - self.set_property("visible", True) - - for key in node.attrs.keys(): - model = self.treeview.get_model() - cell_model = gtk.ListStore(gobject.TYPE_STRING) - - iter = model.append() - model.set_value(iter, 0, key) - model.set_value(iter, 2, cell_model) - - if isinstance(node.attrs[key][0], tuple): - if node.attrs[key][1] is None: - if isinstance(node.attrs[key][0][0], tuple): - model.set_value(iter, 1, "Select " + datatype.print_type(node.attrs[key][0][1]) + "...") - else: - model.set_value(iter, 1, "Select...") - else: - model.set_value(iter, 1, node.attrs[key][1]) - - if isinstance(node.attrs[key][0][0], tuple): - opts = node.attrs[key][0][0] - else: - opts = node.attrs[key][0] - - for opt in opts: - cell_iter = cell_model.append() - cell_model.set_value(cell_iter, 0, opt) - - self.treeview.get_column(2).set_property("visible", True) - elif node.attrs[key][0] is None: - model.set_value(iter, 1, "No data") - elif node.attrs[key][1] is None: - model.set_value(iter, 1, datatype.print_type(node.attrs[key][0])) - else: - model.set_value(iter, 1, node.attrs[key][1]) - - self.treeview.queue_resize() - - return - - def treeview_mouse_over(self, widget, event): - """ - Called when the mouse moves over the attributes widget. Sets the - appropriate attribute widget tooltip. - """ - - path_info = self.treeview.get_path_at_pos(int(event.x), int(event.y)) - if path_info is None: - try: - self.treeview.set_tooltip_text("") - self.treeview.set_property("has-tooltip", False) - except: - pass - return - - path = path_info[0] - col = path_info[1] - if col is not self.treeview.get_column(1): - try: - self.treeview.set_tooltip_text("") - self.treeview.set_property("has-tooltip", False) - except: - pass - return - - iter = self.treeview.get_model().get_iter(path) - iter_key = self.treeview.get_model().get_value(iter, 0) - - return - - def key_data_func(self, col, cell_renderer, model, iter): - """ - Attribute name data function. Sets the cell renderer text colours. - """ - - iter_key = model.get_value(iter, 0) - - if not self.node.active or self.node.attrs[iter_key][0] is None or self.node.attrs[iter_key][0] == "fixed": - cell_renderer.set_property("foreground", "grey") - elif self.node.attrs[iter_key][1] is None: - cell_renderer.set_property("foreground", "blue") - else: - cell_renderer.set_property("foreground", "black") - - return - - def entry_data_func(self, col, cell_renderer, model, iter): - """ - Attribute text data function. Hides the renderer if a combo box is required, - and sets colours and editability otherwise. - """ - - iter_key = model.get_value(iter, 0) - - if not self.node.active or self.node.attrs[iter_key][0] is None or self.node.attrs[iter_key][0] == "fixed": - cell_renderer.set_property("editable", False) - cell_renderer.set_property("foreground", "grey") - cell_renderer.set_property("visible", True) - elif not isinstance(self.node.attrs[iter_key][0], tuple): - cell_renderer.set_property("editable", True) - cell_renderer.set_property("visible", True) - if self.node.attrs[iter_key][1] is None: - cell_renderer.set_property("foreground", "blue") - else: - cell_renderer.set_property("foreground", "black") - else: - cell_renderer.set_property("editable", False) - cell_renderer.set_property("visible", False) - - return - - def combo_data_func(self, col, cell_renderer, model, iter): - """ - Attribute combo box data function. Hides the renderer if a combo box is not - required, and sets the combo box options otherwise. Adds an entry if required. - """ - - iter_key = model.get_value(iter, 0) - - if self.node.active and isinstance(self.node.attrs[iter_key][0], tuple): - cell_renderer.set_property("editable", True) - cell_renderer.set_property("visible", True) - if isinstance(self.node.attrs[iter_key][0][0], tuple): - cell_renderer.set_property("has-entry", True) - else: - cell_renderer.set_property("has-entry", False) - if self.node.attrs[iter_key][1] is None: - cell_renderer.set_property("foreground", "blue") - else: - cell_renderer.set_property("foreground", "black") - else: - cell_renderer.set_property("visible", False) - cell_renderer.set_property("editable", False) - cell_renderer.set_property("model", model.get_value(iter, 2)) - - return - - def icon_data_func(self, col, cell_renderer, model, iter): - """ - Attribute icon data function. Used to add downward pointing arrows for combo - attributes, for consistency with the LHS. - """ - - iter_key = model.get_value(iter, 0) - - if self.node.active and isinstance(self.node.attrs[iter_key][0], tuple): - cell_renderer.set_property("stock-id", gtk.STOCK_GO_DOWN) - else: - cell_renderer.set_property("stock-id", None) - - return - - def entry_edit_start(self, cell_renderer, editable, path): - """ - Called when editing is started on an attribute text cell. Used to delete the - printable_type placeholder. - """ - - iter = self.treeview.get_model().get_iter(path) - iter_key = self.treeview.get_model().get_value(iter, 0) - - if self.node.attrs[iter_key][1] is None: - editable.set_text("") - - return - - def combo_edit_start(self, cell_renderer, editable, path): - """ - Called when editing is started on an attribute combo cell. Used to delete the - select placeholder for mixed entry / combo attributes. - """ - - iter = self.treeview.get_model().get_iter(path) - iter_key = self.treeview.get_model().get_value(iter, 0) - - if isinstance(self.node.attrs[iter_key][0][0], tuple) and self.node.attrs[iter_key][1] is None: - editable.child.set_text("") - - return - - def entry_edited(self, cell_renderer, path, new_text): - """ - Called when editing is finished on an attribute text cell. Updates data in the - treestore. - """ - - iter = self.treeview.get_model().get_iter(path) - iter_key = self.treeview.get_model().get_value(iter, 0) - - if self.node.get_attr(iter_key) is None and new_text == "": - return - - value_check = self.node.validity_check(self.node.attrs[iter_key][0], new_text) - - if value_check is not None and value_check != self.node.attrs[iter_key][1]: - if iter_key == "name" and not self._name_check(value_check): - return - - self.treeview.get_model().set_value(iter, 1, value_check) - self.node.set_attr(iter_key, value_check) - if iter_key == "name": - self.emit("update-name") - - self.emit("on-store") - - return - - def combo_selected(self, cell_renderer, path, new_text): - """ - Called when an attribute combo box element is selected, or combo box entry - element entry is edited. Updates data in the treestore. - """ - - iter = self.treeview.get_model().get_iter(path) - iter_key = self.treeview.get_model().get_value(iter, 0) - - if new_text is None: - return - - if isinstance(self.node.attrs[iter_key][0][0], tuple) and new_text not in self.node.attrs[iter_key][0][0]: - if self.node.get_attr(iter_key) is None and new_text == "": - return - - new_text = self.node.validity_check(self.node.attrs[iter_key][0][1], new_text) - if iter_key == "name" and not self._name_check(new_text): - return False - if new_text != self.node.attrs[iter_key][1]: - self.treeview.get_model().set_value(iter, 1, new_text) - self.node.set_attr(iter_key, new_text) - if iter_key == "name": - self.emit("update-name") - - self.emit("on-store") - - return - - def _name_check(self, value): - """ - Check to see if the supplied data is a valid tree name. - """ - - valid_chars = "_:[]1234567890qwertyuioplkjhgfdsazxcvbnmMNBVCXZASDFGHJKLPOIUYTREWQ" - for char in value: - if char not in valid_chars: - dialogs.error(None, "Invalid value entered") - return False - - return True - -gobject.type_register(AttributeWidget) diff --git a/libspud/diamond/diamond/choice.py b/libspud/diamond/diamond/choice.py deleted file mode 100644 index 75cc474e9a..0000000000 --- a/libspud/diamond/diamond/choice.py +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import base64 -import bz2 -import copy -import StringIO -from lxml import etree - - -import gobject - -import tree - -class Choice(gobject.GObject): - - __gsignals__ = { "on-set-data" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (str,)), - "on-set-attr" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (str, str))} - - def __init__(self, choices, schemaname="", cardinality=''): - gobject.GObject.__init__(self) - - self.choices = choices - if choices == []: - raise Exception - self.index = 0 - name = "" - for choice in choices: - assert choice.__class__ is tree.Tree - choice.connect("on-set-data", self._on_set_data) - choice.connect("on-set-attr", self._on_set_attr) - - name = ":".join(choice.name for choice in choices) - - self.name = name - self.schemaname = schemaname - self.cardinality = cardinality - self.parent = None - self.set_default_active() - - def _on_set_data(self, node, data): - self.emit("on-set-data", data) - - def _on_set_attr(self, node, attr, value): - self.emit("on-set-attr", attr, value) - - def get_attrs(self): - """Get all attributes""" - return self.get_current_tree().get_attrs() - - def set_default_active(self): - self.active = True - if self.cardinality == '?' or self.cardinality == '*': - self.active = False - - def choose(self, i): - self.index = i - - def find_tree(self, name): - for t in self.choices: - if t.name == name: - return t - - debug.deprint("self.name == %s" % self.name, 0) - for choice in self.choices: - debug.deprint("choice.name == %s" % choice.name, 0) - raise Exception, "No such choice name: %s" % name - - def set_active_choice_by_name(self, name): - matched = False - for t in self.choices: - if t.name == name.strip(): - matched = True - self.index = self.choices.index(t) - - if not matched: - raise Exception, "no such name %s found" % name - - self.recompute_validity() - - def set_active_choice_by_ref(self, ref): - self.index = self.choices.index(ref) - self.recompute_validity() - - def get_current_tree(self): - return self.choices[self.index] - - def add_children(self, schema): - return self.get_current_tree().add_children(schema) - - def pickle(self): - return base64.b64encode(bz2.compress(pickle.dumps(self))) - - def recompute_validity(self): - self.get_current_tree().recompute_validity() - - def copy(self): - new_choices = [] - for choice in self.choices: - new_choices.append(choice.copy()) - - new_choice = Choice(new_choices) - for attr in ["index", "name", "schemaname", "cardinality", "active"]: - setattr(new_choice, attr, copy.copy(getattr(self, attr))) - - new_choice.set_parent(self.parent) - for choice in new_choice.choices: - choice.children = copy.copy([]) - - return new_choice - - def get_possible_names(self): - return [x.name for x in self.choices] - - def set_parent(self, parent): - self.parent = parent - for choice in self.choices: - choice.parent = parent - - def write_core(self, parent): - self.choices[self.index].write_core(parent) - return parent - - def is_comment(self): - return False - - def get_comment(self): - return None - - def get_display_name(self): - """ - This is a fluidity hack, allowing the name displayed in the treeview on the - left to be different to the element name. If it has an attribute name="xxx", - element_tag (xxx) is displayed. - """ - - return self.get_current_tree().get_display_name() - - def get_name(self): - return self.get_current_tree().get_name() - - def get_children(self): - return [self.get_current_tree()] - - def get_choices(self): - return self.choices - - def is_hidden(self): - """ - Tests whether the supplied choice should be hidden in view. - """ - return False - - def get_name_path(self, leaf = True): - return self.get_current_tree().get_name_path(leaf) - - def get_mixed_data(self): - return self - - def is_sliceable(self): - return self.get_current_tree().is_sliceable() - - def __str__(self): - """ - Returns the display name of the selected tree. - """ - return self.get_display_name() - - def __repr__(self): - return self.get_name_path() + "[" + self.name + "]" - -gobject.type_register(Choice) diff --git a/libspud/diamond/diamond/commentwidget.py b/libspud/diamond/diamond/commentwidget.py deleted file mode 100644 index 394dfb3b9f..0000000000 --- a/libspud/diamond/diamond/commentwidget.py +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import gobject -import gtk - -class CommentWidget(gtk.Frame): - - __gsignals__ = { "on-store" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ())} - - def __init__(self): - gtk.Frame.__init__(self) - - scrolledWindow = gtk.ScrolledWindow() - scrolledWindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) - - textView = self.textView = gtk.TextView() - textView.set_editable(False) - textView.set_wrap_mode(gtk.WRAP_WORD) - textView.set_cursor_visible(False) - textView.connect("focus-in-event", self.focus_in) - textView.connect("focus-out-event", self.focus_out) - textView.get_buffer().create_tag("tag") - - scrolledWindow.add(textView) - - label = gtk.Label() - label.set_markup("Comment") - - self.set_shadow_type(gtk.SHADOW_NONE) - self.set_label_widget(label) - self.add(scrolledWindow) - - self.comment_tree = None - return - - def update(self, node): - """ - Update the widget with the given node - """ - - #before updateing store the old - self.store() - - if node is None or not node.active: - self.textView.get_buffer().set_text("") - self.textView.set_cursor_visible(False) - self.textView.set_editable(False) - try: - self.textView.set_tooltip_text("") - self.textView.set_property("has-tooltip", False) - except: - pass - - return - - self.comment_tree = comment_tree = node.get_comment() - text_tag = self.textView.get_buffer().get_tag_table().lookup("tag") - if comment_tree is None: - self.textView.get_buffer().set_text("No comment") - self.textView.set_cursor_visible(False) - self.textView.set_editable(False) - text_tag.set_property("foreground", "grey") - try: - self.textView.set_tooltip_text("") - self.textView.set_property("has-tooltip", False) - except: - pass - else: - if comment_tree.data is None: - self.textView.get_buffer().set_text("(string)") - else: - self.textView.get_buffer().set_text(comment_tree.data) - if node.active: - self.textView.set_cursor_visible(True) - self.textView.set_editable(True) - text_tag.set_property("foreground", "black") - else: - self.textView.set_cursor_visible(False) - self.textView.set_editable(False) - text_tag.set_property("foreground", "grey") - - buffer_bounds = self.textView.get_buffer().get_bounds() - self.textView.get_buffer().apply_tag(text_tag, buffer_bounds[0], buffer_bounds[1]) - - self.interacted = False - - return - - def store(self): - """ - Store data in the node comment. - """ - - comment_tree = self.comment_tree - if comment_tree is None or not self.interacted: - return - - data_buffer_bounds = self.textView.get_buffer().get_bounds() - new_comment = self.textView.get_buffer().get_text(data_buffer_bounds[0], data_buffer_bounds[1]) - - if new_comment != comment_tree.data: - if new_comment == "": - comment_tree.data = None - comment_tree.active = False - else: - comment_tree.set_data(new_comment) - comment_tree.active = True - self.emit("on-store") - return - - def focus_in(self, widget, event): - """ - Called when the comment widget gains focus. Removes the printable_type - placeholder. - """ - - comment_tree = self.comment_tree - if not comment_tree is None and not self.interacted: - self.interacted = True - if comment_tree.data is None: - self.textView.get_buffer().set_text("") - - return - - def focus_out(self, widget, event): - """" - Called when the comment widget loses focus. Stores the comment. - """ - self.store() - -gobject.type_register(CommentWidget) diff --git a/libspud/diamond/diamond/config.py b/libspud/diamond/diamond/config.py deleted file mode 100644 index 34a559949b..0000000000 --- a/libspud/diamond/diamond/config.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import os -import os.path -import sys -import ConfigParser - -import debug - -dirs = [] -if sys.platform != "win32" and sys.platform != "win64": - dirs.append("/usr/share/diamond") - dirs.append("/etc/diamond") -dirs.append(os.path.join(os.path.expanduser('~'), ".diamond")) -if "DIAMOND_CONFIG_PATH" in os.environ: - dirs += reversed(os.environ["DIAMOND_CONFIG_PATH"].split(":")) - -config = ConfigParser.SafeConfigParser() -config.read([os.path.join(path, "settings") for path in reversed(dirs)]) #reversed to load usr last - -try: - config.add_section("colour") -except ConfigParser.DuplicateSectionError: - pass - -def __set_default(option, value): - if not config.has_option("colour", option): - config.set("colour", option, value) - -__set_default("normal", "black") -__set_default("insert", "green") -__set_default("delete", "red") -__set_default("update", "blue") -__set_default("subupdate", "cornflowerblue") -__set_default("diffadd", "lightgreen") -__set_default("diffsub", "indianred") - -schemata = {} - -for dir in [os.path.join(path, "schemata") for path in dirs]: - try: - for file in os.listdir(dir): - if file[-1] == "~" or file[0] == ".": #skip files like .nfs0000 - continue # bloody emacs - # Skip item gracefully here if there's a problem. - # This is useful if the schemata files are in a subversion - # repository and there's pesky .svn folders around. - try: - handle = open(os.path.join(dir, file)) - except: - debug.deprint("Failure to examine entry " + file + " in folder " + dir + ".") - continue - lines = [x.strip() for x in handle if x.strip()] - if len(lines) < 2: - debug.deprint("Warning: Found schema registration file \"" + file + "\", but file is improperly formatted - schema type not registered", 0) - continue - - # Expand environment variables in the schema path - alias = {} - for i in range(1, len(lines)): - line = lines[i] - - keyvalue = [x.strip() for x in line.split("=")] - if len(keyvalue) == 1: - key, value = ("default", keyvalue[0]) - elif len(keyvalue) == 2: - (key, value) = keyvalue - else: - debug.deprint("Warning: ignoring line %s" % line) - continue - - value = os.path.expandvars(value) - - if key in alias: - debug.deprint("""alias "%s" already registered, ignoring""" % key) - else: - alias[key] = value - if key == "default": - alias[None] = value - - schemata[file] = (lines[0], alias) - debug.dprint("Registered schema type: " + file) - except OSError: - pass - -if __name__ == "__main__": - for key in schemata: - debug.dprint("%s: %s" % (key, schemata[key]), 0) diff --git a/libspud/diamond/diamond/databuttonswidget.py b/libspud/diamond/diamond/databuttonswidget.py deleted file mode 100644 index 5cb4f3d7bb..0000000000 --- a/libspud/diamond/diamond/databuttonswidget.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import gobject -import gtk - -class DataButtonsWidget(gtk.HBox): - - __gsignals__ = { "revert" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), - "store" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ())} - - def __init__(self): - gtk.HBox.__gobject_init__(self) - revertButton = gtk.Button() - revertButton.set_label("Revert data") - revertButton.connect("clicked", self._revert) - - storeButton = gtk.Button() - storeButton.set_label("Store data") - storeButton.connect("clicked", self._store) - - self.pack_start(revertButton) - self.pack_end(storeButton) - - return - - def _revert(self, widget = None): - self.emit("revert") - - def _store(self, widget = None): - self.emit("store") - -gobject.type_register(DataButtonsWidget) diff --git a/libspud/diamond/diamond/datatype.py b/libspud/diamond/diamond/datatype.py deleted file mode 100644 index ae261a4509..0000000000 --- a/libspud/diamond/diamond/datatype.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import plist - -def print_type(datatype, bracket = True): - """ - Create a string to be displayed in place of empty data / attributes. - """ - - def familiar_type(type_as_printable): - """ - Convert some type names to more familiar equivalents. - """ - - if type_as_printable == "decim": - return "float" - elif type_as_printable == "int": - return "integer" - elif type_as_printable == "str": - return "string" - else: - return type_as_printable - - def type_name(datatype): - """ - Return a human readable version of datatype. - """ - - datatype_string = str(datatype) - - if datatype_string[:7] == "": - value_type_split = datatype_string.split("'") - return familiar_type(value_type_split[1]) - - value_type_split1 = datatype_string.split(".") - value_type_split2 = value_type_split1[len(value_type_split1) - 1].split(" ") - if len(value_type_split2) == 1: - return familiar_type(value_type_split2[0][0:len(value_type_split2[0]) - 6]) - else: - return familiar_type(value_type_split2[0]) - - #print_type - - if isinstance(datatype, plist.List): - if (isinstance(datatype.cardinality, int) and datatype.cardinality == 1) or datatype.cardinality == "": - type_as_printable = type_name(datatype.datatype).lower() - else: - type_as_printable = type_name(datatype).lower() + " of " - list_type_as_printable = type_name(datatype.datatype).lower() - if isinstance(datatype.cardinality, int): - type_as_printable += str(datatype.cardinality) + " " + list_type_as_printable + "s" - else: - type_as_printable += list_type_as_printable + "s" - else: - type_as_printable = type_name(datatype).lower() - - if bracket: - type_as_printable = "(" + type_as_printable + ")" - - return type_as_printable diff --git a/libspud/diamond/diamond/datawidget.py b/libspud/diamond/diamond/datawidget.py deleted file mode 100644 index 4dd20a285f..0000000000 --- a/libspud/diamond/diamond/datawidget.py +++ /dev/null @@ -1,512 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import gobject -import gtk -import pango - -import dialogs -import datatype -import mixedtree -import plist - -class DataWidget(gtk.VBox): - - __gsignals__ = { "on-store" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ())} - - def __init__(self): - gtk.VBox.__init__(self) - - frame = self.frame = gtk.Frame() - - label = gtk.Label() - label.set_markup("Data") - - frame.set_label_widget(label) - frame.set_shadow_type(gtk.SHADOW_NONE) - - self.pack_start(frame) - self.buttons = None - return - - def set_buttons(self, buttons): - self.buttons = buttons - buttons.connect("revert", self.revert) - buttons.connect("store", self.store) - buttons.show_all() - - def update(self, node): - - self.node = node - - if not self.is_node_editable(): - self.set_data_fixed() - elif node.is_tensor(self.geometry_dim_tree): - self.set_data_tensor() - elif isinstance(node.datatype, tuple): - self.set_data_combo() - else: - self.set_data_entry() - - return - - def revert(self, button = None): - """ - "Revert Data" button click signal handler. Reverts data in the data frame. - """ - - self.update(self.node) - - return - - def store(self, button = None): - """ - "Store Data" button click signal handler. Stores data from the data frame - in the treestore. - """ - - if not self.is_node_editable(): - return True - elif self.node.is_tensor(self.geometry_dim_tree): - return self.data_tensor_store() - elif isinstance(self.node.datatype, tuple): - return self.data_combo_store() - else: - return self.data_entry_store() - -# This would be nice, look at it later -# if self.scherror.errlist_is_open(): -# if self.scherror.errlist_type == 0: -# self.scherror.on_validate_schematron() -# else: -# self.scherror.on_validate() - - def is_node_editable(self): - return (self.node is not None - and self.node.active - and self.node.datatype is not None - and self.node.datatype != "fixed" - and (not self.node.is_tensor(self.geometry_dim_tree) or self.geometry_dim_tree.data is not None)) - # not A or B == A implies B - # A B T - # 0 0 1 - # 0 1 1 - # 1 0 0 - # 1 1 1 - - def add_scrolled_window(self): - scrolledWindow = gtk.ScrolledWindow() - scrolledWindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) - self.frame.add(scrolledWindow) - scrolledWindow.show() - return scrolledWindow - - def add_text_view(self): - scrolledWindow = self.add_scrolled_window() - self.set_child_packing(self.frame, True, True, 0, gtk.PACK_START) - - try: - import gtksourceview2 - buf = gtksourceview2.Buffer() - lang_manager = gtksourceview2.LanguageManager() - buf.set_highlight_matching_brackets(True) - if self.node is not None and self.node.is_code(): - codelanguage = self.node.get_code_language(); - if codelanguage in lang_manager.get_language_ids(): - language = lang_manager.get_language(codelanguage) - else: - language = lang_manager.get_language("python") - buf.set_language(language) - buf.set_highlight_syntax(True) - textview = gtksourceview2.View(buffer=buf) - textview.set_auto_indent(True) - textview.set_insert_spaces_instead_of_tabs(True) - textview.set_tab_width(2) - if self.node is not None and self.node.is_code(): - textview.set_show_line_numbers(True) - font_desc = pango.FontDescription("monospace") - if font_desc: - textview.modify_font(font_desc) - except ImportError: - textview = gtk.TextView() - - textview.set_pixels_above_lines(2) - textview.set_pixels_below_lines(2) - textview.set_wrap_mode(gtk.WRAP_WORD) - textview.connect("focus-in-event", self.entry_focus_in) - - scrolledWindow.add(textview) - textview.show() - return textview - - def set_data_empty(self): - """ - Empty the data frame. - """ - - if self.frame.child is not None: - if isinstance(self.data, gtk.TextView): - self.data.handler_block_by_func(self.entry_focus_in) - elif isinstance(self.data, gtk.ComboBox): - self.data.handler_block_by_func(self.combo_focus_child) - - self.frame.remove(self.frame.child) - - self.interacted = False - - return - - def set_data_fixed(self): - """ - Create a non-editable text view to show help or fixed data. - """ - - self.set_data_empty() - - self.data = self.add_text_view() - - self.data.get_buffer().create_tag("tag") - text_tag = self.data.get_buffer().get_tag_table().lookup("tag") - - self.data.set_cursor_visible(False) - self.data.set_editable(False) - self.buttons.hide() - text_tag.set_property("foreground", "grey") - - if self.node is None: - self.data.get_buffer().set_text("") - elif not self.node.active: - self.data.get_buffer().set_text("Inactive node") - elif self.node.datatype is None: - self.data.get_buffer().set_text("No data") - elif self.node.is_tensor(self.geometry_dim_tree): - self.data.get_buffer().set_text("Dimension not set") - else: # self.node.datatype == "fixed": - self.data.get_buffer().set_text(self.node.data) - - buffer_bounds = self.data.get_buffer().get_bounds() - self.data.get_buffer().apply_tag(text_tag, buffer_bounds[0], buffer_bounds[1]) - - return - - def set_data_entry(self): - """ - Create a text view for data entry in the data frame. - """ - - self.set_data_empty() - - self.data = self.add_text_view() - - self.data.get_buffer().create_tag("tag") - text_tag = self.data.get_buffer().get_tag_table().lookup("tag") - - self.data.set_cursor_visible(True) - self.data.set_editable(True) - self.buttons.show() - - if self.node.data is None: - self.data.get_buffer().set_text(datatype.print_type(self.node.datatype)) - text_tag.set_property("foreground", "blue") - else: - self.data.get_buffer().set_text(self.node.data) - - buffer_bounds = self.data.get_buffer().get_bounds() - self.data.get_buffer().apply_tag(text_tag, buffer_bounds[0], buffer_bounds[1]) - - return - - def set_data_tensor(self): - """ - Create a table container packed with appropriate widgets for tensor data entry - in the node data frame. - """ - - self.set_data_empty() - - scrolledWindow = self.add_scrolled_window() - - dim1, dim2 = self.node.tensor_shape(self.geometry_dim_tree) - self.data = gtk.Table(dim1, dim2) - scrolledWindow.add_with_viewport(self.data) - scrolledWindow.child.set_property("shadow-type", gtk.SHADOW_NONE) - - self.set_child_packing(self.frame, True, True, 0, gtk.PACK_START) - - self.show_all() - self.buttons.show() - - is_symmetric = self.node.is_symmetric_tensor(self.geometry_dim_tree) - for i in range(dim1): - for j in range(dim2): - iindex = dim1 - i - 1 - jindex = dim2 - j - 1 - - entry = gtk.Entry() - self.data.attach(entry, jindex, jindex + 1, iindex, iindex + 1) - - if not is_symmetric or i >= j: - entry.show() - entry.connect("focus-in-event", self.tensor_element_focus_in, jindex, iindex) - - if self.node.data is None: - entry.set_text(datatype.print_type(self.node.datatype.datatype)) - entry.modify_text(gtk.STATE_NORMAL, gtk.gdk.color_parse("blue")) - else: - entry.set_text(self.node.data.split(" ")[jindex + iindex * dim2]) - - self.interacted = [False for i in range(dim1 * dim2)] - - return - - def set_data_combo(self): - """ - Create a combo box for node data selection in the node data frame. Add an - entry if required. - """ - - self.set_data_empty() - - if isinstance(self.node.datatype[0], tuple): - self.data = gtk.combo_box_entry_new_text() - else: - self.data = gtk.combo_box_new_text() - - self.frame.add(self.data) - self.data.show() - - self.data.connect("set-focus-child", self.combo_focus_child) - - self.set_child_packing(self.frame, False, False, 0, gtk.PACK_START) - - if isinstance(self.node.datatype[0], tuple): - self.buttons.show() - else: - self.buttons.hide() - - if self.node.data is None: - if isinstance(self.node.datatype[0], tuple): - self.data.child.set_text("Select " + datatype.print_type(self.node.datatype[1]) + "...") - else: - self.data.append_text("Select...") - self.data.set_active(0) - self.data.child.modify_text(gtk.STATE_NORMAL, gtk.gdk.color_parse("blue")) - self.data.child.modify_text(gtk.STATE_PRELIGHT, gtk.gdk.color_parse("blue")) - - if isinstance(self.node.datatype[0], tuple): - options = self.node.datatype[0] - else: - options = self.node.datatype - - for (i, opt) in enumerate(options): - self.data.append_text(opt) - if self.node.data == opt: - self.data.set_active(i) - - if (isinstance(self.node.datatype[0], tuple) - and self.node.data is not None - and self.node.data not in self.node.datatype[0]): - self.data.child.set_text(self.node.data) - - self.data.connect("changed", self.combo_changed) - - return - - def data_entry_store(self): - """ - Attempt to store data read from a textview packed in the data frame. - """ - - new_data = self.data.get_buffer().get_text(*self.data.get_buffer().get_bounds()) - - if new_data == "": - return True - - if self.node.data is None and not self.interacted: - return True - else: - value_check = self.node.validity_check(self.node.datatype, new_data) - if value_check is None: - dialogs.error(None, "Invalid value entered") - return False - elif value_check != self.node.data: - self.node.set_data(value_check) - if (isinstance(self.node, mixedtree.MixedTree) - and "shape" in self.node.child.attrs.keys() - and self.node.child.attrs["shape"][0] is int - and isinstance(self.node.datatype, plist.List) - and self.node.datatype.cardinality == "+"): - self.node.child.set_attr("shape", str(len(value_check.split(" ")))) - - self.emit("on-store") - self.interacted = False - - return True - - def data_tensor_store(self): - """ - Attempt to store data read from tensor data entry widgets packed in the - data frame. - """ - - dim1, dim2 = self.node.tensor_shape(self.geometry_dim_tree) - is_symmetric = self.node.is_symmetric_tensor(self.geometry_dim_tree) - - if True not in self.interacted: - return True - - entry_values = [] - for i in range(dim1): - for j in range(dim2): - if is_symmetric and i > j: - entry_values.append(self.data.get_children()[i + j * dim1].get_text()) - else: - entry_values.append(self.data.get_children()[j + i * dim2].get_text()) - - changed = False - for i in range(dim1): - for j in range(dim2): - if (self.interacted[j + i * dim2] - and entry_values[j + i * dim2] != "" - and (self.node.data is None - or self.node.data.split(" ")[j + i * dim2] != entry_values[j + i * dim2])): - changed = True - break - - if not changed: - return True - elif (self.node.data is None and False in self.interacted) or "" in entry_values: - dialogs.error(None, "Invalid value entered") - return False - - new_data = "" - for i in range(dim1): - for j in range(dim2): - new_data += " " + entry_values[j + i * dim2] - - value_check = self.node.validity_check(self.node.datatype, new_data) - if value_check is None: - return False - elif not value_check == self.node.data: - self.node.set_data(value_check) - - dim1, dim2 = self.node.tensor_shape(self.geometry_dim_tree) - if int(self.node.child.attrs["rank"][1]) == 1: - self.node.child.set_attr("shape", str(dim1)) - else: - self.node.child.set_attr("shape", str(dim1) + " " + str(dim2)) - - self.emit("on-store") - self.interacted = [False for i in range(dim1 * dim2)] - - return True - - def data_combo_store(self): - """ - Attempt to store data read from a combo box entry packed in the node data. - """ - - if not isinstance(self.node.datatype[0], tuple): - return True - - new_data = self.data.get_text() - - if self.node.data is None and not self.interacted: - return True - elif not new_data in self.node.datatype[0]: - new_data = self.node.validity_check(self.node.datatype[1], new_data) - if new_data is None: - return False - - if not new_data == self.node.data: - self.node.set_data(new_data) - self.emit("on-store") - self.interacted = False - - return True - - def entry_focus_in(self, widget, event): - """ - Called when a text view data entry widget gains focus. Used to delete the - printable_type placeholder. - """ - - if (self.node is not None - and self.node.datatype is not None - and not self.node.is_tensor(self.geometry_dim_tree) - and self.node.data is None - and not self.interacted): - self.data.get_buffer().set_text("") - - self.interacted = True - - return - - def tensor_element_focus_in(self, widget, event, row, col): - """ - Called when a tensor data entry widget gains focus. Used to delete the - printable_type placeholder. - """ - - dim1, dim2 = self.node.tensor_shape(self.geometry_dim_tree) - if not self.interacted[row + col * dim2]: - self.interacted[row + col * dim2] = True - if self.node.is_symmetric_tensor(self.geometry_dim_tree): - self.interacted[col + row * dim1] = True - if self.node.data is None: - widget.set_text("") - widget.modify_text(gtk.STATE_NORMAL, gtk.gdk.color_parse("black")) - - return - - def combo_focus_child(self, container, widget): - """ - Called when a data selection widget gains focus. Used to delete the select - placeholder. - """ - if not self.interacted: - self.interacted = True - if self.node.data is None: - self.data.handler_block_by_func(self.combo_changed) - if isinstance(self.node.datatype[0], tuple): - self.data.child.set_text("") - else: - self.data.remove_text(0) - - self.data.child.modify_text(gtk.STATE_NORMAL, gtk.gdk.color_parse("black")) - self.data.child.modify_text(gtk.STATE_PRELIGHT, gtk.gdk.color_parse("black")) - self.data.handler_unblock_by_func(self.combo_changed) - - return - - def combo_changed(self, combo_box): - """ - Called when a data combo box element is selected. Updates data in the - treestore. - """ - - if not isinstance(self.node.datatype[0], tuple): - text = self.data.get_active_text() - if text is None: - return - - self.node.set_data(text) - self.emit("on-store") - self.interacted = False - return - -gobject.type_register(DataWidget) diff --git a/libspud/diamond/diamond/debug.py b/libspud/diamond/diamond/debug.py deleted file mode 100644 index afdf61c2e3..0000000000 --- a/libspud/diamond/diamond/debug.py +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -""" -Debugging module. Stores the program debug level and provides debugging output -functions. Only debugging output with level less than or equal to the current -debug level is output. Note that debugging output with level greater than the -current maximum debug level is treated as having a level equal to the current -maximum debug level, and that debugging output with level less than zero is -treated as having a level equal to zero. -""" - -import sys - -class DebugLevel: - """ - Class used to store a debug level. - """ - - def __init__(self, level = 1, maxLevel = 3): - """ - Initialise a debug level. - """ - - self.SetLevel(level) - self.SetMaxLevel(maxLevel) - - return - - def GetLevel(self): - """ - Get the debug level. - """ - - return self._level - - def SetLevel(self, level = 1): - """ - Set the debug level. - """ - - level = max(level, 0) - - try: - self._level = min(level, self.GetMaxLevel()) - except: - self._level = level - - return - - def GetMaxLevel(self): - """ - Get the maximum debug level. - """ - - return self._maxLevel - - def SetMaxLevel(self, maxLevel = 3): - """ - Set the maximum debug level. - """ - - maxLevel = max(maxLevel, 0) - - self._maxLevel = maxLevel - self.SetLevel(self._level) - - return - -# Stores the current module debug level -_debugLevel = DebugLevel() - -def GetDebugLevel(): - """ - Get the current debug level. - """ - - return _debugLevel.GetLevel() - -def SetDebugLevel(level = 1): - """ - Set the current debug level. - """ - - _debugLevel.SetLevel(level) - - return - -def GetMaxDebugLevel(): - """ - Get the current maximum debug level. - """ - - return _debugLevel.GetMaxLevel() - -def SetMaxDebugLevel(level = 3): - """ - Set the current maximum debug level. - """ - - _debugLevel.SetMaxLevel(level) - - return - -def dprint(msg, level = 1, newline = True, flush = True): - """ - Print a debug message to standard output with supplied debug level. - """ - - dwrite(sys.stdout, msg, level, newline, flush) - - return - -def deprint(msg, level = 1, newline = True, flush = True): - """ - Print a debug message to standard error with supplied debug level. - """ - - dwrite(sys.stderr, msg, level, newline, flush) - - return - -def dwrite(stream, msg, level = 1, newline = True, flush = True): - """ - Print a debug message to the supplied file stream with supplied debug level. - """ - - level = max(level, 0) - level = min(level, GetMaxDebugLevel()) - - if level <= GetDebugLevel(): - stream.write(str(msg)) - if newline: - stream.write("\n") - if flush: - stream.flush() - - return diff --git a/libspud/diamond/diamond/descriptionwidget.py b/libspud/diamond/diamond/descriptionwidget.py deleted file mode 100644 index 54c7734e08..0000000000 --- a/libspud/diamond/diamond/descriptionwidget.py +++ /dev/null @@ -1,192 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import gtk -import re -import TextBufferMarkup -import webbrowser - -class DescriptionWidget(gtk.Frame): - def __init__(self): - gtk.Frame.__init__(self) - - scrolledWindow = gtk.ScrolledWindow() - scrolledWindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) - - textView = self.textView = gtk.TextView() - textView.set_editable(False) - textView.set_wrap_mode(gtk.WRAP_WORD) - textView.set_cursor_visible(False) - - textView.set_buffer(TextBufferMarkup.PangoBuffer()) - textView.connect("button-release-event", self.mouse_button_release) - textView.connect("motion-notify-event", self.mouse_over) - - scrolledWindow.add(textView) - - label = gtk.Label() - label.set_markup("Description") - - self.set_shadow_type(gtk.SHADOW_NONE) - self.set_label_widget(label) - self.add(scrolledWindow) - - return - - def update(self, node): - if node is None: - self.set_description("No node selected") - elif node.doc is None: - self.set_description("No documentation") - else: - self.set_description(node.doc) - - return - - def set_description(self, text): - """ - Set the node description. - """ - - #text saved in self.text without markup - self.text = text = self.render_whitespace(text) - link_bounds = self.link_bounds = self.get_link_bounds(text) - - if link_bounds: - new_text = [] - index = 0 - for bounds in link_bounds: - new_text.append(text[index:bounds[0]]) - new_text.append("") - new_text.append(text[bounds[0]:bounds[1]]) - new_text.append("") - index = bounds[1] - - new_text.append(text[index:]) - text = ''.join(new_text) - - self.textView.get_buffer().set_text(text) - - return - - def get_link_bounds(self, text): - """ - Return a list of tuples corresponding to the start and end points of links in - the supplied string. - """ - text = text.lower() - bounds = [] - - for match in re.finditer(r"\b(" #start at beginging of word - +r"(?:https?://|www\.)" #http:// https:// or www. - +r"(?:[a-z0-9][a-z0-9_\-]*[a-z0-9]\.)*" #Domains - +r"(?:[a-z][a-z0-9\-]*[a-z0-9])" #TLD - +r"(?:/([a-z0-9$_.+\\*'(),;:@&=\-]|%[0-9a-f]{2})*)*" #path - +r"(?:\?([a-z0-9$_.+!*'(),;:@&=\-]|%[0-9a-f]{2})*)?" #query - +r")", text): - bounds.append(match.span()) - - return bounds - - def render_whitespace(self, desc): - ''' Render the line wrapping in desc as follows: - - * Newlines followed by 0-1 spaces are ignored, and 1 space is used. - * Blank lines start new paragraphs. - * Newlines followed by more than 1 space are honoured. - ''' - - text = [] - para = False - literal = False - - for line in desc.split("\n"): - - if line == "" or line.isspace(): #Blank line, start paragraph - if literal: #if following a literal line add newlines - text.append("\n") - para = True - - elif line[0] == " " and line[1] == " ": # >1 space, treat literaly - text.append("\n") - text.append(line) - para = False - literal = True - - else: #normal case - if para: #add if starting a new paragraph - text.append("\n ") - if not line.startswith(" "): - text.append(" ") - text.append(line) - para = False - literal = False - - return ''.join(text) - - def get_hyperlink(self, x, y): - """ - Given an x and y window position (eg from a mouse click) return the hyperlink - at that position if there is one. Else return None. - """ - if self.text is None: - return None - - buffer_pos = self.textView.window_to_buffer_coords(gtk.TEXT_WINDOW_TEXT, x, y) - char_offset = self.textView.get_iter_at_location(buffer_pos[0], buffer_pos[1]).get_offset() - - for bounds in self.link_bounds: - if char_offset >= bounds[0] and char_offset <= bounds[1]: - return self.text[bounds[0]:bounds[1]] - - return None - - def mouse_over(self, widget, event): - """ - Called when the mouse moves over the node description widget. Sets the cursor - to a hand if the mouse hovers over a link. - - Based on code from HyperTextDemo class in hypertext.py from PyGTK 2.12 demos - """ - - if self.get_hyperlink(int(event.x), int(event.y)) is not None: - self.textView.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(gtk.gdk.Cursor(gtk.gdk.HAND2)) - else: - self.textView.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(gtk.gdk.Cursor(gtk.gdk.XTERM)) - - return - - def mouse_button_release(self, widget, event): - """ - Called when a mouse button is released over the node description widget. - Launches a browser if the mouse release was over a link, the left mouse button - was released and no text was selected. - - Based on code from HyperTextDemo class in hypertext.py from PyGTK 2.12 demos - """ - - if not event.button == 1: - return - - if self.textView.get_buffer().get_selection_bounds(): - return - - hyperlink = self.get_hyperlink(int(event.x), int(event.y)) - if hyperlink is not None: - webbrowser.open(hyperlink) - - return diff --git a/libspud/diamond/diamond/dialogs.py b/libspud/diamond/diamond/dialogs.py deleted file mode 100644 index 16c7d2d61e..0000000000 --- a/libspud/diamond/diamond/dialogs.py +++ /dev/null @@ -1,283 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import os -import sys -import traceback - -import gtk - -import pygtkconsole - -def prompt(parent, message, type = gtk.MESSAGE_QUESTION, has_cancel = False): - """ - Display a simple Yes / No dialog. Returns one of gtk.RESPONSE_{YES,NO,CANCEL}. - """ - - prompt_dialog = gtk.MessageDialog(parent, 0, type, gtk.BUTTONS_NONE, message) - prompt_dialog.add_buttons(gtk.STOCK_YES, gtk.RESPONSE_YES, gtk.STOCK_NO, gtk.RESPONSE_NO) - if has_cancel: - prompt_dialog.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) - prompt_dialog.connect("response", prompt_response) - - prompt_dialog.run() - - return prompt_response.response - -def long_message(parent, message): - """ - Display a message prompt, with the message contained within a scrolled window. - """ - - message_dialog = gtk.Dialog(parent = parent, buttons = (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) - message_dialog.set_default_size(400, 300) - message_dialog.connect("response", close_dialog) - - scrolled_window = gtk.ScrolledWindow() - message_dialog.vbox.add(scrolled_window) - scrolled_window.show() - - scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS) - - text_view = gtk.TextView() - scrolled_window.add(text_view) - text_view.show() - - text_view.get_buffer().set_text(message) - text_view.set_cursor_visible(False) - text_view.set_property("editable", False) - text_view.set_property("height-request", 180) - text_view.set_property("width-request", 240) - - message_dialog.run() - - return - -def error(parent, message): - """ - Display an error message. - """ - - error_dialog = gtk.MessageDialog(parent, 0, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, message) - error_dialog.connect("response", close_dialog) - error_dialog.run() - - return - -def error_tb(parent, message): - """ - Display an error message, together with the last traceback. - """ - - tb = traceback.format_exception(sys.exc_info()[0] ,sys.exc_info()[1], sys.exc_info()[2]) - tb_msg = "" - for tbline in tb: - tb_msg += tbline - long_message(parent, tb_msg + "\n" + message) - - return - -def get_filename(title, action, filter_names_and_patterns = {}, folder_uri = None): - """ - Utility function to get a filename. - """ - - if action == gtk.FILE_CHOOSER_ACTION_SAVE: - buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_SAVE,gtk.RESPONSE_OK) - elif action == gtk.FILE_CHOOSER_ACTION_CREATE_FOLDER: - buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_NEW,gtk.RESPONSE_OK) - else: - buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK) - filew = gtk.FileChooserDialog(title=title, action=action, buttons=buttons) - filew.set_default_response(gtk.RESPONSE_OK) - - if not folder_uri is None: - filew.set_current_folder_uri("file://" + os.path.abspath(folder_uri)) - - for filtername in filter_names_and_patterns: - filter = gtk.FileFilter() - filter.set_name(filtername) - filter.add_pattern(filter_names_and_patterns[filtername]) - filew.add_filter(filter) - - allfilter = gtk.FileFilter() - allfilter.set_name("All known files") - for filtername in filter_names_and_patterns: - allfilter.add_pattern(filter_names_and_patterns[filtername]) - filew.add_filter(allfilter) - - filter = gtk.FileFilter() - filter.set_name("All files") - filter.add_pattern("*") - filew.add_filter(filter) - - result = filew.run() - - if result == gtk.RESPONSE_OK: - filename = filew.get_filename() - filtername = filew.get_filter().get_name() - filew.destroy() - return filename - else: - filew.destroy() - return None - -def console(parent, locals = None): - """ - Launch a python console. - """ - - console_dialog = gtk.Dialog(parent = parent, buttons = (gtk.STOCK_QUIT, gtk.RESPONSE_ACCEPT)) - console_dialog.set_default_size(400, 300) - console_dialog.connect("response", close_dialog) - - stdout = sys.stdout - stderr = sys.stderr - - console_widget = pygtkconsole.GTKInterpreterConsole(locals) - console_dialog.vbox.add(console_widget) - console_widget.show() - - console_dialog.run() - - sys.stdout = stdout - sys.stderr = stderr - - return - -def prompt_response(dialog, response_id): - """ - Signal handler for dialog response signals. Stores the dialog response in the - function namespace, to allow response return in other functions. - """ - - if response_id == gtk.RESPONSE_DELETE_EVENT: - response_id = gtk.RESPONSE_CANCEL - - prompt_response.response = response_id - close_dialog(dialog, response_id) - - return - -def close_dialog(dialog, response_id = None): - """ - Signal handler for dialog reponse or destroy signals. Closes the dialog. - """ - - dialog.destroy() - - return - -def radio_dialog(title, message, choices, logo): - r = RadioDialog(title, message, choices, logo) - return r.data - -def message_box(window, title, message): - dialog = gtk.MessageDialog(window, 0, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, message) - dialog.set_title(title) - dialog.connect("response", close_dialog) - dialog.run() - -class RadioDialog: - def __init__(self, title, message, choices, logo): - self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) - self.window.connect("delete_event", self.cleanup) - self.window.connect("key_press_event", self.key_press) - self.window.set_title(title) - self.window.set_position(gtk.WIN_POS_CENTER) - if not logo is None: - self.window.set_icon_from_file(logo) - self.window.show() - - #swindow = gtk.ScrolledWindow() - #swindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) - #self.window.add(swindow) - #swindow.show() - - main_box = gtk.VBox(False, 0) - self.window.add(main_box) - main_box.show() - - if not logo is None: - image = gtk.Image() - image.set_from_file(logo) - main_box.pack_start(image, True, True, 0) - image.show() - - label = gtk.Label(message) - main_box.add(label) - label.show() - - radio_box = gtk.VBox(False, 10) - main_box.pack_start(radio_box, True, True, 0) - radio_box.show() - - separator = gtk.HSeparator() - main_box.pack_start(separator, False, True, 0) - separator.show() - - close = gtk.Button(stock=gtk.STOCK_OK) - close.connect("clicked", self.cleanup) - main_box.pack_start(close, False, False, 0) - close.show() - - prev_radio = None - for choice in choices: - radio = gtk.RadioButton(prev_radio, choice) - radio.connect("toggled", self.radio_callback, choice) - radio_box.pack_start(radio, False, False, 0) - radio.show() - if prev_radio is None: - radio.set_active(True) - prev_radio = radio - - self.data = choices[0] - - gtk.main() - - def cleanup(self, widget, data=None): - self.window.destroy() - gtk.main_quit() - - def key_press(self, widget, event): - if event.keyval == gtk.keysyms.Return: - self.cleanup(None) - - def radio_callback(self, widget, data): - self.data = data - -class GoToDialog: - def __init__(self, parent): - self.goto_gui = gtk.glade.XML(parent.gladefile, root="GoToDialog") - self.dialog_box = self.goto_gui.get_widget("GoToDialog") - self.dialog_box.set_modal(True) - - def run(self): - signals = {"goto_activate": self.on_goto_activate, - "cancel_activate": self.on_cancel_activate} - - self.goto_gui.signal_autoconnect(signals) - - self.dialog_box.show() - return "" - - def on_goto_activate(self, widget=None): - print "goto" - - def on_cancel_activate(self, widget=None): - print "cancel" - diff --git a/libspud/diamond/diamond/diffview.py b/libspud/diamond/diamond/diffview.py deleted file mode 100644 index a252fdfea4..0000000000 --- a/libspud/diamond/diamond/diffview.py +++ /dev/null @@ -1,548 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import os -import os.path -import sys -import cStringIO as StringIO - -import gobject -import gtk -import threading - -from lxml import etree - -import attributewidget -import databuttonswidget -import datawidget -import mixedtree - -from config import config -import dxdiff.diff as xmldiff - -class DiffView(gtk.Window): - - def __init__(self, path, tree): - gtk.Window.__init__(self) - - self.__add_controls() - - tree1 = etree.parse(path) - tree2 = etree.ElementTree(tree.write_core(None)) - - self.__update(tree1, tree2) - - self.show_all() - - def __add_controls(self): - self.set_default_size(800, 600) - self.set_title("Diff View") - - mainvbox = gtk.VBox() - - menubar = gtk.MenuBar() - edititem = gtk.MenuItem("_Edit") - menubar.append(edititem) - - agr = gtk.AccelGroup() - self.add_accel_group(agr) - - self.popup = editmenu = gtk.Menu() - edititem.set_submenu(editmenu) - copyitem = gtk.MenuItem("Copy") - copyitem.connect("activate", self.on_copy) - key, mod = gtk.accelerator_parse("C") - copyitem.add_accelerator("activate", agr, key, mod, gtk.ACCEL_VISIBLE) - editmenu.append(copyitem) - - mainvbox.pack_start(menubar, expand = False) - - hpane = gtk.HPaned() - scrolledwindow = gtk.ScrolledWindow() - scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) - - self.treeview = gtk.TreeView() - - self.treeview.get_selection().set_mode(gtk.SELECTION_SINGLE) - self.treeview.get_selection().connect("changed", self.on_select_row) - - # Node column - celltext = gtk.CellRendererText() - column = gtk.TreeViewColumn("Node", celltext) - column.set_cell_data_func(celltext, self.set_celltext) - - self.treeview.append_column(column) - - # 0: The node tag - # 1: The attributes dict - # 2: The value of the node if any - # 3: The old value of the node - # 4: "insert", "delete", "update", "" - self.treestore = gtk.TreeStore(gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT) - self.treeview.set_enable_search(False) - self.treeview.connect("button_press_event", self.on_treeview_button_press) - self.treeview.connect("popup_menu", self.on_treeview_popup) - scrolledwindow.add(self.treeview) - hpane.pack1(scrolledwindow, True) - - vpane = gtk.VPaned() - frame = gtk.Frame() - label = gtk.Label() - label.set_markup("Attributes") - frame.set_label_widget(label) - frame.set_shadow_type(gtk.SHADOW_NONE) - - self.attribview = gtk.TreeView() - - celltext = gtk.CellRendererText() - keycolumn = gtk.TreeViewColumn("Key", celltext) - keycolumn.set_cell_data_func(celltext, self.set_cellkey) - - self.attribview.append_column(keycolumn) - - celltext = gtk.CellRendererText() - valuecolumn = gtk.TreeViewColumn("Value", celltext) - valuecolumn.set_cell_data_func(celltext, self.set_cellvalue) - - self.attribview.append_column(valuecolumn) - - frame.add(self.attribview) - vpane.pack1(frame) - - frame = gtk.Frame() - label = gtk.Label() - label.set_markup("Data") - frame.set_label_widget(label) - frame.set_shadow_type(gtk.SHADOW_NONE) - - self.dataview = gtk.TextView() - self.dataview.set_cursor_visible(False) - self.dataview.set_editable(False) - self.__create_tags(self.dataview.get_buffer()) - - frame.add(self.dataview) - vpane.pack2(frame) - - hpane.pack2(vpane) - mainvbox.pack_start(hpane) - self.add(mainvbox) - - def on_treeview_button_press(self, treeview, event): - pathinfo = treeview.get_path_at_pos(int(event.x), int(event.y)) - if event.button == 3: - if pathinfo is not None: - treeview.get_selection().select_path(pathinfo[0]) - self.show_popup(None, event.button, event.time) - return True - - def popup_location(self, widget, user_data): - column = self.treeview.get_column(0) - path = self.treeview.get_selection().get_selected()[1] - area = self.treeview.get_cell_area(path, column) - tx, ty = area.x, area.y - x, y = self.treeview.tree_to_widget_coords(tx, ty) - return (x, y, True) - - def on_treeview_popup(self, treeview): - self.show_popup(None, self.popup_location, gtk.get_current_event_time()) - return - - def show_popup(self, func, button, time): - self.popup.popup( None, None, func, button, time) - return - - def __update(self, tree1, tree2): - - def async_diff(self, tree1, tree2): - editscript = xmldiff.diff(tree1, tree2) - self.__set_treestore(tree1.getroot()) - self.__parse_editscript(editscript) - self.__floodfill(self.treestore.get_iter_root()) - gtk.idle_add(self.treeview.set_model, self.treestore) - - t = threading.Thread(target = async_diff, args = (self, tree1, tree2)) - t.start() - - def __set_treestore(self, tree, iter = None): - - attrib = {} - for key, value in tree.attrib.iteritems(): - # (new, old, edit) - attrib[key] = (value, value, None) - - child_iter = self.treestore.append(iter, [tree.tag, attrib, tree.text, tree.text, None]) - for child in tree: - self.__set_treestore(child, child_iter) - - def __parse_editscript(self, editscript): - for edit in editscript: - iter, key = self.__get_iter(edit["location"]) - if key: - attribs = self.treestore.get_value(iter, 1) - old = attribs[key][1] - if edit["type"] == "delete": - attribs[key] = (None, old, "delete") - elif edit["type"] == "update": - attribs[key] = (edit["value"], old, "update") - elif edit["type"] == "move": - attribs[key] = (None, old, "delete") - self.__insert(self.__get_iter(edit["value"])[0], key + " " + old, 0) - - else: - - if edit["type"] == "insert": - self.__insert(iter, edit["value"], int(edit["index"])) - elif edit["type"] == "delete": - self.treestore.set(iter, 2, None) - self.treestore.set(iter, 4, "delete") - elif edit["type"] == "update": - self.treestore.set(iter, 2, edit["value"]) - elif edit["type"] == "move": - self.__move(iter, edit["value"], int(edit["index"])) - - def __floodfill(self, iter, parentedit = None): - """ - Floodfill the tree with the correct edit types. - If something has changed below you, "subupdate" - If your value or attrs has changed "update" - If insert, all below insert - If delete, all below delete - """ - attribs, new, old, edit = self.treestore.get(iter, 1, 2, 3, 4) - - if parentedit == "insert": - edit = "insert" - elif parentedit == "delete": - edit = "delete" - - if edit == "insert" or edit == "delete": - for key, (valuenew, valueold, valueedit) in attribs.iteritems(): - attribs[key] = (valuenew, valueold, edit) - - child = self.treestore.iter_children(iter) - while child is not None: - self.__floodfill(child, edit) - child = self.treestore.iter_next(child) - - self.treestore.set(iter, 4, edit) - else: - update = False - for key in attribs: - # edit value - if attribs[key][2] is not None: - update = True - break - if new != old: - update = True - - if update: - self.treestore.set(iter, 4, "update") - else: - child = self.treestore.iter_children(iter) - while child is not None: - change = self.__floodfill(child, edit) - if change is not None: - self.treestore.set(iter, 4, "subupdate") - child = self.treestore.iter_next(child) - - return self.treestore.get_value(iter, 4) - - def __insert(self, iter, value, index): - if " " in value: - key, value = value.split(" ") - attrib = self.treestore.get_value(iter, 1) - attrib[key] = (value, None, "insert") - else: - before = self.__iter_nth_child(iter, index - 1) - if before: - self.treestore.insert_before(iter, before, [value, {}, None, None, "insert"]) - else: - self.treestore.append(iter, [value, {}, None, None, "insert"]) - - def __move(self, iter, value, index): - """ - Copy the entire subtree at iter to the path at value[index], - mark all of iter as deleted, and all of the copy inserted. - """ - tag, attrib, text = self.treestore.get(iter, 0, 1, 2) - self.treestore.set(iter, 2, None) - self.treestore.set(iter, 4, "delete") - - destiter = self.__get_iter(value)[0] - - before = self.__iter_nth_child(destiter, index - 1) - if before: - destiter = self.treestore.insert_before(destiter, before, [tag, attrib, text, None, "insert"]) - else: - destiter = self.treestore.append(destiter, [tag, attrib, text, None, "insert"]) - - def move(iterfrom, iterto): - for childfrom in self.__iter_children(iterfrom): - tag, attrib, text = self.treestore.get(childfrom, 0, 1, 2) - self.treestore.set(childfrom, 2, None) - self.treestore.set(childfrom, 4, "delete") - - childto = self.treestore.append(iterto, [tag, attrib, text, None, "insert"]) - move(childfrom, childto) - - move(iter, destiter) - - def __iter_children(self, iter): - child = self.treestore.iter_children(iter) - - while child: - active = self.treestore.get_value(child, 4) != "delete" - if active: - yield child - child = self.treestore.iter_next(child) - - def __iter_nth_child(self, iter, n): - - for child in self.__iter_children(iter): - if n == 0: - return child - else: - n -= 1 - return None - - def __get_iter(self, path, iter = None): - """ - Convert the given XML path to an iter into the treestore. - """ - - if iter is None: - iter = self.treestore.get_iter_first() - - tag, edit = self.treestore.get(iter, 0, 4) - if edit == "delete": - return None # don't search deleted paths - - parentiter = self.treestore.iter_parent(iter) - if parentiter: - siblings = [] - for siblingiter in self.__iter_children(parentiter): - siblingtag = self.treestore.get_value(siblingiter, 0) - if siblingtag == tag: - siblings.append(self.treestore.get_path(siblingiter)) - - if len(siblings) != 1: - index = "[" + str(siblings.index(self.treestore.get_path(iter)) + 1) + "]" - else: - index = "" - - tag = "/" + tag + index - else: - tag = "/" + tag - - index = path.find("/", 1) - if index == -1: - index = len(path) - - root = path[:index] - path = path[index:] - - #check we match root - if root != tag: - return None - - if path: - # check for text() - if path == "/text()": - return (iter, None) - - # check attributes - if path.startswith("/@"): - attrib = self.treestore.get_value(iter, 1) - for key in attrib: - if path == "/@" + key: - return (iter, key) - return None - - # check children - for iter in self.__iter_children(iter): - edit = self.treestore.get_value(iter, 4) - if edit != "delete": - result = self.__get_iter(path, iter) - if result: - return result - - return None - else: - # must be us - return (iter, None) - - def on_select_row(self, selection): - """ - Called when a row is selected. - """ - (model, row) = selection.get_selected() - if row is None: - return - - attrib, new, old, edit = model.get(row, 1, 2, 3, 4) - - databuffer = self.dataview.get_buffer() - tag = databuffer.get_tag_table().lookup("tag") - if new or old: - self.__set_textdiff(self.dataview.get_buffer(), old, new) - tag.set_property("background-set", False) - tag.set_property("foreground", "black") - else: - databuffer.set_text("No data") - self.__set_cell_property(tag, None) - tag.set_property("foreground", "grey") - - bounds = databuffer.get_bounds() - databuffer.apply_tag(tag, bounds[0], bounds[1]) - - # 0: Key - # 1: Value - # 2: Old value - # 3: "insert", "delete", "update", "" - - attribstore = gtk.TreeStore(gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT) - - for key, (new, old, diff) in attrib.iteritems(): - attribstore.append(None, [key, new, old, diff]) - - self.attribview.set_model(attribstore) - - def __set_textdiff(self, databuffer, old, new): - text1 = old.splitlines() if old else [] - text2 = new.splitlines() if new else [] - - from difflib import Differ - differ = Differ() - result = differ.compare(text1, text2) - result = [line + "\n" for line in result if not line.startswith("? ")] - - databuffer.set_text("") - for line in result: - iter = databuffer.get_end_iter() - if line.startswith(" "): - databuffer.insert(iter, line) - elif line.startswith("+ "): - databuffer.insert_with_tags_by_name(iter, line, "add") - elif line.startswith("- "): - databuffer.insert_with_tags_by_name(iter, line, "rem") - - - def __create_tags(self, databuffer): - databuffer.create_tag("tag") - add = databuffer.create_tag("add") - rem = databuffer.create_tag("rem") - - add.set_property("background", config.get("colour", "diffadd")) - rem.set_property("background", config.get("colour", "diffsub")) - - def __set_cell_property(self, cell, edit): - if edit is None: - cell.set_property("foreground", config.get("colour", "normal")) - elif edit == "insert": - cell.set_property("foreground", config.get("colour", "insert")) - elif edit == "delete": - cell.set_property("foreground", config.get("colour", "delete")) - elif edit == "update": - cell.set_property("foreground", config.get("colour", "update")) - elif edit == "subupdate": - cell.set_property("foreground", config.get("colour", "subupdate")) - - def set_celltext(self, column, cell, model, iter): - - tag, text, edit = model.get(iter, 0, 2, 4) - - cell.set_property("text", tag) - self.__set_cell_property(cell, edit) - - def set_cellkey(self, column, cell, model, iter): - - key, edit = model.get(iter, 0, 3) - cell.set_property("text", key) - self.__set_cell_property(cell, edit) - - def set_cellvalue(self, column, cell, model, iter): - - new, old, edit = model.get(iter, 1, 2, 3) - if edit == "delete": - cell.set_property("text", old) - else: - cell.set_property("text", new) - self.__set_cell_property(cell, edit) - - def _get_focus_widget(self, parent): - """ - Gets the widget that is a child of parent with the focus. - """ - focus = parent.get_focus_child() - if focus is None or (focus.flags() & gtk.HAS_FOCUS): - return focus - else: - return self._get_focus_widget(focus) - - def _handle_clipboard(self, widget, signal): - """ - This finds the currently focused widget. - If no widget is focused or the focused widget doesn't support - the given clipboard operation use the treeview (False), otherwise - signal the widget to handel the clipboard operation (True). - """ - widget = self._get_focus_widget(self) - - if widget is None or widget is self.treeview: - return False - - if gobject.signal_lookup(signal + "-clipboard", widget): - widget.emit(signal + "-clipboard") - return True - else: - return False - - def __get_treestore(self, iter): - - tag, attrib, text = self.treestore.get(iter, 0, 1, 2) - - tree = etree.Element(tag) - - for key, (newvalue, oldvalue, edit) in attrib.iteritems(): - tree.attrib[key] = newvalue - - child_iter = self.treestore.iter_children(iter) - while child_iter: - child = self.__get_treestore(child_iter) - tree.append(child) - child_iter = self.treestore.iter_next(child_iter) - - return tree - - def on_copy(self, widget=None): - if self._handle_clipboard(widget, "copy"): - return - - (model, row) = self.treeview.get_selection().get_selected() - if row is None: - return - - tree = etree.ElementTree(self.__get_treestore(row)) - - ios = StringIO.StringIO() - tree.write(ios, pretty_print = True, xml_declaration = False, encoding = "utf-8") - - clipboard = gtk.clipboard_get() - clipboard.set_text(ios.getvalue()) - clipboard.store() - - ios.close() diff --git a/libspud/diamond/diamond/interface.py b/libspud/diamond/diamond/interface.py deleted file mode 100644 index 3694724062..0000000000 --- a/libspud/diamond/diamond/interface.py +++ /dev/null @@ -1,1983 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import os -import os.path -import re -import time -import sys -import tempfile -import cStringIO as StringIO - -import pango -import gobject -import gtk -import gtk.glade - -import choice -import config -import datatype -import debug -import dialogs -import mixedtree -import plist -import plugins -import schema -import scherror -import tree - -import StringIO -import TextBufferMarkup - -import attributewidget -import commentwidget -import descriptionwidget -import databuttonswidget -import datawidget -import diffview -import sliceview -import useview - -from lxml import etree - -try: - gtk.Tooltip() -except: - debug.deprint("Interface warning: Unable to use GTK tooltips") - -""" -Here are some notes about the code: - -Important fields: - file_path: the directory containing the current file (the working directory or directory of last opened / saved file if no file is open) - filename: output filename of the current file - data_paths: paths (from the root node) to important Diamond data (e.g. geometry dimension) - geometry_dim_tree: MixedTree, with parent equal to the geometry dimension tree and child equal to the geometry dimension data subtree - gladefile: input Glade file - gui: GUI GladeXML object - logofile: the GUI logo file - main_window: GUI toplevel window - node_attrs: RHS attributes entry widget - description: RHS description widget - data = RHS data widget - comment: RHS comment entry widget - node_data: RHS data entry widget - node_data_buttons_hbox: container for "Revert Data" and "Store Data" buttons - node_data_interacted: used to determine if a node data widget has been interacted with without data being stored - node_data_frame: frame containing data entry widgets - options_tree_select_func_enabled: boolean, true if the options tree select function is enabled (used to overcome a nasty clash with the treeview clicked signal) - re-enabled on next options_tree_select_func call - selected_node: a tree.Tree or MixedTree containing data to be displayed on the RHS - selected_iter: last iter set by on_select_row - s: current schema - saved: boolean, false if the current file has been edited - schemafile: the current RNG schema file - schemafile_path: the directory containing the current schema file (the working directory if no schema is open) - signals: dictionary containing signal handlers for signals set up in the Glade file - statusbar: GUI status bar - tree: LHS tree root - treestore: the LHS tree model - treeview: the LHS tree widget - -Important routines: - cellcombo_changed: called when a choice is selected on the left-hand pane - init_treemodel: set up the treemodel and treeview - on_treeview_clicked: when a row is clicked, process the consequences (e.g. activate inactive instance) - set_treestore: stuff the treestore with a given tree.Tree - on_find_find_button & search_treestore: the find functionality - on_select_row: when a row is selected, update the options frame - update_options_frame: paint the right-hand side - -If there are bugs in reading in, see schema.read. -If there are bugs in writing out, see tree.write. -""" - -class Diamond: - def __init__(self, gladefile, schemafile = None, schematron_file = None, logofile = None, input_filename = None, - dim_path = "/geometry/dimension", suffix=None): - self.gladefile = gladefile - self.gui = gtk.glade.XML(self.gladefile) - - self.statusbar = DiamondStatusBar(self.gui.get_widget("statusBar")) - self.find = DiamondFindDialog(self, gladefile) - self.popup = self.gui.get_widget("popupmenu") - - self.add_custom_widgets() - - self.plugin_buttonbox = self.gui.get_widget("plugin_buttonbox") - self.plugin_buttonbox.set_layout(gtk.BUTTONBOX_START) - self.plugin_buttonbox.show() - self.plugin_buttons = [] - - self.scherror = scherror.DiamondSchemaError(self, gladefile, schemafile, schematron_file) - - signals = {"on_new": self.on_new, - "on_quit": self.on_quit, - "on_open": self.on_open, - "on_open_schema": self.on_open_schema, - "on_save": self.on_save, - "on_save_as": self.on_save_as, - "on_validate": self.scherror.on_validate, - "on_validate_schematron": self.scherror.on_validate_schematron, - "on_expand_all": self.on_expand_all, - "on_collapse_all": self.on_collapse_all, - "on_find": self.find.on_find, - "on_go_to_node": self.on_go_to_node, - "on_console": self.on_console, - "on_display_properties_toggled": self.on_display_properties_toggled, - "on_about": self.on_about, - "on_copy_spud_path": self.on_copy_spud_path, - "on_copy": self.on_copy, - "on_paste": self.on_paste, - "on_slice": self.on_slice, - "on_diff": self.on_diff, - "on_diffsave": self.on_diffsave, - "on_finduseage": self.on_finduseage, - "on_group": self.on_group, - "on_ungroup": self.on_ungroup} - - self.gui.signal_autoconnect(signals) - - self.main_window = self.gui.get_widget("mainWindow") - self.main_window.connect("delete_event", self.on_delete) - - self.logofile = logofile - if self.logofile is not None: - for l in self.logofile: - try: - gtk.window_set_default_icon_from_file(l) - break - except: - pass - - self.init_treemodel() - - self.data_paths = {} - self.data_paths["dim"] = dim_path - - self.suffix = suffix - - self.selected_node = None - self.selected_iter = None - self.update_options_frame() - - self.file_path = os.getcwd() - self.schemafile_path = os.getcwd() - self.filename = None - self.schemafile = None - self.init_datatree() - self.set_saved(True) - self.open_file(schemafile = None, filename = None) - - self.main_window.show() - - if schemafile is not None: - self.open_file(schemafile = schemafile, filename = input_filename) - - # Hide specific menu items - menu = self.gui.get_widget("menu") - - # Disable Find - menu.get_children()[1].get_submenu().get_children()[0].set_property("visible", False) - - if schematron_file is None: - # Disable Validate Schematron - menu.get_children()[3].get_submenu().get_children()[1].set_property("sensitive", False) - - return - - def program_exists(self, name): - ret = os.system("which %s > /dev/null" % name) - return ret == 0 - - ### MENU ### - - def update_title(self): - """ - Update the Diamond title based on the save status of the currently open file. - """ - - title = "Diamond: " - if not self.saved: - title += "*" - if self.filename is None: - title += "(Unsaved)" - else: - title += os.path.basename(self.filename) - if len(os.path.dirname(self.filename)) > 0: - title += " (%s)" % os.path.dirname(self.filename) - - self.main_window.set_title(title) - - return - - def set_saved(self, saved, filename = ""): - """ - Change the save status of the current file. - """ - - self.saved = saved - if filename != "": - self.filename = filename - if filename is not None: - self.file_path = os.path.dirname(filename) + os.path.sep - self.update_title() - - return - - def close_schema(self): - if self.schemafile is None: - return - - # clear the schema. - self.s = None - self.schemafile = None - self.schemafile_path = None - self.scherror.schema_file = None - - return - - def load_schema(self, schemafile): - # so, if the schemafile has already been opened, then .. - if schemafile == self.schemafile: - self.statusbar.set_statusbar('Schema ' + schemafile + ' already loaded') - return - - # if we aren't using a http schema, and we're passed a relative filename, we - # need to absolut-ify it. - if 'http' not in schemafile: - schemafile = os.path.abspath(schemafile) - - self.statusbar.set_statusbar('Loading schema from ' + schemafile) - - # now, let's try and read the schema. - try: - s_read = schema.Schema(schemafile) - self.s = s_read - self.statusbar.set_statusbar('Loaded schema from ' + schemafile) - except: - dialogs.error_tb(self.main_window, "Unable to open schema file \"" + schemafile + "\"") - self.statusbar.clear_statusbar() - return - - self.schemafile = schemafile - self.schemafile_path = os.path.dirname(schemafile) + os.path.sep - self.scherror.schema_file = schemafile - - self.remove_children(None) - self.init_datatree() - - return - - def close_file(self): - self.remove_children(None) - self.init_datatree() - - self.filename = None - - return - - def display_validation_errors(self, errors): - # Extract and display validation errors - saved = True - lost_eles, added_eles, lost_attrs, added_attrs = errors - if len(lost_eles) > 0 or len(added_eles) > 0 or len(lost_attrs) > 0 or len(added_attrs) > 0: - saved = False - msg = "" - if len(lost_eles) > 0: - msg += "Warning: lost xml elements:\n" - for ele in lost_eles: - msg += ele + "\n" - if len(added_eles) > 0: - msg += "Warning: added xml elements:\n" - for ele in added_eles: - msg += ele + "\n" - if len(lost_attrs) > 0: - msg += "Warning: lost xml attributes:\n" - for ele in lost_attrs: - msg += ele + "\n" - if len(added_attrs) > 0: - msg += "Warning: added xml attributes:\n" - for ele in added_attrs: - msg += ele + "\n" - - dialogs.long_message(self.main_window, msg) - return saved - - def load_file(self, filename): - # if we have a relative path, make it absolute - filename = os.path.abspath(filename) - - try: - os.stat(filename) - except OSError: - self.filename = filename - self.set_saved(False) - - self.remove_children(None) - self.init_datatree() - - return - - try: - tree_read = self.s.read(filename) - - if tree_read is None: - dialogs.error_tb(self.main_window, "Unable to open file \"" + filename + "\"") - return - - saved = self.display_validation_errors(self.s.read_errors()) - - self.tree = tree_read - self.filename = filename - except: - dialogs.error_tb(self.main_window, "Unable to open file \"" + filename + "\"") - return - - self.set_saved(saved, filename) - - return - - def open_file(self, schemafile = "", filename = ""): - """ - Handle opening or clearing of the current file and / or schema. - """ - - self.find.on_find_close_button() - if schemafile is None: - self.close_schema() - elif schemafile != "": - self.load_schema(schemafile) - if filename is None: - self.close_file() - elif filename != "": - self.load_file(filename) - - self.treeview.freeze_child_notify() - self.treeview.set_model(None) - self.signals = {} - self.set_treestore(None, [self.tree], True) - self.treeview.set_model(self.treestore) - self.treeview.thaw_child_notify() - - self.set_geometry_dim_tree() - - self.treeview.grab_focus() - self.treeview.get_selection().select_path(0) - - self.selected_node = None - self.update_options_frame() - - self.scherror.destroy_error_list() - - return - - def save_continue(self): - - if not self.saved: - prompt_response = dialogs.prompt(self.main_window, - "Unsaved data. Do you want to save the current document before continuing?", gtk.MESSAGE_WARNING, True) - - if prompt_response == gtk.RESPONSE_YES: - if self.filename is None: - return self.on_save_as() - else: - return self.on_save() - elif prompt_response == gtk.RESPONSE_CANCEL: - return False - - return True - - def on_new(self, widget=None): - """ - Called when new is clicked. Clear the treestore and reset the datatree. - """ - - if not self.save_continue(): - return - - self.open_file(filename = None) - self.filename = None - - return - - def on_open(self, widget=None): - """ - Called when open is clicked. Open a user supplied file. - """ - - if not self.save_continue(): - return - - filter_names_and_patterns = {} - if self.suffix is None: - for xmlname in config.schemata: - filter_names_and_patterns[config.schemata[xmlname][0]] = "*." + xmlname - elif self.suffix in config.schemata.keys(): - filter_names_and_patterns[config.schemata[self.suffix][0]] = "*." + self.suffix - else: - filter_names_and_patterns[self.suffix] = "*." + self.suffix - - filename = dialogs.get_filename(title = "Open XML file", action = gtk.FILE_CHOOSER_ACTION_OPEN, filter_names_and_patterns = filter_names_and_patterns, folder_uri = self.file_path) - - if filename is not None: - self.open_file(filename = filename) - - return - - def on_open_schema(self, widget=None): - """ - Called when open schema is clicked. Clear the treestore and reset the schema. - """ - - if not self.save_continue(): - return - - filename = dialogs.get_filename(title = "Open RELAX NG schema", action = gtk.FILE_CHOOSER_ACTION_OPEN, filter_names_and_patterns = {"RNG files":"*.rng"}, folder_uri = self.schemafile_path) - if filename is not None: - self.open_file(schemafile = filename) - - return - - def on_save(self, widget=None): - """ - Write out to XML. If we don't already have a filename, open a dialog to get - one. - """ - - self.data.store() - - if self.filename is None: - return self.on_save_as(widget) - else: - self.statusbar.set_statusbar("Saving ...") - self.main_window.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) - try: - self.tree.write(self.filename) - except: - dialogs.error_tb(self.main_window, "Saving to \"" + self.filename + "\" failed") - self.statusbar.clear_statusbar() - self.main_window.window.set_cursor(None) - return False - - self.set_saved(True) - - self.statusbar.clear_statusbar() - self.main_window.window.set_cursor(None) - return True - - return False - - def on_save_as(self, widget=None): - """ - Write out the XML to a file. - """ - - if self.schemafile is None: - dialogs.error(self.main_window, "No schema file open") - return False - - filter_names_and_patterns = {} - if self.suffix is None: - for xmlname in config.schemata: - filter_names_and_patterns[config.schemata[xmlname][0]] = "*." + xmlname - elif self.suffix in config.schemata.keys(): - filter_names_and_patterns[config.schemata[self.suffix][0]] = "*." + self.suffix - else: - filter_names_and_patterns[self.suffix] = "*." + self.suffix - - filename = dialogs.get_filename(title = "Save XML file", action = gtk.FILE_CHOOSER_ACTION_SAVE, filter_names_and_patterns = filter_names_and_patterns, folder_uri = self.file_path) - - if filename is not None: - # Check that the selected file has a file extension. If not, add a .xml extension. - if len(filename.split(".")) <= 1: - filename += ".xml" - - # Save the file - self.statusbar.set_statusbar("Saving ...") - self.main_window.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) - self.tree.write(filename) - self.set_saved(True, filename) - self.statusbar.clear_statusbar() - self.main_window.window.set_cursor(None) - return True - - return False - - def on_delete(self, widget, event): - """ - Called when the main window is deleted. Return "True" to prevent the deletion - of the main window (deletion is handled by "on_quit"). - """ - - self.on_quit(widget, event) - - return True - - def on_quit(self, widget, event = None): - """ - Quit the program. Prompt the user to save data if the current file has been - changed. - """ - - if not self.save_continue(): - return - - self.destroy() - - return - - def destroy(self): - """ - End the program. - """ - - try: - gtk.main_quit() - except: - debug.dprint("Failed to quit - already quit?") - - return - - def on_display_properties_toggled(self, widget=None): - optionsFrame = self.gui.get_widget("optionsFrame") - optionsFrame.set_property("visible", not optionsFrame.get_property("visible")) - return - - def on_go_to_node(self, widget=None): - """ - Go to a node, identified by an XPath - """ - - dialog = dialogs.GoToDialog(self) - spudpath = dialog.run() - - return - - def on_expand_all(self, widget=None): - """ - Show the whole tree. - """ - - self.treeview.expand_all() - - return - - def on_collapse_all(self, widget=None): - """ - Collapse the whole tree. - """ - - self.treeview.collapse_all() - - return - - def on_console(self, widget = None): - """ - Launch a python console - """ - - # Construct the dictionary of locals that will be used by the interpreter - locals = {} - locals["interface"] = globals() - locals["diamond_gui"] = self - - dialogs.console(self.main_window, locals) - - return - - def on_about(self, widget=None): - """ - Tell the user how fecking great we are. - """ - - about = gtk.AboutDialog() - about.set_name("Diamond") - about.set_copyright("GPLv3") - about.set_comments("A RELAX-NG-aware XML editor") - about.set_authors(["Patrick E. Farrell", "James R. Maddison", "Matthew T. Whitworth", "Fraser J. Waters"]) - about.set_license("Diamond is free software: you can redistribute it and/or modify\n"+ - "it under the terms of the GNU General Public License as published by\n"+ - "the Free Software Foundation, either version 3 of the License, or\n"+ - "(at your option) any later version.\n"+ - "\n"+ - "Diamond is distributed in the hope that it will be useful,\n"+ - "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"+ - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"+ - "GNU General Public License for more details.\n"+ - "You should have received a copy of the GNU General Public License\n"+ - "along with Diamond. If not, see http://www.gnu.org/licenses/.") - - if self.logofile is not None: - for l in self.logofile: - try: - logo = gtk.gdk.pixbuf_new_from_file(l) - about.set_logo(logo) - break - except: - pass - - - try: - image = about.get_children()[0].get_children()[0].get_children()[0] - image.set_tooltip_text("Diamond: it's clearer than GEM") - except: - pass - - about.run() - about.destroy() - - return - - - def on_copy_spud_path(self, widget=None): - path = self.get_selected_row(self.treeview.get_selection()) - if path is None: - debug.deprint("No selection.") - return - iter = self.treestore.get_iter(path) - active_tree = self.treestore.get_value(iter, 1) - name = self.get_spudpath(active_tree) - clipboard = gtk.clipboard_get() - clipboard.set_text(name) - clipboard.store() - - def _get_focus_widget(self, parent): - """ - Gets the widget that is a child of parent with the focus. - """ - focus = parent.get_focus_child() - if focus is None or (focus.flags() & gtk.HAS_FOCUS): - return focus - else: - return self._get_focus_widget(focus) - - def _handle_clipboard(self, widget, signal): - """ - This finds the currently focused widget. - If no widget is focused or the focused widget doesn't support - the given clipboard operation use the treeview (False), otherwise - signal the widget to handel the clipboard operation (True). - """ - widget = self._get_focus_widget(self.main_window) - - if widget is None or widget is self.treeview: - return False - - if gobject.signal_lookup(signal + "-clipboard", widget): - widget.emit(signal + "-clipboard") - return True - else: - return False - - def on_copy(self, widget=None): - if self._handle_clipboard(widget, "copy"): - return - - if isinstance(self.selected_node, mixedtree.MixedTree): - node = self.selected_node.parent - else: - node = self.selected_node - - if node != None and node.active: - ios = StringIO.StringIO() - node.write(ios) - - clipboard = gtk.clipboard_get() - clipboard.set_text(ios.getvalue()) - clipboard.store() - - ios.close() - return - - def on_paste(self, widget=None): - if self._handle_clipboard(widget, "paste"): - return - - clipboard = gtk.clipboard_get() - ios = StringIO.StringIO(clipboard.wait_for_text()) - - if self.selected_iter is not None: - node = self.treestore.get_value(self.selected_iter, 0) - - if node != None: - - expand = not node.active - if expand: - self.expand_tree(self.selected_iter) - - newnode = self.s.read(ios, node) - - if newnode is None: - if expand: - self.collapse_tree(self.selected_iter, False) - self.statusbar.set_statusbar("Trying to paste invalid XML.") - return - - if node.parent is not None: - newnode.set_parent(node.parent) - children = node.parent.get_children() - children.insert(children.index(node), newnode) - children.remove(node) - - self.treeview.freeze_child_notify() - iter = self.set_treestore(self.selected_iter, [newnode], True, True) - newnode.recompute_validity() - self.treeview.thaw_child_notify() - - self.treeview.get_selection().select_iter(iter) - - self.display_validation_errors(self.s.read_errors()) - - self.set_saved(False) - - return - - def __diff(self, path): - def run_diff(self, path): - start = time.clock() - diffview.DiffView(path, self.tree) - seconds = time.clock() - start - self.statusbar.set_statusbar("Diff calculated (took " + str(seconds) + " seconds)") - return False - - if path and os.path.isfile(path): - filename = path - else: - dialog = gtk.FileChooserDialog( - title = "Diff against", - action = gtk.FILE_CHOOSER_ACTION_OPEN, - buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK)) - - if path: - dialog.set_current_folder(path) - - response = dialog.run() - if response != gtk.RESPONSE_OK: - dialog.destroy() - return - - filename = dialog.get_filename() - dialog.destroy() - - self.statusbar.set_statusbar("Calculating diff... (this may take a while)") - gobject.idle_add(run_diff, self, filename) - - def on_diff(self, widget = None, path = None): - if path is None: - path = os.path.dirname(self.filename) if self.filename else None - self.__diff(path) - - def on_diffsave(self, widget = None): - if self.filename: - self.__diff(self.filename) - else: - dialogs.error(self.main_window, "No save to diff against.") - - def on_finduseage(self, widget = None): - useview.UseView(self.s, self.suffix) - - def on_slice(self, widget = None): - if not self.selected_node.is_sliceable(): - self.statusbar.set_statusbar("Cannot slice on this element.") - return - - window = sliceview.SliceView(self.main_window) - window.geometry_dim_tree = self.geometry_dim_tree - window.update(self.selected_node, self.tree) - window.connect("destroy", self._slice_destroy) - return - - def _slice_destroy(self, widget): - self.on_select_row() - - - groupmode = False - - def on_group(self, widget = None): - """ - Clears the treeview and then fills it with nodes - with the same type as the selected node. - """ - - if self.selected_node == self.tree or not self.selected_iter: - self.statusbar.set_statusbar("Cannot group on this element.") - return #Group on the entire tree... ie don't group or nothing selected - - self.gui.get_widget("menuitemUngroup").show() - self.gui.get_widget("popupmenuitemUngroup").show() - - self.groupmode = True - node, tree = self.treestore.get(self.selected_iter, 0, 1) - - self.treeview.freeze_child_notify() - self.treeview.set_model(None) - - def get_nodes(node, tree): - nodes = [] - - if isinstance(tree, choice.Choice): - child = tree.get_current_tree() - if child.name == node.name: - nodes.append(tree) - nodes += get_nodes(node, child) - else: - for child in tree.get_children(): - if child.name == node.name: - nodes.append(child) - nodes += get_nodes(node, child) - - return nodes - - self.set_treestore(None, get_nodes(tree, self.tree), True) - - self.treeview.set_model(self.treestore) - self.treeview.thaw_child_notify() - - path = self.get_treestore_path_from_node(node) - self.treeview.get_selection().select_path(path) - - return - - def on_ungroup(self, widget = None): - """ - Restores the treeview to normal. - """ - - self.gui.get_widget("menuitemUngroup").hide() - self.gui.get_widget("popupmenuitemUngroup").hide() - - self.groupmode = False - node = self.treestore.get_value(self.selected_iter, 0) - - self.treeview.freeze_child_notify() - self.treeview.set_model(None) - - self.set_treestore(None, [self.tree], True) - - self.treeview.set_model(self.treestore) - self.treeview.thaw_child_notify() - - path = self.get_treestore_path_from_node(node) - self.treeview.expand_to_path(path) - self.treeview.scroll_to_cell(path) - self.treeview.get_selection().select_path(path) - - return - - ## LHS ### - - def init_datatree(self): - """ - Add the root node of the XML tree to the treestore, and its children. - """ - - if self.schemafile is None: - self.set_treestore(None, []) - self.tree = None - else: - l = self.s.valid_children(":start") - - self.tree = l[0] - self.signals = {} - self.set_treestore(None, l) - - root_iter = self.treestore.get_iter_first() - self.treeview.freeze_child_notify() - self.treeview.set_model(None) - self.expand_treestore(root_iter) - self.treeview.set_model(self.treestore) - self.treeview.thaw_child_notify() - - return - - def init_treemodel(self): - """ - Set up the treestore and treeview. - """ - - self.treeview = optionsTree = self.gui.get_widget("optionsTree") - self.treeview.connect("key_press_event", self.on_treeview_key_press) - self.treeview.connect("button_press_event", self.on_treeview_button_press) - self.treeview.connect("row-activated", self.on_activate_row) - self.treeview.connect("popup_menu", self.on_treeview_popup) - - self.treeview.set_property("rules-hint", True) - - self.treeview.get_selection().set_mode(gtk.SELECTION_SINGLE) - self.treeview.get_selection().connect("changed", self.on_select_row) - self.treeview.get_selection().set_select_function(self.options_tree_select_func) - self.options_tree_select_func_enabled = True - - # Node column - column = gtk.TreeViewColumn("Node") - column.set_property("expand", True) - column.set_resizable(True) - - self.cellcombo = cellCombo = gtk.CellRendererCombo() - cellCombo.set_property("text-column", 0) - cellCombo.set_property("editable", True) - cellCombo.set_property("has-entry", False) - cellCombo.connect("changed", self.cellcombo_changed) - column.pack_start(cellCombo) - column.set_cell_data_func(cellCombo, self.set_combobox_liststore) - - self.choicecell = choiceCell = gtk.CellRendererPixbuf() - column.pack_end(choiceCell, expand=False) - column.set_cell_data_func(choiceCell, self.set_cellpicture_choice) - - optionsTree.append_column(column) - - self.imgcell = cellPicture = gtk.CellRendererPixbuf() - self.imgcolumn = imgcolumn = gtk.TreeViewColumn("", cellPicture) - imgcolumn.set_property("expand", False) - imgcolumn.set_property("fixed-width", 20) - imgcolumn.set_property("sizing", gtk.TREE_VIEW_COLUMN_FIXED) - imgcolumn.set_cell_data_func(cellPicture, self.set_cellpicture_cardinality) - optionsTree.append_column(imgcolumn) - - # 0: pointer to node in self.tree -- a choice or a tree - # 1: pointer to currently active tree - # 2: gtk.ListStore containing the display names of possible choices - - self.treestore = gtk.TreeStore(gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT) - self.treeview.set_model(self.treestore) - self.treeview.set_enable_search(False) - - return - - def create_liststore(self, choice_or_tree): - """ - Given a list of possible choices, create the liststore for the - gtk.CellRendererCombo that contains the names of possible choices. - """ - - liststore = gtk.ListStore(str, gobject.TYPE_PYOBJECT) - - for t in choice_or_tree.get_choices(): - liststore.append([str(t), t]) - - return liststore - - def set_treestore(self, iter=None, new_tree=[], recurse=False, replace=False): - """ - Given a list of children of a node in a treestore, stuff them in the treestore. - """ - - if replace: - replacediter = iter - iter = self.treestore.iter_parent(replacediter) - else: - self.remove_children(iter) - - for t in new_tree: - if t is not None and t in self.signals: - t.disconnect(self.signals[t][0]) - t.disconnect(self.signals[t][1]) - - if isinstance(t, tree.Tree): - if t.is_hidden(): - attrid = t.connect("on-set-attr", self.on_set_attr, self.treestore.get_path(iter)) - dataid = t.connect("on-set-data", self.on_set_data, self.treestore.get_path(iter)) - self.signals[t] = (attrid, dataid) - continue - - liststore = self.create_liststore(t) - - if replace: - child_iter = self.treestore.insert_before(iter, replacediter, [t, t, liststore]) - else: - child_iter = self.treestore.append(iter, [t, t, liststore]) - - attrid = t.connect("on-set-attr", self.on_set_attr, self.treestore.get_path(child_iter)) - dataid = t.connect("on-set-data", self.on_set_data, self.treestore.get_path(child_iter)) - self.signals[t] = (attrid, dataid) - - if recurse and t.active: self.set_treestore(child_iter, t.children, recurse) - - elif isinstance(t, choice.Choice): - liststore = self.create_liststore(t) - ts_choice = t.get_current_tree() - if ts_choice.is_hidden(): - attrid = t.connect("on-set-attr", self.on_set_attr, self.treestore.get_path(iter)) - dataid = t.connect("on-set-data", self.on_set_data, self.treestore.get_path(iter)) - self.signals[t] = (attrid, dataid) - continue - - if replace: - child_iter = self.treestore.insert_before(iter, replacediter, [t, ts_choice, liststore]) - else: - child_iter = self.treestore.append(iter, [t, ts_choice, liststore]) - - attrid = t.connect("on-set-attr", self.on_set_attr, self.treestore.get_path(child_iter)) - dataid = t.connect("on-set-data", self.on_set_data, self.treestore.get_path(child_iter)) - self.signals[t] = (attrid, dataid) - - if recurse and t.active: self.set_treestore(child_iter, ts_choice.children, recurse) - - if replace: - self.treestore.remove(replacediter) - return child_iter - - return iter - - def expand_choice_or_tree(self, choice_or_tree): - """ - Query the schema for what valid children can live under this node, and add - them to the choice or tree. This recurses. - """ - - if isinstance(choice_or_tree, choice.Choice): - for opt in choice_or_tree.choices(): - self.expand_choice_or_tree(opt) - else: - l = self.s.valid_children(choice_or_tree.schemaname) - l = choice_or_tree.find_or_add(l) - for opt in l: - self.expand_choice_or_tree(opt) - - return - - def expand_treestore(self, iter = None): - """ - Query the schema for what valid children can live under this node, then set the - treestore appropriately. This recurses. - """ - - if iter is None: - iter = self.treestore.get_iter_first() - if iter is None: - self.set_treestore(iter, []) - return - - choice_or_tree, active_tree = self.treestore.get(iter, 0, 1) - if active_tree.active is False or choice_or_tree.active is False: - return - - l = self.s.valid_children(active_tree.schemaname) - l = active_tree.find_or_add(l) - self.set_treestore(iter, l) - - child_iter = self.treestore.iter_children(iter) - while child_iter is not None: - # fix for recursive schemata! - child_active_tree = self.treestore.get_value(child_iter, 1) - if child_active_tree.schemaname == active_tree.schemaname: - debug.deprint("Warning: recursive schema elements not supported: %s" % active_tree.name) - child_iter = self.treestore.iter_next(child_iter) - if child_iter is None: break - - self.expand_treestore(child_iter) - child_iter = self.treestore.iter_next(child_iter) - - return - - def remove_children(self, iter): - """ - Delete the children of iter in the treestore. - """ - - childiter = self.treestore.iter_children(iter) - if childiter is None: return - - result = True - - while result is True: - result = self.treestore.remove(childiter) - - return - - def set_combobox_liststore(self, column, cellCombo, treemodel, iter, user_data=None): - """ - This hook function sets the properties of the gtk.CellRendererCombo for each - row. It sets up the cellcombo to use the correct liststore for its choices, - decides whether the cellcombo should be editable or not, and sets the - foreground colour. - """ - - choice_or_tree, active_tree, liststore = treemodel.get(iter, 0, 1, 2) - - if self.groupmode and treemodel.iter_parent(iter) is None: - cellCombo.set_property("text", choice_or_tree.get_name_path()) - else: - cellCombo.set_property("text", str(choice_or_tree)) - - - cellCombo.set_property("model", liststore) - - # set the properties: colour, etc. - if isinstance(choice_or_tree, tree.Tree): - cellCombo.set_property("editable", False) - elif isinstance(choice_or_tree, choice.Choice): - cellCombo.set_property("editable", True) - - if self.iter_is_active(treemodel, iter): - if active_tree.valid is True: - cellCombo.set_property("foreground", "black") - else: - cellCombo.set_property("foreground", "blue") - else: - cellCombo.set_property("foreground", "gray") - - return - - def set_cellpicture_choice(self, column, cell, treemodel, iter): - """ - This hook function sets up the other gtk.CellRendererPixbuf, the one that gives - the clue to the user whether this is a choice or not. - """ - - choice_or_tree = treemodel.get_value(iter, 0) - if isinstance(choice_or_tree, tree.Tree): - cell.set_property("stock-id", None) - elif isinstance(choice_or_tree, choice.Choice): - cell.set_property("stock-id", gtk.STOCK_GO_DOWN) - - return - - def set_cellpicture_cardinality(self, column, cell, treemodel, iter): - """ - This hook function sets up the gtk.CellRendererPixbuf on the extreme right-hand - side for each row; this paints a plus or minus or nothing depending on whether - something can be added or removed or has to be there. - """ - - choice_or_tree = treemodel.get_value(iter, 0) - if choice_or_tree.cardinality == "": - cell.set_property("stock-id", None) - elif choice_or_tree.cardinality == "?" or choice_or_tree.cardinality == "*": - if choice_or_tree.active: - cell.set_property("stock-id", gtk.STOCK_REMOVE) - else: - cell.set_property("stock-id", gtk.STOCK_ADD) - elif choice_or_tree.cardinality == "+": - parent_tree = choice_or_tree.parent - count = parent_tree.count_children_by_schemaname(choice_or_tree.schemaname) - - if choice_or_tree.active and count == 2: # one active, one inactive - cell.set_property("stock-id", None) - elif choice_or_tree.active: - cell.set_property("stock-id", gtk.STOCK_REMOVE) - else: - cell.set_property("stock-id", gtk.STOCK_ADD) - - return - - def toggle_tree(self, iter): - """ - Toggles the state of part of the tree. - """ - - choice_or_tree = self.treestore.get_value(iter, 0) - - if choice_or_tree.active: - self.collapse_tree(iter) - else: - self.expand_tree(iter) - - self.on_select_row() - - return - - def collapse_tree(self, iter, confirm = True): - """ - Collapses part of the tree. - """ - - choice_or_tree, = self.treestore.get(iter, 0) - parent_tree = choice_or_tree.parent - - if not choice_or_tree.active: - return - - if choice_or_tree.cardinality == "": - return - - if choice_or_tree.cardinality == "?": - choice_or_tree.active = False - self.set_saved(False) - self.remove_children(iter) - - elif choice_or_tree.cardinality == "*": - # If this is the only one, just make it inactive. - # Otherwise, just delete it. - count = parent_tree.count_children_by_schemaname(choice_or_tree.schemaname) - if count == 1: - choice_or_tree.active = False - self.set_saved(False) - self.remove_children(iter) - else: - self.delete_tree(iter, confirm) - - elif choice_or_tree.cardinality == "+": - count = parent_tree.count_children_by_schemaname(choice_or_tree.schemaname) - if count == 2: # one active, one inactive - # do nothing - return - else: # count > 2 - self.delete_tree(iter, confirm) - - parent_tree.recompute_validity() - self.treeview.queue_draw() - return - - def delete_tree(self, iter, confirm): - choice_or_tree, = self.treestore.get(iter, 0) - parent_tree = choice_or_tree.parent - isSelected = self.treeview.get_selection().iter_is_selected(iter) - sibling = self.treestore.iter_next(iter) - - if confirm: - response = dialogs.prompt(self.main_window, "Are you sure you want to delete this node?") - - # not A or B == A implies B - if not confirm or response == gtk.RESPONSE_YES: - parent_tree.delete_child_by_ref(choice_or_tree) - self.remove_children(iter) - self.treestore.remove(iter) - self.set_saved(False) - - if isSelected and sibling: - self.treeview.get_selection().select_iter(sibling) - return - - def expand_tree(self, iter): - """ - Expands part of the tree. - """ - - choice_or_tree, active_tree = self.treestore.get(iter, 0, 1) - parent_tree = choice_or_tree.parent - - if choice_or_tree.active: - return - - if choice_or_tree.cardinality == "": - return - - elif choice_or_tree.cardinality == "?": - choice_or_tree.active = True - self.set_saved(False) - self.expand_treestore(iter) - - elif choice_or_tree.cardinality == "*" or choice_or_tree.cardinality == "+": - # Make this active, and add a new inactive instance - choice_or_tree.active = True - new_tree = parent_tree.add_inactive_instance(choice_or_tree) - liststore = self.create_liststore(new_tree) - self.expand_treestore(iter) - iter = self.treestore.insert_after( - None, iter, [new_tree, new_tree.get_current_tree(), liststore]) - attrid = new_tree.connect("on-set-attr", self.on_set_attr, self.treestore.get_path(iter)) - dataid = new_tree.connect("on-set-data", self.on_set_data, self.treestore.get_path(iter)) - self.signals[new_tree] = (attrid, dataid) - self.set_saved(False) - - parent_tree.recompute_validity() - return - - def options_tree_select_func(self, info = None): - """ - Called when the user selected a new item in the treeview. Prevents changing of - node and attempts to save data if appropriate. - """ - - if not self.options_tree_select_func_enabled: - self.options_tree_select_func_enabled = True - return False - - if not self.data.store(): - return False - - if (isinstance(self.selected_node, mixedtree.MixedTree) - and self.geometry_dim_tree is not None - and self.selected_node.parent is self.geometry_dim_tree.parent - and self.selected_node.data is not None): - self.geometry_dim_tree.set_data(self.selected_node.data) - - return True - - def on_treeview_key_press(self, treeview, event): - """ - Called when treeview intercepts a key press. Collapse and expand rows. - """ - - if event.keyval == gtk.keysyms.Right: - self.treeview.expand_row(self.get_selected_row(), open_all = False) - - if event.keyval == gtk.keysyms.Left: - self.treeview.collapse_row(self.get_selected_row()) - - if event.keyval == gtk.keysyms.Delete: - self.collapse_tree(self.treestore.get_iter(self.get_selected_row())) - self.on_select_row() - - return - - def on_treeview_button_press(self, treeview, event): - """ - This routine is called every time the mouse is clicked on the treeview on the - left-hand side. It processes the "buttons" gtk.STOCK_ADD and gtk.STOCK_REMOVE - in the right-hand column, activating, adding and removing tree nodes as - necessary. - """ - pathinfo = treeview.get_path_at_pos(int(event.x), int(event.y)) - - if event.button == 1: - - if pathinfo is not None: - path = pathinfo[0] - col = pathinfo[1] - - if col is self.imgcolumn: - iter = self.treestore.get_iter(path) - self.toggle_tree(iter) - - elif event.button == 3: - if pathinfo is not None: - treeview.get_selection().select_path(pathinfo[0]) - self.show_popup(None, event.button, event.time) - return True - - def popup_location(self, widget): - column = self.treeview.get_column(0) - treemodel, treeiter = self.treeview.get_selection().get_selected() - treepath = treemodel.get_path(treeiter) - area = self.treeview.get_cell_area(treepath, column) - sx, sy = self.popup.size_request() - tx, ty = area.x, area.y + int(sy * 1.25) - x, y = self.treeview.tree_to_widget_coords(tx, ty) - return (x, y, True) - - def on_treeview_popup(self, treeview): - self.show_popup(self.popup_location, 0, gtk.get_current_event_time()) - return - - def show_popup(self, func, button, time): - self.popup.popup(None, None, func, button, time) - return - - def on_select_row(self, selection=None): - """ - Called when a row is selected. Update the options frame. - """ - - if isinstance(selection, str) or isinstance(selection, tuple): - path = selection - else: - path = self.get_selected_row(selection) - - if path is None: - return - - self.selected_iter = iter = self.treestore.get_iter(path) - choice_or_tree, active_tree = self.treestore.get(iter, 0, 1) - - debug.dprint(active_tree) - - self.selected_node = self.get_painted_tree(iter) - self.update_options_frame() - - name = self.get_spudpath(active_tree) - self.statusbar.set_statusbar(name) - self.current_spudpath = name - self.current_xpath = self.get_xpath(active_tree) - - self.clear_plugin_buttons() - - for plugin in plugins.plugins: - if plugin.matches(name): - self.add_plugin_button(plugin) - - return - - def get_spudpath(self, active_tree): - # get the name to paint on the statusbar - name_tree = active_tree - name = "" - while name_tree is not None: - if "name" in name_tree.attrs and name_tree.attrs["name"][1] is not None: - used_name = name_tree.name + '::%s' % name_tree.attrs["name"][1] - elif name_tree.parent is not None and name_tree.parent.count_children_by_schemaname(name_tree.schemaname) > 1: - siblings = [x for x in name_tree.parent.children if x.schemaname == name_tree.schemaname] - i = 0 - for sibling in siblings: - if sibling is name_tree: - break - else: - i = i + 1 - used_name = name_tree.name + "[%s]" % i - else: - used_name = name_tree.name - - name = "/" + used_name + name - name_tree = name_tree.parent - - # and split off the root name: - name = '/' + '/'.join(name.split('/')[2:]) - return name - - def get_xpath(self, active_tree): - # get the name to paint on the statusbar - name_tree = active_tree - name = "" - while name_tree is not None: - if "name" in name_tree.attrs and name_tree.attrs["name"][1] is not None: - used_name = name_tree.name + '[@name="%s"]' % name_tree.attrs["name"][1] - elif name_tree.parent is not None and name_tree.parent.count_children_by_schemaname(name_tree.schemaname) > 1: - siblings = [x for x in name_tree.parent.children if x.schemaname == name_tree.schemaname] - i = 0 - for sibling in siblings: - if sibling is name_tree: - break - else: - i = i + 1 - used_name = name_tree.name + "[%s]" % i - else: - used_name = name_tree.name - - name = "/" + used_name + name - name_tree = name_tree.parent - - return name - - def clear_plugin_buttons(self): - for button in self.plugin_buttons: - self.plugin_buttonbox.remove(button) - - self.plugin_buttons = [] - - def add_plugin_button(self, plugin): - button = gtk.Button(label=plugin.name) - button.connect('clicked', self.plugin_handler, plugin) - button.show() - - self.plugin_buttons.append(button) - self.plugin_buttonbox.add(button) - - def plugin_handler(self, widget, plugin): - f = StringIO.StringIO() - self.tree.write(f) - xml = f.getvalue() - xml = plugin.execute(xml, self.current_xpath) - if xml: - ios = StringIO.StringIO(xml) - - try: - tree_read = self.s.read(filename) - - if tree_read is None: - self.statusbar.set_statusbar("Unable to read plugin result") - return - - self.display_validation_errors(self.s.read_errors()) - self.tree = tree_read - except: - dialogs.error_tb(self.main_window, "Unable to read plugin result") - return - - path = self.treestore.get_path(self.selected_iter) - - self.display_validation_errors(self.s.read_errors()) - - self.set_saved(False) - - self.treeview.freeze_child_notify() - self.treeview.set_model(None) - self.signals = {} - self.set_treestore(None, [self.tree], True) - self.treeview.set_model(self.treestore) - self.treeview.thaw_child_notify() - - self.set_geometry_dim_tree() - - self.treeview.get_selection().select_path(path) - - self.scherror.destroy_error_list() - - - def get_selected_row(self, selection=None): - """ - Get the iter to the selected row. - """ - - if (selection == None): - selection = self.treeview.get_selection() - - (model, paths) = selection.get_selected_rows() - if paths: - return paths[0] - else: - return None - - def on_activate_row(self, treeview, path, view_column): - """ - Called when you double click or press Enter on a row. - """ - - iter = self.treestore.get_iter(path) - - self.expand_tree(iter) - self.on_select_row() - - if path is None: - return - - if treeview.row_expanded(path): - treeview.collapse_row(path) - else: - treeview.expand_row(path, False) - - return - - def cellcombo_changed(self, combo, tree_path, combo_iter): - """ - This is called when a cellcombo on the left-hand treeview is edited, - i.e. the user chooses between more than one possible choice. - """ - - tree_iter = self.treestore.get_iter(tree_path) - choice = self.treestore.get_value(tree_iter, 0) - - # get the ref to the new active choice - liststore = self.treestore.get_value(tree_iter, 2) - ref = liststore.get_value(combo_iter, 1) - - # record the choice in the datatree - choice.set_active_choice_by_ref(ref) - new_active_tree = choice.get_current_tree() - - name = self.get_spudpath(new_active_tree) - self.statusbar.set_statusbar(name) - self.treestore.set(tree_iter, 1, new_active_tree) - self.current_spudpath = name - xpath = self.get_xpath(new_active_tree) - self.current_xpath = xpath - - self.clear_plugin_buttons() - - for plugin in plugins.plugins: - if plugin.matches(xpath): - self.add_plugin_button(plugin) - - self.remove_children(tree_iter) - self.expand_treestore(tree_iter) - self.treeview.expand_row(tree_path, False) - - self.set_saved(False) - self.selected_node = self.get_painted_tree(tree_iter) - self.update_options_frame() - - return - - def get_treeview_iter(self, selection): - """ - Get a treeview iterator object, given a selection. - """ - - path = self.get_selected_row(selection) - if path is None: - return self.get_treestore_iter_from_xmlpath(self.current_xpath) - - return self.treestore.get_iter(path) - - def on_set_data(self, node, data, path): - self.set_saved(False) - self.treeview.queue_draw() - - def on_set_attr(self, node, attr, value, path): - self.set_saved(False) - self.treeview.queue_draw() - - def get_painted_tree(self, iter_or_tree, lock_geometry_dim = True): - """ - Check if the given tree, or the active tree at the given iter in the treestore, - have any children of the form *_value. If so, we need to make the node painted - by the options tree a mix of the two: the documentation and attributes come from - the parent, and the data from the child. - - Also check if it is the geometry node, validity of any tuple data, and, if an - iter is supplied, check that the node is active. - """ - - if isinstance(iter_or_tree, tree.Tree): - active_tree = iter_or_tree - else: - active_tree = self.treestore.get_value(iter_or_tree, 1) - - painted_tree = active_tree.get_mixed_data() - - if not isinstance(iter_or_tree, tree.Tree) and not self.iter_is_active(self.treestore, iter_or_tree): - painted_tree = tree.Tree(painted_tree.name, painted_tree.schemaname, painted_tree.attrs, doc = painted_tree.doc) - painted_tree.active = False - elif lock_geometry_dim and self.geometry_dim_tree is not None and self.geometry_dim_tree.data is not None: - if active_tree is self.geometry_dim_tree: - data_tree = tree.Tree(painted_tree.name, painted_tree.schemaname, datatype = "fixed") - data_tree.data = painted_tree.data - painted_tree = MixedTree(painted_tree, data_tree) - elif isinstance(self.geometry_dim_tree, mixedtree.MixedTree) and active_tree is self.geometry_dim_tree.parent: - data_tree = tree.Tree(painted_tree.child.name, painted_tree.child.schemaname, datatype = "fixed") - data_tree.data = painted_tree.data - painted_tree = mixedtree.MixedTree(painted_tree, data_tree) - - return painted_tree - - def get_treestore_iter_from_xmlpath(self, xmlpath): - """ - Convert the given XML path to an iter into the treestore. For children of a - single parent with the same names, only the first child is considered. - """ - - names = xmlpath.split("/") - - iter = self.treestore.get_iter_first() - if iter is None: - return None - for name in names[1:-1]: - while str(self.treestore.get_value(iter, 0)) != name: - iter = self.treestore.iter_next(iter) - if iter is None: - return None - iter = self.treestore.iter_children(iter) - if iter is None: - return None - - return iter - - def get_treestore_path_from_node(self, node): - """ - Look for the path for the given node. - """ - - def search(iter, node, indent=""): - while iter: - if self.treestore.get_value(iter, 0) is node: - return iter - else: - child = search(self.treestore.iter_children(iter), node, indent + " ") - if child: return child - - iter = self.treestore.iter_next(iter) - return iter - - iter = search(self.treestore.get_iter_first(), node) - return self.treestore.get_path(iter) if iter else None - - def set_geometry_dim_tree(self): - """ - Find the iter into the treestore corresponding to the geometry dimension, and - perform checks to test that the geometry dimension node is valid. - """ - - self.geometry_dim_tree = self.data.geometry_dim_tree = None - # The tree must exist - if self.tree is None: - return - - # A geometry dimension element must exist - iter = self.get_treestore_iter_from_xmlpath("/" + self.tree.name + self.data_paths["dim"]) - if iter is None: - return - - painted_tree = self.get_painted_tree(iter, False) - if isinstance(painted_tree, mixedtree.MixedTree): - # If the geometry dimension element has a hidden data element, it must - # have datatype tuple or fixed - if not isinstance(painted_tree.datatype, tuple) and painted_tree.datatype != "fixed": - self.geometry_dim_tree = None - return - elif painted_tree.datatype != "fixed": - # Otherwise, only fixed datatype is permitted - return - - # All parents of the geometry dimension element must have cardinality "" - # (i.e. not ?, * or +). - parent = painted_tree.parent - while parent is not None: - if parent.cardinality != "": - self.geometry_dim_tree = None - return - parent = parent.parent - - # All possible geometry dimensions must be positive integers - if isinstance(painted_tree.datatype, tuple): - possible_dims = painted_tree.datatype - elif painted_tree.datatype == "fixed": - possible_dims = [painted_tree.data] - else: - return - for opt in possible_dims: - try: - test = int(opt) - assert test > 0 - except: - return - - # A valid geometry dimension element has been located - self.geometry_dim_tree = self.data.geometry_dim_tree = painted_tree - - return - - def iter_is_active(self, treemodel, iter): - """ - Test whether the node at the given iter in the LHS treestore is active. - """ - - while iter is not None: - choice_or_tree = treemodel.get_value(iter, 0) - active_tree = treemodel.get_value(iter, 1) - if not choice_or_tree.active or not active_tree.active: - return False - iter = treemodel.iter_parent(iter) - - return True - - def choice_or_tree_matches(self, text, choice_or_tree, recurse, search_active_subtrees = False): - """ - See if the supplied node matches a given piece of text. If recurse is True, - the node is deemed to match if any of its children match or, if the node is a - choice and search_active_subtrees is True, any of the available trees in the - choice match. - """ - - if choice_or_tree.is_hidden(): - return False - elif isinstance(choice_or_tree, choice.Choice): - if self.choice_or_tree_matches(text, choice_or_tree.get_current_tree(), False): - return True - elif recurse and self.find.search_gui.get_widget("searchInactiveChoiceSubtreesCheckButton").get_active(): - for opt in choice_or_tree.choices(): - if not search_active_subtrees and opt is choice_or_tree.get_current_tree(): - continue - if opt.children == []: - self.expand_choice_or_tree(opt) - if self.choice_or_tree_matches(text, opt, recurse, True): - return True - else: - if self.get_painted_tree(choice_or_tree).matches(text, self.find.search_gui.get_widget("caseSensitiveCheckButton").get_active()): - return True - else: - if self.find.search_gui.get_widget("caseSensitiveCheckButton").get_active(): - text_re = re.compile(text) - else: - text_re = re.compile(text, re.IGNORECASE) - comment = choice_or_tree.get_comment() - if comment is not None and comment.data is not None and text_re.search(comment.data) is not None: - return True - elif recurse: - for opt in choice_or_tree.children: - if self.choice_or_tree_matches(text, opt, recurse, True): - return True - - return False - - def search_treestore(self, text, iter = None): - """ - Recursively search the tree for a node that matches a given piece of text. - MixedTree.matches and choice_or_tree_matches decide what is a match (using - tree.Matches). - - This uses lazy evaluation to only search as far as necessary; I love - Python generators. If you don't know what a Python generator is and need to - understand this, see PEP 255. - """ - - if iter is None: - iter = self.treestore.get_iter_first() - if iter is None: - yield None - choice_or_tree = self.treestore.get_value(iter, 0) - - if self.choice_or_tree_matches(text, choice_or_tree, isinstance(choice_or_tree, choice.Choice)): - yield iter - - child_iter = self.treestore.iter_children(iter) - while child_iter is not None: - for iter in self.search_treestore(text, child_iter): - yield iter - child_iter = self.treestore.iter_next(child_iter) - - return - - ### RHS ### - - def add_custom_widgets(self): - """ - Adds custom python widgets that aren't easily handeled by glade. - """ - - optionsFrame = self.gui.get_widget("optionsFrame") - - vpane1 = gtk.VPaned() - vpane2 = gtk.VPaned() - vbox = gtk.VBox() - - vpane1.pack2(vpane2, True, False) - vpane2.pack1(vbox, True, False) - optionsFrame.add(vpane1) - - self.description = descriptionwidget.DescriptionWidget() - vpane1.pack1(self.description, True, False) - - self.attributes = attributewidget.AttributeWidget() - vbox.pack_start(self.attributes, True, True) - - databuttons = databuttonswidget.DataButtonsWidget() - vbox.pack_end(databuttons, False) - - self.data = datawidget.DataWidget() - self.data.set_buttons(databuttons) - vbox.pack_end(self.data, True, True) - - self.comment = commentwidget.CommentWidget() - vpane2.pack2(self.comment, True, False) - - optionsFrame.show_all() - return - - def update_options_frame(self): - """ - Update the RHS. - """ - - self.description.update(self.selected_node) - - self.attributes.update(self.selected_node) - - self.data.update(self.selected_node) - - self.comment.update(self.selected_node) - - self.gui.get_widget("optionsFrame").queue_resize() - - return - -class DiamondFindDialog: - def __init__(self, parent, gladefile): - self.parent = parent - self.gladefile = gladefile - self.search_dialog = None - - return - - def on_find(self, widget=None): - """ - Open up the find dialog. It has to be created each time from the glade file. - """ - - if not self.search_dialog is None: - return - - signals = {"on_find_dialog_close": self.on_find_close_button, - "on_close_clicked": self.on_find_close_button, - "on_find_clicked": self.on_find_find_button} - - self.search_gui = gtk.glade.XML(self.gladefile, root="find_dialog") - self.search_dialog = self.search_gui.get_widget("find_dialog") - self.search_gui.signal_autoconnect(signals) - search_entry = self.search_gui.get_widget("search_entry") - search_entry.connect("activate", self.on_find_find_button) - - # reset the search parameters - self.search_generator = None - self.search_text = "" - self.search_count = 0 - self.search_dialog.show() - self.parent.statusbar.set_statusbar("") - - return - - def on_find_find_button(self, button): - """ - Search. Each time "Find" is clicked, we compare the stored search text to the - text in the entry box. If it's the same, we find next; if it's different, we - start a new search. self.search_treestore does the heavy lifting. - """ - - search_entry = self.search_gui.get_widget("search_entry") - - self.parent.statusbar.clear_statusbar() - - text = search_entry.get_text() - if text == "": - self.parent.statusbar.set_statusbar("No text") - return - - # check if we've started a new search - if text != self.search_text: - # started a new search - self.search_generator = None - self.search_generator = self.parent.search_treestore(text) - self.search_text = text - self.search_count = 0 - - try: - # get the iter of the next tree that matches - iter = self.search_generator.next() - path = self.parent.treestore.get_path(iter) - # scroll down to it, expand it, and select it - self.parent.treeview.expand_to_path(path) - self.parent.treeview.get_selection().select_iter(iter) - self.parent.treeview.scroll_to_cell(path, use_align=True, col_align=0.5) - # count how many hits we've had - self.search_count = self.search_count + 1 - except StopIteration: - # reset the search and cycle - self.search_text = "" - # if something was found, go through again - if self.search_count > 0: - self.on_find_find_button(button) - else: - self.parent.statusbar.set_statusbar("No results") - - return - - def on_find_close_button(self, button = None): - """ - Close the search widget. - """ - - if not self.search_dialog is None: - self.search_dialog.hide() - self.search_dialog = None - self.parent.statusbar.clear_statusbar() - - return - -class DiamondStatusBar: - def __init__(self, statusbar): - self.statusbar = statusbar - self.context_id = statusbar.get_context_id("Messages") - - return - - def set_statusbar(self, msg): - """ - Set the status bar message. - """ - - self.statusbar.push(self.context_id, msg) - - return - - def clear_statusbar(self): - """ - Clear the status bar. - """ - - self.statusbar.push(self.context_id, "") - - return diff --git a/libspud/diamond/diamond/mixedtree.py b/libspud/diamond/diamond/mixedtree.py deleted file mode 100644 index 5641c47969..0000000000 --- a/libspud/diamond/diamond/mixedtree.py +++ /dev/null @@ -1,236 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import plist - -class MixedTree: - def __init__(self, parent, child): - """ - The .doc and .attrs comes from parent, and the .data comes from child. This - is used to hide integer_value etc. from the left hand side, but for its data - entry to show up on the right. - """ - - self.parent = parent - self.child = child - - self.name = parent.name - self.schemaname = parent.schemaname - - excluded_attrs = ["shape"] - self.attrs = dict(self.parent.attrs.items() + [x for x in self.child.attrs.items() if x[0] not in excluded_attrs]) - - self.children = parent.children - self.datatype = child.datatype - self.data = child.data - self.doc = parent.doc - self.active = parent.active - - return - - def set_attr(self, attr, val): - if attr in self.parent.attrs: - self.parent.set_attr(attr, val) - elif attr in self.child.attrs: - self.child.set_attr(attr, val) - else: - raise Exception, "Attribute not present in either parent or child!" - - return - - def get_attr(self, attr): - if attr in self.parent.attrs: - self.parent.get_attr(attr) - elif attr in self.child.attrs: - self.child.get_attr(attr) - else: - raise Exception, "Attribute not present in either parent or child!" - - def set_data(self, data): - self.child.set_data(data) - self.datatype = self.child.datatype - self.data = self.child.data - - return - - def valid_data(self, datatype, data): - return self.child.valid_data(datatype, data) - - def validity_check(self, datatype, data): - return self.child.validity_check(datatype, data) - - def matches(self, text, case_sensitive = False): - old_parent_data = self.parent.data - self.parent.data = None - parent_matches = self.parent.matches(text, case_sensitive) - self.parent.data = old_parent_data - - if parent_matches: - return True - - if case_sensitive: - text_re = re.compile(text) - else: - text_re = re.compile(text, re.IGNORECASE) - - if not self.child.data is None and not text_re.search(self.child.data) is None: - return True - else: - return False - - def is_comment(self): - return self.parent.is_comment() - - def get_comment(self): - return self.parent.get_comment() - - def is_tensor(self, geometry_dim_tree): - """ - Perform a series of tests on the current MixedTree, to determine if - it is intended to be used to store tensor or vector data. - """ - - # Check that a geometry is defined - if geometry_dim_tree is None: - return False - - # Check that this element has calculable and positive dimensions - try: - dim1, dim2 = self.tensor_shape(geometry_dim_tree) - assert dim1 > 0 - assert dim2 > 0 - except AssertionError: - return False - - # The element must have dim1, rank and shape attributes - if "dim1" not in self.child.attrs.keys() \ - or "rank" not in self.child.attrs.keys() \ - or "shape" not in self.child.attrs.keys(): - return False - - # The dim1 and rank attributes must be of fixed type - if self.child.attrs["dim1"][0] != "fixed" or self.child.attrs["rank"][0] != "fixed": - return False - - if "dim2" in self.child.attrs.keys(): - # If a dim2 attribute is specified, it must be of fixed type and the rank must be 2 - # Also, the shape attribute must be a list of integers with cardinality equal to the rank - if self.child.attrs["dim2"][0] != "fixed" \ - or self.child.attrs["rank"][1] != "2" \ - or not isinstance(self.child.attrs["shape"][0], plist.List) \ - or self.child.attrs["shape"][0].datatype is not int \ - or str(self.child.attrs["shape"][0].cardinality) != self.child.attrs["rank"][1]: - return False - - # Otherwise, the rank must be one and the shape an integer - elif self.child.attrs["rank"][1] != "1" or self.child.attrs["shape"][0] is not int: - return False - - # The data for the element must be a list of one or more - if not isinstance(self.datatype, plist.List) or self.datatype.cardinality != "+": - return False - - # If the shape has been set, check that it has a valid value - if self.child.attrs["shape"][1] != None: - if geometry_dim_tree.data is None: - return False - - dim1, dim2 = self.tensor_shape(geometry_dim_tree) - if "dim2" in self.child.attrs.keys(): - if self.child.attrs["shape"][1] != str(dim1) + " " + str(dim2): - return False - elif self.child.attrs["shape"][1] != str(dim1): - return False - - return True - - def tensor_shape(self, dimension): - """ - Read the tensor shape for tensor or vector data in the current MixedTree. - """ - - if not isinstance(dimension, int): - dimension = int(dimension.data) - - dim1 = 1 - dim2 = 1 - if "dim1" in self.child.attrs.keys(): - dim1 = int(eval(self.child.attrs["dim1"][1], {"dim":dimension})) - if "dim2" in self.child.attrs.keys(): - dim2 = int(eval(self.child.attrs["dim2"][1], {"dim":dimension})) - - return (dim1, dim2) - - def is_symmetric_tensor(self, geometry): - """ - Read if the tensor data in the current MixedTree is symmetric. - """ - - dim1, dim2 = self.tensor_shape(geometry) - - return dim1 == dim2 and "symmetric" in self.child.attrs.keys() and self.child.attrs["symmetric"][1] == "true" - - def is_code(self): - """ - Perform a series of tests on the current MixedTree, to determine if - it is intended to be used to store code data. - """ - try: - lang = self.get_attr("language") - if lang == "python": - return True - except: - pass - - if self.datatype is not str: - return False - - if "type" in self.child.attrs.keys(): - return self.child.attrs["type"][1] == "code" - - return False - - def get_code_language(self): - """ - Assuming this is a code snippet return the language. - """ - - if not self.is_code(): - return "python" - - try: - lang = self.child.get_attr("language") - return lang - except: - try: - lang = self.get_attr("language") - return lang - except: - return "python" - - def get_name_path(self, leaf = True): - return self.parent.get_name_path(leaf) - - def is_sliceable(self): - return True - - def all_attrs_fixed(self): - for attr in self.attrs: - if self.attrs[attr][0] != "fixed": - return False - - return True diff --git a/libspud/diamond/diamond/plist.py b/libspud/diamond/diamond/plist.py deleted file mode 100644 index c8463135c7..0000000000 --- a/libspud/diamond/diamond/plist.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -class List: - def __init__(self, datatype, cardinality=''): - self.datatype = datatype - self.cardinality = cardinality - - # The input to call is a string containing a list of elements seperated by "," or " ". It - # returns a string, containing the elements in val seperated by " ". - def __call__(self, val): - val = val.strip() - if "," in val: - x = val.split(",") - else: - x = val.split(" ") - - # Perform some checks on the list cardinality, for oneOrMore elements ('+') - # and compulsory elements (''). - if self.cardinality == '+': - assert len(x) > 0 - elif self.cardinality == '': - assert len(x) == 1 - - # Check the list cardinality (as an integer) matches up with the number of elements - # in the seperated val string. - try: - assert len(x) == int(self.cardinality) - except ValueError: - pass # The int conversion may fail (if cardinality is '+' or ''), so just ignore it. - - # Make sure each element can be converted to type 'self.datatype'. An exception will be - # thrown if this is not possible. - for y in x: - z = self.datatype(y) - - # Return a string of the elements in val, seperated by " ". - return " ".join(x) - - def __str__(self): - return "list of " + str(self.datatype) + " of cardinality: " + self.cardinality - - def __repr__(self): - return "list of " + str(self.datatype) + " of cardinality: " + self.cardinality diff --git a/libspud/diamond/diamond/plugins.py.in b/libspud/diamond/diamond/plugins.py.in deleted file mode 100644 index 5058dd45b3..0000000000 --- a/libspud/diamond/diamond/plugins.py.in +++ /dev/null @@ -1,78 +0,0 @@ -import os -import os.path -import sys -import thread -import traceback - -import gtk.gdk - -import debug - -plugins = [] - -class PluginDetails(object): - def __init__(self, applies, name, cb): - self.applies = applies - self.name = name - self.cb = cb - - def matches(self, xpath): - try: - return self.applies(xpath) - except Exception: - debug.deprint("Warning: plugin %s raised an exception in matching function." % self.name, 0) - return False - - def execute(self, xml, xpath): - thread.start_new_thread(self.cb, (xml, xpath)) - -def register_plugin(applies, name, cb): - global plugins - p = PluginDetails(applies, name, cb) - plugins.append(p) - -def configure_plugins(suffix): - homedir = os.path.expanduser('~') - dirs=[] - if "DIAMOND_CONFIG_PATH" in os.environ: - dirs += os.environ["DIAMOND_CONFIG_PATH"].split(":") - dirs.append(os.path.join(homedir, ".diamond", "plugins", suffix)) - dirs.append("@prefix@/share/diamond/plugins/" + suffix) - if sys.platform != "win32" and sys.platform != "win64": - dirs.append("/etc/diamond/plugins/" + suffix) - - for dir in dirs: - sys.path.insert(0, dir) - try: - for file in os.listdir(dir): - module_name, ext = os.path.splitext(file) - if ext == ".py": - try: - debug.deprint("Attempting to import " + module_name, 1) - module = __import__(module_name) - except: - debug.deprint("Plugin raised an exception:", 0) - tb = traceback.format_exception(sys.exc_info()[0] ,sys.exc_info()[1], sys.exc_info()[2]) - tb_msg = "" - for tbline in tb: - tb_msg += tbline - debug.deprint(tb_msg, 0) - except OSError: - pass - -def cb_decorator(f): - def wrapper(*args, **kwargs): - gtk.gdk.threads_enter() - - try: - f(*args, **kwargs) - except: - debug.deprint("Plugin raised an exception:", 0) - tb = traceback.format_exception(sys.exc_info()[0] ,sys.exc_info()[1], sys.exc_info()[2]) - tb_msg = "" - for tbline in tb: - tb_msg += tbline - debug.deprint(tb_msg, 0) - - gtk.gdk.threads_leave() - return wrapper diff --git a/libspud/diamond/diamond/preprocess.py.in b/libspud/diamond/diamond/preprocess.py.in deleted file mode 100644 index 21e0dbfe13..0000000000 --- a/libspud/diamond/diamond/preprocess.py.in +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -from lxml import etree -import os -import os.path -import debug -import sys -import copy -import urllib2 - -def preprocess(schemafile): - p = etree.XMLParser(remove_comments=True) - ns = 'http://relaxng.org/ns/structure/1.0' - - if 'http' in schemafile: - schemafile_handle = urllib2.urlopen(schemafile) - else: - schemafile_handle = open(schemafile) - - try: - tree = etree.parse(schemafile_handle, p) - except Exception: - debug.deprint("Error: %s is not a valid Relax NG schema" % schemafile, 0) - sys.exit(1) - - # - # deal with include - # - includes = tree.xpath('/t:grammar//t:include', namespaces={'t': ns}) - - for include in includes: - include_parent = include.getparent() - include_index = list(include_parent).index(include) - - # find the file - file = None - filename = include.attrib["href"] - possible_files = [os.path.join(os.path.dirname(schemafile), filename), filename] - possible_files.append(os.path.join("@prefix@/share/spud", filename)) - possible_files.append(os.path.join(os.path.dirname(__file__) + "/../../schema", filename)) - - for possible_file in possible_files: - try: - if 'http' in possible_file: - file = urllib2.urlopen(possible_file) - else: - file = open(possible_file) - break - except IOError: - debug.deprint("IOError when searching for included file " + filename, 1) - - if file is None: - debug.deprint("Error: could not locate included file %s" % filename, 0) - debug.deprint("Path: %s" % possible_files) - sys.exit(1) - - # parse the included xml file and steal all the nodes - include_tree = etree.parse(file, p) - nodes_to_take = include_tree.xpath('/t:grammar/*', namespaces={'t': ns}) - - # here's where the magic happens: - for node in nodes_to_take: - include_parent.insert(include_index, copy.deepcopy(node)) - - # now delete the include: - include_parent.remove(include) - - grammar_list = tree.xpath('/t:grammar', namespaces={'t': ns}) - - # If the .rnc didn't include a start = prefix, then no valid - # grammar tag will be present. Let the user know. - - if len(grammar_list) == 0: - debug.deprint("Error: No grammar tag present in schema.", 0) - sys.exit(1) - - grammar = grammar_list[0] - - defines = {} - define_nodes = tree.xpath('/t:grammar//t:define', namespaces={'t': ns}) - - # - # deal with combine="interleave" - # - - # first, fetch all the plain definitions - for define in define_nodes: - if "combine" not in define.attrib: - name = define.attrib["name"] - defines[name] = define - - # now look for interleaves with those - for define in define_nodes: - if "combine" in define.attrib and define.attrib["combine"] == "interleave": - name = define.attrib["name"] - if name not in defines: - defines[name] = define - else: - matching_defn = defines[name] - for child in define: - matching_defn.append(copy.deepcopy(child)) - - # - # deal with combine="choice" - # - combine_names = [] - for define in define_nodes: - if "combine" in define.attrib and define.attrib["combine"] == "choice": - name = define.attrib["name"] - combine_names.append(name) - - combine_names = list(set(combine_names)) - for name in combine_names: - xpath = tree.xpath('/t:grammar//t:define[@name="%s"]' % name, namespaces={'t': ns}) - choices = [] - for node in xpath: - choices = choices + list(node) - define = etree.Element("define") - define.attrib["name"] = name - choice = etree.Element("choice") - define.append(choice) - for x in choices: - choice.append(x) - defines[name] = define - - # delete all the define nodes from the xml - for define in define_nodes: - parent = define.getparent() - parent.remove(define) - - # add the modified defines back to the grammar - for define in defines.values(): - grammar.append(define) - - return etree.tostring(tree, xml_declaration=True, encoding='utf-8', pretty_print=True) - -if __name__ == "__main__": - import sys - schemafile = sys.argv[1] - newfile = schemafile.replace(".rng", ".pp.rng") - f = open(newfile, "w") - f.write(preprocess(schemafile)) diff --git a/libspud/diamond/diamond/pygtkconsole.py b/libspud/diamond/diamond/pygtkconsole.py deleted file mode 100644 index 57926cd3ab..0000000000 --- a/libspud/diamond/diamond/pygtkconsole.py +++ /dev/null @@ -1,333 +0,0 @@ -#!/usr/bin/env python - -# GTK Interactive Console -# (C) 2003, Jon Anderson -# (C) 2007 Imperial College London and others. -# Please see the AUTHORS file for a full list of contributors. - -# See www.python.org/2.2/license.htm for -# license details. -# - -import gtk -import gtk.gdk -import code -import sys -import pango - -import __builtin__ -import __main__ - -import debug - -banner = """GTK Interactive Python Console -%s -""" % sys.version - -class Completer: - """ - Taken from rlcompleter, with readline references stripped, and a local dictionary to use. - """ - def __init__(self, locals): - self.locals = locals - - def complete(self, text, state): - """Return the next possible completion for 'text'. - This is called successively with state == 0, 1, 2, ... until it - returns None. The completion should begin with 'text'. - - """ - if state == 0: - if "." in text: - self.matches = self.attr_matches(text) - else: - self.matches = self.global_matches(text) - try: - return self.matches[state] - except IndexError: - return None - - def global_matches(self, text): - """Compute matches when text is a simple name. - - Return a list of all keywords, built-in functions and names - currently defines in __main__ that match. - - """ - import keyword - matches = [] - n = len(text) - for list in [keyword.kwlist,__builtin__.__dict__.keys(),__main__.__dict__.keys(), self.locals.keys()]: - for word in list: - if word[:n] == text and word != "__builtins__": - matches.append(word) - return matches - - def attr_matches(self, text): - """Compute matches when text contains a dot. - - Assuming the text is of the form NAME.NAME....[NAME], and is - evaluatable in the globals of __main__, it will be evaluated - and its attributes (as revealed by dir()) are used as possible - completions. (For class instances, class members are are also - considered.) - - WARNING: this can still invoke arbitrary C code, if an object - with a __getattr__ hook is evaluated. - - """ - import re - m = re.match(r"(\w+(\.\w+)*)\.(\w*)", text) - if not m: - return - expr, attr = m.group(1, 3) - object = eval(expr, __main__.__dict__, self.locals) - words = dir(object) - if hasattr(object,'__class__'): - words.append('__class__') - words = words + get_class_members(object.__class__) - matches = [] - n = len(attr) - for word in words: - if word[:n] == attr and word != "__builtins__": - matches.append("%s.%s" % (expr, word)) - return matches - -def get_class_members(klass): - ret = dir(klass) - if hasattr(klass,'__bases__'): - for base in klass.__bases__: - ret = ret + get_class_members(base) - return ret - - - -class OutputStream: - """ - A Multiplexing output stream. - It can replace another stream, and tee output to the original stream and too - a GTK textview. - """ - def __init__(self,view,old_out,style): - self.view = view - self.buffer = view.get_buffer() - self.mark = self.buffer.create_mark("End",self.buffer.get_end_iter(), False ) - self.out = old_out - self.style = style - self.tee = 1 - - def write(self,text): - if self.tee: - debug.dwrite(self.out, text, newline = False, flush = False) - - end = self.buffer.get_end_iter() - - if not self.view == None: - self.view.scroll_to_mark(self.mark, 0, True, 1, 1) - - self.buffer.insert_with_tags(end,text,self.style) - - def flush(self): - self.view.queue_draw() - - return - -class GTKInterpreterConsole(gtk.ScrolledWindow): - """ - An InteractiveConsole for GTK. It's an actual widget, - so it can be dropped in just about anywhere. - """ - def __init__(self, locals = None): - gtk.ScrolledWindow.__init__(self) - self.set_policy (gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC) - - self.text = gtk.TextView() - self.text.set_wrap_mode(True) - - self.interpreter = code.InteractiveInterpreter(locals) - - self.completer = Completer(self.interpreter.locals) - self.buffer = [] - self.history = [] - self.banner = banner - self.ps1 = ">>> " - self.ps2 = "... " - - self.text.add_events( gtk.gdk.KEY_PRESS_MASK ) - self.text.connect( "key_press_event", self.key_pressed ) - - self.current_history = -1 - - self.mark = self.text.get_buffer().create_mark("End",self.text.get_buffer().get_end_iter(), False ) - - #setup colors - self.style_banner = gtk.TextTag("banner") - self.style_banner.set_property( "foreground", "saddle brown" ) - - self.style_ps1 = gtk.TextTag("ps1") - self.style_ps1.set_property( "foreground", "DarkOrchid4" ) - self.style_ps1.set_property( "editable", False ) - self.style_ps1.set_property("font", "courier" ) - - self.style_ps2 = gtk.TextTag("ps2") - self.style_ps2.set_property( "foreground", "DarkOliveGreen" ) - self.style_ps2.set_property( "editable", False ) - self.style_ps2.set_property("font", "courier" ) - - self.style_out = gtk.TextTag("stdout") - self.style_out.set_property( "foreground", "midnight blue" ) - self.style_err = gtk.TextTag("stderr") - self.style_err.set_property( "style", pango.STYLE_ITALIC ) - self.style_err.set_property( "foreground", "red" ) - - self.text.get_buffer().get_tag_table().add(self.style_banner) - self.text.get_buffer().get_tag_table().add(self.style_ps1) - self.text.get_buffer().get_tag_table().add(self.style_ps2) - self.text.get_buffer().get_tag_table().add(self.style_out) - self.text.get_buffer().get_tag_table().add(self.style_err) - - self.stdout = OutputStream(self.text,sys.stdout,self.style_out) - self.stderr = OutputStream(self.text,sys.stderr,self.style_err) - - sys.stderr = self.stderr - sys.stdout = self.stdout - - self.current_prompt = None - - self.write_line(self.banner, self.style_banner) - self.prompt_ps1() - - self.add(self.text) - self.text.show() - - - - def reset_history(self): - self.history = [] - - def reset_buffer(self): - self.buffer = [] - - def prompt_ps1(self): - self.current_prompt = self.prompt_ps1 - self.write_line(self.ps1,self.style_ps1) - - def prompt_ps2(self): - self.current_prompt = self.prompt_ps2 - self.write_line(self.ps2,self.style_ps2) - - def write_line(self,text,style=None): - start,end = self.text.get_buffer().get_bounds() - if style==None: - self.text.get_buffer().insert(end,text) - else: - self.text.get_buffer().insert_with_tags(end,text,style) - - self.text.scroll_to_mark(self.mark, 0, True, 1, 1) - - def push(self, line): - - self.buffer.append(line) - if len(line) > 0: - self.history.append(line) - - source = "\n".join(self.buffer) - - more = self.interpreter.runsource(source, "<>") - - if not more: - self.reset_buffer() - - return more - - def key_pressed(self,widget,event): - if event.keyval == gtk.gdk.keyval_from_name('Return'): - return self.execute_line() - - if event.keyval == gtk.gdk.keyval_from_name('Up'): - self.current_history = self.current_history - 1 - if self.current_history < - len(self.history): - self.current_history = - len(self.history) - return self.show_history() - elif event.keyval == gtk.gdk.keyval_from_name('Down'): - self.current_history = self.current_history + 1 - if self.current_history > 0: - self.current_history = 0 - return self.show_history() - elif event.keyval == gtk.gdk.keyval_from_name( 'Home'): - l = self.text.get_buffer().get_line_count() - 1 - start = self.text.get_buffer().get_iter_at_line_offset(l,4) - self.text.get_buffer().place_cursor(start) - return True - elif event.keyval == gtk.gdk.keyval_from_name( 'space') and event.state & gtk.gdk.CONTROL_MASK: - return self.complete_line() - return False - - def show_history(self): - if self.current_history == 0: - return True - else: - self.replace_line( self.history[self.current_history] ) - return True - - def current_line(self): - start,end = self.current_line_bounds() - return self.text.get_buffer().get_text(start,end, True) - - def current_line_bounds(self): - txt_buffer = self.text.get_buffer() - l = txt_buffer.get_line_count() - 1 - - start = txt_buffer.get_iter_at_line(l) - if start.get_chars_in_line() >= 4: - start.forward_chars(4) - end = txt_buffer.get_end_iter() - return start,end - - def replace_line(self,txt): - start,end = self.current_line_bounds() - self.text.get_buffer().delete(start,end) - self.write_line(txt) - - def execute_line(self): - line = self.current_line() - - self.write_line("\n") - - more = self.push(line) - - self.text.get_buffer().place_cursor(self.text.get_buffer().get_end_iter()) - - if more: - self.prompt_ps2() - else: - self.prompt_ps1() - - - self.current_history = 0 - - return True - - def complete_line(self): - line = self.current_line() - tokens = line.split() - token = tokens[-1] - - completions = [] - p = self.completer.complete(token,len(completions)) - while p != None: - completions.append(p) - p = self.completer.complete(token, len(completions)) - - if len(completions) != 1: - self.write_line("\n") - self.write_line("\n".join(completions), self.style_ps1) - self.write_line("\n") - self.current_prompt() - self.write_line(line) - else: - i = line.rfind(token) - line = line[0:i] + completions[0] - self.replace_line(line) - - return True diff --git a/libspud/diamond/diamond/schema.py b/libspud/diamond/diamond/schema.py deleted file mode 100644 index 9937980ced..0000000000 --- a/libspud/diamond/diamond/schema.py +++ /dev/null @@ -1,890 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import base64 -import bz2 -import copy -import sys - -import cStringIO - -from lxml import etree - -import debug -import choice -import plist -import preprocess -import tree - -def memoise(f): - cache = {} - def memf(*x): - if x not in cache: - cache[x] = f(*x) - return cache[x] - return memf - -########################## -# SCHEMA CLASS # -########################## - -class Schema(object): - def __init__(self, schemafile): - p = etree.XMLParser(remove_comments=True) - self.tree = etree.parse(cStringIO.StringIO(preprocess.preprocess(schemafile)), p) - - self.callbacks = {'element': self.cb_element, - 'documentation': self.cb_documentation, - 'value': self.cb_value, - 'attribute': self.cb_attribute, - 'data': self.cb_data, - 'optional': self.cb_optional, - 'zeroOrMore': self.cb_zeroormore, - 'oneOrMore': self.cb_oneormore, - 'choice': self.cb_choice, - 'empty': self.cb_empty, - 'list': self.cb_list, - 'group': self.cb_group, - 'interleave': self.cb_group, - 'name': self.cb_name, - 'text': self.cb_text, - 'anyName' : self.cb_anyname, - 'nsName' : self.cb_nsname, - 'except' : self.cb_except, - 'ignore' : self.cb_ignore, - 'notAllowed' : self.cb_notallowed} - - self.lost_eles = [] - self.added_eles = [] - self.lost_attrs = [] - self.added_attrs = [] - - return - - @memoise - def element_children(self, element): - """ - Return a list of the children of the supplied element, following references - as required. - """ - - children = [] - for child1 in element.iterchildren(tag=etree.Element): - if self.tag(child1) == "ref": - if not "name" in child1.keys(): - debug.deprint("Warning: Encountered reference with no name") - continue - - name = child1.get("name") - - xpath = self.tree.xpath('/t:grammar/t:define[@name="' + name + '"]', - namespaces={'t': 'http://relaxng.org/ns/structure/1.0'}) - - if len(xpath) == 0: - debug.deprint("Warning: Schema reference %s not found" % name, 0) - continue - - for child2 in self.element_children(xpath[0]): - children.append(child2) - else: - children.append(child1) - - return children - - def choice_children(self, children): - """ - Collapse all choices within a choice into a single list of (non-choice) children - """ - - out_children = [] - for child in children: - if self.tag(child) == "choice": - out_children = out_children + self.choice_children(self.element_children(child)) - else: - out_children.append(child) - - return out_children - - def valid_children(self, eid): - if isinstance(eid, tree.Tree): - eid = eid.schemaname - - if eid == ":start": - try: - node = self.tree.xpath('/t:grammar/t:start', namespaces={'t': 'http://relaxng.org/ns/structure/1.0'})[0] - except: - debug.deprint("No valid start node found. Are you using a library Relax-NG file like spud_base.rng?", 0) - sys.exit(0) - else: - xpath = self.tree.xpath(eid) - if len(xpath) == 0: - debug.deprint("Warning: no element with XPath %s" % eid) - return [] - node = xpath[0] - - results = [] - - for child in self.element_children(node): - self.append(results, self.to_tree(child)) - - if eid == ":start" and len(results) != 1: - debug.deprint("Error: there must be exactly one root element in an XML document, but found:", 0) - for result in results: - debug.deprint(" %s" % result.name, 0) - sys.exit(1) - - return results - - def valid_node(self, eid): - if isinstance(eid, tree.Tree) or isinstance(eid, choice.Choice): - eidtree = eid - eid = eid.schemaname - - xpath = self.tree.xpath(eid) - if len(xpath) == 0: - debug.deprint("Warning: no element with XPath %s" % eid) - return None - node = xpath[0] - - node = self.to_tree(node) - - if eidtree is not None: - node.cardinality = eidtree.cardinality - node.parent = eidtree.parent - - return node - - def to_tree(self, element): - tag = self.tag(element) - f = self.callbacks[tag] - facts = {} - x = f(element, facts) - return x - - ############################################# - # Beginning of schema processing functions. # - ############################################# - - def cb_name(self, element, facts): - name = element.text - facts["name"] = name - - def cb_element(self, element, facts): - newfacts = {} - if "cardinality" in facts: - newfacts["cardinality"] = facts["cardinality"] - - if "name" in element.keys(): - newfacts["name"] = element.get("name") - else: - debug.deprint("Warning: Encountered element with no name") - - newfacts['schemaname'] = self.tree.getpath(element) - - for child in self.element_children(element): - tag = self.tag(child) - - if tag not in ['element', 'optional', 'zeroOrMore', 'oneOrMore', 'ignore']: - f = self.callbacks[tag] - x = f(child, newfacts) - - try: - d = newfacts["datatype"] - if isinstance(d, tuple): - new_d = [] - - for x in d: - if x is not None: - new_d.append(x) - - d = tuple(new_d) - newfacts["datatype"] = d - if len(d) == 0: - newfacts["datatype"] = None - elif len(d) == 1 and isinstance(d[0], plist.List): - newfacts["datatype"] = d[0] - else: - l_values = [] - l_data = [] - for x in d: - if isinstance(x, str): - l_values.append(x) - else: - l_data.append(x) - - if len(l_data) > 1: - if "name" in element.keys(): - debug.deprint("Warning: Element %s has multiple datatypes - using first one" % newfacts["name"]) - else: - debug.deprint("Warning: Unnamed element has multiple datatypes - using first one") - - if len(l_data) > 0: - if len(l_values) == 0: - newfacts["datatype"] = l_data[0] - else: - newfacts["datatype"] = tuple([tuple(l_values)] + l_data[0]) - except KeyError: - pass - - return tree.Tree(**newfacts) - - def cb_documentation(self, element, facts): - facts['doc'] = element.text - - def cb_value(self, element, facts): - if "datatype" in facts: - l = list(facts["datatype"]) - else: - l = [] - - l.append(element.text) - facts["datatype"] = tuple(l) - - def cb_attribute(self, element, facts): - if not "name" in element.keys(): - debug.deprint("Warning: Encountered attribute with no name") - return - - newfacts = {} - name = element.get("name") - - for child in self.element_children(element): - tag = self.tag(child) - f = self.callbacks[tag] - x = f(child, newfacts) - - if "attrs" not in facts: - facts["attrs"] = {} - - try: - datatype = newfacts["datatype"] - except: - debug.deprint("Warning: Encountered attribute with no datatype") - return - curval = None - - if isinstance(datatype, tuple): - new_datatype = [] - for x in datatype: - if not x is None: - new_datatype.append(x) - datatype = new_datatype - if len(datatype) == 0: - datatype = None - elif len(datatype) == 1: - datatype = datatype[0] - if isinstance(datatype, str): - curval = datatype - datatype = 'fixed' - else: - curval = None - else: - l_values = [] - l_data = [] - for x in datatype: - if isinstance(x, str): - l_values.append(x) - else: - l_data.append(x) - - if len(l_data) > 0: - debug.deprint("Warning: Attribute %s has multiple datatypes - using first one" % name) - if len(l_values) == 0: - datatype = l_data[0] - else: - datatype = tuple([tuple(l_values)] + l_data[0]) - else: - datatype = tuple(l_values) - - facts["attrs"][name] = (datatype, curval) - - def cb_data(self, element, facts): - if "datatype" in facts: - if isinstance(facts["datatype"], tuple): - l = list(facts["datatype"]) - else: - l = [facts["datatype"]] - else: - l = [] - - mapping = {'integer': int, - 'float': float, - 'double': float, - 'decimal': float, - 'string': str, - 'ID' : str, - 'anyURI' : str, - 'IDREF' : int, - 'NMTOKEN' : str, - 'boolean': bool} - - datatype_name = element.get("type") - l.append(mapping[datatype_name]) - if len(l) == 1: - facts["datatype"] = l[0] - else: - facts["datatype"] = tuple(l) - - def cb_optional(self, element, facts): - facts["cardinality"] = '?' - r = [] - for child in self.element_children(element): - tag = self.tag(child) - f = self.callbacks[tag] - self.append(r, f(child, facts)) - - return r - - def cb_zeroormore(self, element, facts): - facts["cardinality"] = '*' - r = [] - for child in self.element_children(element): - tag = self.tag(child) - f = self.callbacks[tag] - self.append(r, f(child, facts)) - - return r - - def cb_oneormore(self, element, facts): - facts["cardinality"] = '+' - r = [] - for child in self.element_children(element): - tag = self.tag(child) - f = self.callbacks[tag] - self.append(r, f(child, facts)) - - return r - - def cb_choice(self, element, facts): - # there are really two cases here. - # choice between values of elements, - # and choice between elements - - tagnames = [self.tag(child) for child in element] - - if "value" in tagnames: - for child in self.element_children(element): - tag = self.tag(child) - f = self.callbacks[tag] - x = f(child, facts) - - else: - if "schemaname" in facts: - return - - facts['schemaname'] = self.tree.getpath(element) - - r = [] - children = self.choice_children(self.element_children(element)) - - # bloody simplified RNG - if len(children) == 2: - empty = [x for x in children if self.tag(x) == "empty"] - if empty: - nonempty = [x for x in children if self.tag(x) != "empty"] - tag = self.tag(nonempty[0]) - f = self.callbacks[tag] - return f(element, facts) - - for child in children: - newfacts = {} - tag = self.tag(child) - f = self.callbacks[tag] - self.append(r, f(child, newfacts)) - - return choice.Choice(r, **facts) - - def cb_empty(self, element, facts): - pass - - def cb_list(self, element, facts): - newfacts = {} - for child in self.element_children(element): - tag = self.tag(child) - f = self.callbacks[tag] - f(child, newfacts) - - d = newfacts["datatype"] - try: - c = newfacts["cardinality"] - except KeyError: - c = '' - if isinstance(d, tuple): - c = str(len(d)) - d = d[0] - - l = plist.List(d, c) - if "datatype" in facts: - e = list(facts["datatype"]) - else: - e = [] - - e.append(l) - facts["datatype"] = tuple(e) - - def cb_group(self, element, facts): - results = [] - for child in self.element_children(element): - newfacts = {} - tag = self.tag(child) - f = self.callbacks[tag] - self.append(results, f(child, newfacts)) - - return results - - def cb_text(self, element, facts): - if "datatype" in facts: - if isinstance(facts["datatype"], tuple): - l = list(facts["datatype"]) - else: - l = [facts["datatype"]] - else: - l = [] - - l.append(str) - if len(l) == 1: - facts["datatype"] = l[0] - else: - facts["datatype"] = tuple(l) - - def cb_anyname(self, element, facts): - debug.deprint("anyName element found. Yet to handle.", 0) -# sys.exit(1) - - def cb_nsname(self, element, facts): - debug.deprint("nsName element found. Yet to handle.", 0) -# sys.exit(1) - - def cb_except(self, element, facts): - debug.deprint("except element found. Yet to handle.", 0) -# sys.exit(1) - - def cb_ignore(self, element, facts): - pass - - def cb_notallowed(self, element, facts): - debug.dprint("notallowed element found. Yet to handle.", 0) - - ####################################### - # End of schema processing functions. # - ####################################### - - def tag(self, element): - # Ignore non-RelaxNG elements. Is this the best way to handle it? - namespace = element.tag.split('}')[0] - if namespace.find("relaxng") != -1: - return element.tag.split('}')[-1] - else: - return "ignore" - - # append - append either a list or single element 'x' to 'r'. - def append(self, r, x): - if x is None: - return - - if isinstance(x, list): - r.extend(x) - else: - r.append(x) - - ########################################## - # Beginning of XML processing functions. # - ########################################## - - # read takes a file handle, constructs a generic in-memory representation using the - # the etree API, and then converts it to a tree of Tree and Choice elements. - def read(self, xmlfile, root = None): - try: - doc = etree.parse(xmlfile) - except etree.XMLSyntaxError as e: - debug.dprint("Invalid XML.") - debug.dprint(e) - return None - - self.lost_eles = [] - self.added_eles = [] - self.lost_attrs = [] - self.added_attrs = [] - - if root is None: - datatree = self.valid_children(":start")[0] - else: - datatree = self.valid_node(root) - - xmlnode = doc.getroot() - self.xml_read_merge(datatree, xmlnode) - self.xml_read_core(datatree.get_current_tree(), xmlnode, doc) - - if len(self.lost_eles) != 0: - debug.deprint("WARNING: Lost XML elements:\n" + str(self.lost_eles)) - if len(self.added_eles) != 0: - debug.deprint("WARNING: Added XML elements:\n" + str(self.added_eles)) - if len(self.lost_attrs) != 0: - debug.deprint("WARNING: Lost XML attributes:\n" + str(self.lost_attrs)) - if len(self.added_eles) != 0: - debug.deprint("WARNING: Added XML attributes:\n" + str(self.added_attrs)) - - return datatree - - def xml_read_merge(self, datatree, xmlnode): - # The datatree has the following set: - # name, schemaname, doc, cardinality, datatype, parent, - # attribute datatypes. - # the xmlnode contains the following information: - # attribute values, data - # merge the two. - - datatree.xmlnode = xmlnode - xmlkeys = xmlnode.keys() - - if datatree.__class__ is tree.Tree: - to_set = datatree - elif datatree.__class__ is choice.Choice: - if "name" in xmlkeys: - xmlname = xmlnode.get("name") - have_found = False - - possibles = [tree_choice for tree_choice in datatree.get_choices() if tree_choice.name == xmlnode.tag] - # first loop over the fixed-value names - for tree_choice in possibles: - if "name" not in tree_choice.attrs: - continue - - datatype = tree_choice.attrs["name"][0] - if datatype == 'fixed': - treename = tree_choice.attrs["name"][1] - if treename == xmlname: - have_found = True - datatree.set_active_choice_by_ref(tree_choice) - break - - # if we haven't found it, look for a generic name - if have_found is False: - for tree_choice in possibles: - if "name" not in tree_choice.attrs: - continue - - datatype = tree_choice.attrs["name"][0] - if datatype != 'fixed': - have_found = True - datatree.set_active_choice_by_ref(tree_choice) - break - - else: - datatree.set_active_choice_by_name(xmlnode.tag) - - to_set = datatree.get_current_tree() - - # catch any lost XML attributes - for key in xmlkeys: - if key not in to_set.attrs.keys(): - self.lost_attrs += [to_set.name + '/' + key] - - # attribute values. - for key in to_set.attrs.keys(): - if key in xmlkeys: - try: - to_set.set_attr(key, xmlnode.get(key)) - except: - pass - else: - self.added_attrs += [to_set.name + '/' + key] - - # Get the text value (the node's data) - if xmlnode.text is not None: - try: - text=xmlnode.text.strip() - if text != "": - to_set.set_data(text) - except: - pass - - - # data. - for child in xmlnode.iterchildren(tag=etree.Element): - if child.tail is not None: - try: - text = child.tail.strip() - if text != "": - to_set.set_data(text) - break - except: - pass - - to_set.recompute_validity() - datatree.recompute_validity() - - ########################################################################################### - # construct the priority queue - # we treat compulsory nodes first, then descend through the cardinalities - ########################################################################################### - - def construct_priority_queue(self, schemachildren): - # priority_queue will store the schemachildren, in the order in which - # they query data from the XML - priority_queue = [] - - # compulsory first. - for schemachild in schemachildren: - if schemachild.cardinality == '': - priority_queue.append(schemachild) - - # then oneormore. - for schemachild in schemachildren: - if schemachild.cardinality == '+': - priority_queue.append(schemachild) - - # then, optional - for schemachild in schemachildren: - if schemachild.cardinality == '?': - priority_queue.append(schemachild) - - # then zeroormore. - for schemachild in schemachildren: - if schemachild.cardinality == '*': - priority_queue.append(schemachild) - - return priority_queue - - ########################################################################################### - # initialise the availability data - # avail[name][xmlnode] records whether xmlnode is available or not - ########################################################################################### - def init_avail_data(self, xmlnode, schemachildren): - used = {} - avail = {} - - for xml in xmlnode.iterchildren(tag=etree.Element): - used[xml] = False - - for schemachild in schemachildren: - for name in schemachild.get_possible_names(): - avail[name] = {} - - for name in avail: - for xmldata in xmlnode.iterchildren(tag=name): - avail[name][xmldata] = True - - return (used, avail) - - ########################################################################################### - # assign the available xml nodes to the children the schema says should be there - # in order of priority. - # xmls[schemachild.schemaname] is the list of xml nodes - # that schemachild should take - ########################################################################################### - def assign_xml_nodes(self, priority_queue, xmlnode, avail): - xmls = {} - - for schemachild in priority_queue: - if schemachild.cardinality in ['', '?']: - for curtree in schemachild.get_choices(): - name = curtree.name - - have_fixed_name = False - if "name" in curtree.attrs: - datatype = curtree.attrs["name"][0] - if datatype == 'fixed': - have_fixed_name = True - - if have_fixed_name is False: - xml = xmlnode.xpath(name) - else: - xml = xmlnode.xpath(name + '[@name="%s"]' % curtree.get_attr("name")) - - for xmldata in xml: - if avail[name][xmldata]: - avail[name][xmldata] = False - xmls[schemachild.schemaname] = [xmldata] - break - - if schemachild.schemaname not in xmls: - if schemachild.cardinality == '': - xmls[schemachild.schemaname] = copy.deepcopy([]) - else: - xmls[schemachild.schemaname] = copy.deepcopy([]) - elif schemachild.cardinality in ['*', '+']: - xmls[schemachild.schemaname] = copy.deepcopy([]) - for curtree in schemachild.get_choices(): - name = curtree.name - - have_fixed_name = False - if "name" in curtree.attrs: - datatype = curtree.attrs["name"][0] - if datatype == 'fixed': - have_fixed_name = True - - if have_fixed_name is False: - xml = xmlnode.xpath(name) - else: - xml = xmlnode.xpath(name + '[@name="%s"]' % curtree.get_attr("name")) - - for xmldata in xml: - if avail[name][xmldata]: - avail[name][xmldata] = False - xmls[schemachild.schemaname].append(xmldata) - - return xmls - - ########################################################################################### - # now that we have assigned the xml nodes, loop through and grab them - # stuff the tree data in bins[schemachild.schemaname] - ########################################################################################### - def assign_xml_children(self, priority_queue, xmlnode, xmls, schemachildren, used, rootdoc): - # bins[schemachild.schemaname] will store the data associated with schemachild - bins = {} - - for schemachild in schemachildren: - bins[schemachild.schemaname] = [] - - for schemachild in priority_queue: - if schemachild.cardinality in ['', '?']: - child = schemachild.copy() - child.xmlnode = None - child.active = True - if len(xmls[schemachild.schemaname]) == 1: - xmldata = xmls[schemachild.schemaname][0] - used[xmldata] = True - self.xml_read_merge(child, xmldata) - - # Was this part of the uncompressed XML file or part of a hidden comment? - if xmldata.getroottree().getroot() != rootdoc.getroot(): - self.xml_read_core(child.get_current_tree(), xmldata, xmldata.getroottree()) - child.active = False - child.recurse = False - else: - if schemachild.cardinality == '?': - child.active = False - - bins[schemachild.schemaname] = [child] - - elif schemachild.cardinality in ['*', '+']: - for xmldata in xmls[schemachild.schemaname]: - child = schemachild.copy() - child.active = True - used[xmldata] = True - self.xml_read_merge(child, xmldata) - bins[schemachild.schemaname].append(child) - - if schemachild.cardinality == '+': - # check that we have at least one. - count = len(bins[schemachild.schemaname]) - if count == 0: - child = schemachild.copy() - child.active = True - child.xmlnode = None - bins[schemachild.schemaname] = [child] - - if schemachild.cardinality in ['*', '+']: - # add an inactive instance - child = schemachild.copy() - child.active = False - child.xmlnode = None - bins[schemachild.schemaname].append(child) - - # search for neglected choices - if isinstance(schemachild, choice.Choice) and schemachild.cardinality in ['', '?']: - for child in bins[schemachild.schemaname]: - - # Does the child have a valid XML node attached? - if not hasattr(child, "xmlnode"): continue - if child.xmlnode is None: continue - - current_choice = child.get_current_tree() - for tree_choice in child.get_choices(): - if tree_choice is current_choice: continue - - return bins - - # Loop over lost nodes, and store their XML so the user can be notified later. - def check_unused_nodes(self, used): - def xml2string(xml): - buf = cStringIO.StringIO() - buf.write(etree.tostring(xml, pretty_print = True)) - s = buf.getvalue() - buf.close() - - return s - - for xml in used: - if used[xml] is False: - s = xml2string(xml) - self.lost_eles += [s] - - # Append the children to the datatree in the order the schema presents them. - # Order matters here. - def append_children(self, schemachildren, datatree, bins): - for schemachild in schemachildren: - for child in bins[schemachild.schemaname]: - child.set_parent(datatree) - datatree.children.append(child) - - # Recurse down the in-memory XML tree, reading elements and merging their - # information into the in-memory Tree structure. - def read_children(self, datatree, rootdoc): - for schild in datatree.children: - - if hasattr(schild, "recurse"): - if schild.recurse is False: - continue - - if schild.__class__ is choice.Choice: - child = schild.get_current_tree() - else: - child = schild - - if schild.active is False: - continue - - child.children = copy.copy([]) - self.xml_read_core(child, schild.xmlnode, rootdoc) - - # xml_read_core recurses throughout the tree, calling xml_read_merge on the current node "xmlnode" and - # and reading information about the node's children. - def xml_read_core(self, datatree, xmlnode, rootdoc): - """This is the part that recurses, you see.""" - - assert len(datatree.children) == 0 - - # no information from XML to be had :-/ - if xmlnode is None: - self.added_eles.append(self.readable_name(datatree)) - if datatree.active: datatree.add_children(self) - return - - schemachildren = self.valid_children(datatree) - - priority_queue = self.construct_priority_queue(schemachildren) - (used, avail) = self.init_avail_data(xmlnode, schemachildren) - xmls = self.assign_xml_nodes(priority_queue, xmlnode, avail) - bins = self.assign_xml_children(priority_queue, xmlnode, xmls, schemachildren, used, rootdoc) - self.append_children(schemachildren, datatree, bins) - self.check_unused_nodes(used) - self.read_children(datatree, rootdoc) - - datatree.recompute_validity() - - def read_errors(self): - return self.lost_eles, self.added_eles, self.lost_attrs, self.added_attrs - - def readable_name(self, datatree): - output = "" - node = datatree - while node is not None: - output = node.name + '/' + output - node = node.parent - return '/' + output[:-1] diff --git a/libspud/diamond/diamond/schemausage.py b/libspud/diamond/diamond/schemausage.py deleted file mode 100755 index 18dd093be1..0000000000 --- a/libspud/diamond/diamond/schemausage.py +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -from cStringIO import StringIO -from lxml import etree - -from schema import Schema - -RELAXNGNS = "http://relaxng.org/ns/structure/1.0" -RELAXNG = "{" + RELAXNGNS + "}" - -def find_fullset(tree): - """ - Given a schema tree pulls out xpaths for every element. - """ - - cache = set() - - def traverse(node): - - if node.tag == RELAXNG + "element" or (node.tag == RELAXNG + "choice" and all(n.tag != RELAXNG + "value" for n in node)): - fullset.add(tree.getpath(node)) - - elif node.tag == RELAXNG + "ref": - query = '/t:grammar/t:define[@name="' + node.get("name") + '"]' - if query in cache: - return # we only need to add the reference once - cache.add(query) - node = tree.xpath('/t:grammar/t:define[@name="' + node.get("name") + '"]', namespaces={'t': RELAXNGNS})[0] - - for child in node: - traverse(child) - - start = tree.xpath("/t:grammar/t:start", namespaces={'t': RELAXNGNS})[0] - - root = start[0] - - fullset = set() - traverse(root) - return fullset - -def find_useset(tree): - """ - Given a diamond xml tree pulls out scehama paths for every element and attribute. - """ - - def traverse(node): - if node.active: - useset.add(node.schemaname) - - for child in node.get_children(): - traverse(child) - - useset = set() - traverse(tree) - return useset - -def find_unusedset(schema, paths): - """ - Given the a diamond schema and a list of paths to xml files - find the unused xpaths. - """ - def traverse(node): - if node.active: - unusedset.discard(node.schemaname) - - for child in node.get_children(): - traverse(child) - - unusedset = find_fullset(schema.tree) - - for path in paths: - try: - tree = schema.read(path) - traverse(tree) - except IOError: - pass - - return unusedset - -def strip(tag): - return tag[tag.index("}") + 1:] - -def node_name(node): - """ - Returns a name for this node. - """ - tagname = node.get("name") if "name" in node.keys() else strip(node.tag) - name = None - - for child in node: - if child.tag == RELAXNG + "attribute": - if "name" in child.keys() and child.get("name") == "name": - for grandchild in child: - if grandchild.tag == RELAXNG + "value": - name = " (" + grandchild.text + ")" - break - if name: - break - return tagname + (name if name else "") diff --git a/libspud/diamond/diamond/scherror.py b/libspud/diamond/diamond/scherror.py deleted file mode 100644 index 61ffd73cb8..0000000000 --- a/libspud/diamond/diamond/scherror.py +++ /dev/null @@ -1,259 +0,0 @@ -#!/usr/bin/env python - -# This file is part of Diamond. -# -# Diamond is free software: you can 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. -# -# Diamond is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import debug -import pango -import gobject -import gtk -import gtk.glade -import sys -import tempfile -import os -import re - -import dialogs -import interface - -class DiamondSchemaError: - def __init__(self, parent, gladefile, schema_file, schematron_file): - self.parent = parent - self.gladefile = gladefile - self.schema_file = schema_file - self.schematron_file = schematron_file - self.errlist_type = 0 - self.listview = None - - self.listwindow = self.parent.gui.get_widget("errListWindow") - self.listview = self.parent.gui.get_widget("sch_err_list") - - if self.listwindow is None or self.listview is None: - raise Exception("Could not find the error list widgets") - - self.model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING) - self.cellcombo = gtk.CellRendererCombo() - self.cellcombo.set_property("model", self.model) - self.cellcombo.set_property("editable", False) - - column_renderer = gtk.CellRendererText() - column_renderer.set_property("editable", False) - column_xpath = gtk.TreeViewColumn("Element", column_renderer, text = 0) - column_error = gtk.TreeViewColumn("Error", column_renderer, text = 1) - - self.listview.append_column(column_xpath) - self.listview.append_column(column_error) - - column_xpath.set_property("expand", True) - column_xpath.set_resizable(True) - column_xpath.set_property("min-width", 75) - - column_error.set_property("expand", True) - column_error.set_resizable(True) - column_error.set_property("min-width", 75) - - # Set adjustment parameters for the list view - self.listview.set_model(self.model) - self.listview.connect("row_activated", self.on_xml_row_activate) - - # User can only select one error at a time to go to. - self.listview.get_selection().set_mode(gtk.SELECTION_SINGLE) - - self.listview.hide() - self.listwindow.hide() - - # Create the error list, model and tree view columns if the list does not exist. - def create_error_list(self): - if self.listview is not None: - return - - # Destroy the error list widgets - def destroy_error_list(self): - if self.listview is not None: - self.listview.hide() - self.listwindow.hide() - - def on_validate(self, widget=None): - """ - Tools > Validate XML. This writes out the XML to a temporary file, then calls - xmllint on it. (I didn't use the Xvif validation capabilities because the error - messages are worse than useless; xmllint actually gives line numbers and such). - """ - - if self.schema_file is None: - dialogs.error(self.parent.main_window, "No schema file open") - return - - self.tmp = tempfile.NamedTemporaryFile() - self.parent.tree.write(self.tmp.name) - - std_input, std_output, std_error = os.popen3("xmllint --relaxng %s %s --noout --path \".\"" % (self.schema_file, self.tmp.name)) - output = std_error.read() - - output = output.replace("%s fails to validate" % self.tmp.name, "") - - if output.strip() == "%s validates" % self.tmp.name: - # No errors. Close the error list (if it is open) and display a congratulatory message box. - self.destroy_error_list() - dialogs.message_box(self.parent.main_window, "XML file validated successfully", "Validation successful") - else: - self.create_error_list() - - self.errlist_type = 1 - self.model.clear() - - lines = output.split("\n") - - # Read the temporary output file, split it by lines and use it to convert - # line numbers to xpaths for the column data. - f = file(self.tmp.name) - data = f.read() - output_lines = data.split("\n") - - for line in lines: - if len(line) == 0: - continue - - tokens = line.split(" ") - - # Parse each line of the xmllint --relaxng output. - # FORMAT: - # ELEMENT:LINE: element NAME: Relax-NG validity error : ERROR MESSAGE - # (Capitals denotes variable data). Update the following code if the output changes. - sub_tokens = tokens[0].split(":") - - message = " ".join(tokens[7:]) - - line = sub_tokens[1] - xpath = self.add_to_xpath(output_lines, "", long(line)-1) - - self.model.append([ xpath, message ]) - - self.listview.set_property("visible", True) - self.listwindow.set_property("visible", True) - - # Update the status bar. Inform the user of the number of errors. - self.parent.statusbar.set_statusbar("There are %u Relax-NG errors in the document" % len(lines)) - - return - - def on_validate_schematron(self, widget=None): - """ - Tools > Validate Schematron. This uses the etree.Schematron API, if it exists, to - validate the document tree against a supplied schematron file. - """ - - if self.schematron_file is None: - dialogs.error(self.parent.main_window, "No schematron file supplied") - return - - # Write the current version out to file. - tmp = tempfile.NamedTemporaryFile() - self.parent.tree.write(tmp.name) - std_input, std_output, err_output = os.popen3("xmllint --schematron %s %s --noout" % (self.schematron_file, tmp.name)) - output = err_output.read() - - output = output.replace("%s fails to validate" % tmp.name, "") - output = output.strip() - - if output == "%s validates" % tmp.name: - self.destroy_error_list() - dialogs.message_box(self.parent.main_window, "XML file validated successfully against %s" % self.schematron_file, "XML validation successful") - - # Clear the list, as there may still be errors from a previous schematron validation. - self.model.clear() - self.errlist_type = 0 - - # Add each line of output as a new row. - lines = output.split("\n") - - for line in lines: - if len(line) == 0: - continue - - tokens = line.split(" ") - self.model.append([ tokens[0], " ".join(tokens[3:]), 0 ]) - - # Finish set up of list view widget. - self.listview.set_property("visible", True) - self.listwindow.set_property("visible", True) - self.parent.statusbar.set_statusbar("There are %u Schematron errors in the document" % len(lines)) - - def errlist_is_open(self): - return self.listview.get_property("visible") - - def get_elem_name(self, line): - xml = re.compile("<([/?!]?\w+)", re.VERBOSE) - matches = xml.findall(line) - # print "get_elem_name", line, "=", matches[0] - return matches[0] - - def add_to_xpath(self, lines, xpath, line_no): - - line = lines[line_no].strip() - name = self.get_elem_name(line) - - if name not in ["string_value", "integer_value", "real_value"]: - xpath = "/" + name + xpath - - # Are we at the start of the document? - if line_no == 0 or line_no == 1: - return xpath - - # Find the parent node. - while 1: - line_no = line_no - 1 - line = lines[line_no].strip() - -# print "MAIN LOOP: ", line - - # Skip past comments - if line.find("-->") != -1: - while line.find(" - - -
- - - - -<application>Diamond</application> - manual - - -Matthew Whitworth - - - - - GNOME Documentation Project - - - - - -Documentation -Matthew Whitworth - -Imperial Applied Modelling and Computation Group -
-mtw07@doc.ic.ac.uk -
-
-
- -
- - - - - - - - - - - - - - -This manual describes version 0.2 of Diamond. - - - - -Feedback - - -To report a bug or make a suggestion regarding the -Diamond - application or - this manual, follow the directions in the -GNOME Feedback Page -. - - - - - -
- - -MY-GNOME-APP - - - -mygnomeapp - - - - - - - - - -Introduction - - -The -Diamond - application enables you to view image files. - -Diamond - provides the following features: - - - - - -Support for the following image file formats: - - - - -BMP - Windows Bitmap - - - -GIF - Graphics Interchange Format - - - -ICO - Windows Icon - - - -JPEG - Joint Photographic Experts Group - - - -PNG - Portable Network Graphics - - - -PNM - Portable Anymap from the PPM Toolkit - - - -RAS - Sun Raster - - - -TIFF - Tagged Image File Format - - - -XPM - X Pixmap - - - - - - - -A variety of zoom levels and full screen viewing, with low usage - of memory regardless of the zoom level. - - - - - - -Bonobo embedding technology that enables you to embed image views - in other GNOME applications. - - - - - -This is a note. - - - - - - - - -Getting Started - - - - -To Start -<application>MY-GNOME-APPLICATION</application> - - - -You can start - - -MY-GNOME-APPLICATION - - in the following ways: - - - - - - - - -Applications - menu - - - - - -Choose - - - -Submenu Name -My-GNOME-APPLICATION - -. - - - - - -Command line - - - - -To start - - -MY-GNOME-APPLICATION - - from a command line, type the following command, - then press -Return -: - - - -myapp -filename.jpg - - - -where - -filename.jpg - is the name of the file you - want to open. - - - - -MY-GNOME-APPLICATION - opens each file that you specify in a new window. - - - - - - - - - -When You Start -<application>MY-GNOME-APPLICATION</application> - - - -When you start - - -MY-GNOME-APPLICATION - -, the following window is displayed. - - - -
- - -<application>MY-GNOME-APPLICATION</application> - Start Up Window - - - - - - - - - - - - - - - - - -Shows -MY-GNOME-APPLICATION - main window. Contains titlebar, menubar, toolbar, display area, and - scrollbars. Menubar contains File, View, Settings, and Help menus. - - - - -
- - - - - - - -The -MY-GNOME-APPLICATION - window contains the following elements: - - - - - - -Menubar. - - - - -The menus on the menubar contain all of the commands you need to work with files in - - - -MY-GNOME-APPLICATION - -. - - - - - -Toolbar. - - - - - The toolbar contains a subset of the commands that you can access from the menubar. - - - - - -Statusbar. - - - - -The statusbar displays information about current - - -MY-GNOME-APPLICATION - - - activity and contextual information about the menu items. - - - - -
-
- - - - - - -Usage - - -You can use the -MY-GNOME-APPLICATION - application to - perform the following tasks: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -To Open an Image - - -To open an image, choose - - - -File -Open Image - -. The - -Open Image - dialog is displayed. Select the file - that you want to open, then click - -OK -. To open another image in a new window, - choose - - - -File -Create New Window - -. Choose - - - -File -Open Image - - to select the file that you want to open. You can also drag an image - from another application such as a file manager to the -MY-GNOME-APPLICATION - - window. If the -MY-GNOME-APPLICATION - window is empty, the application displays - the image in the window. If the window is not empty, the - application starts a new window to display the file. The - application displays the name of the image file and the size - of the image in pixels in the titlebar of the window. - - - - - If you try to open an image file format that -MY-GNOME-APPLICATION - does - not recognize, the application displays an error - message. - - - - -This is a caution. - - - - - - -To Manipulate the View of an Image - - -You can use the following methods to resize the view of an image in - the -MY-GNOME-APPLICATION - window: - - - - - - - -To enlarge the view of an image, choose - - - -View -Zoom In - -. - - - - - - -To shrink the view of an image, choose - - - -View -Zoom Out - -. - - - - - - -To view the image at its actual size, choose - - - -View -Zoom 1:1 - -. - - - - - - -To enlarge or shrink the view of an image so that the image - fits the -MY-GNOME-APPLICATION - window, choose - - - -View -Fit to Window - -. - - - - - - -To enlarge or shrink the image to a specific zoom factor, - choose - - - -View -Zoom factor - -, then choose the appropriate zoom factor from the - drop-down list. - - - - - - -To display the image in full screen mode, choose - - - -View -Full Screen - -. Full screen mode displays the image in a window that - fills the full screen. The window does not contain a - window frame, titlebar, - menubar, or toolbar. To exit from this mode, press the - -Esc - key or - - - -Ctrl -W - -. - - - - - - -This is a tip. - - - - - - -To Scroll an Image - - -To scroll around an image that is larger than the image window or - full screen window, you can use the following methods: - - - - - -Use the arrow keys on the keyboard. - - - - - -Drag the image in the opposite direction to the direction in - which you want to scroll. For example, if you want to - scroll down the image, - drag the image upwards in the window. - - - - -Use the scrollbars on the window. - - - - - - - -To Close an Image - - -To close an image, choose - - - -File -Close This Window - -. If the window is the last - -MY-GNOME-APPLICATION - window open, the application exits. - - - -To quit -MY-GNOME-APPLICATION - and close all of the - windows that you opened in the current session, choose - - - -File -Exit - -. - - - -This is a warning. - - - - - - - - - -Settings - - -To configure -MY-GNOME-APPLICATION -, choose - - - -Settings -Preferences - -. The - -Preferences - dialog contains the following tabbed - sections: - - - - - - - - - - - - - - - - - - - - - - - - -Display - - - - - - -Interpolation type - - - - - -Use this drop-down list box to specify the - interpolation method that - -MY-GNOME-APPLICATION - uses when the - application resizes images. Select one of the following - options: - - - - - - - -Nearest neighbor - - - -This method of interpolation takes a location in the - original image and replicates the pixel that is - nearest to this location. When - you zoom in on an image, the pixels are - replicated. When you zoom out of an - image, the image loses some of its detail. - - - - - - -Bilinear - - - -This is a simple and fast method of interpolation. When - you zoom in on an image, -MY-GNOME-APPLICATION - uses up to four - adjacent pixels to compute the colors of the new - pixels. When you zoom out of - an image, -MY-GNOME-APPLICATION - averages regions of color in the - existing image to compute the colors of the pixels. - - - - - - -Hyperbolic - - - -This is a high-quality, slow method of interpolation. The - application performs interpolation on the image in - the manner described in - Digital Image Warping by George Wolberg. - - - - - -Default: - -Nearest neighbor -. - - - - - - - -Transparency type - - - - - -Use this drop-down list box to specify how - -MY-GNOME-APPLICATION - displays transparent or partially opaque - backgrounds in images. Select one of the following options: - - - - - - - -Dark checks - -This option displays black and dark gray checks. - - - - - -Midtone checks - - - -This option displays dark gray and light gray - checks. - - - - - - -Light checks - -This option displays light gray and white checks. - - - - - -Black only - -This option displays solid black. - - - - - -Gray only - -This option displays solid gray. - - - - - -White only - -This option displays solid white. - - - - -Default: - -Dark checks -. - - - - - - - -Check size - - - - - -Use this drop-down list box to specify the size of the checks - to use to display transparent or partially opaque - backgrounds in images. This - option is only relevant if you choose - -Dark checks -, - -Midtone checks -, or - -Light checks - from the - -Transparency type - drop-down list box. - Select one of the following options: - - - - - - - -Small - - - - - - -Medium - - - - - - -Large - - - - - -Default: - -Small -. - - - - - - - -Dither type - - - - - -Use this drop-down list box to specify the dithering method - to use to display images. Dithering is a technique that - is used to simulate - colors in the original image file but that your system - can not display. Select - one of the following options: - - - - - - - -None - -This option does not use dithering. - - - - - -Normal (pseudocolor) - - - -This option performs dithering on pseudocolor displays, - which use a limited palette of colors. - - - - - - -Maximum (high color) - - - -This option performs dithering on pseudocolor and high - color displays. - - - - - -Default: - -None -. - - - - - - - -Two-pass scrolling - - - - - -Select this option to render an image in two passes - when you scroll the image quickly. The first pass - renders a low quality version of the image. The second - pass renders a full quality version of the image over - the low quality version. Two-pass scrolling enables you - to view at least a low quality version of the image at - all times regardless of how quickly you scroll the - image. - - -Default: unselected. - - - - - - - - - - -Viewers - - -You can set the following viewer preferences: - - - - - - - - - - - - - - - - - - - - - -Image Windows - - -The - -Image Windows - group contains the preferences - that you can set to view images in image windows. - - - - - - - -Use scrollbars - - - - - -Use this drop-down list box to specify when to use - scrollbars to scroll through an image. Select one of - the following options: - - - - - - - -Never - - - -This option never displays scrollbars. You can use the - arrow keys on the keyboard or the mouse to scroll - through the image. - - - - - - -Only if image does not fit - - - -This option displays scrollbars when the image is - larger than the image window. - - - - - -Default: - -Never -. - - - - - - - -Pick window size and zoom factor - automatically - - - - - -Select this option to resize the image window to fit the - image or to resize the image to fit the image - window. If the image is small, - -MY-GNOME-APPLICATION - resizes the image window to fit the image. If - the image is large, -MY-GNOME-APPLICATION - resizes the image to fit - the image window. - -Default: unselected. - - - - - - -Open images in a new window - - - - - -Select this option to open a new - -MY-GNOME-APPLICATION - window each time you open an image. If you do - not select this option, -MY-GNOME-APPLICATION - replaces the existing - image with the new image when you open an image. - -Default: unselected. - - - - - - -Full Screen - - -The - -Full Screen - group contains the preferences that - you can set to view images in full screen mode. - - - - - - - -Use scrollbars - - - - - -Use this drop-down list box to specify when to use - scrollbars to scroll through an image. Select one of the following - options: - - - - - - - -Never - - - -This option never displays scrollbars. You can use the - arrow keys on the keyboard or the mouse to scroll - through the image. - - - - - - -Only if image does not fit - - - -This option displays scrollbars when the image is - larger than the full screen. - - - - - -Default: - -Never -. - - - - - - - -Use 1:1 zoom factor - - - - - -Select this option to use the 1:1 zoom factor when you open - an image. The 1:1 zoom factor displays the image at - its actual size. - -Default: selected. - - - - - - -Use same zoom factor as image window - - - - - -Select this option to use the same zoom factor that the - application uses to display the image in an image - window. - -Default: unselected. - - - - - - -Fit all images to screen - - - - - -Select this option to resize images to fill the full screen - when you open the images in full screen mode. - -Default: unselected. - - - - - - -Fit standard-sized images to screen - - - - - -Select this option to automatically resize images - that are the same size as standard screens so that the - images fill the full screen when you open them in full - screen mode. If you select this option, -MY-GNOME-APPLICATION - ignores - the settings for the previous three options when you - open an image that is the same size as a standard - screen. Examples of standard screen sizes are 640 x - 480 pixels, 1024 x 768 pixels, and so on. - -Default: unselected. - - - - - - -Put a bevel around the edge of the screen - - - - - -Select this option to display a 3D beveled border around - the full screen view of an image. - -Default: unselected. - - - - - - - - - - - - - - - - - - -About -<application>MY-GNOME-APPLICATION</application> - - - -MY-GNOME-APPLICATION - was written by GNOME-HACKER - ( -hacker@gnome.org -). To find more information about - -MY-GNOME-APPLICATION -, please visit the - -MY-GNOME-APP Web - page -. - - - - - To report a bug or make a suggestion regarding this application or - this manual, follow the directions in this - -document -. - - - - - This program is distributed 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. A copy of this license can be found at this - -link -, or in the file - COPYING included with the source code of this program. - - -
diff --git a/libspud/diamond/gui/diamond.png b/libspud/diamond/gui/diamond.png deleted file mode 100644 index ad683c698ae005c7e41651cd17e46395f197164b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3566 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 diff --git a/libspud/diamond/gui/diamond.svg b/libspud/diamond/gui/diamond.svg deleted file mode 100644 index 467318726f..0000000000 --- a/libspud/diamond/gui/diamond.svg +++ /dev/null @@ -1,446 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - diff --git a/libspud/diamond/gui/gui.glade b/libspud/diamond/gui/gui.glade deleted file mode 100644 index b52e16f7e2..0000000000 --- a/libspud/diamond/gui/gui.glade +++ /dev/null @@ -1,564 +0,0 @@ - - - - - - Diamond - 800 - 600 - - - - True - - - True - - - True - _File - True - - - - - gtk-new - True - all - True - True - - - - - - gtk-open - True - True - True - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Open schema - True - - - - - - gtk-save - True - True - True - - - - - - gtk-save-as - True - True - True - - - - - - True - - - - - gtk-quit - True - True - True - - - - - - - - - - True - _Edit - True - - - - - gtk-find - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - True - - - - - - True - Copy spud path - Copy spud path - True - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Copy - Copy - True - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Paste - Paste - True - - - - - - - True - Group - - - - - - False - Ungroup - - - - - - - - - - True - View - True - - - True - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Expand all - True - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - all - Collapse all - True - - - - - - - - - - - True - Validate - True - - - True - - - True - Validate XML - True - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Validate Schematron - True - - - - - - - - - - True - Tools - True - - - True - - - True - Diff - - - - - - True - Diff against last save - - - - - - True - Find schema usage - - - - - - True - Display the option properties on the right hand side of the main window. - Display properties - True - True - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Console - True - - - - - - - - - - - True - _Help - True - - - - - gtk-about - True - True - True - - - - - - - - - - False - False - 0 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 200 - True - True - automatic - automatic - - - True - True - False - - - - - True - False - - - - - 200 - True - 0 - none - - - True - <b>Option Properties</b> - True - - - label_item - - - - - True - False - - - - - 1 - - - - - True - automatic - automatic - - - True - True - - - - - False - False - 2 - - - - - True - start - - - - - - False - False - 3 - - - - - True - - - False - False - 3 - - - - - - - Find - False - dialog - - - - - True - 8 - - - True - 5 - 18 - - - True - 2 - 12 - 12 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - 2 - - - - - True - 0 - _Search for: - True - - - GTK_FILL - - - - - - False - False - 0 - - - - - False - 1 - - - - - Case Sensitive - True - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - - - 2 - - - - - Search Inactive Choice Subtrees - True - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - - - 3 - - - - - True - end - - - gtk-close - True - True - True - False - True - - - - False - False - 0 - - - - - gtk-find - True - True - True - False - True - - - - False - False - 1 - - - - - False - False - end - 0 - - - - - - - True - - - True - Copy - True - - - - - - True - Paste - True - - - - - - True - Slice - True - - - - - - True - Group - - - - - - False - Ungroup - - - - - diff --git a/libspud/diamond/macosx/Info.plist b/libspud/diamond/macosx/Info.plist deleted file mode 100644 index 5a5b361c47..0000000000 --- a/libspud/diamond/macosx/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleExecutable - diamond - CFBundleGetInfoString - Diamond: Fluidity preprocessor - CFBundleIdentifier - scienceapps.diamond - CFBundleInfoDictionaryVersion - 6.0 - CFBundleIconFile - diamond.icns - CFBundleName - Diamond - CFBundlePackageType - APPL - CFBundleShortVersionString - 0.1.0 - CFBundleSignature - WRUN - CFBundleVersion - 0.0.1.20070616 - - diff --git a/libspud/diamond/macosx/PkgInfo b/libspud/diamond/macosx/PkgInfo deleted file mode 100644 index 1f05bf2da5..0000000000 --- a/libspud/diamond/macosx/PkgInfo +++ /dev/null @@ -1 +0,0 @@ -APPLWRUN \ No newline at end of file diff --git a/libspud/diamond/macosx/diamond b/libspud/diamond/macosx/diamond deleted file mode 100755 index 4ea68cfea1..0000000000 --- a/libspud/diamond/macosx/diamond +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# -# Launch script for diamond - -# export the location of a few files -export GDK_PIXBUF_MODULE_FILE="/Applications/Diamond.app/Contents/Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" -export PANGO_RC_FILE="/Applications/Diamond.app/Contents/Resources/pango_rc" -export DIAMOND_CONFIG_PATH="/Applications/Diamond.app/Contents/Resources" -# run diamond -/Applications/Diamond.app/Contents/bin/python /Applications/Diamond.app/Contents/bin/diamond diff --git a/libspud/diamond/macosx/diamond.icns b/libspud/diamond/macosx/diamond.icns deleted file mode 100644 index fe95851436bc5c33cf0fc4ada759b8c24cd8ad32..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 262454 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 RHgHRs3o|ZODo%mF|JiRY4F>=K diff --git a/libspud/diamond/macosx/mac_bundle.sh b/libspud/diamond/macosx/mac_bundle.sh deleted file mode 100755 index 6204998909..0000000000 --- a/libspud/diamond/macosx/mac_bundle.sh +++ /dev/null @@ -1,191 +0,0 @@ -#!/bin/bash -# -# Package script for Diamond. -# -# Thanks: http://stackoverflow.com/questions/1596945/building-osx-app-bundle - -# Instructions: -# bzr co lp:spud mac_bundle -# cd mac_bundle -# ./configure -# cd diamond/macosx -# ./mac_bundle -# *make a coffee or tea* -# Done -# - - -# Also fix $INSTALLDIR/MacOS/diamond in case this number changes -PYVER=2.7 -APP=Diamond.app -INSTALLDIR=$APP/Contents -LIBDIR=$INSTALLDIR/lib -APPDIR=/Applications/$INSTALLDIR -LOCALDIR=/opt/gtk - -# set up our virtual python environment -virtualenv --python=python$PYVER --no-site-packages $INSTALLDIR - -cd ../ -# install diamond in it -sed -i .bak 's/packaging=False/packaging=True/' setup.py -macosx/$INSTALLDIR/bin/python setup.py install - -# install dxdiff -cd ../dxdiff; -../diamond/macosx/$INSTALLDIR/bin/python setup.py install - -cd ../diamond/macosx; - -mkdir $INSTALLDIR/MacOS -mkdir $INSTALLDIR/Resources - -# Sort out the Resources -cp PkgInfo $INSTALLDIR/ -cp Info.plist $INSTALLDIR/ -cp pango_rc $INSTALLDIR/Resources/ -cp diamond.icns $INSTALLDIR/Resources/ -cp diamond $INSTALLDIR/MacOS - -# Now we have to play silly buggers with some bits of the diamond file -# as the Mac app packages adds a command line argument, which we want to ignore -sed -i .bak 's/sys.argv\[1:\]/sys.argv\[2:\]/' $INSTALLDIR/bin/diamond - - - -# Let's get the latest fluidity release schema -# NOTE: UPDATE URL AFTER A RELEASE -if [ ! -d fluidity ]; then - bzr branch lp:fluidity/4.1 fluidity -else - cd fluidity - bzr up - cd ../ -fi -# Make the schemata description -rm -rf $INSTALLDIR/Resources/schemata/fluidity -mkdir -p $INSTALLDIR/Resources/schemata/fluidity -cat > $INSTALLDIR/Resources/schemata/flml << EOF -Fluidity Markup Language -/Applications/Diamond.app/Contents/Resources/schemata/fluidity/fluidity_options.rng -EOF -cp fluidity/schemas/*.rng $INSTALLDIR/Resources/schemata/fluidity/ -cp ../../schema/*.rng $INSTALLDIR/Resources/schemata/fluidity/ -# clean up -#rm -rf fluidity - -# Do the above for any other schema we want to distribute -# Don't forget the spud-base! - - - -# Let's get lxml installed -$INSTALLDIR/bin/easy_install --allow-hosts=lxml.de,*.python.org lxml - -# Temp. solution - Just manually copy stuff we know we need -SITEPACKAGES=$LIBDIR/python$PYVER/site-packages - -mkdir -p $SITEPACKAGES - -# This locates pygtk.pyc. We want the source file -pygtk=`python -c "import pygtk; print pygtk.__file__[:-1]"` -oldsite=`dirname $pygtk` -gobject=`python -c "import gobject; print gobject.__file__[:-1]"` -glib=`python -c "import glib; print glib.__file__[:-1]"` - -# Copy PyGtk and related libraries -cp $pygtk $SITEPACKAGES -cp -r `dirname $gobject` $SITEPACKAGES -cp -r `dirname $glib` $SITEPACKAGES -cp -r $oldsite/cairo $SITEPACKAGES -cp -r $oldsite/gtk-2.0 $SITEPACKAGES -cp $oldsite/pygtk.pth $SITEPACKAGES - - -# Modules, config, etc. -for dir in lib etc/pango etc/gtk-2.0 share/themes; do - mkdir -p $INSTALLDIR/$dir - cp -r $LOCALDIR/$dir/* $INSTALLDIR/$dir -done - -# Resources, are processed on startup -for dir in etc/gtk-2.0 etc/pango lib/gdk-pixbuf-2.0/2.10.0; do - mkdir -p $INSTALLDIR/Resources/$dir - cp $LOCALDIR/$dir/* $INSTALLDIR/Resources/$dir -done - -# Somehow files are writen with mode 444 -find $INSTALLDIR -type f -exec chmod u+w {} \; - -function log() { - echo $* >&2 -} - -function resolve_deps() { - local lib=$1 - local dep - otool -L $lib | grep -e "^.$LOCALDIR/" |\ - while read dep _; do - echo $dep - done -} - -function fix_paths() { - local lib=$1 - log Fixing $lib - for dep in `resolve_deps $lib`; do - log Fixing `basename $lib` - log "| $dep" - install_name_tool -change $dep @executable_path/../lib/`basename $dep` $lib - done -} - -binlibs=`find $INSTALLDIR -type f -name '*.so'` - -for lib in $binlibs; do - log Resolving $lib - resolve_deps $lib - fix_paths $lib -done | sort -u | while read lib; do - log Copying $lib - cp $lib $LIBDIR - chmod u+w $LIBDIR/`basename $lib` - fix_paths $LIBDIR/`basename $lib` -done - -for lib in $dylibs; do - log Resolving $lib - resolve_deps $lib - fix_paths $lib -done | sort -u | while read lib; do - log Copying $lib - cp $lib $LIBDIR - chmod u+w $LIBDIR/`basename $lib` - fix_paths $LIBDIR/`basename $lib` -done - - -# Fix config files -sed -i .bak 's#/opt/gtk/#'$APPDIR'/#' $INSTALLDIR/etc/pango/pango.modules -sed -i .bak 's#/opt/gtk/#'$APPDIR'/#' $INSTALLDIR/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache -sed -i .bak 's#/opt/gtk/#'$APPDIR'/#' $INSTALLDIR/Resources/etc/pango/pango.modules -sed -i .bak 's#/opt/gtk/#'$APPDIR'/#' $INSTALLDIR/Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache - - - -# Package! -VERSION=0.01 -# we now need to fiddle with the Python run path on the diamond script -# COMMENT THESE OUT IF YOU WANT TO TEST YOUR APP WITHOUT INSTALLING -# EDIT AS REQUIRED -sed -i .bak 's|/Users/amcg/Software/spud/mac_port/diamond|/Applications|' $INSTALLDIR/bin/diamond -sed -i .bak 's|/Users/amcg/Software/spud/mac_port/diamond|/Applications|' $INSTALLDIR/MacOS/diamond - -zip -rq Diamond-$VERSION-osx.zip $APP -hdiutil create -srcfolder $APP Diamond-$VERSION.dmg - - -# To test, temporarily move your /opt/gtk folder -# Move the Diamond.app folder to /Applications and go -# open -a Console -# helps to debug \ No newline at end of file diff --git a/libspud/diamond/macosx/pango_rc b/libspud/diamond/macosx/pango_rc deleted file mode 100644 index bb7bad22f4..0000000000 --- a/libspud/diamond/macosx/pango_rc +++ /dev/null @@ -1,2 +0,0 @@ -[Pango] -ModuleFiles = /Applications/Diamond.app/Contents/Resources/etc/pango/pango.modules \ No newline at end of file diff --git a/libspud/diamond/misc/diamond-bash-completion b/libspud/diamond/misc/diamond-bash-completion deleted file mode 100644 index b7a2b62092..0000000000 --- a/libspud/diamond/misc/diamond-bash-completion +++ /dev/null @@ -1,29 +0,0 @@ -# Bash completion for diamond - -_diamond() -{ - local cmd cur prev skinsdir IFS=$' \t\n' i j k=0 - - COMPREPLY=() - cmd=${COMP_WORDS[0]} - _get_comp_words_by_ref cur prev - - case $prev in - -a) - cur=${COMP_WORDS[COMP_CWORD]} - COMPREPLY=( $(compgen -W "$( find "${HOME}/.diamond/schemata/" -maxdepth 1 -type f ! -iname ".*" -print | while read file; do cat ${file} | grep ' = ' | sed -e 's/ *=.*$//' | tr '\n' ' '; done; echo -n 'default ' )" -- $cur ) ) - return 0 - ;; - -s) - _filedir '@(rng)' - return 0 - ;; - *) - _filedir '@(*ml)' - return 0; - ;; - esac - - return 0 -} -complete -o filenames -F _diamond diamond diff --git a/libspud/diamond/plugins/flml/show_triangle_mesh.py.disabled b/libspud/diamond/plugins/flml/show_triangle_mesh.py.disabled deleted file mode 100644 index ee495bb401..0000000000 --- a/libspud/diamond/plugins/flml/show_triangle_mesh.py.disabled +++ /dev/null @@ -1,66 +0,0 @@ -from diamond.plugins import register_plugin, cb_decorator -from lxml import etree - -# For now, I've put TriangleReader in diamond -from diamond.triangle_reader import TriangleReader - -from enthought.mayavi.core.engine import Engine # Error occurs when this is imported -from enthought.mayavi.modules.api import Surface -from enthought.mayavi.core.ui.engine_view import EngineView - -def plugin_applies(xpath): - # Allow plugin to be used at any element which is under any mesh - return (xpath.startswith('/geometry/mesh')) - -@cb_decorator - -def handle_click(xml, xpath): - xml_root = etree.fromstring(xml) - - # This check is needed in case xpath in Diamond is not updated upon changing an attribute - # (can be removed once the bug in Diamond has been fixed) - if (len(xml_root.xpath(xpath)) == 0): - return - - # Track back along xpath to find mesh element - element = xml_root.xpath(xpath)[0] - while (element.tag != 'mesh'): - element = element.getparent() - - # Check whether Triangle format is selected (can only show Triangle meshes) - triangle_format_element = element.xpath('from_file/format[@name="triangle"]') - if (triangle_format_element): - try: - # Exception occurs if file name is not set - file_name = element.xpath('from_file')[0].attrib['file_name'] - except: - return - else: - return - - # Find the number of dimensions so that we load the correct file - ndim = int(xml_root.xpath('/fluidity_options/geometry/dimension')[0].getchildren()[0].text) - show_mesh(file_name, ndim) - -def show_mesh(file_name, ndim): - mayavi_engine = Engine() - mayavi_engine.start() - mayavi_engine.new_scene() - - # View the MayaVi pipeline - engine_view = EngineView(engine=mayavi_engine) - ui = engine_view.edit_traits() - - # Setup MayaVi pipeline - src = TriangleReader() - - if (ndim == 2): - src.initialize(file_name+'.edge') # Load the 2D .edge file - else: - src.initialize(file_name+'.face') # Load the 3D .face file - - mayavi_engine.add_source(src) - # Add any filters, modules here in the order that they are to appear in the pipeline - mayavi_engine.add_module(Surface()) - -register_plugin(plugin_applies, "Show Mesh", handle_click) diff --git a/libspud/diamond/plugins/test.py b/libspud/diamond/plugins/test.py deleted file mode 100644 index 2829b1fd91..0000000000 --- a/libspud/diamond/plugins/test.py +++ /dev/null @@ -1,16 +0,0 @@ -from diamond.plugins import register_plugin, cb_decorator - -def plugin_applies(xpath): - if xpath == "/my_root_element": - return True - else: - return False - -@cb_decorator -def handle_click(xml, xpath): - print "xpath == ", xpath - print "xml[0:80] == ", xml[0:80] - print "Hello, world!" - - -register_plugin(plugin_applies, "Test", handle_click) diff --git a/libspud/diamond/setup.py.in b/libspud/diamond/setup.py.in deleted file mode 100644 index 15fb1f3fdf..0000000000 --- a/libspud/diamond/setup.py.in +++ /dev/null @@ -1,87 +0,0 @@ -from distutils.core import setup -from distutils.extension import Extension -import os -import os.path -import glob - -# There are a number of local hacks in this file, to deal with the multiple -# ways in which setup.py is called by various scripts and packaging methods -# that interact with spud, enabling setuptools to grok their intentions. - -# In some cases, we will be passed a 'DESTDIR' from an upstream packagaing -# system. This will be a local directory to install into, and act as local '/' -# as far as all paths are concerned. Check for this, and fail nicely if not set. - -prefix = None -import sys -packaging=False - -# We may also be given prefix, either as a configuration option (which will be -# dealt with by substitutions later) or as a command line option. If a command -# line option is present, parse this. In some cases, just to add spice into the -# mix, PREFIX is supplied twice - once by configure, and again by a parent -# Makefile as a command-line flag. -# -# As an alternative to DESTDIR being set, Debian packaging calls setup.py with -# a --root command line option which does the same thing. This needs to be -# parsed if present, and supercedes any previous DESTDIR picked up from -# environment. - -for i, arg in enumerate(sys.argv): - if "--prefix" in arg: - prefix = arg.split('=')[1] - -# Given the above prefix possibilities, as well as root and DESTDIR, we need to -# construct a list of data directories to be installed -# -# * configure-supplied prefixes are dealt with by substitution directly into -# this file, with @ PREFIX @ being replaced. -# * prefixes as command-line options are pushed by us -# -# Note that in the case of this and other packages which supply prefix twice -# (once in configure, and then again on the command line) we honour the prefix -# on the command line in preference to the configure prefix. - -# First parse the plugin directories -plugin_dirs = [dir for dir in os.listdir('plugins') if os.path.isdir(os.path.join('plugins', dir)) and dir[0] != '.'] -plugin_data_files = [] -if sys.platform == 'darwin' and packaging: - for plugin in plugin_dirs: - plugin_data_files.append(("./plugins/" + plugin, - glob.glob('plugins/' + plugin + '/*.py'))) -else: - for plugin in plugin_dirs: - if prefix is None: - plugin_data_files.append(("@prefix@/share/diamond/plugins/" + plugin, - glob.glob('plugins/' + plugin + '/*.py'))) - else: - plugin_data_files.append((prefix + "/share/diamond/plugins/" + plugin, - glob.glob('plugins/' + plugin + '/*.py'))) - -# Now parse the GUI directories -gui_data_files = [] -if sys.platform == 'darwin' and packaging : - gui_data_files.append(("./gui", - ["gui/gui.glade", "gui/diamond.svg", "gui/diamond.png"])) -else: - if prefix is None: - gui_data_files.append(("@prefix@/share/diamond/gui", - ["gui/gui.glade", "gui/diamond.svg"])) - else: - gui_data_files.append((prefix + "/share/diamond/gui", - ["gui/gui.glade", "gui/diamond.svg"])) - -# We now have all the information we need; run setup. -setup( - name='diamond', - version='1.0', - description="Fluidity preprocessor", - author = "The ICOM team", - author_email = "patrick.farrell@imperial.ac.uk", - url = "http://amcg.ese.ic.ac.uk", - packages = ['diamond'], - package_dir = {'diamond': 'diamond'}, - scripts=["bin/diamond"], - data_files = gui_data_files + plugin_data_files - ) - diff --git a/libspud/diamond/tests/plist/plist.py b/libspud/diamond/tests/plist/plist.py deleted file mode 100644 index d71d95dfa0..0000000000 --- a/libspud/diamond/tests/plist/plist.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python - -import diamond.plist as plist -import unittest - -class PyListModule(unittest.TestCase): - - ''' #1: A simple list of integers, with cardinality ''. (One element only). ''' - def testSimple(self): - l = plist.List(int) - self.assertEqual(l.__str__(), "list of of cardinality: ") - self.assertEqual(l.__repr__(), "list of of cardinality: ") - self.assertEqual(l("0"), "0") - - ''' #2: A simple list of integers, with cardinality '+'. ''' - def testOneOrMore(self): - l = plist.List(int, '+') - self.assertEqual(l.__str__(), "list of of cardinality: +") - self.assertEqual(l.__repr__(), "list of of cardinality: +") - self.assertEqual(l("3,4,5"), "3 4 5") - - ''' #3: A list of two strings, with cardinality 2. ''' - def testTwoStrings(self): - l = plist.List(str, "2") - self.assertEqual(l.__str__(), "list of of cardinality: 2") - self.assertEqual(l.__repr__(), "list of of cardinality: 2") - self.assertEqual(l("first second"), "first second") - - ''' #4: A list of none type, which should throw an non-callable exception when called. ''' - def testNoneType(self): - l = plist.List(None) - try: - l("3,4,5") - self.fail() - except: - pass - -if __name__ == '__main__': - suite = unittest.TestLoader().loadTestsFromTestCase(PyListModule) - unittest.TextTestRunner(verbosity=3).run(suite) diff --git a/libspud/diamond/tests/read_xml/find_hidden_xmldata.py b/libspud/diamond/tests/read_xml/find_hidden_xmldata.py deleted file mode 100644 index c58834ac8c..0000000000 --- a/libspud/diamond/tests/read_xml/find_hidden_xmldata.py +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env python - -import diamond.schema -import unittest - -class FindHiddenModule(unittest.TestCase): - def testNoMagicComments(self): - hiddens = schema.find_hidden_xmldata( - self.assertEqual(self.schema.tree.getroot(), None) - -if __name__ == '__main__': - unittest.main() diff --git a/libspud/diamond/tests/schema/first.rnc b/libspud/diamond/tests/schema/first.rnc deleted file mode 100644 index 9c69d4e738..0000000000 --- a/libspud/diamond/tests/schema/first.rnc +++ /dev/null @@ -1,6 +0,0 @@ -include "spud_base.rnc" - -start = element test { - element example_real_tensor { real_tensor }, - element example_real_vector { real_vector } -} diff --git a/libspud/diamond/tests/schema/first.rng b/libspud/diamond/tests/schema/first.rng deleted file mode 100644 index 2903ace083..0000000000 --- a/libspud/diamond/tests/schema/first.rng +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/libspud/diamond/tests/schema/test_cb_methods.py b/libspud/diamond/tests/schema/test_cb_methods.py deleted file mode 100644 index c48b7e37dc..0000000000 --- a/libspud/diamond/tests/schema/test_cb_methods.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python - -import diamond.schema -import unittest - -class TestSchemaModule(unittest.TestCase): - def setUp(self): - self.schema = diamond.schema.Schema("first.rng") - - def testName(self): - root=self.schema.tree.getroot() - self.cb_name(root.children[0], {}) - - -if __name__ == '__main__': - unittest.main() diff --git a/libspud/diamond/tests/schema/test_references_schema.py b/libspud/diamond/tests/schema/test_references_schema.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libspud/diamond/tests/schema/test_simple_schema.py b/libspud/diamond/tests/schema/test_simple_schema.py deleted file mode 100644 index 23b679c319..0000000000 --- a/libspud/diamond/tests/schema/test_simple_schema.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python - -import diamond.schema -import unittest - -class TestSchemaModule(unittest.TestCase): - def setUp(self): - self.schema = diamond.schema.Schema("first.rng") - - def testRootExistence(self): - self.assertNotEqual(self.schema.tree.getroot(), None) - - def testStartExistence(self): - self.assertEqual(len(self.schema.valid_children(":start")), 1) - - def testTestInvalidXPath(self): - self.assertEqual(len(self.schema.valid_children("/test")), 0) - - def testStartChildren(self): - self.assertNotEqual(self.schema.valid_children(":start")[0], None) - -if __name__ == '__main__': - unittest.main() diff --git a/libspud/diamond/tests/to_test.txt b/libspud/diamond/tests/to_test.txt deleted file mode 100644 index cff76d7701..0000000000 --- a/libspud/diamond/tests/to_test.txt +++ /dev/null @@ -1,14 +0,0 @@ -schema.py - TREE - read - xml_read_merge - construct_priority_queue - init_avail_data - assign_xml_nodes - assign_xml_children - check_unused_nodes - append_children - read_children - find_hidden_xmldata - xml_read_core -tree.py diff --git a/libspud/diamond/todo.txt b/libspud/diamond/todo.txt deleted file mode 100644 index e2d26b9f03..0000000000 --- a/libspud/diamond/todo.txt +++ /dev/null @@ -1 +0,0 @@ -o Check the inline editing functions work with tensors etc. diff --git a/libspud/doc/Makefile b/libspud/doc/Makefile deleted file mode 100644 index eb3392c57c..0000000000 --- a/libspud/doc/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -default: spud_manual.pdf - -%.pdf: %.tex - pdflatex $^ - if fgrep "Rerun to" $*.log; then $(MAKE) --assume-new $^ $@;fi -ifndef NOBIBTEX - if fgrep "There were undefined" $*.log;\ - then bibtex $*; \ - $(MAKE) NOBIBTEX=true --assume-new $^ $@;fi -endif - -# We don't rm *.ps *.pdf because that might clobber image files. Instead, put any -# ps files which should go in $(PSFILES) -clean: - rm $(TARGETS) $(PSFILES) *.eps *.dvi *.aux *.log *.bbl *.blg *.out *.toc 2>/dev/null||true diff --git a/libspud/doc/diamond_manual.tex b/libspud/doc/diamond_manual.tex deleted file mode 100644 index 32a217d0a1..0000000000 --- a/libspud/doc/diamond_manual.tex +++ /dev/null @@ -1,163 +0,0 @@ -\chapter{Diamond}\label{chap:diamond} - -\section{Installation} -Diamond depends on Python (version 2.3 or greater), PyGTK, -the 4Suite XML library, and the lxml library. All of these dependencies -are available in the Debian/Ubuntu repositories with the following command: -\begin{verbatim} -apt-get install python-gtk2 python-lxml python-4suite-xml -\end{verbatim} - -Windows versions of these packages are available for download on their respective websites. - -\section{Configuration files} - -In accordance with normal Unix practice, system wide configuration for -diamond is stored in the \verb+/etc/diamond+ directory while per-user -configuration is stored in a \verb+.diamond+ directory in the user's home -directory. - -\subsection{Colour}\label{sec:colour} - -Diamond diff view uses colour to display differences between documents. -These colours are configured by a text file in the diamond directory called \verb+settings+ -with the following contents: -\begin{verbatim} -[colour] -normal = black -insert = green -delete = red -update = blue -subupdate = cornflowerblue -diffadd = lightgreen -diffsub = indianred -\end{verbatim} -All colours are optional and will be filled in to the above default values if not given. -The colour are specified with X11 colour names, see \href{http://en.wikipedia.org/wiki/X11_color_names}{here}. - -\subsection{Schemas} - -Diamond needs to know which Spud schemas are installed and available on the -current system. This is specified in the \verb+schemata+ subdirectory of: -\begin{itemize} -\item the \verb+/usr/share/diamond+ directory -\item the \verb+/etc/diamond+ directory -\item the \verb+~/.diamond+ directory -\item any directories specified in the \verb+$DIAMOND_CONFIG_PATH+ environment variable. -\end{itemize} -Directories are searched in the above order. The file names in the -\verb+schemata+ directory give the filename extension associated with a -particular problem description language. If multiple files corresponding to a particular extension are found the last file takes -precendence (i.e. a file found in a \verb+schemata+ subdirectory of \verb+$DIAMOND_CONFIG_PATH+ will take precendence over -one in \verb+~/.diamond/schemata+). - -The content of the file is two or -more lines. The first line is the name of the problem description language, -the remaining lines are key value pairs (key = value) of alias names and the -path of the XML syntax (\verb+.rng+) version of the corresponding schema. -A line with no "key =" part will be interpreted as "default =". - -For example, the Fluidity package has a problem description language called -the Fluidity Markup Language which uses the file extension -\verb+.flml+. When installed on a system by the sysadmin, Fluidity might -create the file \verb+/etc/diamond/flml+ with the following contents: -\begin{verbatim} -Fluidity Markup Language -/usr/share/fluidity/fluidity_options.rng -\end{verbatim} -An individual user \verb+jrluser+ might have the current version of the -Fluidity svn tree checked out in their home directory and would need to -point diamond at the (posssibly updated) schema in their source -tree. \verb+jrluser+ would then create the file -\verb+/home/jrluser/.diamond/schemata/flml+ which would contain: -\begin{verbatim} -Fluidity Markup Language -/home/jrluser/fluidity/schemas/fluidity_options.rng -\end{verbatim} -Now Diamond will pick up the version of the schema in \verb+jrluser+'s svn -tree rather than the version the sysadmin installed. -Alternatively they could just add an alias to the existing \verb+//home/jrluser/.diamond/schemata/flml+: -\begin{verbatim} -Fluidity Markup Language -/usr/share/fluidity/fluidity_options.rng -jrl = /home/jrluser/fluidity/schemas/fluidity_options.rng -\end{verbatim} - -It is also possible to specify a URL over HTTP for the location of the -schema. For example: -\begin{verbatim} -Fluidity Markup Language -http://amcg.ese.ic.ac.uk/svn/fluidity/trunk/tools/fluidity_options.rng -\end{verbatim} -This is to facilitate centralised deployments. - -\section{Starting Diamond} - -Diamond can be started in several ways. - -When executed as -\begin{verbatim} -diamond -\end{verbatim} -Diamond will offer the user the choice of which registered schema to use. -If only one schema is registered, then it will use that by default. -Diamond will open a blank document of the language specified by the schema to be edited. - -When executed as -\begin{verbatim} -diamond -s /path/to/schema.rng -\end{verbatim} -Diamond will open a blank document using the schema specified on the command line. - -When executed as -\begin{verbatim} -diamond filename.suffix -\end{verbatim} -Diamond will inspect the registered schemas for the suffix specified -and use that schema. - -\section{Using Diamond} - -Diamond provides three views. -\begin{description} -\item[Main view] Is how Diamond starts up. -\item[Slice view] Shows same type elements together. -\item[Diff view] Shows the differences between the open document and another. -\end{description} - -\subsection{Main view} -The main view shows the tree structure of the document on the left hand side and -data and documentation for the currently selected element on the right hand side. -The treeview can be traversed with either the mouse by clicking to open, close, add and -destroy elements or with the keyboard, using the arrows keys, enter and delete. -Elements can be copied (puts the XML representation onto the clipboard) or XML can be pasted into -an element. -Finally elements of the same type can be grouped together, this will bring all elements of the selected -type to the top level and hide other elements. Ungroup will then return the view to normal. - -\subsection{Slice view} -Slice view is opened by right clicking an element and selecting \verb+Slice+ or -selecting an element and then selecting \verb+Slice+ in the \verb+Edit+ menu. -The slice view shows a list of a given type of element. Each item shows the path, data and attributes for that element. - -\subsection{Diff view} -To open diff view select \verb+Diff+ or \verb+Diff against last save+ in the \verb+Tools+ menu. -The diff view shows the differences between the currently open document (understood to be the newer version) -and a user selected document (understood to be the older version). The diff view does NOT understand some conventions -used in the main view such as hiding certain elements (for example real\_value or comment). -The colours used in the diff view can be set in the settings file see \ref{sec:colour}. - -\subsection{Dynamic validation} -Diamond uses the schema to guide the editing of valid documents that the schema -permits. When a blank document is opened, information necessary to make a valid -document is missing and the document is thus invalid\footnote{This is true for all -but a trivial schema which permits only one document.}. The invalidity of the document -is reflected in the colouration of the root node: valid nodes are coloured in black, -while invalid nodes are coloured in blue. As invalid nodes have their attributes -and data specified, their validity is dynamically updated and they are coloured appropriately. -The document as a whole is valid if and only if the root node is coloured black. - -\subsection{Finding unused schema elements} -Diamond has a built in tool to test multiple document files against one schema to see what parts of the schema are not used. -In the \verb+Tools+ menu select \verb+Find schema usage+, it will prompt for an input directory. It will find every file with -a matching suffix (.flml for Fluidity Markup Langauge) in the directory tree and check the schema against them. diff --git a/libspud/doc/spud_manual.pdf b/libspud/doc/spud_manual.pdf deleted file mode 100644 index 60e053e464cc0ed2c9b7559c805ea4a15cda3fdb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 290244 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

A+DT*1=oT>0g@E* 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 can only be set once - element dimension { - attribute replaces {"NDIM"}, - element integer_value { - attribute rank {"0"}, - ("3"|"2") - } - } - } - } - ) -\end{lstlisting} - - \caption{A trivial schema showing a schema comment, schema annotations and - a user comment pattern. The dimension of the problem is specified by the - dimension element under the geometry element.} - \label{fig:schema} - -\end{figure} - -\section{Restrictions on the base language} - -In order to facilitate processing of schemas by libspud and Diamond, and in -particular to make the presentation of a simple and intuitive user interface -possible, several restrictions are imposed on RELAX NG schemas used in Spud. - -\begin{itemize} -\item Choice nodes must be choices between single elements (e.g. a choice - between a OR (b AND c) is invalid). -\item Elements with the same tag under the same parent are allowed. However, - at most one can be + (oneOrMore) or * (zeroOrMore). Elements with the same - tag under the same parent must each have a name attribute with a unique - value. -\item \lstinline+name+ attributes may contain only alpha-numeric characters, - or characters in the set "\verb+/_:[]+" -\item Recursive schema elements are not supported. -\end{itemize} - -\section{Comments and annotations} - -There are three layers of comment which are applicable in Spud. The schema, -as with any piece of source code, can contain comments which are of use to -other developers editing the schema. Second, the schema can embed -documentation for the problem description language. This documentation will -be displayed to the model user by Diamond. The former comments are known as -schema comments and are written with a single leading hash (\verb+#+) -while the latter are known as schema annotations and are written with a -double leading hash (\verb+##+). Schema annotations must be written -immediately before the element they document. - -Finally, the \verb+comment+ named pattern will cause diamond to associate a -user comment box with the parent element. This enables users to document -their problem description files. Each of the named patterns in the base -language also includes the \verb+comment+ pattern so that every parameter in -an input file can have a user comment associated with it. Figure -\ref{fig:schema}\ shows a simple schema incorporating all three layers of -comment. - - -\section{Preprocessing the schema for use with Diamond} -RELAX NG comes in two equivalent formats: XML syntax (with -file suffix \verb+.rng+) and compact -syntax (with file suffix \verb+.rnc+). -Compact syntax is optimised for human use, while XML -syntax is optimised for ease of machine parsing. Therefore, -it is recommended that model developers write the schema -in compact syntax, then transform it using a supplied tool -to XML syntax for use with Diamond and other validation tools. -To transform compact syntax into XML syntax, use the command: -\begin{verbatim} -spud-preprocess /path/to/schema.rnc -\end{verbatim} -This will create a file called schema.rng in the same directory. - -\chapter{Libspud} - -Libspud provides C, C++ and Fortran interfaces for accessing the options -specified in a Spud XML file. - -\section{The options tree} - -Spud XML files are read into an in-memory tree structure which reflects the -tree of nested elements in the XML. Nodes in this tree are indexed by -strings, i.e. the options tree is a dictionary in which values are -interrogated via keys. - -\section{Option key syntax} - -The option key syntax is similar to Unix file path syntax. -Consider the simple example, \verb+simple.xml+, which is valid with respect -to the schema in figure \ref{fig:schema}: -\begin{verbatim} - - - Basic simulation - - - - 3 - - - -\end{verbatim} - -The simulation name and the dimension of the geometry may be accessed -using the following Fortran program: -\begin{verbatim} -program fetch_info - use spud - implicit none - - integer :: dimension - character(len=255) :: simulation_name - - call load_options("simple.xml") - call get_option("/simulation_name", simulation_name) - call get_option("/geometry/dimension", dimension) -end program fetch_info -\end{verbatim} - -The option key \verb+/simulation_name+ accesses the element -called \verb+simulation_name+ that is a child of the root element -(which in this case is called \verb+model_options+). The option key -\verb+/geometry/dimension+ accesses the element \verb+dimension+ which -in turn is a child of the root element. - -\subsection{Multiple elements} -One of the restrictions that Spud places on RELAX NG schemas -is that \emph{each element of the same name under the same parent -must be differentiated by a \texttt{name} attribute}. An example will -clarify what is valid. Consider the file \verb+complex_invalid.xml+: -\begin{verbatim} - - - Basic simulation - - - - 3 - - - mesh_A.msh - - - mesh_B.msh - - - -\end{verbatim} - -This file is invalid as there are two \verb+mesh+ elements beneath the same -\verb+geometry+ element, and they are not differentiated by a unique \verb+name+ -attribute. To make this file valid we must differentiate the two \verb+mesh+ -elements by adding a \verb+name+ attribute: - -\begin{verbatim} - - - Basic simulation - - - - 3 - - - mesh_A.msh - - - mesh_B.msh - - - -\end{verbatim} - -This file is now valid as the two \verb+mesh+ elements have different -\verb+name+ values. - -To access these elements in the model, the option keys -\begin{verbatim} -/geometry/mesh[0] -/geometry/mesh[1] -\end{verbatim} -may be used to access the elements in order, or they may be accessed -by \verb+name+ by -\begin{verbatim} -/geometry/mesh::PositionMesh -/geometry/mesh::VelocityMesh -\end{verbatim} - -\subsection{Attributes} - -For simplicity, attributes of an element are treated the same as children -of the element. Consider the example above: \verb+name+ is an attribute -of the \verb+mesh+ element. The \verb+name+ of the first \verb+mesh+ element -may be accessed by -\begin{verbatim} -/geometry/mesh[0]/name -\end{verbatim} -that is, the \verb+name+ attribute is accessed the same way as a child element -called \verb+name+ would be. - -Attributes in the options tree must have string type data and have no children. -If either of these rules are broken (e.g. via a \ref{sec:set_option} call) -then the attribute element will be unmarked as an attribute, will be treated as -a normal element, and will appear in XML files written out by libspud as XML -elements rather than element attributes. - -\subsection{Data elements} - -Data defined in the Spud base language (see \ref{sec:named_patterns}), such as -\verb+integer_value+ or \verb+real_value+, are detected by libspud and stored in -"\verb+__value+" children. e.g, for the following schema: - -\begin{verbatim} - - - - - -\end{verbatim} - -the data element "\verb+real_value+" has option key -"\verb+/real_parent/__value+". Alternatively, the data element -"\verb+real_value+" can be accessed directly with option key -"\verb+/real_parent+" - i.e. libspud automatically navigates into -"\verb+__value+" child elements when reading or setting options, if such a child -element exists. - -Manually creating a "\verb+__value+" child for an element that already itself -contains data will result in the data of the parent element being removed, and -a warning message will be sent to standard error. - - -\section{Language specific features} - -In some cases the interfaces differ slightly between Fortran, C and C++. -This is brought about by differences in the designs of these languages -themselves and in particular the difference in the manner in which optional -arguments are supported in Fortran on the one hand and C/C++ on the other. -The decision has been made to write the interfaces in the manner which seems -natural in each language at the cost of consistency between languages rather -than enforcing a foreign paradigm on one or all of the interfaces. - -\subsection{Fortran} - -All of the Fortran procedures as well as the named constants for error codes -(\ref{sec:error_codes}) and data types -(\ref{sec:types}) are encapsulated in the \lstinline+spud+ module. - -Where a routine returns an error code, in Fortran this is achieved via the -optional \stat argument. If \stat is not present and an error code other -than \lstinline[language=fortran]+SPUD_NO_ERROR+ is returned then execution -will halt with an error message. - -\subsection{C} - -Since C does not itself have any namespacing facility, all exposed symbols -have the prefix \lstinline[language=C]+spud_+. Error codes are returned via -function return values. - -\subsection{C++} - -The entire public C++ API of libspud is contained in the -\lstinline[language=C++]+Spud+ namespace. Error codes are returned via function -return values. - -\section{Naming conventions} - -Where a routine returns its main result via an argument (as is the case for -a Fortran subroutine, for example), the routine's name starts with -\lstinline[language=fortran]+get_+. The word -\lstinline[language=fortran]+key+ is exclusively used to refer to a lookup key in -the options dictionary. - -\section{Procedure interfaces} -\lstset{frame=single} - -In each case, the Fortran interface is given first, followed by the C and -then C++ interfaces. - -\subsection{Error codes}\label{sec:error_codes} - -The following values are return statuses of procedures. In Fortran these are -named constants in the \lstinline+spud+ module while in C and C++ these are -the enum types \lstinline+SpudOptionError+ and \lstinline+Spud::OptionError+ -respectively. - -Error values are greater than zero, warnings are negative and -\lstinline+SPUD_NO_ERROR+ has the value 0. - -\begin{tabular}{lp{8cm}} - \textbf{Error code} & \textbf{Interpretation}\\ - \lstinline+SPUD_NO_ERROR+ & Successful completion.\\ - \lstinline+SPUD_KEY_ERROR+ & The specified option is not present in the - dictionary.\\ - \lstinline+SPUD_TYPE_ERROR+ & The specified option has a different type - from that of the option argument provided.\\ - \lstinline+SPUD_RANK_ERROR+ & The specified option has a different rank - from that of the option argument provided.\\ - \lstinline+SPUD_SHAPE_ERROR+ & The specified option has a different shape - from that of the option argument provided.\\ - \lstinline+SPUD_FILE_ERROR+ & The specified options file cannot be read or - written to as the routine requires.\\ - \lstinline+SPUD_NEW_KEY_WARNING+ & The option being inserted is not - already in the dictionary.\\ - \lstinline+SPUD_ATTR_SET_FAILED_WARNING+ & The option being set as an - attribute can not be set as an attribute. -\end{tabular} - -\subsection{Data type parameters}\label{sec:types} - -The option\_type routine returns the following values. In Fortran these are -named constants in the \lstinline+spud+ module while in C and C++ these are -the enum types \lstinline+SpudOptionType+ and \lstinline+Spud::OptionType+ -respectively. - -\begin{tabular}{ll} - \textbf{Fortran} & \textbf{C/C++} \\ - \lstinline+SPUD_REAL+ & \lstinline+SPUD_DOUBLE+\\ - \lstinline+SPUD_INTEGER+ & \lstinline+SPUD_INT+\\ - \lstinline+SPUD_NONE+ & \lstinline+SPUD_NONE+\\ - \lstinline+SPUD_CHARACTER+ & \lstinline+SPUD_STRING+ -\end{tabular} - -\subsection{clear\_options} - -\begin{lstlisting}[language=fortran] -subroutine clear_options() -end subroutine clear_options -\end{lstlisting} - -\begin{lstlisting}[language=C] -void spud_clear_options() -\end{lstlisting} - -\begin{lstlisting} -void Spud::clear_options(); -\end{lstlisting} - -Clears the entire options tree. - -\subsection{load\_options} - -\begin{lstlisting}[language=fortran] -function load_options(filename, stat) - character(len=*), intent(in) :: filename - integer, optional, intent(out) :: stat -\end{lstlisting} - -\begin{lstlisting}[language=C] -int spud_load_options(const char* key, const int key_len) -\end{lstlisting} - -\begin{lstlisting} -OptionError Spud::load_options(const std::string& filename) -\end{lstlisting} - -Reads the XML file \lstinline+filename+ into the options tree. - -Returns error code \lstinline+SPUD_FILE_ERROR+ if the file does not exist or cannot be read. - -\subsection{write\_options} - -\begin{lstlisting}[language=fortran] -subroutine write_options(filename, stat) - character(len=*), intent(in) :: filename - integer, optional, intent(out) :: stat -\end{lstlisting} - -\begin{lstlisting}[language=C] -int spud_write_options(const char* filename, const int filename_len) -\end{lstlisting} - -\begin{lstlisting}[language=C++] -OptionError write_options(const std::string& filename) -\end{lstlisting} - -Writes the options tree out to the XML file \lstinline+filename+. - -Returns error code \lstinline+SPUD_FILE_ERROR+ if the file does not exist or cannot be written. - -\subsection{get\_child\_name} - -\begin{lstlisting}[language=fortran] -subroutine get_child_name(key, index, child_name) - character(len=*), intent(in)::key - integer, intent(in)::index - character(len=*), intent(out)::child_name -\end{lstlisting} - -\begin{lstlisting}[language=C] -int spud_get_child_name(const char* key, const int key_len, - const int index, - char* child_name, const int child_name_len) -\end{lstlisting} - -\begin{lstlisting}[language=C++] -Spud::OptionError Spud::get_child_name(const std::string& key, - const unsigned& index, - std::string& child_name) -\end{lstlisting} - -Retrieves the name of the \lstinline+index+th child of \lstinline+key+. This -is mostly useful for debugging input files. - -Returns error code \lstinline+SPUD_KEY_ERROR+ if the supplied key does not -exist in the options tree. - -\subsection{get\_number\_of\_children} - -\begin{lstlisting}[language=Fortran] -function number_of_children(key, child_count) - integer :: number_of_children - character(len=*), intent(in) :: key - integer, intent(out) :: child_count - integer, optional, intent(out) :: stat -\end{lstlisting} - -\begin{lstlisting}[language=C] -int spud_get_number_of_children(const char* key, const int key_len, int* child_count) -\end{lstlisting} - -\begin{lstlisting}[language=C++] -int Spud::get_number_of_children(const std::string& key, int& child_count) -\end{lstlisting} - -On return, \lstinline+child_count+ the number of children under \lstinline+key+. This is mainly of use -for debugging input files. - -Returns the error code \lstinline+SPUD_KEY_ERROR+ if the specified key does not exist in the options tree. - -\subsection{option\_count} - -\begin{lstlisting}[language=fortran] -function option_count(key) - integer :: option_count - character(len=*), intent(in) :: key -\end{lstlisting} - -\begin{lstlisting}[language=C] -int spud_option_count(const char* key, const int key_len) -\end{lstlisting} - -\begin{lstlisting}[language=C++] -int Spud::option_count(const std::string& key) -\end{lstlisting} - -Returns the number of options which match \lstinline+key+. Searches all possible -paths matching the given key. For example, for the following XML file: - -\begin{verbatim} - - - - ... - - - - - ... - - - -\end{verbatim} - -in the following Fortran code: - -\begin{lstlisting}[language=fortran] -n_child = option_count("/scalar_field/solver") -\end{lstlisting} - -\lstinline+n_child+ is assigned the value 2. - -This routine is useful where an option can occur any number of times (for -example a simulation may allow for any number of fields to be specified). - -Returns 0 if \lstinline+key+ is not present in the dictionary. - -\subsection{have\_option} - -\begin{lstlisting}[language=fortran] -function have_option(key) - logical :: have_option - character(len=*), intent(in) :: key -\end{lstlisting} - -\begin{lstlisting}[language=C] -int spud_have_option(const char* key, const int key_len) -\end{lstlisting} - -\begin{lstlisting}[language=C++] -logical_t Spud::have_option(const std::string& key) -\end{lstlisting} - -Returns true if \lstinline+key+ is present in the options dictionary, and -false otherwise. This is useful for determining whether optional options have -been set and for determining which of a choice of options has been selected. - -\subsection{option\_type}\label{sec:option_type} - -\begin{lstlisting}[language=fortran] -function option_type(key, stat) result (type) - integer :: type - character(len=*), intent(in) :: key - integer, optional, intent(out) :: stat -\end{lstlisting} - -\begin{lstlisting}[language=C] -int spud_get_option_type(const char* key, const int key_len, int* type) -\end{lstlisting} - -\begin{lstlisting}[language=C++] -Spud::OptionError Spud::get_option_type(const std::string& key, -Spud::OptionType& type) -\end{lstlisting} - -Returns the type of the option specified by \lstinline+key+. The type will -be returned as one of the named constants in \ref{sec:types}. - -Returns error code \lstinline+SPUD_KEY_ERROR+ if the supplied key does not -exist in the options tree. - -\subsection{option\_rank} - -\begin{lstlisting}[language=fortran] -function option_rank(key, stat) result (rank) - integer :: rank - character(len=*), intent(in) :: key - integer, optional, intent(out) :: stat -\end{lstlisting} - -\begin{lstlisting}[language=C] -int spud_get_option_rank(const char* key, const int key_len, int* rank) -\end{lstlisting} - -\begin{lstlisting}[language=C++] -Spud::OptionError Spud::get_option_rank(const std::string& key, -int& rank) -\end{lstlisting} - -Returns the rank of the option specified by \lstinline+key+. The rank returned -will be 0 (for a scalar), 1 (for a vector) or 2 (a rank 2 tensor, or matrix). - -Returns error code \lstinline+SPUD_KEY_ERROR+ if the supplied key does not -exist in the options tree. - -\subsection{option\_shape} - -\begin{lstlisting}[language=fortran] -function option_shape(key, stat) result (lshape) - integer, dimension(2) :: lshape - character(len=*), intent(in) :: key - integer, optional, intent(out) :: stat -\end{lstlisting} - -\begin{lstlisting}[language=C] -int spud_get_option_shape(const char* key, const int key_len, int* shape) -\end{lstlisting} - -\begin{lstlisting}[language=C++] -Spud::OptionError Spud::get_option_shape(const std::string& key, -std::vector& shape) -\end{lstlisting} - -Returns the shape of the option specified by \lstinline+key+. The shape is -always a 2-vector. If the option in question is rank 1 then the second -component will be -1, if the option is rank 0 (a scalar) then both entries -will be -1. - -Returns error code \lstinline+SPUD_KEY_ERROR+ if the supplied key does not -exist in the options tree. - -\subsection{get\_option}\label{sec:get_option} - -\begin{lstlisting}[language=fortran,emph=option_type,emphstyle=\textit] -subroutine get_option(key, val, stat, default) - character(len=*), intent(in) :: key - option_type, intent(out) :: val - integer, optional, intent(out) :: stat - option_type, optional, intent(in) :: default -\end{lstlisting} - -\begin{lstlisting}[language=C,emph=option_type,emphstyle=\textit] -int spud_get_option(const char* key, const int key_len, void* val) -\end{lstlisting} - -\begin{lstlisting}[language=C++,emph=option_type,emphstyle=\textit] -Spud::OptionError Spud::get_option(const std::string& key, -option_type val) - -Spud::OptionError Spud::get_option(const std::string& key, -option_type val, option_type default_val) -\end{lstlisting} - -This is the main method for retrieving option values from the options -dictionary. For Fortran and C++ -\lstinline[emph=option_type,emphstyle=\textit]+option_type+ can be any of the -following values: - -\begin{tabular}{ll} - \textbf{Fortran type} & \textbf{C++ type} \\ - \lstinline[language=fortran]+double precision+ & - \lstinline[language=C++]+double&+ \\ - \lstinline[language=fortran]+double precision, dimension(:)+ & - \lstinline[language=C++]+std::vector&+ \\ - \lstinline[language=fortran]+double precision, dimension(:,:)+ & - \lstinline[language=C++]+std::vector< std::vector >&+\\ - \lstinline[language=fortran]+integer+ & - \lstinline[language=C++]+int&+ \\ - \lstinline[language=fortran]+integer, dimension(:)+ & - \lstinline[language=C++]+std::vector&+ \\ - \lstinline[language=fortran]+integer, dimension(:,:)+ & - \lstinline[language=C++]+std::vector< std::vector >&+\\ - \lstinline[language=fortran]+character(len=*)+ & - \lstinline[language=C++]+std::string&+ -\end{tabular} - -In Fortran, single precision interfaces are also provided in each of the -above cases. However, these values will be stored in the options dictionary -in double precision. In every case the type and shape of the argument must -match that of the option in the dictionary. In C the returned argument is -always a \lstinline+void+ pointer and it is the responsibility of the user -to match the size and type correctly. - -This routine can return the following error codes: -\begin{itemize} -\item If \lstinline+key+ matches an option but the shape, rank or type fails - to match, appropriate error code will be set (see - \ref{sec:error_codes}). -\item If \lstinline+key+ fails to match but \lstinline+default+ is present, - \lstinline+option+ is set to the value of \lstinline+default+. -\item If \lstinline+key+ fails to match and \lstinline+default+ is not - present, the error code will be set to \lstinline+SPUD_KEY_ERROR+. -\end{itemize} - -\subsection{add\_option} - -\begin{lstlisting}[language=fortran] -subroutine add_option(key, stat) - character(len=*), intent(in) :: key - integer, optional, intent(out) :: stat -\end{lstlisting} - -\begin{lstlisting}[language=C] -int spud_add_option(const char* key, const int key_len) -\end{lstlisting} - -\begin{lstlisting}[language=C++] -Spud::OptionError Spud::add_option(const std::string& key) -\end{lstlisting} - -Creates a new option at the supplied key. If the option does not currently -exist, creates the option (with data type \lstinline+SPUD_NONE+) and -returns error code \lstinline+SPUD_NEW_KEY_WARNING+. - -\subsection{set\_option}\label{sec:set_option} - -\begin{lstlisting}[language=fortran,emph=option_type,emphstyle=\textit] -subroutine set_option(key, val, stat) - character(len=*), intent(in) :: key - option_type, intent(in or inout) :: val - integer, optional, intent(out) :: stat -\end{lstlisting} - -\begin{lstlisting}[language=C,emph=option_type,emphstyle=\textit] -int spud_set_option(const char* key, const int key_len, const void* val, -const int type, const int rank, const int* shape) -\end{lstlisting} - -\begin{lstlisting}[language=C++,emph=option_type,emphstyle=\textit] -Spud::OptionError Spud::set_option(const std::string& key, -const option_type& val) -\end{lstlisting} - -Method for setting options in the options tree. The -\lstinline[emph=option_type,emphstyle=\textit]+option_type+ can be any of the -types listed above in \ref{sec:get_option}. - -This routine can return the following error codes: -\begin{itemize} -\item If \lstinline+key+ matches an option but the shape, rank or type fails - to match currently existing option, returns an appropriate error code (see - \ref{sec:error_codes}). -\item If \lstinline+key+ fails to match, creates a new option at the supplied - key, sets the option to \lstinline+val+ and returns error code - \lstinline+SPUD_NEW_KEY_WARNING+. -\end{itemize} - -\subsection{set\_option\_attribute} - -\begin{lstlisting}[language=fortran] -subroutine set_option_attribute(key, val, stat) - character(len=*), intent(in) :: key - character(len=*), intent(in) :: val - integer, optional, intent(out) :: stat -\end{lstlisting} - -\begin{lstlisting}[language=C] -int int spud_set_option_attribute(const char* key, const int key_len, -const char* val, const int val_len) -\end{lstlisting} - -\begin{lstlisting}[language=C++] -Spud::OptionError Spud::set_option_attribute(const std::string& key, -const std::string& val) -\end{lstlisting} - -As \lstinline+set_option+ (see \ref{sec:set_option}), but additionally attempts -to mark the option at the specified key as an attribute. Note that -\lstinline+set_option_attribute+ accepts only string data data for -\lstinline+val+. - -This routine can return the following error codes: -\begin{itemize} -\item If \lstinline+key+ matches an option but the shape, rank or type fails - to match currently existing option, returns an appropriate error code (see - \ref{sec:error_codes}). -\item If \lstinline+key+ fails to match, creates a new option at the supplied - key, sets the option to \lstinline+val+ and returns error code - \lstinline+SPUD_NEW_KEY_WARNING+. -\item If \lstinline+key+ matches an option, but the existing option has - children, sets the option to \lstinline+val+ and returns error code - \lstinline+SPUD_ATTR_SET_FAILED_WARNING+. -\end{itemize} - -\subsection{delete\_option} - -\begin{lstlisting}[language=fortran] -subroutine delete_option(key, stat) - character(len=*), intent(in) :: key - integer, optional, intent(out) :: stat -\end{lstlisting} - -\begin{lstlisting}[language=C] -int spud_delete_option(const char* key, const int key_len) -\end{lstlisting} - -\begin{lstlisting}[language=C++] -Spud::OptionError Spud::delete_option(const std::string& key) -\end{lstlisting} - -Deletes the option at the specified key. - -Returns error code \lstinline+SPUD_KEY_ERROR+ if the supplied key does not -exist in the options tree. - -\subsection{move\_option} - -\begin{lstlisting}[language=fortran] -subroutine move_option(key1, key2, stat) - character(len=*), intent(in) :: key1 - character(len=*), intent(in) :: key2 - integer, optional, intent(out) :: stat -\end{lstlisting} - -\begin{lstlisting}[language=C] -int spud_move_option(const char* key1, const int key1_len, const char* key2, const int key2_len) -\end{lstlisting} - -\begin{lstlisting}[language=C++] -Spud::OptionError Spud::move_option(const std::string& key1, const std::string& key2) -\end{lstlisting} - -Moves the entire options tree and all its children from key1 to key2. - -\subsection{copy\_option} - -\begin{lstlisting}[language=fortran] -subroutine copy_option(key1, key2, stat) - character(len=*), intent(in) :: key1 - character(len=*), intent(in) :: key2 - integer, optional, intent(out) :: stat -\end{lstlisting} - -\begin{lstlisting}[language=C] -int spud_copy_option(const char* key1, const int key1_len, const char* key2, const int key2_len) -\end{lstlisting} - -\begin{lstlisting}[language=C++] -Spud::OptionError Spud::copy_option(const std::string& key1, const std::string& key2) -\end{lstlisting} - -Copies the entire options tree and all its children from key1 to key2. - -\subsection{print\_options} - -\begin{lstlisting}[language=fortran] -subroutine print_options() -\end{lstlisting} - -\begin{lstlisting}[language=C] -void spud_print_options() -\end{lstlisting} - -\begin{lstlisting}[language=C++] -void Spud::print_options() -\end{lstlisting} - -Prints the entire options tree to standard output. Useful for debugging. - -\section{Python binding for libspud} - -libspud also offers bindings for the Python programming language. Users can use Python for accessing the options specified in a Spud XML file. (This is done by the libspud.c module. The module is written in C using the header file Python.h and spud.h. It provides a Python interface to libspud; so that users could use Python codes to access the C codes in libspud. The module takes in Python arguments, converts them into C arguments and then call the corresponding C functions with the converted C arguments.) - -\subsection{Errors} - -Python binding converts spud errors into exceptions, and that these exceptions match those listed in 3.5.2: \\* -SpudError; \\* -SpudTypeError; \\* -SpudKeyError; \\* -SpudFileError; \\* -SpudNewKeyWarning; \\* -SpudAttrSetFailedWarning; \\* -SpudShapeError; \\* -SpudRankError; - -\subsection{Data type parameters}\label{sec:types} - -The option\_type routine returns the following values. In Fortran these are -named constants in the \lstinline+spud+ module while in C and C++ these are -the enum types \lstinline+SpudOptionType+ and \lstinline+Spud::OptionType+ -respectively. - -\begin{tabular}{lll} - \textbf{Fortran} & \textbf{C/C++} & \textbf{Python} \\ - \lstinline+SPUD_REAL+ & \lstinline+SPUD_DOUBLE+ & \lstinline+float+ \\ - \lstinline+SPUD_INTEGER+ & \lstinline+SPUD_INT+ & \lstinline+int+ \\ - \lstinline+SPUD_NONE+ & \lstinline+SPUD_NONE+ & \lstinline+None+ \\ - \lstinline+SPUD_CHARACTER+ & \lstinline+SPUD_STRING+ & \lstinline+str+ -\end{tabular} - -\subsection{clear\_options} - -\begin{lstlisting}[language=Python] -def clear_options() -return None -\end{lstlisting} - -This function takes no arguments and returns None. -Clears the entire options tree. - -\subsection{load\_options} - -\begin{lstlisting}[language=Python] -def load_options(string filename) -return None -\end{lstlisting} - -This function takes the XML filename in the form of a Python string and raises SpudFileError if file cannot be read or does not exist. -Otherwise, it reads the file into the options tree, and then returns None. - -\subsection{write\_options} - -\begin{lstlisting}[language=Python] -def write_options(string filename) -return None -\end{lstlisting} - -This function takes the XML filename in the form of a Python string and raises SpudFileError if file cannot be written or does not exist. -Otherwise, it writes the options tree to the file, and then returns None. - -\subsection{get\_child\_name} - -\begin{lstlisting}[language=Python] -def get_child_name(string key, int index) -return string -\end{lstlisting} - -This function takes the key in the form of a Python string, and an integer index. -It raises SpudKeyError if supplied key does not exist in the options tree. -Otherwise, it retrieves the childname of the indexth of key , and then returns the childname as Python string. - -\subsection{get\_number\_of\_children} - -\begin{lstlisting}[language=Python] -def get_number_of_children(string key) -return int -\end{lstlisting} - -This function takes the key in the form of a Python string. -It raises SpudKeyError if supplied key does not exist in the options tree. -Otherwise, it returns the number of children of the key as Python integer. - -\subsection{option\_count} - -\begin{lstlisting}[language=Python] -def option_count(string key) -return int -\end{lstlisting} - -This function takes the key in the form of a Python string. -It returns the number of options which match the key as Python integer. -It returns 0 if key is not present in the dictionary. - -\subsection{have\_option} - -\begin{lstlisting}[language=Python] -def have_option(string key) -return True or False -\end{lstlisting} - -This function takes the key in the form of a Python string. -It returns True if the key is present in the options dictionary, False otherwise. - -\subsection{get\_option\_type} - -\begin{lstlisting}[language=Python] -def get_option_type(string key) -return PyObject_Type -\end{lstlisting} - -This function takes the key in the form of a Python string. -It raises SpudKeyError if the supplied key does not exist in the options tree. -It returns the type of the key as one of the Python object types in 3.6.2. - -\subsection{get\_option\_rank} - -\begin{lstlisting}[language=Python] -def get_option_rank(string key) -return int -\end{lstlisting} - -This function takes the key in the form of a Python string. -It raises SpudKeyError if the supplied key does not exist in the options tree. -It returns the rank of the key as Python ints. -0 for scalar, 1 for vector, 2 for tensor or matrix. - -\subsection{get\_option\_shape} - -\begin{lstlisting}[language=Python] -def get_option_shape(string key) -return (int, int) -\end{lstlisting} - -This function takes the key in the form of a Python string. -It raises SpudKeyError if the supplied key does not exist in the options tree. -It returns the shape of the key as Python two-tuple. -If the option in question is rank 1 then the second component will be -1, if the option is rank 0 (a scalar) then both entries will be -1. - -\subsection{get\_option} - -\begin{lstlisting}[language=Python] -def get_option(string key) -return optionvalue -\end{lstlisting} - -This function takes the key in the form of a Python string. -If key matches an option but the shape, rank or type fails to match, appropriate error code will -be set (see 3.6.1). -If key fails to match but default is present, option is set to the value of default. -If key fails to match and default is not present, the error code will be set to SpudKeyError. -It returns the value of the option, the value could be of any type. - -\subsection{add\_option} - -\begin{lstlisting}[language=Python] -def add_option(string key) -return None -\end{lstlisting} - -This function takes the key in the form of a Python string. -It creates a new option at the supplied key. -If the option does not currently exist, creates the option -(with data type SPUD\_NONE) and returns error code SpudNewKeyWarning. - -\subsection{set\_option} - -\begin{lstlisting}[language=Python] -def set_option(string key, valuetype value) -return None -\end{lstlisting} - -This function takes the key in the form of a Python string, and the value to be set. -Value could be of any type listed in 3.6.2. -If key matches an option but the shape, rank or type fails to match currently existing option, -returns an appropriate error code (see 3.6.1). -If key fails to match, creates a new option at the supplied key, sets the option to value and returns -error code SpudNewKeyWarning. -This function is for setting options in the options tree. - -\subsection{set\_option\_attribute} - -\begin{lstlisting}[language=Python] -def set_option_attribute(string key, valuetype value) -return None -\end{lstlisting} - -This function takes the key in the form of a Python string, and the value to be set. -Value could be of any type listed in 3.6.2. -If key matches an option but the shape, rank or type fails to match currently existing option, -returns an appropriate error code (see 3.6.1). -If key fails to match, creates a new option at the supplied key, sets the option to value and returns -error code SpudNewKeyWarning. -If key matches an option, but the existing option has children, sets the option to val and -returns error code SpudAttrSetFailedWarning. -This function is for setting options in the options tree, but additionally attempts to mark the option at the key as an attribute. - -\subsection{delete\_option} - -\begin{lstlisting}[language=Python] -def delete_option(string key) -return None -\end{lstlisting} - -This function takes the key in the form of a Python string. -It raises SpudKeyError if the supplied key does not exist in the options tree. -This function deletes the option in the options tree. - -\subsection{print\_options} - -\begin{lstlisting}[language=Python] -def print_options() -return None -\end{lstlisting} - -This function takes no arguments. -It prints the entire options tree to standard output. - - -\include{diamond_manual} - -\chapter{Miscellaneous tools} - -\section{Spud-set} - -Spud-set is a short Python script which enables users to make small -modifications to the values of options in Spud options files on the command -line. This is particularly useful where users wish to script a number of -model runs exploring different values of one or more parameters. - -The syntax of spud-set is: -\begin{verbatim} -spud-set filename xpath new_value -\end{verbatim} -where: -\begin{description} -\item[filename] is the name of the options file which is to be modified. -\item[xpath] is the xpath of the option to be modified (see below). -\item[new\_value] is the new value which the option should take. -\end{description} - -\subsection{xpath} - -An xpath is a language which provides a mechanism for addressing parts of an -xml file. It uses paths similar in some ways to those used to retrieve -options in libspud. A full description of xpath syntax is to be found in the -\href{http://www.w3.org/TR/xpath}{World Wide Web Consortium XPath - Recommendation}. However, users of Spud will usually find it much easier -to use the xpaths generated by Diamond. The xpath for any option is shown at -the bottom of the Diamond window when that option is selected and can be -copied to the clipboard using the ``copy spud path'' option from the edit menu. - -\section{Spud-update-options} - -Spud-update-options is a short Python script with enables users to attempt to automatically update their options files against a -schema. If there are changes that cannot be automatically made to the options files then they will be flagged as invalid. - -The syntax of spud-update-options is: -\begin{verbatim} -spud-update-options [-h] [-a ALIAS] [-s SCHEMA] [-r [depth]] [-v] file [file ...] -\end{verbatim} -where: -\begin{description} -\item[file] is the name of the options file (or regular expression describing the options files) to be updated. -\item[-a] allows a schema alias to be specified (will be ignored if -s is specified) -\item[-s] allows the schema to be specified (if neither -a or -s is specified the script will follow the same search for schema -files as diamond) -\item[-r] allows the script to recurse the file tree (completely or to the specified depth) searching for options files matching the description in file -\item[-v] makes the script verbose -\item[-h] prints a help message -\end{description} - - -\end{document} diff --git a/libspud/dxdiff/COPYING b/libspud/dxdiff/COPYING deleted file mode 100644 index eeb60bae25..0000000000 --- a/libspud/dxdiff/COPYING +++ /dev/null @@ -1,15 +0,0 @@ -dxdiff is copyright (C) 2011 Imperial College London and others. -For a full list of contributors see the AUTHORS file. - -dxdiff is free software: you can 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. - -The complete text of the GNU General Public License can be found -in the file `GPL-3'. diff --git a/libspud/dxdiff/GPL-3 b/libspud/dxdiff/GPL-3 deleted file mode 100644 index 4432540474..0000000000 --- a/libspud/dxdiff/GPL-3 +++ /dev/null @@ -1,676 +0,0 @@ - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. - diff --git a/libspud/dxdiff/dxdiff/__init__.py b/libspud/dxdiff/dxdiff/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libspud/dxdiff/dxdiff/bimap.py b/libspud/dxdiff/dxdiff/bimap.py deleted file mode 100644 index 6060dcad0c..0000000000 --- a/libspud/dxdiff/dxdiff/bimap.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python - -# This file is part of dxdiff. -# -# dxdiff is free software: you can 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. -# -# dxdiff is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - - -class Bimap: - """ - Bimap is a simple wrapper class over two dicts, - it behaves as a bi-directional map. - """ - - def __init__(self): - self.left = {} - self.right = {} - - def __len__(self): - return len(self.left) - - def __iter__(self): - # we iter over the left dict so that the left item is - # on the left side of the tuple returned - for item in self.left.iteritems(): - yield item - - def __contains__(self, item): - # check that the left dict contains left and points to right - try: - left, right = item - return self.left[left] == right - except KeyError: - return False - - def add(self, item): - x, y = item - self.left[x] = y - self.right[y] = x diff --git a/libspud/dxdiff/dxdiff/diff.py b/libspud/dxdiff/dxdiff/diff.py deleted file mode 100644 index 0d74ed3be9..0000000000 --- a/libspud/dxdiff/dxdiff/diff.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python - -# This file is part of dxdiff. -# -# dxdiff is free software: you can 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. -# -# dxdiff is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -import fmes - -def diff(xmlold, xmlnew): - """ - Compares two xml trees. - Returns an editscript to transform old into new. - """ - - return fmes.diff(xmlold, xmlnew) diff --git a/libspud/dxdiff/dxdiff/dxdiff b/libspud/dxdiff/dxdiff/dxdiff deleted file mode 100755 index 04556e7fc9..0000000000 --- a/libspud/dxdiff/dxdiff/dxdiff +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env python - -# This file is part of dxdiff. -# -# dxdiff is free software: you can 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. -# -# dxdiff is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -from getopt import getopt -import sys -import os -from lxml import etree -from diff import diff - -def __display_help(): - """ - Prints usage information to standard output. - """ - - print "\n".join(["Usage: dxdiff [OPTIONS] ... [FILE1] [FILE2]", - "", - "An XML aware diff tool. [FILE1] and [FILE2] are the XML files to be compared.", - "[FILE1] should be the old file.", - "", - "Options:", - "" - "-h Display this message", - ""]) - -def __main(): - """ - Main routine to run dxdiff - """ - - try: - opts, args = getopt(sys.argv[1:], "hso:") - except: - __display_help() - sys.exit(1) - - if len(args) != 2: - __display_help() - sys.exit(1) - - if ("h", "") in opts: - __display_help() - - output_file = None - for opt in opts: - if opt[0] == "-o": - output_file = opt[1] - - file1 = args[0] - file2 = args[1] - - try: - os.stat(file1) - except OSError: - print "Could not find " + file1 + "!" - sys.exit(1) - - try: - os.stat(file2) - except OSError: - print "Could not find " + file2 + "!" - sys.exit(1) - - xmlold = etree.parse(file1) - xmlnew = etree.parse(file2) - - editscript = diff(xmlold, xmlnew) - if ("s", "") not in opts: - print editscript - if output_file is not None: - editscript.write(output_file) - -if __name__ == "__main__": - __main() diff --git a/libspud/dxdiff/dxdiff/editscript.py b/libspud/dxdiff/dxdiff/editscript.py deleted file mode 100644 index 8ba161b025..0000000000 --- a/libspud/dxdiff/dxdiff/editscript.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python - -# This file is part of dxdiff. -# -# dxdiff is free software: you can 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. -# -# dxdiff is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -from lxml import etree - -class EditScript: - - def __init__(self): - self.script = [] - - def __str__(self): - return etree.tostring(self.to_xml(), pretty_print = True) - - def __len__(self): - return len(self.script) - - def __getitem__(self, key): - return self.script[key] - - def __iter__(self): - return self.script.__iter__() - - def update(self, path, value, userdata = None): - self.script.append({ "type": "update", - "location": path, - "value": value, - "userdata": userdata }) - - def insert(self, path, index, tag, value = None, userdata = None): - self.script.append({ "type": "insert", - "location": path, - "index": index, - "value": tag + (" " + value if value is not None else ""), - "userdata": userdata}) - - def delete(self, path, userdata = None): - self.script.append({ "type": "delete", - "location": path, - "userdata": userdata}) - - def move(self, path, destination, index, userdata = None): - self.script.append({ "type": "move", - "location": path, - "index": index, - "value": destination, - "userdata": userdata }) - - def to_xml(self): - tree = etree.Element("xmldiff") - - for edit in self.script: - node = etree.Element(edit["type"], location = edit["location"]) - if "index" in edit: - node.attrib["index"] = edit["index"] - if edit["userdata"] is not None: - node.attrib["userdata"] = edit["userdata"] - - if "value" in edit: - node.text = edit["value"] - tree.append(node) - - return etree.ElementTree(tree) - - def write(self, path): - self.to_xml().write(path, pretty_print = True, xml_declaration = True, encoding = "utf-8") diff --git a/libspud/dxdiff/dxdiff/fmes.py b/libspud/dxdiff/dxdiff/fmes.py deleted file mode 100644 index 506475fe87..0000000000 --- a/libspud/dxdiff/dxdiff/fmes.py +++ /dev/null @@ -1,473 +0,0 @@ -#!/usr/bin/env python - -# This file is part of dxdiff. -# -# dxdiff is free software: you can 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. -# -# dxdiff is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . -""" -Diff xml trees using a modification of FMES [http://infolab.stanford.edu/pub/papers/tdiff3-8.ps] -""" - -from lxml import etree -from collections import deque -from bimap import Bimap -from editscript import EditScript - -import lcs -import utils - -class Dom: - def __init__(self, tag, value, parent, attribute = False): - self.tag = tag - self.value = value - self.parent = parent - self.children = [] - - if value is None: - self.typetag = "/Element" - elif attribute: - self.typetag = "/Attribute" - else: - self.typetag = "/Text" - - if parent: - self.depth = parent.depth + 1 - else: - self.depth = 0 - - self.inorder = False - - def elements(self): - return [child for child in self.children if child.is_element()] - - def attributes(self): - return [child for child in self.children if child.is_attribute()] - - def text(self): - return [child for child in self.children if child.is_text()] - - def is_element(self): - return self.typetag == "/Element" - - def is_text(self): - return self.typetag == "/Text" - - def is_attribute(self): - return self.typetag == "/Attribute" - - def __repr__(self): - return "<" + self.label() + ">" + (self.value or "") - - def __str__(self, indent = ""): - title = indent + "<" + self.path() + ">" + (self.value or "") + "\n" + indent - children = ("\n" + indent).join(child.__str__(indent + " ") for child in self.children) - return title + children - - def path(self): - """ - Finds the path of this element. - """ - if self.is_text(): - return self.parent.path() + "/text()" - - if self.is_attribute(): - return self.parent.path() + "/@" + self.tag - - if self.parent: - siblings = [sibling for sibling in self.parent.elements() if sibling.tag == self.tag] - if len(siblings) != 1: - index = "[" + str(siblings.index(self) + 1) + "]" - else: - index = "" - return self.parent.path() + "/" + self.tag + index - else: - return "/" + self.tag - - - def find(self, path): - - if self.is_text(): - if path == "/text()": - return self - else: return None - - if self.is_attribute(): - if path == "/@" + self.tag: - return self - else: return None - - index = path.find("/", 1) - if index == -1: - index = len(path) - - root = path[:index] - path = path[index:] - - if self.parent: - siblings = [sibling for sibling in self.parent.elements() if sibling.tag == self.tag] - if len(siblings) != 1: - index = "[" + str(siblings.index(self) + 1) + "]" - else: - index = "" - - if root != "/" + self.tag + index: - return None - else: - if root != "/" + self.tag: - return None - - if path: - for child in self.children: - result = child.find(path) - if result: - return result - else: - return self - - def _real_index(self, parent, index): - if index == 0: - return 0 - - elements = parent.elements() - if len(elements) < index: - return len(parent.children) - return parent.children.index(elements[index - 1]) - - def insert(self, tag, tagtype, value, path, index): - parent = self.find(path) - - node = Dom(tag, value, parent, tagtype == "/Attribute") - parent.children.insert(self._real_index(parent, index), node) - return node - - def update(self, path, value): - node = self.find(path) - - node.value = value - return node - - def move(self, from_path, to_path, index): - node = self.find(from_path) - node.parent.children.remove(node) - - parent = self.find(to_path) - parent.children.insert(self._real_index(parent, index), node) - node.parent = parent - - def delete(self, path): - node = self.find(path) - node.parent.children.remove(node) - node.parent = None - -def _get_text(tree): - """ - Returns the text and child tails. - """ - return "".join([tree.text or ""] + [child.tail or "" for child in tree]).strip() - -def dom(tree = None, parent = None): - node = Dom(tree.tag, None, parent) - - text = _get_text(tree) - if text: - text = Dom(tree.tag, text, node) - node.children.append(text) - - for key, value in tree.items(): - attr = Dom(key, value, node, True) - node.children.append(attr) - - for child in tree: - node.children.append(dom(child, node)) - - return node - -def get_leaf_nodes(tree): - """ - Gets all the leaf nodes of an xml tree. - """ - if tree.children: - return utils.flatten([get_leaf_nodes(child) for child in tree.children]) - else: - return [tree] - -def get_parent_nodes(tree): - """ - Returns all the non leaf nodes of an xml tree. - """ - - if tree.children: - return utils.flatten([get_parent_nodes(child) for child in tree.children]) + [tree] - else: - return [] - -def get_depth(tree): - """ - Returns the maximum depth of a tree. - """ - depth = tree.depth - for child in tree.children: - depth = max(depth, get_depth(child)) - return depth - -def get_depth_nodes(tree, depth): - """ - Gets all the nodes of a certain depth of an xml tree. - """ - if tree.depth == depth: - return [tree] - else: - if tree.children: - return utils.flatten([get_depth_nodes(child, depth) for child in tree.children]) - else: - return [] - -def get_chain(nodes, label): - return [node for node in nodes if node.label == label] - -def compare_value(value1, value2): - if value1 is None and value2 is None: - return 0.0 - if value1 is None or value2 is None: - return 1.0 - return 1.0 - (float(len(lcs.lcs(lcs.path(value1, value2)))) / max(len(value1), len(value2))) - -def leaf_equal(f, M, l1, l2): - return compare_value(l1.value, l2.value) <= f - -def common(children1, children2, M): - return [(x, y) for (x, y) in M if x in children1 and y in children2] - -def compare_children(children1, children2, M): - return (float(len(common(children1, children2, M))) / max(len(children1), len(children2))) - -def node_equal(t, M, n1, n2): - return compare_children(n1.children, n2.children, M) > t - -def depth_equal(f, t, M, n1, n2): - if n1.label != n2.label: - return False #labels must match - - if "[" not in n1.path() and "[" not in n2.path(): - return True #if paths are not indexed and match then match the nodes - - if n1.children or n2.children: - return node_equal(t, M, n1, n2) - else: - return leaf_equal(f, M, n1, n2) - -def _match(nodes1, nodes2, M, equal): - nodes = nodes1 + nodes2 - for label in utils.nub([node.label for node in nodes]): - - s1 = get_chain(nodes1, label) - s2 = get_chain(nodes2, label) - - path = lcs.lcs(lcs.path(s1, s2, equal)) - - for x, y in path: - M.add((s1[x], s2[y])) - for x, y in reversed(path): - s1.pop(x) - s2.pop(y) - - for x in range(len(s1)): - for y in range(len(s2)): - if equal(s1[x], s2[y]): - M.add((s1[x], s2[y])) - s2.pop(y) - break - -def label(tree): - """ - Strips out indexers from the paths. - """ - - for node in depth_iter(tree): - path = node.path() - while True: - lindex = path.find("[") - if lindex == -1: - break - rindex = path.find("]", lindex) - path = path[:lindex] + path[rindex + 1:] - node.label = path - -def fastmatch(t1, t2): - """ - Calculates a match between t1 and t2. - See figure 10 in reference. - """ - M = Bimap() - - label(t1) - label(t2) - depth = max(get_depth(t1), get_depth(t2)) - - while 0 <= depth: - nodes1 = get_depth_nodes(t1, depth) - nodes2 = get_depth_nodes(t2, depth) - - equal = utils.partial(depth_equal, 0.6, 0.5, M) - - _match(nodes1, nodes2, M, equal) - - depth -= 1 - - return M - -def depth_iter(tree): - Q = [] - Q.append(tree) - while Q: - t = Q.pop() - for child in t.children: - Q.append(child) - yield t - -def breadth_iter(tree): - Q = deque() - Q.append(tree) - while Q: - t = Q.popleft() - if t is not tree: - yield t - if t.parent is not None or t is tree: #check we haven't deleted it - for child in t.children: - Q.append(child) - -def postorder_iter(tree): - S = [] - O = [] - S.append(tree) - while S: - t = S.pop() - O.append(t) - for child in t.children: - S.append(child) - while O: - t = O.pop() - if t is not tree: - yield t - -def editscript(t1, t2): - """ - Finds an editscript between t1 and t2. - See figure 8 in reference. - """ - - E = EditScript() - M = fastmatch(t1, t2) - - M.add((t1, t2)) - alignchildren(t1, t2, M, E, t1, t2) - - for x in breadth_iter(t2): - y = x.parent - z = M.right[y] - - if x not in M.right: - if x.typetag == "/Text": #Can't insert Text, do an update - E.update(z.path(), x.value) - w = t1.insert(x.tag, x.typetag, x.value, z.path(), 0) - M.add((w, x)) - else: - x.inorder = True - k = findpos(M, x) - E.insert(z.path(), str(k), x.tag, x.value) - w = t1.insert(x.tag, x.typetag, x.value, z.path(), k) - M.add((w, x)) - else: # y is not None: - w = M.right[x] - v = w.parent - if w.value != x.value: - E.update(w.path(), x.value) - t1.update(w.path(), x.value) - if (v, y) not in M: - x.inorder = True - k = findpos(M, x) - E.move(w.path(), z.path(), str(k)) - t1.move(w.path(), z.path(), k) - - alignchildren(t1, t2, M, E, w, x) - - for w in breadth_iter(t1): - if w not in M.left: - if w.typetag == "/Text": #Can't delete Text, do an update - E.update(w.path(), "") - t1.update(w.path(), "") - else: - E.delete(w.path()) - t1.delete(w.path()) - - return E - -def alignchildren(t1, t2, M, E, w, x): - """ - See figure 9 in reference. - """ - - for c in w.elements(): - c.inorder = False - for c in x.elements(): - c.inorder = False - - s1 = [child for child in w.elements() if child in M.left and M.left[child].parent == x] - s2 = [child for child in x.elements() if child in M.right and M.right[child].parent == w] - - def equal(a, b): - return (a, b) in M - - S = [(s1[x], s2[y]) for x, y in lcs.lcs(lcs.path(s1, s2, equal))] - for (a, b) in S: - a.inorder = b.inorder = True - - for a in s1: - for b in s2: - if (a, b) in M and (a, b) not in S: - k = findpos(M, b) - E.move(a.path(), w.path(), k) - t1.move(a.path(), w.path(), str(k)) - a.inorder = b.inorder = True - -def findpos(M, x): - """ - See figure 9 in reference. - """ - if x.is_text() or x.is_attribute(): - return 0 - - y = x.parent - children = y.elements() - - #find the rightmost inorder node left of x (v) - index = children.index(x) - v = None - for i in range(index): - c = children[i] - if c.inorder: - v = c - - if v is None: - return 1 - - u = M.right[v] - children = u.parent.elements() - index = children.index(u) + 1 - return index + 1 - -def diff(tree1, tree2): - t1 = dom(tree1.getroot()) - t2 = dom(tree2.getroot()) - E = editscript(t1, t2) - return E diff --git a/libspud/dxdiff/dxdiff/lcs.py b/libspud/dxdiff/dxdiff/lcs.py deleted file mode 100644 index 2098edb12a..0000000000 --- a/libspud/dxdiff/dxdiff/lcs.py +++ /dev/null @@ -1,284 +0,0 @@ -#!/usr/bin/env python - -# This file is part of dxdiff. -# -# dxdiff is free software: you can 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. -# -# dxdiff is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . -""" -Find the LCS (Longest Common Subsequence). Uses [http://www.xmailserver.org/diff2.pdf] -""" - -from utils import irange - -def __path(V, D, k): - if D == 0: - return [(xy, xy) for xy in irange(V[0][0])] - - tx = V[D][k] - - if k == -D or (k != D and V[D][k - 1] < V[D][k + 1]): - x = V[D][k + 1] - y = x - (k + 1) - k = k + 1 - y = y + 1 - else: - x = V[D][k - 1] - y = x - (k - 1) - k = k - 1 - x = x + 1 - - return __path(V, D - 1, k) + [(x + d, y + d) for d in irange(tx - x)] - -def __eq(a, b): return a == b - -def path(a, b, eq = __eq): - """ - Finds the path through the match grid of sequence a and b, - using the function eq to determine equality. - Returns path - """ - - m = len(a) - n = len(b) - mn = m + n - - if mn == 0: # two empty sequences - return [(0, 0)] - - Vd = [] - V = {1: 0} - - for D in irange(mn): - for k in irange(-D, D, 2): - if k == -D or (k != D and V[k - 1] < V[k + 1]): - x = V[k + 1] - else: - x = V[k - 1] + 1 - y = x - k - - while x < m and y < n and eq(a[x], b[y]): - x += 1 - y += 1 - - V[k] = x - - if x >= m and y >= n: - Vd.append(V.copy()) - return __path(Vd, D, k) - - Vd.append(V.copy()) - - raise Exception("lcs should not reach here") - -def lcs(path): - """ - Given an edit script path returns the longest common subseqence. - """ - - result = [] - - for i in range(1, len(path)): - x, y = path[i] - px, py = path[i - 1] - dx, dy = x - px, y - py - if dx == 1 and dy == 1: - result.append((px, py)) - - return result - -def ses(path, b): - """ - Returns an edit script for a given match grid path. - The edit script transforms sequence A of the match grid - into sequence B via deletions ("D", index) and inserations - ("I", A index, B value). - """ - - patch = [] - for i in range(len(path) - 1): - x, y = path[i] - nx, ny = path[i + 1] - dx, dy = nx - x, ny - y - if dx == 1 and dy == 1: - pass #match - elif dx == 1: - patch.append(("D", x)) - else: #dy == 1: - patch.append(("I", x, b[y])) - - return patch - -def patch(patch, a): - """ - Given a sequence and a patch from the ses function transforms a into b - """ - - seq = type(a) - result = seq() - i = 0 - - for op in patch: - while i < op[1]: - result += seq(a[i]) - i += 1 - - if op[0] == "D": - i += 1 - else: - result += seq(op[2]) - - while i < len(a): - result += seq(a[i]) - i += 1 - - return result - -################## -### Unit Tests ### -################## - -import unittest - -class __Test_lcs(unittest.TestCase): - def test_zero(self): - self.assertEqual(path("", ""), [(0, 0)]) - self.assertEqual(path("", "a"), [(0, 0), (0, 1)]) - self.assertEqual(path("a", ""), [(0, 0), (1, 0)]) - - def test_single(self): - self.assertEqual(path("a", "a"), [(0, 0), (1, 1)]) - self.assertEqual(path("a", "b"), [(0, 0), (1, 0), (1, 1)]) - - def test_short(self): - self.assertEqual(path("ab", "ab"), [(0, 0), (1, 1), (2, 2)]) - self.assertEqual(path("ab", "ac"), [(0, 0), (1, 1), (2, 1), (2, 2)]) - self.assertEqual(path("abcabba", "cbabac"), [(0, 0), (1, 0), (2, 0), (3, 1), (3, 2), (4, 3), (5, 4), (6, 4), (7, 5), (7, 6)]) - self.assertEqual(path("hello", "help me"), [(0, 0), (1, 1), (2, 2), (3, 3), (4, 3), (5, 3), (5, 4), (5, 5), (5, 6), (5, 7)]) - - def test_long(self): - self.assertEqual(path("hello", "night night"), - [(0, 0), (0, 1), (0, 2), (0, 3), (1, 4), (2, 4), - (3, 4), (4, 4), (5, 4), (5, 5), (5, 6), (5, 7), - (5, 8), (5, 9), (5, 10), (5, 11)]) - - self.assertEqual(path([ - "This part of the", - "document has stayed the", - "same from version to", - "version. It shouldn't", - "be shown if it doesn't", - "change. Otherwise, that", - "would not be helping to", - "compress the size of the", - "changes.", - "", - "This paragraph contains", - "text that is outdated.", - "It will be deleted in the", - "near future.", - "", - "It is important to spell", - "check this dokument. On", - "the other hand, a", - "misspelled word isn't", - "the end of the world.", - "Nothing in the rest of", - "this paragraph needs to", - "be changed. Things can", - "be added after it." - ], [ - "This is an important", - "notice! It should", - "therefore be located at", - "the beginning of this", - "document!", - "", - "This part of the", - "document has stayed the", - "same from version to", - "version. It shouldn't", - "be shown if it doesn't", - "change. Otherwise, that", - "would not be helping to", - "compress anything.", - "", - "It is important to spell", - "check this document. On", - "the other hand, a", - "misspelled word isn't", - "the end of the world.", - "Nothing in the rest of", - "this paragraph needs to", - "be changed. Things can", - "be added after it.", - "", - "This paragraph contains", - "important new additions", - "to this document.", - ]), [(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), - (0, 5), (0, 6), (1, 7), (2, 8), (3, 9), - (4, 10), (5, 11), (6, 12), (7, 13), (8, 13), - (9, 13), (9, 14), (10, 15), (11, 15), (12, 15), - (13, 15), (14, 15), (15, 15), (16, 16), (17, 16), - (17, 17), (18, 18), (19, 19), (20, 20), (21, 21), - (22, 22), (23, 23), (24, 24), (24, 25), (24, 26), - (24, 27), (24, 28)]) - -class __Test_diff(unittest.TestCase): - def test_zero(self): - p = path("", "") - - self.assertEqual(ses(p, ""), []) - - def test_delete(self): - p = path("a", "") - self.assertEqual(ses(p, ""), [("D", 0)]) - - p = path("abcd", "") - self.assertEqual(ses(p, ""), [("D", 0), ("D", 1), ("D", 2), ("D", 3)]) - - p = path("abcd", "cd") - self.assertEqual(ses(p, "cd"), [("D", 0), ("D", 1)]) - - p = path("abcd", "ab") - self.assertEqual(ses(p, "ab"), [("D", 2), ("D", 3)]) - - p = path("abcd", "bc") - self.assertEqual(ses(p, "bc"), [("D", 0), ("D", 3)]) - - def test_insert(self): - p = path("", "a") - self.assertEqual(ses(p, "a"), [("I", 0, "a")]) - - p = path("", "abcd") - self.assertEqual(ses(p, "abcd"), [("I", 0, "a"), ("I", 0, "b"), ("I", 0, "c"), ("I", 0, "d")]) - - def test_delins(self): - p = path("abcd", "abef") - self.assertEqual(ses(p, "abef"), [("D", 2), ("D", 3), ("I", 4, "e"), ("I", 4, "f")]) - -class __Test_patch(unittest.TestCase): - def do_patch(self, a, b): - self.assertEqual(patch(ses(path(a, b), b), a), b) - - def test_patch(self): - self.do_patch("", "hello") - self.do_patch("hello", "") - self.do_patch("hello", "hello") - self.do_patch("hello", "night night") - self.do_patch("hello", "help me") - self.do_patch("test bob", "kill bob") - self.do_patch("test bill", "test jane") - -if __name__ == "__main__": - unittest.main() diff --git a/libspud/dxdiff/dxdiff/utils.py b/libspud/dxdiff/dxdiff/utils.py deleted file mode 100644 index d9f4ab9b8e..0000000000 --- a/libspud/dxdiff/dxdiff/utils.py +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env python - -# This file is part of dxdiff. -# -# dxdiff is free software: you can 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. -# -# dxdiff is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Diamond. If not, see . - -def flatten(l): - """ - Flattens a list of lists into a list. - """ - return [item for sublist in l for item in sublist] - -def nub(l, reverse=False): - """ - Removes duplicates from a list. - If reverse is true keeps the last duplicate item - as opposed to the first. - """ - if reverse: - seen = {} - result = [] - for item in reversed(l): - if item in seen: continue - seen[item] = 1 - result.append(item) - return reversed(result) - else: - seen = {} - result = [] - for item in l: - if item in seen: continue - seen[item] = 1 - result.append(item) - return result - -def partial(fn, *cargs, **ckwargs): - """ - Partial function application, taken from PEP 309. - """ - ckwargs = ckwargs.copy() - def call_fn(*fargs, **fkwargs): - d = ckwargs - d.update(fkwargs) - return fn(*(cargs + fargs), **d) - return call_fn - -def irange(*args): - """ - Similar to range but stop is an inclusive upper bound. - """ - if len(args) == 0: - raise TypeError("irange expected at least 1 arguments, got 0") - elif len(args) == 1: - stop = args[0] - start = 0 - step = 1 - elif len(args) == 2: - start, stop = args - step = 1 - elif len(args) == 3: - start, stop, step = args - else: - raise TypeError("irange expected at most 3 arguments, got " + str(len(args))) - - if step == 0: - raise ValueError("irange() step argument must not be zero") - - stop = stop + 1 if step > 0 else stop - 1 - return range(start, stop, step) - -################## -### Unit Tests ### -################## - -import unittest - -class __Test_flatten(unittest.TestCase): - def test_type(self): - self.assertRaises(TypeError, flatten, 1, 2, 3) - - def test_zero(self): - self.assertEqual(flatten([]), []) - self.assertEqual(flatten([[]]), []) - self.assertEqual(flatten([[], []]), []) - - def test_one(self): - self.assertEqual(flatten([[1]]), [1]) - self.assertEqual(flatten([[1, 2], [3, 4]]), [1, 2, 3, 4]) - - def test_two(self): - self.assertEqual(flatten([[[1, 2], [3, 4]], [[5, 6], [7, 8]]]), [[1, 2], [3, 4], [5, 6], [7, 8]]) - -class __Test_nub(unittest.TestCase): - def test_zero(self): - self.assertEqual(nub([]), []) - - def test_nodups(self): - self.assertEqual(nub([1, 2, 3, 4]), [1, 2, 3, 4]) - - def test_dups(self): - self.assertEqual(nub([1, 1, 2, 3, 4, 2]), [1, 2, 3, 4]) - -class __Test_partial(unittest.TestCase): - def printer(*args, **kargs): - result = [] - for arg in args: - result.append(str(args)) - for k, v in kargs.items(): - result.append(str(k) + ": " + str(v)) - return ' '.join(result) - - def test_zero(self): - self.assertEqual(partial(self.printer)(), self.printer()) - - def test_args(self): - self.assertEqual(partial(self.printer, 1)(), self.printer(1)) - self.assertEqual(partial(self.printer)(1), self.printer(1)) - - def test_kargs(self): - self.assertEqual(partial(self.printer, a = 0)(), self.printer(a = 0)) - self.assertEqual(partial(self.printer)(a = 0), self.printer(a = 0)) - -class __Test_irange(unittest.TestCase): - def test_type(self): - self.assertRaises(TypeError, irange) - self.assertRaises(TypeError, irange, 0, 1, 2, 3) - self.assertRaises(TypeError, irange, 0, 1, 2, 3, 4) - - def test_zerostep(self): - self.assertRaises(ValueError, irange, 0, 0, 0) - self.assertRaises(ValueError, irange, 1, 2, 0) - - def test_zero(self): - self.assertEqual(irange(0), [0]) - - def test_stop(self): - self.assertEqual(irange(1), [0, 1]) - self.assertEqual(irange(2), [0, 1, 2]) - - def test_start(self): - self.assertEqual(irange(5, 10), [5, 6, 7, 8, 9, 10]) - - def test_step(self): - self.assertEqual(irange(0, 4, 2), [0, 2, 4]) - self.assertEqual(irange(0, 3, 2), [0, 2]) - - def test_negative(self): - self.assertEqual(irange(-10, -5), [-10, -9, -8, -7, -6, -5]) - self.assertEqual(irange(-5, 5), [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5]) - - def test_negstep(self): - self.assertEqual(irange(5, 0, -1), [5, 4, 3, 2, 1, 0]) - self.assertEqual(irange(2, -2, -1), [2, 1, 0, -1, -2]) - - def test_norange(self): - self.assertEqual(irange(5, 0), []) - self.assertEqual(irange(1, -1), []) - self.assertEqual(irange(0, 5, -1), []) - -if __name__ == "__main__": - unittest.main() diff --git a/libspud/dxdiff/setup.py b/libspud/dxdiff/setup.py deleted file mode 100644 index d60d901332..0000000000 --- a/libspud/dxdiff/setup.py +++ /dev/null @@ -1,21 +0,0 @@ -from distutils.core import setup -import os -import os.path -import glob - -try: - destdir = os.environ["DESTDIR"] -except KeyError: - destdir = "" - -setup( - name='dxdiff', - version='1.0', - description="An XML aware diff tool.", - author = "The ICOM team", - author_email = "fraser.waters08@imperial.ac.uk", - url = "http://amcg.ese.ic.ac.uk", - packages = ['dxdiff'], - scripts=["dxdiff/dxdiff"], - ) - diff --git a/libspud/examples/Makefile.in b/libspud/examples/Makefile.in deleted file mode 100644 index 48ea3bad91..0000000000 --- a/libspud/examples/Makefile.in +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (C) 2007 Imperial College London and others. -# -# Please see the AUTHORS file in the main source directory for a full list -# of copyright holders. -# -# Applied Modelling and Computation Group -# Department of Earth Science and Engineering -# Imperial College London -# -# David.Ham@Imperial.ac.uk -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation, -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA - -FC = @FC@ -FCFLAGS = -I../include @FCFLAGS@ - -CXX = @CXX@ -I../include -CXXFLAGS= @CPPFLAGS@ @CXXFLAGS@ -I../include - -LIB = ../libspud.a - -HEADERS = ../include/cspud.h ../include/spud.h ../include/spud_config.h ../include/spud_enums.h ../include/tinystr.h ../include/tinyxml.h - -BINARIES=ballistics - -.SUFFIXES: .f90 .F90 .c .cpp .o .a $(.SUFFIXES) - -%.o: %.f90 - $(FC) $(FCFLAGS) -c $< -%.o: %.F90 - $(FC) $(FCFLAGS) -c $< -%.o: %.c - $(CC) $(CFLAGS) -c $< -%.o: %.cpp - $(CXX) $(CXXFLAGS) -c $< - -ballistics: ballistics.o - $(FC) -o $@ $^ -L../ $(LIB) -lstdc++ @PROFILING_FLAG@ - -clean: - rm -f $(BINARIES) - rm -f *.o *.mod *.output diff --git a/libspud/examples/README b/libspud/examples/README deleted file mode 100644 index c3bda61f8e..0000000000 --- a/libspud/examples/README +++ /dev/null @@ -1,66 +0,0 @@ -This directory provides a working example of a rather trivial -simulation program which employs Spud as its options system. - -Ballistics -========== - -Ballistics is a program which simulates projectiles moving under -Newtonian mechanics. The only external forcing is gravity so the -projectiles follow parabolic trajectories. This program has no -scientific use of itself and no attempt has been made to use -sophisticated numerics, error handling or any of the other features -which would form a part of a functional simulation package. The -intention is merely to provide a program with a small number of -configurable options which illustrates each component of the Spud -system. - -Directory contents ------------------- - -* ballistics.F90 - Fortran source of the ballistics simulation. -* ballistics.rnc, ballistics.rng - compact and xml versions of the - ballistics schema file. -* ballistics.xml - sample ballistics options file generated using - diamond and the spud schema. -* show_ballistics - Python script providing a plot of the - ballistic tracks generated. - -Compiling and running ---------------------- - -Having configured and built libspud, it should be sufficient to type -"make" in the current directory. The resulting executable will be -called "ballistics" and can be run as: - -ballistics ballistics.xml - -where ballistics.xml can obviously be replaced by any xml file -conforming to the ballistics.rng schema. - -Specifying model options ------------------------- - -Ballistics has a number of configurable options: the problem name -(used for the output files) can be specified as can the time step, -total simulation time and the acceleration due to gravity. To set any -of these options, run diamond on the xml options file ballistics.xml: - -diamond -s ballistics.rng ballistics.xml - -If you have not installed diamond in your path (see the manual for -installation instructions) then you can run diamond directly from the -source directory with: - -../diamond/bin/diamond -s ballistics.rng ballistics.xml - - -Output ------- - -Ballistics outputs a file called foo.csv where foo is the simulation -name specified in diamond. This file contains the time and the -position of each projectile at each timestep in plain text, comma -separated format. The script "show_ballistics" will plot the -results. This script depends on Python and the Python libraries numpy -and matplotlib. Users who do not wish to install these packages can -examine the output file in any spreadsheet or even in a text editor. diff --git a/libspud/examples/ballistics.F90 b/libspud/examples/ballistics.F90 deleted file mode 100644 index ea0fb681be..0000000000 --- a/libspud/examples/ballistics.F90 +++ /dev/null @@ -1,206 +0,0 @@ -program ballistics - !!< This is a simple program which illustrates the use of spud to drive a - !!< trivial simulation. - use spud - implicit none - - integer, parameter :: D=kind(0.0D0) - - type projectile_type - character(len=256) :: name - real(D), dimension(2) :: velocity - real(D), dimension(2) :: position - ! Whether this projectile is still airbourne. - logical :: active = .true. - end type projectile_type - - ! The list of projectiles to be evolved - type(projectile_type), dimension(:), allocatable :: projectiles - - ! The acceleration due to gravity. - real(D) :: gravity - - real(D) :: current_time, finish_time, dt - - character(len=1024) :: time_integration_scheme - - character(len=1024) :: filename - - integer, parameter :: output_unit=42 - - integer :: i - - !------------------------------------------------------------------------ - ! Program starts here - !------------------------------------------------------------------------ - - ! Read the input file name from the command line. - call read_command_line(filename) - - ! Load the input options into the dictionary. - call load_options(filename) - - call setup_projectiles(projectiles) - - call setup_output_file(projectiles, output_unit) - - call get_option("/timestepping/finish_time", finish_time) - call get_option("/timestepping/dt", dt) - call get_option("/timestepping/time_integration_scheme",& - & time_integration_scheme) - call get_option("/gravity", gravity) - - current_time=0.0 - timeloop: do while (current_time" - - end subroutine usage - - subroutine setup_projectiles(projectiles) - ! Read in the starting positions and velocities of the projectiles. - type(projectile_type), dimension(:), allocatable, intent(inout)& - :: projectiles - - integer :: projectile_count, i - character(len=1024) :: path - - projectile_count=option_count("/projectile") - - allocate(projectiles(projectile_count)) - - do i=1,projectile_count - - write(path, '(a,i0,a)') "/projectile[",i-1,"]" - - call get_option(trim(path)//"/name", projectiles(i)%name) - - call get_option(trim(path)//"/initial_velocity", & - projectiles(i)%velocity) - - ! Note that the launch position is measured along the x axis. - call get_option(trim(path)//"/launch_position", & - projectiles(i)%position(1:1)) - - end do - - end subroutine setup_projectiles - - subroutine setup_output_file(projectiles, output_unit) - ! Open the output file and populate the header line. - type(projectile_type), dimension(:), intent(in) :: projectiles - integer, intent(in) :: output_unit - - character(len=1024) :: output_filename - integer :: i - - call get_option("/simulation_name", output_filename) - - open(unit=output_unit, file=trim(output_filename)//".csv", & - action="write") - - write(output_unit, '(a)', advance="no") "time" - - do i=1,size(projectiles) - write(output_unit, '(a)', advance="no") & - ", "//trim(projectiles(i)%name)//"_x, "& - //trim(projectiles(i)%name)//"_y" - end do - - ! Finish the line. - write(output_unit, '(a)') "" - - end subroutine setup_output_file - - subroutine output_projectile_positions(current_time, projectiles, output_unit) - !!< Simply dump the time and the positions to the output file. - real(D), intent(in) :: current_time - type(projectile_type), dimension(:), intent(in) :: projectiles - integer, intent(in) :: output_unit - - integer :: i - - write(output_unit, '(e15.8,",")', advance="no") current_time - - do i=1,size(projectiles) - write(output_unit, '(2(e15.8,","))', advance="no") projectiles(i)%position - end do - - ! Finish the line. - write(output_unit, '(a)') "" - - end subroutine output_projectile_positions - - subroutine move_projectile(projectile, dt) - !!< Move the current projectile by dt. - type(projectile_type), intent(inout) :: projectile - real(D), intent(in) :: dt - - select case(time_integration_scheme) - - case("explicit_euler") - ! Move the projectile using the existing velocity. - - projectile%position=projectile%position + dt * projectile%velocity - - case("analytic") - ! Move the projectile using s= u*dt + 0.5*a*dt**2 - - projectile%position=projectile%position + dt * projectile%velocity & - & + 0.5_D*dt**2*(/0.0_D, -gravity/) - - case default - write(0,*) "Unknown time integration scheme" - - end select - - ! Calculate the new velocity. - projectile%velocity=projectile%velocity + dt * (/0.0_D, -gravity/) - - ! Deactivate projectiles which touch the ground. - if (projectile%position(2)<=0.0) then - projectile%active=.false. - end if - - end subroutine move_projectile - - -end program ballistics diff --git a/libspud/examples/ballistics.rnc b/libspud/examples/ballistics.rnc deleted file mode 100644 index daba11d663..0000000000 --- a/libspud/examples/ballistics.rnc +++ /dev/null @@ -1,75 +0,0 @@ -include "spud_base.rnc" - -start = - ( - element ballistics_options { - element simulation_name { - ## The name of the simulation. - ## This will be used as the basename of output files. - filename - }, - # Timestepping_options is a named pattern defined below. - # In this case this is used to reduce clutter and increase readability. - timestepping_options, - element gravity { - ## The acceleration due to gravity measured downwards. - ## e.g. 9.8 - real - }, - projectile+, # The + means one or more projectiles. - element geometry { - element dimension { - ## Only 2D simulations are suppored by ballistics. - element integer_value { - attribute rank {"0"}, - "2" - } - } - } - } - ) - -timestepping_options = - ( - element timestepping { - element dt { - ## The length of each timestep. - real - }, - element finish_time { - ## The time at which the simulation should stop. - real - }, - element time_integration_scheme { - ## The algorithm which will be used to move the projectiles. - ## explicit_euler is the first order unstable numeric scheme. - ## analytic is the analytic solution. - element string_value { - # Lines is a hint to the gui about the size of the text box. - # It is not an enforced limit on string length. - attribute lines { "1" }, - ( "explicit_euler" | "analytic" ) - } - } - } - ) - -projectile = - ( - element projectile { - ## An object with a velocity. Projectiles move during the simulation - ## and are accelerated by gravity. - ## - ## The projectile name identifies this projectile in the output. - attribute name { string }, - element initial_velocity { - ## Velocity of the projectile at launch. - real_dim_vector - }, - element launch_position { - ## Position along the x axis at which the projectile begins. - real_dim_minus_one_vector - } - } - ) - diff --git a/libspud/examples/ballistics.rng b/libspud/examples/ballistics.rng deleted file mode 100644 index 7bc1e45293..0000000000 --- a/libspud/examples/ballistics.rng +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - The name of the simulation. -This will be used as the basename of output files. - - - - - - - The acceleration due to gravity measured downwards. -e.g. 9.8 - - - - - - - - - - Only 2D simulations are suppored by ballistics. - - 0 - - 2 - - - - - - - - - - The length of each timestep. - - - - - The time at which the simulation should stop. - - - - - The algorithm which will be used to move the projectiles. -explicit_euler is the first order unstable numeric scheme. -analytic is the analytic solution. - - - 1 - - - explicit_euler - analytic - - - - - - - - - An object with a velocity. Projectiles move during the simulation -and are accelerated by gravity. - -The projectile name identifies this projectile in the output. - - - - - Velocity of the projectile at launch. - - - - - Position along the x axis at which the projectile begins. - - - - - diff --git a/libspud/examples/ballistics.xml b/libspud/examples/ballistics.xml deleted file mode 100644 index f0c32385c4..0000000000 --- a/libspud/examples/ballistics.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - bal1 - - -

- 0.1 -
- - 10 - - - explicit_euler - - - - 10 - - - - 10 10 - - - 10 - - - - - -5 10 - - - 20 - - - - - 2 - - - diff --git a/libspud/examples/show_ballistics b/libspud/examples/show_ballistics deleted file mode 100644 index b177469fba..0000000000 --- a/libspud/examples/show_ballistics +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/python -from optparse import OptionParser -import sys -import numpy -import pylab - -# Script starts here. -optparser=OptionParser(usage='usage: %prog ', - add_help_option=True, - description="""This plots the result of a ballistics simulation """) - -(options, argv) = optparser.parse_args() - -if len(argv)!=1: - optparser.print_help() - sys.exit(1) - -output=file(argv[0], 'r') - -header=output.readline().split(",") - -column_count=len(header) - -projectile_count=(column_count-1)/2 - -data=numpy.fromfile(output, sep=",") - -data=data.reshape(data.size/column_count, column_count) - -for i in range(projectile_count): - pylab.plot(data[:,2*(i+1)-1], data[:,2*(i+1)],'+-') - -pylab.legend([field[:-2] for field in header[1::2]]) - -pylab.show() diff --git a/libspud/include/spud b/libspud/include/spud deleted file mode 100644 index a6d10ada4e..0000000000 --- a/libspud/include/spud +++ /dev/null @@ -1,553 +0,0 @@ -/* Copyright (C) 2006 Imperial College London and others. - - Please see the AUTHORS file in the main source directory for a full list - of copyright holders. - - Prof. C Pain - Applied Modelling and Computation Group - Department of Earth Science and Engineering - Imperial College London - - C.Pain@Imperial.ac.uk - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, - version 2.1 of the License. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - USA -*/ - -#ifndef SPUD_H -#define SPUD_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "tinyxml.h" - -#include "spud_enums.h" - -namespace Spud{ - - typedef char logical_t; - - class OptionManager{ - - public: - - static void clear_options(); - static void* get_manager(); - static void set_manager(void* m); - - static OptionError load_options(const std::string& filename); - static OptionError write_options(const std::string& filename); - - static OptionError get_child_name(const std::string& key, const unsigned& index, std::string& child_name); - - static OptionError get_number_of_children(const std::string& key, int& child_count); - - static int option_count(const std::string& key); - - static logical_t have_option(const std::string& key); - - static OptionError get_option_type(const std::string& key, OptionType& type); - static OptionError get_option_rank(const std::string& key, int& rank); - static OptionError get_option_shape(const std::string& key, std::vector& shape); - - static OptionError get_option(const std::string& key, double& val); - static OptionError get_option(const std::string& key, double& val, const double& default_val); - static OptionError get_option(const std::string& key, std::vector& val); - static OptionError get_option(const std::string& key, std::vector& val, const std::vector& default_val); - static OptionError get_option(const std::string& key, std::vector< std::vector >& val); - static OptionError get_option(const std::string& key, std::vector< std::vector >& val, const std::vector< std::vector >& default_val); - - static OptionError get_option(const std::string& key, int& val); - static OptionError get_option(const std::string& key, int& val, const int& default_val); - static OptionError get_option(const std::string& key, std::vector& val); - static OptionError get_option(const std::string& key, std::vector& val, const std::vector& default_val); - static OptionError get_option(const std::string& key, std::vector< std::vector >& val); - static OptionError get_option(const std::string& key, std::vector< std::vector >& val, const std::vector< std::vector >& default_val); - - static OptionError get_option(const std::string& key, std::string& val); - static OptionError get_option(const std::string& key, std::string& val, const std::string& default_val); - - static OptionError add_option(const std::string& key); - - static OptionError set_option(const std::string& key, const double& val); - static OptionError set_option(const std::string& key, const std::vector& val); - static OptionError set_option(const std::string& key, const std::vector< std::vector >& val); - - static OptionError set_option(const std::string& key, const int& val); - static OptionError set_option(const std::string& key, const std::vector& val); - static OptionError set_option(const std::string& key, const std::vector< std::vector >& val); - - static OptionError set_option(const std::string& key, const std::string& val); - static OptionError set_option_attr(const std::string& key, const std::string& val); - - static OptionError set_option_attribute(const std::string& key, const std::string& val); - - static OptionError move_option(const std::string& key1, const std::string& key2); - static OptionError copy_option(const std::string& key1, const std::string& key2); - - static OptionError delete_option(const std::string& key); - - static void print_options(); - - private: - - OptionManager(); - - OptionManager(const OptionManager& manager); - - ~OptionManager(); - - OptionManager& operator=(const OptionManager& manager); - - static OptionError check_key(const std::string& key); - - static OptionError check_rank(const std::string& key, const int& rank); - - static OptionError check_type(const std::string& key, const OptionType& type); - - static OptionError check_option(const std::string& key, const OptionType& type, const int& rank); - - static OptionManager manager; - - void reset(); - - class Option{ - - public: - - Option(); - - Option(const Option& inOption); - - Option(std::string name); - - ~Option(); - - const Option& operator=(const Option& inOption); - - /** - * Read from an XML file with the given filename. - * Sets the name of this element to be that of the root element in - * the supplied XML file, and adds children to this element - * corresponding to the data in the XML file. - */ - OptionError load_options(const std::string& filename); - /** - * Write out this element and all of its children to an XML file - * with the supplied filename. - */ - OptionError write_options(const std::string& filename) const; - - /** - * Get the name of this element. - */ - std::string get_name() const; - - /** - * Get the attribute status for this element. - */ - logical_t get_is_attribute() const; - - /** - * Generate a list containing the names of the children of the - * element with the supplied key. - */ - void list_children(const std::string& key, std::deque< std::string >& kids) const; - - /** - * Get the child of this element at the supplied key. - * Const version. - */ - const Option* get_child(const std::string& key) const; - /** - * Get the child of this element at the supplied key. - * Non-const version - checks that the child exists, and if it does - * finds it with create_child. - */ - Option* get_child(const std::string& key); - - /** Counts the number of elements with this key. - */ - size_t count(const std::string& key) const; - - /** Finds first element with this key. - */ - std::deque< std::pair >::iterator find(const std::string& key); - std::deque< std::pair >::const_iterator find(const std::string& key) const; - - /** Finds next element with this key after current iterator. - */ - std::deque< std::pair >::iterator - find_next(std::deque< std::pair >::iterator current, const std::string& key); - std::deque< std::pair >::const_iterator - find_next(std::deque< std::pair >::const_iterator current, const std::string& key) const; - - /** - * Get the number of elements at the supplied key. Searches all - * possible paths matching the given key. - */ - int option_count(const std::string& key) const; - - /** - * Test if an element exists at the supplied key. - */ - logical_t have_option(const std::string& key) const; - - /** - * Get the type of the data in this element, or the __value child if - * it exists. - */ - OptionType get_option_type() const; - /** - * Get the rank of the data in this element, or the __value child if - * it exists. - */ - size_t get_option_rank() const; - /** - * Get the shape of the data in this element, or the __value child - * if it exists. - */ - std::vector get_option_shape() const; - - /** - * Get the double data from this element, or from the __value child - * if it exists. - */ - OptionError get_option(std::vector& val) const; - /** - * Get the int data from this element, or from the __value child - * if it exists. - */ - OptionError get_option(std::vector& val) const; - /** - * Get the string data from this element, or from the __value child - * if it exists. - */ - OptionError get_option(std::string& val) const; - - /** - * Get the double data from the supplied key. - */ - OptionError get_option(const std::string& key, std::vector& val) const; - /** - * Get the int data from the supplied key. - */ - OptionError get_option(const std::string& key, std::vector& val) const; - - /** - * Get the string data from the supplied key. - */ - OptionError get_option(const std::string& key, std::string& val) const; - - /** - * Find or add a new element at the supplied key. - */ - OptionError add_option(const std::string& key); - - /** - * Set the data in the element, or in the __value child if it - * exists, with the supplied double data. - */ - OptionError set_option(const std::vector& val, const int& rank, const std::vector& shape); - /** - * Set the data in the element, or in the __value child if it - * exists, with the supplied int data. - */ - OptionError set_option(const std::vector& val, const int& rank, const std::vector& shape); - /** - * Set the data in the element, or in the __value child if it - * exists, with the supplied string data. - */ - OptionError set_option(const std::string& val); - - /** - * Set the data at the supplied key with the supplied double data. - */ - OptionError set_option(const std::string& key, const std::vector& val, const int& rank, const std::vector& shape); - /** - * Set the data at the supplied key with the supplied int data. - */ - OptionError set_option(const std::string& key, const std::vector& val, const int& rank, const std::vector& shape); - /** - * Set the data at the supplied key with the supplied string data. - */ - OptionError set_option(const std::string& key, const std::string& val); - - /** - * Attempt to set the attribute status for this element. - * Only elements with string data and no children may be marked as - * attributes. - */ - logical_t set_is_attribute(const logical_t& is_attribute); - /** - * Set the data at the supplied key with the supplied string data, - * and mark the element as an attribute. - */ - OptionError set_attribute(const std::string& key, const std::string& val); - - /* - * Move an option. - */ - OptionError move_option(const std::string& key1, const std::string& key2); - - /* - * Copy an option. - */ - OptionError copy_option(const std::string& key1, const std::string& key2); - - /** - * Delete the element at the supplied key. - */ - OptionError delete_option(const std::string& key); - - /** - * Print this element to standard output. - */ - void print(const std::string& prefix = "") const; - - /** - * Turn on verbosity for this element (used for debugging only). - */ - void verbose_on(); - /** - * Turn off verbosity for this element. - */ - void verbose_off(); - - private: - - /** - * Finds or creates a new child at the supplied key, and returns - * that child. - * If the parent of a created child is marked as an attribute, - * unmarks it. - */ - Option* create_child(const std::string& key); - - /** - * Set the rank and shape for the data in this element. - */ - OptionError set_rank_and_shape(const int& rank, const std::vector& shape); - /** - * Set the option type for this element, and delete all data of - * other option types. - * If the new option type is not string type and this element is - * marked as an attribute, unmarks it. - */ - OptionError set_option_type(const OptionType& val_type); - - /** - * Parses the supplied TiXmlNode and sets the data and and attribute - * status of this element appropriately. - */ - void parse_node(const std::string& root, const TiXmlNode* node); - /** - * Convert this element into a TiXmlElement. - */ - TiXmlElement* to_element() const; - - /** - * Tokenize the supplied string - */ - void tokenize(const std::string& str, std::vector& tokens, const std::string& delimiters = " ") const; - /** - * Split the supplied key into the highest child name (including its - * index) and key from that sub-child. - */ - OptionError split_name(const std::string& in, std::string& name, std::string& branch) const; - /** - * Split the supplied key in into the highest child name (excluding - * its index), the index of that sub-child, and the key from that - * sub-child. - */ - OptionError split_name(const std::string& in, std::string& name, int& index, std::string& branch) const; - /** - * Split the name of this element into the key (excluding the name - * attribute) and it's name attribute (which may be empty). - */ - void split_node_name(std::string& node_name, std::string& name_attr) const; - - /** - * Converts the data for this element into a string. - */ - std::string data_as_string() const; - - std::string node_name; - std::deque< std::pair > children; - - int rank, shape[2]; - std::vector data_double; - std::vector data_int; - std::string data_string; - - logical_t is_attribute; - - logical_t verbose; - - }; - - static bool deallocated; - Option* options; - - }; - - inline void clear_options(){ - OptionManager::clear_options(); - } - - inline void* get_manager(){ - return OptionManager::get_manager(); - } - - inline void set_manager(void* m){ - OptionManager::set_manager(m); - return; - } - - inline OptionError load_options(const std::string& filename){ - return OptionManager::load_options(filename); - } - - inline OptionError write_options(const std::string& filename){ - return OptionManager::write_options(filename); - } - - inline OptionError get_child_name(const std::string& key, const unsigned& index, std::string& child_name){ - return OptionManager::get_child_name(key, index, child_name); - } - - inline OptionError get_number_of_children(const std::string& key, int& child_count){ - return OptionManager::get_number_of_children(key, child_count); - } - - inline int option_count(const std::string& key){ - return OptionManager::option_count(key); - } - - inline logical_t have_option(const std::string& key){ - return OptionManager::have_option(key); - } - - inline OptionError get_option_type(const std::string& key, OptionType& type){ - return OptionManager::get_option_type(key, type); - } - inline OptionError get_option_rank(const std::string& key, int& rank){ - return OptionManager::get_option_rank(key, rank); - } - inline OptionError get_option_shape(const std::string& key, std::vector& shape){ - return OptionManager::get_option_shape(key, shape); - } - - inline OptionError get_option(const std::string& key, double& val){ - return OptionManager::get_option(key, val); - } - inline OptionError get_option(const std::string& key, double& val, const double& default_val){ - return OptionManager::get_option(key, val, default_val); - } - inline OptionError get_option(const std::string& key, std::vector& val){ - return OptionManager::get_option(key, val); - } - inline OptionError get_option(const std::string& key, std::vector& val, const std::vector& default_val){ - return OptionManager::get_option(key, val, default_val); - } - inline OptionError get_option(const std::string& key, std::vector< std::vector >& val){ - return OptionManager::get_option(key, val); - } - inline OptionError get_option(const std::string& key, std::vector< std::vector >& val, const std::vector< std::vector >& default_val){ - return OptionManager::get_option(key, val, default_val); - } - inline OptionError get_option(const std::string& key, int& val){ - return OptionManager::get_option(key, val); - } - inline OptionError get_option(const std::string& key, int& val, const int& default_val){ - return OptionManager::get_option(key, val, default_val); - } - inline OptionError get_option(const std::string& key, std::vector& val){ - return OptionManager::get_option(key, val); - } - inline OptionError get_option(const std::string& key, std::vector& val, const std::vector& default_val){ - return OptionManager::get_option(key, val, default_val); - } - inline OptionError get_option(const std::string& key, std::vector< std::vector >& val){ - return OptionManager::get_option(key, val); - } - inline OptionError get_option(const std::string& key, std::vector< std::vector >& val, const std::vector< std::vector >& default_val){ - return OptionManager::get_option(key, val, default_val); - } - inline OptionError get_option(const std::string& key, std::string& val){ - return OptionManager::get_option(key, val); - } - inline OptionError get_option(const std::string& key, std::string& val, const std::string& default_val){ - return OptionManager::get_option(key, val, default_val); - } - - inline OptionError add_option(const std::string& key){ - return OptionManager::add_option(key); - } - - inline OptionError set_option(const std::string& key, const double& val){ - return OptionManager::set_option(key, val); - } - inline OptionError set_option(const std::string& key, const std::vector& val){ - return OptionManager::set_option(key, val); - } - inline OptionError set_option(const std::string& key, const std::vector< std::vector >& val){ - return OptionManager::set_option(key, val); - } - inline OptionError set_option(const std::string& key, const int& val){ - return OptionManager::set_option(key, val); - } - inline OptionError set_option(const std::string& key, const std::vector& val){ - return OptionManager::set_option(key, val); - } - inline OptionError set_option(const std::string& key, const std::vector< std::vector >& val){ - return OptionManager::set_option(key, val); - } - inline OptionError set_option(const std::string& key, const std::string& val){ - return OptionManager::set_option(key, val); - } - - inline OptionError set_option_attribute(const std::string& key, const std::string& val){ - return OptionManager::set_option_attribute(key, val); - } - - inline OptionError move_option(const std::string& key1, const std::string& key2){ - return OptionManager::move_option(key1, key2); - } - - inline OptionError copy_option(const std::string& key1, const std::string& key2){ - return OptionManager::copy_option(key1, key2); - } - inline OptionError delete_option(const std::string& key){ - return OptionManager::delete_option(key); - } - - inline void print_options(){ - OptionManager::print_options(); - - return; - } - -} - -#endif diff --git a/libspud/include/spud.h b/libspud/include/spud.h deleted file mode 100644 index 6b3563b71a..0000000000 --- a/libspud/include/spud.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 2006 Imperial College London and others. - - Please see the AUTHORS file in the main source directory for a full list - of copyright holders. - - Prof. C Pain - Applied Modelling and Computation Group - Department of Earth Science and Engineering - Imperial College London - - C.Pain@Imperial.ac.uk - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, - version 2.1 of the License. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - USA -*/ - -#ifndef CSPUD_H -#define CSPUD_H - -#include "spud_enums.h" - -#ifdef __cplusplus -extern "C" { -#endif - - void spud_clear_options(); - void* spud_get_manager(); - void spud_set_manager(void* m); - - int spud_load_options(const char* filename, const int filename_len); - int spud_write_options(const char* filename, const int filename_len); - - int spud_get_child_name(const char* key, const int key_len, const int index, char* child_name, const int child_name_len); - - int spud_get_number_of_children(const char* key, const int key_len, int* child_count); - - int spud_option_count(const char* key, const int key_len); - - int spud_have_option(const char* key, const int key_len); - - int spud_get_option_type(const char* key, const int key_len, int* type); - int spud_get_option_rank(const char* key, const int key_len, int* rank); - int spud_get_option_shape(const char* key, const int key_len, int* shape); - - int spud_get_option(const char* key, const int key_len, void* val); - - int spud_add_option(const char* key, const int key_len); - - int spud_set_option(const char* key, const int key_len, const void* val, const int type, const int rank, const int* shape); - - int spud_set_option_attribute(const char* key, const int key_len, const char* val, const int val_len); - - int spud_move_option(const char* key1, const int key1_len, const char* key2, const int key2_len); - int spud_copy_option(const char* key1, const int key1_len, const char* key2, const int key2_len); - - int spud_delete_option(const char* key, const int key_len); - - void spud_print_options(); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libspud/include/spud_enums.h b/libspud/include/spud_enums.h deleted file mode 100644 index 832945de0e..0000000000 --- a/libspud/include/spud_enums.h +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright (C) 2006 Imperial College London and others. - - Please see the AUTHORS file in the main source directory for a full list - of copyright holders. - - Prof. C Pain - Applied Modelling and Computation Group - Department of Earth Science and Engineering - Imperial College London - - C.Pain@Imperial.ac.uk - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, - version 2.1 of the License. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - USA -*/ - -#ifndef SPUD_ENUMS_H -#define SPUD_ENUMS_H - -#ifdef __cplusplus -namespace Spud{ -#endif - -#ifdef __cplusplus - enum OptionType{ -#else - enum SpudOptionType{ -#endif - SPUD_DOUBLE = 0, - SPUD_INT = 1, - SPUD_NONE = 2, - SPUD_STRING = 3, - }; - -#ifdef __cplusplus - enum OptionError{ -#else - enum SpudOptionError{ -#endif - SPUD_NO_ERROR = 0, - SPUD_KEY_ERROR = 1, - SPUD_TYPE_ERROR = 2, - SPUD_RANK_ERROR = 3, - SPUD_SHAPE_ERROR = 4, - SPUD_FILE_ERROR = 5, - SPUD_NEW_KEY_WARNING = -1, - SPUD_ATTR_SET_FAILED_WARNING = -2, - }; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libspud/include/tinystr.h b/libspud/include/tinystr.h deleted file mode 100644 index 3c2aa9d54d..0000000000 --- a/libspud/include/tinystr.h +++ /dev/null @@ -1,319 +0,0 @@ -/* -www.sourceforge.net/projects/tinyxml -Original file by Yves Berquin. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -/* - * THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005. - * - * - completely rewritten. compact, clean, and fast implementation. - * - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems) - * - fixed reserve() to work as per specification. - * - fixed buggy compares operator==(), operator<(), and operator>() - * - fixed operator+=() to take a const ref argument, following spec. - * - added "copy" constructor with length, and most compare operators. - * - added swap(), clear(), size(), capacity(), operator+(). - */ - -#ifndef TIXML_USE_STL - -#ifndef TIXML_STRING_INCLUDED -#define TIXML_STRING_INCLUDED - -#include -#include - -/* The support for explicit isn't that universal, and it isn't really - required - it is used to check that the TiXmlString class isn't incorrectly - used. Be nice to old compilers and macro it here: -*/ -#if defined(_MSC_VER) && (_MSC_VER >= 1200 ) - // Microsoft visual studio, version 6 and higher. - #define TIXML_EXPLICIT explicit -#elif defined(__GNUC__) && (__GNUC__ >= 3 ) - // GCC version 3 and higher.s - #define TIXML_EXPLICIT explicit -#else - #define TIXML_EXPLICIT -#endif - - -/* - TiXmlString is an emulation of a subset of the std::string template. - Its purpose is to allow compiling TinyXML on compilers with no or poor STL support. - Only the member functions relevant to the TinyXML project have been implemented. - The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase - a string and there's no more room, we allocate a buffer twice as big as we need. -*/ -class TiXmlString -{ - public : - // The size type used - typedef size_t size_type; - - // Error value for find primitive - static const size_type npos; // = -1; - - - // TiXmlString empty constructor - TiXmlString () : rep_(&nullrep_) - { - } - - // TiXmlString copy constructor - TiXmlString ( const TiXmlString & copy) : rep_(0) - { - init(copy.length()); - memcpy(start(), copy.data(), length()); - } - - // TiXmlString constructor, based on a string - TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0) - { - init( static_cast( strlen(copy) )); - memcpy(start(), copy, length()); - } - - // TiXmlString constructor, based on a string - TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0) - { - init(len); - memcpy(start(), str, len); - } - - // TiXmlString destructor - ~TiXmlString () - { - quit(); - } - - // = operator - TiXmlString& operator = (const char * copy) - { - return assign( copy, (size_type)strlen(copy)); - } - - // = operator - TiXmlString& operator = (const TiXmlString & copy) - { - return assign(copy.start(), copy.length()); - } - - - // += operator. Maps to append - TiXmlString& operator += (const char * suffix) - { - return append(suffix, static_cast( strlen(suffix) )); - } - - // += operator. Maps to append - TiXmlString& operator += (char single) - { - return append(&single, 1); - } - - // += operator. Maps to append - TiXmlString& operator += (const TiXmlString & suffix) - { - return append(suffix.data(), suffix.length()); - } - - - // Convert a TiXmlString into a null-terminated char * - const char * c_str () const { return rep_->str; } - - // Convert a TiXmlString into a char * (need not be null terminated). - const char * data () const { return rep_->str; } - - // Return the length of a TiXmlString - size_type length () const { return rep_->size; } - - // Alias for length() - size_type size () const { return rep_->size; } - - // Checks if a TiXmlString is empty - bool empty () const { return rep_->size == 0; } - - // Return capacity of string - size_type capacity () const { return rep_->capacity; } - - - // single char extraction - const char& at (size_type index) const - { - assert( index < length() ); - return rep_->str[ index ]; - } - - // [] operator - char& operator [] (size_type index) const - { - assert( index < length() ); - return rep_->str[ index ]; - } - - // find a char in a string. Return TiXmlString::npos if not found - size_type find (char lookup) const - { - return find(lookup, 0); - } - - // find a char in a string from an offset. Return TiXmlString::npos if not found - size_type find (char tofind, size_type offset) const - { - if (offset >= length()) return npos; - - for (const char* p = c_str() + offset; *p != '\0'; ++p) - { - if (*p == tofind) return static_cast< size_type >( p - c_str() ); - } - return npos; - } - - void clear () - { - //Lee: - //The original was just too strange, though correct: - // TiXmlString().swap(*this); - //Instead use the quit & re-init: - quit(); - init(0,0); - } - - /* Function to reserve a big amount of data when we know we'll need it. Be aware that this - function DOES NOT clear the content of the TiXmlString if any exists. - */ - void reserve (size_type cap); - - TiXmlString& assign (const char* str, size_type len); - - TiXmlString& append (const char* str, size_type len); - - void swap (TiXmlString& other) - { - Rep* r = rep_; - rep_ = other.rep_; - other.rep_ = r; - } - - private: - - void init(size_type sz) { init(sz, sz); } - void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; } - char* start() const { return rep_->str; } - char* finish() const { return rep_->str + rep_->size; } - - struct Rep - { - size_type size, capacity; - char str[1]; - }; - - void init(size_type sz, size_type cap) - { - if (cap) - { - // Lee: the original form: - // rep_ = static_cast(operator new(sizeof(Rep) + cap)); - // doesn't work in some cases of new being overloaded. Switching - // to the normal allocation, although use an 'int' for systems - // that are overly picky about structure alignment. - const size_type bytesNeeded = sizeof(Rep) + cap; - const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int ); - rep_ = reinterpret_cast( new int[ intsNeeded ] ); - - rep_->str[ rep_->size = sz ] = '\0'; - rep_->capacity = cap; - } - else - { - rep_ = &nullrep_; - } - } - - void quit() - { - if (rep_ != &nullrep_) - { - // The rep_ is really an array of ints. (see the allocator, above). - // Cast it back before delete, so the compiler won't incorrectly call destructors. - delete [] ( reinterpret_cast( rep_ ) ); - } - } - - Rep * rep_; - static Rep nullrep_; - -} ; - - -inline bool operator == (const TiXmlString & a, const TiXmlString & b) -{ - return ( a.length() == b.length() ) // optimization on some platforms - && ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare -} -inline bool operator < (const TiXmlString & a, const TiXmlString & b) -{ - return strcmp(a.c_str(), b.c_str()) < 0; -} - -inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); } -inline bool operator > (const TiXmlString & a, const TiXmlString & b) { return b < a; } -inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); } -inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); } - -inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; } -inline bool operator == (const char* a, const TiXmlString & b) { return b == a; } -inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); } -inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); } - -TiXmlString operator + (const TiXmlString & a, const TiXmlString & b); -TiXmlString operator + (const TiXmlString & a, const char* b); -TiXmlString operator + (const char* a, const TiXmlString & b); - - -/* - TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString. - Only the operators that we need for TinyXML have been developped. -*/ -class TiXmlOutStream : public TiXmlString -{ -public : - - // TiXmlOutStream << operator. - TiXmlOutStream & operator << (const TiXmlString & in) - { - *this += in; - return *this; - } - - // TiXmlOutStream << operator. - TiXmlOutStream & operator << (const char * in) - { - *this += in; - return *this; - } - -} ; - -#endif // TIXML_STRING_INCLUDED -#endif // TIXML_USE_STL diff --git a/libspud/include/tinyxml.h b/libspud/include/tinyxml.h deleted file mode 100644 index 1dcd2b4244..0000000000 --- a/libspud/include/tinyxml.h +++ /dev/null @@ -1,1804 +0,0 @@ -/* -www.sourceforge.net/projects/tinyxml -Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - - -#ifndef TINYXML_INCLUDED -#define TINYXML_INCLUDED - -#define TIXML_USE_STL - -#ifdef _MSC_VER -#pragma warning( push ) -#pragma warning( disable : 4530 ) -#pragma warning( disable : 4786 ) -#endif - -#include -#include -#include -#include -#include - -// Help out windows: -#if defined( _DEBUG ) && !defined( DEBUG ) -#define DEBUG -#endif - -#ifdef TIXML_USE_STL - #include - #include - #include - #define TIXML_STRING std::string -#else - #include "tinystr.h" - #define TIXML_STRING TiXmlString -#endif - -// Deprecated library function hell. Compilers want to use the -// new safe versions. This probably doesn't fully address the problem, -// but it gets closer. There are too many compilers for me to fully -// test. If you get compilation troubles, undefine TIXML_SAFE -#define TIXML_SAFE - -#ifdef TIXML_SAFE - #if defined(_MSC_VER) && (_MSC_VER >= 1400 ) - // Microsoft visual studio, version 2005 and higher. - #define TIXML_SNPRINTF _snprintf_s - #define TIXML_SNSCANF _snscanf_s - #define TIXML_SSCANF sscanf_s - #elif defined(_MSC_VER) && (_MSC_VER >= 1200 ) - // Microsoft visual studio, version 6 and higher. - //#pragma message( "Using _sn* functions." ) - #define TIXML_SNPRINTF _snprintf - #define TIXML_SNSCANF _snscanf - #define TIXML_SSCANF sscanf - #elif defined(__GNUC__) && (__GNUC__ >= 3 ) - // GCC version 3 and higher.s - //#warning( "Using sn* functions." ) - #define TIXML_SNPRINTF snprintf - #define TIXML_SNSCANF snscanf - #define TIXML_SSCANF sscanf - #else - #define TIXML_SSCANF sscanf - #endif -#endif - -class TiXmlDocument; -class TiXmlElement; -class TiXmlComment; -class TiXmlUnknown; -class TiXmlAttribute; -class TiXmlText; -class TiXmlDeclaration; -class TiXmlParsingData; - -const int TIXML_MAJOR_VERSION = 2; -const int TIXML_MINOR_VERSION = 5; -const int TIXML_PATCH_VERSION = 3; - -/* Internal structure for tracking location of items - in the XML file. -*/ -struct TiXmlCursor -{ - TiXmlCursor() { Clear(); } - void Clear() { row = col = -1; } - - int row; // 0 based. - int col; // 0 based. -}; - - -/** - If you call the Accept() method, it requires being passed a TiXmlVisitor - class to handle callbacks. For nodes that contain other nodes (Document, Element) - you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves - are simple called with Visit(). - - If you return 'true' from a Visit method, recursive parsing will continue. If you return - false, no children of this node or its sibilings will be Visited. - - All flavors of Visit methods have a default implementation that returns 'true' (continue - visiting). You need to only override methods that are interesting to you. - - Generally Accept() is called on the TiXmlDocument, although all nodes suppert Visiting. - - You should never change the document from a callback. - - @sa TiXmlNode::Accept() -*/ -class TiXmlVisitor -{ -public: - virtual ~TiXmlVisitor() {} - - /// Visit a document. - virtual bool VisitEnter( const TiXmlDocument& /*doc*/ ) { return true; } - /// Visit a document. - virtual bool VisitExit( const TiXmlDocument& /*doc*/ ) { return true; } - - /// Visit an element. - virtual bool VisitEnter( const TiXmlElement& /*element*/, const TiXmlAttribute* /*firstAttribute*/ ) { return true; } - /// Visit an element. - virtual bool VisitExit( const TiXmlElement& /*element*/ ) { return true; } - - /// Visit a declaration - virtual bool Visit( const TiXmlDeclaration& /*declaration*/ ) { return true; } - /// Visit a text node - virtual bool Visit( const TiXmlText& /*text*/ ) { return true; } - /// Visit a comment node - virtual bool Visit( const TiXmlComment& /*comment*/ ) { return true; } - /// Visit an unknow node - virtual bool Visit( const TiXmlUnknown& /*unknown*/ ) { return true; } -}; - -// Only used by Attribute::Query functions -enum -{ - TIXML_SUCCESS, - TIXML_NO_ATTRIBUTE, - TIXML_WRONG_TYPE -}; - - -// Used by the parsing routines. -enum TiXmlEncoding -{ - TIXML_ENCODING_UNKNOWN, - TIXML_ENCODING_UTF8, - TIXML_ENCODING_LEGACY -}; - -const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN; - -/** TiXmlBase is a base class for every class in TinyXml. - It does little except to establish that TinyXml classes - can be printed and provide some utility functions. - - In XML, the document and elements can contain - other elements and other types of nodes. - - @verbatim - A Document can contain: Element (container or leaf) - Comment (leaf) - Unknown (leaf) - Declaration( leaf ) - - An Element can contain: Element (container or leaf) - Text (leaf) - Attributes (not on tree) - Comment (leaf) - Unknown (leaf) - - A Decleration contains: Attributes (not on tree) - @endverbatim -*/ -class TiXmlBase -{ - friend class TiXmlNode; - friend class TiXmlElement; - friend class TiXmlDocument; - -public: - TiXmlBase() : userData(0) {} - virtual ~TiXmlBase() {} - - /** All TinyXml classes can print themselves to a filestream - or the string class (TiXmlString in non-STL mode, std::string - in STL mode.) Either or both cfile and str can be null. - - This is a formatted print, and will insert - tabs and newlines. - - (For an unformatted stream, use the << operator.) - */ - virtual void Print( FILE* cfile, int depth ) const = 0; - - /** The world does not agree on whether white space should be kept or - not. In order to make everyone happy, these global, static functions - are provided to set whether or not TinyXml will condense all white space - into a single space or not. The default is to condense. Note changing this - value is not thread safe. - */ - static void SetCondenseWhiteSpace( bool condense ) { condenseWhiteSpace = condense; } - - /// Return the current white space setting. - static bool IsWhiteSpaceCondensed() { return condenseWhiteSpace; } - - /** Return the position, in the original source file, of this node or attribute. - The row and column are 1-based. (That is the first row and first column is - 1,1). If the returns values are 0 or less, then the parser does not have - a row and column value. - - Generally, the row and column value will be set when the TiXmlDocument::Load(), - TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set - when the DOM was created from operator>>. - - The values reflect the initial load. Once the DOM is modified programmatically - (by adding or changing nodes and attributes) the new values will NOT update to - reflect changes in the document. - - There is a minor performance cost to computing the row and column. Computation - can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value. - - @sa TiXmlDocument::SetTabSize() - */ - int Row() const { return location.row + 1; } - int Column() const { return location.col + 1; } ///< See Row() - - void SetUserData( void* user ) { userData = user; } ///< Set a pointer to arbitrary user data. - void* GetUserData() { return userData; } ///< Get a pointer to arbitrary user data. - const void* GetUserData() const { return userData; } ///< Get a pointer to arbitrary user data. - - // Table that returs, for a given lead byte, the total number of bytes - // in the UTF-8 sequence. - static const int utf8ByteTable[256]; - - virtual const char* Parse( const char* p, - TiXmlParsingData* data, - TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0; - - /** Expands entities in a string. Note this should not contian the tag's '<', '>', etc, - or they will be transformed into entities! - */ - static void EncodeString( const TIXML_STRING& str, TIXML_STRING* out ); - - enum - { - TIXML_NO_ERROR = 0, - TIXML_ERROR, - TIXML_ERROR_OPENING_FILE, - TIXML_ERROR_OUT_OF_MEMORY, - TIXML_ERROR_PARSING_ELEMENT, - TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, - TIXML_ERROR_READING_ELEMENT_VALUE, - TIXML_ERROR_READING_ATTRIBUTES, - TIXML_ERROR_PARSING_EMPTY, - TIXML_ERROR_READING_END_TAG, - TIXML_ERROR_PARSING_UNKNOWN, - TIXML_ERROR_PARSING_COMMENT, - TIXML_ERROR_PARSING_DECLARATION, - TIXML_ERROR_DOCUMENT_EMPTY, - TIXML_ERROR_EMBEDDED_NULL, - TIXML_ERROR_PARSING_CDATA, - TIXML_ERROR_DOCUMENT_TOP_ONLY, - - TIXML_ERROR_STRING_COUNT - }; - -protected: - - static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding ); - inline static bool IsWhiteSpace( char c ) - { - return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); - } - inline static bool IsWhiteSpace( int c ) - { - if ( c < 256 ) - return IsWhiteSpace( (char) c ); - return false; // Again, only truly correct for English/Latin...but usually works. - } - - #ifdef TIXML_USE_STL - static bool StreamWhiteSpace( std::istream * in, TIXML_STRING * tag ); - static bool StreamTo( std::istream * in, int character, TIXML_STRING * tag ); - #endif - - /* Reads an XML name into the string provided. Returns - a pointer just past the last character of the name, - or 0 if the function has an error. - */ - static const char* ReadName( const char* p, TIXML_STRING* name, TiXmlEncoding encoding ); - - /* Reads text. Returns a pointer past the given end tag. - Wickedly complex options, but it keeps the (sensitive) code in one place. - */ - static const char* ReadText( const char* in, // where to start - TIXML_STRING* text, // the string read - bool ignoreWhiteSpace, // whether to keep the white space - const char* endTag, // what ends this text - bool ignoreCase, // whether to ignore case in the end tag - TiXmlEncoding encoding ); // the current encoding - - // If an entity has been found, transform it into a character. - static const char* GetEntity( const char* in, char* value, int* length, TiXmlEncoding encoding ); - - // Get a character, while interpreting entities. - // The length can be from 0 to 4 bytes. - inline static const char* GetChar( const char* p, char* _value, int* length, TiXmlEncoding encoding ) - { - assert( p ); - if ( encoding == TIXML_ENCODING_UTF8 ) - { - *length = utf8ByteTable[ *((const unsigned char*)p) ]; - assert( *length >= 0 && *length < 5 ); - } - else - { - *length = 1; - } - - if ( *length == 1 ) - { - if ( *p == '&' ) - return GetEntity( p, _value, length, encoding ); - *_value = *p; - return p+1; - } - else if ( *length ) - { - //strncpy( _value, p, *length ); // lots of compilers don't like this function (unsafe), - // and the null terminator isn't needed - for( int i=0; p[i] && i<*length; ++i ) { - _value[i] = p[i]; - } - return p + (*length); - } - else - { - // Not valid text. - return 0; - } - } - - // Return true if the next characters in the stream are any of the endTag sequences. - // Ignore case only works for english, and should only be relied on when comparing - // to English words: StringEqual( p, "version", true ) is fine. - static bool StringEqual( const char* p, - const char* endTag, - bool ignoreCase, - TiXmlEncoding encoding ); - - static const char* errorString[ TIXML_ERROR_STRING_COUNT ]; - - TiXmlCursor location; - - /// Field containing a generic user pointer - void* userData; - - // None of these methods are reliable for any language except English. - // Good for approximation, not great for accuracy. - static int IsAlpha( unsigned char anyByte, TiXmlEncoding encoding ); - static int IsAlphaNum( unsigned char anyByte, TiXmlEncoding encoding ); - inline static int ToLower( int v, TiXmlEncoding encoding ) - { - if ( encoding == TIXML_ENCODING_UTF8 ) - { - if ( v < 128 ) return tolower( v ); - return v; - } - else - { - return tolower( v ); - } - } - static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ); - -private: - TiXmlBase( const TiXmlBase& ); // not implemented. - void operator=( const TiXmlBase& base ); // not allowed. - - struct Entity - { - const char* str; - unsigned int strLength; - char chr; - }; - enum - { - NUM_ENTITY = 5, - MAX_ENTITY_LENGTH = 6 - - }; - static Entity entity[ NUM_ENTITY ]; - static bool condenseWhiteSpace; -}; - - -/** The parent class for everything in the Document Object Model. - (Except for attributes). - Nodes have siblings, a parent, and children. A node can be - in a document, or stand on its own. The type of a TiXmlNode - can be queried, and it can be cast to its more defined type. -*/ -class TiXmlNode : public TiXmlBase -{ - friend class TiXmlDocument; - friend class TiXmlElement; - -public: - #ifdef TIXML_USE_STL - - /** An input stream operator, for every class. Tolerant of newlines and - formatting, but doesn't expect them. - */ - friend std::istream& operator >> (std::istream& in, TiXmlNode& base); - - /** An output stream operator, for every class. Note that this outputs - without any newlines or formatting, as opposed to Print(), which - includes tabs and new lines. - - The operator<< and operator>> are not completely symmetric. Writing - a node to a stream is very well defined. You'll get a nice stream - of output, without any extra whitespace or newlines. - - But reading is not as well defined. (As it always is.) If you create - a TiXmlElement (for example) and read that from an input stream, - the text needs to define an element or junk will result. This is - true of all input streams, but it's worth keeping in mind. - - A TiXmlDocument will read nodes until it reads a root element, and - all the children of that root element. - */ - friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base); - - /// Appends the XML node or attribute to a std::string. - friend std::string& operator<< (std::string& out, const TiXmlNode& base ); - - #endif - - /** The types of XML nodes supported by TinyXml. (All the - unsupported types are picked up by UNKNOWN.) - */ - enum NodeType - { - DOCUMENT, - ELEMENT, - COMMENT, - UNKNOWN, - TEXT, - DECLARATION, - TYPECOUNT - }; - - virtual ~TiXmlNode(); - - /** The meaning of 'value' changes for the specific type of - TiXmlNode. - @verbatim - Document: filename of the xml file - Element: name of the element - Comment: the comment text - Unknown: the tag contents - Text: the text string - @endverbatim - - The subclasses will wrap this function. - */ - const char *Value() const { return value.c_str (); } - - #ifdef TIXML_USE_STL - /** Return Value() as a std::string. If you only use STL, - this is more efficient than calling Value(). - Only available in STL mode. - */ - const std::string& ValueStr() const { return value; } - #endif - - const TIXML_STRING& ValueTStr() const { return value; } - - /** Changes the value of the node. Defined as: - @verbatim - Document: filename of the xml file - Element: name of the element - Comment: the comment text - Unknown: the tag contents - Text: the text string - @endverbatim - */ - void SetValue(const char * _value) { value = _value;} - - #ifdef TIXML_USE_STL - /// STL std::string form. - void SetValue( const std::string& _value ) { value = _value; } - #endif - - /// Delete all the children of this node. Does not affect 'this'. - void Clear(); - - /// One step up the DOM. - TiXmlNode* Parent() { return parent; } - const TiXmlNode* Parent() const { return parent; } - - const TiXmlNode* FirstChild() const { return firstChild; } ///< The first child of this node. Will be null if there are no children. - TiXmlNode* FirstChild() { return firstChild; } - const TiXmlNode* FirstChild( const char * value ) const; ///< The first child of this node with the matching 'value'. Will be null if none found. - /// The first child of this node with the matching 'value'. Will be null if none found. - TiXmlNode* FirstChild( const char * _value ) { - // Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe) - // call the method, cast the return back to non-const. - return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->FirstChild( _value )); - } - const TiXmlNode* LastChild() const { return lastChild; } /// The last child of this node. Will be null if there are no children. - TiXmlNode* LastChild() { return lastChild; } - - const TiXmlNode* LastChild( const char * value ) const; /// The last child of this node matching 'value'. Will be null if there are no children. - TiXmlNode* LastChild( const char * _value ) { - return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->LastChild( _value )); - } - - #ifdef TIXML_USE_STL - const TiXmlNode* FirstChild( const std::string& _value ) const { return FirstChild (_value.c_str ()); } ///< STL std::string form. - TiXmlNode* FirstChild( const std::string& _value ) { return FirstChild (_value.c_str ()); } ///< STL std::string form. - const TiXmlNode* LastChild( const std::string& _value ) const { return LastChild (_value.c_str ()); } ///< STL std::string form. - TiXmlNode* LastChild( const std::string& _value ) { return LastChild (_value.c_str ()); } ///< STL std::string form. - #endif - - /** An alternate way to walk the children of a node. - One way to iterate over nodes is: - @verbatim - for( child = parent->FirstChild(); child; child = child->NextSibling() ) - @endverbatim - - IterateChildren does the same thing with the syntax: - @verbatim - child = 0; - while( child = parent->IterateChildren( child ) ) - @endverbatim - - IterateChildren takes the previous child as input and finds - the next one. If the previous child is null, it returns the - first. IterateChildren will return null when done. - */ - const TiXmlNode* IterateChildren( const TiXmlNode* previous ) const; - TiXmlNode* IterateChildren( const TiXmlNode* previous ) { - return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( previous ) ); - } - - /// This flavor of IterateChildren searches for children with a particular 'value' - const TiXmlNode* IterateChildren( const char * value, const TiXmlNode* previous ) const; - TiXmlNode* IterateChildren( const char * _value, const TiXmlNode* previous ) { - return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( _value, previous ) ); - } - - #ifdef TIXML_USE_STL - const TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) const { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. - TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. - #endif - - /** Add a new node related to this. Adds a child past the LastChild. - Returns a pointer to the new object or NULL if an error occured. - */ - TiXmlNode* InsertEndChild( const TiXmlNode& addThis ); - - - /** Add a new node related to this. Adds a child past the LastChild. - - NOTE: the node to be added is passed by pointer, and will be - henceforth owned (and deleted) by tinyXml. This method is efficient - and avoids an extra copy, but should be used with care as it - uses a different memory model than the other insert functions. - - @sa InsertEndChild - */ - TiXmlNode* LinkEndChild( TiXmlNode* addThis ); - - /** Add a new node related to this. Adds a child before the specified child. - Returns a pointer to the new object or NULL if an error occured. - */ - TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ); - - /** Add a new node related to this. Adds a child after the specified child. - Returns a pointer to the new object or NULL if an error occured. - */ - TiXmlNode* InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ); - - /** Replace a child of this node. - Returns a pointer to the new object or NULL if an error occured. - */ - TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ); - - /// Delete a child of this node. - bool RemoveChild( TiXmlNode* removeThis ); - - /// Navigate to a sibling node. - const TiXmlNode* PreviousSibling() const { return prev; } - TiXmlNode* PreviousSibling() { return prev; } - - /// Navigate to a sibling node. - const TiXmlNode* PreviousSibling( const char * ) const; - TiXmlNode* PreviousSibling( const char *_prev ) { - return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->PreviousSibling( _prev ) ); - } - - #ifdef TIXML_USE_STL - const TiXmlNode* PreviousSibling( const std::string& _value ) const { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. - TiXmlNode* PreviousSibling( const std::string& _value ) { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. - const TiXmlNode* NextSibling( const std::string& _value) const { return NextSibling (_value.c_str ()); } ///< STL std::string form. - TiXmlNode* NextSibling( const std::string& _value) { return NextSibling (_value.c_str ()); } ///< STL std::string form. - #endif - - /// Navigate to a sibling node. - const TiXmlNode* NextSibling() const { return next; } - TiXmlNode* NextSibling() { return next; } - - /// Navigate to a sibling node with the given 'value'. - const TiXmlNode* NextSibling( const char * ) const; - TiXmlNode* NextSibling( const char* _next ) { - return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->NextSibling( _next ) ); - } - - /** Convenience function to get through elements. - Calls NextSibling and ToElement. Will skip all non-Element - nodes. Returns 0 if there is not another element. - */ - const TiXmlElement* NextSiblingElement() const; - TiXmlElement* NextSiblingElement() { - return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement() ); - } - - /** Convenience function to get through elements. - Calls NextSibling and ToElement. Will skip all non-Element - nodes. Returns 0 if there is not another element. - */ - const TiXmlElement* NextSiblingElement( const char * ) const; - TiXmlElement* NextSiblingElement( const char *_next ) { - return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement( _next ) ); - } - - #ifdef TIXML_USE_STL - const TiXmlElement* NextSiblingElement( const std::string& _value) const { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. - TiXmlElement* NextSiblingElement( const std::string& _value) { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. - #endif - - /// Convenience function to get through elements. - const TiXmlElement* FirstChildElement() const; - TiXmlElement* FirstChildElement() { - return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement() ); - } - - /// Convenience function to get through elements. - const TiXmlElement* FirstChildElement( const char * _value ) const; - TiXmlElement* FirstChildElement( const char * _value ) { - return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement( _value ) ); - } - - #ifdef TIXML_USE_STL - const TiXmlElement* FirstChildElement( const std::string& _value ) const { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. - TiXmlElement* FirstChildElement( const std::string& _value ) { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. - #endif - - /** Query the type (as an enumerated value, above) of this node. - The possible types are: DOCUMENT, ELEMENT, COMMENT, - UNKNOWN, TEXT, and DECLARATION. - */ - int Type() const { return type; } - - /** Return a pointer to the Document this node lives in. - Returns null if not in a document. - */ - const TiXmlDocument* GetDocument() const; - TiXmlDocument* GetDocument() { - return const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(this))->GetDocument() ); - } - - /// Returns true if this node has no children. - bool NoChildren() const { return !firstChild; } - - virtual const TiXmlDocument* ToDocument() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual const TiXmlElement* ToElement() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual const TiXmlComment* ToComment() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual const TiXmlUnknown* ToUnknown() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual const TiXmlText* ToText() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual const TiXmlDeclaration* ToDeclaration() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - - virtual TiXmlDocument* ToDocument() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual TiXmlElement* ToElement() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual TiXmlComment* ToComment() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual TiXmlUnknown* ToUnknown() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual TiXmlText* ToText() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - virtual TiXmlDeclaration* ToDeclaration() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. - - /** Create an exact duplicate of this node and return it. The memory must be deleted - by the caller. - */ - virtual TiXmlNode* Clone() const = 0; - - /** Accept a hierchical visit the nodes in the TinyXML DOM. Every node in the - XML tree will be conditionally visited and the host will be called back - via the TiXmlVisitor interface. - - This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse - the XML for the callbacks, so the performance of TinyXML is unchanged by using this - interface versus any other.) - - The interface has been based on ideas from: - - - http://www.saxproject.org/ - - http://c2.com/cgi/wiki?HierarchicalVisitorPattern - - Which are both good references for "visiting". - - An example of using Accept(): - @verbatim - TiXmlPrinter printer; - tinyxmlDoc.Accept( &printer ); - const char* xmlcstr = printer.CStr(); - @endverbatim - */ - virtual bool Accept( TiXmlVisitor* visitor ) const = 0; - -protected: - TiXmlNode( NodeType _type ); - - // Copy to the allocated object. Shared functionality between Clone, Copy constructor, - // and the assignment operator. - void CopyTo( TiXmlNode* target ) const; - - #ifdef TIXML_USE_STL - // The real work of the input operator. - virtual void StreamIn( std::istream* in, TIXML_STRING* tag ) = 0; - #endif - - // Figure out what is at *p, and parse it. Returns null if it is not an xml node. - TiXmlNode* Identify( const char* start, TiXmlEncoding encoding ); - - TiXmlNode* parent; - NodeType type; - - TiXmlNode* firstChild; - TiXmlNode* lastChild; - - TIXML_STRING value; - - TiXmlNode* prev; - TiXmlNode* next; - -private: - TiXmlNode( const TiXmlNode& ); // not implemented. - void operator=( const TiXmlNode& base ); // not allowed. -}; - - -/** An attribute is a name-value pair. Elements have an arbitrary - number of attributes, each with a unique name. - - @note The attributes are not TiXmlNodes, since they are not - part of the tinyXML document object model. There are other - suggested ways to look at this problem. -*/ -class TiXmlAttribute : public TiXmlBase -{ - friend class TiXmlAttributeSet; - -public: - /// Construct an empty attribute. - TiXmlAttribute() : TiXmlBase() - { - document = 0; - prev = next = 0; - } - - #ifdef TIXML_USE_STL - /// std::string constructor. - TiXmlAttribute( const std::string& _name, const std::string& _value ) - { - name = _name; - value = _value; - document = 0; - prev = next = 0; - } - #endif - - /// Construct an attribute with a name and value. - TiXmlAttribute( const char * _name, const char * _value ) - { - name = _name; - value = _value; - document = 0; - prev = next = 0; - } - - const char* Name() const { return name.c_str(); } ///< Return the name of this attribute. - const char* Value() const { return value.c_str(); } ///< Return the value of this attribute. - #ifdef TIXML_USE_STL - const std::string& ValueStr() const { return value; } ///< Return the value of this attribute. - #endif - int IntValue() const; ///< Return the value of this attribute, converted to an integer. - double DoubleValue() const; ///< Return the value of this attribute, converted to a double. - - // Get the tinyxml string representation - const TIXML_STRING& NameTStr() const { return name; } - - /** QueryIntValue examines the value string. It is an alternative to the - IntValue() method with richer error checking. - If the value is an integer, it is stored in 'value' and - the call returns TIXML_SUCCESS. If it is not - an integer, it returns TIXML_WRONG_TYPE. - - A specialized but useful call. Note that for success it returns 0, - which is the opposite of almost all other TinyXml calls. - */ - int QueryIntValue( int* _value ) const; - /// QueryDoubleValue examines the value string. See QueryIntValue(). - int QueryDoubleValue( double* _value ) const; - - void SetName( const char* _name ) { name = _name; } ///< Set the name of this attribute. - void SetValue( const char* _value ) { value = _value; } ///< Set the value. - - void SetIntValue( int _value ); ///< Set the value from an integer. - void SetDoubleValue( double _value ); ///< Set the value from a double. - - #ifdef TIXML_USE_STL - /// STL std::string form. - void SetName( const std::string& _name ) { name = _name; } - /// STL std::string form. - void SetValue( const std::string& _value ) { value = _value; } - #endif - - /// Get the next sibling attribute in the DOM. Returns null at end. - const TiXmlAttribute* Next() const; - TiXmlAttribute* Next() { - return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Next() ); - } - - /// Get the previous sibling attribute in the DOM. Returns null at beginning. - const TiXmlAttribute* Previous() const; - TiXmlAttribute* Previous() { - return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Previous() ); - } - - bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; } - bool operator<( const TiXmlAttribute& rhs ) const { return name < rhs.name; } - bool operator>( const TiXmlAttribute& rhs ) const { return name > rhs.name; } - - /* Attribute parsing starts: first letter of the name - returns: the next char after the value end quote - */ - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - - // Prints this Attribute to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const { - Print( cfile, depth, 0 ); - } - void Print( FILE* cfile, int depth, TIXML_STRING* str ) const; - - // [internal use] - // Set the document pointer so the attribute can report errors. - void SetDocument( TiXmlDocument* doc ) { document = doc; } - -private: - TiXmlAttribute( const TiXmlAttribute& ); // not implemented. - void operator=( const TiXmlAttribute& base ); // not allowed. - - TiXmlDocument* document; // A pointer back to a document, for error reporting. - TIXML_STRING name; - TIXML_STRING value; - TiXmlAttribute* prev; - TiXmlAttribute* next; -}; - - -/* A class used to manage a group of attributes. - It is only used internally, both by the ELEMENT and the DECLARATION. - - The set can be changed transparent to the Element and Declaration - classes that use it, but NOT transparent to the Attribute - which has to implement a next() and previous() method. Which makes - it a bit problematic and prevents the use of STL. - - This version is implemented with circular lists because: - - I like circular lists - - it demonstrates some independence from the (typical) doubly linked list. -*/ -class TiXmlAttributeSet -{ -public: - TiXmlAttributeSet(); - ~TiXmlAttributeSet(); - - void Add( TiXmlAttribute* attribute ); - void Remove( TiXmlAttribute* attribute ); - - const TiXmlAttribute* First() const { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } - TiXmlAttribute* First() { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } - const TiXmlAttribute* Last() const { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } - TiXmlAttribute* Last() { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } - - const TiXmlAttribute* Find( const char* _name ) const; - TiXmlAttribute* Find( const char* _name ) { - return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) ); - } - #ifdef TIXML_USE_STL - const TiXmlAttribute* Find( const std::string& _name ) const; - TiXmlAttribute* Find( const std::string& _name ) { - return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) ); - } - - #endif - -private: - //*ME: Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element), - //*ME: this class must be also use a hidden/disabled copy-constructor !!! - TiXmlAttributeSet( const TiXmlAttributeSet& ); // not allowed - void operator=( const TiXmlAttributeSet& ); // not allowed (as TiXmlAttribute) - - TiXmlAttribute sentinel; -}; - - -/** The element is a container class. It has a value, the element name, - and can contain other elements, text, comments, and unknowns. - Elements also contain an arbitrary number of attributes. -*/ -class TiXmlElement : public TiXmlNode -{ -public: - /// Construct an element. - TiXmlElement (const char * in_value); - - #ifdef TIXML_USE_STL - /// std::string constructor. - TiXmlElement( const std::string& _value ); - #endif - - TiXmlElement( const TiXmlElement& ); - - void operator=( const TiXmlElement& base ); - - virtual ~TiXmlElement(); - - /** Given an attribute name, Attribute() returns the value - for the attribute of that name, or null if none exists. - */ - const char* Attribute( const char* name ) const; - - /** Given an attribute name, Attribute() returns the value - for the attribute of that name, or null if none exists. - If the attribute exists and can be converted to an integer, - the integer value will be put in the return 'i', if 'i' - is non-null. - */ - const char* Attribute( const char* name, int* i ) const; - - /** Given an attribute name, Attribute() returns the value - for the attribute of that name, or null if none exists. - If the attribute exists and can be converted to an double, - the double value will be put in the return 'd', if 'd' - is non-null. - */ - const char* Attribute( const char* name, double* d ) const; - - /** QueryIntAttribute examines the attribute - it is an alternative to the - Attribute() method with richer error checking. - If the attribute is an integer, it is stored in 'value' and - the call returns TIXML_SUCCESS. If it is not - an integer, it returns TIXML_WRONG_TYPE. If the attribute - does not exist, then TIXML_NO_ATTRIBUTE is returned. - */ - int QueryIntAttribute( const char* name, int* _value ) const; - /// QueryDoubleAttribute examines the attribute - see QueryIntAttribute(). - int QueryDoubleAttribute( const char* name, double* _value ) const; - /// QueryFloatAttribute examines the attribute - see QueryIntAttribute(). - int QueryFloatAttribute( const char* name, float* _value ) const { - double d; - int result = QueryDoubleAttribute( name, &d ); - if ( result == TIXML_SUCCESS ) { - *_value = (float)d; - } - return result; - } - - #ifdef TIXML_USE_STL - /** Template form of the attribute query which will try to read the - attribute into the specified type. Very easy, very powerful, but - be careful to make sure to call this with the correct type. - - NOTE: This method doesn't work correctly for 'string' types. - - @return TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE - */ - template< typename T > int QueryValueAttribute( const std::string& name, T* outValue ) const - { - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( !node ) - return TIXML_NO_ATTRIBUTE; - - std::stringstream sstream( node->ValueStr() ); - sstream >> *outValue; - if ( !sstream.fail() ) - return TIXML_SUCCESS; - return TIXML_WRONG_TYPE; - } - /* - This is - in theory - a bug fix for "QueryValueAtribute returns truncated std::string" - but template specialization is hard to get working cross-compiler. Leaving the bug for now. - - // The above will fail for std::string because the space character is used as a seperator. - // Specialize for strings. Bug [ 1695429 ] QueryValueAtribute returns truncated std::string - template<> int QueryValueAttribute( const std::string& name, std::string* outValue ) const - { - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( !node ) - return TIXML_NO_ATTRIBUTE; - *outValue = node->ValueStr(); - return TIXML_SUCCESS; - } - */ - #endif - - /** Sets an attribute of name to a given value. The attribute - will be created if it does not exist, or changed if it does. - */ - void SetAttribute( const char* name, const char * _value ); - - #ifdef TIXML_USE_STL - const std::string* Attribute( const std::string& name ) const; - const std::string* Attribute( const std::string& name, int* i ) const; - const std::string* Attribute( const std::string& name, double* d ) const; - int QueryIntAttribute( const std::string& name, int* _value ) const; - int QueryDoubleAttribute( const std::string& name, double* _value ) const; - - /// STL std::string form. - void SetAttribute( const std::string& name, const std::string& _value ); - ///< STL std::string form. - void SetAttribute( const std::string& name, int _value ); - #endif - - /** Sets an attribute of name to a given value. The attribute - will be created if it does not exist, or changed if it does. - */ - void SetAttribute( const char * name, int value ); - - /** Sets an attribute of name to a given value. The attribute - will be created if it does not exist, or changed if it does. - */ - void SetDoubleAttribute( const char * name, double value ); - - /** Deletes an attribute with the given name. - */ - void RemoveAttribute( const char * name ); - #ifdef TIXML_USE_STL - void RemoveAttribute( const std::string& name ) { RemoveAttribute (name.c_str ()); } ///< STL std::string form. - #endif - - const TiXmlAttribute* FirstAttribute() const { return attributeSet.First(); } ///< Access the first attribute in this element. - TiXmlAttribute* FirstAttribute() { return attributeSet.First(); } - const TiXmlAttribute* LastAttribute() const { return attributeSet.Last(); } ///< Access the last attribute in this element. - TiXmlAttribute* LastAttribute() { return attributeSet.Last(); } - - /** Convenience function for easy access to the text inside an element. Although easy - and concise, GetText() is limited compared to getting the TiXmlText child - and accessing it directly. - - If the first child of 'this' is a TiXmlText, the GetText() - returns the character string of the Text node, else null is returned. - - This is a convenient method for getting the text of simple contained text: - @verbatim - This is text - const char* str = fooElement->GetText(); - @endverbatim - - 'str' will be a pointer to "This is text". - - Note that this function can be misleading. If the element foo was created from - this XML: - @verbatim - This is text - @endverbatim - - then the value of str would be null. The first child node isn't a text node, it is - another element. From this XML: - @verbatim - This is text - @endverbatim - GetText() will return "This is ". - - WARNING: GetText() accesses a child node - don't become confused with the - similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are - safe type casts on the referenced node. - */ - const char* GetText() const; - - /// Creates a new Element and returns it - the returned element is a copy. - virtual TiXmlNode* Clone() const; - // Print the Element to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const; - - /* Attribtue parsing starts: next char past '<' - returns: next char past '>' - */ - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - - virtual const TiXmlElement* ToElement() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - virtual TiXmlElement* ToElement() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - - /** Walk the XML tree visiting this node and all of its children. - */ - virtual bool Accept( TiXmlVisitor* visitor ) const; - -protected: - - void CopyTo( TiXmlElement* target ) const; - void ClearThis(); // like clear, but initializes 'this' object as well - - // Used to be public [internal use] - #ifdef TIXML_USE_STL - virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); - #endif - /* [internal use] - Reads the "value" of the element -- another element, or text. - This should terminate with the current end tag. - */ - const char* ReadValue( const char* in, TiXmlParsingData* prevData, TiXmlEncoding encoding ); - -private: - - TiXmlAttributeSet attributeSet; -}; - - -/** An XML comment. -*/ -class TiXmlComment : public TiXmlNode -{ -public: - /// Constructs an empty comment. - TiXmlComment() : TiXmlNode( TiXmlNode::COMMENT ) {} - /// Construct a comment from text. - TiXmlComment( const char* _value ) : TiXmlNode( TiXmlNode::COMMENT ) { - SetValue( _value ); - } - TiXmlComment( const TiXmlComment& ); - void operator=( const TiXmlComment& base ); - - virtual ~TiXmlComment() {} - - /// Returns a copy of this Comment. - virtual TiXmlNode* Clone() const; - // Write this Comment to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const; - - /* Attribtue parsing starts: at the ! of the !-- - returns: next char past '>' - */ - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - - virtual const TiXmlComment* ToComment() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - virtual TiXmlComment* ToComment() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - - /** Walk the XML tree visiting this node and all of its children. - */ - virtual bool Accept( TiXmlVisitor* visitor ) const; - -protected: - void CopyTo( TiXmlComment* target ) const; - - // used to be public - #ifdef TIXML_USE_STL - virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); - #endif -// virtual void StreamOut( TIXML_OSTREAM * out ) const; - -private: - -}; - - -/** XML text. A text node can have 2 ways to output the next. "normal" output - and CDATA. It will default to the mode it was parsed from the XML file and - you generally want to leave it alone, but you can change the output mode with - SetCDATA() and query it with CDATA(). -*/ -class TiXmlText : public TiXmlNode -{ - friend class TiXmlElement; -public: - /** Constructor for text element. By default, it is treated as - normal, encoded text. If you want it be output as a CDATA text - element, set the parameter _cdata to 'true' - */ - TiXmlText (const char * initValue ) : TiXmlNode (TiXmlNode::TEXT) - { - SetValue( initValue ); - cdata = false; - } - virtual ~TiXmlText() {} - - #ifdef TIXML_USE_STL - /// Constructor. - TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT) - { - SetValue( initValue ); - cdata = false; - } - #endif - - TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TEXT ) { copy.CopyTo( this ); } - void operator=( const TiXmlText& base ) { base.CopyTo( this ); } - - // Write this text object to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const; - - /// Queries whether this represents text using a CDATA section. - bool CDATA() const { return cdata; } - /// Turns on or off a CDATA representation of text. - void SetCDATA( bool _cdata ) { cdata = _cdata; } - - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - - virtual const TiXmlText* ToText() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - virtual TiXmlText* ToText() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - - /** Walk the XML tree visiting this node and all of its children. - */ - virtual bool Accept( TiXmlVisitor* content ) const; - -protected : - /// [internal use] Creates a new Element and returns it. - virtual TiXmlNode* Clone() const; - void CopyTo( TiXmlText* target ) const; - - bool Blank() const; // returns true if all white space and new lines - // [internal use] - #ifdef TIXML_USE_STL - virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); - #endif - -private: - bool cdata; // true if this should be input and output as a CDATA style text element -}; - - -/** In correct XML the declaration is the first entry in the file. - @verbatim - - @endverbatim - - TinyXml will happily read or write files without a declaration, - however. There are 3 possible attributes to the declaration: - version, encoding, and standalone. - - Note: In this version of the code, the attributes are - handled as special cases, not generic attributes, simply - because there can only be at most 3 and they are always the same. -*/ -class TiXmlDeclaration : public TiXmlNode -{ -public: - /// Construct an empty declaration. - TiXmlDeclaration() : TiXmlNode( TiXmlNode::DECLARATION ) {} - -#ifdef TIXML_USE_STL - /// Constructor. - TiXmlDeclaration( const std::string& _version, - const std::string& _encoding, - const std::string& _standalone ); -#endif - - /// Construct. - TiXmlDeclaration( const char* _version, - const char* _encoding, - const char* _standalone ); - - TiXmlDeclaration( const TiXmlDeclaration& copy ); - void operator=( const TiXmlDeclaration& copy ); - - virtual ~TiXmlDeclaration() {} - - /// Version. Will return an empty string if none was found. - const char *Version() const { return version.c_str (); } - /// Encoding. Will return an empty string if none was found. - const char *Encoding() const { return encoding.c_str (); } - /// Is this a standalone document? - const char *Standalone() const { return standalone.c_str (); } - - /// Creates a copy of this Declaration and returns it. - virtual TiXmlNode* Clone() const; - // Print this declaration to a FILE stream. - virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const; - virtual void Print( FILE* cfile, int depth ) const { - Print( cfile, depth, 0 ); - } - - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - - virtual const TiXmlDeclaration* ToDeclaration() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - virtual TiXmlDeclaration* ToDeclaration() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - - /** Walk the XML tree visiting this node and all of its children. - */ - virtual bool Accept( TiXmlVisitor* visitor ) const; - -protected: - void CopyTo( TiXmlDeclaration* target ) const; - // used to be public - #ifdef TIXML_USE_STL - virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); - #endif - -private: - - TIXML_STRING version; - TIXML_STRING encoding; - TIXML_STRING standalone; -}; - - -/** Any tag that tinyXml doesn't recognize is saved as an - unknown. It is a tag of text, but should not be modified. - It will be written back to the XML, unchanged, when the file - is saved. - - DTD tags get thrown into TiXmlUnknowns. -*/ -class TiXmlUnknown : public TiXmlNode -{ -public: - TiXmlUnknown() : TiXmlNode( TiXmlNode::UNKNOWN ) {} - virtual ~TiXmlUnknown() {} - - TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::UNKNOWN ) { copy.CopyTo( this ); } - void operator=( const TiXmlUnknown& copy ) { copy.CopyTo( this ); } - - /// Creates a copy of this Unknown and returns it. - virtual TiXmlNode* Clone() const; - // Print this Unknown to a FILE stream. - virtual void Print( FILE* cfile, int depth ) const; - - virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); - - virtual const TiXmlUnknown* ToUnknown() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - virtual TiXmlUnknown* ToUnknown() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - - /** Walk the XML tree visiting this node and all of its children. - */ - virtual bool Accept( TiXmlVisitor* content ) const; - -protected: - void CopyTo( TiXmlUnknown* target ) const; - - #ifdef TIXML_USE_STL - virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); - #endif - -private: - -}; - - -/** Always the top level node. A document binds together all the - XML pieces. It can be saved, loaded, and printed to the screen. - The 'value' of a document node is the xml file name. -*/ -class TiXmlDocument : public TiXmlNode -{ -public: - /// Create an empty document, that has no name. - TiXmlDocument(); - /// Create a document with a name. The name of the document is also the filename of the xml. - TiXmlDocument( const char * documentName ); - - #ifdef TIXML_USE_STL - /// Constructor. - TiXmlDocument( const std::string& documentName ); - #endif - - TiXmlDocument( const TiXmlDocument& copy ); - void operator=( const TiXmlDocument& copy ); - - virtual ~TiXmlDocument() {} - - /** Load a file using the current document value. - Returns true if successful. Will delete any existing - document data before loading. - */ - bool LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); - /// Save a file using the current document value. Returns true if successful. - bool SaveFile() const; - /// Load a file using the given filename. Returns true if successful. - bool LoadFile( const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); - /// Save a file using the given filename. Returns true if successful. - bool SaveFile( const char * filename ) const; - /** Load a file using the given FILE*. Returns true if successful. Note that this method - doesn't stream - the entire object pointed at by the FILE* - will be interpreted as an XML file. TinyXML doesn't stream in XML from the current - file location. Streaming may be added in the future. - */ - bool LoadFile( FILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); - /// Save a file using the given FILE*. Returns true if successful. - bool SaveFile( FILE* ) const; - - #ifdef TIXML_USE_STL - bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ) ///< STL std::string version. - { -// StringToBuffer f( filename ); -// return ( f.buffer && LoadFile( f.buffer, encoding )); - return LoadFile( filename.c_str(), encoding ); - } - bool SaveFile( const std::string& filename ) const ///< STL std::string version. - { -// StringToBuffer f( filename ); -// return ( f.buffer && SaveFile( f.buffer )); - return SaveFile( filename.c_str() ); - } - #endif - - /** Parse the given null terminated block of xml data. Passing in an encoding to this - method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml - to use that encoding, regardless of what TinyXml might otherwise try to detect. - */ - virtual const char* Parse( const char* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); - - /** Get the root element -- the only top level element -- of the document. - In well formed XML, there should only be one. TinyXml is tolerant of - multiple elements at the document level. - */ - const TiXmlElement* RootElement() const { return FirstChildElement(); } - TiXmlElement* RootElement() { return FirstChildElement(); } - - /** If an error occurs, Error will be set to true. Also, - - The ErrorId() will contain the integer identifier of the error (not generally useful) - - The ErrorDesc() method will return the name of the error. (very useful) - - The ErrorRow() and ErrorCol() will return the location of the error (if known) - */ - bool Error() const { return error; } - - /// Contains a textual (english) description of the error if one occurs. - const char * ErrorDesc() const { return errorDesc.c_str (); } - - /** Generally, you probably want the error string ( ErrorDesc() ). But if you - prefer the ErrorId, this function will fetch it. - */ - int ErrorId() const { return errorId; } - - /** Returns the location (if known) of the error. The first column is column 1, - and the first row is row 1. A value of 0 means the row and column wasn't applicable - (memory errors, for example, have no row/column) or the parser lost the error. (An - error in the error reporting, in that case.) - - @sa SetTabSize, Row, Column - */ - int ErrorRow() const { return errorLocation.row+1; } - int ErrorCol() const { return errorLocation.col+1; } ///< The column where the error occured. See ErrorRow() - - /** SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) - to report the correct values for row and column. It does not change the output - or input in any way. - - By calling this method, with a tab size - greater than 0, the row and column of each node and attribute is stored - when the file is loaded. Very useful for tracking the DOM back in to - the source file. - - The tab size is required for calculating the location of nodes. If not - set, the default of 4 is used. The tabsize is set per document. Setting - the tabsize to 0 disables row/column tracking. - - Note that row and column tracking is not supported when using operator>>. - - The tab size needs to be enabled before the parse or load. Correct usage: - @verbatim - TiXmlDocument doc; - doc.SetTabSize( 8 ); - doc.Load( "myfile.xml" ); - @endverbatim - - @sa Row, Column - */ - void SetTabSize( int _tabsize ) { tabsize = _tabsize; } - - int TabSize() const { return tabsize; } - - /** If you have handled the error, it can be reset with this call. The error - state is automatically cleared if you Parse a new XML block. - */ - void ClearError() { error = false; - errorId = 0; - errorDesc = ""; - errorLocation.row = errorLocation.col = 0; - //errorLocation.last = 0; - } - - /** Write the document to standard out using formatted printing ("pretty print"). */ - void Print() const { Print( stdout, 0 ); } - - /* Write the document to a string using formatted printing ("pretty print"). This - will allocate a character array (new char[]) and return it as a pointer. The - calling code pust call delete[] on the return char* to avoid a memory leak. - */ - //char* PrintToMemory() const; - - /// Print this Document to a FILE stream. - virtual void Print( FILE* cfile, int depth = 0 ) const; - // [internal use] - void SetError( int err, const char* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding ); - - virtual const TiXmlDocument* ToDocument() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - virtual TiXmlDocument* ToDocument() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. - - /** Walk the XML tree visiting this node and all of its children. - */ - virtual bool Accept( TiXmlVisitor* content ) const; - -protected : - // [internal use] - virtual TiXmlNode* Clone() const; - #ifdef TIXML_USE_STL - virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); - #endif - -private: - void CopyTo( TiXmlDocument* target ) const; - - bool error; - int errorId; - TIXML_STRING errorDesc; - int tabsize; - TiXmlCursor errorLocation; - bool useMicrosoftBOM; // the UTF-8 BOM were found when read. Note this, and try to write. -}; - - -/** - A TiXmlHandle is a class that wraps a node pointer with null checks; this is - an incredibly useful thing. Note that TiXmlHandle is not part of the TinyXml - DOM structure. It is a separate utility class. - - Take an example: - @verbatim - - - - - - - @endverbatim - - Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very - easy to write a *lot* of code that looks like: - - @verbatim - TiXmlElement* root = document.FirstChildElement( "Document" ); - if ( root ) - { - TiXmlElement* element = root->FirstChildElement( "Element" ); - if ( element ) - { - TiXmlElement* child = element->FirstChildElement( "Child" ); - if ( child ) - { - TiXmlElement* child2 = child->NextSiblingElement( "Child" ); - if ( child2 ) - { - // Finally do something useful. - @endverbatim - - And that doesn't even cover "else" cases. TiXmlHandle addresses the verbosity - of such code. A TiXmlHandle checks for null pointers so it is perfectly safe - and correct to use: - - @verbatim - TiXmlHandle docHandle( &document ); - TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement(); - if ( child2 ) - { - // do something useful - @endverbatim - - Which is MUCH more concise and useful. - - It is also safe to copy handles - internally they are nothing more than node pointers. - @verbatim - TiXmlHandle handleCopy = handle; - @endverbatim - - What they should not be used for is iteration: - - @verbatim - int i=0; - while ( true ) - { - TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).ToElement(); - if ( !child ) - break; - // do something - ++i; - } - @endverbatim - - It seems reasonable, but it is in fact two embedded while loops. The Child method is - a linear walk to find the element, so this code would iterate much more than it needs - to. Instead, prefer: - - @verbatim - TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).ToElement(); - - for( child; child; child=child->NextSiblingElement() ) - { - // do something - } - @endverbatim -*/ -class TiXmlHandle -{ -public: - /// Create a handle from any node (at any depth of the tree.) This can be a null pointer. - TiXmlHandle( TiXmlNode* _node ) { this->node = _node; } - /// Copy constructor - TiXmlHandle( const TiXmlHandle& ref ) { this->node = ref.node; } - TiXmlHandle operator=( const TiXmlHandle& ref ) { this->node = ref.node; return *this; } - - /// Return a handle to the first child node. - TiXmlHandle FirstChild() const; - /// Return a handle to the first child node with the given name. - TiXmlHandle FirstChild( const char * value ) const; - /// Return a handle to the first child element. - TiXmlHandle FirstChildElement() const; - /// Return a handle to the first child element with the given name. - TiXmlHandle FirstChildElement( const char * value ) const; - - /** Return a handle to the "index" child with the given name. - The first child is 0, the second 1, etc. - */ - TiXmlHandle Child( const char* value, int index ) const; - /** Return a handle to the "index" child. - The first child is 0, the second 1, etc. - */ - TiXmlHandle Child( int index ) const; - /** Return a handle to the "index" child element with the given name. - The first child element is 0, the second 1, etc. Note that only TiXmlElements - are indexed: other types are not counted. - */ - TiXmlHandle ChildElement( const char* value, int index ) const; - /** Return a handle to the "index" child element. - The first child element is 0, the second 1, etc. Note that only TiXmlElements - are indexed: other types are not counted. - */ - TiXmlHandle ChildElement( int index ) const; - - #ifdef TIXML_USE_STL - TiXmlHandle FirstChild( const std::string& _value ) const { return FirstChild( _value.c_str() ); } - TiXmlHandle FirstChildElement( const std::string& _value ) const { return FirstChildElement( _value.c_str() ); } - - TiXmlHandle Child( const std::string& _value, int index ) const { return Child( _value.c_str(), index ); } - TiXmlHandle ChildElement( const std::string& _value, int index ) const { return ChildElement( _value.c_str(), index ); } - #endif - - /** Return the handle as a TiXmlNode. This may return null. - */ - TiXmlNode* ToNode() const { return node; } - /** Return the handle as a TiXmlElement. This may return null. - */ - TiXmlElement* ToElement() const { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); } - /** Return the handle as a TiXmlText. This may return null. - */ - TiXmlText* ToText() const { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); } - /** Return the handle as a TiXmlUnknown. This may return null. - */ - TiXmlUnknown* ToUnknown() const { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); } - - /** @deprecated use ToNode. - Return the handle as a TiXmlNode. This may return null. - */ - TiXmlNode* Node() const { return ToNode(); } - /** @deprecated use ToElement. - Return the handle as a TiXmlElement. This may return null. - */ - TiXmlElement* Element() const { return ToElement(); } - /** @deprecated use ToText() - Return the handle as a TiXmlText. This may return null. - */ - TiXmlText* Text() const { return ToText(); } - /** @deprecated use ToUnknown() - Return the handle as a TiXmlUnknown. This may return null. - */ - TiXmlUnknown* Unknown() const { return ToUnknown(); } - -private: - TiXmlNode* node; -}; - - -/** Print to memory functionality. The TiXmlPrinter is useful when you need to: - - -# Print to memory (especially in non-STL mode) - -# Control formatting (line endings, etc.) - - When constructed, the TiXmlPrinter is in its default "pretty printing" mode. - Before calling Accept() you can call methods to control the printing - of the XML document. After TiXmlNode::Accept() is called, the printed document can - be accessed via the CStr(), Str(), and Size() methods. - - TiXmlPrinter uses the Visitor API. - @verbatim - TiXmlPrinter printer; - printer.SetIndent( "\t" ); - - doc.Accept( &printer ); - fprintf( stdout, "%s", printer.CStr() ); - @endverbatim -*/ -class TiXmlPrinter : public TiXmlVisitor -{ -public: - TiXmlPrinter() : depth( 0 ), simpleTextPrint( false ), - buffer(), indent( " " ), lineBreak( "\n" ) {} - - virtual bool VisitEnter( const TiXmlDocument& doc ); - virtual bool VisitExit( const TiXmlDocument& doc ); - - virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ); - virtual bool VisitExit( const TiXmlElement& element ); - - virtual bool Visit( const TiXmlDeclaration& declaration ); - virtual bool Visit( const TiXmlText& text ); - virtual bool Visit( const TiXmlComment& comment ); - virtual bool Visit( const TiXmlUnknown& unknown ); - - /** Set the indent characters for printing. By default 4 spaces - but tab (\t) is also useful, or null/empty string for no indentation. - */ - void SetIndent( const char* _indent ) { indent = _indent ? _indent : "" ; } - /// Query the indention string. - const char* Indent() { return indent.c_str(); } - /** Set the line breaking string. By default set to newline (\n). - Some operating systems prefer other characters, or can be - set to the null/empty string for no indenation. - */ - void SetLineBreak( const char* _lineBreak ) { lineBreak = _lineBreak ? _lineBreak : ""; } - /// Query the current line breaking string. - const char* LineBreak() { return lineBreak.c_str(); } - - /** Switch over to "stream printing" which is the most dense formatting without - linebreaks. Common when the XML is needed for network transmission. - */ - void SetStreamPrinting() { indent = ""; - lineBreak = ""; - } - /// Return the result. - const char* CStr() { return buffer.c_str(); } - /// Return the length of the result string. - size_t Size() { return buffer.size(); } - - #ifdef TIXML_USE_STL - /// Return the result. - const std::string& Str() { return buffer; } - #endif - -private: - void DoIndent() { - for( int i=0; i&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test -z "$d" && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/libspud/ltmain.sh b/libspud/ltmain.sh deleted file mode 100644 index aa5624c816..0000000000 --- a/libspud/ltmain.sh +++ /dev/null @@ -1,9636 +0,0 @@ - -# libtool (GNU libtool) 2.4 -# Written by Gordon Matzigkeit , 1996 - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . -# GNU libtool home page: . -# General help using GNU software: . - -PROGRAM=libtool -PACKAGE=libtool -VERSION=2.4 -TIMESTAMP="" -package_revision=1.3293 - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# NLS nuisances: We save the old values to restore during execute mode. -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" - fi" -done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL - -$lt_unset CDPATH - - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - - - -: ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SED="/bin/sed"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} -: ${Xsed="$SED -e 1s/^X//"} - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -exit_status=$EXIT_SUCCESS - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" - -dirname="s,/[^/]*$,," -basename="s,^.*/,," - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} # func_dirname may be replaced by extended shell implementation - - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$basename"` -} # func_basename may be replaced by extended shell implementation - - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` -} # func_dirname_and_basename may be replaced by extended shell implementation - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname may be replaced by extended shell implementation - - -# These SED scripts presuppose an absolute path with a trailing slash. -pathcar='s,^/\([^/]*\).*$,\1,' -pathcdr='s,^/[^/]*,,' -removedotparts=':dotsl - s@/\./@/@g - t dotsl - s,/\.$,/,' -collapseslashes='s@/\{1,\}@/@g' -finalslash='s,/*$,/,' - -# func_normal_abspath PATH -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -# value returned in "$func_normal_abspath_result" -func_normal_abspath () -{ - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` - while :; do - # Processed it all yet? - if test "$func_normal_abspath_tpath" = / ; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result" ; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - -# func_relative_path SRCDIR DSTDIR -# generates a relative path from SRCDIR to DSTDIR, with a trailing -# slash if non-empty, suitable for immediately appending a filename -# without needing to append a separator. -# value returned in "$func_relative_path_result" -func_relative_path () -{ - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=${func_dirname_result} - if test "x$func_relative_path_tlibdir" = x ; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test "x$func_stripname_result" != x ; then - func_relative_path_result=${func_relative_path_result}/${func_stripname_result} - fi - - # Normalisation. If bindir is libdir, return empty string, - # else relative path ending with a slash; either way, target - # file name can be directly appended. - if test ! -z "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result/" - func_relative_path_result=$func_stripname_result - fi -} - -# The name of this program: -func_dirname_and_basename "$progpath" -progname=$func_basename_result - -# Make sure we have an absolute path for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=$func_dirname_result - progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" - ;; - *) - save_IFS="$IFS" - IFS=: - for progdir in $PATH; do - IFS="$save_IFS" - test -x "$progdir/$progname" && break - done - IFS="$save_IFS" - test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([`"$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' - -# Sed substitution that converts a w32 file name or path -# which contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - -# Re-`\' parameter expansions in output of double_quote_subst that were -# `\'-ed in input to the same. If an odd number of `\' preceded a '$' -# in input to double_quote_subst, that '$' was protected from expansion. -# Since each input `\' is now two `\'s, look for any number of runs of -# four `\'s followed by two `\'s and then a '$'. `\' that '$'. -bs='\\' -bs2='\\\\' -bs4='\\\\\\\\' -dollar='\$' -sed_double_backslash="\ - s/$bs4/&\\ -/g - s/^$bs2$dollar/$bs&/ - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g - s/\n//g" - -# Standard options: -opt_dry_run=false -opt_help=false -opt_quiet=false -opt_verbose=false -opt_warning=: - -# func_echo arg... -# Echo program name prefixed message, along with the current mode -# name if it has been set yet. -func_echo () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }$*" -} - -# func_verbose arg... -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $opt_verbose && func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 -} - -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 - - # bash bug again: - : -} - -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" -} -help="Try \`$progname --help' for more information." ## default - - -# func_grep expression filename -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_mkdir_p directory-path -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - my_directory_path="$1" - my_dir_list= - - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" - - # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` - done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" - - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} - - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "$my_tmpdir" -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () -{ - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac - - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac -} - - -# func_quote_for_expand arg -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac - - case $my_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac - - func_quote_for_expand_result="$my_arg" -} - - -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - -# func_tr_sh -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac -} - - -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $opt_debug - - $SED -n '/(C)/!b go - :more - /\./!{ - N - s/\n# / / - b more - } - :go - /^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} - -# func_usage -# Echo short help message to standard output and exit. -func_usage () -{ - $opt_debug - - $SED -n '/^# Usage:/,/^# *.*--help/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - echo - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. -func_help () -{ - $opt_debug - - $SED -n '/^# Usage:/,/# Report bugs to/ { - :print - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - s*\$LTCFLAGS*'"$LTCFLAGS"'* - s*\$LD*'"$LD"'* - s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ - p - d - } - /^# .* home page:/b print - /^# General help using/b print - ' < "$progpath" - ret=$? - if test -z "$1"; then - exit $ret - fi -} - -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - $opt_debug - - func_error "missing argument for $1." - exit_cmd=exit -} - - -# func_split_short_opt shortopt -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -func_split_short_opt () -{ - my_sed_short_opt='1s/^\(..\).*$/\1/;q' - my_sed_short_rest='1s/^..\(.*\)$/\1/;q' - - func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` - func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` -} # func_split_short_opt may be replaced by extended shell implementation - - -# func_split_long_opt longopt -# Set func_split_long_opt_name and func_split_long_opt_arg shell -# variables after splitting LONGOPT at the `=' sign. -func_split_long_opt () -{ - my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' - my_sed_long_arg='1s/^--[^=]*=//' - - func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` - func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` -} # func_split_long_opt may be replaced by extended shell implementation - -exit_cmd=: - - - - - -magic="%%%MAGIC variable%%%" -magic_exe="%%%MAGIC EXE variable%%%" - -# Global variables. -nonopt= -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "${1}=\$${1}\${2}" -} # func_append may be replaced by extended shell implementation - -# func_append_quoted var value -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -func_append_quoted () -{ - func_quote_for_eval "${2}" - eval "${1}=\$${1}\\ \$func_quote_for_eval_result" -} # func_append_quoted may be replaced by extended shell implementation - - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "${@}"` -} # func_arith may be replaced by extended shell implementation - - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` -} # func_len may be replaced by extended shell implementation - - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} # func_lo2o may be replaced by extended shell implementation - - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` -} # func_xform may be replaced by extended shell implementation - - -# func_fatal_configuration arg... -# Echo program name prefixed message to standard error, followed by -# a configuration failure hint, and exit. -func_fatal_configuration () -{ - func_error ${1+"$@"} - func_error "See the $PACKAGE documentation for more information." - func_fatal_error "Fatal configuration error." -} - - -# func_config -# Display the configuration for all the tags in this script. -func_config () -{ - re_begincf='^# ### BEGIN LIBTOOL' - re_endcf='^# ### END LIBTOOL' - - # Default configuration. - $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" - - # Now print the configurations for the tags. - for tagname in $taglist; do - $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" - done - - exit $? -} - -# func_features -# Display the features supported by this script. -func_features () -{ - echo "host: $host" - if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - - exit $? -} - -# func_enable_tag tagname -# Verify that TAGNAME is valid, and either flag an error and exit, or -# enable the TAGNAME tag. We also add TAGNAME to the global $taglist -# variable here. -func_enable_tag () -{ - # Global variable: - tagname="$1" - - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf="/$re_begincf/,/$re_endcf/p" - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac - - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; - *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" - - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac -} - -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF - fi - - exit $EXIT_MISMATCH - fi -} - - -# Shorthand for --mode=foo, only valid as the first argument -case $1 in -clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; -compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; -execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; -finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; -install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; -link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; -uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; -esac - - - -# Option defaults: -opt_debug=: -opt_dry_run=false -opt_config=false -opt_preserve_dup_deps=false -opt_features=false -opt_finish=false -opt_help=false -opt_help_all=false -opt_silent=: -opt_verbose=: -opt_silent=false -opt_verbose=false - - -# Parse options once, thoroughly. This comes as soon as possible in the -# script to make things like `--version' happen as quickly as we can. -{ - # this just eases exit handling - while test $# -gt 0; do - opt="$1" - shift - case $opt in - --debug|-x) opt_debug='set -x' - func_echo "enabling shell trace mode" - $opt_debug - ;; - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - --config) - opt_config=: -func_config - ;; - --dlopen|-dlopen) - optarg="$1" - opt_dlopen="${opt_dlopen+$opt_dlopen -}$optarg" - shift - ;; - --preserve-dup-deps) - opt_preserve_dup_deps=: - ;; - --features) - opt_features=: -func_features - ;; - --finish) - opt_finish=: -set dummy --mode finish ${1+"$@"}; shift - ;; - --help) - opt_help=: - ;; - --help-all) - opt_help_all=: -opt_help=': help-all' - ;; - --mode) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_mode="$optarg" -case $optarg in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; -esac - shift - ;; - --no-silent|--no-quiet) - opt_silent=false -func_append preserve_args " $opt" - ;; - --no-verbose) - opt_verbose=false -func_append preserve_args " $opt" - ;; - --silent|--quiet) - opt_silent=: -func_append preserve_args " $opt" - opt_verbose=false - ;; - --verbose|-v) - opt_verbose=: -func_append preserve_args " $opt" -opt_silent=false - ;; - --tag) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_tag="$optarg" -func_append preserve_args " $opt $optarg" -func_enable_tag "$optarg" - shift - ;; - - -\?|-h) func_usage ;; - --help) func_help ;; - --version) func_version ;; - - # Separate optargs to long options: - --*=*) - func_split_long_opt "$opt" - set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-n*|-v*) - func_split_short_opt "$opt" - set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognized option \`$opt'" ;; - *) set dummy "$opt" ${1+"$@"}; shift; break ;; - esac - done - - # Validate options: - - # save first non-option argument - if test "$#" -gt 0; then - nonopt="$opt" - shift - fi - - # preserve --debug - test "$opt_debug" = : || func_append preserve_args " --debug" - - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac - - $opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test "$opt_mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$opt_mode' for more information." - } - - - # Bail if the options were screwed - $exit_cmd $EXIT_FAILURE -} - - - - -## ----------- ## -## Main. ## -## ----------- ## - -# func_lalib_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_lalib_p () -{ - test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} - -# func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function implements the same check as func_lalib_p without -# resorting to external programs. To this end, it redirects stdin and -# closes it afterwards, without saving the original file descriptor. -# As a safety measure, use it only where a negative result would be -# fatal anyway. Works if `file' does not exist. -func_lalib_unsafe_p () -{ - lalib_p=no - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then - for lalib_p_l in 1 2 3 4 - do - read lalib_p_line - case "$lalib_p_line" in - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; - esac - done - exec 0<&5 5<&- - fi - test "$lalib_p" = yes -} - -# func_ltwrapper_script_p file -# True iff FILE is a libtool wrapper script -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_script_p () -{ - func_lalib_p "$1" -} - -# func_ltwrapper_executable_p file -# True iff FILE is a libtool wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_executable_p () -{ - func_ltwrapper_exec_suffix= - case $1 in - *.exe) ;; - *) func_ltwrapper_exec_suffix=.exe ;; - esac - $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 -} - -# func_ltwrapper_scriptname file -# Assumes file is an ltwrapper_executable -# uses $file to determine the appropriate filename for a -# temporary ltwrapper_script. -func_ltwrapper_scriptname () -{ - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" -} - -# func_ltwrapper_p file -# True iff FILE is a libtool wrapper script or wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_p () -{ - func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" -} - - -# func_execute_cmds commands fail_cmd -# Execute tilde-delimited COMMANDS. -# If FAIL_CMD is given, eval that upon failure. -# FAIL_CMD may read-access the current command in variable CMD! -func_execute_cmds () -{ - $opt_debug - save_ifs=$IFS; IFS='~' - for cmd in $1; do - IFS=$save_ifs - eval cmd=\"$cmd\" - func_show_eval "$cmd" "${2-:}" - done - IFS=$save_ifs -} - - -# func_source file -# Source FILE, adding directory component if necessary. -# Note that it is not necessary on cygwin/mingw to append a dot to -# FILE even if both FILE and FILE.exe exist: automatic-append-.exe -# behavior happens only for exec(3), not for open(2)! Also, sourcing -# `FILE.' does not work on cygwin managed mounts. -func_source () -{ - $opt_debug - case $1 in - */* | *\\*) . "$1" ;; - *) . "./$1" ;; - esac -} - - -# func_resolve_sysroot PATH -# Replace a leading = in PATH with a sysroot. Store the result into -# func_resolve_sysroot_result -func_resolve_sysroot () -{ - func_resolve_sysroot_result=$1 - case $func_resolve_sysroot_result in - =*) - func_stripname '=' '' "$func_resolve_sysroot_result" - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result - ;; - esac -} - -# func_replace_sysroot PATH -# If PATH begins with the sysroot, replace it with = and -# store the result into func_replace_sysroot_result. -func_replace_sysroot () -{ - case "$lt_sysroot:$1" in - ?*:"$lt_sysroot"*) - func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result="=$func_stripname_result" - ;; - *) - # Including no sysroot. - func_replace_sysroot_result=$1 - ;; - esac -} - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - $opt_debug - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac - fi -} - - - -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' - else - write_lobj=none - fi - - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then - func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$lt_sed_naive_backslashify"` - else - func_convert_core_file_wine_to_w32_result= - fi - fi -} -# end: func_convert_core_file_wine_to_w32 - - -# func_convert_core_path_wine_to_w32 ARG -# Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. -# -# ARG is path to be converted from $build format to win32. -# Result is available in $func_convert_core_path_wine_to_w32_result. -# Unconvertible file (directory) names in ARG are skipped; if no directory names -# are convertible, then the result may be empty. -func_convert_core_path_wine_to_w32 () -{ - $opt_debug - # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result="" - if test -n "$1"; then - oldIFS=$IFS - IFS=: - for func_convert_core_path_wine_to_w32_f in $1; do - IFS=$oldIFS - func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result" ; then - if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" - else - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" - fi - fi - done - IFS=$oldIFS - fi -} -# end: func_convert_core_path_wine_to_w32 - - -# func_cygpath ARGS... -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or -# (2), returns the Cygwin file name or path in func_cygpath_result (input -# file name or path is assumed to be in w32 format, as previously converted -# from $build's *nix or MSYS format). In case (3), returns the w32 file name -# or path in func_cygpath_result (input file name or path is assumed to be in -# Cygwin format). Returns an empty string on error. -# -# ARGS are passed to cygpath, with the last one being the file name or path to -# be converted. -# -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH -# environment variable; do not put it in $PATH. -func_cygpath () -{ - $opt_debug - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` - if test "$?" -ne 0; then - # on failure, ensure result is empty - func_cygpath_result= - fi - else - func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" - fi -} -#end: func_cygpath - - -# func_convert_core_msys_to_w32 ARG -# Convert file name or path ARG from MSYS format to w32 format. Return -# result in func_convert_core_msys_to_w32_result. -func_convert_core_msys_to_w32 () -{ - $opt_debug - # awkward: cmd appends spaces to result - func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` -} -#end: func_convert_core_msys_to_w32 - - -# func_convert_file_check ARG1 ARG2 -# Verify that ARG1 (a file name in $build format) was converted to $host -# format in ARG2. Otherwise, emit an error message, but continue (resetting -# func_to_host_file_result to ARG1). -func_convert_file_check () -{ - $opt_debug - if test -z "$2" && test -n "$1" ; then - func_error "Could not determine host file name corresponding to" - func_error " \`$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_file_result="$1" - fi -} -# end func_convert_file_check - - -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH -# Verify that FROM_PATH (a path in $build format) was converted to $host -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting -# func_to_host_file_result to a simplistic fallback value (see below). -func_convert_path_check () -{ - $opt_debug - if test -z "$4" && test -n "$3"; then - func_error "Could not determine the host path corresponding to" - func_error " \`$3'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This is a deliberately simplistic "conversion" and - # should not be "improved". See libtool.info. - if test "x$1" != "x$2"; then - lt_replace_pathsep_chars="s|$1|$2|g" - func_to_host_path_result=`echo "$3" | - $SED -e "$lt_replace_pathsep_chars"` - else - func_to_host_path_result="$3" - fi - fi -} -# end func_convert_path_check - - -# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG -# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT -# and appending REPL if ORIG matches BACKPAT. -func_convert_path_front_back_pathsep () -{ - $opt_debug - case $4 in - $1 ) func_to_host_path_result="$3$func_to_host_path_result" - ;; - esac - case $4 in - $2 ) func_append func_to_host_path_result "$3" - ;; - esac -} -# end func_convert_path_front_back_pathsep - - -################################################## -# $build to $host FILE NAME CONVERSION FUNCTIONS # -################################################## -# invoked via `$to_host_file_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# Result will be available in $func_to_host_file_result. - - -# func_to_host_file ARG -# Converts the file name ARG from $build format to $host format. Return result -# in func_to_host_file_result. -func_to_host_file () -{ - $opt_debug - $to_host_file_cmd "$1" -} -# end func_to_host_file - - -# func_to_tool_file ARG LAZY -# converts the file name ARG from $build format to toolchain format. Return -# result in func_to_tool_file_result. If the conversion in use is listed -# in (the comma separated) LAZY, no conversion takes place. -func_to_tool_file () -{ - $opt_debug - case ,$2, in - *,"$to_tool_file_cmd",*) - func_to_tool_file_result=$1 - ;; - *) - $to_tool_file_cmd "$1" - func_to_tool_file_result=$func_to_host_file_result - ;; - esac -} -# end func_to_tool_file - - -# func_convert_file_noop ARG -# Copy ARG to func_to_host_file_result. -func_convert_file_noop () -{ - func_to_host_file_result="$1" -} -# end func_convert_file_noop - - -# func_convert_file_msys_to_w32 ARG -# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_file_result. -func_convert_file_msys_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_to_host_file_result="$func_convert_core_msys_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_w32 - - -# func_convert_file_cygwin_to_w32 ARG -# Convert file name ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_file_cygwin_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # because $build is cygwin, we call "the" cygpath in $PATH; no need to use - # LT_CYGPATH in this case. - func_to_host_file_result=`cygpath -m "$1"` - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_cygwin_to_w32 - - -# func_convert_file_nix_to_w32 ARG -# Convert file name ARG from *nix to w32 format. Requires a wine environment -# and a working winepath. Returns result in func_to_host_file_result. -func_convert_file_nix_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_w32 - - -# func_convert_file_msys_to_cygwin ARG -# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_file_msys_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_cygwin - - -# func_convert_file_nix_to_cygwin ARG -# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed -# in a wine environment, working winepath, and LT_CYGPATH set. Returns result -# in func_to_host_file_result. -func_convert_file_nix_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. - func_convert_core_file_wine_to_w32 "$1" - func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_cygwin - - -############################################# -# $build to $host PATH CONVERSION FUNCTIONS # -############################################# -# invoked via `$to_host_path_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# The result will be available in $func_to_host_path_result. -# -# Path separators are also converted from $build format to $host format. If -# ARG begins or ends with a path separator character, it is preserved (but -# converted to $host format) on output. -# -# All path conversion functions are named using the following convention: -# file name conversion function : func_convert_file_X_to_Y () -# path conversion function : func_convert_path_X_to_Y () -# where, for any given $build/$host combination the 'X_to_Y' value is the -# same. If conversion functions are added for new $build/$host combinations, -# the two new functions must follow this pattern, or func_init_to_host_path_cmd -# will break. - - -# func_init_to_host_path_cmd -# Ensures that function "pointer" variable $to_host_path_cmd is set to the -# appropriate value, based on the value of $to_host_file_cmd. -to_host_path_cmd= -func_init_to_host_path_cmd () -{ - $opt_debug - if test -z "$to_host_path_cmd"; then - func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd="func_convert_path_${func_stripname_result}" - fi -} - - -# func_to_host_path ARG -# Converts the path ARG from $build format to $host format. Return result -# in func_to_host_path_result. -func_to_host_path () -{ - $opt_debug - func_init_to_host_path_cmd - $to_host_path_cmd "$1" -} -# end func_to_host_path - - -# func_convert_path_noop ARG -# Copy ARG to func_to_host_path_result. -func_convert_path_noop () -{ - func_to_host_path_result="$1" -} -# end func_convert_path_noop - - -# func_convert_path_msys_to_w32 ARG -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_path_result. -func_convert_path_msys_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from ARG. MSYS - # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; - # and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_msys_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_msys_to_w32 - - -# func_convert_path_cygwin_to_w32 ARG -# Convert path ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_path_cygwin_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_cygwin_to_w32 - - -# func_convert_path_nix_to_w32 ARG -# Convert path ARG from *nix to w32 format. Requires a wine environment and -# a working winepath. Returns result in func_to_host_file_result. -func_convert_path_nix_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_nix_to_w32 - - -# func_convert_path_msys_to_cygwin ARG -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_path_msys_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_msys_to_cygwin - - -# func_convert_path_nix_to_cygwin ARG -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in -# func_to_host_file_result. -func_convert_path_nix_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_nix_to_cygwin - - -# func_mode_compile arg... -func_mode_compile () -{ - $opt_debug - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - pie_flag= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - test -n "$libobj" && \ - func_fatal_error "you cannot specify \`-o' more than once" - arg_mode=target - continue - ;; - - -pie | -fpie | -fPIE) - func_append pie_flag " $arg" - continue - ;; - - -shared | -static | -prefer-pic | -prefer-non-pic) - func_append later " $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - func_append_quoted lastarg "$arg" - done - IFS="$save_ifs" - func_stripname ' ' '' "$lastarg" - lastarg=$func_stripname_result - - # Add the arguments to base_compile. - func_append base_compile " $lastarg" - continue - ;; - - *) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - func_append_quoted base_compile "$lastarg" - done # for arg - - case $arg_mode in - arg) - func_fatal_error "you must specify an argument for -Xcompile" - ;; - target) - func_fatal_error "you must specify a target with \`-o'" - ;; - *) - # Get the name of the library object. - test -z "$libobj" && { - func_basename "$srcfile" - libobj="$func_basename_result" - } - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - case $libobj in - *.[cCFSifmso] | \ - *.ada | *.adb | *.ads | *.asm | \ - *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) - func_xform "$libobj" - libobj=$func_xform_result - ;; - esac - - case $libobj in - *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; - *) - func_fatal_error "cannot determine name of library object from \`$libobj'" - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - continue - ;; - - -static) - build_libtool_libs=no - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ - && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname - - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - func_append removelist " $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi - - $opt_dry_run || $RM $removelist - func_append removelist " $lockfile" - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - - func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 - srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi - - func_mkdir_p "$xdir$objdir" - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - func_append command " -o $lobj" - fi - - func_show_eval_locale "$command" \ - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - func_show_eval '$MV "$output_obj" "$lobj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - - # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - func_append command " -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - func_append command "$suppress_output" - func_show_eval_locale "$command" \ - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - func_show_eval '$MV "$output_obj" "$obj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - fi - - $opt_dry_run || { - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - removelist=$lockfile - $RM "$lockfile" - fi - } - - exit $EXIT_SUCCESS -} - -$opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} -} - -func_mode_help () -{ - # We need to display help for each of the modes. - case $opt_mode in - "") - # Generic help is extracted from the usage comments - # at the start of this file. - func_help - ;; - - clean) - $ECHO \ -"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - - compile) - $ECHO \ -"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to build PIC objects only - -prefer-non-pic try to build non-PIC objects only - -shared do not build a \`.o' file suitable for static linking - -static only build a \`.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - - execute) - $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - - finish) - $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - - install) - $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The following components of INSTALL-COMMAND are treated specially: - - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - - link) - $ECHO \ -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -bindir BINDIR specify path to binaries directory (for systems where - libraries must be found in the PATH setting at runtime) - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wl,FLAG - -Xlinker FLAG pass linker-specific FLAG directly to the linker - -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - - uninstall) - $ECHO \ -"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - - *) - func_fatal_help "invalid operation mode \`$opt_mode'" - ;; - esac - - echo - $ECHO "Try \`$progname --help' for more information about other modes." -} - -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test "$opt_help" = :; then - func_mode_help - else - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - sed '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi - - -# func_mode_execute arg... -func_mode_execute () -{ - $opt_debug - # The first argument is the command name. - cmd="$nonopt" - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $opt_dlopen; do - test -f "$file" \ - || func_fatal_help "\`$file' is not a file" - - dir= - case $file in - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$lib' is not a valid libtool archive" - - # Read the libtool library. - dlname= - library_names= - func_source "$file" - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && \ - func_warning "\`$file' was not linked with \`-export-dynamic'" - continue - fi - - func_dirname "$file" "" "." - dir="$func_dirname_result" - - if test -f "$dir/$objdir/$dlname"; then - func_append dir "/$objdir" - else - if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" - fi - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - func_dirname "$file" "" "." - dir="$func_dirname_result" - ;; - - *) - func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -* | *.la | *.lo ) ;; - *) - # Do a test to see if this is really a libtool program. - if func_ltwrapper_script_p "$file"; then - func_source "$file" - # Transform arg to wrapped name. - file="$progdir/$program" - elif func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - func_source "$func_ltwrapper_scriptname_result" - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - func_append_quoted args "$file" - done - - if test "X$opt_dry_run" = Xfalse; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libs= - libdirs= - admincmds= - - for opt in "$nonopt" ${1+"$@"} - do - if test -d "$opt"; then - func_append libdirs " $opt" - - elif test -f "$opt"; then - if func_lalib_unsafe_p "$opt"; then - func_append libs " $opt" - else - func_warning "\`$opt' is not a valid libtool archive" - fi - - else - func_fatal_error "invalid argument \`$opt'" - fi - done - - if test -n "$libs"; then - if test -n "$lt_sysroot"; then - sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` - sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" - else - sysroot_cmd= - fi - - # Remove sysroot references - if $opt_dry_run; then - for lib in $libs; do - echo "removing references to $lt_sysroot and \`=' prefixes from $lib" - done - else - tmpdir=`func_mktempdir` - for lib in $libs; do - sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ - > $tmpdir/tmp-la - mv -f $tmpdir/tmp-la $lib - done - ${RM}r "$tmpdir" - fi - fi - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - func_execute_cmds "$finish_cmds" 'admincmds="$admincmds -'"$cmd"'"' - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || func_append admincmds " - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" - fi - exit $EXIT_SUCCESS -} - -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} - - -# func_mode_install arg... -func_mode_install () -{ - $opt_debug - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac; then - # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " - arg=$1 - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - no_mode=: - for arg - do - arg2= - if test -n "$dest"; then - func_append files " $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - if $install_cp; then :; else - prev=$arg - fi - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then - arg2=$install_override_mode - no_mode=false - fi - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" - if test -n "$arg2"; then - func_quote_for_eval "$arg2" - fi - func_append install_shared_prog " $func_quote_for_eval_result" - done - - test -z "$install_prog" && \ - func_fatal_help "you must specify an install program" - - test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" - - if test -n "$install_override_mode" && $no_mode; then - if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" - fi - fi - - if test -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" - - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - func_fatal_help "\`$destdir' must be an absolute directory name" - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - func_append staticlibs " $file" - ;; - - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$file' is not a valid libtool archive" - - library_names= - old_library= - relink_command= - func_source "$file" - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) func_append current_libdirs " $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) func_append future_libdirs " $libdir" ;; - esac - fi - - func_dirname "$file" "/" "" - dir="$func_dirname_result" - func_append dir "$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - func_warning "relinking \`$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' - fi - - # See the names of the shared library. - set dummy $library_names; shift - if test -n "$1"; then - realname="$1" - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme="$stripme" - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - case $realname in - *.dll.a) - tstripme="" - ;; - esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - func_execute_cmds "$postinstall_cmds" 'exit $?' - fi - - # Install the pseudo-library for information purposes. - func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && func_append staticlibs " $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - func_lo2o "$destfile" - staticdest=$func_lo2o_result - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - func_fatal_help "cannot copy a libtool object to \`$destfile'" - ;; - esac - - # Install the libtool object if requested. - test -n "$destfile" && \ - func_show_eval "$install_prog $file $destfile" 'exit $?' - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - func_lo2o "$file" - staticobj=$func_lo2o_result - func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - func_stripname '' '.exe' "$file" - file=$func_stripname_result - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin* | *mingw*) - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - wrapper=$func_ltwrapper_scriptname_result - else - func_stripname '' '.exe' "$file" - wrapper=$func_stripname_result - fi - ;; - *) - wrapper=$file - ;; - esac - if func_ltwrapper_script_p "$wrapper"; then - notinst_deplibs= - relink_command= - - func_source "$wrapper" - - # Check the variables that should have been set. - test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script \`$wrapper'" - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - func_source "$lib" - fi - libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - $opt_dry_run || { - if test "$finalize" = yes; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_silent || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink \`$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file="$outputname" - else - func_warning "cannot relink \`$file'" - fi - } - else - # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done - - for file in $staticlibs; do - func_basename "$file" - name="$func_basename_result" - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - func_show_eval "$install_prog \$file \$oldlib" 'exit $?' - - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $oldlib" 'exit $?' - fi - - # Do each command in the postinstall commands. - func_execute_cmds "$old_postinstall_cmds" 'exit $?' - done - - test -n "$future_libdirs" && \ - func_warning "remember to run \`$progname --finish$future_libdirs'" - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = install && func_mode_install ${1+"$@"} - - -# func_generate_dlsyms outputname originator pic_p -# Extract symbols from dlprefiles and create ${outputname}S.o with -# a dlpreopen symbol table. -func_generate_dlsyms () -{ - $opt_debug - my_outputname="$1" - my_originator="$2" - my_pic_p="${3-no}" - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` - my_dlsyms= - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms="${my_outputname}S.c" - else - func_error "not configured to extract global symbols from dlpreopened files" - fi - fi - - if test -n "$my_dlsyms"; then - case $my_dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${my_outputname}.nm" - - func_show_eval "$RM $nlist ${nlist}S ${nlist}T" - - # Parse the name list into a source file. - func_verbose "creating $output_objdir/$my_dlsyms" - - $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" -#endif - -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" - - $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" - $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $opt_dry_run || { - eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - if test -n "$export_symbols_regex"; then - $opt_dry_run || { - eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $opt_dry_run || { - $RM $export_symbols - eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - } - else - $opt_dry_run || { - eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - } - fi - fi - - for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from \`$dlprefile'" - func_basename "$dlprefile" - name="$func_basename_result" - case $host in - *cygwin* | *mingw* | *cegcc* ) - # if an import library, we need to obtain dlname - if func_win32_import_lib_p "$dlprefile"; then - func_tr_sh "$dlprefile" - eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename="" - if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then - # Use subshell, to avoid clobbering current variable values - dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname" ; then - func_basename "$dlprefile_dlname" - dlprefile_dlbasename="$func_basename_result" - else - # no lafile. user explicitly requested -dlpreopen . - $sharedlib_from_linklib_cmd "$dlprefile" - dlprefile_dlbasename=$sharedlib_from_linklib_result - fi - fi - $opt_dry_run || { - if test -n "$dlprefile_dlbasename" ; then - eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' - else - func_warning "Could not compute DLL name from $name" - eval '$ECHO ": $name " >> "$nlist"' - fi - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" - } - else # not an import lib - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - fi - ;; - *) - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - ;; - esac - done - - $opt_dry_run || { - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $MV "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if $GREP -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - $GREP -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$my_dlsyms" - fi - - echo >> "$output_objdir/$my_dlsyms" "\ - -/* The mapping between symbol names and symbols. */ -typedef struct { - const char *name; - void *address; -} lt_dlsymlist; -extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[]; -LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," - - case $need_lib_prefix in - no) - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - *) - eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - esac - echo >> "$output_objdir/$my_dlsyms" "\ - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_${my_prefix}_LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - } # !$opt_dry_run - - pic_flag_for_symtable= - case "$compile_command " in - *" -static "*) ;; - *) - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; - *-*-hpux*) - pic_flag_for_symtable=" $pic_flag" ;; - *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi - ;; - esac - ;; - esac - symtab_cflags= - for arg in $LTCFLAGS; do - case $arg in - -pie | -fpie | -fPIE) ;; - *) func_append symtab_cflags " $arg" ;; - esac - done - - # Now compile the dynamic symbol file. - func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' - - # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' - - # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" - case $host in - *cygwin* | *mingw* | *cegcc* ) - if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - ;; - esac - ;; - *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` - fi -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. -func_win32_libid () -{ - $opt_debug - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' - 1,100{ - / I /{ - s,.*,import, - p - q - } - }'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $ECHO "$win32_libid_type" -} - -# func_cygming_dll_for_implib ARG -# -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib () -{ - $opt_debug - sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` -} - -# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs -# -# The is the core of a fallback implementation of a -# platform-specific function to extract the name of the -# DLL associated with the specified import library LIBNAME. -# -# SECTION_NAME is either .idata$6 or .idata$7, depending -# on the platform and compiler that created the implib. -# -# Echos the name of the DLL associated with the -# specified import library. -func_cygming_dll_for_implib_fallback_core () -{ - $opt_debug - match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` - $OBJDUMP -s --section "$1" "$2" 2>/dev/null | - $SED '/^Contents of section '"$match_literal"':/{ - # Place marker at beginning of archive member dllname section - s/.*/====MARK====/ - p - d - } - # These lines can sometimes be longer than 43 characters, but - # are always uninteresting - /:[ ]*file format pe[i]\{,1\}-/d - /^In archive [^:]*:/d - # Ensure marker is printed - /^====MARK====/p - # Remove all lines with less than 43 characters - /^.\{43\}/!d - # From remaining lines, remove first 43 characters - s/^.\{43\}//' | - $SED -n ' - # Join marker and all lines until next marker into a single line - /^====MARK====/ b para - H - $ b para - b - :para - x - s/\n//g - # Remove the marker - s/^====MARK====// - # Remove trailing dots and whitespace - s/[\. \t]*$// - # Print - /./p' | - # we now have a list, one entry per line, of the stringified - # contents of the appropriate section of all members of the - # archive which possess that section. Heuristic: eliminate - # all those which have a first or second character that is - # a '.' (that is, objdump's representation of an unprintable - # character.) This should work for all archives with less than - # 0x302f exports -- but will fail for DLLs whose name actually - # begins with a literal '.' or a single character followed by - # a '.'. - # - # Of those that remain, print the first one. - $SED -e '/^\./d;/^.\./d;q' -} - -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - -# func_cygming_dll_for_implib_fallback ARG -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# -# This fallback implementation is for use when $DLLTOOL -# does not support the --identify-strict option. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib_fallback () -{ - $opt_debug - if func_cygming_gnu_implib_p "$1" ; then - # binutils import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1" ; then - # ms-generated import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` - else - # unknown - sharedlib_from_linklib_result="" - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - $opt_debug - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - if test "$lock_old_archive_extraction" = yes; then - lockfile=$f_ex_an_ar_oldlib.lock - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - fi - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ - 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then - $opt_dry_run || rm -f "$lockfile" - fi - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $opt_debug - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib="$func_basename_result" - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - func_mkdir_p "$my_xdir" - - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -rf unfat-$$ - cd "$darwin_orig_dir" - else - cd $darwin_orig_dir - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - } # !$opt_dry_run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=${1-no} - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: - generated_by_libtool_version='$macro_version' - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$ECHO are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=\"$qECHO\" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ which is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 - if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then - # special case for '.' - if test \"\$thisdir\" = \".\"; then - thisdir=\`pwd\` - fi - # remove .libs from thisdir - case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" - - $ECHO "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 - fi - fi - - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $ECHO "\ - - if test -f \"\$progdir/\$program\"; then" - - # fixup the dll searchpath if we need to. - # - # Fix the DLL searchpath if we need to. Do this before prepending - # to shlibpath, because on Windows, both are PATH and uninstalled - # libraries must come first. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` - - export $shlibpath_var -" - fi - - $ECHO "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. - func_exec_program \${1+\"\$@\"} - fi - else - # The program doesn't exist. - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" -} - - -# func_emit_cwrapperexe_src -# emit the source code for a wrapper executable on stdout -# Must ONLY be called from within func_mode_link because -# it depends on a number of variable set therein. -func_emit_cwrapperexe_src () -{ - cat < -#include -#ifdef _MSC_VER -# include -# include -# include -#else -# include -# include -# ifdef __CYGWIN__ -# include -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -/* declarations of non-ANSI functions */ -#if defined(__MINGW32__) -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#elif defined(__CYGWIN__) -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif -/* #elif defined (other platforms) ... */ -#endif - -/* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -# define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif -#elif defined(__MINGW32__) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined(__CYGWIN__) -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ -#endif - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0 -#endif - -/* path handling portability macros */ -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# define FOPEN_WB "wb" -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#ifndef FOPEN_WB -# define FOPEN_WB "w" -#endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -#if defined(LT_DEBUGWRAPPER) -static int lt_debug = 1; -#else -static int lt_debug = 0; -#endif - -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -char *chase_symlinks (const char *pathspec); -int make_executable (const char *path); -int check_executable (const char *path); -char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); -void lt_setenv (const char *name, const char *value); -char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); -EOF - - cat <= 0) - && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) - return 1; - else - return 0; -} - -int -make_executable (const char *path) -{ - int rval = 0; - struct stat st; - - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; - - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char *concat_name; - - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -chase_symlinks (const char *pathspec) -{ -#ifndef S_ISLNK - return xstrdup (pathspec); -#else - char buf[LT_PATHMAX]; - struct stat s; - char *tmp_pathspec = xstrdup (pathspec); - char *p; - int has_symlinks = 0; - while (strlen (tmp_pathspec) && !has_symlinks) - { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); - if (lstat (tmp_pathspec, &s) == 0) - { - if (S_ISLNK (s.st_mode) != 0) - { - has_symlinks = 1; - break; - } - - /* search backwards for last DIR_SEPARATOR */ - p = tmp_pathspec + strlen (tmp_pathspec) - 1; - while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - p--; - if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - { - /* no more DIR_SEPARATORS left */ - break; - } - *p = '\0'; - } - else - { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} - -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; - - assert (str != NULL); - assert (pat != NULL); - - len = strlen (str); - patlen = strlen (pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp (str, pat) == 0) - *str = '\0'; - } - return str; -} - -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - -static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *file, int line, const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); - va_end (ap); -} - -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - -void -lt_setenv (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - int len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} - -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - int orig_value_len = strlen (orig_value); - int add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - return new_value; -} - -void -lt_update_exe_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - int len = strlen (new_value); - while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[len-1] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -void -lt_update_lib_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; - - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; - - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); - - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; - - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; - - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - - return new_argv; -} -EOF - ;; - esac - - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' - - cat <<"EOF" -} -EOF -} -# end: func_emit_cwrapperexe_src - -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $opt_debug - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac -} - -# func_mode_link arg... -func_mode_link () -{ - $opt_debug - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= - - avoid_version=no - bindir= - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module="${wl}-single_module" - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - func_append compile_command " @OUTPUT@" - func_append finalize_command " @OUTPUT@" - ;; - esac - - case $prev in - bindir) - bindir="$arg" - prev= - continue - ;; - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - func_append dlfiles " $arg" - else - func_append dlprefiles " $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - test -f "$arg" \ - || func_fatal_error "symbol file \`$arg' does not exist" - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - framework) - case $host in - *-*-darwin*) - case "$deplibs " in - *" $qarg.ltframework "*) ;; - *) func_append deplibs " $qarg.ltframework" # this is fixed later - ;; - esac - ;; - esac - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat "$save_arg"` - do -# func_append moreargs " $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - done - else - func_fatal_error "link input file \`$arg' does not exist" - fi - arg=$save_arg - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) func_append rpath " $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) func_append xrpath " $arg" ;; - esac - fi - prev= - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - weak) - func_append weak_libs " $arg" - prev= - continue - ;; - xcclinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xcompiler) - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xlinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $wl$qarg" - prev= - func_append compile_command " $wl$qarg" - func_append finalize_command " $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - # See comment for -static flag below, for more details. - func_append compile_command " $link_static_flag" - func_append finalize_command " $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - func_fatal_error "\`-allow-undefined' must not be used because it is the default" - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -bindir) - prev=bindir - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=framework - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - func_append compile_command " $arg" - func_append finalize_command " $arg" - ;; - esac - continue - ;; - - -L*) - func_stripname "-L" '' "$arg" - if test -z "$func_stripname_result"; then - if test "$#" -gt 0; then - func_fatal_error "require no space between \`-L' and \`$1'" - else - func_fatal_error "need path for \`-L' option" - fi - fi - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of \`$dir'" - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "* | *" $arg "*) - # Will only happen for absolute or sysroot arguments - ;; - *) - # Preserve sysroot, but never include relative directories - case $dir in - [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; - *) func_append deplibs " -L$dir" ;; - esac - func_append lib_search_path " $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - ::) dllsearchpath=$dir;; - *) func_append dllsearchpath ":$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - func_append deplibs " System.ltframework" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - func_append deplibs " $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) func_append new_inherited_linker_flags " $arg" ;; - esac - continue - ;; - - -multi_module) - single_module="${wl}-multi_module" - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) - # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. - func_warning "\`-no-install' is ignored for $host" - func_warning "assuming \`-no-fast-install' instead" - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - func_stripname '-R' '' "$arg" - dir=$func_stripname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - =*) - func_stripname '=' '' "$dir" - dir=$lt_sysroot$func_stripname_result - ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - continue - ;; - - -shared) - # The effects of -shared are defined in a previous loop. - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -weak) - prev=weak - continue - ;; - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Wl,*) - func_stripname '-Wl,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # -msg_* for osf cc - -msg_*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - # --sysroot=* for sysroot support - # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-flto*|-fwhopr*|-fuse-linker-plugin) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - func_append compile_command " $arg" - func_append finalize_command " $arg" - func_append compiler_flags " $arg" - continue - ;; - - # Some other compiler flag. - -* | +*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - *.$objext) - # A standard object. - func_append objs " $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - ;; - - *.$libext) - # An archive. - func_append deplibs " $arg" - func_append old_deplibs " $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - func_resolve_sysroot "$arg" - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - func_append dlfiles " $func_resolve_sysroot_result" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - func_append dlprefiles " $func_resolve_sysroot_result" - prev= - else - func_append deplibs " $func_resolve_sysroot_result" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - done # argument parsing loop - - test -n "$prev" && \ - func_fatal_help "the \`$prevarg' option requires an argument" - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - func_basename "$output" - outputname="$func_basename_result" - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" - func_to_tool_file "$output_objdir/" - tool_output_objdir=$func_to_tool_file_result - # Create the object directory. - func_mkdir_p "$output_objdir" - - # Determine the type of output - case $output in - "") - func_fatal_help "you must specify an output file" - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if $opt_preserve_dup_deps ; then - case "$libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append libs " $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if $opt_duplicate_compiler_generated_deps; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; - esac - func_append pre_post_deps " $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - - case $linkmode in - lib) - passes="conv dlpreopen link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - - for pass in $passes; do - # The preopen pass in lib mode reverses $deplibs; put it back here - # so that -L comes before libs that need it for instance... - if test "$linkmode,$pass" = "lib,link"; then - ## FIXME: Find the place where the list is rebuilt in the wrong - ## order, and fix it there properly - tmp_deplibs= - for deplib in $deplibs; do - tmp_deplibs="$deplib $tmp_deplibs" - done - deplibs="$tmp_deplibs" - fi - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - if test "$linkmode,$pass" = "lib,dlpreopen"; then - # Collect and forward deplibs of preopened libtool libs - for lib in $dlprefiles; do - # Ignore non-libtool-libs - dependency_libs= - func_resolve_sysroot "$lib" - case $lib in - *.la) func_source "$func_resolve_sysroot_result" ;; - esac - - # Collect preopened libtool deplibs, except any this library - # has declared as weak libs - for deplib in $dependency_libs; do - func_basename "$deplib" - deplib_base=$func_basename_result - case " $weak_libs " in - *" $deplib_base "*) ;; - *) func_append deplibs " $deplib" ;; - esac - done - done - libs="$dlprefiles" - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append compiler_flags " $deplib" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" - continue - fi - func_stripname '-l' '' "$deplib" - name=$func_stripname_result - if test "$linkmode" = lib; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if func_lalib_p "$lib"; then - library_names= - old_library= - func_source "$lib" - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - *) - func_warning "\`-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - func_stripname '-R' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) - func_resolve_sysroot "$deplib" - lib=$func_resolve_sysroot_result - ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - # Linking convenience modules into shared libraries is allowed, - # but linking other static libraries is non-portable. - case " $dlpreconveniencelibs " in - *" $deplib "*) ;; - *) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." - else - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - ;; - esac - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - func_append newdlprefiles " $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append newdlfiles " $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - - if test "$found" = yes || test -f "$lib"; then : - else - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" - fi - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$lib" \ - || func_fatal_error "\`$lib' is not a valid libtool archive" - - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - inherited_linker_flags= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - func_source "$lib" - - # Convert "-framework foo" to "foo.ltframework" - if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do - case " $new_inherited_linker_flags " in - *" $tmp_inherited_linker_flag "*) ;; - *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && func_append dlfiles " $dlopen" - test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - # It is a libtool convenience library, so add in its objects. - func_append convenience " $ladir/$objdir/$old_library" - func_append old_convenience " $ladir/$objdir/$old_library" - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" - fi - 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 - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - if test -n "$old_library" && - { test "$prefer_static_libs" = yes || - test "$prefer_static_libs,$installed" = "built,no"; }; then - linklib=$old_library - else - for l in $old_library $library_names; do - linklib="$l" - done - fi - if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - func_fatal_error "cannot -dlopen a convenience library: \`$lib'" - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - func_append dlprefiles " $lib $dependency_libs" - else - func_append newdlfiles " $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of \`$ladir'" - func_warning "passing it literally to the linker, although it might fail" - abs_ladir="$ladir" - fi - ;; - esac - func_basename "$lib" - laname="$func_basename_result" - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$lt_sysroot$libdir" - absdir="$lt_sysroot$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - func_append notinst_path " $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - func_append notinst_path " $abs_ladir" - fi - fi # $installed = yes - func_stripname 'lib' '.la' "$laname" - name=$func_stripname_result - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir" && test "$linkmode" = prog; then - func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" - fi - case "$host" in - # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) - # Linker will automatically link against shared library if both - # static and shared are present. Therefore, ensure we extract - # symbols from the import library if a shared library is present - # (otherwise, the dlopen module name will be incorrect). We do - # this by putting the import library name into $newdlprefiles. - # We recover the dlopen module name by 'saving' the la file - # name in a special purpose variable, and (later) extracting the - # dlname from the la file. - if test -n "$dlname"; then - func_tr_sh "$dir/$linklib" - eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" - func_append newdlprefiles " $dir/$linklib" - else - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - fi - ;; - * ) - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - func_append newdlprefiles " $dir/$dlname" - else - func_append newdlprefiles " $dir/$linklib" - fi - ;; - esac - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - func_append newlib_search_path " $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in - *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc*) - # No point in relinking DLLs because paths are not encoded - func_append notinst_deplibs " $lib" - need_relink=no - ;; - *) - if test "$installed" = no; then - func_append notinst_deplibs " $lib" - need_relink=yes - fi - ;; - esac - # This is a shared library - - # Warn about portability, can't link against -module's on some - # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule="" - for dlpremoduletest in $dlprefiles; do - if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule="$dlpremoduletest" - break - fi - done - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - echo - if test "$linkmode" = prog; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" - else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" - fi - $ECHO "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - shift - realname="$1" - shift - libname=`eval "\\$ECHO \"$libname_spec\""` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw* | *cegcc*) - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - func_basename "$soroot" - soname="$func_basename_result" - func_stripname 'lib' '.dll' "$soname" - newlib=libimp-$func_stripname_result.a - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - func_verbose "extracting exported symbol list from \`$soname'" - func_execute_cmds "$extract_expsyms_cmds" 'exit $?' - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for \`$soname'" - func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$opt_mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not - # link against it, someone is ignoring the earlier warnings - if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null ; then - if test "X$dlopenmodule" != "X$lib"; then - $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - echo - echo "*** And there doesn't seem to be a static archive available" - echo "*** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - elif test -n "$old_library"; then - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - func_fatal_configuration "unsupported hardcode properties" - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) func_append compile_shlibpath "$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && - test "$hardcode_minus_L" != yes && - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$opt_mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo - $ECHO "*** Warning: This system can not link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) func_stripname '-R' '' "$libdir" - temp_xrpath=$func_stripname_result - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) func_append xrpath " $temp_xrpath";; - esac;; - *) func_append temp_deplibs " $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - func_append newlib_search_path " $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result";; - *) func_resolve_sysroot "$deplib" ;; - esac - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $func_resolve_sysroot_result "*) - func_append specialdeplibs " $func_resolve_sysroot_result" ;; - esac - fi - func_append tmp_libs " $func_resolve_sysroot_result" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - path= - case $deplib in - -L*) path="$deplib" ;; - *.la) - func_resolve_sysroot "$deplib" - deplib=$func_resolve_sysroot_result - func_dirname "$deplib" "" "." - dir=$func_dirname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of \`$dir'" - absdir="$dir" - fi - ;; - esac - if $GREP "^installed=no" $deplib > /dev/null; then - case $host in - *-*-darwin*) - depdepl= - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$absdir/$objdir/$depdepl" ; then - depdepl="$absdir/$objdir/$depdepl" - darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - if test -z "$darwin_install_name"; then - darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - fi - func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" - path= - fi - fi - ;; - *) - path="-L$absdir/$objdir" - ;; - esac - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - test "$absdir" != "$libdir" && \ - func_warning "\`$deplib' seems to be moved" - - path="-L$absdir" - fi - ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test "$pass" = link; then - if test "$linkmode" = "prog"; then - compile_deplibs="$new_inherited_linker_flags $compile_deplibs" - finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" - else - compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) func_append lib_search_path " $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) func_append tmp_libs " $deplib" ;; - esac - ;; - *) func_append tmp_libs " $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - func_append tmp_libs " $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for archives" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for archives" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for archives" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for archives" - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for archives" - - test -n "$release" && \ - func_warning "\`-release' is ignored for archives" - - test -n "$export_symbols$export_symbols_regex" && \ - func_warning "\`-export-symbols' is ignored for archives" - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - func_append objs "$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - func_stripname 'lib' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - test "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" - - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - func_stripname '' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - func_stripname '' '.la' "$outputname" - libname=$func_stripname_result - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" - else - echo - $ECHO "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" - func_append libobjs " $objs" - fi - fi - - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" - - set dummy $rpath - shift - test "$#" -gt 1 && \ - func_warning "ignoring multiple \`-rpath's for a libtool library" - - install_libdir="$1" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for convenience libraries" - - test -n "$release" && \ - func_warning "\`-release' is ignored for convenience libraries" - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - shift - IFS="$save_ifs" - - test -n "$7" && \ - func_fatal_help "too many parameters to \`-version-info'" - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$1" - number_minor="$2" - number_revision="$3" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows|none) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|qnx|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_minor" - lt_irix_increment=no - ;; - esac - ;; - no) - current="$1" - revision="$2" - age="$3" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current" - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - ;; - - osf) - func_arith $current - $age - major=.$func_arith_result - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - func_arith $current - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - func_append verstring ":${current}.0" - ;; - - qnx) - major=".$current" - versuffix=".$current" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - - *) - func_fatal_configuration "unknown library version type \`$version_type'" - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - func_warning "undefined symbols not allowed in $host shared libraries" - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - fi - - func_generate_dlsyms "$libname" "$libname" "yes" - func_append libobjs " $symfileobj" - test "X$libobjs" = "X " && libobjs= - - if test "$opt_mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$ECHO "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext | *.gcno) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - func_append removelist " $p" - ;; - *) ;; - esac - done - test -n "$removelist" && \ - func_show_eval "${RM}r \$removelist" - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - func_append oldlibs " $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - func_replace_sysroot "$libdir" - func_append temp_xrpath " -R$func_replace_sysroot_result" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) func_append dlfiles " $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) func_append dlprefiles " $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - func_append deplibs " System.ltframework" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - func_append deplibs " -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c </dev/null` - $nocaseglob - else - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - fi - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null | - $GREP " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for file magic test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a file magic. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - for a_deplib in $deplibs; do - case $a_deplib in - -l*) - func_stripname -l '' "$a_deplib" - name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - func_append newdeplibs " $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval "\\$ECHO \"$libname_spec\""` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ - $EGREP "$match_pattern_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a regex pattern. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` - done - fi - case $tmp_deplibs in - *[!\ \ ]*) - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - ;; - esac - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - deplibs="$new_libs" - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$opt_mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - func_replace_sysroot "$libdir" - libdir=$func_replace_sysroot_result - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append dep_rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_apped perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - shift - realname="$1" - shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - func_append linknames " $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` - test "X$libobjs" = "X " && libobjs= - - delfiles= - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols="$output_objdir/$libname.uexp" - func_append delfiles " $export_symbols" - fi - - orig_export_symbols= - case $host_os in - cygwin* | mingw* | cegcc*) - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then - # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then - # and it's NOT already a .def file. Must figure out - # which of the given symbols are data symbols and tag - # them as such. So, trigger use of export_symbols_cmds. - # export_symbols gets reassigned inside the "prepare - # the list of exported symbols" if statement, so the - # include_expsyms logic still works. - orig_export_symbols="$export_symbols" - export_symbols= - always_export_symbols=yes - fi - fi - ;; - esac - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd1 in $cmds; do - IFS="$save_ifs" - # Take the normal branch if the nm_file_list_spec branch - # doesn't work or if tool conversion is not needed. - case $nm_file_list_spec~$to_tool_file_cmd in - *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) - try_normal_branch=yes - eval cmd=\"$cmd1\" - func_len " $cmd" - len=$func_len_result - ;; - *) - try_normal_branch=no - ;; - esac - if test "$try_normal_branch" = yes \ - && { test "$len" -lt "$max_cmd_len" \ - || test "$max_cmd_len" -le -1; } - then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - elif test -n "$nm_file_list_spec"; then - func_basename "$output" - output_la=$func_basename_result - save_libobjs=$libobjs - save_output=$output - output=${output_objdir}/${output_la}.nm - func_to_tool_file "$output" - libobjs=$nm_file_list_spec$func_to_tool_file_result - func_append delfiles " $output" - func_verbose "creating $NM input file list: $output" - for obj in $save_libobjs; do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > "$output" - eval cmd=\"$cmd1\" - func_show_eval "$cmd" 'exit $?' - output=$save_output - libobjs=$save_libobjs - skipped_export=false - else - # The command line is too long to execute in one step. - func_verbose "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - func_append tmp_deplibs " $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && - test -z "$libobjs"; then - # extract the archives, so we have objects to list. - # TODO: could optimize this to just extract one archive. - whole_archive_flag_spec= - fi - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - else - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - func_append linker_flags " $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - func_len " $test_cmds" && - len=$func_len_result && - test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise - # or, if using GNU ld and skipped_export is not :, use a linker - # script. - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - func_basename "$output" - output_la=$func_basename_result - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript - func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output - for obj in $save_libobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - echo ')' >> $output - func_append delfiles " $output" - func_to_tool_file "$output" - output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then - output=${output_objdir}/${output_la}.lnk - func_verbose "creating linker input file list: $output" - : > $output - set x $save_libobjs - shift - firstobj= - if test "$compiler_needs_object" = yes; then - firstobj="$1 " - shift - fi - for obj - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - func_append delfiles " $output" - func_to_tool_file "$output" - output=$firstobj\"$file_list_spec$func_to_tool_file_result\" - else - if test -n "$save_libobjs"; then - func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-${k}.$objext - eval test_cmds=\"$reload_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - if test "X$objlist" = X || - test "$len" -lt "$max_cmd_len"; then - func_append objlist " $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" - else - # All subsequent reloadable object files will link in - # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - func_arith $k + 1 - k=$func_arith_result - output=$output_objdir/$output_la-${k}.$objext - objlist=" $obj" - func_len " $last_robj" - func_arith $len0 + $func_len_result - len=$func_arith_result - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\${concat_cmds}$reload_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" - fi - func_append delfiles " $output" - - else - output= - fi - - if ${skipped_export-false}; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - libobjs=$output - # Append the command to create the export file. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - fi - - test -n "$save_libobjs" && - func_verbose "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - if test -n "$export_symbols_regex" && ${skipped_export-false}; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - - if ${skipped_export-false}; then - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - fi - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - fi - - if test -n "$delfiles"; then - # Append the command to remove temporary files to $cmds. - eval cmds=\"\$cmds~\$RM $delfiles\" - fi - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - func_show_eval '${RM}r "$gentop"' - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for objects" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for objects" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for objects" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for objects" - - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for objects" - - test -n "$release" && \ - func_warning "\`-release' is ignored for objects" - - case $output in - *.lo) - test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object \`$output' from non-libtool objects" - - libobj=$output - func_lo2o "$libobj" - obj=$func_lo2o_result - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $opt_dry_run || $RM $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` - else - gentop="$output_objdir/${obj}x" - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - func_execute_cmds "$reload_cmds" 'exit $?' - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - func_execute_cmds "$reload_cmds" 'exit $?' - fi - - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "\`-release' is ignored for programs" - - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - func_append compile_command " ${wl}-bind_at_load" - func_append finalize_command " ${wl}-bind_at_load" - ;; - esac - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - func_append compile_command " $compile_deplibs" - func_append finalize_command " $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - ::) dllsearchpath=$libdir;; - *) func_append dllsearchpath ":$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) func_append finalize_perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=yes - case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no - ;; - *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - esac - if test "$wrappers_required" = no; then - # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - exit_status=0 - func_show_eval "$link_command" 'exit_status=$?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Delete the generated files. - if test -f "$output_objdir/${outputname}S.${objext}"; then - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' - fi - - exit $exit_status - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - func_append rpath "$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname - - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output_objdir/$outputname" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Now create the wrapper script. - func_verbose "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - fi - - # Only actually do things if not in dry run mode. - $opt_dry_run || { - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) func_stripname '' '.exe' "$output" - output=$func_stripname_result ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - func_stripname '' '.exe' "$outputname" - outputname=$func_stripname_result ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - func_dirname_and_basename "$output" "" "." - output_name=$func_basename_result - output_path=$func_dirname_result - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $RM $cwrappersource $cwrapper - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - func_emit_cwrapperexe_src > $cwrappersource - - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } - - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result - else - func_emit_wrapper no > $func_ltwrapper_scriptname_result - fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 - - func_emit_wrapper no > $output - chmod +x $output - ;; - esac - } - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - func_append oldobjs " $symfileobj" - fi - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $addlibs - func_append oldobjs " $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append oldobjs " $func_extract_archives_result" - fi - - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - func_basename "$obj" - $ECHO "$func_basename_result" - done | sort | sort -uc >/dev/null 2>&1); then - : - else - echo "copying selected object files to avoid basename conflicts..." - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - func_mkdir_p "$gentop" - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - func_basename "$obj" - objbase="$func_basename_result" - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - func_arith $counter + 1 - counter=$func_arith_result - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - func_append oldobjs " $gentop/$newobj" - ;; - *) func_append oldobjs " $obj" ;; - esac - done - fi - eval cmds=\"$old_archive_cmds\" - - func_len " $cmds" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - elif test -n "$archiver_list_spec"; then - func_verbose "using command file archive linking..." - for obj in $oldobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > $output_objdir/$libname.libcmd - func_to_tool_file "$output_objdir/$libname.libcmd" - oldobjs=" $archiver_list_spec$func_to_tool_file_result" - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - func_verbose "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - oldobjs= - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - eval test_cmds=\"$old_archive_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - for obj in $save_oldobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - func_append objlist " $obj" - if test "$len" -lt "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - len=$len0 - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - func_execute_cmds "$cmds" 'exit $?' - done - - test -n "$generated" && \ - func_show_eval "${RM}r$generated" - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - func_verbose "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" - ;; - -L*) - func_stripname -L '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -L$func_replace_sysroot_result" - ;; - -R*) - func_stripname -R '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -R$func_replace_sysroot_result" - ;; - *) func_append newdependency_libs " $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - - for lib in $dlfiles; do - case $lib in - *.la) - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" - ;; - *) func_append newdlfiles " $lib" ;; - esac - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - *.la) - # Only pass preopened files to the pseudo-archive (for - # eventual linking with the app. that links it) if we - # didn't already link the preopened objects directly into - # the library: - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" - ;; - esac - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlfiles " $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlprefiles " $abs" - done - dlprefiles="$newdlprefiles" - fi - $RM $output - # place dlname in correct position for cygwin - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) - # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; - then - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Linker flags that can not go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} - -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && - func_mode_link ${1+"$@"} - - -# func_mode_uninstall arg... -func_mode_uninstall () -{ - $opt_debug - RM="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) func_append RM " $arg"; rmforce=yes ;; - -*) func_append RM " $arg" ;; - *) func_append files " $arg" ;; - esac - done - - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" - - rmdirs= - - for file in $files; do - func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - odir="$objdir" - else - odir="$dir/$objdir" - fi - func_basename "$file" - name="$func_basename_result" - test "$opt_mode" = uninstall && odir="$dir" - - # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then - case " $rmdirs " in - *" $odir "*) ;; - *) func_append rmdirs " $odir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if { test -L "$file"; } >/dev/null 2>&1 || - { test -h "$file"; } >/dev/null 2>&1 || - test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if func_lalib_p "$file"; then - func_source $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - func_append rmfiles " $odir/$n" - done - test -n "$old_library" && func_append rmfiles " $odir/$old_library" - - case "$opt_mode" in - clean) - case " $library_names " in - *" $dlname "*) ;; - *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; - esac - test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if func_lalib_p "$file"; then - - # Read the .lo file - func_source $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" && - test "$pic_object" != none; then - func_append rmfiles " $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && - test "$non_pic_object" != none; then - func_append rmfiles " $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$opt_mode" = clean ; then - noexename=$name - case $file in - *.exe) - func_stripname '' '.exe' "$file" - file=$func_stripname_result - func_stripname '' '.exe' "$name" - noexename=$func_stripname_result - # $file with .exe has already been added to rmfiles, - # add $file without .exe - func_append rmfiles " $file" - ;; - esac - # Do a test to see if this is a libtool program. - if func_ltwrapper_p "$file"; then - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - relink_command= - func_source $func_ltwrapper_scriptname_result - func_append rmfiles " $func_ltwrapper_scriptname_result" - else - relink_command= - func_source $dir/$noexename - fi - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - func_append rmfiles " $odir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - func_append rmfiles " $odir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - func_show_eval "$RM $rmfiles" 'exit_status=1' - done - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - func_show_eval "rmdir $dir >/dev/null 2>&1" - fi - done - - exit $exit_status -} - -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && - func_mode_uninstall ${1+"$@"} - -test -z "$opt_mode" && { - help="$generic_help" - func_fatal_help "you must specify a MODE" -} - -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$opt_mode'" - -if test -n "$exec_cmd"; then - eval exec "$exec_cmd" - exit $EXIT_FAILURE -fi - -exit $exit_status - - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: -# vi:sw=2 - diff --git a/libspud/python/libspud.c b/libspud/python/libspud.c deleted file mode 100644 index 74aa300f7e..0000000000 --- a/libspud/python/libspud.c +++ /dev/null @@ -1,875 +0,0 @@ -#include -#include -#include "spud.h" -#include - -#define MAXLENGTH 2048 - -static PyObject *SpudError; -static PyObject *SpudTypeError; -static PyObject *SpudKeyError; -static PyObject *SpudFileError; -static PyObject *SpudNewKeyWarning; -static PyObject *SpudAttrSetFailedWarning; -static PyObject *SpudShapeError; -static PyObject *SpudRankError; - -void* manager; - -static PyObject * -error_checking(int outcome, char *functionname) -{ - char errormessage [MAXLENGTH]; - - if (outcome == SPUD_KEY_ERROR){ - snprintf(errormessage, MAXLENGTH, "Error: The specified option is not present " - "in the dictionary in %s", functionname); - PyErr_SetString(SpudKeyError, errormessage); - return NULL; - } - if (outcome == SPUD_TYPE_ERROR){ - snprintf(errormessage, MAXLENGTH, "Error: The specified option has a different " - "type from that of the option argument provided in (%s).", functionname); - PyErr_SetString(SpudTypeError, errormessage); - return NULL; - } - if (outcome == SPUD_NEW_KEY_WARNING){ - snprintf(errormessage, MAXLENGTH, "Warning: The option being inserted is not " - "already in the dictionary (%s).", functionname); - PyErr_SetString(SpudNewKeyWarning, errormessage); - return NULL; - } - if (outcome == SPUD_FILE_ERROR){ - snprintf(errormessage, MAXLENGTH, "Error: The specified options file cannot be " - "read or written to as the routine requires in (%s).", functionname); - PyErr_SetString(SpudFileError, errormessage); - return NULL; - } - if (outcome == SPUD_RANK_ERROR){ - snprintf(errormessage, MAXLENGTH, "Error: The specified option has a different rank from " - "that of the option argument provided (%s).", functionname); - PyErr_SetString(SpudRankError, errormessage); - return NULL; - } - if (outcome == SPUD_SHAPE_ERROR){ - snprintf(errormessage, MAXLENGTH, "Error: The specified option has a different shape from " - "that of the option argument provided in (%s).", functionname); - PyErr_SetString(SpudShapeError, errormessage); - return NULL; - } - if (outcome == SPUD_ATTR_SET_FAILED_WARNING){ - snprintf(errormessage, MAXLENGTH, "Warning: The option being set as an attribute can not be " - "set as an attribute in (%s).", functionname); - PyErr_SetString(SpudAttrSetFailedWarning, errormessage); - return NULL; - } - if (outcome == SPUD_NO_ERROR){ - Py_RETURN_NONE; - } - - PyErr_SetString(SpudError,"Error: error checking failed."); - return NULL; -} - -static PyObject * -libspud_load_options(PyObject *self, PyObject *args) -{ - const char *key; - int key_len; - int outcomeLoadOptions; - - if (!PyArg_ParseTuple(args, "s", &key)) - return NULL; - key_len = strlen(key); - outcomeLoadOptions = spud_load_options(key,key_len); - - return error_checking(outcomeLoadOptions, "load options"); -} - -static PyObject* -libspud_print_options(PyObject *self, PyObject *args) -{ - spud_print_options(); - - Py_RETURN_NONE; -} - -static PyObject* -libspud_clear_options(PyObject *self, PyObject *args) -{ - spud_clear_options(); - - Py_RETURN_NONE; -} - -static PyObject * -libspud_get_number_of_children(PyObject *self, PyObject *args) -{ - const char *key; - int key_len; - int child_count; - int outcomeGetNumChildren; - - if (!PyArg_ParseTuple(args, "s", &key)) - return NULL; - key_len = strlen(key); - outcomeGetNumChildren = spud_get_number_of_children(key, key_len, &child_count); - if (error_checking(outcomeGetNumChildren, "get number of children") == NULL){ - return NULL; - } - - return Py_BuildValue("i", child_count); -} - -static PyObject * -libspud_get_child_name(PyObject *self, PyObject *args) -{ - const char *key; - int key_len; - int index; - char child_name [MAXLENGTH]; - int i; - int outcomeGetChildName; - - for (i = 0; i < MAXLENGTH; i++){ - child_name[i] = '\0'; - } - if (!PyArg_ParseTuple(args, "si", &key, &index)){ - return NULL; - } - key_len = strlen(key); - outcomeGetChildName = spud_get_child_name(key, key_len, index, child_name, MAXLENGTH); - if (error_checking(outcomeGetChildName, "get child name") == NULL){ - return NULL; - } - - return Py_BuildValue("s", child_name); -} - -static PyObject * -libspud_option_count(PyObject *self, PyObject *args) -{ - const char *key; - int key_len; - int numoptions; - - if (!PyArg_ParseTuple(args, "s", &key)){ - return NULL; - } - key_len = strlen(key); - numoptions = spud_option_count(key, key_len); - - return Py_BuildValue("i", numoptions); -} - -static PyObject * -libspud_have_option(PyObject *self, PyObject *args) -{ - const char *key; - int key_len; - int haveoption; - - if (!PyArg_ParseTuple(args, "s", &key)){ - return NULL; - } - key_len = strlen(key); - haveoption = spud_have_option(key, key_len); - - if (haveoption == 0){ - Py_RETURN_FALSE; - } - else{ - Py_RETURN_TRUE; - } -} - -static PyObject * -libspud_add_option(PyObject *self, PyObject *args) -{ - const char *key; - int key_len; - int outcomeAddOption; - - if (!PyArg_ParseTuple(args, "s", &key)){ - return NULL; - } - key_len = strlen(key); - outcomeAddOption = spud_add_option(key, key_len); - return error_checking(outcomeAddOption, "add option"); - -} - -static PyObject * -libspud_get_option_type(PyObject *self, PyObject *args) -{ - const char *key; - int key_len; - int type; - int outcomeGetOptionType; - - if (!PyArg_ParseTuple(args, "s", &key)){ - return NULL; - } - key_len = strlen(key); - outcomeGetOptionType = spud_get_option_type(key, key_len, &type); - if (error_checking(outcomeGetOptionType, "get option type") == NULL){ - return NULL; - } - if (type == SPUD_DOUBLE){ - Py_INCREF(&PyFloat_Type); - return (PyObject*) &PyFloat_Type; - } - else if (type == SPUD_INT){ - Py_INCREF(&PyInt_Type); - return (PyObject*) &PyInt_Type; - } - else if (type == SPUD_NONE){ - Py_RETURN_NONE; - } - else if (type == SPUD_STRING){ - Py_INCREF(&PyString_Type); - return (PyObject*) &PyString_Type; - } - - PyErr_SetString(SpudError,"Error: Get option type function failed"); - return NULL; -} - -static PyObject * -libspud_get_option_rank(PyObject *self, PyObject *args) -{ - const char *key; - int key_len; - int rank; - int outcomeGetOptionRank; - - if (!PyArg_ParseTuple(args, "s", &key)){ - return NULL; - } - key_len = strlen(key); - outcomeGetOptionRank = spud_get_option_rank(key, key_len, &rank); - if (error_checking(outcomeGetOptionRank, "get option rank") == NULL){ - return NULL; - } - - return Py_BuildValue("i", rank); -} - -static PyObject * -libspud_get_option_shape(PyObject *self, PyObject *args) -{ - const char *key; - int key_len; - int shape[2]; - int outcomeGetOptionShape; - - if (!PyArg_ParseTuple(args, "s", &key)){ - return NULL; - } - key_len = strlen(key); - outcomeGetOptionShape = spud_get_option_shape(key, key_len, shape); - if (error_checking(outcomeGetOptionShape, "get option shape") == NULL){ - return NULL; - } - - return Py_BuildValue("(i,i)", shape[0],shape[1]); -} - -static PyObject* -spud_get_option_aux_list_ints(const char *key, int key_len, int type, int rank, int *shape) -{ // this function is for getting option when the option is of type a list of ints - int outcomeGetOption; - int size = shape[0]; - int val [size]; - int j; - - outcomeGetOption = spud_get_option(key, key_len, val); - if (error_checking(outcomeGetOption, "get option aux list") == NULL){ - return NULL; - } - PyObject* pylist = PyList_New(size); - if (pylist == NULL){ - printf("New list error."); - return NULL; - } - for (j = 0; j < size; j++){ - PyObject* element = Py_BuildValue("i", val[j]); - PyList_SetItem(pylist, j, element); - } - - return pylist; -} - -static PyObject* -spud_get_option_aux_list_doubles(const char *key, int key_len, int type, int rank, int *shape) -{ // this function is for getting option when the option is of type a list of doubles - int outcomeGetOption; - int size = shape[0]; - double val [size]; - int j; - - outcomeGetOption = spud_get_option(key, key_len, val); - if (error_checking(outcomeGetOption, "get option aux list") == NULL){ - return NULL; - } - PyObject* pylist = PyList_New(size); - if (pylist == NULL){ - printf("New list error."); - return NULL; - } - for (j = 0; j < size; j++){ - PyObject* element = Py_BuildValue("d", val[j]); - PyList_SetItem(pylist, j, element); - } - - return pylist; -} - -static PyObject * -spud_get_option_aux_scalar_or_string(const char *key, int key_len, int type, int rank, int *shape) -{ // this function is for getting option when the option is of type a scalar or string - int outcomeGetOption; - if (type == SPUD_DOUBLE){ - double val; - outcomeGetOption = spud_get_option(key, key_len, &val); - if (error_checking(outcomeGetOption, "get option aux scalar or string") == NULL){ - return NULL; - } - return Py_BuildValue("d", val); - } - else if (type == SPUD_INT){ - int val; - outcomeGetOption = spud_get_option(key, key_len, &val); - if (error_checking(outcomeGetOption, "get option aux scalar or string") == NULL){ - return NULL; - } - return Py_BuildValue("i", val); - } - else if (type == SPUD_STRING) { - int size = shape[0]; - char val[size+1]; - int i; - for (i = 0; i < size+1; i++) - val[i] = '\0'; - - outcomeGetOption = spud_get_option(key, key_len, val); - if (error_checking(outcomeGetOption, "get option aux scalar or string") == NULL){ - return NULL; - } - return Py_BuildValue("s", val); - } - - PyErr_SetString(SpudError,"Error: Get option aux scalar failed"); - return NULL; -} - -static PyObject* -spud_get_option_aux_tensor_doubles(const char *key, int key_len, int type, int rank, int *shape) -{ // this function is for getting option when the option is of type a tensor o doubles - int outcomeGetOption; - int rowsize = shape[0]; - int colsize = shape[1]; - int size = rowsize*colsize; - double val [size]; - int m; - int n; - int counter; - - outcomeGetOption = spud_get_option(key, key_len, val); - if (error_checking(outcomeGetOption, "get option aux tensor") == NULL){ - return NULL; - } - PyObject* pylist = PyList_New(rowsize); - if (pylist == NULL){ - printf("New list error"); - return NULL; - } - counter = 0; - for (m = 0; m < rowsize; m++){ - PyObject* pysublist = PyList_New(colsize); - if (pysublist == NULL){ - printf("New sublist error"); - return NULL; - } - for (n = 0; n < colsize; n++){ - PyObject* element = Py_BuildValue("d", val[counter]); - PyList_SetItem(pysublist, n, element); - counter++; - } - PyList_SetItem(pylist, m, pysublist); - } - - return pylist; -} - -static PyObject* -spud_get_option_aux_tensor_ints(const char *key, int key_len, int type, int rank, int *shape) -{ // this function is for getting option when the option is of type a tensor of ints - int outcomeGetOption; - int rowsize = shape[0]; - int colsize = shape[1]; - int size = rowsize*colsize; - int val [size]; - int m; - int n; - int counter; - - outcomeGetOption = spud_get_option(key, key_len, val); - if (error_checking(outcomeGetOption, "get option aux tensor") == NULL){ - return NULL; - } - PyObject* pylist = PyList_New(rowsize); - if (pylist == NULL){ - printf("New list error"); - return NULL; - } - counter = 0; - for (m = 0; m < rowsize; m++){ - PyObject* pysublist = PyList_New(colsize); - if (pysublist == NULL){ - printf("New sublist error"); - return NULL; - } - for (n = 0; n < colsize; n++){ - PyObject* element = Py_BuildValue("i", val[counter]); - PyList_SetItem(pysublist, n, element); - counter++; - } - PyList_SetItem(pylist, m, pysublist); - } - - return pylist; -} - -static PyObject * -libspud_get_option(PyObject *self, PyObject *args) -{ - const char *key; - int key_len; - int type; - int rank = 0; - int shape[2]; - int outcomeGetOptionType; - int outcomeGetOptionRank; - int outcomeGetOptionShape; - - if(!PyArg_ParseTuple(args, "s", &key)){ - return NULL; - } - key_len = strlen(key); - outcomeGetOptionRank = spud_get_option_rank(key, key_len, &rank); - if (error_checking(outcomeGetOptionRank, "get option") == NULL){ - return NULL; - } - outcomeGetOptionType = spud_get_option_type(key, key_len, &type); - if (error_checking(outcomeGetOptionType, "get option") == NULL){ - return NULL; - } - outcomeGetOptionShape = spud_get_option_shape(key, key_len, shape); - if (error_checking(outcomeGetOptionShape, "get option") == NULL){ - return NULL; - } - - if (rank == -1){ // type error - char errormessage [MAXLENGTH]; - snprintf(errormessage, MAXLENGTH, "Error: The specified option has a different \ - type from that of the option argument provided in %s", "get option"); - PyErr_SetString(SpudTypeError, errormessage); - return NULL; - } - else if (rank == 0){ // scalar - return spud_get_option_aux_scalar_or_string(key, key_len, type, rank, shape); - } - else if (rank == 1){ // list or string - if (type == SPUD_INT){ //a list of ints - return spud_get_option_aux_list_ints(key, key_len, type, rank, shape); - } - else if (type == SPUD_DOUBLE){ //a list of doubles - return spud_get_option_aux_list_doubles(key, key_len, type, rank, shape); - } - else if (type == SPUD_STRING){ //string - return spud_get_option_aux_scalar_or_string(key, key_len, type, rank, shape); - } - } - else if (rank == 2){ // tensor - if (type == SPUD_DOUBLE){ //a tensor of doubles - return spud_get_option_aux_tensor_doubles(key, key_len, type, rank, shape); - } - else if (type == SPUD_INT){ //a tensor of ints - return spud_get_option_aux_tensor_ints(key, key_len, type, rank, shape); - } - } - - PyErr_SetString(SpudError,"Error: Get option failed."); - return NULL; -} -static PyObject* -set_option_aux_list_ints(PyObject *pylist, const char *key, int key_len, int type, int rank, int *shape) -{ // this function is for setting option when the second argument is of type a list of ints - int j; - int psize = PyList_Size(pylist); - shape[0] = psize; - int val[psize] ; - int outcomeSetOption; - int element; - - for (j = 0; j < psize; j++){ - element = -1; - PyObject* pelement = PyList_GetItem(pylist, j); - PyArg_Parse(pelement, "i", &element); - val[j] = element; - } - outcomeSetOption = spud_set_option(key, key_len, val, type, rank, shape); - if (error_checking(outcomeSetOption, "set option aux list ints") == NULL){ - return NULL; - } - Py_RETURN_NONE; -} - -static PyObject* -set_option_aux_list_doubles(PyObject *pylist, const char *key, int key_len, int type, int rank, int *shape) -{ // this function is for setting option when the second argument is of type a list of doubles - int j; - int psize = PyList_Size(pylist); - shape[0] = psize; - double val [psize]; - int outcomeSetOption; - double element; - - for (j = 0; j < psize; j++){ - element = -1.0; - PyObject* pelement = PyList_GetItem(pylist, j); - element = PyFloat_AS_DOUBLE(pelement); - val[j] = element; - } - outcomeSetOption = spud_set_option(key, key_len, val, type, rank, shape); - if (error_checking(outcomeSetOption, "set option aux list ints") == NULL){ - return NULL; - } - - Py_RETURN_NONE; -} - -static PyObject* -set_option_aux_string(PyObject *pystring, const char *key, int key_len, int type, int rank, int *shape) -{ // this function is for setting option when the second argument is of type string - char *val = PyString_AsString(pystring); - int outcomeSetOption = spud_set_option(key, key_len, val, type, rank, shape); - return error_checking(outcomeSetOption, "set option aux string"); -} - -static PyObject* -libspud_set_option_attribute(PyObject *self, PyObject *args) -{ - const char*key; - int key_len; - PyObject* firstArg; - PyObject* secondArg; - const char*val; - int val_len; - int outcomeSetOption; - - firstArg = PyTuple_GetItem(args, 0); - secondArg = PyTuple_GetItem(args, 1); - PyArg_Parse(firstArg, "s", &key); - key_len = strlen(key); - PyArg_Parse(secondArg, "s", &val); - val_len = strlen(val); - outcomeSetOption = spud_set_option_attribute(key, key_len, val, val_len); - return error_checking(outcomeSetOption, "set option attribute"); -} - -static PyObject* -libspud_delete_option(PyObject *self, PyObject *args) -{ - const char*key; - int key_len; - PyObject* firstArg; - int outcomeDeleteOption; - - firstArg = PyTuple_GetItem(args, 0); - PyArg_Parse(firstArg, "s", &key); - key_len = strlen(key); - outcomeDeleteOption = spud_delete_option(key, key_len); - return error_checking(outcomeDeleteOption, "delete option"); -} - -static PyObject* -set_option_aux_tensor_doubles(PyObject *pylist, const char *key, int key_len, int type, int rank, int *shape) -{ // this function is for setting option when the second argument is of type a tensor of doubles - int i; - int j; - int counter = 0; - - int outcomeSetOption; - - int size = shape[0]*shape[1]; - - double element; - double val [size]; - - for (i = 0; i < shape[0]; i++){ - PyObject* pysublist = PyList_GetItem(pylist, i); - for (j = 0; j < shape[1]; j++){ - PyObject* pysublistElement = PyList_GetItem(pysublist, j); - element = PyFloat_AS_DOUBLE(pysublistElement); - val[counter] = (double) element; - counter ++; - } - } - - outcomeSetOption = spud_set_option(key, key_len, val, type, rank, shape); - return error_checking(outcomeSetOption, "set option aux tensor doubles"); -} - -static PyObject* -set_option_aux_tensor_ints(PyObject *pylist, const char *key, int key_len, int type, int rank, int *shape) -{ // this function is for setting option when the second argument is of type a tensor of ints - int i; - int j; - int counter = 0; - int size = shape[0]*shape[1]; - int val [size]; - int outcomeSetOption; - - int element; - - for (i = 0; i < shape[0]; i++){ - PyObject* pysublist = PyList_GetItem(pylist, i); - for (j = 0; j < shape[1]; j++){ - element = 1; - PyObject* pysublistElement = PyList_GetItem(pysublist, j); - PyArg_Parse(pysublistElement, "i", &element); - val[counter] = element; - counter ++; - } - } - - outcomeSetOption = spud_set_option(key, key_len, val, type, rank, shape); - return error_checking(outcomeSetOption, "set option aux tensor ints"); -} - -static PyObject* -set_option_aux_scalar(PyObject *pyscalar, const char *key, int key_len, int type, int rank, int *shape) -{ // this function is for setting option when the second argument is of type scalar - int outcomeSetOption = SPUD_NO_ERROR; - - if (type == SPUD_DOUBLE){ //scalar is double - double val = PyFloat_AS_DOUBLE(pyscalar); - outcomeSetOption = spud_set_option(key, key_len, &val, type, rank, shape); - } - else if (type == SPUD_INT){ - int val; - PyArg_Parse(pyscalar, "i", &val); - outcomeSetOption = spud_set_option(key, key_len, &val, type, rank, shape); - } - - return error_checking(outcomeSetOption, "set option aux scalar"); -} - - -static PyObject* -libspud_set_option(PyObject *self, PyObject *args) -{ - const char *key; - int key_len; - int type=-1; - int rank=-1; - int shape[2]; - PyObject* firstArg; - PyObject* secondArg; - - if(PyTuple_GET_SIZE(args)!=2){ - PyErr_SetString(SpudError,"Error: set_option takes exactly 2 arguments."); - return NULL; - } - - firstArg = PyTuple_GetItem(args, 0); - secondArg = PyTuple_GetItem(args, 1); - PyArg_Parse(firstArg, "s", &key); - key_len = strlen(key); - - if (!spud_have_option(key, key_len)){ //option does not exist yet - int outcomeAddOption = spud_add_option(key, key_len); - error_checking(outcomeAddOption, "set option"); - } - - if (PyInt_Check(secondArg)){ //just an int - type = SPUD_INT; - rank = 0; - shape[0] = -1; - shape[1] = -1; - - } - else if (PyString_Check(secondArg)){// a string - type = SPUD_STRING; - rank = 1; - shape[0] = PyString_GET_SIZE(secondArg); - shape[1] = -1; - } - else if (PyFloat_Check(secondArg)){// a double - type = SPUD_DOUBLE; - rank = 0; - shape[0] = -1; - shape[1] = -1; - } - else if (PyList_Check(secondArg)){ - PyObject* listElement = PyList_GetItem(secondArg, 0); - if (PyInt_Check(listElement)){ //list of ints - type = SPUD_INT; - rank = 1; - shape[0] = 1; - shape[1] = -1; - } - else if (PyFloat_Check(listElement)){ - type = SPUD_DOUBLE; //list of doubles - rank = 1; - shape[0] = 1; - shape[1] = -1; - } - else if (PyList_Check(listElement)){ //list of lists - int pylistSize = PyList_GET_SIZE(secondArg); - int pysublistSize = PyList_GET_SIZE(listElement); - PyObject* sublistElement = PyList_GetItem(listElement, 0); - if (PyInt_Check(sublistElement)){ //list of lists of ints - type = SPUD_INT; - } - else if (PyFloat_Check(sublistElement)){//list of lists of doubles - type = SPUD_DOUBLE; - } - rank = 2; - shape[0] = pylistSize; - shape[1] = pysublistSize; - } - } - - if (rank == 0){ // scalar - set_option_aux_scalar(secondArg, key, key_len, type, rank, shape); - } - else if (rank == 1){ // list or string - if (PyString_Check(secondArg)){ // pystring - set_option_aux_string(secondArg, key, key_len, type, rank, shape); - } - else if (type == SPUD_INT) { // list of ints - set_option_aux_list_ints(secondArg, key, key_len, type, rank, shape); - } - else if (type == SPUD_DOUBLE){ // list of doubles - set_option_aux_list_doubles(secondArg, key, key_len, type, rank, shape); - } - } - else if (rank == 2){ // tensor - if (type == SPUD_DOUBLE) { // tensor of doubles - set_option_aux_tensor_doubles(secondArg, key, key_len, type, rank, shape); - } - else if (type == SPUD_INT) { // tensor of ints - set_option_aux_tensor_ints(secondArg, key, key_len, type, rank, shape); - } - } - - if (PyErr_Occurred()){ - return NULL; - } - else { - Py_RETURN_NONE; - } -} - -static PyObject* -libspud_write_options(PyObject *self, PyObject *args) -{ - PyObject* firstArg; - char *filename; - int filename_len; - int outcomeWriteOptions; - - firstArg = PyTuple_GetItem(args, 0); - PyArg_Parse(firstArg, "s", &filename); - filename_len = strlen(filename); - outcomeWriteOptions = spud_write_options (filename, filename_len); - return error_checking(outcomeWriteOptions, "write options"); -} - -static PyMethodDef libspudMethods[] = { - {"load_options", libspud_load_options, METH_VARARGS, - PyDoc_STR("Reads the xml file into the options tree.")}, - {"print_options", libspud_print_options, METH_VARARGS, - PyDoc_STR("Print the entire options tree to standard output.")}, - {"clear_options", libspud_clear_options, METH_VARARGS, - PyDoc_STR("Clears the entire options tree.")}, - {"get_number_of_children", libspud_get_number_of_children, METH_VARARGS, - PyDoc_STR("get number of children under key.")}, - {"get_child_name", libspud_get_child_name, METH_VARARGS, - PyDoc_STR("Get name of the indexth child of key.")}, - {"option_count", libspud_option_count, METH_VARARGS, - PyDoc_STR("Return the number of options matching key.")}, - {"have_option", libspud_have_option, METH_VARARGS, - PyDoc_STR("Checks whether key is present in options dictionary.")}, - {"get_option_type", libspud_get_option_type, METH_VARARGS, - PyDoc_STR("Returns the type of option specified by key.")}, - {"get_option_rank", libspud_get_option_rank, METH_VARARGS, - PyDoc_STR("Return the rank of option specified by key.")}, - {"get_option_shape", libspud_get_option_shape, METH_VARARGS, - PyDoc_STR("Return the shape of option specified by key.")}, - {"get_option", libspud_get_option, METH_VARARGS, - PyDoc_STR("Retrives option values from the options dictionary.")}, - {"set_option", libspud_set_option, METH_VARARGS, - PyDoc_STR("Sets options in the options tree.")}, - {"write_options", libspud_write_options, METH_VARARGS, - PyDoc_STR("Write options tree out to the xml file specified by name.")}, - {"delete_option", libspud_delete_option, METH_VARARGS, - PyDoc_STR("Delete options at the specified key.")}, - {"set_option_attribute", libspud_set_option_attribute, METH_VARARGS, - PyDoc_STR("As set_option, but additionally attempts to mark the option at the \ - specified key as an attribute. Set_option_attribute accepts only string data for val.")}, - {"add_option", libspud_add_option, METH_VARARGS, - PyDoc_STR("Creates a new option at the supplied key.")}, - {NULL, NULL, 0, NULL}, - /* Sentinel */ -}; - -PyMODINIT_FUNC -initlibspud(void) -{ - PyObject *m; - - m = Py_InitModule("libspud", libspudMethods); - if (m == NULL) - return; - - SpudError = PyErr_NewException("Spud.error", NULL, NULL); - SpudNewKeyWarning = PyErr_NewException("SpudNewKey.warning", NULL, NULL); - SpudKeyError = PyErr_NewException("SpudKey.error", NULL, NULL); - SpudTypeError = PyErr_NewException("SpudType.error", NULL, NULL); - SpudFileError = PyErr_NewException("SpudFile.error", NULL, NULL); - SpudAttrSetFailedWarning = PyErr_NewException("SpudAttrSetFailed.warning", NULL, NULL); - SpudShapeError = PyErr_NewException("SpudShape.error", NULL, NULL); - SpudRankError = PyErr_NewException("SpudRank.error", NULL, NULL); - - Py_INCREF(SpudError); - Py_INCREF(SpudNewKeyWarning); - Py_INCREF(SpudKeyError); - Py_INCREF(SpudTypeError); - Py_INCREF(SpudFileError); - Py_INCREF(SpudRankError); - Py_INCREF(SpudShapeError); - Py_INCREF(SpudAttrSetFailedWarning); - - PyModule_AddObject(m, "SpudError", SpudError); - PyModule_AddObject(m, "SpudNewKeyWarning", SpudNewKeyWarning); - PyModule_AddObject(m, "SpudKeyError", SpudKeyError); - PyModule_AddObject(m, "SpudTypeError", SpudTypeError); - PyModule_AddObject(m, "SpudFileError", SpudFileError); - PyModule_AddObject(m, "SpudAttrSetFailedWarning", SpudAttrSetFailedWarning); - PyModule_AddObject(m, "SpudShapeError", SpudShapeError); - PyModule_AddObject(m, "SpudRankError", SpudRankError); - - -#if PY_MINOR_VERSION > 6 - manager = PyCapsule_Import("spud_manager._spud_manager", 0); - if (manager != NULL) spud_set_manager(manager); - else PyErr_Clear(); -#endif - -} - - diff --git a/libspud/python/libspud.py.ctypes b/libspud/python/libspud.py.ctypes deleted file mode 100644 index 4b1a5f676b..0000000000 --- a/libspud/python/libspud.py.ctypes +++ /dev/null @@ -1,307 +0,0 @@ -#!/usr/bin/env python - -# A draft python binding for libspud -# You will need to compile _libspud.so -# by hand for now -- haven't hooked it up -# to the Makefile - -from ctypes import * -import os - -SPUD_REAL = 0 -SPUD_INTEGER = 1 -SPUD_NONE = 2 -SPUD_CHARACTER = 3 -pytype_map = {SPUD_REAL: float, SPUD_INTEGER: int, SPUD_NONE: None, SPUD_CHARACTER: str} -typepy_map = {float: SPUD_REAL, int: SPUD_INTEGER, None: SPUD_NONE, str: SPUD_CHARACTER} -ctype_map = {float: c_double, int: c_int, None: None, str: c_char_p} - -SPUD_NO_ERROR = 0 -SPUD_KEY_ERROR = 1 -SPUD_TYPE_ERROR = 2 -SPUD_RANK_ERROR = 3 -SPUD_SHAPE_ERROR = 4 -SPUD_NEW_KEY_WARNING = -1 -SPUD_ATTR_SET_FAILED_WARNING = -2 - -OPTION_PATH_LEN = 8192 - -class SpudKeyError(Exception): - def __init__(self, msg = "The specified option is not present in the dictionary."): - self.message = msg - -class SpudTypeError(Exception): - def __init__(self, msg = "The specified option has a different type from that of the option argument provided."): - self.message = msg - -class SpudRankError(Exception): - def __init__(self, msg = "The specified option has a different rank from that of the option argument provided."): - self.message = msg - -class SpudShapeError(Exception): - def __init__(self, msg = "The specified option has a different shape from that of the option argument provided."): - self.message = msg - -class SpudNewKeyWarning(Exception): - def __init__(self, msg = "The option being inserted is not already in the dictionary."): - self.message = msg - -class SpudAttrSetFailedWarning(Exception): - def __init__(self, msg = "The option being set as an attribute can not be set as an attribute."): - self.message = msg - -spud_exceptions = {SPUD_KEY_ERROR: SpudKeyError, - SPUD_TYPE_ERROR: SpudTypeError, - SPUD_RANK_ERROR: SpudRankError, - SPUD_SHAPE_ERROR: SpudShapeError, - SPUD_NEW_KEY_WARNING: SpudNewKeyWarning, - SPUD_ATTR_SET_FAILED_WARNING: SpudAttrSetFailedWarning} - -libspud = cdll.LoadLibrary('@prefix@' + '/lib/libspud.so') - -cclear_options = libspud.spud_clear_options -cclear_options.argtypes = [] -cclear_options.restype = None - -def clear_options(): - cclear_options() - -cload_options = libspud.spud_load_options -cload_options.argtypes = [c_char_p, c_int] -cload_options.restype = c_int - -def load_options(s): - out = cload_options(s, c_int(len(s))) - if out != SPUD_NO_ERROR: - raise spud_exceptions[out] - -cwrite_options = libspud.spud_write_options -cwrite_options.argtypes = [c_char_p, c_int] -cwrite_options.restype = c_int - -def write_options(filename): - out = cwrite_options(filename, c_int(len(filename))) - if out != SPUD_NO_ERROR: - raise spud_exceptions[out] - -cget_child_name = libspud.spud_get_child_name -cget_child_name.argtypes = [c_char_p, c_int, c_int, c_char_p, c_int] -cget_child_name.restype = c_int - -def get_child_name(s, idx): - val = create_string_buffer(OPTION_PATH_LEN) - out = cget_child_name(s, c_int(len(s)), c_int(idx), val, c_int(len(val))) - - if out != SPUD_NO_ERROR: - raise spud_exceptions[out] - - return val.value.strip() - -cget_number_of_children = libspud.spud_get_number_of_children -cget_number_of_children.argtypes = [c_char_p, c_int, POINTER(c_int)] -cget_number_of_children.restype = c_int - -def get_number_of_children(s): - val = c_int() - out = cget_number_of_children(s, c_int(len(s)), byref(val)) - - if out != SPUD_NO_ERROR: - raise spud_exceptions[out] - - return val.value - -coption_count = libspud.spud_option_count -coption_count.argtypes = [c_char_p, c_int] -coption_count.restype = c_int - -def option_count(s): - return coption_count(s, c_int(len(s))) - -chave_option = libspud.spud_have_option -chave_option.argtypes = [c_char_p, c_int] -chave_option.restype = c_int - -def have_option(s): - out = chave_option(s, c_int(len(s))) - - if out == 1: - return True - else: - return False - -cget_option_type = libspud.spud_get_option_type -cget_option_type.argtypes = [c_char_p, c_int, POINTER(c_int)] -cget_option_type.restype = c_int - -def get_option_type(s): - val = c_int() - out = cget_option_type(s, c_int(len(s)), byref(val)) - - if out != SPUD_NO_ERROR: - raise spud_exceptions[out] - - return pytype_map[val.value] - -cget_option_rank = libspud.spud_get_option_rank -cget_option_rank.argtypes = [c_char_p, c_int, POINTER(c_int)] -cget_option_rank.restype = c_int - -def get_option_rank(s): - rank = c_int() - out = cget_option_rank(s, c_int(len(s)), byref(rank)) - if out != SPUD_NO_ERROR: - raise spud_exceptions[out] - return rank.value - -cget_option_shape = libspud.spud_get_option_shape -cget_option_shape.argtypes = [c_char_p, c_int, POINTER(c_int)] -cget_option_shape.restype = int - -def get_option_shape(s): - shape_type = c_int * 2 - shape = shape_type() - out = cget_option_shape(s, c_int(len(s)), shape) - - if out != SPUD_NO_ERROR: - raise spud_exceptions[out] - - return tuple(shape) - -cget_option = libspud.spud_get_option -cget_option.argtypes = [c_char_p, c_int, c_void_p] -cget_option.restype = c_int - -def get_option(s): - type = get_option_type(s) - rank=0 - if type is str: - strlen = get_option_shape(s)[0] - val = create_string_buffer(strlen+1) - elif type is None: - raise spud_exceptions[SPUD_TYPE_ERROR]("No value exists at the given path") - else: - val_type = ctype_map[type] - rank = get_option_rank(s) - shape = get_option_shape(s) - # reverse the numbering so we get a rowxcolumn list of lists - for i in range(rank-1, -1, -1): val_type = val_type*shape[i] - val = val_type() - - out = cget_option(s, c_int(len(s)), byref(val)) - if out != SPUD_NO_ERROR: - raise spud_exceptions[out] - - if rank==2: - val_out = [[val[i][j] for j in range(shape[1])] for i in range(shape[0])] - elif rank==1: - val_out = [val[i] for i in range(shape[0])] - else: - val_out = val.value - return val_out - -cadd_option = libspud.spud_add_option -cadd_option.argtypes = [c_char_p, c_int] -cadd_option.restype = c_int - -def add_option(s): - out = cadd_option(s, c_int(len(s))) - - if out != SPUD_NO_ERROR: - raise spud_exceptions[out] - - return - -cset_option = libspud.spud_set_option -cset_option.argtypes = [c_char_p, c_int, c_void_p, c_int, c_int, POINTER(c_int)] -cset_option.restype = c_int - -def set_option(s, val): - rank = 0 - shape_type = c_int * 2 - shape = shape_type(1, -1) - py_type = type(val) - if py_type not in typepy_map: - if py_type == list: - subval = val - for i in range(2): - if type(subval) == list: - shape[i] = len(subval) - rank += 1 - subval = subval[0] - else: - break - py_type = type(subval) - # elif ... - # could put numpy array handling in here - # (they'd be easier but didn't want to - # add a numpy dependency) - else: - raise spud_exceptions[SPUD_TYPE_ERROR]("Unknown value type. Only know about floats, ints, strings and lists thereof.") - spud_code = typepy_map[py_type] - c_type = ctype_map[py_type] - # reverse the order of the shape entries as that way we end up with a rows x columns c_type - for i in range(rank-1, -1, -1): c_type = c_type*shape[i] - if rank == 2: - c_val = c_type() - for i in range(shape[0]): - for j in range(shape[1]): - c_val[i][j] = val[i][j] - elif rank == 1: - c_val = c_type() - for i in range(shape[0]): - c_val[i] = val[i] - else: - c_val = c_type(val) - - if py_type is str: - shape = shape_type(len(val), -1) - rank = 1 - out = cset_option(s, c_int(len(s)), (c_val), c_int(spud_code), c_int(rank), shape) - else: - out = cset_option(s, c_int(len(s)), byref(c_val), c_int(spud_code), c_int(rank), shape) - - if out != SPUD_NO_ERROR: - raise spud_exceptions[out] - -cset_option_attribute = libspud.spud_set_option_attribute -cset_option_attribute.argtypes = [c_char_p, c_int, c_char_p, c_int] -cset_option_attribute.restype = c_int - -def set_option_attribute(s, val): - out = cset_option_attribute(s, c_int(len(s)), val, c_int(len(val))) - - if out != SPUD_NO_ERROR: - raise spud_exceptions[out] - - return - -cdelete_option = libspud.spud_delete_option -cdelete_option.argtypes = [c_char_p, c_int] -cdelete_option.restype = c_int - -def delete_option(s): - out = cdelete_option(s, c_int(len(s))) - - if out != SPUD_NO_ERROR: - raise spud_exceptions[out] - - return - -cmove_option = libspud.spud_move_option -cmove_option.argtypes = [c_char_p, c_int, c_char_p, c_int] -cmove_option.restype = c_int - -def move_option(s1, s2): - out = cmove_option(s1, c_int(len(s1)), s2, c_int(len(s2))) - - if out != SPUD_NO_ERROR: - raise spud_exceptions[out] - - return - -cprint_options = libspud.spud_print_options -cprint_options.restype = None -cprint_options.argtypes = [] - -def print_options(): - cprint_options() diff --git a/libspud/python/setup.py b/libspud/python/setup.py deleted file mode 100644 index da84618c8b..0000000000 --- a/libspud/python/setup.py +++ /dev/null @@ -1,9 +0,0 @@ -from distutils.core import setup, Extension -import os.path - -module1 = Extension('libspud', sources = ['libspud.c'], libraries=["spud"], library_dirs=[os.path.abspath("..")], include_dirs=[os.path.abspath("../include")]) - -setup (name = 'libspud', - version = '1.1.3', - description = 'Python bindings for libspud', - ext_modules = [module1]) diff --git a/libspud/python/test.flml b/libspud/python/test.flml deleted file mode 100644 index 00615caf5a..0000000000 --- a/libspud/python/test.flml +++ /dev/null @@ -1,382 +0,0 @@ - - - - explicit-hyperc-superman-conservative - - - multimaterial - - - - 2 - - - - - - - - - - - - - - - 0 - - - - discontinuous - - - - - - - - - - - - - - - - - 1 - - - 1 - - - - - - vtk - - - - 100 - - - - - - 10000000 - 10 - - - - - - - - 0.0 - - - 0.025 - this is overwritten by the adaptive timestepping - - - 3.0 - - - - 0.25 - - - - - - - - - - - 1.0 - - - - - - - 1.0 2.0 - - - - - - - - - - - - - - - - - - - 1.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - def val(X,t): - # Do not remove this comment - u = 0.25 * ((4*X[0] - 2) + (4*X[1] - 2)**3) - v = -0.25 * ((4*X[1] - 2) + (4*X[0] - 2)**3) - return [u, v] - - - - - - - - - - - - - - - - - - - - - - - - - - 1.E-12 - - - 10000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.0 - - - - - 0.0 - - - - 0.0 - - - - - - - def val(X,t): - from math import sqrt, pi - dx1 = X[0]-0.5 - dx2 = X[1]-0.5 - r=sqrt(dx1*dx1+dx2*dx2) - if (r<=(0.25)): - return 1.0 - else: - return 0.0 - - - - - 7 8 9 10 - - - - - - - - - - - - - - - - - - - - - - - def val(X,t): - from math import sqrt, pi - dx1 = X[0]-0.5 - dx2 = X[1]-0.5 - r=sqrt(dx1*dx1+dx2*dx2) - if (r<=(0.25)): - return 1.0 - else: - return 0.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0 2.0 3.0 4.0 - - - - - - - - - - - - - 1.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libspud/python/test_libspud.py b/libspud/python/test_libspud.py deleted file mode 100644 index 36b2ac9ae1..0000000000 --- a/libspud/python/test_libspud.py +++ /dev/null @@ -1,124 +0,0 @@ -import libspud - -libspud.load_options('test.flml') - -#libspud.print_options() - -assert libspud.get_option('/timestepping/timestep') == 0.025 - -assert libspud.get_number_of_children('/geometry') == 5 -assert libspud.get_child_name('geometry', 0) == "dimension" - -assert libspud.option_count('/problem_type') == 1 -assert libspud.have_option('/problem_type') - -assert libspud.get_option_type('/geometry/dimension') is int -assert libspud.get_option_type('/problem_type') is str - -assert libspud.get_option_rank('/geometry/dimension') == 0 -assert libspud.get_option_rank('/physical_parameters/gravity/vector_field::GravityDirection/prescribed/value/constant') == 1 - -assert libspud.get_option_shape('/geometry/dimension') == (-1, -1) -assert libspud.get_option_shape('/problem_type')[0] > 1 -assert libspud.get_option_shape('/problem_type')[1] == -1 - -assert libspud.get_option('/problem_type') == "multimaterial" -assert libspud.get_option('/geometry/dimension') == 2 -libspud.set_option('/geometry/dimension', 3) - - -assert libspud.get_option('/geometry/dimension') == 3 - -list_path = '/material_phase::Material1/scalar_field::MaterialVolumeFraction/prognostic/boundary_conditions::LetNoOneLeave/surface_ids' -assert libspud.get_option_shape(list_path) == (4, -1) -assert libspud.get_option_rank(list_path) == 1 -assert libspud.get_option(list_path) == [7, 8, 9, 10] - -libspud.set_option(list_path, [11, 12, 13, 14, 15]) -assert libspud.get_option_shape(list_path) == (5, -1) -assert libspud.get_option_rank(list_path) == 1 -assert libspud.get_option(list_path)==[11, 12, 13, 14, 15] - -tensor_path = '/material_phase::Material1/tensor_field::DummyTensor/prescribed/value::WholeMesh/anisotropic_asymmetric/constant' -assert libspud.get_option_shape(tensor_path) == (2, 2) -assert libspud.get_option_rank(tensor_path) == 2 - -assert libspud.get_option(tensor_path)==[[1.0,2.0],[3.0,4.0]] - -libspud.set_option(tensor_path, [[5.0,6.0,2.0],[7.0,8.0,1.0]]) -assert libspud.get_option_shape(tensor_path) == (2,3) -assert libspud.get_option_rank(tensor_path) == 2 - -assert(libspud.get_option(tensor_path)==[[5.0, 6.0, 2.0],[7.0, 8.0, 1.0]]) - -try: - libspud.add_option('/foo') - assert False -except libspud.SpudNewKeyWarning, e: - pass - -assert libspud.option_count('/foo') == 1 - -libspud.set_option('/problem_type', 'helloworld') -assert libspud.get_option('/problem_type') == "helloworld" - -try: - libspud.set_option_attribute('/foo/bar', 'foobar') - assert False -except libspud.SpudNewKeyWarning, e: - pass - -assert libspud.get_option('/foo/bar') == "foobar" - -libspud.delete_option('/foo') -assert libspud.option_count('/foo') == 0 - -try: - libspud.get_option('/foo') - assert False -except libspud.SpudKeyError, e: - pass - -try: - libspud.get_option('/geometry') - assert False -except libspud.SpudTypeError, e: - pass - -libspud.write_options('test_out.flml') - -try: - libspud.set_option('/test', 4.3) -except libspud.SpudNewKeyWarning, e: - pass - -assert libspud.get_option('/test') == 4.3 - -libspud.set_option('/test',4) - -assert libspud.get_option('/test') == 4 - -libspud.set_option('/test',[[4.0,2.0,3.0],[2.0,5.0,6.6]]) - -assert libspud.get_option('/test') == [[4.0,2.0,3.0],[2.0,5.0,6.6]] - -libspud.set_option('/test',"Hallo") - -assert libspud.get_option('/test') == "Hallo" - -libspud.set_option('/test',[1,2,3]) - -assert libspud.get_option('/test') == [1,2,3] - -libspud.set_option('/test',[2.3,3.3]) - -assert libspud.get_option('/test') == [2.3,3.3] - -try: - libspud.set_option('/test') - assert False -except libspud.SpudError, e: - pass - - -print "All tests passed!" diff --git a/libspud/schema/spud_base.rnc b/libspud/schema/spud_base.rnc deleted file mode 100644 index 1706f0b5db..0000000000 --- a/libspud/schema/spud_base.rnc +++ /dev/null @@ -1,226 +0,0 @@ -# Any value in the xml file can be accompanied by a comment -# displayed together in the gui. -comment = - element comment { - xsd:string - }? - -# A simple string -anystring = - ( - element string_value{ - # Lines is a hint to the gui about the size of the text box. - # It is not an enforced limit on string length. - attribute lines { "1" }, - xsd:string - }, - comment - ) - -# a filename for which the gui -filename = - ( - element string_value{ - attribute type { "filename" }, - # Lines is a hint to the gui about the size of the text box. - # It is not an enforced limit on string length. - attribute lines { "1" }, - xsd:string - }, - comment - ) - -# python_code is just a long string -python_code = - ( - element string_value{ - attribute type { "code" }, - attribute language { "python" }, - # Lines is a hint to the gui about the size of the text box. - # It is not an enforced limit on string length. - attribute lines { "20" }, - xsd:string - }, - comment - ) - -integer = - ( - element integer_value{ - attribute rank { "0" }, - list {xsd:integer} - }, - comment - ) - -# an integer vector of any length -integer_vector = - ( - element integer_value{ - attribute rank { "1" }, - attribute shape { xsd:integer }, - list {xsd:integer+} - }, - comment - ) - -# an integer tensor of any shape -integer_tensor = - ( - element integer_value{ - attribute rank { "2" }, - attribute shape { list{xsd:integer, xsd:integer} }, - list {xsd:integer+} - }, - comment - ) - -# An integer vector of length dim -integer_dim_vector = - ( - element integer_value{ - attribute rank { "1" }, - # Setting dim1 to a function of dim allows the gui to set the - # vector to the right length. - attribute dim1 { "dim" }, - attribute shape { xsd:integer }, - list {xsd:integer+} - }, - comment - ) - -# An dim x dim integer matrix (rank 2 tensor). -integer_dim_tensor = - ( - element integer_value{ - attribute rank { "2" }, - # Setting dim1, dim2 to a function of dim allows the gui to set the - # tensor to the right shape. - attribute dim1 { "dim" }, - attribute dim2 { "dim" }, - attribute shape { list{xsd:integer, xsd:integer} }, - list {xsd:integer+} - }, - comment - ) - -real = - ( - element real_value{ - attribute rank { "0" }, - list {xsd:float} - }, - comment - ) - -# An arbitrary length real vector -real_vector = - ( - element real_value{ - attribute rank { "1" }, - attribute shape { xsd:integer }, - list {xsd:float+} - }, - comment - ) - -# An arbitrary size real matrix (rank 2 tensor). -real_tensor = - ( - element real_value{ - attribute rank { "2" }, - attribute shape { list{xsd:integer, xsd:integer} }, - list {xsd:float+} - }, - comment - ) - -# A real vector of length dim -real_dim_vector = - ( - element real_value{ - attribute rank { "1" }, - # Setting dim1 to a function of dim allows the gui to set the - # vector to the right length. - attribute dim1 { "dim" }, - attribute shape { xsd:integer }, - list{xsd:float+} - }, - comment - ) - -# A real vector of length dim minus one -real_dim_minus_one_vector = - ( - element real_value{ - attribute rank { "1" }, - # Setting dim1 to a function of dim allows the gui to set the - # vector to the right length. - attribute dim1 { "dim-1" }, - attribute shape { xsd:integer }, - list{xsd:float+} - }, - comment - ) - -# A dim x dim real matrix (rank 2 tensor). -real_dim_tensor = - ( - element real_value{ - attribute symmetric {"false"}, - attribute rank { "2" }, - # Setting dim1, dim2 to a function of dim allows the gui to set the - # tensor to the right shape. - attribute dim1 { "dim" }, - attribute dim2 { "dim" }, - attribute shape { list{xsd:integer, xsd:integer} }, - list {xsd:float+} - }, - comment - ) - -# A dim x dim real matrix (rank 2 tensor) constrained to be symmetric. -real_dim_symmetric_tensor = - ( - element real_value{ - attribute symmetric {"true"}, - attribute rank { "2" }, - attribute dim1 { "dim" }, - attribute dim2 { "dim" }, - attribute shape { list{xsd:integer, xsd:integer} }, - list {xsd:float+} - }, - comment - ) - -# A dim-1 x dim-1 real matrix (rank 2 tensor). -real_dim_minus_one_tensor = - ( - element real_value{ - attribute symmetric {"false"}, - attribute rank { "2" }, - # Setting dim1, dim2 to a function of dim allows the gui to set the - # tensor to the right shape. - attribute dim1 { "dim-1" }, - attribute dim2 { "dim-1" }, - attribute shape { list{xsd:integer, xsd:integer} }, - list {xsd:float+} - }, - comment - ) - -# A dim-1 x dim-1 real matrix (rank 2 tensor) constrained to be symmetric. -real_dim_minus_one_symmetric_tensor = - ( - element real_value{ - attribute symmetric {"true"}, - attribute rank { "2" }, - # Setting dim1, dim2 to a function of dim allows the gui to set the - # tensor to the right shape. - attribute dim1 { "dim-1" }, - attribute dim2 { "dim-1" }, - attribute shape { list{xsd:integer, xsd:integer} }, - list {xsd:float+} - }, - comment - ) diff --git a/libspud/schema/spud_base.rng b/libspud/schema/spud_base.rng deleted file mode 100644 index 5ab5d79512..0000000000 --- a/libspud/schema/spud_base.rng +++ /dev/null @@ -1,391 +0,0 @@ - - - - - - - - - - - - - - - - 1 - - - - - - - - - - filename - - - - 1 - - - - - - - - - - code - - - python - - - - 20 - - - - - - - - - 0 - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - 2 - - - - - - - - - - - - - - - - - - - - 1 - - - - dim - - - - - - - - - - - - - - - - - 2 - - - - dim - - - dim - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - 2 - - - - - - - - - - - - - - - - - - - - 1 - - - - dim - - - - - - - - - - - - - - - - - 1 - - - - dim-1 - - - - - - - - - - - - - - - - - false - - - 2 - - - - dim - - - dim - - - - - - - - - - - - - - - - - - - - true - - - 2 - - - dim - - - dim - - - - - - - - - - - - - - - - - - - - false - - - 2 - - - - dim-1 - - - dim-1 - - - - - - - - - - - - - - - - - - - - true - - - 2 - - - - dim-1 - - - dim-1 - - - - - - - - - - - - - - - - diff --git a/libspud/src/fspud.f90 b/libspud/src/fspud.f90 deleted file mode 100644 index 23a4ce0c8b..0000000000 --- a/libspud/src/fspud.f90 +++ /dev/null @@ -1,1183 +0,0 @@ -! Copyright (C) 2007 Imperial College London and others. -! -! Please see the AUTHORS file in the main source directory for a full list -! of copyright holders. -! -! Applied Modelling and Computation Group -! Department of Earth Science and Engineering -! Imperial College London -! -! David.Ham@Imperial.ac.uk -! -! This library is free software; you can redistribute it and/or -! modify it under the terms of the GNU Lesser General Public -! License as published by the Free Software Foundation, -! version 2.1 of the License. -! -! This library is distributed in the hope that it will be useful, -! but WITHOUT ANY WARRANTY; without even the implied warranty of -! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -! Lesser General Public License for more details. -! -! You should have received a copy of the GNU Lesser General Public -! License along with this library; if not, write to the Free Software -! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -! USA - -module spud - use iso_c_binding - implicit none - - private - - integer, parameter :: D = c_double - - integer, parameter, public :: & - & SPUD_REAL = 0, & - & SPUD_INTEGER = 1, & - & SPUD_NONE = 2, & - & SPUD_CHARACTER = 3 - - integer, parameter, public :: & - & SPUD_NO_ERROR = 0, & - & SPUD_KEY_ERROR = 1, & - & SPUD_TYPE_ERROR = 2, & - & SPUD_RANK_ERROR = 3, & - & SPUD_SHAPE_ERROR = 4, & - & SPUD_FILE_ERROR = 5, & - & SPUD_NEW_KEY_WARNING = -1, & - & SPUD_ATTR_SET_FAILED_WARNING = -2 - - public :: & - & clear_options, & - & load_options, & - & write_options, & - & get_child_name, & - & get_number_of_children, & - & option_count, & - & have_option, & - & option_type, & - & option_rank, & - & option_shape, & - & get_option, & - & add_option, & - & set_option, & - & set_option_attribute, & - & move_option, & - & copy_option, & - & delete_option, & - & print_options - - interface get_option - module procedure & - & get_option_real_scalar, & - & get_option_real_vector, & - & get_option_real_tensor, & - & get_option_real_scalar_sp, & - & get_option_real_vector_sp, & - & get_option_real_tensor_sp, & - & get_option_integer_scalar, & - & get_option_integer_vector, & - & get_option_integer_tensor, & - & get_option_character - end interface - - interface set_option - module procedure & - & set_option_real_scalar, & - & set_option_real_vector, & - & set_option_real_tensor, & - & set_option_real_scalar_sp, & - & set_option_real_vector_sp, & - & set_option_real_tensor_sp, & - & set_option_integer_scalar, & - & set_option_integer_vector, & - & set_option_integer_tensor, & - & set_option_character - end interface - - ! C interfaces - interface - subroutine spud_clear_options() bind(c) - end subroutine spud_clear_options - - function spud_load_options(key, key_len) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key_len - character(len=1,kind=c_char), dimension(key_len), intent(in) :: key - integer(c_int) :: spud_load_options - end function spud_load_options - - function spud_write_options(key, key_len) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key_len - character(len=1,kind=c_char), dimension(key_len), intent(in) :: key - integer(c_int) :: spud_write_options - end function spud_write_options - - function spud_get_child_name(key, key_len, index, child_name, child_name_len) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key_len - integer(c_int), intent(in), value :: child_name_len - character(len=1,kind=c_char), dimension(key_len), intent(in) :: key - integer(c_int), intent(in), value :: index - character(len=1,kind=c_char), dimension(child_name_len), intent(out) :: child_name - integer(c_int) :: spud_get_child_name - end function spud_get_child_name - - function spud_get_number_of_children(key, key_len, child_count) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key_len - character(len=1,kind=c_char), dimension(key_len), intent(in) :: key - integer(c_int), intent(out) :: child_count - integer(c_int) :: spud_get_number_of_children - end function spud_get_number_of_children - - function spud_option_count(key, key_len) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key_len - character(len=1,kind=c_char), dimension(key_len), intent(in) :: key - integer(c_int) :: spud_option_count - end function spud_option_count - - function spud_have_option(key, key_len) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key_len - character(len=1,kind=c_char), dimension(key_len), intent(in) :: key - integer(c_int) :: spud_have_option - end function spud_have_option - - function spud_get_option_type(key, key_len, option_type) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key_len - character(len=1,kind=c_char), dimension(key_len), intent(in) :: key - integer(c_int), intent(out) :: option_type - integer(c_int) :: spud_get_option_type - end function spud_get_option_type - - function spud_get_option_rank(key, key_len, option_rank) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key_len - character(len=1,kind=c_char), dimension(key_len), intent(in) :: key - integer(c_int), intent(out) :: option_rank - integer(c_int) :: spud_get_option_rank - end function spud_get_option_rank - - function spud_get_option_shape(key, key_len, shape) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key_len - character(len=1,kind=c_char), dimension(key_len), intent(in) :: key - integer(c_int), dimension(2), intent(out) :: shape - integer(c_int) :: spud_get_option_shape - end function spud_get_option_shape - - function spud_add_option(key, key_len) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key_len - character(len=1,kind=c_char), dimension(key_len), intent(in) :: key - integer(c_int) :: spud_add_option - end function spud_add_option - - function spud_set_option_attribute(key, key_len, val, val_len) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key_len - integer(c_int), intent(in), value :: val_len - character(len=1,kind=c_char), dimension(key_len), intent(in) :: key - character(len=1,kind=c_char), dimension(val_len), intent(in) :: val - integer(c_int) :: spud_set_option_attribute - end function spud_set_option_attribute - - function spud_move_option(key1, key1_len, key2, key2_len) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key1_len - integer(c_int), intent(in), value :: key2_len - character(len = 1,kind=c_char), dimension(key1_len), intent(in) :: key1 - character(len = 1,kind=c_char), dimension(key2_len), intent(in) :: key2 - integer(c_int) :: spud_move_option - end function spud_move_option - - function spud_copy_option(key1, key1_len, key2, key2_len) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key1_len - integer(c_int), intent(in), value :: key2_len - character(len = 1,kind=c_char), dimension(key1_len), intent(in) :: key1 - character(len = 1,kind=c_char), dimension(key2_len), intent(in) :: key2 - integer(c_int) :: spud_copy_option - end function spud_copy_option - - function spud_delete_option(key, key_len) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key_len - character(len=1,kind=c_char), dimension(key_len), intent(in) :: key - integer(c_int) :: spud_delete_option - end function spud_delete_option - - subroutine spud_print_options() bind(c) - end subroutine spud_print_options - - function spud_get_option(key, key_len, val) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key_len - character(len=1,kind=c_char), dimension(key_len), intent(in) :: key - ! Here intent(in) refers to the c_ptr, not the target! - type(c_ptr), value, intent(in) :: val - integer(c_int) :: spud_get_option - end function spud_get_option - - function spud_set_option(key, key_len, val, type, rank, shape) bind(c) - use iso_c_binding - implicit none - integer(c_int), intent(in), value :: key_len - character(len=1,kind=c_char), dimension(key_len), intent(in) :: key - type(c_ptr), value, intent(in) :: val - integer(c_int), intent(in), value :: type, rank - integer(c_int), intent(in), dimension(2) :: shape - integer(c_int) :: spud_set_option - end function spud_set_option - - end interface - -contains - - pure function string_array(string) result(array) - ! Convert a character array to a string to facilitate C interoperability. - implicit none - character(len=*), intent(in) :: string - character(len=1,kind=c_char), dimension(len(string)) :: array - - integer :: i - - do i=1, size(array) - array(i)=string(i:i) - end do - - end function string_array - - pure function array_string(array) result(string) - ! Convert a character string to a array to facilitate C interoperability. - implicit none - character(len=1,kind=c_char), dimension(:), intent(in) :: array - character(len=size(array)) :: string - - integer :: i - - do i=1, size(array) - string(i:i)=array(i) - end do - - end function array_string - - subroutine clear_options() - call spud_clear_options - end subroutine clear_options - - subroutine load_options(filename, stat) - character(len = * ), intent(in) :: filename - integer, optional, intent(out) :: stat - - integer :: lstat - - lstat = spud_load_options(string_array(filename), len_trim(filename)) - - if(lstat /= SPUD_NO_ERROR) then - call option_error(filename, lstat, stat) - return - end if - - end subroutine load_options - - subroutine write_options(filename, stat) - character(len = *), intent(in) :: filename - integer, optional, intent(out) :: stat - - integer :: lstat - - lstat = spud_write_options(string_array(filename), len_trim(filename)) - - if(lstat /= SPUD_NO_ERROR) then - call option_error(filename, lstat, stat) - return - end if - - end subroutine write_options - - subroutine get_child_name(key, index, child_name, stat) - character(len = *), intent(in) :: key - integer, intent(in) :: index - character(len = *), intent(out) :: child_name - integer, optional, intent(out) :: stat - - character(len = 1, kind=c_char), dimension(len(child_name)) :: lchild_name - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lchild_name = "" - lstat = spud_get_child_name(string_array(key), len_trim(key), index, lchild_name, size(lchild_name)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - child_name = trim(array_string(lchild_name)) - - end subroutine get_child_name - - subroutine get_number_of_children(key, child_count, stat) - character(len = *), intent(in) :: key - integer, intent(out) :: child_count - integer, optional, intent(out) :: stat - - integer :: lstat - - lstat = spud_get_number_of_children(string_array(key), len_trim(key), child_count) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end subroutine get_number_of_children - - function option_count(key) - character(len = *), intent(in) :: key - - integer :: option_count - - option_count = spud_option_count(string_array(key), len_trim(key)) - - end function option_count - - function have_option(key) - character(len = *), intent(in) :: key - - logical :: have_option - - have_option = (spud_have_option(string_array(key), len_trim(key)) /= 0) - - end function have_option - - function option_type(key, stat) - character(len = *), intent(in) :: key - integer, optional, intent(out) :: stat - - integer :: option_type - - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lstat = spud_get_option_type(string_array(key), len_trim(key), option_type) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end function option_type - - function option_rank(key, stat) - character(len = *), intent(in) :: key - integer, optional, intent(out) :: stat - - integer :: option_rank - - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lstat = spud_get_option_rank(string_array(key), len_trim(key), option_rank) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end function option_rank - - function option_shape(key, stat) - character(len = *), intent(in) :: key - integer, optional, intent(out) :: stat - - integer, dimension(2) :: option_shape - - integer :: lstat, shape_store - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lstat = spud_get_option_shape(string_array(key), len_trim(key), option_shape(1:2)) ! Slicing required by GCC 4.2 - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - if(option_rank(key, stat) == 2) then - shape_store = option_shape(1) - option_shape(1) = option_shape(2) - option_shape(2) = shape_store - end if - - end function option_shape - - subroutine get_option_real_scalar(key, val, stat, default) - character(len = *), intent(in) :: key - real(D), intent(out) :: val - integer, optional, intent(out) :: stat - real(D), optional, intent(in) :: default - - real(D), target :: lval - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - if(.not. have_option(key) .and. present(default)) then - val = default - else - call check_option(key, SPUD_REAL, 0, (/-1, -1/), lstat) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - lstat = spud_get_option(key, len_trim(key), c_loc(lval)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - val=lval - end if - - end subroutine get_option_real_scalar - - subroutine get_option_real_vector(key, val, stat, default) - character(len = *), intent(in) :: key - real(D), dimension(:), intent(inout) :: val - integer, optional, intent(out) :: stat - real(D), dimension(size(val)), optional, intent(in) :: default - - real(D), dimension(size(val)), target :: lval - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - if(.not. have_option(key) .and. present(default)) then - val = default - else - call check_option(key, SPUD_REAL, 1, (/size(val), -1/), lstat) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - lstat = spud_get_option(string_array(key), len_trim(key), c_loc(lval)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - val=lval - end if - - end subroutine get_option_real_vector - - subroutine get_option_real_tensor(key, val, stat, default) - character(len = *), intent(in) :: key - real(D), dimension(:, :), intent(inout) :: val - integer, optional, intent(out) :: stat - real(D), dimension(size(val, 1), size(val, 2)), optional, intent(in) :: default - - integer :: lstat - ! Note the transpose - real(D), dimension(size(val, 2), size(val, 1)), target :: lval - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - if(.not. have_option(key) .and. present(default)) then - val = default - else - call check_option(key, SPUD_REAL, 2, shape(val), lstat) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - lstat = spud_get_option(string_array(key), len_trim(key), c_loc(lval)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - val=transpose(lval) - end if - - end subroutine get_option_real_tensor - - subroutine get_option_real_scalar_sp(key, val, stat, default) - ! Single precision version of routine. Note that values stored in the - ! dictionary are always double precision. - character(len = *), intent(in) :: key - real, intent(out) :: val - integer, optional, intent(out) :: stat - real, optional, intent(in) :: default - - real(D), target :: lval - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - if(.not. have_option(key) .and. present(default)) then - val = default - else - call check_option(key, SPUD_REAL, 0, (/-1, -1/), lstat) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - lstat = spud_get_option(string_array(key), len_trim(key), c_loc(lval)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - val=real(lval) - end if - - end subroutine get_option_real_scalar_sp - - subroutine get_option_real_vector_sp(key, val, stat, default) - ! Single precision version of routine. Note that values stored in the - ! dictionary are always double precision. - character(len = *), intent(in) :: key - real, dimension(:), intent(inout) :: val - integer, optional, intent(out) :: stat - real, dimension(size(val)), optional, intent(in) :: default - - integer :: lstat - real(D), dimension(size(val)), target :: lval - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - if(.not. have_option(key) .and. present(default)) then - val = default - else - call check_option(key, SPUD_REAL, 1, (/size(val), -1/), lstat) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - lstat = spud_get_option(string_array(key), len_trim(key), c_loc(lval)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - val=real(lval) - end if - - end subroutine get_option_real_vector_sp - - subroutine get_option_real_tensor_sp(key, val, stat, default) - ! Single precision version of routine. Note that values stored in the - ! dictionary are always double precision. - character(len = *), intent(in) :: key - real, dimension(:, :), intent(inout) :: val - integer, optional, intent(out) :: stat - real, dimension(size(val, 1), size(val, 2)), optional, intent(in) :: default - - integer :: lstat - real(D), dimension(size(val, 2), size(val, 1)), target :: lval - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - if(.not. have_option(key) .and. present(default)) then - val = default - else - call check_option(key, SPUD_REAL, 2, shape(val), lstat) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - lstat = spud_get_option(string_array(key), len_trim(key), c_loc(lval)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - val=real(transpose(lval)) - end if - - end subroutine get_option_real_tensor_sp - - subroutine get_option_integer_scalar(key, val, stat, default) - character(len = *), intent(in) :: key - integer, intent(out) :: val - integer, optional, intent(out) :: stat - integer, optional, intent(in) :: default - - integer :: lstat - integer(c_int), target :: lval - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - if(.not. have_option(key) .and. present(default)) then - val = default - else - call check_option(key, SPUD_INTEGER, 0, (/-1, -1/), lstat) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - lstat = spud_get_option(string_array(key), len_trim(key), c_loc(lval)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - val=lval - end if - - end subroutine get_option_integer_scalar - - subroutine get_option_integer_vector(key, val, stat, default) - character(len = *), intent(in) :: key - integer, dimension(:), intent(inout) :: val - integer, optional, intent(out) :: stat - integer, dimension(size(val)), optional, intent(in) :: default - - integer(c_int), dimension(size(val)), target :: lval - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - if(.not. have_option(key) .and. present(default)) then - val = default - else - call check_option(key, SPUD_INTEGER, 1, (/size(val), -1/), lstat) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - lstat = spud_get_option(string_array(key), len_trim(key), c_loc(lval)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - val=lval - end if - - end subroutine get_option_integer_vector - - subroutine get_option_integer_tensor(key, val, stat, default) - character(len = *), intent(in) :: key - integer, dimension(:, :), intent(inout) :: val - integer, optional, intent(out) :: stat - integer, dimension(size(val, 1), size(val, 2)), optional, intent(in) :: default - - integer :: lstat - integer(c_int), dimension(size(val, 2), size(val, 1)), target :: lval - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - if(.not. have_option(key) .and. present(default)) then - val = default - else - call check_option(key, SPUD_INTEGER, 2, shape(val), lstat) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - lstat = spud_get_option(string_array(key), len_trim(key), c_loc(lval)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - val=transpose(lval) - end if - - end subroutine get_option_integer_tensor - - subroutine get_option_character(key, val, stat, default) - character(len = *), intent(in) :: key - character(len = *), intent(out) :: val - integer, optional, intent(out) :: stat - character(len = *), optional, intent(in) :: default - - character(len=1,kind=c_char), dimension(len(val)), target :: lval - integer :: lstat - integer, dimension(2) :: lshape - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - if(.not. have_option(key) .and. present(default)) then - val = trim(default) - else - call check_option(key, SPUD_CHARACTER, 1, stat = lstat) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - lshape = option_shape(key, stat) - if(lshape(1) > len(val)) then - call option_error(key, SPUD_SHAPE_ERROR, stat) - return - end if - lval = "" - lstat = spud_get_option(string_array(key), len_trim(key), c_loc(lval)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - val = array_string(lval) - end if - - end subroutine get_option_character - - subroutine add_option(key, stat) - character(len = *), intent(in) :: key - integer, optional, intent(out) :: stat - - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lstat = spud_add_option(string_array(key), len_trim(key)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end subroutine add_option - - subroutine set_option_real_scalar(key, val, stat) - character(len = *), intent(in) :: key - real(D), intent(in), target :: val - integer, optional, intent(out) :: stat - - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lstat = spud_set_option(string_array(key), len_trim(key), c_loc(val), SPUD_REAL, 0, (/-1, -1/)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end subroutine set_option_real_scalar - - subroutine set_option_real_vector(key, val, stat) - character(len = *), intent(in) :: key - real(D), dimension(:), intent(in) :: val - integer, optional, intent(out) :: stat - - integer :: lstat - ! Buffer to make c_loc call legal. - real(D), dimension(size(val)), target :: lval - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lval=val - - lstat = spud_set_option(string_array(key), len_trim(key), c_loc(lval), SPUD_REAL, 1, (/size(val), -1/)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end subroutine set_option_real_vector - - subroutine set_option_real_tensor(key, val, stat) - character(len = *), intent(in) :: key - real(D), dimension(:, :), intent(in), target :: val - integer, optional, intent(out) :: stat - - integer :: lstat - real(D), dimension(size(val, 2), size(val, 1)), target :: val_handle - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - val_handle = transpose(val) - - lstat = spud_set_option(string_array(key), len_trim(key), c_loc(val_handle), SPUD_REAL, 2, shape(val_handle)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end subroutine set_option_real_tensor - - subroutine set_option_real_scalar_sp(key, val, stat) - ! Single precision version of routine. Note that values stored in the - ! dictionary are always double precision. - character(len = *), intent(in) :: key - real, intent(in) :: val - integer, optional, intent(out) :: stat - - integer :: lstat - real(D), target :: lval - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lval = val - lstat = spud_set_option(string_array(key), len_trim(key), c_loc(lval), SPUD_REAL, 0, (/-1, -1/)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end subroutine set_option_real_scalar_sp - - subroutine set_option_real_vector_sp(key, val, stat) - ! Single precision version of routine. Note that values stored in the - ! dictionary are always double precision. - character(len = *), intent(in) :: key - real, dimension(:), intent(in) :: val - integer, optional, intent(out) :: stat - - integer :: lstat - real(D), dimension(size(val)), target :: lval - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lval=val - lstat = spud_set_option(string_array(key), len_trim(key), c_loc(lval), SPUD_REAL, 1, (/size(val), -1/)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end subroutine set_option_real_vector_sp - - subroutine set_option_real_tensor_sp(key, val, stat) - ! Single precision version of routine. Note that values stored in the - ! dictionary are always double precision. - character(len = *), intent(in) :: key - real, dimension(:, :), intent(in) :: val - integer, optional, intent(out) :: stat - - integer :: lstat - real(D), dimension(size(val, 2), size(val, 1)), target :: val_handle - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - val_handle = transpose(val) - - lstat = spud_set_option(string_array(key), len_trim(key), c_loc(val_handle), SPUD_REAL, 2, shape(val_handle)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end subroutine set_option_real_tensor_sp - - subroutine set_option_integer_scalar(key, val, stat) - character(len = *), intent(in) :: key - integer(c_int), intent(in), target :: val - integer, optional, intent(out) :: stat - - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lstat = spud_set_option(string_array(key), len_trim(key), c_loc(val), SPUD_INTEGER, 0, (/-1, -1/)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end subroutine set_option_integer_scalar - - subroutine set_option_integer_vector(key, val, stat) - character(len = *), intent(in) :: key - integer, dimension(:), intent(in) :: val - integer, optional, intent(out) :: stat - - integer :: lstat - integer(c_int), dimension(size(val)), target :: lval - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lval=val - - lstat = spud_set_option(string_array(key), len_trim(key), c_loc(lval), SPUD_INTEGER, 1, (/size(val), -1/)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end subroutine set_option_integer_vector - - subroutine set_option_integer_tensor(key, val, stat) - character(len = *), intent(in) :: key - integer, dimension(:, :), intent(in) :: val - integer, optional, intent(out) :: stat - - integer :: lstat - integer, dimension(size(val, 2), size(val, 1)), target :: val_handle - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - val_handle = transpose(val) - - lstat = spud_set_option(string_array(key), len_trim(key), c_loc(val_handle), SPUD_INTEGER, 2, shape(val_handle)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end subroutine set_option_integer_tensor - - subroutine set_option_character(key, val, stat) - character(len = *), intent(in) :: key - character(len = *), intent(in) :: val - integer, optional, intent(out) :: stat - - character(len=1,kind=c_char), dimension(len(val)), target :: lval - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lval=string_array(val) - - lstat = spud_set_option(string_array(key), len_trim(key), c_loc(lval), SPUD_CHARACTER, 1, (/len_trim(val), -1/)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end subroutine set_option_character - - subroutine set_option_attribute(key, val, stat) - character(len = *), intent(in) :: key - character(len = *), intent(in) :: val - integer, optional, intent(out) :: stat - - character(len=1,kind=c_char), dimension(len(val)), target :: lval - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lval=string_array(val) - - lstat = spud_set_option_attribute(string_array(key), len_trim(key), lval, len_trim(val)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end subroutine set_option_attribute - - subroutine move_option(key1, key2, stat) - character(len = *), intent(in) :: key1 - character(len = *), intent(in) :: key2 - integer, optional, intent(out) :: stat - - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lstat = spud_move_option(string_array(key1), len_trim(key1), string_array(key2), len_trim(key2)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key1, lstat, stat) - return - end if - - end subroutine move_option - - subroutine copy_option(key1, key2, stat) - character(len = *), intent(in) :: key1 - character(len = *), intent(in) :: key2 - integer, optional, intent(out) :: stat - - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lstat = spud_copy_option(string_array(key1), len_trim(key1), string_array(key2), len_trim(key2)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key1, lstat, stat) - return - end if - - end subroutine copy_option - - subroutine delete_option(key, stat) - character(len = *), intent(in) :: key - integer, optional, intent(out) :: stat - - integer :: lstat - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - lstat = spud_delete_option(string_array(key), len_trim(key)) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - end subroutine delete_option - - subroutine print_options() - - call spud_print_options() - - end subroutine print_options - - subroutine option_error(key, error, stat) - !!< Handle option errors - - character(len = *), intent(in) :: key - ! Error code - integer, intent(in) :: error - ! Optional stat argument - die if error and it's not present - integer, optional, intent(out) :: stat - - if(present(stat)) then - stat = error - return - end if - - select case(error) - case(SPUD_NO_ERROR) - return - case(SPUD_KEY_ERROR) - write(0, *) "Option key error. Key is: " // trim(key) - case(SPUD_TYPE_ERROR) - write(0, *) "Option type error. Key is: " // trim(key) - case(SPUD_RANK_ERROR) - write(0, *) "Option rank error. Key is: " // trim(key) - case(SPUD_SHAPE_ERROR) - write(0, *) "Option shape error. Key is: " // trim(key) - case(SPUD_FILE_ERROR) - write(0, *) "Option file error. Filename is: " // trim(key) - case(SPUD_NEW_KEY_WARNING) - write(0, *) "Option warning. Key is not in the options tree: " // trim(key) - case(SPUD_ATTR_SET_FAILED_WARNING) - write(0, *) "Option warning. Option cannot be set as an attribute. Key is " // trim(key) - case default - write(0, *) "Unknown option error. Key is: " // trim(key) - end select - - stop - - end subroutine option_error - - subroutine check_option(key, type, rank, shape, stat) - !!< Check existence, type, rank, and optionally shape, of the option with - !!< the supplied key - - character(len = *), intent(in) :: key - integer, intent(in) :: type - integer, intent(in) :: rank - integer, dimension(2), optional, intent(in) :: shape - integer, optional, intent(out) :: stat - - integer :: i, lrank, lstat, ltype - integer, dimension(2) :: lshape - - if(present(stat)) then - stat = SPUD_NO_ERROR - end if - - if(.not. have_option(key)) then - call option_error(key, SPUD_KEY_ERROR, stat) - return - end if - - ltype = option_type(key, lstat) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - lrank = option_rank(key, lstat) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - if(type /= ltype) then - call option_error(key, SPUD_TYPE_ERROR, stat) - return - else if(rank /= lrank) then - call option_error(key, SPUD_RANK_ERROR, stat) - return - else if(present(shape)) then - lshape = option_shape(key, stat) - if(lstat /= SPUD_NO_ERROR) then - call option_error(key, lstat, stat) - return - end if - - do i = 1, rank - if(shape(i) /= lshape(i)) then - call option_error(key, SPUD_SHAPE_ERROR, stat) - return - end if - end do - end if - - end subroutine check_option - -end module spud diff --git a/libspud/src/spud.cpp b/libspud/src/spud.cpp deleted file mode 100644 index 528d3f5eab..0000000000 --- a/libspud/src/spud.cpp +++ /dev/null @@ -1,1875 +0,0 @@ -/* Copyright (C) 2007 Imperial College London and others. - - Please see the AUTHORS file in the main source directory for a full list - of copyright holders. - - Applied Modelling and Computation Group - Department of Earth Science and Engineering - Imperial College London - - David.Ham@Imperial.ac.uk - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, - version 2.1 of the License. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - USA -*/ - -#include "spud" - -using namespace std; - -namespace Spud{ - - // OptionManager CLASS METHODS - - // PRIVATE VARIABLES - - bool OptionManager::deallocated = false; - - // PUBLIC METHODS - - void OptionManager::clear_options() { - manager.reset(); - - return; - } - - void* OptionManager::get_manager() { - return (void*) manager.options; - } - - void OptionManager::set_manager(void* m) { - delete manager.options; - manager.options = (Spud::OptionManager::Option*) m; - return; - } - - OptionError OptionManager::load_options(const string& filename){ - return manager.options->load_options(filename); - } - - OptionError OptionManager::write_options(const string& filename){ - return manager.options->write_options(filename); - } - - OptionError OptionManager::get_child_name(const string& key, const unsigned& index, string& child_name){ - deque kids; - manager.options->list_children(key, kids); - if(kids.size() < index){ - return SPUD_KEY_ERROR; - } - - child_name = kids[index]; - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::get_number_of_children(const string& key, int& child_count){ - deque kids; - - manager.options->list_children(key, kids); - - child_count = kids.size(); - - return check_key(key); - } - - int OptionManager::option_count(const string& key){ - return manager.options->option_count(key); - } - - logical_t OptionManager::have_option(const string& key){ - return manager.options->have_option(key); - } - - OptionError OptionManager::get_option_type(const string& key, OptionType& type){ - Option* child = manager.options->get_child(key); - if(child == NULL){ - return SPUD_KEY_ERROR; - } - - type = child->get_option_type(); - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::get_option_rank(const string& key, int& rank){ - Option* child = manager.options->get_child(key); - if(child == NULL){ - return SPUD_KEY_ERROR; - } - - rank = child->get_option_rank(); - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::get_option_shape(const string& key, vector& shape){ - Option* child = manager.options->get_child(key); - if(child == NULL){ - return SPUD_KEY_ERROR; - } - - shape = child->get_option_shape(); - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::get_option(const string& key, double& val){ - OptionError check_err = check_option(key, SPUD_DOUBLE, 0); - if(check_err != SPUD_NO_ERROR){ - return check_err; - } - - vector val_handle; - OptionError get_err = manager.options->get_option(key, val_handle); - if(get_err != SPUD_NO_ERROR){ - return get_err; - }else if(val_handle.size() != 1){ - return SPUD_RANK_ERROR; - } - - val = val_handle[0]; - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::get_option(const string& key, double& val, const double& default_val){ - if(!have_option(key)){ - val = default_val; - return SPUD_NO_ERROR; - } - - return get_option(key, val); - } - - OptionError OptionManager::get_option(const string& key, vector& val){ - OptionError check_err = check_option(key, SPUD_DOUBLE, 1); - if(check_err != SPUD_NO_ERROR){ - return check_err; - } - - vector val_handle; - OptionError get_err = manager.options->get_option(key, val_handle); - if(get_err != SPUD_NO_ERROR){ - return get_err; - } - - val = val_handle; - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::get_option(const string& key, vector& val, const vector& default_val){ - if(!have_option(key)){ - val = default_val; - return SPUD_NO_ERROR; - } - - return get_option(key, val); - } - - OptionError OptionManager::get_option(const string& key, vector< vector >& val){ - OptionError check_err = check_option(key, SPUD_DOUBLE, 2); - if(check_err != SPUD_NO_ERROR){ - return check_err; - } - - vector shape; - OptionError shape_err = get_option_shape(key, shape); - if(shape_err != SPUD_NO_ERROR){ - return shape_err; - } - - vector val_handle; - OptionError get_err = manager.options->get_option(key, val_handle); - if(get_err != SPUD_NO_ERROR){ - return get_err; - } - - val.clear(); - for(int i = 0;i < shape[0];i++){ - val.push_back(vector(shape[1])); - for(int j = 0;j < shape[1];j++){ - val[i][j] = val_handle[(i * shape[1]) + j]; - } - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::get_option(const string& key, vector< vector >& val, const vector< vector >& default_val){ - if(!have_option(key)){ - val = default_val; - return SPUD_NO_ERROR; - } - - return get_option(key, val); - } - - OptionError OptionManager::get_option(const string& key, int& val){ - OptionError check_err = check_option(key, SPUD_INT, 0); - if(check_err != SPUD_NO_ERROR){ - return check_err; - } - - vector val_handle; - OptionError get_err = manager.options->get_option(key, val_handle); - if(get_err != SPUD_NO_ERROR){ - return get_err; - }else if(val_handle.size() != 1){ - return SPUD_RANK_ERROR; - } - - val = val_handle[0]; - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::get_option(const string& key, int& val, const int& default_val){ - if(!have_option(key)){ - val = default_val; - return SPUD_NO_ERROR; - } - - return get_option(key, val); - } - - OptionError OptionManager::get_option(const string& key, vector& val){ - OptionError check_err = check_option(key, SPUD_INT, 1); - if(check_err != SPUD_NO_ERROR){ - return check_err; - } - - vector val_handle; - OptionError get_err = manager.options->get_option(key, val_handle); - if(get_err != SPUD_NO_ERROR){ - return get_err; - } - - val = val_handle; - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::get_option(const string& key, vector& val, const vector& default_val){ - if(!have_option(key)){ - val = default_val; - return SPUD_NO_ERROR; - } - - return get_option(key, val); - } - - OptionError OptionManager::get_option(const string& key, vector< vector >& val){ - OptionError check_err = check_option(key, SPUD_INT, 2); - if(check_err != SPUD_NO_ERROR){ - return check_err; - } - - vector shape; - OptionError shape_err = get_option_shape(key, shape); - if(shape_err != SPUD_NO_ERROR){ - return shape_err; - } - - vector val_handle; - OptionError get_err = manager.options->get_option(key, val_handle); - if(get_err != SPUD_NO_ERROR){ - return get_err; - } - - val.clear(); - for(int i = 0;i < shape[0];i++){ - val.push_back(vector(shape[1])); - for(int j = 0;j < shape[1];j++){ - val[i][j] = val_handle[(i * shape[1]) + j]; - } - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::get_option(const string& key, vector< vector >& val, const vector< vector >& default_val){ - if(!have_option(key)){ - val = default_val; - return SPUD_NO_ERROR; - } - - return get_option(key, val); - } - - OptionError OptionManager::get_option(const string& key, string& val){ - OptionError check_err = check_option(key, SPUD_STRING, 1); - if(check_err != SPUD_NO_ERROR){ - return check_err; - } - - string val_handle; - OptionError get_err = manager.options->get_option(key, val_handle); - if(get_err != SPUD_NO_ERROR){ - return get_err; - } - - val = val_handle; - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::get_option(const string& key, string& val, const string& default_val){ - if(!have_option(key)){ - val = default_val; - return SPUD_NO_ERROR; - } - - return get_option(key, val); - } - - OptionError OptionManager::add_option(const string& key){ - logical_t new_key = !have_option(key); - - OptionError add_err = manager.options->add_option(key); - if(add_err != SPUD_NO_ERROR){ - return add_err; - }else if(new_key){ - return SPUD_NEW_KEY_WARNING; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::set_option(const string& key, const double& val){ - logical_t new_key = !have_option(key); - - vector val_handle; - val_handle.push_back(val); - vector shape(2); - shape[0] = -1; shape[1] = -1; - OptionError set_err = manager.options->set_option(key + "/__value", val_handle, 0, shape); - if(set_err != SPUD_NO_ERROR){ - return set_err; - }else if(new_key){ - return SPUD_NEW_KEY_WARNING; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::set_option(const string& key, const vector& val){ - logical_t new_key = !have_option(key); - - vector val_handle = val; - vector shape(2); - shape[0] = val.size(); shape[1] = -1; - OptionError set_err = manager.options->set_option(key + "/__value", val_handle, 1, shape); - if(set_err != SPUD_NO_ERROR){ - return set_err; - }else if(new_key){ - return SPUD_NEW_KEY_WARNING; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::set_option(const string& key, const vector< vector >& val){ - logical_t new_key = !have_option(key); - - vector val_handle; - for(size_t i = 0;i < val.size();i++){ - if(i > 0 and val[i].size() != val[0].size()){ - return SPUD_SHAPE_ERROR; - } - for(size_t j = 0;j < val[i].size();j++){ - val_handle.push_back(val[i][j]); - } - } - vector shape(2); - shape[0] = val.size(); - if(val.size() == 0){ - shape[1] = 0; - }else{ - shape[1] = val[0].size(); - } - OptionError set_err = manager.options->set_option(key + "/__value", val_handle, 2, shape); - if(set_err != SPUD_NO_ERROR){ - return set_err; - }else if(new_key){ - return SPUD_NEW_KEY_WARNING; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::set_option(const string& key, const int& val){ - logical_t new_key = !have_option(key); - - vector val_handle; - val_handle.push_back(val); - vector shape(2); - shape[0] = -1; shape[1] = -1; - OptionError set_err = manager.options->set_option(key + "/__value", val_handle, 0, shape); - if(set_err != SPUD_NO_ERROR){ - return set_err; - }else if(new_key){ - return SPUD_NEW_KEY_WARNING; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::set_option(const string& key, const vector& val){ - logical_t new_key = !have_option(key); - - vector val_handle = val; - vector shape(2); - shape[0] = val.size(); shape[1] = -1; - OptionError set_err = manager.options->set_option(key + "/__value", val_handle, 1, shape); - if(set_err != SPUD_NO_ERROR){ - return set_err; - }else if(new_key){ - return SPUD_NEW_KEY_WARNING; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::set_option(const string& key, const vector< vector >& val){ - logical_t new_key = !have_option(key); - - vector val_handle; - for(size_t i = 0;i < val.size();i++){ - if(i > 0 and val[i].size() != val[0].size()){ - return SPUD_SHAPE_ERROR; - } - for(size_t j = 0;j < val[i].size();j++){ - val_handle.push_back(val[i][j]); - } - } - vector shape(2); - shape[0] = val.size(); - if(val.size() == 0){ - shape[1] = 0; - }else{ - shape[1] = val[0].size(); - } - OptionError set_err = manager.options->set_option(key + "/__value", val_handle, 2, shape); - if(set_err != SPUD_NO_ERROR){ - return set_err; - }else if(new_key){ - return SPUD_NEW_KEY_WARNING; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::set_option(const string& key, const string& val){ - logical_t new_key = !have_option(key); - - OptionError set_err = manager.options->set_option(key + "/__value", val); - if(set_err != SPUD_NO_ERROR){ - return set_err; - }else if(new_key){ - return SPUD_NEW_KEY_WARNING; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::set_option_attr(const string& key, const string& val){ - logical_t new_key = !have_option(key); - - OptionError set_err = manager.options->set_option(key, val); - if(set_err != SPUD_NO_ERROR){ - return set_err; - }else if(new_key){ - return SPUD_NEW_KEY_WARNING; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::set_option_attribute(const string& key, const string& val){ - OptionError set_err = set_option_attr(key, val); - if(set_err != SPUD_NO_ERROR and set_err != SPUD_NEW_KEY_WARNING){ - return set_err; - } - - Option* child = manager.options->get_child(key); - if(child == NULL){ - return SPUD_KEY_ERROR; - } - logical_t is_attribute = child->set_is_attribute(true); - if(set_err != SPUD_NO_ERROR){ - return set_err; - } - else if(!is_attribute){ - return SPUD_ATTR_SET_FAILED_WARNING; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::move_option(const string& key1, const string& key2){ - OptionError move_err = manager.options->move_option(key1, key2); - if(move_err != SPUD_NO_ERROR){ - return move_err; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::copy_option(const string& key1, const string& key2){ - OptionError copy_err = manager.options->copy_option(key1, key2); - if(copy_err != SPUD_NO_ERROR){ - return copy_err; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::delete_option(const string& key){ - OptionError del_err = manager.options->delete_option(key); - if(del_err != SPUD_NO_ERROR){ - return del_err; - } - - return SPUD_NO_ERROR; - } - - void OptionManager::print_options(){ - manager.options->print(); - - return; - } - - // PRIVATE METHODS - - OptionManager::OptionManager(){ - options = new Option(); - deallocated = false; - - return; - } - - OptionManager::OptionManager(const OptionManager& manager){ - cerr << "SPUD ERROR: OptionManager copy constructor cannot be called" << endl; - exit(-1); - } - - OptionManager::~OptionManager(){ - if (!deallocated) - { - delete options; - deallocated = true; - } - - return; - } - - OptionManager& OptionManager::operator=(const OptionManager& manager){ - cerr << "SPUD ERROR: OptionManager assignment operator cannot be called" << endl; - exit(-1); - } - - OptionError OptionManager::check_key(const string& key){ - if(!have_option(key)){ - return SPUD_KEY_ERROR; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::check_rank(const string& key, const int& rank){ - int rank_handle; - OptionError rank_err = get_option_rank(key, rank_handle); - if(rank_err != SPUD_NO_ERROR){ - return rank_err; - }else if(rank_handle != rank){ - return SPUD_RANK_ERROR; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::check_type(const string& key, const OptionType& type){ - OptionType type_handle; - OptionError type_err = get_option_type(key, type_handle); - if(type_err != SPUD_NO_ERROR){ - return type_err; - }else if(type_handle != type){ - return SPUD_TYPE_ERROR; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::check_option(const string& key, const OptionType& type, const int& rank){ - OptionError check_err; - check_err = check_key(key); - if(check_err != SPUD_NO_ERROR){ - return check_err; - } - check_err = check_type(key, type); - if(check_err != SPUD_NO_ERROR){ - return check_err; - } - check_err = check_rank(key, rank); - if(check_err != SPUD_NO_ERROR){ - return check_err; - } - - return SPUD_NO_ERROR; - } - - void OptionManager::reset(){ - delete options; - options = new Option; - - return; - } - - // End OptionManager CLASS METHODS - - // OptionManager::Option CLASS METHODS - - // PUBLIC METHODS - - OptionManager::Option::Option(){ - verbose_off(); - OptionError set_err = set_rank_and_shape(-1, vector()); - if(set_err != SPUD_NO_ERROR){ - cerr << "SPUD ERROR: Failed to set rank and shape" << endl; - exit(-1); - } - is_attribute = false; - - return; - } - - OptionManager::Option::Option(const OptionManager::Option& inOption){ - *this = inOption; - - return; - } - - OptionManager::Option::Option(string name){ - verbose_off(); - node_name = name; - OptionError set_err = set_rank_and_shape(-1, vector()); - if(set_err != SPUD_NO_ERROR){ - cerr << "SPUD ERROR: Failed to set rank and shape" << endl; - exit(-1); - } - is_attribute = false; - - return; - } - - OptionManager::Option::~Option(){ - for(deque< pair >::iterator it=children.begin();it!=children.end();++it){ - if(it->second) delete it->second; - } - - return; - } - - const OptionManager::Option& OptionManager::Option::operator=(const OptionManager::Option& inOption){ - verbose = inOption.verbose; - if(verbose) - cout << "const OptionManager::Option& OptionManager::Option::operator=(const OptionManager::Option& inOption)\n"; - - node_name = inOption.node_name; - children = inOption.children; - - data_double = inOption.data_double; - data_int = inOption.data_int; - data_string = inOption.data_string; - vector shape(2); - shape[0] = inOption.shape[0]; shape[1] = inOption.shape[1]; - OptionError set_err = set_rank_and_shape(inOption.rank, shape); - if(set_err != SPUD_NO_ERROR){ - cerr << "SPUD ERROR: Failed to set rank and shape" << endl; - exit(-1); - } - - is_attribute = inOption.is_attribute; - - return *this; - } - - OptionError OptionManager::Option::load_options(const string& filename){ - if(verbose) - cout << "void OptionManager::Option::load_options(const string& filename = " << filename << ")\n"; - - delete_option("/"); - - TiXmlDocument doc(filename); - doc.SetCondenseWhiteSpace(false); - if(!doc.LoadFile()){ - //cerr << "SPUD WARNING: Failed to load options file " << filename << endl; - return SPUD_FILE_ERROR; - } - - TiXmlNode* header = doc.FirstChild(); - while(header != NULL and header->Type() != TiXmlNode::DECLARATION){ - header = header->NextSibling(); - } - TiXmlNode* fluidity_options = doc.FirstChildElement(); - if(fluidity_options == NULL){ - //cerr << "SPUD WARNING: Failed to find root node when loading options file" << endl; - return SPUD_FILE_ERROR; - } - - // Set the name of this element - node_name = fluidity_options->ValueStr(); - - // Decend down through all the fluidity options - TiXmlNode* option_node; - for(option_node = fluidity_options->FirstChildElement();option_node;option_node = option_node->NextSiblingElement()){ - if(option_node->ToElement()){ - parse_node("", option_node); - } - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::Option::write_options(const string& filename) const{ - if(verbose) - cout << "void OptionManager::Option::write_options(const string& filename = " << filename << ") const\n"; - - TiXmlDocument doc; - - // XML header - TiXmlDeclaration* header = new TiXmlDeclaration("1.0", "utf-8", ""); - doc.LinkEndChild(header); - - // Root node - TiXmlNode* root_node = to_element(); - doc.LinkEndChild(root_node); - - if(!doc.SaveFile(filename)){ - return SPUD_FILE_ERROR; - //cerr << "SPUD WARNING: Failed to write options file" << endl; - } - - return SPUD_NO_ERROR; - } - - string OptionManager::Option::get_name() const{ - if(verbose) - cout << "void OptionManager::Option::get_name(void) const\n"; - return node_name; - } - - logical_t OptionManager::Option::get_is_attribute() const{ - if(verbose) - cout << "logical_t OptionManager::Option::get_is_attribute(void) const\n"; - return is_attribute; - } - - void OptionManager::Option::list_children(const string& name, deque& kids) const{ - if(verbose) - cout << "void OptionManager::Option::list_children(const string& name = " << name << ", deque& kids) const\n"; - - kids.clear(); - - const Option* descendant = get_child(name); - if(descendant != NULL){ - for(deque< pair >::const_iterator it = descendant->children.begin();it != descendant->children.end();it++){ - kids.push_back(it->first); - } - } - - return; - } - - size_t OptionManager::Option::count(const string& key) const{ - size_t cnt=0; - for(deque< pair >::const_iterator it=children.begin();it!=children.end();++it){ - if(it->first == key) - cnt++; - } - return cnt; - } - - deque< pair >::iterator OptionManager::Option::find(const string& key){ - for(deque< pair >::iterator it=children.begin();it!=children.end();++it){ - if(it->first == key) - return it; - } - return children.end(); - } - - deque< pair >::const_iterator OptionManager::Option::find(const string& key) const{ - for(deque< pair >::const_iterator it=children.begin();it!=children.end();++it){ - if(it->first == key) - return it; - } - return children.end(); - } - - deque< pair >::iterator OptionManager::Option::find_next(deque< pair >::iterator current, const string& key){ - deque< pair >::iterator it = current; - it++; - for(;it!=children.end();++it){ - if(it->first == key) - return it; - } - return children.end(); - } - - deque< pair >::const_iterator OptionManager::Option::find_next(deque< pair >::const_iterator current, const string& key) const{ - deque< pair >::const_iterator it = current; - it++; - for(;it!=children.end();++it){ - if(it->first == key) - return it; - } - return children.end(); - } - - const OptionManager::Option* OptionManager::Option::get_child(const string& key) const{ - if(verbose) - cout << "const OptionManager::Option* OptionManager::Option::get_child(const string& key = " << key << ") const\n"; - - if(key == "/" or key.empty()) - return this; - - string name, branch; - int index; - OptionError key_err = split_name(key, name, index, branch); - if(key_err != SPUD_NO_ERROR){ - return NULL; - } - - if(name.empty()){ - return NULL; - } - - deque< pair >::const_iterator it; - if(count(name) == 0){ - name += "::"; - int i = 0; - for(it = children.begin();it != children.end();it++){ - if(it->first.compare(0, name.size(), name) == 0){ - if(index < 0 or i == index){ - break; - }else{ - i++; - } - } - } - }else{ - if(index < 0){ - it = find(name); - }else{ - it = find(name); - for(size_t i = 0;it!=children.end();i++){ - if((int)i == index){ - break; - } - it = find_next(it, name); - } - } - } - - if(it == children.end()){ - return NULL; - }else if(branch.empty()){ - return it->second; - }else{ - return it->second->get_child(branch); - } - } - - OptionManager::Option* OptionManager::Option::get_child(const string& key){ - if(verbose) - cout << "OptionManager::Option* OptionManager::Option::get_child(const string& key = " << key <<")\n"; - - if(!have_option(key)){ - return NULL; - }else{ - return create_child(key); - } - } - - int OptionManager::Option::option_count(const string& key) const{ - if(verbose) - cout << "int OptionManager::Option::option_count(const string& key = " << key << ") const\n"; - - string name, branch; - int index; - OptionError key_err = split_name(key, name, index, branch); - if(key_err != SPUD_NO_ERROR){ - return 0; - } - - if(name.empty()){ - return 0; - } - - logical_t match_whole = true; - if(!count(name)){ - // Apparently there is no such child but lets check for "name::*" - name += "::"; - match_whole = false; - } - - int count = 0, i = 0; - for(deque< pair >::const_iterator it = children.begin();it != children.end();it++){ - if(it->first.compare(0, name.size(), name) == 0 and (not match_whole or it->first.size() == name.size())){ - if(index < 0){ - if(branch.empty()){ - count++; - }else{ - count += it->second->option_count(branch); - } - }else{ - if(i == index){ - if(branch.empty()){ - count++; - }else{ - count += it->second->option_count(branch); - } - break; - } - i++; - } - } - } - - return count; - } - - logical_t OptionManager::Option::have_option(const string& key) const{ - if(verbose) - cout << "logical_t OptionManager::Option::have_option(const string& key = " << key << ") const\n"; - - if(key == "/"){ - return true; - }else{ - return (get_child(key) != NULL); - } - } - - OptionType OptionManager::Option::get_option_type() const{ - if(verbose) - cout << "OptionType OptionManager::Option::get_option_type(void) const\n"; - - if(have_option("__value")){ - return find("__value")->second->get_option_type(); - } - - if(!data_double.empty()){ - return SPUD_DOUBLE; - }else if(!data_int.empty()){ - return SPUD_INT; - }else if(!data_string.empty()){ - return SPUD_STRING; - }else{ - return SPUD_NONE; - } - } - - size_t OptionManager::Option::get_option_rank() const{ - if(verbose) - cout << "size_t OptionManager::Option::get_option_rank(void) const\n"; - - if(have_option("__value")){ - return find("__value")->second->get_option_rank(); - }else{ - return rank; - } - } - - vector OptionManager::Option::get_option_shape() const{ - if(verbose) - cout << "vector OptionManager::Option::get_option_shape(void) const\n"; - - if(have_option("__value")){ - return find("__value")->second->get_option_shape(); - }else{ - vector shape(2); - shape[0] = this->shape[0]; - shape[1] = this->shape[1]; - return shape; - } - } - - OptionError OptionManager::Option::get_option(vector& val) const{ - if(verbose) - cout << "OptionError OptionManager::Option::get_option(vector& val) const\n"; - - if(have_option("__value")){ - return get_option("__value", val); - }else if(get_option_type() != SPUD_DOUBLE){ - return SPUD_TYPE_ERROR; - }else{ - val = data_double; - return SPUD_NO_ERROR; - } - } - - OptionError OptionManager::Option::get_option(vector& val) const{ - if(verbose) - cout << "OptionError OptionManager::Option::get_option(vector& val) const\n"; - - if(have_option("__value")){ - return get_option("__value", val); - }else if(get_option_type() != SPUD_INT){ - return SPUD_TYPE_ERROR; - }else{ - val = data_int; - return SPUD_NO_ERROR; - } - } - - OptionError OptionManager::Option::get_option(string& val) const{ - if(verbose) - cout << "OptionError OptionManager::Option::get_option(string& val = " << val << ") const\n"; - - if(have_option("__value")){ - return get_option("__value", val); - }else if(get_option_type() != SPUD_STRING){ - return SPUD_TYPE_ERROR; - }else{ - val = data_string; - return SPUD_NO_ERROR; - } - } - - OptionError OptionManager::Option::get_option(const string& key, vector& val) const{ - if(verbose) - cout << "OptionError OptionManager::Option::get_option(const string& key = " << key << ", vector& val)\n"; - - const Option* child = get_child(key); - if(child == NULL){ - return SPUD_KEY_ERROR; - }else{ - return child->get_option(val); - } - } - - OptionError OptionManager::Option::get_option(const string& key, vector& val) const{ - if(verbose) - cout << "OptionError OptionManager::Option::get_option(const string& key = " << key << ", vector& val)\n"; - - const Option* child = get_child(key); - if(child == NULL){ - return SPUD_KEY_ERROR; - }else{ - return child->get_option(val); - } - } - - OptionError OptionManager::Option::get_option(const string& key, string& val) const{ - if(verbose) - cout << "OptionError OptionManager::Option::get_option(const string& key = " << key << ", string& val = " << val << ")\n"; - - const Option* child = get_child(key); - if(child == NULL){ - return SPUD_KEY_ERROR; - }else{ - return child->get_option(val); - } - } - - OptionError OptionManager::Option::add_option(const string& key){ - if(verbose) - cout << "OptionError OptionManager::Option::add_option(const string& key = " << key << ")\n"; - - return create_child(key) == NULL ? SPUD_KEY_ERROR : SPUD_NO_ERROR; - } - - OptionError OptionManager::Option::set_option(const vector& val, const int& rank, const vector& shape){ - if(verbose) - cout << "OptionError OptionManager::Option::set_option(const vector& val, const int& rank = " << rank << ", const vector& shape)\n"; - - if(have_option("__value")){ - return set_option("__value", val, rank, shape); - }else{ - data_double = val; - OptionError set_err = set_option_type(SPUD_DOUBLE); - if(set_err != SPUD_NO_ERROR){ - return set_err; - } - set_err = set_rank_and_shape(rank, shape); - if(set_err != SPUD_NO_ERROR){ - return set_err; - } - return SPUD_NO_ERROR; - } - } - - OptionError OptionManager::Option::set_option(const vector& val, const int& rank, const vector& shape){ - if(verbose) - cout << "OptionError OptionManager::Option::set_option(const vector& val, const int& rank = " << rank << ", const vector& shape)\n"; - - if(have_option("__value")){ - return set_option("__value", val, rank, shape); - }else{ - data_int = val; - OptionError set_err = set_option_type(SPUD_INT); - if(set_err != SPUD_NO_ERROR){ - return set_err; - } - set_err = set_rank_and_shape(rank, shape); - if(set_err != SPUD_NO_ERROR){ - return set_err; - } - return SPUD_NO_ERROR; - } - } - - OptionError OptionManager::Option::set_option(const string& val){ - if(verbose) - cout << "OptionError OptionManager::Option::set_option(const string& val = " << val << ")\n"; - - if(have_option("__value")){ - return set_option("__value", val); - }else{ - data_string = val; - vector shape(2); - shape[0] = val.size(); shape[1] = -1; - OptionError set_err = set_option_type(SPUD_STRING); - if(set_err != SPUD_NO_ERROR){ - return set_err; - } - set_err = set_rank_and_shape(1, shape); - if(set_err != SPUD_NO_ERROR){ - return set_err; - } - return SPUD_NO_ERROR; - }; - } - - OptionError OptionManager::Option::set_option(const string& key, const vector& val, const int& rank, const vector& shape){ - if(verbose) - cout << "OptionError OptionManager::Option::set_option(const string& key = " << key << ", const vector& val, const int& rank = " << rank << ", const vector& shape)\n"; - - Option* opt = create_child(key); - if(opt == NULL){ - return SPUD_KEY_ERROR; - }else{ - return opt->set_option(val, rank, shape); - } - } - - OptionError OptionManager::Option::set_option(const string& key, const vector& val, const int& rank, const vector& shape){ - if(verbose) - cout << "OptionError OptionManager::Option::set_option(const string& key = " << key << ", const vector& val, const int& rank = " << rank << ", const vector& shape)\n"; - - Option* opt = create_child(key); - if(opt == NULL){ - return SPUD_KEY_ERROR; - }else{ - return opt->set_option(val, rank, shape); - } - } - - OptionError OptionManager::Option::set_option(const string& key, const string& val){ - if(verbose) - cout << "OptionError OptionManager::Option::set_option(const string& key = " << key << ", const string& val = " << val <<")\n"; - - Option* opt = create_child(key); - if(opt == NULL){ - return SPUD_KEY_ERROR; - }else{ - return opt->set_option(val); - } - } - - logical_t OptionManager::Option::set_is_attribute(const logical_t& is_attribute){ - if(verbose) - cout << "logical_t OptionManager::Option::set_is_attribute(const logical_t& is_attribute = " << is_attribute << ")\n"; - if(children.size() == 0 and get_option_type() == SPUD_STRING){ - this->is_attribute = is_attribute; - } - - return this->is_attribute; - } - - OptionError OptionManager::Option::set_attribute(const string& key, const string& val){ - if(verbose) - cout << "OptionError OptionManager::Option::set_attribute(const string& key = " << key << ", const string& val = " << val << ")\n"; - - Option* opt = create_child(key); - if(opt == NULL){ - return SPUD_KEY_ERROR; - }else{ - OptionError set_err = opt->set_option(val); - if(set_err != SPUD_NO_ERROR){ - return set_err; - } - opt->set_is_attribute(true); - return SPUD_NO_ERROR; - } - } - - OptionError OptionManager::Option::copy_option(const string& key1, const string& key2){ - if(verbose) - cout << "OptionError OptionManager::Option::copy_option(const string& key1 = " << key1 << ", const string& key2 = " << key2 << ")\n"; - - const Option* option1 = get_child(key1); - if(option1 == NULL){ - return SPUD_KEY_ERROR; - } - - const Option* option2 = get_child(key2); - if(option2 != NULL){ - return SPUD_KEY_ERROR; - } - - string::size_type lastPos = key2.find_last_not_of("/"); - lastPos = key2.find_last_of("/", lastPos); - string key2_parent = key2.substr(0, lastPos); - string key2_name = key2.substr(lastPos + 1); - - Option* option2_parent = create_child(key2_parent); - if(option2_parent == NULL){ - return SPUD_KEY_ERROR; - } - - Option* new_option1 = new Option(*option1); - new_option1->node_name = key2_name; - string new_node_name, name_attr; - new_option1->split_node_name(new_node_name, name_attr); - if(name_attr.size() == 0){ - option2_parent->children.push_back(pair(new_node_name, new_option1)); - }else{ - new_option1->set_attribute("name", name_attr); - option2_parent->children.push_back(pair(new_node_name + "::" + name_attr, new_option1)); - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::Option::move_option(const string& key1, const string& key2){ - if(verbose) - cout << "OptionError OptionManager::Option::move_option(const string& key1 = " << key1 << ", const string& key2 = " << key2 << ")\n"; - - const Option* option1 = get_child(key1); - if(option1 == NULL){ - return SPUD_KEY_ERROR; - } - - const Option* option2 = get_child(key2); - if(option2 != NULL){ - return SPUD_KEY_ERROR; - } - - string::size_type lastPos = key2.find_last_not_of("/"); - lastPos = key2.find_last_of("/", lastPos); - string key2_parent = key2.substr(0, lastPos); - string key2_name = key2.substr(lastPos + 1); - - Option* option2_parent = create_child(key2_parent); - if(option2_parent == NULL){ - return SPUD_KEY_ERROR; - } - - Option* new_option1 = new Option(*option1); - new_option1->node_name = key2_name; - string new_node_name, name_attr; - new_option1->split_node_name(new_node_name, name_attr); - if(name_attr.size() == 0){ - option2_parent->children.push_back(pair(new_node_name, new_option1)); - }else{ - new_option1->set_attribute("name", name_attr); - option2_parent->children.push_back(pair(new_node_name + "::" + name_attr, new_option1)); - } - - delete_option(key1); - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::Option::delete_option(const string& key){ - if(verbose) - cout << "OptionError OptionManager::Option::delete_option(const string& key = " << key << ")\n"; - - string branch, name; - OptionError key_err = split_name(key, name, branch); - if(key_err != SPUD_NO_ERROR){ - return key_err; - } - - Option* opt = get_child(name); - if(opt == NULL){ - return SPUD_KEY_ERROR; - }else if(branch.empty()){ - deque< pair >::iterator iter = find(name); - while(iter!=children.end()){ - if(iter->second == opt){ - children.erase(iter); - return SPUD_NO_ERROR; - } - iter = find_next(iter, name); - } - for(iter = children.begin();iter != children.end();iter++){ - if(iter->second == opt){ - children.erase(iter); - return SPUD_NO_ERROR; - } - } - return SPUD_KEY_ERROR; - }else{ - return opt->delete_option(branch); - } - } - - void OptionManager::Option::print(const string& prefix) const{ - cout << prefix << node_name; - string lprefix = prefix + " "; - - if(children.empty()){ - cout << ": "; - if(!data_double.empty()){ - for(vector::const_iterator i = data_double.begin();i != data_double.end();++i){ - cout << *i << " "; - } - }else if(!data_int.empty()){ - for(vector::const_iterator i=data_int.begin();i != data_int.end();++i){ - cout << *i << " "; - } - }else if(!data_string.empty()){ - cout << data_string; - }else{ - cout << "NULL"; - } - cout << endl; - }else{ - cout << "/" << endl; - - if(!data_double.empty()){ - cout << lprefix << ": "; - for(vector::const_iterator i = data_double.begin();i != data_double.end();++i){ - cout << *i<< " "; - } - cout << endl; - }else if(!data_int.empty()){ - cout << lprefix << ": "; - for(vector::const_iterator i=data_int.begin();i!=data_int.end();++i){ - cout << *i << " "; - } - cout << endl; - }else if(!data_string.empty()){ - cout << lprefix << ": " << data_string; - cout << endl; - } - for(deque< pair >::const_iterator i = children.begin();i!=children.end();++i){ - i->second->print(lprefix + " "); - } - } - - return; - } - - void OptionManager::Option::verbose_on(){ - cout << "void OptionManager::Option::verbose_on(void)\n"; - - verbose = true; - } - - void OptionManager::Option::verbose_off(){ - verbose = false; - } - - // PRIVATE METHODS - - OptionManager::Option* OptionManager::Option::create_child(const string& key){ - if(verbose) - cout << "OptionManager::Option* OptionManager::Option::create_child(const string& key = " << key << ")\n"; - - if(key == "/" or key.empty()) - return this; - - string branch, name; - int index; - OptionError key_err = split_name(key, name, index, branch); - if(key_err != SPUD_NO_ERROR){ - return NULL; - } - - if(name.empty()){ - return NULL; - } - - deque< pair >::iterator child; - if(count(name) == 0){ - string name2 = name + "::"; - int i = 0; - for(child = children.begin();child != children.end();child++){ - if(child->first.compare(0, name2.size(), name2) == 0){ - if(index < 0 or i == index){ - break; - }else{ - i++; - } - } - } - if(child == children.end()){ - if(name == "__value" and get_option_type() != SPUD_NONE){ - cerr << "SPUD WARNING: Creating __value child for non null element - deleting parent data" << endl; - set_option_type(SPUD_NONE); - } - children.push_back(pair(name, new Option(name))); - string new_node_name, name_attr; - child = children.end(); child--; - child->second->split_node_name(new_node_name, name_attr); - if(name_attr.size() > 0){ - child->second->set_attribute("name", name_attr); - } - is_attribute = false; - } - }else{ - if(index < 0){ - child = find(name); - }else{ - child = find(name); - size_t i; - for(i = 0;child != children.end();i++){ - if((int)i == index){ - break; - } - child = find_next(child, name); - } - if(child == children.end() and index == (int)i){ - children.push_back(pair(name, new Option(name))); - child = children.end(); child--; - is_attribute = false; - } - } - } - - if(child == children.end()){ - return NULL; - }else if(branch.empty()){ - return child->second; - }else{ - return child->second->create_child(branch); - } - } - - OptionError OptionManager::Option::set_rank_and_shape(const int& rank, const vector& shape){ - if(verbose) - cout << "OptionError OptionManager::Option::set_rank_and_shape(const int& rank = " << rank << ", const vector& shape)\n"; - - if((int)shape.size() != 2 and rank != -1 and (int)shape.size() != rank){ - return SPUD_SHAPE_ERROR; - } - - OptionType type = get_option_type(); - logical_t set_attrs = (type == SPUD_DOUBLE or type == SPUD_INT); - switch(rank){ - case(-1): - this->rank = -1; - this->shape[0] = -1; - this->shape[1] = -1; - break; - case(0): - this->rank = 0; - this->shape[0] = -1; - this->shape[1] = -1; - if(set_attrs){ - ostringstream rank_as_string; - rank_as_string << this->rank; - set_attribute("rank", rank_as_string.str()); - } - break; - case(1): - this->rank = 1; - this->shape[0] = shape[0]; - this->shape[1] = -1; - if(set_attrs){ - ostringstream rank_as_string; - rank_as_string << this->rank; - set_attribute("rank", rank_as_string.str()); - ostringstream shape_as_string; - shape_as_string << shape[0]; - set_attribute("shape", shape_as_string.str()); - } - break; - case(2): - this->rank = 2; - this->shape[0] = shape[0]; - this->shape[1] = shape[1]; - if(set_attrs){ - ostringstream rank_as_string; - rank_as_string << this->rank; - set_attribute("rank", rank_as_string.str()); - ostringstream shape_as_string; - shape_as_string << shape[0] << " " << shape[1]; - set_attribute("shape", shape_as_string.str()); - } - break; - default: - return SPUD_RANK_ERROR; - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::Option::set_option_type(const OptionType& option_type){ - if(verbose) - cout << "OptionError OptionManager::Option::set_option_type(const OptionType& option_type)\n"; - - switch(option_type){ - case(SPUD_DOUBLE): - data_int.clear(); - data_string = ""; - is_attribute = false; - break; - case(SPUD_INT): - data_double.clear(); - data_string = ""; - is_attribute = false; - break; - case(SPUD_NONE): - data_double.clear(); - data_int.clear(); - data_string = ""; - is_attribute = false; - break; - case(SPUD_STRING): - data_double.clear(); - data_int.clear(); - break; - default: - return SPUD_TYPE_ERROR; - } - - return SPUD_NO_ERROR; - } - - void OptionManager::Option::parse_node(const string& root, const TiXmlNode* node){ - if(verbose) - cout << "void OptionManager::Option::parse_node(const string& root = " << root << ", const TiXmlNode* node)\n"; - - // Should only deal with TiXmlNode::ELEMENT types - if(node->Type() != TiXmlNode::ELEMENT){ - cerr << "SPUD WARNING - Non-element: " << root << " encountered" << endl; - return; - } - - const TiXmlElement* element = node->ToElement(); - - // Establish new base name of this node - string basename = root + "/" + node->ValueStr(); - if(element->Attribute("name")){ - basename = basename + "::" + element->Attribute("name"); - } - - // Ensure this path has been added - Option* child = create_child(basename); - if(child == NULL){ - cerr << "SPUD ERROR: Unexpected failure when creating child element" << endl; - exit(-1); - } - - // Store node attributes - for(const TiXmlAttribute* att = element->FirstAttribute();att;att = att->Next()){ - string att_name(basename + "/" + att->Name()); - set_attribute(att_name, att->ValueStr()); - } - - // Loop through all child elements - for(const TiXmlNode* cnode = node->FirstChild();cnode;cnode = cnode->NextSibling()){ - switch(cnode->Type()){ - case(TiXmlNode::ELEMENT): - break; - case(TiXmlNode::TEXT): - // Store node data - set_option(basename, cnode->ValueStr()); - continue; - default: - continue; - } - - // Special case when the child of cnode is empty - if(!cnode->FirstChild()){ - parse_node(basename, cnode); - continue; - } - - const TiXmlElement* celement = cnode->ToElement(); - - if(cnode->ValueStr() == string("integer_value")){ - // Tokenise the data stored and convert to ints - vector tokens; - tokenize(cnode->FirstChild()->ValueStr(), tokens); - - // Find shape and rank - int rank; - vector shape(2); - istringstream(celement->Attribute("rank")) >> rank; - if(rank == 0){ - shape[0] = -1; shape[1] = -1; - }else if(rank == 1){ - shape[0] = tokens.size(); shape[1] = -1; - }else if(rank == 2){ - istringstream(celement->Attribute("shape")) >> shape[0] >> shape[1]; - } - - vector val; - val.resize(tokens.size()); - for(size_t i = 0;i> val[i]; - } - - set_option(basename + "/__value", val, rank, shape); - for(const TiXmlAttribute* att = celement->FirstAttribute();att;att = att->Next()){ - string att_name(basename + "/__value/" + att->Name()); - set_attribute(att_name, att->ValueStr()); - } - }else if(cnode->ValueStr() == string("real_value")){ - // Tokenise the data stored and convert to doubles - vector tokens; - tokenize(cnode->FirstChild()->ValueStr(), tokens); - - // Find shape and rank - int rank; - vector shape(2); - istringstream(celement->Attribute("rank")) >> rank; - if(rank == 0){ - shape[0] = -1; shape[1] = -1; - }else if(rank == 1){ - shape[0] = tokens.size(); shape[1] = -1; - }else if(rank == 2){ - istringstream(celement->Attribute("shape")) >> shape[0] >> shape[1]; - } - - vector val; - val.resize(tokens.size()); - for(size_t i = 0;i::quiet_NaN(); - }else if(tokens[i] == "inf"){ - val[i] = numeric_limits::infinity(); - }else if(tokens[i] == "-inf"){ - val[i] = -numeric_limits::infinity(); - }else{ - istringstream(tokens[i]) >> val[i]; - } - } - - set_option(basename + "/__value", val, rank, shape); - for(const TiXmlAttribute* att = celement->FirstAttribute();att;att = att->Next()){ - string att_name(basename + "/__value/" + att->Name()); - set_attribute(att_name, att->ValueStr()); - } - }else if(cnode->ValueStr() == string("string_value")){ - set_option(basename + "/__value", cnode->FirstChild()->ValueStr()); - for(const TiXmlAttribute* att = celement->FirstAttribute();att;att = att->Next()){ - string att_name(basename + "/__value/" + att->Name()); - set_attribute(att_name, att->ValueStr()); - } - }else{ - parse_node(basename, cnode); - } - } - } - - TiXmlElement* OptionManager::Option::to_element() const{ - if(verbose) - cout << "TiXmlElement* OptionManager::Option:to_element(void) const\n"; - - if(is_attribute){ - cerr << "SPUD WARNING: Converting an attribute to an element" << endl; - } - - // Create new element - TiXmlElement* ele = new TiXmlElement(node_name); - - // Set element name and name attribute if composite name - string node_name, name_attr; - split_node_name(node_name, name_attr); - if(name_attr.size() > 0){ - ele->SetValue(node_name); - ele->SetAttribute("name", name_attr); - } - - // Set data - TiXmlText* data_ele = new TiXmlText(""); - data_ele->SetValue(data_as_string()); - ele->LinkEndChild(data_ele); - - for(deque< pair >::const_iterator iter = children.begin();iter != children.end();iter++){ - if(iter->second->is_attribute){ - // Add attribute - ele->SetAttribute(iter->second->node_name, iter->second->data_as_string()); - }else{ - TiXmlElement* child_ele = iter->second->to_element(); - if(iter->second->node_name == "__value"){ - // Detect data sub-element - switch(iter->second->get_option_type()){ - case(SPUD_DOUBLE): - child_ele->SetValue("real_value"); - break; - case(SPUD_INT): - child_ele->SetValue("integer_value"); - break; - case(SPUD_NONE): - break; - case(SPUD_STRING): - child_ele->SetValue("string_value"); - break; - default: - cerr << "SPUD ERROR: Invalid option type" << endl; - exit(-1); - } - } - // Add child - ele->LinkEndChild(child_ele); - } - } - return ele; - } - - void OptionManager::Option::tokenize(const string& str, vector& tokens, const string& delimiters) const{ - if(verbose) - cout << "void OptionManager::Option::tokenize(const string& str = " << str << ", vector& tokens, const string& delimiters = " << delimiters << ")\n"; - - tokens.clear(); - - // Skip delimiters at beginning. - string::size_type lastPos = str.find_first_not_of(delimiters, 0); - - // Find first "non-delimiter". - string::size_type pos = str.find_first_of(delimiters, lastPos); - - while (string::npos != pos || string::npos != lastPos){ - // Found a token, add it to the vector. - tokens.push_back(str.substr(lastPos, pos - lastPos)); - - // Skip delimiters. Note the "not_of" - lastPos = str.find_first_not_of(delimiters, pos); - - // Find next "non-delimiter" - pos = str.find_first_of(delimiters, lastPos); - } - - return; - } - - OptionError OptionManager::Option::split_name(const string& in, string& name, string& branch) const{ - if(verbose) - cout << "OptionError OptionManager::Option::split_name(const string& in = " << in << ", string& name, string& branch) const\n"; - - name = ""; - branch = ""; - - string fullname = in.substr(0, min(in.size(), in.find_first_of(" "))); - - // Skip delimiters at beginning. - string::size_type lastPos = fullname.find_first_not_of("/", 0); - if(lastPos == string::npos){ - return SPUD_NO_ERROR; - } - - // Find next delimiter - string::size_type pos = fullname.find_first_of("/", lastPos); - if(pos == string::npos){ - name = fullname.substr(lastPos, fullname.size() - lastPos); - }else{ - name = fullname.substr(lastPos, pos - lastPos); - branch = fullname.substr(pos, fullname.size()-pos); - } - - return SPUD_NO_ERROR; - } - - OptionError OptionManager::Option::split_name(const string& in, string& name, int& index, string& branch) const{ - if(verbose) - cout << "OptionError OptionManager::Option::split_name(const string& in = " << in << ", string& name, int& index, string& branch) const\n"; - - index = -1; - OptionError key_err = split_name(in, name, branch); - if(key_err != SPUD_NO_ERROR){ - return key_err; - } - - // Extract the index from the name if necessary - string::size_type pos = name.find_first_of("[", 0); - string::size_type lastPos = name.find_first_of("]", 0); - if(lastPos < name.size() - 1){ - return SPUD_KEY_ERROR; - } - if((lastPos-pos) > 0){ - istringstream(name.substr(pos + 1, lastPos - 1))>>index; - name = name.substr(0, pos); - } - - return SPUD_NO_ERROR; - } - - void OptionManager::Option::split_node_name(string& node_name, string& name_attr) const{ - if(verbose) - cout << "void OptionManager::Option::split_node_name(string& node_name, string& name_attr) const\n"; - - string::size_type firstPos = this->node_name.rfind("::"); - if(firstPos == string::npos or firstPos == this->node_name.size() - 2){ - node_name = this->node_name; - name_attr = ""; - }else{ - node_name = this->node_name.substr(0, firstPos); - name_attr = this->node_name.substr(firstPos + 2); - } - - return; - } - - string OptionManager::Option::data_as_string() const{ - if(verbose) - cout << "string OptionManager::Option::data_as_string(void) const\n"; - - ostringstream data_as_string; - data_as_string.precision(numeric_limits< double >::digits10); - switch(get_option_type()){ - case(SPUD_DOUBLE): - for(unsigned int i = 0;i < data_double.size();i++){ - data_as_string << data_double[i]; - if(i < data_double.size() - 1){ - data_as_string << " "; - } - } - return data_as_string.str(); - case(SPUD_INT): - for(unsigned int i = 0;i < data_int.size();i++){ - data_as_string << data_int[i]; - if(i < data_int.size() - 1){ - data_as_string << " "; - } - } - return data_as_string.str(); - case(SPUD_NONE): - return ""; - case(SPUD_STRING): - return data_string; - default: - cerr << "SPUD ERROR: Invalid option type" << endl; - exit(-1); - } - } - - // END OF OptionManager::Option CLASS METHODS - - // The option manager - OptionManager OptionManager::manager; - -} diff --git a/libspud/src/spud_interfaces.cpp b/libspud/src/spud_interfaces.cpp deleted file mode 100644 index 1e63897490..0000000000 --- a/libspud/src/spud_interfaces.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/* Copyright (C) 2007 Imperial College London and others. - - Please see the AUTHORS file in the main source directory for a full list - of copyright holders. - - Applied Modelling and Computation Group - Department of Earth Science and Engineering - Imperial College London - - David.Ham@Imperial.ac.uk - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, - version 2.1 of the License. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - USA -*/ - -#include "spud.h" -#include "spud" - -using namespace std; - -using namespace Spud; - -extern "C" { - - void spud_clear_options(){ - clear_options(); - - return; - } - - void* spud_get_manager(){ - return get_manager(); - } - - void spud_set_manager(void* m){ - set_manager(m); - return; - } - - int spud_load_options(const char* filename, const int filename_len) - { - return load_options(string(filename, filename_len)); - } - - int spud_write_options(const char* filename, const int filename_len) - { - return write_options(string(filename, filename_len)); - } - - int spud_get_child_name(const char* key, const int key_len, const int index, char* child_name, const int child_name_len){ - string child_name_handle; - OptionError get_name_err = get_child_name(string(key, key_len), index, child_name_handle); - if(get_name_err != SPUD_NO_ERROR){ - return get_name_err; - } - - int copy_len = (int)child_name_handle.size() > child_name_len ? child_name_len : child_name_handle.size(); - memcpy(child_name, child_name_handle.c_str(), copy_len); - - return SPUD_NO_ERROR; - } - - int spud_get_number_of_children(const char* key, const int key_len, int* child_count){ - return get_number_of_children(string(key, key_len), *child_count); - } - - int spud_option_count(const char* key, const int key_len){ - return option_count(string(key, key_len)); - } - - int spud_have_option(const char* key, const int key_len){ - return have_option(string(key, key_len)) ? 1 : 0; - } - - int spud_get_option_type(const char* key, const int key_len, int* type){ - OptionType type_handle; - OptionError get_type_err = get_option_type(string(key, key_len), type_handle); - if(get_type_err != SPUD_NO_ERROR){ - return get_type_err; - } - - *type = type_handle; - - return SPUD_NO_ERROR; - } - - int spud_get_option_rank(const char* key, const int key_len, int* rank){ - return get_option_rank(string(key, key_len), *rank); - } - - int spud_get_option_shape(const char* key, const int key_len, int* shape){ - vector shape_handle; - OptionError get_shape_err = get_option_shape(string(key, key_len), shape_handle); - if(get_shape_err != SPUD_NO_ERROR){ - return get_shape_err; - } - - shape[0] = -1; shape[1] = -1; - for(size_t i = 0;i < shape_handle.size();i++){ - shape[i] = shape_handle[i]; - } - - return SPUD_NO_ERROR; - } - - int spud_get_option(const char* key, const int key_len, void* val){ - string key_handle(key, key_len); - - OptionType type; - OptionError get_type_err = get_option_type(key_handle, type); - if(get_type_err != SPUD_NO_ERROR){ - return get_type_err; - } - - int rank; - OptionError get_rank_err = get_option_rank(key_handle, rank); - if(get_rank_err != SPUD_NO_ERROR){ - return get_rank_err; - } - - if(type == SPUD_DOUBLE){ - if(rank == 0){ - double val_handle; - OptionError get_err = get_option(key_handle, val_handle); - if(get_err != SPUD_NO_ERROR){ - return get_err; - } - *((double*)val) = val_handle; - }else if(rank == 1){ - vector val_handle; - OptionError get_err = get_option(key_handle, val_handle); - if(get_err != SPUD_NO_ERROR){ - return get_err; - } - for(size_t i = 0;i < val_handle.size();i++){ - ((double*)val)[i] = val_handle[i]; - } - }else if(rank == 2){ - vector< vector > val_handle; - OptionError get_err = get_option(key_handle, val_handle); - if(get_err != SPUD_NO_ERROR){ - return get_err; - } - for(size_t i = 0;i < val_handle.size();i++){ - for(size_t j = 0;j < val_handle[0].size();j++){ - ((double*)val)[i * val_handle[0].size() + j] = val_handle[i][j]; - } - } - }else{ - return SPUD_RANK_ERROR; - } - }else if(type == SPUD_INT){ - if(rank == 0){ - int val_handle; - OptionError get_err = get_option(key_handle, val_handle); - if(get_err != SPUD_NO_ERROR){ - return get_err; - } - *((int*)val) = val_handle; - }else if(rank == 1){ - vector val_handle; - OptionError get_err = get_option(key_handle, val_handle); - if(get_err != SPUD_NO_ERROR){ - return get_err; - } - for(size_t i = 0;i < val_handle.size();i++){ - ((int*)val)[i] = val_handle[i]; - } - }else if(rank == 2){ - vector< vector > val_handle; - OptionError get_err = get_option(key_handle, val_handle); - if(get_err != SPUD_NO_ERROR){ - return get_err; - } - for(size_t i = 0;i < val_handle.size();i++){ - for(size_t j = 0;j < val_handle[0].size();j++){ - ((int*)val)[i * val_handle[0].size() + j] = val_handle[i][j]; - } - } - }else{ - return SPUD_RANK_ERROR; - } - }else if(type == SPUD_STRING){ - string val_handle; - OptionError get_err = get_option(key_handle, val_handle); - if(get_err != SPUD_NO_ERROR){ - return get_err; - } - memcpy(val, val_handle.c_str(), val_handle.size() * sizeof(char)); - }else{ - return SPUD_TYPE_ERROR; - } - - return SPUD_NO_ERROR; - } - - int spud_add_option(const char* key, const int key_len){ - return add_option(string(key, key_len)); - } - - int spud_set_option(const char* key, const int key_len, const void* val, const int type, const int rank, const int* shape){ - string key_handle(key, key_len); - - if(type == SPUD_DOUBLE){ - if(rank == 0){ - double val_handle = *((double*)val); - return set_option(key_handle, val_handle); - }else if(rank == 1){ - vector val_handle; - for(int i = 0;i < shape[0];i++){ - val_handle.push_back(((double*)val)[i]); - } - return set_option(key_handle, val_handle); - }else if(rank == 2){ - vector< vector > val_handle; - for(int i = 0;i < shape[0];i++){ - val_handle.push_back(vector()); - for(int j = 0;j < shape[1];j++){ - val_handle[i].push_back(((double*)val)[i * val_handle[0].size() + j]); - } - } - return set_option(key_handle, val_handle); - }else{ - return SPUD_RANK_ERROR; - } - }else if(type == SPUD_INT){ - if(rank == 0){ - int val_handle = *((int*)val); - return set_option(key_handle, val_handle); - }else if(rank == 1){ - vector val_handle; - for(int i = 0;i < shape[0];i++){ - val_handle.push_back(((int*)val)[i]); - } - return set_option(key_handle, val_handle); - }else if(rank == 2){ - vector< vector > val_handle; - for(int i = 0;i < shape[0];i++){ - val_handle.push_back(vector()); - for(int j = 0;j < shape[1];j++){ - val_handle[i].push_back(((int*)val)[i * val_handle[0].size() + j]); - } - } - return set_option(key_handle, val_handle); - }else{ - return SPUD_RANK_ERROR; - } - }else if(type == SPUD_STRING){ - return set_option(key_handle, string((char*)val, shape[0])); - }else{ - return SPUD_TYPE_ERROR; - } - } - - int spud_set_option_attribute(const char* key, const int key_len, const char* val, const int val_len){ - return set_option_attribute(string(key, key_len), string(val, val_len)); - } - - int spud_move_option(const char* key1, const int key1_len, const char* key2, const int key2_len){ - return move_option(string(key1, key1_len), string(key2, key2_len)); - } - - int spud_copy_option(const char* key1, const int key1_len, const char* key2, const int key2_len){ - return copy_option(string(key1, key1_len), string(key2, key2_len)); - } - int spud_delete_option(const char* key, const int key_len){ - return delete_option(string(key, key_len)); - } - - void spud_print_options(){ - print_options(); - - return; - } - -} diff --git a/libspud/src/tests/Makefile.in b/libspud/src/tests/Makefile.in deleted file mode 100644 index 4d656a71d3..0000000000 --- a/libspud/src/tests/Makefile.in +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright (C) 2006 Imperial College London and others. -# -# Please see the AUTHORS file in the main source directory for a full list -# of copyright holders. -# -# Applied Modelling and Computation Group -# Department of Earth Science and Engineering -# Imperial College London -# -# David.Ham@Imperial.ac.uk -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation, -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA - -FC = @FC@ -FCFLAGS = -I../.. @FCFLAGS@ - -CXX = @CXX@ -CXXFLAGS= @CPPFLAGS@ @CXXFLAGS@ -I../../include - -LIBS = @LIBS@ ../../libspud.a - -# The test binaries NOT to be built -DISABLED_TESTS = unittest_tools - -# The test programs to be built -TEST_BINARIES = $(addprefix bin/, $(filter-out $(DISABLED_TESTS), $(basename $(wildcard *.f90)))) - -default: test - -test: unittest - -test-binaries: $(TEST_BINARIES) - -unittest: test-binaries - @PATH=.:$PATH; $(TEST_BINARIES) - -.SUFFIXES: .f90 .F90 .c .cpp .o .a $(.SUFFIXES) - -%.o: %.f90 - $(FC) $(FCFLAGS) -c $< -%.o: %.F90 - $(FC) $(FCFLAGS) -c $< -%.o: %.cpp - $(CXX) $(CXXFLAGS) -c $< - -# Creates a TESTNAME_main.o from test_main.cpp which calls the subroutine -# TESTNAME, that should be a subroutine in TESTNAME.f90 -%_main.o: unittest_tools.o - $(CXX) $(CXXFLAGS) -D TESTNAME=$(subst _main.o,,$@)_ -o $@ -c test_main.cpp - -# Link this TESTNAME_main.o with TESTNAME.o from TESTNAME.F90 -bin/%: %_main.o %.o - mkdir -p bin - $(CXX) -o $@ $(filter %.o,$^) unittest_tools.o $(LIBS) - -clean: - rm -f $(TEST_BINARIES) - rm -rf bin - rm -f *.o *.mod - -distclean: - rm -f Makefile diff --git a/libspud/src/tests/test_fspud.f90 b/libspud/src/tests/test_fspud.f90 deleted file mode 100644 index f31c5015da..0000000000 --- a/libspud/src/tests/test_fspud.f90 +++ /dev/null @@ -1,964 +0,0 @@ -! Copyright (C) 2007 Imperial College London and others. -! -! Please see the AUTHORS file in the main source directory for a full list -! of copyright holders. -! -! Applied Modelling and Computation Group -! Department of Earth Science and Engineering -! Imperial College London -! -! David.Ham@Imperial.ac.uk -! -! This library is free software; you can redistribute it and/or -! modify it under the terms of the GNU Lesser General Public -! License as published by the Free Software Foundation, -! version 2.1 of the License. -! -! This library is distributed in the hope that it will be useful, -! but WITHOUT ANY WARRANTY; without even the implied warranty of -! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -! Lesser General Public License for more details. -! -! You should have received a copy of the GNU Lesser General Public -! License along with this library; if not, write to the Free Software -! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -! USA - -subroutine test_fspud - - use spud - use unittest_tools - - implicit none - - integer, parameter :: D = kind(0.0D0) - real(D), parameter :: tol = epsilon(0.0) - - print *, "*** Testing clear_options ***" - call test_clear_options("/type_none") - - print *, "*** Testing set_option and get_option for real scalar ***" - call test_set_and_get_real_scalar("/real_scalar", 42.0_D) - - print *, "*** Testing set_option and get_option for real vector ***" - call test_set_and_get_real_vector("/real_vector", (/42.0_D, 43.0_D/)) - - print *, "*** Testing set_option and get_option for real tensor ***" - call test_set_and_get_real_tensor("/real_tensor", reshape((/42.0_D, 43.0_D, 44.0_D, 45.0_D, 46.0_D, 47.0_D/), (/2, 3/))) - - print *, "*** Testing set_option and get_option for integer scalar ***" - call test_set_and_get_integer_scalar("/integer_scalar", 42) - - print *, "*** Testing set_option and get_option for integer vector ***" - call test_set_and_get_integer_vector("/integer_vector", (/42, 43/)) - - print *, "*** Testing set_option and get_option for integer tensor ***" - call test_set_and_get_integer_tensor("/integer_tensor", reshape((/42, 43, 44, 45, 46, 47/), (/2, 3/))) - - print *, "*** Testing set_option and get_option for character ***" - call test_set_and_get_character("/character", "Forty Two") - - print *, "*** Testing add_option and get_option ***" - call test_set_and_get_type_none("/type_none") - - print *, "*** Testing set_option for integer scalar, with option name ***" - call test_named_key("/integer_scalar", "name", 42) - - print *, "*** Testing set_option for integer scalar, with option name (containing symbols) ***" - call test_named_key("/integer_scalar", 'tricky_name!"£$%^&*()', 42) - - print *, "*** Testing set_option for integer scalar, with option index ***" - call test_indexed_key("/integer_scalar", 42) - - print *, "*** Testing move_option ***" - call test_move_option("/type_none", "/type_none_2") - - print *, "*** Testing copy_option ***" - call test_copy_option("/type_none", "/type_none_2") - -contains - - subroutine test_key_errors(key) - character(len = *), intent(in) :: key - - character(len = 255) :: test_char - integer :: test_integer_scalar - integer, dimension(3) :: test_integer_vector, integer_vector_default - integer, dimension(3, 4) :: test_integer_tensor, integer_tensor_default - real(D) :: test_real_scalar - real(D), dimension(3) :: test_real_vector, real_vector_default - real(D), dimension(3, 4) :: test_real_tensor, real_tensor_default - integer :: rank, type, stat - integer, dimension(2) :: shape - - integer :: i, j - - do i = 1, size(real_vector_default) - real_vector_default = 42.0_D + i - end do - do i = 1, size(real_tensor_default, 1) - do j = 1, size(real_tensor_default, 2) - real_tensor_default = 42.0_D + i * size(real_tensor_default, 2) + j - end do - end do - do i = 1, size(integer_vector_default) - integer_vector_default = 42.0_D + i - end do - do i = 1, size(real_tensor_default, 1) - do j = 1, size(integer_tensor_default, 2) - integer_tensor_default = 42.0_D + i * size(integer_tensor_default, 2) + j - end do - end do - - call report_test("[Missing option]", have_option(key), .false., "Missing option reported present") - type = option_type(key, stat) - call report_test("[Key error when extracting option type]", stat /= SPUD_KEY_ERROR, .false., "Returned incorrect error code when retrieving option type") - rank = option_rank(key, stat) - call report_test("[Key error when extracting option rank]", stat /= SPUD_KEY_ERROR, .false., "Returned incorrect error code when retrieving option rank") - shape = option_shape(key, stat) - call report_test("[Key error when extracting option shape]", stat /= SPUD_KEY_ERROR, .false., "Returned incorrect error code when retrieving option shape") - call get_option(key, test_real_scalar, stat) - call report_test("[Key error when extracting option data]", stat /= SPUD_KEY_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, test_real_scalar, stat, default = 42.0_D) - call report_test("[Extracted option data with default argument]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data (default)]", abs(test_real_scalar - 42.0_D) > tol, .false., "Retrieved incorrect option data") - call get_option(key, test_real_vector, stat) - call report_test("[Key error when extracting option data]", stat /= SPUD_KEY_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, test_real_vector, stat, default = real_vector_default) - call report_test("[Extracted option data with default argument]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data (default)]", maxval(abs(test_real_vector - real_vector_default)) > tol, .false., "Retrieved incorrect option data") - call get_option(key, test_real_tensor, stat) - call report_test("[Key error when extracting option data]", stat /= SPUD_KEY_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, test_real_tensor, stat, default = real_tensor_default) - call report_test("[Extracted option data with default argument]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data (default)]", maxval(abs(test_real_tensor - real_tensor_default)) > tol, .false., "Retrieved incorrect option data") - call get_option(key, test_integer_scalar, stat) - call report_test("[Key error when extracting option data]", stat /= SPUD_KEY_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, test_integer_scalar, stat, default = 42) - call report_test("[Extracted option data with default argument]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data (default)]", test_integer_scalar /= 42, .false., "Retrieved incorrect option data") - call get_option(key, test_integer_vector, stat) - call report_test("[Key error when extracting option data]", stat /= SPUD_KEY_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, test_integer_vector, stat, default = integer_vector_default) - call report_test("[Extracted option data with default argument]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data (default)]", count(test_integer_vector /= integer_vector_default) > 0, .false., "Retrieved incorrect option data") - call get_option(key, test_integer_tensor, stat) - call report_test("[Key error when extracting option data]", stat /= SPUD_KEY_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, test_integer_tensor, stat, default = integer_tensor_default) - call report_test("[Extracted option data with default argument]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data (default)]", count(test_integer_tensor /= integer_tensor_default) > 0, .false., "Retrieved incorrect option data") - call get_option(key, test_char, stat) - call report_test("[Key error when extracting option data]", stat /= SPUD_KEY_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, test_char, stat, default = "Forty Two") - call report_test("[Extracted option data with default argument]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data (default)]", test_char /= "Forty Two", .false., "Retrieved incorrect option data") - - end subroutine test_key_errors - - subroutine test_key_present(key) - character(len = *), intent(in) :: key - - call report_test("[Option present]", .not. have_option(key), .false., "Present option reported missing") - - end subroutine test_key_present - - subroutine test_type(key, type) - character(len = *), intent(in) :: key - integer, intent(in) :: type - - integer :: stat, type_ret - - type_ret = option_type(key, stat) - call report_test("[Extracted option type]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option type") - call report_test("[Correct option type]", type_ret /= type, .false., "Incorrect option type returned") - - end subroutine test_type - - subroutine test_rank(key, rank) - character(len = *), intent(in) :: key - integer, intent(in) :: rank - - integer :: stat, rank_ret - - rank_ret = option_rank(key, stat) - call report_test("[Extracted option rank]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option rank") - call report_test("[Correct option rank]", rank_ret /= rank, .false., "Incorrect option rank returned") - - end subroutine test_rank - - subroutine test_shape(key, shape) - character(len = *), intent(in) :: key - integer, dimension(2), intent(in) :: shape - - integer :: stat - integer, dimension(2) :: shape_ret - - shape_ret = option_shape(key, stat) - call report_test("[Extracted option shape]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option shape") - call report_test("[Correct option shape]", count(shape_ret /= shape) /= 0, .false., "Incorrect option shape returned") - - end subroutine test_shape - - subroutine test_type_errors_real(key) - character(len = *), intent(in) :: key - - integer :: stat - real(D) :: real_scalar_val - real(D), dimension(3) :: real_vector_default, real_vector_val - real(D), dimension(3, 4) :: real_tensor_default, real_tensor_val - - call get_option(key, real_scalar_val, stat) - call report_test("[Type error when extracting option data]", stat /= SPUD_TYPE_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, real_scalar_val, stat, default = 0.0_D) - call report_test("[Type error when extracting option data with default argument]", stat /= SPUD_TYPE_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, real_vector_val, stat) - call report_test("[Type error when extracting option data]", stat /= SPUD_TYPE_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, real_vector_val, stat, default = real_vector_default) - call report_test("[Type error when extracting option data with default argument]", stat /= SPUD_TYPE_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, real_tensor_val, stat) - call report_test("[Type error when extracting option data]", stat /= SPUD_TYPE_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, real_tensor_val, stat, default = real_tensor_default) - call report_test("[Type error when extracting option data with default argument]", stat /= SPUD_TYPE_ERROR, .false., "Returned incorrect error code when retrieving option data") - - end subroutine test_type_errors_real - - subroutine test_type_errors_integer(key) - character(len = *), intent(in) :: key - - integer :: integer_scalar_val, stat - integer, dimension(3) :: integer_vector_default, integer_vector_val - integer, dimension(3, 4) :: integer_tensor_default, integer_tensor_val - - call get_option(key, integer_scalar_val, stat) - call report_test("[Type error when extracting option data]", stat /= SPUD_TYPE_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, integer_scalar_val, stat, default = 0) - call report_test("[Type error when extracting option data with default argument]", stat /= SPUD_TYPE_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, integer_vector_val, stat) - call report_test("[Type error when extracting option data]", stat /= SPUD_TYPE_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, integer_vector_val, stat, default = integer_vector_default) - call report_test("[Type error when extracting option data with default argument]", stat /= SPUD_TYPE_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, integer_tensor_val, stat) - call report_test("[Type error when extracting option data]", stat /= SPUD_TYPE_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, integer_tensor_val, stat, default = integer_tensor_default) - call report_test("[Type error when extracting option data with default argument]", stat /= SPUD_TYPE_ERROR, .false., "Returned incorrect error code when retrieving option data") - - end subroutine test_type_errors_integer - - subroutine test_type_errors_character(key) - character(len = *), intent(in) :: key - - character(len = 0) :: character_val - integer :: stat - - call get_option(key, character_val, stat) - call report_test("[Type error when extracting option data]", stat /= SPUD_TYPE_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, character_val, stat, default = "") - call report_test("[Type error when extracting option data with default argument]", stat /= SPUD_TYPE_ERROR, .false., "Returned incorrect error code when retrieving option data") - - end subroutine test_type_errors_character - - subroutine test_rank_errors_real_scalar(key) - character(len = *), intent(in) :: key - - integer :: stat - real(D) :: real_scalar_val - - call get_option(key, real_scalar_val, stat) - call report_test("[Rank error when extracting option data]", stat /= SPUD_RANK_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, real_scalar_val, stat, default = 0.0_D) - call report_test("[Rank error when extracting option data with default argument]", stat /= SPUD_RANK_ERROR, .false., "Returned error code when retrieving option data") - - end subroutine test_rank_errors_real_scalar - - subroutine test_rank_errors_real_vector(key) - character(len = *), intent(in) :: key - - integer :: stat - real(D), dimension(3) :: real_vector_default, real_vector_val - - call get_option(key, real_vector_val, stat) - call report_test("[Rank error when extracting option data]", stat /= SPUD_RANK_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, real_vector_val, stat, default = real_vector_default) - call report_test("[Rank error when extracting option data with default argument]", stat /= SPUD_RANK_ERROR, .false., "Returned error code when retrieving option data") - - end subroutine test_rank_errors_real_vector - - subroutine test_rank_errors_real_tensor(key) - character(len = *), intent(in) :: key - - integer :: stat - real(D), dimension(3, 4) :: real_tensor_default, real_tensor_val - - call get_option(key, real_tensor_val, stat) - call report_test("[Rank error when extracting option data]", stat /= SPUD_RANK_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, real_tensor_val, stat, default = real_tensor_default) - call report_test("[Rank error when extracting option data with default argument]", stat /= SPUD_RANK_ERROR, .false., "Returned error code when retrieving option data") - - end subroutine test_rank_errors_real_tensor - - subroutine test_rank_errors_integer_scalar(key) - character(len = *), intent(in) :: key - - integer :: integer_scalar_val, stat - - call get_option(key, integer_scalar_val, stat) - call report_test("[Rank error when extracting option data]", stat /= SPUD_RANK_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, integer_scalar_val, stat, default = 0) - call report_test("[Rank error when extracting option data with default argument]", stat /= SPUD_RANK_ERROR, .false., "Returned error code when retrieving option data") - - end subroutine test_rank_errors_integer_scalar - - subroutine test_rank_errors_integer_vector(key) - character(len = *), intent(in) :: key - - integer :: stat - integer, dimension(3) :: integer_vector_default, integer_vector_val - - call get_option(key, integer_vector_val, stat) - call report_test("[Rank error when extracting option data]", stat /= SPUD_RANK_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, integer_vector_val, stat, default = integer_vector_default) - call report_test("[Rank error when extracting option data with default argument]", stat /= SPUD_RANK_ERROR, .false., "Returned error code when retrieving option data") - - end subroutine test_rank_errors_integer_vector - - subroutine test_rank_errors_integer_tensor(key) - character(len = *), intent(in) :: key - - integer :: stat - integer, dimension(3, 4) :: integer_tensor_default, integer_tensor_val - - call get_option(key, integer_tensor_val, stat) - call report_test("[Rank error when extracting option data]", stat /= SPUD_RANK_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(key, integer_tensor_val, stat, default = integer_tensor_default) - call report_test("[Rank error when extracting option data with default argument]", stat /= SPUD_RANK_ERROR, .false., "Returned error code when retrieving option data") - - end subroutine test_rank_errors_integer_tensor - - subroutine test_add_new_option(key) - character(len = *), intent(in) :: key - - integer :: stat - - call add_option(key, stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when adding option") - - end subroutine test_add_new_option - - subroutine test_delete_option(key) - character(len = *), intent(in) :: key - - integer :: stat - - call delete_option(key, stat) - call report_test("[Deleted option]", stat /= SPUD_NO_ERROR, .false., "Returned error code when deleting option") - - call test_key_errors(key) - - end subroutine test_delete_option - - subroutine test_clear_options(key) - character(len = *), intent(in) :: key - - call test_key_errors(key) - call test_add_new_option(key) - call clear_options() - call test_key_errors(key) - - end subroutine test_clear_options - - subroutine test_set_and_get_real_scalar(key, test_real_scalar) - character(len = *), intent(in) :: key - real(D), intent(in) :: test_real_scalar - - integer :: i, stat - real(D) :: ltest_real_scalar, real_scalar_val - - call test_key_errors(key) - - do i = 1, 2 - select case(i) - case(1) - ltest_real_scalar = test_real_scalar - call set_option(key, ltest_real_scalar, stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - case default - ltest_real_scalar = ltest_real_scalar * 1.1_D - call set_option(key, ltest_real_scalar, stat) - call report_test("[Set existing option]", stat /= SPUD_NO_ERROR, .false., "Returned error code when setting option") - end select - - call test_key_present(key) - call test_type(key, SPUD_REAL) - call test_rank(key, 0) - call test_shape(key, (/-1, -1/) ) - - call get_option(key, real_scalar_val, stat) - call report_test("[Extracted option data]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data]", abs(real_scalar_val - ltest_real_scalar) > tol, .false., "Retrieved incorrect option data") - call get_option(key, real_scalar_val, stat, default = ltest_real_scalar * 1.1_D) - call report_test("[Extracted option data with default argument]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data with default argument]", abs(real_scalar_val - ltest_real_scalar) > tol, .false., "Retrieved incorrect option data") - - call test_rank_errors_real_vector(key) - call test_rank_errors_real_tensor(key) - call test_type_errors_integer(key) - call test_type_errors_character(key) - - call test_get_character(key // "/__value/rank", "0") - call test_key_errors(key // "/__value/shape") - - end do - - call test_delete_option(key) - - end subroutine test_set_and_get_real_scalar - - subroutine test_set_and_get_real_vector(key, test_real_vector) - character(len = *), intent(in) :: key - real(D), dimension(:), intent(in) :: test_real_vector - - integer :: i, stat - real(D), dimension(size(test_real_vector)) :: ltest_real_vector - real(D), dimension(:), allocatable :: real_vector_default, real_vector_val - - call test_key_errors(key) - - do i = 1, 2 - select case(i) - case(1) - ltest_real_vector = test_real_vector - call set_option(key, ltest_real_vector, stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - case default - ltest_real_vector = ltest_real_vector * 1.1_D - call set_option(key, ltest_real_vector, stat) - call report_test("[Set existing option]", stat /= SPUD_NO_ERROR, .false., "Returned error code when setting option") - end select - - call test_key_present(key) - call test_type(key, SPUD_REAL) - call test_rank(key, 1) - call test_shape(key, (/size(ltest_real_vector), -1/)) - - allocate(real_vector_val(size(ltest_real_vector))) - allocate(real_vector_default(size(ltest_real_vector))) - call get_option(key, real_vector_val, stat) - call report_test("[Extracted option data]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data]", maxval(abs(real_vector_val - ltest_real_vector)) > tol, .false., "Retrieved incorrect option data") - call get_option(key, real_vector_val, stat, default = ltest_real_vector * 1.1_D) - call report_test("[Extracted option data with default argument]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data with default argument]", maxval(abs(real_vector_val - ltest_real_vector)) > tol, .false., "Retrieved incorrect option data") - deallocate(real_vector_val) - deallocate(real_vector_default) - allocate(real_vector_val(size(ltest_real_vector) + 1)) - allocate(real_vector_default(size(ltest_real_vector) + 1)) - call get_option(key, real_vector_val, stat) - call report_test("[Shape error when extracting option data]", stat /= SPUD_SHAPE_ERROR, .false., "Returned error code when retrieving option data") - call get_option(key, real_vector_val, stat, default = real_vector_default) - call report_test("[Shape error when extracting option data with default argument]", stat /= SPUD_SHAPE_ERROR, .false., "Returned error code when retrieving option data") - deallocate(real_vector_val) - deallocate(real_vector_default) - - call test_rank_errors_real_scalar(key) - call test_rank_errors_real_tensor(key) - call test_type_errors_integer(key) - call test_type_errors_character(key) - - call test_get_character(key // "/__value/rank", "1") - call test_get_character(key // "/__value/shape", int2str(size(test_real_vector))) - - end do - - call test_delete_option(key) - - end subroutine test_set_and_get_real_vector - - subroutine test_set_and_get_real_tensor(key, test_real_tensor) - character(len = *), intent(in) :: key - real(D), dimension(:, :), intent(in) :: test_real_tensor - - integer :: i, stat - real(D), dimension(size(test_real_tensor, 1), size(test_real_tensor, 2)) :: ltest_real_tensor - real(D), dimension(:, :), allocatable :: real_tensor_default, real_tensor_val - - call test_key_errors(key) - - do i = 1, 2 - select case(i) - case(1) - ltest_real_tensor = test_real_tensor - call set_option(key, ltest_real_tensor, stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - case default - ltest_real_tensor = ltest_real_tensor * 1.1_D - call set_option(key, ltest_real_tensor, stat) - call report_test("[Set existing option]", stat /= SPUD_NO_ERROR, .false., "Returned error code when setting option") - end select - - call test_key_present(key) - call test_type(key, SPUD_REAL) - call test_rank(key, 2) - call test_shape(key, (/size(ltest_real_tensor, 1), size(ltest_real_tensor, 2)/)) - - allocate(real_tensor_val(size(ltest_real_tensor, 1), size(ltest_real_tensor, 2))) - allocate(real_tensor_default(size(ltest_real_tensor, 1), size(ltest_real_tensor, 2))) - call get_option(key, real_tensor_val, stat) - call report_test("[Extracted option data]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data]", maxval(abs(real_tensor_val - ltest_real_tensor)) > tol, .false., "Retrieved incorrect option data") - call get_option(key, real_tensor_val, stat, default = ltest_real_tensor * 1.1_D) - call report_test("[Extracted option data with default argument]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data with default argument]", maxval(abs(real_tensor_val - ltest_real_tensor)) > tol, .false., "Retrieved incorrect option data") - deallocate(real_tensor_val) - deallocate(real_tensor_default) - allocate(real_tensor_val(size(ltest_real_tensor, 1) + 1, size(ltest_real_tensor, 2) + 1)) - allocate(real_tensor_default(size(ltest_real_tensor, 1) + 1, size(ltest_real_tensor, 2) + 1)) - call get_option(key, real_tensor_val, stat) - call report_test("[Shape error when extracting option data]", stat /= SPUD_SHAPE_ERROR, .false., "Returned error code when retrieving option data") - call get_option(key, real_tensor_val, stat, default = real_tensor_default) - call report_test("[Shape error when extracting option data with default argument]", stat /= SPUD_SHAPE_ERROR, .false., "Returned error code when retrieving option data") - deallocate(real_tensor_val) - deallocate(real_tensor_default) - - call test_rank_errors_real_scalar(key) - call test_rank_errors_real_vector(key) - call test_type_errors_integer(key) - call test_type_errors_character(key) - - call test_get_character(key // "/__value/rank", "2") - call test_get_character(key // "/__value/shape", int2str(size(test_real_tensor, 2)) // " " // int2str(size(test_real_tensor, 1))) - - end do - - call test_delete_option(key) - - end subroutine test_set_and_get_real_tensor - - subroutine test_get_integer_scalar(key, test_integer_scalar) - character(len = *), intent(in) :: key - integer, intent(in) :: test_integer_scalar - - integer :: integer_scalar_val, stat - - call test_key_present(key) - call test_type(key, SPUD_INTEGER) - call test_rank(key, 0) - call test_shape(key, (/-1, -1/)) - - call get_option(key, integer_scalar_val, stat) - call report_test("[Extracted option data]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data]", integer_scalar_val /= test_integer_scalar, .false., "Retrieved incorrect option data") - call get_option(key, integer_scalar_val, stat, default = test_integer_scalar + 1) - call report_test("[Extracted option data with default argument]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data with default argument]", integer_scalar_val /= test_integer_scalar, .false., "Retrieved incorrect option data") - - call test_type_errors_real(key) - call test_rank_errors_integer_vector(key) - call test_rank_errors_integer_tensor(key) - call test_type_errors_character(key) - - end subroutine test_get_integer_scalar - - subroutine test_set_and_get_integer_scalar(key, test_integer_scalar) - character(len = *), intent(in) :: key - integer, intent(in) :: test_integer_scalar - - integer :: i, ltest_integer_scalar, stat - - call test_key_errors(key) - - do i = 1, 2 - select case(i) - case(1) - ltest_integer_scalar = test_integer_scalar - call set_option(key, ltest_integer_scalar, stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - case default - ltest_integer_scalar = ltest_integer_scalar + 1 - call set_option(key, ltest_integer_scalar, stat) - call report_test("[Set existing option]", stat /= SPUD_NO_ERROR, .false., "Returned error code when setting option") - end select - - call test_get_integer_scalar(key, ltest_integer_scalar) - call test_get_character(key // "/__value/rank", "0") - call test_key_errors(key // "/__value/shape") - - end do - - call test_delete_option(key) - - end subroutine test_set_and_get_integer_scalar - - subroutine test_set_and_get_integer_vector(key, test_integer_vector) - character(len = *), intent(in) :: key - integer, dimension(:), intent(in) :: test_integer_vector - - integer :: i, stat - integer, dimension(size(test_integer_vector)) :: ltest_integer_vector - integer, dimension(:), allocatable :: integer_vector_default, integer_vector_val - - call test_key_errors(key) - - do i = 1, 2 - select case(i) - case(1) - ltest_integer_vector = test_integer_vector - call set_option(key, ltest_integer_vector, stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - case default - ltest_integer_vector = ltest_integer_vector + 1 - call set_option(key, ltest_integer_vector, stat) - call report_test("[Set existing option]", stat /= SPUD_NO_ERROR, .false., "Returned error code when setting option") - end select - - call test_key_present(key) - call test_type(key, SPUD_INTEGER) - call test_rank(key, 1) - call test_shape(key, (/size(ltest_integer_vector), -1/)) - - allocate(integer_vector_val(size(ltest_integer_vector))) - allocate(integer_vector_default(size(ltest_integer_vector))) - call get_option(key, integer_vector_val, stat) - call report_test("[Extracted option data]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data]", count(integer_vector_val /= ltest_integer_vector) > 1, .false., "Retrieved incorrect option data") - call get_option(key, integer_vector_val, stat, default = ltest_integer_vector + 1) - call report_test("[Extracted option data with default argument]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data with default argument]", count(integer_vector_val /= ltest_integer_vector) > 1, .false., "Retrieved incorrect option data") - deallocate(integer_vector_val) - deallocate(integer_vector_default) - allocate(integer_vector_val(size(ltest_integer_vector) + 1)) - allocate(integer_vector_default(size(ltest_integer_vector) + 1)) - call get_option(key, integer_vector_val, stat) - call report_test("[Shape error when extracting option data]", stat /= SPUD_SHAPE_ERROR, .false., "Returned error code when retrieving option data") - call get_option(key, integer_vector_val, stat, default = integer_vector_default) - call report_test("[Shape error when extracting option data with default argument]", stat /= SPUD_SHAPE_ERROR, .false., "Returned error code when retrieving option data") - deallocate(integer_vector_val) - deallocate(integer_vector_default) - - call test_type_errors_real(key) - call test_rank_errors_integer_scalar(key) - call test_rank_errors_integer_tensor(key) - call test_type_errors_character(key) - - call test_get_character(key // "/__value/rank", "1") - call test_get_character(key // "/__value/shape", int2str(size(test_integer_vector))) - - end do - - call test_delete_option(key) - - end subroutine test_set_and_get_integer_vector - - subroutine test_set_and_get_integer_tensor(key, test_integer_tensor) - character(len = *), intent(in) :: key - integer, dimension(:, :), intent(in) :: test_integer_tensor - - integer :: i, stat - integer, dimension(size(test_integer_tensor, 1), size(test_integer_tensor, 2)) :: ltest_integer_tensor - integer, dimension(:, :), allocatable :: integer_tensor_default, integer_tensor_val - - call test_key_errors(key) - - do i = 1, 2 - select case(i) - case(1) - ltest_integer_tensor = test_integer_tensor - call set_option(key, ltest_integer_tensor, stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - case default - ltest_integer_tensor = ltest_integer_tensor + 1 - call set_option(key, ltest_integer_tensor, stat) - call report_test("[Set existing option]", stat /= SPUD_NO_ERROR, .false., "Returned error code when setting option") - end select - - call test_key_present(key) - call test_type(key, SPUD_INTEGER) - call test_rank(key, 2) - call test_shape(key, (/size(ltest_integer_tensor, 1), size(ltest_integer_tensor, 2)/)) - - allocate(integer_tensor_val(size(ltest_integer_tensor, 1), size(ltest_integer_tensor, 2))) - allocate(integer_tensor_default(size(ltest_integer_tensor, 1), size(ltest_integer_tensor, 2))) - call get_option(key, integer_tensor_val, stat) - call report_test("[Extracted option data]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data]", count(integer_tensor_val /= ltest_integer_tensor) > 0, .false., "Retrieved incorrect option data") - call get_option(key, integer_tensor_val, stat, default = ltest_integer_tensor + 1) - call report_test("[Extracted option data with default argument]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data with default argument]", count(integer_tensor_val /= ltest_integer_tensor) > 0, .false., "Retrieved incorrect option data") - deallocate(integer_tensor_val) - deallocate(integer_tensor_default) - allocate(integer_tensor_val(size(ltest_integer_tensor, 1) + 1, size(ltest_integer_tensor, 2) + 1)) - allocate(integer_tensor_default(size(ltest_integer_tensor, 1) + 1, size(ltest_integer_tensor, 2) + 1)) - call get_option(key, integer_tensor_val, stat) - call report_test("[Shape error when extracting option data]", stat /= SPUD_SHAPE_ERROR, .false., "Returned error code when retrieving option data") - call get_option(key, integer_tensor_val, stat, default = integer_tensor_default) - call report_test("[Shape error when extracting option data with default argument]", stat /= SPUD_SHAPE_ERROR, .false., "Returned error code when retrieving option data") - deallocate(integer_tensor_val) - deallocate(integer_tensor_default) - - call test_type_errors_real(key) - call test_rank_errors_integer_scalar(key) - call test_rank_errors_integer_vector(key) - call test_type_errors_character(key) - - call test_get_character(key // "/__value/rank", "2") - call test_get_character(key // "/__value/shape", int2str(size(test_integer_tensor, 2)) // " " // int2str(size(test_integer_tensor, 1))) - - end do - - call test_delete_option(key) - - end subroutine test_set_and_get_integer_tensor - - subroutine test_get_character(key, test_character) - character(len = *), intent(in) :: key - character(len = *), intent(in) :: test_character - - character(len = 0) :: short_character - character(len = len(test_character)) :: character_val - integer :: stat - - call test_key_present(key) - call test_type(key, SPUD_CHARACTER) - call test_rank(key, 1) - call test_shape(key, (/len_trim(test_character), -1/)) - - call get_option(key, character_val, stat) - call report_test("[Extracted option data]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data]", trim(character_val) /= trim(test_character), .false., "Retrieved incorrect option data") - call get_option(key, character_val, stat, default = trim(test_character) // " Plus One") - call report_test("[Extracted option data with default argument]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data with default argument]", trim(character_val) /= trim(test_character), .false., "Retrieved incorrect option data") - if(len_trim(test_character) > 0) then - call get_option(key, short_character, stat) - call report_test("[Shape error when extracting option data]", stat /= SPUD_SHAPE_ERROR, .false., "Returned error code when retrieving option data") - call get_option(key, short_character, stat, default = "") - call report_test("[Shape error when extracting option data with default argument]", stat /= SPUD_SHAPE_ERROR, .false., "Returned error code when retrieving option data") - else - write(0, *) "Warning: Zero length test character supplied - character shape test skipped" - end if - - call test_type_errors_real(key) - call test_type_errors_integer(key) - - end subroutine test_get_character - - subroutine test_set_and_get_character(key, test_character) - character(len = *), intent(in) :: key - character(len = *), intent(in) :: test_character - - character(len = len_trim(test_character) + len(" Plus One")) :: ltest_character - integer :: i, stat - - call test_key_errors(key) - - do i = 1, 2 - select case(i) - case(1) - ltest_character = trim(test_character) - call set_option(key, ltest_character, stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - case default - ltest_character = trim(ltest_character) // " Plus One" - call set_option(key, ltest_character, stat) - call report_test("[Set existing option]", stat /= SPUD_NO_ERROR, .false., "Returned error code when setting option") - end select - - call test_get_character(key, ltest_character) - call test_key_errors(key // "/__value/rank") - call test_key_errors(key // "/__value/shape") - - end do - - call test_delete_option(key) - - end subroutine test_set_and_get_character - - subroutine test_set_and_get_type_none(key) - character(len = *), intent(in) :: key - - integer :: i, stat - - call test_key_errors(key) - - do i = 1, 2 - select case(i) - case(1) - call test_add_new_option(key) - case default - call add_option(key, stat) - call report_test("[Add existing option]", stat /= SPUD_NO_ERROR, .false., "Returned error code when adding option") - end select - - call test_key_present(key) - call test_type(key, SPUD_NONE) - call test_rank(key, -1) - call test_shape(key, (/-1, -1/)) - - call test_type_errors_real(key) - call test_type_errors_integer(key) - call test_type_errors_character(key) - - call test_key_errors(key // "/__value/rank") - call test_key_errors(key // "/__value/shape") - - end do - - call test_delete_option(key) - - end subroutine test_set_and_get_type_none - - subroutine test_named_key(key, name, test_integer) - character(len = *), intent(in) :: key - character(len = *), intent(in) :: name - integer, intent(in) :: test_integer - - character(len = len_trim(name)) :: name_val - integer :: integer_val, stat - - call set_option(trim(key) // "::" // name, test_integer, stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - call test_key_present(key) - call report_test("[Add option name]", .not. have_option(key // "::" // name), .false., "Failed to add option name when adding option") - - call get_option(trim(key) // "::" // name, integer_val, stat) - call report_test("[Extracted option data]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data]", integer_val /= test_integer, .false., "Retrieved incorrect option data") - call get_option(trim(key) // "::" // trim(name) // "/name", name_val, stat) - call report_test("[Extracted option data]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data]", trim(name_val) /= trim(name), .false., "Retrieved incorrect option data") - - call get_option(trim(key) // "[0]", integer_val, stat) - call report_test("[Extracted option data]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data]", integer_val /= test_integer, .false., "Retrieved incorrect option data") - call get_option(trim(key) // "[0]" // "/name", name_val, stat) - call report_test("[Extracted option data]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data]", trim(name_val) /= trim(name), .false., "Retrieved incorrect option data") - - call get_option(trim(key) // "[0]trailingtext", integer_val, stat) - call report_test("[Key error when extracting option data]", stat /= SPUD_KEY_ERROR, .false., "Returned incorrect error code when retrieving option data") - call get_option(trim(key) // "[1]", integer_val, stat) - call report_test("[Key error when extracting option data]", stat /= SPUD_KEY_ERROR, .false., "Returned incorrect error code when retrieving option data") - - call test_delete_option(key) - - end subroutine test_named_key - - subroutine test_indexed_key(key, test_integer) - character(len = *), intent(in) :: key - integer, intent(in) :: test_integer - - integer :: integer_val, stat - - call set_option(trim(key) // "[0]", test_integer, stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - call test_key_present(key) - - call set_option(trim(key) // "[1]", test_integer + 1, stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - call test_key_present(key) - - call get_option(trim(key) // "[0]", integer_val, stat) - call report_test("[Extracted option data]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data]", integer_val /= test_integer, .false., "Retrieved incorrect option data") - - call get_option(trim(key) // "[1]", integer_val, stat) - call report_test("[Extracted option data]", stat /= SPUD_NO_ERROR, .false., "Returned error code when retrieving option data") - call report_test("[Extracted correct option data]", integer_val /= test_integer + 1, .false., "Retrieved incorrect option data") - - call test_delete_option(trim(key) // "[1]") - call test_delete_option(trim(key) // "[0]") - - end subroutine test_indexed_key - - subroutine test_move_option(key1, key2) - character(len = *), intent(in) :: key1 - character(len = *), intent(in) :: key2 - - integer :: stat - - call add_option(trim(key1), stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - call test_key_present(key1) - - call move_option(trim(key1), trim(key2)) - call test_key_errors(key1) - call test_key_present(key2) - - call test_delete_option(key2) - - call add_option(trim(key1) // "::name", stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - call test_key_present(key1) - call test_key_present(key1 // "::name") - - call move_option(trim(key1) // "::name", trim(key2) // "::name") - call test_key_errors(key1) - call test_key_errors(key1 // "::name") - call test_key_present(key2) - call test_key_present(key2 // "::name") - - call test_delete_option(key2) - - call add_option(trim(key1) // trim(key1), stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - call test_key_present(key1) - call test_key_present(trim(key1) // key1) - - call move_option(trim(key1) // trim(key1), trim(key2) // trim(key2)) - call test_key_present(key1) - call test_key_errors(trim(key1) // key1) - call test_key_present(key2) - call test_key_present(trim(key2) // key2) - - call test_delete_option(key1) - call test_delete_option(key2) - - end subroutine test_move_option - - subroutine test_copy_option(key1, key2) - character(len = *), intent(in) :: key1 - character(len = *), intent(in) :: key2 - - integer :: stat - - call add_option(trim(key1), stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - call test_key_present(key1) - - call copy_option(trim(key1), trim(key2)) - call test_key_present(key1) - call test_key_present(key2) - - call test_delete_option(key2) - call test_delete_option(key1) - - call add_option(trim(key1) // "::name", stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - call test_key_present(key1) - call test_key_present(key1 // "::name") - - call copy_option(trim(key1) // "::name", trim(key2) // "::name") - call test_key_present(key2) - call test_key_present(key2 // "::name") - call test_key_present(key1) - call test_key_present(key1 // "::name") - - call test_delete_option(key2) - call test_delete_option(key1) - - call add_option(trim(key1) // trim(key1), stat) - call report_test("[New option]", stat /= SPUD_NEW_KEY_WARNING, .false., "Failed to return new key warning when setting option") - call test_key_present(key1) - call test_key_present(trim(key1) // key1) - - call copy_option(trim(key1) // trim(key1), trim(key2) // trim(key2)) - call test_key_present(key1) - call test_key_present(trim(key1) // key1) - call test_key_present(key2) - call test_key_present(trim(key2) // key2) - - call test_delete_option(key1) - call test_delete_option(key2) - - end subroutine test_copy_option - -end subroutine test_fspud diff --git a/libspud/src/tests/test_main.cpp b/libspud/src/tests/test_main.cpp deleted file mode 100644 index 4e1b544a18..0000000000 --- a/libspud/src/tests/test_main.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (C) 2006 Imperial College London and others. - - Please see the AUTHORS file in the main source directory for a full list - of copyright holders. - - Applied Modelling and Computation Group - Department of Earth Science and Engineering - Imperial College London - - David.Ham@Imperial.ac.uk - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, - version 2.1 of the License. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - USA -*/ - -#include -#include - -#ifdef HAVE_MPI -#include -#endif - -extern "C"{ - void TESTNAME(); -} - -int main(int argc, char **argv) { -#ifdef HAVE_MPI - MPI_Init(&argc, &argv); - chdir(getenv("PWD")); -#endif - TESTNAME(); -#ifdef HAVE_MPI - MPI_Finalize(); -#endif - - return 0; -} diff --git a/libspud/src/tests/unittest_tools.f90 b/libspud/src/tests/unittest_tools.f90 deleted file mode 100644 index d76764ae91..0000000000 --- a/libspud/src/tests/unittest_tools.f90 +++ /dev/null @@ -1,88 +0,0 @@ -! Copyright (C) 2007 Imperial College London and others. -! -! Please see the AUTHORS file in the main source directory for a full list -! of copyright holders. -! -! Applied Modelling and Computation Group -! Department of Earth Science and Engineering -! Imperial College London -! -! David.Ham@Imperial.ac.uk -! -! This library is free software; you can redistribute it and/or -! modify it under the terms of the GNU Lesser General Public -! License as published by the Free Software Foundation, -! version 2.1 of the License. -! -! This library is distributed in the hope that it will be useful, -! but WITHOUT ANY WARRANTY; without even the implied warranty of -! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -! Lesser General Public License for more details. -! -! You should have received a copy of the GNU Lesser General Public -! License along with this library; if not, write to the Free Software -! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -! USA - -module unittest_tools - !!< This module contains utility functions for the libspud unit testing framework. - - implicit none - - private - - public :: report_test, int2str_len, int2str - -contains - - subroutine report_test(title, fail, warn, msg) - !!< This is the subroutine used by unit tests to report the output of - !!< a test case. - - !! Title: the name of the test case. - character(len = *), intent(in) :: title - !! Msg: an explanatory message printed if the test case fails. - character(len = *), intent(in) :: msg - !! Has the test case failed, or triggered a warning? Set fail or warn to .true. if so. - logical, intent(in) :: fail, warn - - if(fail) then - print "('Fail: ',a,'; error: ',a)", title, msg - else if(warn) then - print "('Warn: ',a,'; error: ',a)", title, msg - else - print "('Pass: ',a)", title - end if - - end subroutine report_test - - pure function int2str_len(i) - - !!< Count number of digits in i. - - integer, intent(in) :: i - integer :: int2str_len - - if(i==0) then - int2str_len=1 - else if (i>0) then - int2str_len = floor(log10(real(i)))+1 - else - int2str_len = floor(log10(abs(real(i))))+2 - end if - - end function int2str_len - - function int2str (i) - - !!< Convert integer i into a string. - !!< This should only be used when forming option strings. - - integer, intent(in) :: i - character(len=int2str_len(i)) :: int2str - - write(int2str,"(i0)") i - - end function int2str - -end module unittest_tools diff --git a/libspud/src/tinystr.cpp b/libspud/src/tinystr.cpp deleted file mode 100644 index 681250714b..0000000000 --- a/libspud/src/tinystr.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* -www.sourceforge.net/projects/tinyxml -Original file by Yves Berquin. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -/* - * THIS FILE WAS ALTERED BY Tyge Løvset, 7. April 2005. - */ - - -#ifndef TIXML_USE_STL - -#include "tinystr.h" - -// Error value for find primitive -const TiXmlString::size_type TiXmlString::npos = static_cast< TiXmlString::size_type >(-1); - - -// Null rep. -TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, { '\0' } }; - - -void TiXmlString::reserve (size_type cap) -{ - if (cap > capacity()) - { - TiXmlString tmp; - tmp.init(length(), cap); - memcpy(tmp.start(), data(), length()); - swap(tmp); - } -} - - -TiXmlString& TiXmlString::assign(const char* str, size_type len) -{ - size_type cap = capacity(); - if (len > cap || cap > 3*(len + 8)) - { - TiXmlString tmp; - tmp.init(len); - memcpy(tmp.start(), str, len); - swap(tmp); - } - else - { - memmove(start(), str, len); - set_size(len); - } - return *this; -} - - -TiXmlString& TiXmlString::append(const char* str, size_type len) -{ - size_type newsize = length() + len; - if (newsize > capacity()) - { - reserve (newsize + capacity()); - } - memmove(finish(), str, len); - set_size(newsize); - return *this; -} - - -TiXmlString operator + (const TiXmlString & a, const TiXmlString & b) -{ - TiXmlString tmp; - tmp.reserve(a.length() + b.length()); - tmp += a; - tmp += b; - return tmp; -} - -TiXmlString operator + (const TiXmlString & a, const char* b) -{ - TiXmlString tmp; - TiXmlString::size_type b_len = static_cast( strlen(b) ); - tmp.reserve(a.length() + b_len); - tmp += a; - tmp.append(b, b_len); - return tmp; -} - -TiXmlString operator + (const char* a, const TiXmlString & b) -{ - TiXmlString tmp; - TiXmlString::size_type a_len = static_cast( strlen(a) ); - tmp.reserve(a_len + b.length()); - tmp.append(a, a_len); - tmp += b; - return tmp; -} - - -#endif // TIXML_USE_STL diff --git a/libspud/src/tinyxml.cpp b/libspud/src/tinyxml.cpp deleted file mode 100644 index 5de21f6dec..0000000000 --- a/libspud/src/tinyxml.cpp +++ /dev/null @@ -1,1888 +0,0 @@ -/* -www.sourceforge.net/projects/tinyxml -Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -#include - -#ifdef TIXML_USE_STL -#include -#include -#endif - -#include "tinyxml.h" - - -bool TiXmlBase::condenseWhiteSpace = true; - -// Microsoft compiler security -FILE* TiXmlFOpen( const char* filename, const char* mode ) -{ - #if defined(_MSC_VER) && (_MSC_VER >= 1400 ) - FILE* fp = 0; - errno_t err = fopen_s( &fp, filename, mode ); - if ( !err && fp ) - return fp; - return 0; - #else - return fopen( filename, mode ); - #endif -} - -void TiXmlBase::EncodeString( const TIXML_STRING& str, TIXML_STRING* outString ) -{ - int i=0; - - while( i<(int)str.length() ) - { - unsigned char c = (unsigned char) str[i]; - - if ( c == '&' - && i < ( (int)str.length() - 2 ) - && str[i+1] == '#' - && str[i+2] == 'x' ) - { - // Hexadecimal character reference. - // Pass through unchanged. - // © -- copyright symbol, for example. - // - // The -1 is a bug fix from Rob Laveaux. It keeps - // an overflow from happening if there is no ';'. - // There are actually 2 ways to exit this loop - - // while fails (error case) and break (semicolon found). - // However, there is no mechanism (currently) for - // this function to return an error. - while ( i<(int)str.length()-1 ) - { - outString->append( str.c_str() + i, 1 ); - ++i; - if ( str[i] == ';' ) - break; - } - } - else if ( c == '&' ) - { - outString->append( entity[0].str, entity[0].strLength ); - ++i; - } - else if ( c == '<' ) - { - outString->append( entity[1].str, entity[1].strLength ); - ++i; - } - else if ( c == '>' ) - { - outString->append( entity[2].str, entity[2].strLength ); - ++i; - } - else if ( c == '\"' ) - { - outString->append( entity[3].str, entity[3].strLength ); - ++i; - } - else if ( c == '\'' ) - { - outString->append( entity[4].str, entity[4].strLength ); - ++i; - } - else if ( c < 32 ) - { - // Easy pass at non-alpha/numeric/symbol - // Below 32 is symbolic. - char buf[ 32 ]; - - #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF( buf, sizeof(buf), "&#x%02X;", (unsigned) ( c & 0xff ) ); - #else - sprintf( buf, "&#x%02X;", (unsigned) ( c & 0xff ) ); - #endif - - //*ME: warning C4267: convert 'size_t' to 'int' - //*ME: Int-Cast to make compiler happy ... - outString->append( buf, (int)strlen( buf ) ); - ++i; - } - else - { - //char realc = (char) c; - //outString->append( &realc, 1 ); - *outString += (char) c; // somewhat more efficient function call. - ++i; - } - } -} - - -TiXmlNode::TiXmlNode( NodeType _type ) : TiXmlBase() -{ - parent = 0; - type = _type; - firstChild = 0; - lastChild = 0; - prev = 0; - next = 0; -} - - -TiXmlNode::~TiXmlNode() -{ - TiXmlNode* node = firstChild; - TiXmlNode* temp = 0; - - while ( node ) - { - temp = node; - node = node->next; - delete temp; - } -} - - -void TiXmlNode::CopyTo( TiXmlNode* target ) const -{ - target->SetValue (value.c_str() ); - target->userData = userData; -} - - -void TiXmlNode::Clear() -{ - TiXmlNode* node = firstChild; - TiXmlNode* temp = 0; - - while ( node ) - { - temp = node; - node = node->next; - delete temp; - } - - firstChild = 0; - lastChild = 0; -} - - -TiXmlNode* TiXmlNode::LinkEndChild( TiXmlNode* node ) -{ - assert( node->parent == 0 || node->parent == this ); - assert( node->GetDocument() == 0 || node->GetDocument() == this->GetDocument() ); - - if ( node->Type() == TiXmlNode::DOCUMENT ) - { - delete node; - if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - node->parent = this; - - node->prev = lastChild; - node->next = 0; - - if ( lastChild ) - lastChild->next = node; - else - firstChild = node; // it was an empty list. - - lastChild = node; - return node; -} - - -TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis ) -{ - if ( addThis.Type() == TiXmlNode::DOCUMENT ) - { - if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - TiXmlNode* node = addThis.Clone(); - if ( !node ) - return 0; - - return LinkEndChild( node ); -} - - -TiXmlNode* TiXmlNode::InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ) -{ - if ( !beforeThis || beforeThis->parent != this ) { - return 0; - } - if ( addThis.Type() == TiXmlNode::DOCUMENT ) - { - if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - TiXmlNode* node = addThis.Clone(); - if ( !node ) - return 0; - node->parent = this; - - node->next = beforeThis; - node->prev = beforeThis->prev; - if ( beforeThis->prev ) - { - beforeThis->prev->next = node; - } - else - { - assert( firstChild == beforeThis ); - firstChild = node; - } - beforeThis->prev = node; - return node; -} - - -TiXmlNode* TiXmlNode::InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ) -{ - if ( !afterThis || afterThis->parent != this ) { - return 0; - } - if ( addThis.Type() == TiXmlNode::DOCUMENT ) - { - if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - TiXmlNode* node = addThis.Clone(); - if ( !node ) - return 0; - node->parent = this; - - node->prev = afterThis; - node->next = afterThis->next; - if ( afterThis->next ) - { - afterThis->next->prev = node; - } - else - { - assert( lastChild == afterThis ); - lastChild = node; - } - afterThis->next = node; - return node; -} - - -TiXmlNode* TiXmlNode::ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ) -{ - if ( replaceThis->parent != this ) - return 0; - - TiXmlNode* node = withThis.Clone(); - if ( !node ) - return 0; - - node->next = replaceThis->next; - node->prev = replaceThis->prev; - - if ( replaceThis->next ) - replaceThis->next->prev = node; - else - lastChild = node; - - if ( replaceThis->prev ) - replaceThis->prev->next = node; - else - firstChild = node; - - delete replaceThis; - node->parent = this; - return node; -} - - -bool TiXmlNode::RemoveChild( TiXmlNode* removeThis ) -{ - if ( removeThis->parent != this ) - { - assert( 0 ); - return false; - } - - if ( removeThis->next ) - removeThis->next->prev = removeThis->prev; - else - lastChild = removeThis->prev; - - if ( removeThis->prev ) - removeThis->prev->next = removeThis->next; - else - firstChild = removeThis->next; - - delete removeThis; - return true; -} - -const TiXmlNode* TiXmlNode::FirstChild( const char * _value ) const -{ - const TiXmlNode* node; - for ( node = firstChild; node; node = node->next ) - { - if ( strcmp( node->Value(), _value ) == 0 ) - return node; - } - return 0; -} - - -const TiXmlNode* TiXmlNode::LastChild( const char * _value ) const -{ - const TiXmlNode* node; - for ( node = lastChild; node; node = node->prev ) - { - if ( strcmp( node->Value(), _value ) == 0 ) - return node; - } - return 0; -} - - -const TiXmlNode* TiXmlNode::IterateChildren( const TiXmlNode* previous ) const -{ - if ( !previous ) - { - return FirstChild(); - } - else - { - assert( previous->parent == this ); - return previous->NextSibling(); - } -} - - -const TiXmlNode* TiXmlNode::IterateChildren( const char * val, const TiXmlNode* previous ) const -{ - if ( !previous ) - { - return FirstChild( val ); - } - else - { - assert( previous->parent == this ); - return previous->NextSibling( val ); - } -} - - -const TiXmlNode* TiXmlNode::NextSibling( const char * _value ) const -{ - const TiXmlNode* node; - for ( node = next; node; node = node->next ) - { - if ( strcmp( node->Value(), _value ) == 0 ) - return node; - } - return 0; -} - - -const TiXmlNode* TiXmlNode::PreviousSibling( const char * _value ) const -{ - const TiXmlNode* node; - for ( node = prev; node; node = node->prev ) - { - if ( strcmp( node->Value(), _value ) == 0 ) - return node; - } - return 0; -} - - -void TiXmlElement::RemoveAttribute( const char * name ) -{ - #ifdef TIXML_USE_STL - TIXML_STRING str( name ); - TiXmlAttribute* node = attributeSet.Find( str ); - #else - TiXmlAttribute* node = attributeSet.Find( name ); - #endif - if ( node ) - { - attributeSet.Remove( node ); - delete node; - } -} - -const TiXmlElement* TiXmlNode::FirstChildElement() const -{ - const TiXmlNode* node; - - for ( node = FirstChild(); - node; - node = node->NextSibling() ) - { - if ( node->ToElement() ) - return node->ToElement(); - } - return 0; -} - - -const TiXmlElement* TiXmlNode::FirstChildElement( const char * _value ) const -{ - const TiXmlNode* node; - - for ( node = FirstChild( _value ); - node; - node = node->NextSibling( _value ) ) - { - if ( node->ToElement() ) - return node->ToElement(); - } - return 0; -} - - -const TiXmlElement* TiXmlNode::NextSiblingElement() const -{ - const TiXmlNode* node; - - for ( node = NextSibling(); - node; - node = node->NextSibling() ) - { - if ( node->ToElement() ) - return node->ToElement(); - } - return 0; -} - - -const TiXmlElement* TiXmlNode::NextSiblingElement( const char * _value ) const -{ - const TiXmlNode* node; - - for ( node = NextSibling( _value ); - node; - node = node->NextSibling( _value ) ) - { - if ( node->ToElement() ) - return node->ToElement(); - } - return 0; -} - - -const TiXmlDocument* TiXmlNode::GetDocument() const -{ - const TiXmlNode* node; - - for( node = this; node; node = node->parent ) - { - if ( node->ToDocument() ) - return node->ToDocument(); - } - return 0; -} - - -TiXmlElement::TiXmlElement (const char * _value) - : TiXmlNode( TiXmlNode::ELEMENT ) -{ - firstChild = lastChild = 0; - value = _value; -} - - -#ifdef TIXML_USE_STL -TiXmlElement::TiXmlElement( const std::string& _value ) - : TiXmlNode( TiXmlNode::ELEMENT ) -{ - firstChild = lastChild = 0; - value = _value; -} -#endif - - -TiXmlElement::TiXmlElement( const TiXmlElement& copy) - : TiXmlNode( TiXmlNode::ELEMENT ) -{ - firstChild = lastChild = 0; - copy.CopyTo( this ); -} - - -void TiXmlElement::operator=( const TiXmlElement& base ) -{ - ClearThis(); - base.CopyTo( this ); -} - - -TiXmlElement::~TiXmlElement() -{ - ClearThis(); -} - - -void TiXmlElement::ClearThis() -{ - Clear(); - while( attributeSet.First() ) - { - TiXmlAttribute* node = attributeSet.First(); - attributeSet.Remove( node ); - delete node; - } -} - - -const char* TiXmlElement::Attribute( const char* name ) const -{ - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( node ) - return node->Value(); - return 0; -} - - -#ifdef TIXML_USE_STL -const std::string* TiXmlElement::Attribute( const std::string& name ) const -{ - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( node ) - return &node->ValueStr(); - return 0; -} -#endif - - -const char* TiXmlElement::Attribute( const char* name, int* i ) const -{ - const char* s = Attribute( name ); - if ( i ) - { - if ( s ) { - *i = atoi( s ); - } - else { - *i = 0; - } - } - return s; -} - - -#ifdef TIXML_USE_STL -const std::string* TiXmlElement::Attribute( const std::string& name, int* i ) const -{ - const std::string* s = Attribute( name ); - if ( i ) - { - if ( s ) { - *i = atoi( s->c_str() ); - } - else { - *i = 0; - } - } - return s; -} -#endif - - -const char* TiXmlElement::Attribute( const char* name, double* d ) const -{ - const char* s = Attribute( name ); - if ( d ) - { - if ( s ) { - *d = atof( s ); - } - else { - *d = 0; - } - } - return s; -} - - -#ifdef TIXML_USE_STL -const std::string* TiXmlElement::Attribute( const std::string& name, double* d ) const -{ - const std::string* s = Attribute( name ); - if ( d ) - { - if ( s ) { - *d = atof( s->c_str() ); - } - else { - *d = 0; - } - } - return s; -} -#endif - - -int TiXmlElement::QueryIntAttribute( const char* name, int* ival ) const -{ - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( !node ) - return TIXML_NO_ATTRIBUTE; - return node->QueryIntValue( ival ); -} - - -#ifdef TIXML_USE_STL -int TiXmlElement::QueryIntAttribute( const std::string& name, int* ival ) const -{ - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( !node ) - return TIXML_NO_ATTRIBUTE; - return node->QueryIntValue( ival ); -} -#endif - - -int TiXmlElement::QueryDoubleAttribute( const char* name, double* dval ) const -{ - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( !node ) - return TIXML_NO_ATTRIBUTE; - return node->QueryDoubleValue( dval ); -} - - -#ifdef TIXML_USE_STL -int TiXmlElement::QueryDoubleAttribute( const std::string& name, double* dval ) const -{ - const TiXmlAttribute* node = attributeSet.Find( name ); - if ( !node ) - return TIXML_NO_ATTRIBUTE; - return node->QueryDoubleValue( dval ); -} -#endif - - -void TiXmlElement::SetAttribute( const char * name, int val ) -{ - char buf[64]; - #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF( buf, sizeof(buf), "%d", val ); - #else - sprintf( buf, "%d", val ); - #endif - SetAttribute( name, buf ); -} - - -#ifdef TIXML_USE_STL -void TiXmlElement::SetAttribute( const std::string& name, int val ) -{ - std::ostringstream oss; - oss << val; - SetAttribute( name, oss.str() ); -} -#endif - - -void TiXmlElement::SetDoubleAttribute( const char * name, double val ) -{ - char buf[256]; - #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF( buf, sizeof(buf), "%f", val ); - #else - sprintf( buf, "%f", val ); - #endif - SetAttribute( name, buf ); -} - - -void TiXmlElement::SetAttribute( const char * cname, const char * cvalue ) -{ - #ifdef TIXML_USE_STL - TIXML_STRING _name( cname ); - TIXML_STRING _value( cvalue ); - #else - const char* _name = cname; - const char* _value = cvalue; - #endif - - TiXmlAttribute* node = attributeSet.Find( _name ); - if ( node ) - { - node->SetValue( _value ); - return; - } - - TiXmlAttribute* attrib = new TiXmlAttribute( cname, cvalue ); - if ( attrib ) - { - attributeSet.Add( attrib ); - } - else - { - TiXmlDocument* document = GetDocument(); - if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN ); - } -} - - -#ifdef TIXML_USE_STL -void TiXmlElement::SetAttribute( const std::string& name, const std::string& _value ) -{ - TiXmlAttribute* node = attributeSet.Find( name ); - if ( node ) - { - node->SetValue( _value ); - return; - } - - TiXmlAttribute* attrib = new TiXmlAttribute( name, _value ); - if ( attrib ) - { - attributeSet.Add( attrib ); - } - else - { - TiXmlDocument* document = GetDocument(); - if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN ); - } -} -#endif - - -void TiXmlElement::Print( FILE* cfile, int depth ) const -{ - int i; - assert( cfile ); - for ( i=0; iNext() ) - { - fprintf( cfile, " " ); - attrib->Print( cfile, depth ); - } - - // There are 3 different formatting approaches: - // 1) An element without children is printed as a node - // 2) An element with only a text child is printed as text - // 3) An element with children is printed on multiple lines. - TiXmlNode* node; - if ( !firstChild ) - { - fprintf( cfile, " />" ); - } - else if ( firstChild == lastChild && firstChild->ToText() ) - { - fprintf( cfile, ">" ); - firstChild->Print( cfile, depth + 1 ); - fprintf( cfile, "", value.c_str() ); - } - else - { - fprintf( cfile, ">" ); - - for ( node = firstChild; node; node=node->NextSibling() ) - { - if ( !node->ToText() ) - { - fprintf( cfile, "\n" ); - } - node->Print( cfile, depth+1 ); - } - fprintf( cfile, "\n" ); - for( i=0; i", value.c_str() ); - } -} - - -void TiXmlElement::CopyTo( TiXmlElement* target ) const -{ - // superclass: - TiXmlNode::CopyTo( target ); - - // Element class: - // Clone the attributes, then clone the children. - const TiXmlAttribute* attribute = 0; - for( attribute = attributeSet.First(); - attribute; - attribute = attribute->Next() ) - { - target->SetAttribute( attribute->Name(), attribute->Value() ); - } - - TiXmlNode* node = 0; - for ( node = firstChild; node; node = node->NextSibling() ) - { - target->LinkEndChild( node->Clone() ); - } -} - -bool TiXmlElement::Accept( TiXmlVisitor* visitor ) const -{ - if ( visitor->VisitEnter( *this, attributeSet.First() ) ) - { - for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) - { - if ( !node->Accept( visitor ) ) - break; - } - } - return visitor->VisitExit( *this ); -} - - -TiXmlNode* TiXmlElement::Clone() const -{ - TiXmlElement* clone = new TiXmlElement( Value() ); - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; -} - - -const char* TiXmlElement::GetText() const -{ - const TiXmlNode* child = this->FirstChild(); - if ( child ) { - const TiXmlText* childText = child->ToText(); - if ( childText ) { - return childText->Value(); - } - } - return 0; -} - - -TiXmlDocument::TiXmlDocument() : TiXmlNode( TiXmlNode::DOCUMENT ) -{ - tabsize = 4; - useMicrosoftBOM = false; - ClearError(); -} - -TiXmlDocument::TiXmlDocument( const char * documentName ) : TiXmlNode( TiXmlNode::DOCUMENT ) -{ - tabsize = 4; - useMicrosoftBOM = false; - value = documentName; - ClearError(); -} - - -#ifdef TIXML_USE_STL -TiXmlDocument::TiXmlDocument( const std::string& documentName ) : TiXmlNode( TiXmlNode::DOCUMENT ) -{ - tabsize = 4; - useMicrosoftBOM = false; - value = documentName; - ClearError(); -} -#endif - - -TiXmlDocument::TiXmlDocument( const TiXmlDocument& copy ) : TiXmlNode( TiXmlNode::DOCUMENT ) -{ - copy.CopyTo( this ); -} - - -void TiXmlDocument::operator=( const TiXmlDocument& copy ) -{ - Clear(); - copy.CopyTo( this ); -} - - -bool TiXmlDocument::LoadFile( TiXmlEncoding encoding ) -{ - // See STL_STRING_BUG below. - //StringToBuffer buf( value ); - - return LoadFile( Value(), encoding ); -} - - -bool TiXmlDocument::SaveFile() const -{ - // See STL_STRING_BUG below. -// StringToBuffer buf( value ); -// -// if ( buf.buffer && SaveFile( buf.buffer ) ) -// return true; -// -// return false; - return SaveFile( Value() ); -} - -bool TiXmlDocument::LoadFile( const char* _filename, TiXmlEncoding encoding ) -{ - // There was a really terrifying little bug here. The code: - // value = filename - // in the STL case, cause the assignment method of the std::string to - // be called. What is strange, is that the std::string had the same - // address as it's c_str() method, and so bad things happen. Looks - // like a bug in the Microsoft STL implementation. - // Add an extra string to avoid the crash. - TIXML_STRING filename( _filename ); - value = filename; - - // reading in binary mode so that tinyxml can normalize the EOL - FILE* file = TiXmlFOpen( value.c_str (), "rb" ); - - if ( file ) - { - bool result = LoadFile( file, encoding ); - fclose( file ); - return result; - } - else - { - SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); - return false; - } -} - -bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding ) -{ - if ( !file ) - { - SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); - return false; - } - - // Delete the existing data: - Clear(); - location.Clear(); - - // Get the file size, so we can pre-allocate the string. HUGE speed impact. - long length = 0; - fseek( file, 0, SEEK_END ); - length = ftell( file ); - fseek( file, 0, SEEK_SET ); - - // Strange case, but good to handle up front. - if ( length <= 0 ) - { - SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return false; - } - - // If we have a file, assume it is all one big XML file, and read it in. - // The document parser may decide the document ends sooner than the entire file, however. - TIXML_STRING data; - data.reserve( length ); - - // Subtle bug here. TinyXml did use fgets. But from the XML spec: - // 2.11 End-of-Line Handling - // - // - // ...the XML processor MUST behave as if it normalized all line breaks in external - // parsed entities (including the document entity) on input, before parsing, by translating - // both the two-character sequence #xD #xA and any #xD that is not followed by #xA to - // a single #xA character. - // - // - // It is not clear fgets does that, and certainly isn't clear it works cross platform. - // Generally, you expect fgets to translate from the convention of the OS to the c/unix - // convention, and not work generally. - - /* - while( fgets( buf, sizeof(buf), file ) ) - { - data += buf; - } - */ - - char* buf = new char[ length+1 ]; - buf[0] = 0; - - if ( fread( buf, length, 1, file ) != 1 ) { - delete [] buf; - SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); - return false; - } - - const char* lastPos = buf; - const char* p = buf; - - buf[length] = 0; - while( *p ) { - assert( p < (buf+length) ); - if ( *p == 0xa ) { - // Newline character. No special rules for this. Append all the characters - // since the last string, and include the newline. - data.append( lastPos, (p-lastPos+1) ); // append, include the newline - ++p; // move past the newline - lastPos = p; // and point to the new buffer (may be 0) - assert( p <= (buf+length) ); - } - else if ( *p == 0xd ) { - // Carriage return. Append what we have so far, then - // handle moving forward in the buffer. - if ( (p-lastPos) > 0 ) { - data.append( lastPos, p-lastPos ); // do not add the CR - } - data += (char)0xa; // a proper newline - - if ( *(p+1) == 0xa ) { - // Carriage return - new line sequence - p += 2; - lastPos = p; - assert( p <= (buf+length) ); - } - else { - // it was followed by something else...that is presumably characters again. - ++p; - lastPos = p; - assert( p <= (buf+length) ); - } - } - else { - ++p; - } - } - // Handle any left over characters. - if ( p-lastPos ) { - data.append( lastPos, p-lastPos ); - } - delete [] buf; - buf = 0; - - Parse( data.c_str(), 0, encoding ); - - if ( Error() ) - return false; - else - return true; -} - - -bool TiXmlDocument::SaveFile( const char * filename ) const -{ - // The old c stuff lives on... - FILE* fp = TiXmlFOpen( filename, "w" ); - if ( fp ) - { - bool result = SaveFile( fp ); - fclose( fp ); - return result; - } - return false; -} - - -bool TiXmlDocument::SaveFile( FILE* fp ) const -{ - if ( useMicrosoftBOM ) - { - const unsigned char TIXML_UTF_LEAD_0 = 0xefU; - const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; - const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; - - fputc( TIXML_UTF_LEAD_0, fp ); - fputc( TIXML_UTF_LEAD_1, fp ); - fputc( TIXML_UTF_LEAD_2, fp ); - } - Print( fp, 0 ); - return (ferror(fp) == 0); -} - - -void TiXmlDocument::CopyTo( TiXmlDocument* target ) const -{ - TiXmlNode::CopyTo( target ); - - target->error = error; - target->errorId = errorId; - target->errorDesc = errorDesc; - target->tabsize = tabsize; - target->errorLocation = errorLocation; - target->useMicrosoftBOM = useMicrosoftBOM; - - TiXmlNode* node = 0; - for ( node = firstChild; node; node = node->NextSibling() ) - { - target->LinkEndChild( node->Clone() ); - } -} - - -TiXmlNode* TiXmlDocument::Clone() const -{ - TiXmlDocument* clone = new TiXmlDocument(); - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; -} - - -void TiXmlDocument::Print( FILE* cfile, int depth ) const -{ - assert( cfile ); - for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) - { - node->Print( cfile, depth ); - fprintf( cfile, "\n" ); - } -} - - -bool TiXmlDocument::Accept( TiXmlVisitor* visitor ) const -{ - if ( visitor->VisitEnter( *this ) ) - { - for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) - { - if ( !node->Accept( visitor ) ) - break; - } - } - return visitor->VisitExit( *this ); -} - - -const TiXmlAttribute* TiXmlAttribute::Next() const -{ - // We are using knowledge of the sentinel. The sentinel - // have a value or name. - if ( next->value.empty() && next->name.empty() ) - return 0; - return next; -} - -/* -TiXmlAttribute* TiXmlAttribute::Next() -{ - // We are using knowledge of the sentinel. The sentinel - // have a value or name. - if ( next->value.empty() && next->name.empty() ) - return 0; - return next; -} -*/ - -const TiXmlAttribute* TiXmlAttribute::Previous() const -{ - // We are using knowledge of the sentinel. The sentinel - // have a value or name. - if ( prev->value.empty() && prev->name.empty() ) - return 0; - return prev; -} - -/* -TiXmlAttribute* TiXmlAttribute::Previous() -{ - // We are using knowledge of the sentinel. The sentinel - // have a value or name. - if ( prev->value.empty() && prev->name.empty() ) - return 0; - return prev; -} -*/ - -void TiXmlAttribute::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const -{ - TIXML_STRING n, v; - - EncodeString( name, &n ); - EncodeString( value, &v ); - - if (value.find ('\"') == TIXML_STRING::npos) { - if ( cfile ) { - fprintf (cfile, "%s=\"%s\"", n.c_str(), v.c_str() ); - } - if ( str ) { - (*str) += n; (*str) += "=\""; (*str) += v; (*str) += "\""; - } - } - else { - if ( cfile ) { - fprintf (cfile, "%s='%s'", n.c_str(), v.c_str() ); - } - if ( str ) { - (*str) += n; (*str) += "='"; (*str) += v; (*str) += "'"; - } - } -} - - -int TiXmlAttribute::QueryIntValue( int* ival ) const -{ - if ( TIXML_SSCANF( value.c_str(), "%d", ival ) == 1 ) - return TIXML_SUCCESS; - return TIXML_WRONG_TYPE; -} - -int TiXmlAttribute::QueryDoubleValue( double* dval ) const -{ - if ( TIXML_SSCANF( value.c_str(), "%lf", dval ) == 1 ) - return TIXML_SUCCESS; - return TIXML_WRONG_TYPE; -} - -void TiXmlAttribute::SetIntValue( int _value ) -{ - char buf [64]; - #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF(buf, sizeof(buf), "%d", _value); - #else - sprintf (buf, "%d", _value); - #endif - SetValue (buf); -} - -void TiXmlAttribute::SetDoubleValue( double _value ) -{ - char buf [256]; - #if defined(TIXML_SNPRINTF) - TIXML_SNPRINTF( buf, sizeof(buf), "%lf", _value); - #else - sprintf (buf, "%lf", _value); - #endif - SetValue (buf); -} - -int TiXmlAttribute::IntValue() const -{ - return atoi (value.c_str ()); -} - -double TiXmlAttribute::DoubleValue() const -{ - return atof (value.c_str ()); -} - - -TiXmlComment::TiXmlComment( const TiXmlComment& copy ) : TiXmlNode( TiXmlNode::COMMENT ) -{ - copy.CopyTo( this ); -} - - -void TiXmlComment::operator=( const TiXmlComment& base ) -{ - Clear(); - base.CopyTo( this ); -} - - -void TiXmlComment::Print( FILE* cfile, int depth ) const -{ - assert( cfile ); - for ( int i=0; i", value.c_str() ); -} - - -void TiXmlComment::CopyTo( TiXmlComment* target ) const -{ - TiXmlNode::CopyTo( target ); -} - - -bool TiXmlComment::Accept( TiXmlVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - - -TiXmlNode* TiXmlComment::Clone() const -{ - TiXmlComment* clone = new TiXmlComment(); - - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; -} - - -void TiXmlText::Print( FILE* cfile, int depth ) const -{ - assert( cfile ); - if ( cdata ) - { - int i; - fprintf( cfile, "\n" ); - for ( i=0; i\n", value.c_str() ); // unformatted output - } - else - { - TIXML_STRING buffer; - EncodeString( value, &buffer ); - fprintf( cfile, "%s", buffer.c_str() ); - } -} - - -void TiXmlText::CopyTo( TiXmlText* target ) const -{ - TiXmlNode::CopyTo( target ); - target->cdata = cdata; -} - - -bool TiXmlText::Accept( TiXmlVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - - -TiXmlNode* TiXmlText::Clone() const -{ - TiXmlText* clone = 0; - clone = new TiXmlText( "" ); - - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; -} - - -TiXmlDeclaration::TiXmlDeclaration( const char * _version, - const char * _encoding, - const char * _standalone ) - : TiXmlNode( TiXmlNode::DECLARATION ) -{ - version = _version; - encoding = _encoding; - standalone = _standalone; -} - - -#ifdef TIXML_USE_STL -TiXmlDeclaration::TiXmlDeclaration( const std::string& _version, - const std::string& _encoding, - const std::string& _standalone ) - : TiXmlNode( TiXmlNode::DECLARATION ) -{ - version = _version; - encoding = _encoding; - standalone = _standalone; -} -#endif - - -TiXmlDeclaration::TiXmlDeclaration( const TiXmlDeclaration& copy ) - : TiXmlNode( TiXmlNode::DECLARATION ) -{ - copy.CopyTo( this ); -} - - -void TiXmlDeclaration::operator=( const TiXmlDeclaration& copy ) -{ - Clear(); - copy.CopyTo( this ); -} - - -void TiXmlDeclaration::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const -{ - if ( cfile ) fprintf( cfile, "" ); - if ( str ) (*str) += "?>"; -} - - -void TiXmlDeclaration::CopyTo( TiXmlDeclaration* target ) const -{ - TiXmlNode::CopyTo( target ); - - target->version = version; - target->encoding = encoding; - target->standalone = standalone; -} - - -bool TiXmlDeclaration::Accept( TiXmlVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - - -TiXmlNode* TiXmlDeclaration::Clone() const -{ - TiXmlDeclaration* clone = new TiXmlDeclaration(); - - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; -} - - -void TiXmlUnknown::Print( FILE* cfile, int depth ) const -{ - for ( int i=0; i", value.c_str() ); -} - - -void TiXmlUnknown::CopyTo( TiXmlUnknown* target ) const -{ - TiXmlNode::CopyTo( target ); -} - - -bool TiXmlUnknown::Accept( TiXmlVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - - -TiXmlNode* TiXmlUnknown::Clone() const -{ - TiXmlUnknown* clone = new TiXmlUnknown(); - - if ( !clone ) - return 0; - - CopyTo( clone ); - return clone; -} - - -TiXmlAttributeSet::TiXmlAttributeSet() -{ - sentinel.next = &sentinel; - sentinel.prev = &sentinel; -} - - -TiXmlAttributeSet::~TiXmlAttributeSet() -{ - assert( sentinel.next == &sentinel ); - assert( sentinel.prev == &sentinel ); -} - - -void TiXmlAttributeSet::Add( TiXmlAttribute* addMe ) -{ - #ifdef TIXML_USE_STL - assert( !Find( TIXML_STRING( addMe->Name() ) ) ); // Shouldn't be multiply adding to the set. - #else - assert( !Find( addMe->Name() ) ); // Shouldn't be multiply adding to the set. - #endif - - addMe->next = &sentinel; - addMe->prev = sentinel.prev; - - sentinel.prev->next = addMe; - sentinel.prev = addMe; -} - -void TiXmlAttributeSet::Remove( TiXmlAttribute* removeMe ) -{ - TiXmlAttribute* node; - - for( node = sentinel.next; node != &sentinel; node = node->next ) - { - if ( node == removeMe ) - { - node->prev->next = node->next; - node->next->prev = node->prev; - node->next = 0; - node->prev = 0; - return; - } - } - assert( 0 ); // we tried to remove a non-linked attribute. -} - - -#ifdef TIXML_USE_STL -const TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name ) const -{ - for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) - { - if ( node->name == name ) - return node; - } - return 0; -} - -/* -TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name ) -{ - for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) - { - if ( node->name == name ) - return node; - } - return 0; -} -*/ -#endif - - -const TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) const -{ - for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) - { - if ( strcmp( node->name.c_str(), name ) == 0 ) - return node; - } - return 0; -} - -/* -TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) -{ - for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) - { - if ( strcmp( node->name.c_str(), name ) == 0 ) - return node; - } - return 0; -} -*/ - -#ifdef TIXML_USE_STL -std::istream& operator>> (std::istream & in, TiXmlNode & base) -{ - TIXML_STRING tag; - tag.reserve( 8 * 1000 ); - base.StreamIn( &in, &tag ); - - base.Parse( tag.c_str(), 0, TIXML_DEFAULT_ENCODING ); - return in; -} -#endif - - -#ifdef TIXML_USE_STL -std::ostream& operator<< (std::ostream & out, const TiXmlNode & base) -{ - TiXmlPrinter printer; - printer.SetStreamPrinting(); - base.Accept( &printer ); - out << printer.Str(); - - return out; -} - - -std::string& operator<< (std::string& out, const TiXmlNode& base ) -{ - TiXmlPrinter printer; - printer.SetStreamPrinting(); - base.Accept( &printer ); - out.append( printer.Str() ); - - return out; -} -#endif - - -TiXmlHandle TiXmlHandle::FirstChild() const -{ - if ( node ) - { - TiXmlNode* child = node->FirstChild(); - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -TiXmlHandle TiXmlHandle::FirstChild( const char * value ) const -{ - if ( node ) - { - TiXmlNode* child = node->FirstChild( value ); - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -TiXmlHandle TiXmlHandle::FirstChildElement() const -{ - if ( node ) - { - TiXmlElement* child = node->FirstChildElement(); - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -TiXmlHandle TiXmlHandle::FirstChildElement( const char * value ) const -{ - if ( node ) - { - TiXmlElement* child = node->FirstChildElement( value ); - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -TiXmlHandle TiXmlHandle::Child( int count ) const -{ - if ( node ) - { - int i; - TiXmlNode* child = node->FirstChild(); - for ( i=0; - child && iNextSibling(), ++i ) - { - // nothing - } - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -TiXmlHandle TiXmlHandle::Child( const char* value, int count ) const -{ - if ( node ) - { - int i; - TiXmlNode* child = node->FirstChild( value ); - for ( i=0; - child && iNextSibling( value ), ++i ) - { - // nothing - } - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -TiXmlHandle TiXmlHandle::ChildElement( int count ) const -{ - if ( node ) - { - int i; - TiXmlElement* child = node->FirstChildElement(); - for ( i=0; - child && iNextSiblingElement(), ++i ) - { - // nothing - } - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -TiXmlHandle TiXmlHandle::ChildElement( const char* value, int count ) const -{ - if ( node ) - { - int i; - TiXmlElement* child = node->FirstChildElement( value ); - for ( i=0; - child && iNextSiblingElement( value ), ++i ) - { - // nothing - } - if ( child ) - return TiXmlHandle( child ); - } - return TiXmlHandle( 0 ); -} - - -bool TiXmlPrinter::VisitEnter( const TiXmlDocument& ) -{ - return true; -} - -bool TiXmlPrinter::VisitExit( const TiXmlDocument& ) -{ - return true; -} - -bool TiXmlPrinter::VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ) -{ - DoIndent(); - buffer += "<"; - buffer += element.Value(); - - for( const TiXmlAttribute* attrib = firstAttribute; attrib; attrib = attrib->Next() ) - { - buffer += " "; - attrib->Print( 0, 0, &buffer ); - } - - if ( !element.FirstChild() ) - { - buffer += " />"; - DoLineBreak(); - } - else - { - buffer += ">"; - if ( element.FirstChild()->ToText() - && element.LastChild() == element.FirstChild() - && element.FirstChild()->ToText()->CDATA() == false ) - { - simpleTextPrint = true; - // no DoLineBreak()! - } - else - { - DoLineBreak(); - } - } - ++depth; - return true; -} - - -bool TiXmlPrinter::VisitExit( const TiXmlElement& element ) -{ - --depth; - if ( !element.FirstChild() ) - { - // nothing. - } - else - { - if ( simpleTextPrint ) - { - simpleTextPrint = false; - } - else - { - DoIndent(); - } - buffer += ""; - DoLineBreak(); - } - return true; -} - - -bool TiXmlPrinter::Visit( const TiXmlText& text ) -{ - if ( text.CDATA() ) - { - DoIndent(); - buffer += ""; - DoLineBreak(); - } - else if ( simpleTextPrint ) - { - TIXML_STRING str; - TiXmlBase::EncodeString( text.ValueTStr(), &str ); - buffer += str; - } - else - { - DoIndent(); - TIXML_STRING str; - TiXmlBase::EncodeString( text.ValueTStr(), &str ); - buffer += str; - DoLineBreak(); - } - return true; -} - - -bool TiXmlPrinter::Visit( const TiXmlDeclaration& declaration ) -{ - DoIndent(); - declaration.Print( 0, 0, &buffer ); - DoLineBreak(); - return true; -} - - -bool TiXmlPrinter::Visit( const TiXmlComment& comment ) -{ - DoIndent(); - buffer += ""; - DoLineBreak(); - return true; -} - - -bool TiXmlPrinter::Visit( const TiXmlUnknown& unknown ) -{ - DoIndent(); - buffer += "<"; - buffer += unknown.Value(); - buffer += ">"; - DoLineBreak(); - return true; -} - diff --git a/libspud/src/tinyxmlerror.cpp b/libspud/src/tinyxmlerror.cpp deleted file mode 100644 index d24f63b2e5..0000000000 --- a/libspud/src/tinyxmlerror.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* -www.sourceforge.net/projects/tinyxml -Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -#include "tinyxml.h" - -// The goal of the seperate error file is to make the first -// step towards localization. tinyxml (currently) only supports -// english error messages, but the could now be translated. -// -// It also cleans up the code a bit. -// - -const char* TiXmlBase::errorString[ TIXML_ERROR_STRING_COUNT ] = -{ - "No error", - "Error", - "Failed to open file", - "Memory allocation failed.", - "Error parsing Element.", - "Failed to read Element name", - "Error reading Element value.", - "Error reading Attributes.", - "Error: empty tag.", - "Error reading end tag.", - "Error parsing Unknown.", - "Error parsing Comment.", - "Error parsing Declaration.", - "Error document empty.", - "Error null (0) or unexpected EOF found in input stream.", - "Error parsing CDATA.", - "Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.", -}; diff --git a/libspud/src/tinyxmlparser.cpp b/libspud/src/tinyxmlparser.cpp deleted file mode 100644 index 9c91b4f946..0000000000 --- a/libspud/src/tinyxmlparser.cpp +++ /dev/null @@ -1,1638 +0,0 @@ -/* -www.sourceforge.net/projects/tinyxml -Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -#include -#include - -#include "tinyxml.h" - -//#define DEBUG_PARSER -#if defined( DEBUG_PARSER ) -# if defined( DEBUG ) && defined( _MSC_VER ) -# include -# define TIXML_LOG OutputDebugString -# else -# define TIXML_LOG printf -# endif -#endif - -// Note tha "PutString" hardcodes the same list. This -// is less flexible than it appears. Changing the entries -// or order will break putstring. -TiXmlBase::Entity TiXmlBase::entity[ NUM_ENTITY ] = -{ - { "&", 5, '&' }, - { "<", 4, '<' }, - { ">", 4, '>' }, - { """, 6, '\"' }, - { "'", 6, '\'' } -}; - -// Bunch of unicode info at: -// http://www.unicode.org/faq/utf_bom.html -// Including the basic of this table, which determines the #bytes in the -// sequence from the lead byte. 1 placed for invalid sequences -- -// although the result will be junk, pass it through as much as possible. -// Beware of the non-characters in UTF-8: -// ef bb bf (Microsoft "lead bytes") -// ef bf be -// ef bf bf - -const unsigned char TIXML_UTF_LEAD_0 = 0xefU; -const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; -const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; - -const int TiXmlBase::utf8ByteTable[256] = -{ - // 0 1 2 3 4 5 6 7 8 9 a b c d e f - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x10 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x20 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x30 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x50 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x70 End of ASCII range - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x80 0x80 to 0xc1 invalid - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x90 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xa0 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xb0 - 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xc0 0xc2 to 0xdf 2 byte - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xd0 - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xe0 0xe0 to 0xef 3 byte - 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 0xf0 0xf0 to 0xf4 4 byte, 0xf5 and higher invalid -}; - - -void TiXmlBase::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ) -{ - const unsigned long BYTE_MASK = 0xBF; - const unsigned long BYTE_MARK = 0x80; - const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; - - if (input < 0x80) - *length = 1; - else if ( input < 0x800 ) - *length = 2; - else if ( input < 0x10000 ) - *length = 3; - else if ( input < 0x200000 ) - *length = 4; - else - { *length = 0; return; } // This code won't covert this correctly anyway. - - output += *length; - - // Scary scary fall throughs. - switch (*length) - { - case 4: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 3: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 2: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 1: - --output; - *output = (char)(input | FIRST_BYTE_MARK[*length]); - } -} - - -/*static*/ int TiXmlBase::IsAlpha( unsigned char anyByte, TiXmlEncoding /*encoding*/ ) -{ - // This will only work for low-ascii, everything else is assumed to be a valid - // letter. I'm not sure this is the best approach, but it is quite tricky trying - // to figure out alhabetical vs. not across encoding. So take a very - // conservative approach. - -// if ( encoding == TIXML_ENCODING_UTF8 ) -// { - if ( anyByte < 127 ) - return isalpha( anyByte ); - else - return 1; // What else to do? The unicode set is huge...get the english ones right. -// } -// else -// { -// return isalpha( anyByte ); -// } -} - - -/*static*/ int TiXmlBase::IsAlphaNum( unsigned char anyByte, TiXmlEncoding /*encoding*/ ) -{ - // This will only work for low-ascii, everything else is assumed to be a valid - // letter. I'm not sure this is the best approach, but it is quite tricky trying - // to figure out alhabetical vs. not across encoding. So take a very - // conservative approach. - -// if ( encoding == TIXML_ENCODING_UTF8 ) -// { - if ( anyByte < 127 ) - return isalnum( anyByte ); - else - return 1; // What else to do? The unicode set is huge...get the english ones right. -// } -// else -// { -// return isalnum( anyByte ); -// } -} - - -class TiXmlParsingData -{ - friend class TiXmlDocument; - public: - void Stamp( const char* now, TiXmlEncoding encoding ); - - const TiXmlCursor& Cursor() { return cursor; } - - private: - // Only used by the document! - TiXmlParsingData( const char* start, int _tabsize, int row, int col ) - { - assert( start ); - stamp = start; - tabsize = _tabsize; - cursor.row = row; - cursor.col = col; - } - - TiXmlCursor cursor; - const char* stamp; - int tabsize; -}; - - -void TiXmlParsingData::Stamp( const char* now, TiXmlEncoding encoding ) -{ - assert( now ); - - // Do nothing if the tabsize is 0. - if ( tabsize < 1 ) - { - return; - } - - // Get the current row, column. - int row = cursor.row; - int col = cursor.col; - const char* p = stamp; - assert( p ); - - while ( p < now ) - { - // Treat p as unsigned, so we have a happy compiler. - const unsigned char* pU = (const unsigned char*)p; - - // Code contributed by Fletcher Dunn: (modified by lee) - switch (*pU) { - case 0: - // We *should* never get here, but in case we do, don't - // advance past the terminating null character, ever - return; - - case '\r': - // bump down to the next line - ++row; - col = 0; - // Eat the character - ++p; - - // Check for \r\n sequence, and treat this as a single character - if (*p == '\n') { - ++p; - } - break; - - case '\n': - // bump down to the next line - ++row; - col = 0; - - // Eat the character - ++p; - - // Check for \n\r sequence, and treat this as a single - // character. (Yes, this bizarre thing does occur still - // on some arcane platforms...) - if (*p == '\r') { - ++p; - } - break; - - case '\t': - // Eat the character - ++p; - - // Skip to next tab stop - col = (col / tabsize + 1) * tabsize; - break; - - case TIXML_UTF_LEAD_0: - if ( encoding == TIXML_ENCODING_UTF8 ) - { - if ( *(p+1) && *(p+2) ) - { - // In these cases, don't advance the column. These are - // 0-width spaces. - if ( *(pU+1)==TIXML_UTF_LEAD_1 && *(pU+2)==TIXML_UTF_LEAD_2 ) - p += 3; - else if ( *(pU+1)==0xbfU && *(pU+2)==0xbeU ) - p += 3; - else if ( *(pU+1)==0xbfU && *(pU+2)==0xbfU ) - p += 3; - else - { p +=3; ++col; } // A normal character. - } - } - else - { - ++p; - ++col; - } - break; - - default: - if ( encoding == TIXML_ENCODING_UTF8 ) - { - // Eat the 1 to 4 byte utf8 character. - int step = TiXmlBase::utf8ByteTable[*((const unsigned char*)p)]; - if ( step == 0 ) - step = 1; // Error case from bad encoding, but handle gracefully. - p += step; - - // Just advance one column, of course. - ++col; - } - else - { - ++p; - ++col; - } - break; - } - } - cursor.row = row; - cursor.col = col; - assert( cursor.row >= -1 ); - assert( cursor.col >= -1 ); - stamp = p; - assert( stamp ); -} - - -const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding ) -{ - if ( !p || !*p ) - { - return 0; - } - if ( encoding == TIXML_ENCODING_UTF8 ) - { - while ( *p ) - { - const unsigned char* pU = (const unsigned char*)p; - - // Skip the stupid Microsoft UTF-8 Byte order marks - if ( *(pU+0)==TIXML_UTF_LEAD_0 - && *(pU+1)==TIXML_UTF_LEAD_1 - && *(pU+2)==TIXML_UTF_LEAD_2 ) - { - p += 3; - continue; - } - else if(*(pU+0)==TIXML_UTF_LEAD_0 - && *(pU+1)==0xbfU - && *(pU+2)==0xbeU ) - { - p += 3; - continue; - } - else if(*(pU+0)==TIXML_UTF_LEAD_0 - && *(pU+1)==0xbfU - && *(pU+2)==0xbfU ) - { - p += 3; - continue; - } - - if ( IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' ) // Still using old rules for white space. - ++p; - else - break; - } - } - else - { - while ( *p && IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' ) - ++p; - } - - return p; -} - -#ifdef TIXML_USE_STL -/*static*/ bool TiXmlBase::StreamWhiteSpace( std::istream * in, TIXML_STRING * tag ) -{ - for( ;; ) - { - if ( !in->good() ) return false; - - int c = in->peek(); - // At this scope, we can't get to a document. So fail silently. - if ( !IsWhiteSpace( c ) || c <= 0 ) - return true; - - *tag += (char) in->get(); - } -} - -/*static*/ bool TiXmlBase::StreamTo( std::istream * in, int character, TIXML_STRING * tag ) -{ - //assert( character > 0 && character < 128 ); // else it won't work in utf-8 - while ( in->good() ) - { - int c = in->peek(); - if ( c == character ) - return true; - if ( c <= 0 ) // Silent failure: can't get document at this scope - return false; - - in->get(); - *tag += (char) c; - } - return false; -} -#endif - -// One of TinyXML's more performance demanding functions. Try to keep the memory overhead down. The -// "assign" optimization removes over 10% of the execution time. -// -const char* TiXmlBase::ReadName( const char* p, TIXML_STRING * name, TiXmlEncoding encoding ) -{ - // Oddly, not supported on some comilers, - //name->clear(); - // So use this: - *name = ""; - assert( p ); - - // Names start with letters or underscores. - // Of course, in unicode, tinyxml has no idea what a letter *is*. The - // algorithm is generous. - // - // After that, they can be letters, underscores, numbers, - // hyphens, or colons. (Colons are valid ony for namespaces, - // but tinyxml can't tell namespaces from names.) - if ( p && *p - && ( IsAlpha( (unsigned char) *p, encoding ) || *p == '_' ) ) - { - const char* start = p; - while( p && *p - && ( IsAlphaNum( (unsigned char ) *p, encoding ) - || *p == '_' - || *p == '-' - || *p == '.' - || *p == ':' ) ) - { - //(*name) += *p; // expensive - ++p; - } - if ( p-start > 0 ) { - name->assign( start, p-start ); - } - return p; - } - return 0; -} - -const char* TiXmlBase::GetEntity( const char* p, char* value, int* length, TiXmlEncoding encoding ) -{ - // Presume an entity, and pull it out. - TIXML_STRING ent; - int i; - *length = 0; - - if ( *(p+1) && *(p+1) == '#' && *(p+2) ) - { - unsigned long ucs = 0; - ptrdiff_t delta = 0; - unsigned mult = 1; - - if ( *(p+2) == 'x' ) - { - // Hexadecimal. - if ( !*(p+3) ) return 0; - - const char* q = p+3; - q = strchr( q, ';' ); - - if ( !q || !*q ) return 0; - - delta = q-p; - --q; - - while ( *q != 'x' ) - { - if ( *q >= '0' && *q <= '9' ) - ucs += mult * (*q - '0'); - else if ( *q >= 'a' && *q <= 'f' ) - ucs += mult * (*q - 'a' + 10); - else if ( *q >= 'A' && *q <= 'F' ) - ucs += mult * (*q - 'A' + 10 ); - else - return 0; - mult *= 16; - --q; - } - } - else - { - // Decimal. - if ( !*(p+2) ) return 0; - - const char* q = p+2; - q = strchr( q, ';' ); - - if ( !q || !*q ) return 0; - - delta = q-p; - --q; - - while ( *q != '#' ) - { - if ( *q >= '0' && *q <= '9' ) - ucs += mult * (*q - '0'); - else - return 0; - mult *= 10; - --q; - } - } - if ( encoding == TIXML_ENCODING_UTF8 ) - { - // convert the UCS to UTF-8 - ConvertUTF32ToUTF8( ucs, value, length ); - } - else - { - *value = (char)ucs; - *length = 1; - } - return p + delta + 1; - } - - // Now try to match it. - for( i=0; iappend( cArr, len ); - } - } - else - { - bool whitespace = false; - - // Remove leading white space: - p = SkipWhiteSpace( p, encoding ); - while ( p && *p - && !StringEqual( p, endTag, caseInsensitive, encoding ) ) - { - if ( *p == '\r' || *p == '\n' ) - { - whitespace = true; - ++p; - } - else if ( IsWhiteSpace( *p ) ) - { - whitespace = true; - ++p; - } - else - { - // If we've found whitespace, add it before the - // new character. Any whitespace just becomes a space. - if ( whitespace ) - { - (*text) += ' '; - whitespace = false; - } - int len; - char cArr[4] = { 0, 0, 0, 0 }; - p = GetChar( p, cArr, &len, encoding ); - if ( len == 1 ) - (*text) += cArr[0]; // more efficient - else - text->append( cArr, len ); - } - } - } - if ( p ) - p += strlen( endTag ); - return p; -} - -#ifdef TIXML_USE_STL - -void TiXmlDocument::StreamIn( std::istream * in, TIXML_STRING * tag ) -{ - // The basic issue with a document is that we don't know what we're - // streaming. Read something presumed to be a tag (and hope), then - // identify it, and call the appropriate stream method on the tag. - // - // This "pre-streaming" will never read the closing ">" so the - // sub-tag can orient itself. - - if ( !StreamTo( in, '<', tag ) ) - { - SetError( TIXML_ERROR_PARSING_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return; - } - - while ( in->good() ) - { - int tagIndex = (int) tag->length(); - while ( in->good() && in->peek() != '>' ) - { - int c = in->get(); - if ( c <= 0 ) - { - SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); - break; - } - (*tag) += (char) c; - } - - if ( in->good() ) - { - // We now have something we presume to be a node of - // some sort. Identify it, and call the node to - // continue streaming. - TiXmlNode* node = Identify( tag->c_str() + tagIndex, TIXML_DEFAULT_ENCODING ); - - if ( node ) - { - node->StreamIn( in, tag ); - bool isElement = node->ToElement() != 0; - delete node; - node = 0; - - // If this is the root element, we're done. Parsing will be - // done by the >> operator. - if ( isElement ) - { - return; - } - } - else - { - SetError( TIXML_ERROR, 0, 0, TIXML_ENCODING_UNKNOWN ); - return; - } - } - } - // We should have returned sooner. - SetError( TIXML_ERROR, 0, 0, TIXML_ENCODING_UNKNOWN ); -} - -#endif - -const char* TiXmlDocument::Parse( const char* p, TiXmlParsingData* prevData, TiXmlEncoding encoding ) -{ - ClearError(); - - // Parse away, at the document level. Since a document - // contains nothing but other tags, most of what happens - // here is skipping white space. - if ( !p || !*p ) - { - SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - // Note that, for a document, this needs to come - // before the while space skip, so that parsing - // starts from the pointer we are given. - location.Clear(); - if ( prevData ) - { - location.row = prevData->cursor.row; - location.col = prevData->cursor.col; - } - else - { - location.row = 0; - location.col = 0; - } - TiXmlParsingData data( p, TabSize(), location.row, location.col ); - location = data.Cursor(); - - if ( encoding == TIXML_ENCODING_UNKNOWN ) - { - // Check for the Microsoft UTF-8 lead bytes. - const unsigned char* pU = (const unsigned char*)p; - if ( *(pU+0) && *(pU+0) == TIXML_UTF_LEAD_0 - && *(pU+1) && *(pU+1) == TIXML_UTF_LEAD_1 - && *(pU+2) && *(pU+2) == TIXML_UTF_LEAD_2 ) - { - encoding = TIXML_ENCODING_UTF8; - useMicrosoftBOM = true; - } - } - - p = SkipWhiteSpace( p, encoding ); - if ( !p ) - { - SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); - return 0; - } - - while ( p && *p ) - { - TiXmlNode* node = Identify( p, encoding ); - if ( node ) - { - p = node->Parse( p, &data, encoding ); - LinkEndChild( node ); - } - else - { - break; - } - - // Did we get encoding info? - if ( encoding == TIXML_ENCODING_UNKNOWN - && node->ToDeclaration() ) - { - TiXmlDeclaration* dec = node->ToDeclaration(); - const char* enc = dec->Encoding(); - assert( enc ); - - if ( *enc == 0 ) - encoding = TIXML_ENCODING_UTF8; - else if ( StringEqual( enc, "UTF-8", true, TIXML_ENCODING_UNKNOWN ) ) - encoding = TIXML_ENCODING_UTF8; - else if ( StringEqual( enc, "UTF8", true, TIXML_ENCODING_UNKNOWN ) ) - encoding = TIXML_ENCODING_UTF8; // incorrect, but be nice - else - encoding = TIXML_ENCODING_LEGACY; - } - - p = SkipWhiteSpace( p, encoding ); - } - - // Was this empty? - if ( !firstChild ) { - SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, encoding ); - return 0; - } - - // All is well. - return p; -} - -void TiXmlDocument::SetError( int err, const char* pError, TiXmlParsingData* data, TiXmlEncoding encoding ) -{ - // The first error in a chain is more accurate - don't set again! - if ( error ) - return; - - assert( err > 0 && err < TIXML_ERROR_STRING_COUNT ); - error = true; - errorId = err; - errorDesc = errorString[ errorId ]; - - errorLocation.Clear(); - if ( pError && data ) - { - data->Stamp( pError, encoding ); - errorLocation = data->Cursor(); - } -} - - -TiXmlNode* TiXmlNode::Identify( const char* p, TiXmlEncoding encoding ) -{ - TiXmlNode* returnNode = 0; - - p = SkipWhiteSpace( p, encoding ); - if( !p || !*p || *p != '<' ) - { - return 0; - } - - TiXmlDocument* doc = GetDocument(); - p = SkipWhiteSpace( p, encoding ); - - if ( !p || !*p ) - { - return 0; - } - - // What is this thing? - // - Elements start with a letter or underscore, but xml is reserved. - // - Comments: "; - - if ( !StringEqual( p, startTag, false, encoding ) ) - { - document->SetError( TIXML_ERROR_PARSING_COMMENT, p, data, encoding ); - return 0; - } - p += strlen( startTag ); - - // [ 1475201 ] TinyXML parses entities in comments - // Oops - ReadText doesn't work, because we don't want to parse the entities. - // p = ReadText( p, &value, false, endTag, false, encoding ); - // - // from the XML spec: - /* - [Definition: Comments may appear anywhere in a document outside other markup; in addition, - they may appear within the document type declaration at places allowed by the grammar. - They are not part of the document's character data; an XML processor MAY, but need not, - make it possible for an application to retrieve the text of comments. For compatibility, - the string "--" (double-hyphen) MUST NOT occur within comments.] Parameter entity - references MUST NOT be recognized within comments. - - An example of a comment: - - - */ - - value = ""; - // Keep all the white space. - while ( p && *p && !StringEqual( p, endTag, false, encoding ) ) - { - value.append( p, 1 ); - ++p; - } - if ( p ) - p += strlen( endTag ); - - return p; -} - - -const char* TiXmlAttribute::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) -{ - p = SkipWhiteSpace( p, encoding ); - if ( !p || !*p ) return 0; - -// int tabsize = 4; -// if ( document ) -// tabsize = document->TabSize(); - - if ( data ) - { - data->Stamp( p, encoding ); - location = data->Cursor(); - } - // Read the name, the '=' and the value. - const char* pErr = p; - p = ReadName( p, &name, encoding ); - if ( !p || !*p ) - { - if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding ); - return 0; - } - p = SkipWhiteSpace( p, encoding ); - if ( !p || !*p || *p != '=' ) - { - if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); - return 0; - } - - ++p; // skip '=' - p = SkipWhiteSpace( p, encoding ); - if ( !p || !*p ) - { - if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); - return 0; - } - - const char* end; - const char SINGLE_QUOTE = '\''; - const char DOUBLE_QUOTE = '\"'; - - if ( *p == SINGLE_QUOTE ) - { - ++p; - end = "\'"; // single quote in string - p = ReadText( p, &value, false, end, false, encoding ); - } - else if ( *p == DOUBLE_QUOTE ) - { - ++p; - end = "\""; // double quote in string - p = ReadText( p, &value, false, end, false, encoding ); - } - else - { - // All attribute values should be in single or double quotes. - // But this is such a common error that the parser will try - // its best, even without them. - value = ""; - while ( p && *p // existence - && !IsWhiteSpace( *p ) && *p != '\n' && *p != '\r' // whitespace - && *p != '/' && *p != '>' ) // tag end - { - if ( *p == SINGLE_QUOTE || *p == DOUBLE_QUOTE ) { - // [ 1451649 ] Attribute values with trailing quotes not handled correctly - // We did not have an opening quote but seem to have a - // closing one. Give up and throw an error. - if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); - return 0; - } - value += *p; - ++p; - } - } - return p; -} - -#ifdef TIXML_USE_STL -void TiXmlText::StreamIn( std::istream * in, TIXML_STRING * tag ) -{ - while ( in->good() ) - { - int c = in->peek(); - if ( !cdata && (c == '<' ) ) - { - return; - } - if ( c <= 0 ) - { - TiXmlDocument* document = GetDocument(); - if ( document ) - document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); - return; - } - - (*tag) += (char) c; - in->get(); // "commits" the peek made above - - if ( cdata && c == '>' && tag->size() >= 3 ) { - size_t len = tag->size(); - if ( (*tag)[len-2] == ']' && (*tag)[len-3] == ']' ) { - // terminator of cdata. - return; - } - } - } -} -#endif - -const char* TiXmlText::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) -{ - value = ""; - TiXmlDocument* document = GetDocument(); - - if ( data ) - { - data->Stamp( p, encoding ); - location = data->Cursor(); - } - - const char* const startTag = ""; - - if ( cdata || StringEqual( p, startTag, false, encoding ) ) - { - cdata = true; - - if ( !StringEqual( p, startTag, false, encoding ) ) - { - document->SetError( TIXML_ERROR_PARSING_CDATA, p, data, encoding ); - return 0; - } - p += strlen( startTag ); - - // Keep all the white space, ignore the encoding, etc. - while ( p && *p - && !StringEqual( p, endTag, false, encoding ) - ) - { - value += *p; - ++p; - } - - TIXML_STRING dummy; - p = ReadText( p, &dummy, false, endTag, false, encoding ); - return p; - } - else - { - bool ignoreWhite = true; - - const char* end = "<"; - p = ReadText( p, &value, ignoreWhite, end, false, encoding ); - if ( p ) - return p-1; // don't truncate the '<' - return 0; - } -} - -#ifdef TIXML_USE_STL -void TiXmlDeclaration::StreamIn( std::istream * in, TIXML_STRING * tag ) -{ - while ( in->good() ) - { - int c = in->get(); - if ( c <= 0 ) - { - TiXmlDocument* document = GetDocument(); - if ( document ) - document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); - return; - } - (*tag) += (char) c; - - if ( c == '>' ) - { - // All is well. - return; - } - } -} -#endif - -const char* TiXmlDeclaration::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding _encoding ) -{ - p = SkipWhiteSpace( p, _encoding ); - // Find the beginning, find the end, and look for - // the stuff in-between. - TiXmlDocument* document = GetDocument(); - if ( !p || !*p || !StringEqual( p, "SetError( TIXML_ERROR_PARSING_DECLARATION, 0, 0, _encoding ); - return 0; - } - if ( data ) - { - data->Stamp( p, _encoding ); - location = data->Cursor(); - } - p += 5; - - version = ""; - encoding = ""; - standalone = ""; - - while ( p && *p ) - { - if ( *p == '>' ) - { - ++p; - return p; - } - - p = SkipWhiteSpace( p, _encoding ); - if ( StringEqual( p, "version", true, _encoding ) ) - { - TiXmlAttribute attrib; - p = attrib.Parse( p, data, _encoding ); - version = attrib.Value(); - } - else if ( StringEqual( p, "encoding", true, _encoding ) ) - { - TiXmlAttribute attrib; - p = attrib.Parse( p, data, _encoding ); - encoding = attrib.Value(); - } - else if ( StringEqual( p, "standalone", true, _encoding ) ) - { - TiXmlAttribute attrib; - p = attrib.Parse( p, data, _encoding ); - standalone = attrib.Value(); - } - else - { - // Read over whatever it is. - while( p && *p && *p != '>' && !IsWhiteSpace( *p ) ) - ++p; - } - } - return 0; -} - -bool TiXmlText::Blank() const -{ - for ( unsigned i=0; i Date: Thu, 31 Jan 2019 11:50:09 +0000 Subject: [PATCH 2/6] Remove libjudy subtree --- libjudy/AUTHORS | 8 - libjudy/COPYING | 516 - libjudy/ChangeLog | 60 - libjudy/INSTALL | 20 - libjudy/Makefile.in | 16 - libjudy/README | 149 - libjudy/aclocal.m4 | 8823 ---------- libjudy/bootstrap | 14 - libjudy/compile | 142 - libjudy/config.guess | 1516 -- libjudy/config.h.in | 171 - libjudy/config.sub | 1622 -- libjudy/configure | 14076 ---------------- libjudy/configure.ac | 258 - libjudy/depcomp | 530 - libjudy/doc/Makefile.am | 209 - libjudy/doc/Makefile.in | 589 - libjudy/doc/ext/COPYRIGHT | 0 libjudy/doc/ext/Judy1_3.htm | 309 - libjudy/doc/ext/Judy1_funcs_3.htm | 260 - libjudy/doc/ext/JudyHS_3.htm | 197 - libjudy/doc/ext/JudyHS_funcs_3.htm | 150 - libjudy/doc/ext/JudyL_3.htm | 358 - libjudy/doc/ext/JudyL_funcs_3.htm | 248 - libjudy/doc/ext/JudySL_3.htm | 246 - libjudy/doc/ext/JudySL_funcs_3.htm | 186 - libjudy/doc/ext/Judy_3.htm | 283 - libjudy/doc/ext/LICENSE | 0 libjudy/doc/ext/README | 20 - libjudy/doc/ext/README_deliver | 20 - libjudy/doc/int/10minutes.htm | 190 - libjudy/examples/Judy1Dup.c | 47 - libjudy/examples/Judy1Dup.h | 31 - libjudy/examples/Judy1DupCheck.c | 80 - libjudy/examples/Judy1Op.c | 150 - libjudy/examples/Judy1Op.h | 15 - libjudy/examples/Judy1OpCheck.c | 150 - libjudy/examples/Makefile | 13 - libjudy/examples/README | 8 - libjudy/install-sh | 323 - libjudy/ltmain.sh | 7880 --------- libjudy/missing | 360 - libjudy/src/Judy.h | 622 - libjudy/src/Judy.h.check.c | 139 - libjudy/src/Judy1/Judy1.h | 551 - libjudy/src/Judy1/Judy1ByCount.c | 954 -- libjudy/src/Judy1/Judy1Cascade.c | 1942 --- libjudy/src/Judy1/Judy1Count.c | 1195 -- libjudy/src/Judy1/Judy1CreateBranch.c | 314 - libjudy/src/Judy1/Judy1Decascade.c | 1206 -- libjudy/src/Judy1/Judy1First.c | 213 - libjudy/src/Judy1/Judy1FreeArray.c | 363 - libjudy/src/Judy1/Judy1InsertBranch.c | 135 - libjudy/src/Judy1/Judy1MallocIF.c | 782 - libjudy/src/Judy1/Judy1MemActive.c | 259 - libjudy/src/Judy1/Judy1MemUsed.c | 61 - libjudy/src/Judy1/Judy1Next.c | 1890 --- libjudy/src/Judy1/Judy1NextEmpty.c | 1390 -- libjudy/src/Judy1/Judy1Prev.c | 1890 --- libjudy/src/Judy1/Judy1PrevEmpty.c | 1390 -- libjudy/src/Judy1/Judy1Set.c | 1873 -- libjudy/src/Judy1/Judy1SetArray.c | 1178 -- libjudy/src/Judy1/Judy1TablesGen.c | 296 - libjudy/src/Judy1/Judy1Test.c | 1094 -- libjudy/src/Judy1/Judy1Unset.c | 2146 --- libjudy/src/Judy1/Makefile.in | 93 - libjudy/src/Judy1/README | 11 - libjudy/src/Judy1/j__udy1Test.c | 1094 -- libjudy/src/JudyCommon/JudyByCount.c | 954 -- libjudy/src/JudyCommon/JudyCascade.c | 1942 --- libjudy/src/JudyCommon/JudyCount.c | 1195 -- libjudy/src/JudyCommon/JudyCreateBranch.c | 314 - libjudy/src/JudyCommon/JudyDecascade.c | 1206 -- libjudy/src/JudyCommon/JudyDel.c | 2146 --- libjudy/src/JudyCommon/JudyFirst.c | 213 - libjudy/src/JudyCommon/JudyFreeArray.c | 363 - libjudy/src/JudyCommon/JudyGet.c | 1094 -- libjudy/src/JudyCommon/JudyIns.c | 1873 -- libjudy/src/JudyCommon/JudyInsArray.c | 1178 -- libjudy/src/JudyCommon/JudyInsertBranch.c | 135 - libjudy/src/JudyCommon/JudyMalloc.c | 87 - libjudy/src/JudyCommon/JudyMallocIF.c | 782 - libjudy/src/JudyCommon/JudyMemActive.c | 259 - libjudy/src/JudyCommon/JudyMemUsed.c | 61 - libjudy/src/JudyCommon/JudyPrevNext.c | 1890 --- libjudy/src/JudyCommon/JudyPrevNextEmpty.c | 1390 -- libjudy/src/JudyCommon/JudyPrintJP.c | 401 - libjudy/src/JudyCommon/JudyPrivate.h | 1613 -- libjudy/src/JudyCommon/JudyPrivate1L.h | 485 - libjudy/src/JudyCommon/JudyPrivateBranch.h | 779 - libjudy/src/JudyCommon/JudyTables.c | 296 - libjudy/src/JudyCommon/Makefile.in | 58 - libjudy/src/JudyCommon/README | 66 - libjudy/src/JudyHS/JudyHS.c | 771 - libjudy/src/JudyHS/JudyHS.h | 35 - libjudy/src/JudyHS/Makefile.in | 58 - libjudy/src/JudyHS/README | 10 - libjudy/src/JudyL/JudyL.h | 505 - libjudy/src/JudyL/JudyLByCount.c | 954 -- libjudy/src/JudyL/JudyLCascade.c | 1942 --- libjudy/src/JudyL/JudyLCount.c | 1195 -- libjudy/src/JudyL/JudyLCreateBranch.c | 314 - libjudy/src/JudyL/JudyLDecascade.c | 1206 -- libjudy/src/JudyL/JudyLDel.c | 2146 --- libjudy/src/JudyL/JudyLFirst.c | 213 - libjudy/src/JudyL/JudyLFreeArray.c | 363 - libjudy/src/JudyL/JudyLGet.c | 1094 -- libjudy/src/JudyL/JudyLIns.c | 1873 -- libjudy/src/JudyL/JudyLInsArray.c | 1178 -- libjudy/src/JudyL/JudyLInsertBranch.c | 135 - libjudy/src/JudyL/JudyLMallocIF.c | 782 - libjudy/src/JudyL/JudyLMemActive.c | 259 - libjudy/src/JudyL/JudyLMemUsed.c | 61 - libjudy/src/JudyL/JudyLNext.c | 1890 --- libjudy/src/JudyL/JudyLNextEmpty.c | 1390 -- libjudy/src/JudyL/JudyLPrev.c | 1890 --- libjudy/src/JudyL/JudyLPrevEmpty.c | 1390 -- libjudy/src/JudyL/JudyLTablesGen.c | 296 - libjudy/src/JudyL/Makefile.in | 91 - libjudy/src/JudyL/README | 8 - libjudy/src/JudyL/j__udyLGet.c | 1094 -- libjudy/src/JudySL/JudySL.c | 1127 -- libjudy/src/JudySL/Makefile.in | 58 - libjudy/src/JudySL/README | 6 - libjudy/src/Makefile.in | 18 - libjudy/src/README | 20 - libjudy/src/apps/README | 21 - libjudy/src/apps/demo/JudySort.c | 34 - libjudy/src/apps/demo/Makefile_deliver | 52 - libjudy/src/apps/demo/README | 24 - libjudy/src/apps/demo/README_deliver | 17 - libjudy/src/apps/demo/funhist.c | 243 - libjudy/src/apps/demo/interL.c | 31 - libjudy/src/apps/demo/interSL.c | 135 - libjudy/src/apps/demo/run_demo | 64 - libjudy/src/build.bat | 185 - libjudy/src/sh_build | 206 - .../test/Centrino_1.3Mhz_Plots/Hash_CO.plot | 565 - .../test/Centrino_1.3Mhz_Plots/JLHash_CO.plot | 560 - .../test/Centrino_1.3Mhz_Plots/JudyHS_CO.plot | 563 - .../test/Centrino_1.3Mhz_Plots/JudySL_CO.plot | 567 - libjudy/test/CheckDupLines.c | 44 - libjudy/test/Checkit | 104 - libjudy/test/Judy1LCheck.c | 908 - libjudy/test/Judy1LHCheck.c | 1018 -- libjudy/test/Judy1LHTime.c | 2235 --- libjudy/test/Judy1LTime.c | 1620 -- libjudy/test/JudyString.c | 106 - libjudy/test/Makefile.am | 8 - libjudy/test/Makefile.in | 408 - libjudy/test/README | 22 - libjudy/test/SLcompare.c | 1079 -- libjudy/test/StringCompare.c | 2551 --- libjudy/test/jbgraph | 1022 -- libjudy/test/malloc-pre2.8a.c | 5387 ------ libjudy/test/simple.c | 24 - libjudy/test/testjbgraph | 22 - libjudy/test/timeit.c | 311 - libjudy/test/timeit.h | 221 - libjudy/tool/Makefile.am | 8 - libjudy/tool/Makefile.in | 439 - libjudy/tool/README | 134 - libjudy/tool/jhton.c | 1920 --- libjudy/tool/listJPtype.c | 239 - 164 files changed, 131573 deletions(-) delete mode 100644 libjudy/AUTHORS delete mode 100644 libjudy/COPYING delete mode 100644 libjudy/ChangeLog delete mode 100644 libjudy/INSTALL delete mode 100644 libjudy/Makefile.in delete mode 100644 libjudy/README delete mode 100644 libjudy/aclocal.m4 delete mode 100755 libjudy/bootstrap delete mode 100755 libjudy/compile delete mode 100755 libjudy/config.guess delete mode 100644 libjudy/config.h.in delete mode 100755 libjudy/config.sub delete mode 100755 libjudy/configure delete mode 100644 libjudy/configure.ac delete mode 100755 libjudy/depcomp delete mode 100644 libjudy/doc/Makefile.am delete mode 100644 libjudy/doc/Makefile.in delete mode 100644 libjudy/doc/ext/COPYRIGHT delete mode 100644 libjudy/doc/ext/Judy1_3.htm delete mode 100644 libjudy/doc/ext/Judy1_funcs_3.htm delete mode 100644 libjudy/doc/ext/JudyHS_3.htm delete mode 100644 libjudy/doc/ext/JudyHS_funcs_3.htm delete mode 100644 libjudy/doc/ext/JudyL_3.htm delete mode 100644 libjudy/doc/ext/JudyL_funcs_3.htm delete mode 100644 libjudy/doc/ext/JudySL_3.htm delete mode 100644 libjudy/doc/ext/JudySL_funcs_3.htm delete mode 100644 libjudy/doc/ext/Judy_3.htm delete mode 100644 libjudy/doc/ext/LICENSE delete mode 100644 libjudy/doc/ext/README delete mode 100644 libjudy/doc/ext/README_deliver delete mode 100644 libjudy/doc/int/10minutes.htm delete mode 100644 libjudy/examples/Judy1Dup.c delete mode 100644 libjudy/examples/Judy1Dup.h delete mode 100644 libjudy/examples/Judy1DupCheck.c delete mode 100644 libjudy/examples/Judy1Op.c delete mode 100644 libjudy/examples/Judy1Op.h delete mode 100644 libjudy/examples/Judy1OpCheck.c delete mode 100644 libjudy/examples/Makefile delete mode 100644 libjudy/examples/README delete mode 100755 libjudy/install-sh delete mode 100644 libjudy/ltmain.sh delete mode 100755 libjudy/missing delete mode 100644 libjudy/src/Judy.h delete mode 100644 libjudy/src/Judy.h.check.c delete mode 100644 libjudy/src/Judy1/Judy1.h delete mode 100644 libjudy/src/Judy1/Judy1ByCount.c delete mode 100644 libjudy/src/Judy1/Judy1Cascade.c delete mode 100644 libjudy/src/Judy1/Judy1Count.c delete mode 100644 libjudy/src/Judy1/Judy1CreateBranch.c delete mode 100644 libjudy/src/Judy1/Judy1Decascade.c delete mode 100644 libjudy/src/Judy1/Judy1First.c delete mode 100644 libjudy/src/Judy1/Judy1FreeArray.c delete mode 100644 libjudy/src/Judy1/Judy1InsertBranch.c delete mode 100644 libjudy/src/Judy1/Judy1MallocIF.c delete mode 100644 libjudy/src/Judy1/Judy1MemActive.c delete mode 100644 libjudy/src/Judy1/Judy1MemUsed.c delete mode 100644 libjudy/src/Judy1/Judy1Next.c delete mode 100644 libjudy/src/Judy1/Judy1NextEmpty.c delete mode 100644 libjudy/src/Judy1/Judy1Prev.c delete mode 100644 libjudy/src/Judy1/Judy1PrevEmpty.c delete mode 100644 libjudy/src/Judy1/Judy1Set.c delete mode 100644 libjudy/src/Judy1/Judy1SetArray.c delete mode 100644 libjudy/src/Judy1/Judy1TablesGen.c delete mode 100644 libjudy/src/Judy1/Judy1Test.c delete mode 100644 libjudy/src/Judy1/Judy1Unset.c delete mode 100644 libjudy/src/Judy1/Makefile.in delete mode 100644 libjudy/src/Judy1/README delete mode 100644 libjudy/src/Judy1/j__udy1Test.c delete mode 100644 libjudy/src/JudyCommon/JudyByCount.c delete mode 100644 libjudy/src/JudyCommon/JudyCascade.c delete mode 100644 libjudy/src/JudyCommon/JudyCount.c delete mode 100644 libjudy/src/JudyCommon/JudyCreateBranch.c delete mode 100644 libjudy/src/JudyCommon/JudyDecascade.c delete mode 100644 libjudy/src/JudyCommon/JudyDel.c delete mode 100644 libjudy/src/JudyCommon/JudyFirst.c delete mode 100644 libjudy/src/JudyCommon/JudyFreeArray.c delete mode 100644 libjudy/src/JudyCommon/JudyGet.c delete mode 100644 libjudy/src/JudyCommon/JudyIns.c delete mode 100644 libjudy/src/JudyCommon/JudyInsArray.c delete mode 100644 libjudy/src/JudyCommon/JudyInsertBranch.c delete mode 100644 libjudy/src/JudyCommon/JudyMalloc.c delete mode 100644 libjudy/src/JudyCommon/JudyMallocIF.c delete mode 100644 libjudy/src/JudyCommon/JudyMemActive.c delete mode 100644 libjudy/src/JudyCommon/JudyMemUsed.c delete mode 100644 libjudy/src/JudyCommon/JudyPrevNext.c delete mode 100644 libjudy/src/JudyCommon/JudyPrevNextEmpty.c delete mode 100644 libjudy/src/JudyCommon/JudyPrintJP.c delete mode 100644 libjudy/src/JudyCommon/JudyPrivate.h delete mode 100644 libjudy/src/JudyCommon/JudyPrivate1L.h delete mode 100644 libjudy/src/JudyCommon/JudyPrivateBranch.h delete mode 100644 libjudy/src/JudyCommon/JudyTables.c delete mode 100644 libjudy/src/JudyCommon/Makefile.in delete mode 100644 libjudy/src/JudyCommon/README delete mode 100644 libjudy/src/JudyHS/JudyHS.c delete mode 100644 libjudy/src/JudyHS/JudyHS.h delete mode 100644 libjudy/src/JudyHS/Makefile.in delete mode 100644 libjudy/src/JudyHS/README delete mode 100644 libjudy/src/JudyL/JudyL.h delete mode 100644 libjudy/src/JudyL/JudyLByCount.c delete mode 100644 libjudy/src/JudyL/JudyLCascade.c delete mode 100644 libjudy/src/JudyL/JudyLCount.c delete mode 100644 libjudy/src/JudyL/JudyLCreateBranch.c delete mode 100644 libjudy/src/JudyL/JudyLDecascade.c delete mode 100644 libjudy/src/JudyL/JudyLDel.c delete mode 100644 libjudy/src/JudyL/JudyLFirst.c delete mode 100644 libjudy/src/JudyL/JudyLFreeArray.c delete mode 100644 libjudy/src/JudyL/JudyLGet.c delete mode 100644 libjudy/src/JudyL/JudyLIns.c delete mode 100644 libjudy/src/JudyL/JudyLInsArray.c delete mode 100644 libjudy/src/JudyL/JudyLInsertBranch.c delete mode 100644 libjudy/src/JudyL/JudyLMallocIF.c delete mode 100644 libjudy/src/JudyL/JudyLMemActive.c delete mode 100644 libjudy/src/JudyL/JudyLMemUsed.c delete mode 100644 libjudy/src/JudyL/JudyLNext.c delete mode 100644 libjudy/src/JudyL/JudyLNextEmpty.c delete mode 100644 libjudy/src/JudyL/JudyLPrev.c delete mode 100644 libjudy/src/JudyL/JudyLPrevEmpty.c delete mode 100644 libjudy/src/JudyL/JudyLTablesGen.c delete mode 100644 libjudy/src/JudyL/Makefile.in delete mode 100644 libjudy/src/JudyL/README delete mode 100644 libjudy/src/JudyL/j__udyLGet.c delete mode 100644 libjudy/src/JudySL/JudySL.c delete mode 100644 libjudy/src/JudySL/Makefile.in delete mode 100644 libjudy/src/JudySL/README delete mode 100644 libjudy/src/Makefile.in delete mode 100644 libjudy/src/README delete mode 100644 libjudy/src/apps/README delete mode 100644 libjudy/src/apps/demo/JudySort.c delete mode 100644 libjudy/src/apps/demo/Makefile_deliver delete mode 100644 libjudy/src/apps/demo/README delete mode 100644 libjudy/src/apps/demo/README_deliver delete mode 100644 libjudy/src/apps/demo/funhist.c delete mode 100644 libjudy/src/apps/demo/interL.c delete mode 100644 libjudy/src/apps/demo/interSL.c delete mode 100755 libjudy/src/apps/demo/run_demo delete mode 100755 libjudy/src/build.bat delete mode 100755 libjudy/src/sh_build delete mode 100644 libjudy/test/Centrino_1.3Mhz_Plots/Hash_CO.plot delete mode 100644 libjudy/test/Centrino_1.3Mhz_Plots/JLHash_CO.plot delete mode 100644 libjudy/test/Centrino_1.3Mhz_Plots/JudyHS_CO.plot delete mode 100644 libjudy/test/Centrino_1.3Mhz_Plots/JudySL_CO.plot delete mode 100644 libjudy/test/CheckDupLines.c delete mode 100755 libjudy/test/Checkit delete mode 100644 libjudy/test/Judy1LCheck.c delete mode 100644 libjudy/test/Judy1LHCheck.c delete mode 100644 libjudy/test/Judy1LHTime.c delete mode 100644 libjudy/test/Judy1LTime.c delete mode 100644 libjudy/test/JudyString.c delete mode 100644 libjudy/test/Makefile.am delete mode 100644 libjudy/test/Makefile.in delete mode 100644 libjudy/test/README delete mode 100644 libjudy/test/SLcompare.c delete mode 100644 libjudy/test/StringCompare.c delete mode 100755 libjudy/test/jbgraph delete mode 100644 libjudy/test/malloc-pre2.8a.c delete mode 100644 libjudy/test/simple.c delete mode 100755 libjudy/test/testjbgraph delete mode 100644 libjudy/test/timeit.c delete mode 100644 libjudy/test/timeit.h delete mode 100644 libjudy/tool/Makefile.am delete mode 100644 libjudy/tool/Makefile.in delete mode 100644 libjudy/tool/README delete mode 100644 libjudy/tool/jhton.c delete mode 100644 libjudy/tool/listJPtype.c diff --git a/libjudy/AUTHORS b/libjudy/AUTHORS deleted file mode 100644 index 411e61edc9..0000000000 --- a/libjudy/AUTHORS +++ /dev/null @@ -1,8 +0,0 @@ -Doug Baskinks - Owner and Main Author - -Contributors: - - Troy Heber: - Repackaging - Project Administration diff --git a/libjudy/COPYING b/libjudy/COPYING deleted file mode 100644 index 74da134b55..0000000000 --- a/libjudy/COPYING +++ /dev/null @@ -1,516 +0,0 @@ -Judy - C library functions for creating and accessing dynamic arrays -Copyright (C) 2004 Doug Baskins - -This library is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as -published by the Free Software Foundation; either version 2.1 of the -License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - - - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -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 and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, 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 library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete 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 distribute a copy of this License along with the -Library. - - 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 Library or any portion -of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -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 Library, 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 Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you 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. - - If distribution of 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 satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be 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. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library 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. - - 9. 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 Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -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 with -this License. - - 11. 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 Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library 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 Library. - -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. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library 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. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser 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 Library -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 Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -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 - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "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 -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. 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 LIBRARY 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 -LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. 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 library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/libjudy/ChangeLog b/libjudy/ChangeLog deleted file mode 100644 index 704735eebd..0000000000 --- a/libjudy/ChangeLog +++ /dev/null @@ -1,60 +0,0 @@ -1.0.5 Version (May 2007) by (twh) -o added proper clean targets to enable multiple builds -o added examples directory -o Correctly Detects 32/64-bit build environment -o Allow explicit configure for 32/64-bit environment - -1.0.4 Version (May 2007) by (twh) -o fixed the Checkit problem "error Judy1PrevEmpty Rcode != 1 = 0" -o Fixed memory allignment in JudyMallocIF.c (doug) -o Fixed messages from "make check" (doug). - -1.0.3 Version (Feb 2006 ) by (twh) -o fixed make files to break out each copy element -to be a unique target, this also seems to have -resolved the issue where running make check rebuilds -the entire library again. - -1.0.2 Version (Jan 2006 ) by (twh) - -o fixed assumption of signed char in test programs. -o updated sh_build -o fixed generation of man pages from html -o fixed 32-bit and 64-bit configure - -1.0.1 Version (Dec 2004) by (twh) - -o fixed bootstrap to use later versions -o fixed manpage naming from (3X) to (3) -o Code changes to support Microsoft __inline directive -o Move away from using symlinks to using copies -o Added build.bat to support building on Windows - -1.0.0 Version (Sept 2004) by (twh) - -o Complete Autoconfisication of Judy -o Removed previous build environment -o Change INSTALL_IT back to INSTALL -o Moving to 1.0.0 to denote API change. - - -0.1.6 Version (1June2004) by (dlb) - -o See src/sh_build in case of 'make' failures -o The is an endian-neutral version I.E. (jp_DcdPop0 deleted) -o Should not require any special platform specific compile flags -o Includes JudyHS*() -- very fast, scalable string version -o JudyHS*() is still preliminary and may need additional functionality. -o See test/manual/StringCompare.c for comparing different 'string' ADT's -o Deleted files: JudyMalloc.h, JudySL.h, JudySearch* -o All malloc() and free() is done thru interface routines in JudyMalloc.c -o Judy.h should work on all platforms that conform to ISO standards. -o After trying on many platforms, was changed to -o jbgraph has some 'bash/ksh' isms that need to be removed. -o See test/manual/testjbgraph for plotting performance graphs -o 'libtools' stuff is in unknown shape. -o Does not "mangle" the root pointer (so old valgrind is not confused) -o Conform to standard "C" -o Change INSTALL to INSTALL_IT because it confused "make install" -o To he man pages need work to clean up the .html to be portable -o Plus hundreds of changes to make the source more portable. diff --git a/libjudy/INSTALL b/libjudy/INSTALL deleted file mode 100644 index 3f40daacfe..0000000000 --- a/libjudy/INSTALL +++ /dev/null @@ -1,20 +0,0 @@ -=== QUICK INSTALLATION OF JUDY LIBRARY AND MANUAL ENTRIES === - -1. ./configure #NOTE: you must do configure with either - --enable-32-bit or --enable-64-bit - depending on your system. Also note if you - are doing a non-native compile you are - responsiable for setting the appropriate - CFLAGS. See README for more information. -2. make -3. make check -4. make install # NOTE: must be SUPERUSER for make install - # This installs /opt/Judy/* and symlinks to - # files there from /usr/include/, /usr/lib/, - # /usr/share/man/, and /usr/share/doc/Judy/. - -(Installation done! The rest is optional but recommended.) - -5) man Judy # nroff -man version, or... - -6) file:/opt/Judy/usr/share/doc/Judy/Judy_3x.htm # from LOCAL Web browser. diff --git a/libjudy/Makefile.in b/libjudy/Makefile.in deleted file mode 100644 index d5654edd16..0000000000 --- a/libjudy/Makefile.in +++ /dev/null @@ -1,16 +0,0 @@ -MAKE = @MAKE@ - -default: - cd src; $(MAKE) - -clean: - cd src; $(MAKE) clean - -install: - cp src/libjudy.a ../lib - cp src/Judy.h ../include -distclean: clean - rm -fr config.h libtool make.log stamp-h1 src/obj src/Judy1/Judy1TablesGen src/JudyL/JudyLTablesGen - -.PHONY: install - diff --git a/libjudy/README b/libjudy/README deleted file mode 100644 index cee3526efb..0000000000 --- a/libjudy/README +++ /dev/null @@ -1,149 +0,0 @@ - - Judy - C library creating and accessing dynamic arrays - ============================================================== - -Content ---------- - - 1. Introduction - 2. Directory Contents - 3. How to install - 4. License - 5. Change History - 6. Reporting Bugs - 7. Known Issues - - -1. INTRODUCTION ------------------ - -This tree contains sources, documents, tests, and tools for the Judy package. -This file is in a form that can be validated using the tool/readme script. - -NOTE: The README files here describe some files that are not included in -every Judy source package. - -WHAT IS JUDY? (see below for list of top-level directories and files) - -Judy is a C library that implements a dynamic array. Empty Judy arrays are -declared with null pointers. A Judy array consumes memory only when -populated yet can grow to take advantage of all available memory. Judy's key -benefits are: scalability, performance, memory efficiency, and ease of use. -Judy arrays are designed to grow without tuning into the peta-element range, -scaling near O(log-base-256) -- 1 more RAM access at 256 X population. - -Judy arrays are accessed with insert, retrieve, and delete calls for number -or string indexes. Configuration and tuning are not required -- in fact not -possible. Judy offers sorting, counting, and neighbor/empty searching. -Indexes can be sequential, clustered, periodic, or random -- it doesn't -matter to the algorithm. Judy arrays can be arranged hierarchically to -handle any bit patterns -- large indexes, sets of keys, etc. - -Judy is often an improvement over common data structures such as: arrays, -sparse arrays, hash tables, B-trees, binary trees, linear lists, skiplists, -other sort and search algorithms, and counting functions. - - -2. JUDY TOP DIRECTORY CONTENTS: --------------------------------- - -AUTHORS Judy authors and contributors -README This file. -INSTALL Summary instructions to build, check and install Judy. -COPYING Judy deliverable license notice (the LGPL). -ChangeLog List of changes per version of Judy. - -configure Autoconf configure script to allow a portable build e - environment. - -src/ Header and source files used to build the package. -doc/ Documents, both external (to the package) and internal. -test/ Test support and some timing programs. -tool/ Primitive tool (jhton) to convert *.html files to "man" pages. - and build tables used by Judy to malloc() sizes of memory. - -3. HOW TO INSTALL ------------------ - -For a quick description see the INSTALL file. - -Judy is now based on the GNU Auto tools. This means that you can do the standard -configure, make, make check and make install and everything should work, with -one minor difference and a little caveat. - -Judy is capable of being built as a 32-bit or a 64-bit library. Configure -will test to detect the native environment and default to that. Therefor if you -explicitly want to to compile for the non-native environment you need to tell -Judy what you want. You can run ./configure with one of the following flags: - - --enable-32-bit - --enable-64-bit - -The caveat comes in on machines that support both at 32-bit and 64-bit runtime -environments such as RISC platforms and x86-64. In this case your compiler will -either use 32-bit or 64-bit as default. If you plan to use the default you can -follow the above instructions and be finished. - -However, if you wish to compile for the non-default target type. YOU ARE -RESPONSIBLE FOR SETTING THE CORRECT FLAGS! Such as CFLAGS to make your compiler -switch modes LDFLAGS to make your linker behave, etc. - -For example: On HP-UX PA-RISC the compiler generates 32-bit code by default. If -I wish to stick with the defaults I can simply build Judy by: - ./configure - make - make check - make install - -If I want to build Judy as a 64-bit library on HP-UX PA-RISC I have to do: - CFLAGS=+DD64 ./configure --enable-64-bit - make - make check - make install - -If I want to build Judy native (64-bit) on Linux AMD64 I have to do: - ./configure - make - make check - make install - -If I want to build Judy 32-bit on Linux AMD64 I have to do: - ./configure --enable-32-bit - make - make check - make install - -4. LICENSE ----------- - -The user library is licensed under the GNU Lesser Public License (LGPL) -Version 2.1, February 1999. The full text of the LGPL is located at: - -COPYING - - -5. CHAGE HISTORY ----------------- - -See the ChangeLog file. - -6. REPORTING BUGS ------------------ - -If you encounter a bug, please submit it to the project bug list, -located on the project page: - - https://sourceforge.net/projects/judy/ - -7. KNOWN ISSUES ---------------- - -When compiling on HP-UX, you may get a message like: - error 1000: Unexpected symbol: - -This is a problem with the HP's compiler in that it doesn't like a typedef'ed -type following a static inline. - -You can work around it by running this command from the Judy directory. - -find ./ -name \*.[ch] | xargs perl -i.BAK -pe 's/static inline/static/g' diff --git a/libjudy/aclocal.m4 b/libjudy/aclocal.m4 deleted file mode 100644 index 6b646a1890..0000000000 --- a/libjudy/aclocal.m4 +++ /dev/null @@ -1,8823 +0,0 @@ -# generated automatically by aclocal 1.10.1 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(AC_AUTOCONF_VERSION, [2.61],, -[m4_warning([this file was generated for autoconf 2.61. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) - -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -]) - -# serial 56 LT_INIT - - -# LT_PREREQ(VERSION) -# ------------------ -# Complain and exit if this libtool version is less that VERSION. -m4_defun([LT_PREREQ], -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, - [m4_default([$3], - [m4_fatal([Libtool version $1 or higher is required], - 63)])], - [$2])]) - - -# _LT_CHECK_BUILDDIR -# ------------------ -# Complain if the absolute build directory name contains unusual characters -m4_defun([_LT_CHECK_BUILDDIR], -[case `pwd` in - *\ * | *\ *) - AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; -esac -]) - - -# LT_INIT([OPTIONS]) -# ------------------ -AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT -AC_BEFORE([$0], [LT_LANG])dnl -AC_BEFORE([$0], [LT_OUTPUT])dnl -AC_BEFORE([$0], [LTDL_INIT])dnl -m4_require([_LT_CHECK_BUILDDIR])dnl - -dnl Autoconf doesn't catch unexpanded LT_ macros by default: -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 -dnl unless we require an AC_DEFUNed macro: -AC_REQUIRE([LTOPTIONS_VERSION])dnl -AC_REQUIRE([LTSUGAR_VERSION])dnl -AC_REQUIRE([LTVERSION_VERSION])dnl -AC_REQUIRE([LTOBSOLETE_VERSION])dnl -m4_require([_LT_PROG_LTMAIN])dnl - -dnl Parse OPTIONS -_LT_SET_OPTIONS([$0], [$1]) - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -_LT_SETUP - -# Only expand once: -m4_define([LT_INIT]) -])# LT_INIT - -# Old names: -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PROG_LIBTOOL], []) -dnl AC_DEFUN([AM_PROG_LIBTOOL], []) - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_FILEUTILS_DEFAULTS -# ---------------------- -# It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. -m4_defun([_LT_FILEUTILS_DEFAULTS], -[: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -])# _LT_FILEUTILS_DEFAULTS - - -# _LT_SETUP -# --------- -m4_defun([_LT_SETUP], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -_LT_DECL([], [host_alias], [0], [The host system])dnl -_LT_DECL([], [host], [0])dnl -_LT_DECL([], [host_os], [0])dnl -dnl -_LT_DECL([], [build_alias], [0], [The build system])dnl -_LT_DECL([], [build], [0])dnl -_LT_DECL([], [build_os], [0])dnl -dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -test -z "$LN_S" && LN_S="ln -s" -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl -dnl -AC_REQUIRE([LT_CMD_MAX_LEN])dnl -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl -dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_CMD_RELOAD])dnl -m4_require([_LT_CHECK_MAGIC_METHOD])dnl -m4_require([_LT_CMD_OLD_ARCHIVE])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl - -_LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi -]) -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -_LT_CHECK_OBJDIR - -m4_require([_LT_TAG_COMPILER])dnl -_LT_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - _LT_PATH_MAGIC - fi - ;; -esac - -# Use C for the default configuration in the libtool script -LT_SUPPORTED_TAG([CC]) -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_LT_CONFIG_COMMANDS -])# _LT_SETUP - - -# _LT_PROG_LTMAIN -# --------------- -# Note that this code is called both from `configure', and `config.status' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -m4_defun([_LT_PROG_LTMAIN], -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" -])# _LT_PROG_LTMAIN - - - -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' -# label. - - -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) - - -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# ----------------------------------------------------- -m4_defun([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) - - -# _LT_FORMAT_COMMENT([COMMENT]) -# ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) - - -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) -# --------------------------------------------------------- -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) - - -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# -------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_dquote_varnames], -[_lt_decl_filter([value], [2], $@)]) - - -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_varnames_tagged], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_quote(m4_if([$2], [], - m4_quote(lt_decl_tag_varnames), - m4_quote(m4_shift($@)))), - m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) -m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) - - -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_all_varnames], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_if([$2], [], - m4_quote(lt_decl_varnames), - m4_quote(m4_shift($@))))[]dnl -]) -m4_define([_lt_decl_all_varnames], -[lt_join($@, lt_decl_varnames_tagged([$1], - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl -]) - - -# _LT_CONFIG_STATUS_DECLARE([VARNAME]) -# ------------------------------------ -# Quote a variable value, and forward it to `config.status' so that its -# declaration there will have the same value as in `configure'. VARNAME -# must have a single quote delimited value for this to work. -m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) - - -# _LT_CONFIG_STATUS_DECLARATIONS -# ------------------------------ -# We delimit libtool config variables with single quotes, so when -# we write them to config.status, we have to be sure to quote all -# embedded single quotes properly. In configure, this macro expands -# each variable declared with _LT_DECL (and _LT_TAGDECL) into: -# -# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), - [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAGS -# ---------------- -# Output comment and list of tags supported by the script -m4_defun([_LT_LIBTOOL_TAGS], -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags="_LT_TAGS"dnl -]) - - -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) -# ----------------------------------- -# Extract the dictionary values for VARNAME (optionally with TAG) and -# expand to a commented shell variable setting: -# -# # Some comment about what VAR is for. -# visible_name=$lt_internal_name -m4_define([_LT_LIBTOOL_DECLARE], -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], - [description])))[]dnl -m4_pushdef([_libtool_name], - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), - [0], [_libtool_name=[$]$1], - [1], [_libtool_name=$lt_[]$1], - [2], [_libtool_name=$lt_[]$1], - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl -]) - - -# _LT_LIBTOOL_CONFIG_VARS -# ----------------------- -# Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG -# section) are produced by _LT_LIBTOOL_TAG_VARS. -m4_defun([_LT_LIBTOOL_CONFIG_VARS], -[m4_foreach([_lt_var], - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAG_VARS(TAG) -# ------------------------- -m4_define([_LT_LIBTOOL_TAG_VARS], -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) - - -# _LT_TAGVAR(VARNAME, [TAGNAME]) -# ------------------------------ -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) - - -# _LT_CONFIG_COMMANDS -# ------------------- -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of -# variables for single and double quote escaping we saved from calls -# to _LT_DECL, we can put quote escaped variables declarations -# into `config.status', and then the shell code to quote escape them in -# for loops in `config.status'. Finally, any additional code accumulated -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. -m4_defun([_LT_CONFIG_COMMANDS], -[AC_PROVIDE_IFELSE([LT_OUTPUT], - dnl If the libtool generation code has been placed in $CONFIG_LT, - dnl instead of duplicating it all over again into config.status, - dnl then we will have config.status run $CONFIG_LT later, so it - dnl needs to know what name is stored there: - [AC_CONFIG_COMMANDS([libtool], - [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], - dnl If the libtool generation code is destined for config.status, - dnl expand the accumulated commands and init code now: - [AC_CONFIG_COMMANDS([libtool], - [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) -])#_LT_CONFIG_COMMANDS - - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], -[ - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -_LT_CONFIG_STATUS_DECLARATIONS -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# Quote evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\[$]0 --fallback-echo"')dnl " - lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` - ;; -esac - -_LT_OUTPUT_LIBTOOL_INIT -]) - - -# LT_OUTPUT -# --------- -# This macro allows early generation of the libtool script (before -# AC_OUTPUT is called), incase it is used in configure for compilation -# tests. -AC_DEFUN([LT_OUTPUT], -[: ${CONFIG_LT=./config.lt} -AC_MSG_NOTICE([creating $CONFIG_LT]) -cat >"$CONFIG_LT" <<_LTEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate a libtool stub with the current configuration. - -lt_cl_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AS_SHELL_SANITIZE -_AS_PREPARE - -exec AS_MESSAGE_FD>&1 -exec AS_MESSAGE_LOG_FD>>config.log -{ - echo - AS_BOX([Running $as_me.]) -} >&AS_MESSAGE_LOG_FD - -lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. - -Usage: $[0] [[OPTIONS]] - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - -Report bugs to ." - -lt_cl_version="\ -m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl -m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) -configured by $[0], generated by m4_PACKAGE_STRING. - -Copyright (C) 2008 Free Software Foundation, Inc. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." - -while test $[#] != 0 -do - case $[1] in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; - - -*) AC_MSG_ERROR([unrecognized option: $[1] -Try \`$[0] --help' for more information.]) ;; - - *) AC_MSG_ERROR([unrecognized argument: $[1] -Try \`$[0] --help' for more information.]) ;; - esac - shift -done - -if $lt_cl_silent; then - exec AS_MESSAGE_FD>/dev/null -fi -_LTEOF - -cat >>"$CONFIG_LT" <<_LTEOF -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AC_MSG_NOTICE([creating $ofile]) -_LT_OUTPUT_LIBTOOL_COMMANDS -AS_EXIT(0) -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# appending to config.log, which fails on DOS, as config.log is still kept -# open by configure. Here we exec the FD to /dev/null, effectively closing -# config.log, so it can be properly (re)opened and appended to by config.lt. -if test "$no_create" != yes; then - lt_cl_success=: - test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" - exec AS_MESSAGE_LOG_FD>/dev/null - $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false - exec AS_MESSAGE_LOG_FD>>config.log - $lt_cl_success || AS_EXIT(1) -fi -])# LT_OUTPUT - - -# _LT_CONFIG(TAG) -# --------------- -# If TAG is the built-in tag, create an initial libtool script with a -# default configuration from the untagged config vars. Otherwise add code -# to config.status for appending the configuration named by TAG from the -# matching tagged config vars. -m4_defun([_LT_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_CONFIG_SAVE_COMMANDS([ - m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl - m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -_LT_COPYING -_LT_LIBTOOL_TAGS - -# ### BEGIN LIBTOOL CONFIG -_LT_LIBTOOL_CONFIG_VARS -_LT_LIBTOOL_TAG_VARS -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - _LT_PROG_LTMAIN - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - _LT_PROG_XSI_SHELLFNS - - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -], -[cat <<_LT_EOF >> "$ofile" - -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded -dnl in a comment (ie after a #). -# ### BEGIN LIBTOOL TAG CONFIG: $1 -_LT_LIBTOOL_TAG_VARS(_LT_TAG) -# ### END LIBTOOL TAG CONFIG: $1 -_LT_EOF -])dnl /m4_if -], -[m4_if([$1], [], [ - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile'], []) -])dnl /_LT_CONFIG_SAVE_COMMANDS -])# _LT_CONFIG - - -# LT_SUPPORTED_TAG(TAG) -# --------------------- -# Trace this macro to discover what tags are supported by the libtool -# --tag option, using: -# autoconf --trace 'LT_SUPPORTED_TAG:$1' -AC_DEFUN([LT_SUPPORTED_TAG], []) - - -# C support is built-in for now -m4_define([_LT_LANG_C_enabled], []) -m4_define([_LT_TAGS], []) - - -# LT_LANG(LANG) -# ------------- -# Enable libtool support for the given language if not already enabled. -AC_DEFUN([LT_LANG], -[AC_BEFORE([$0], [LT_OUTPUT])dnl -m4_case([$1], - [C], [_LT_LANG(C)], - [C++], [_LT_LANG(CXX)], - [Java], [_LT_LANG(GCJ)], - [Fortran 77], [_LT_LANG(F77)], - [Fortran], [_LT_LANG(FC)], - [Windows Resource], [_LT_LANG(RC)], - [m4_ifdef([_LT_LANG_]$1[_CONFIG], - [_LT_LANG($1)], - [m4_fatal([$0: unsupported language: "$1"])])])dnl -])# LT_LANG - - -# _LT_LANG(LANGNAME) -# ------------------ -m4_defun([_LT_LANG], -[m4_ifdef([_LT_LANG_]$1[_enabled], [], - [LT_SUPPORTED_TAG([$1])dnl - m4_append([_LT_TAGS], [$1 ])dnl - m4_define([_LT_LANG_]$1[_enabled], [])dnl - _LT_LANG_$1_CONFIG($1)])dnl -])# _LT_LANG - - -# _LT_LANG_DEFAULT_CONFIG -# ----------------------- -m4_defun([_LT_LANG_DEFAULT_CONFIG], -[AC_PROVIDE_IFELSE([AC_PROG_CXX], - [LT_LANG(CXX)], - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) - -AC_PROVIDE_IFELSE([AC_PROG_F77], - [LT_LANG(F77)], - [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) - -AC_PROVIDE_IFELSE([AC_PROG_FC], - [LT_LANG(FC)], - [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) - -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal -dnl pulling things in needlessly. -AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([LT_PROG_GCJ], - [LT_LANG(GCJ)], - [m4_ifdef([AC_PROG_GCJ], - [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([A][M_PROG_GCJ], - [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([LT_PROG_GCJ], - [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) - -AC_PROVIDE_IFELSE([LT_PROG_RC], - [LT_LANG(RC)], - [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) -])# _LT_LANG_DEFAULT_CONFIG - -# Obsolete macros: -AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) -AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) -AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) -AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_CXX], []) -dnl AC_DEFUN([AC_LIBTOOL_F77], []) -dnl AC_DEFUN([AC_LIBTOOL_FC], []) -dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) - - -# _LT_TAG_COMPILER -# ---------------- -m4_defun([_LT_TAG_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_TAG_COMPILER - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -m4_defun([_LT_COMPILER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -m4_defun([_LT_LINKER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* -])# _LT_LINKER_BOILERPLATE - -# _LT_REQUIRED_DARWIN_CHECKS -# ------------------------- -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - AC_CHECK_TOOL([LIPO], [lipo], [:]) - AC_CHECK_TOOL([OTOOL], [otool], [:]) - AC_CHECK_TOOL([OTOOL64], [otool64], [:]) - _LT_DECL([], [DSYMUTIL], [1], - [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) - _LT_DECL([], [NMEDIT], [1], - [Tool to change global to local symbols on Mac OS X]) - _LT_DECL([], [LIPO], [1], - [Tool to manipulate fat objects and archives on Mac OS X]) - _LT_DECL([], [OTOOL], [1], - [ldd/readelf like tool for Mach-O binaries on Mac OS X]) - _LT_DECL([], [OTOOL64], [1], - [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi]) - AC_CACHE_CHECK([for -exported_symbols_list linker flag], - [lt_cv_ld_exported_symbols_list], - [lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [lt_cv_ld_exported_symbols_list=yes], - [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS="$save_LDFLAGS" - ]) - case $host_os in - rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac -]) - - -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- -# Checks for linker and compiler features on darwin -m4_defun([_LT_DARWIN_LINKER_FEATURES], -[ - m4_require([_LT_REQUIRED_DARWIN_CHECKS]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_automatic, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" - if test "$GCC" = "yes"; then - output_verbose_link_cmd=echo - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - m4_if([$1], [CXX], -[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" - fi -],[]) - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi -]) - -# _LT_SYS_MODULE_PATH_AIX -# ----------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -m4_defun([_LT_SYS_MODULE_PATH_AIX], -[m4_require([_LT_DECL_SED])dnl -AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_SYS_MODULE_PATH_AIX - - -# _LT_SHELL_INIT(ARG) -# ------------------- -m4_define([_LT_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_SHELL_INIT - - -# _LT_PROG_ECHO_BACKSLASH -# ----------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -m4_defun([_LT_PROG_ECHO_BACKSLASH], -[_LT_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -[$]* -_LT_EOF - exit 0 -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(lt_ECHO) -]) -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], - [An echo program that does not interpret backslashes]) -])# _LT_PROG_ECHO_BACKSLASH - - -# _LT_ENABLE_LOCK -# --------------- -m4_defun([_LT_ENABLE_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AS_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks="$enable_libtool_lock" -])# _LT_ENABLE_LOCK - - -# _LT_CMD_OLD_ARCHIVE -# ------------------- -m4_defun([_LT_CMD_OLD_ARCHIVE], -[AC_CHECK_TOOL(AR, ar, false) -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1]) - -AC_CHECK_TOOL(STRIP, strip, :) -test -z "$STRIP" && STRIP=: -_LT_DECL([], [STRIP], [1], [A symbol stripping program]) - -AC_CHECK_TOOL(RANLIB, ranlib, :) -test -z "$RANLIB" && RANLIB=: -_LT_DECL([], [RANLIB], [1], - [Commands used to install an old-style archive]) - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi -_LT_DECL([], [old_postinstall_cmds], [2]) -_LT_DECL([], [old_postuninstall_cmds], [2]) -_LT_TAGDECL([], [old_archive_cmds], [2], - [Commands used to build an old-style archive]) -])# _LT_CMD_OLD_ARCHIVE - - -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([_LT_COMPILER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $RM conftest* -]) - -if test x"[$]$2" = xyes; then - m4_if([$5], , :, [$5]) -else - m4_if([$6], , :, [$6]) -fi -])# _LT_COMPILER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) - - -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------- -# Check whether the given linker option works -AC_DEFUN([_LT_LINKER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - m4_if([$4], , :, [$4]) -else - m4_if([$5], , :, [$5]) -fi -])# _LT_LINKER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) - - -# LT_CMD_MAX_LEN -#--------------- -AC_DEFUN([LT_CMD_MAX_LEN], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -max_cmd_len=$lt_cv_sys_max_cmd_len -_LT_DECL([], [max_cmd_len], [0], - [What is the maximum length of a command?]) -])# LT_CMD_MAX_LEN - -# Old name: -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) - - -# _LT_HEADER_DLFCN -# ---------------- -m4_defun([_LT_HEADER_DLFCN], -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl -])# _LT_HEADER_DLFCN - - -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ---------------------------------------------------------------- -m4_defun([_LT_TRY_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -[#line __oline__ "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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -}] -_LT_EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_TRY_DLOPEN_SELF - - -# LT_SYS_DLOPEN_SELF -# ------------------ -AC_DEFUN([LT_SYS_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -_LT_DECL([dlopen_support], [enable_dlopen], [0], - [Whether dlopen is supported]) -_LT_DECL([dlopen_self], [enable_dlopen_self], [0], - [Whether dlopen of programs is supported]) -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], - [Whether dlopen of statically linked programs is supported]) -])# LT_SYS_DLOPEN_SELF - -# Old name: -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) - - -# _LT_COMPILER_C_O([TAGNAME]) -# --------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler. -# This macro does not hard code the compiler like AC_PROG_CC_C_O. -m4_defun([_LT_COMPILER_C_O], -[m4_require([_LT_DECL_SED])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* -]) -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], - [Does compiler simultaneously support -c and -o options?]) -])# _LT_COMPILER_C_O - - -# _LT_COMPILER_FILE_LOCKS([TAGNAME]) -# ---------------------------------- -# Check to see if we can do hard links to lock some files if needed -m4_defun([_LT_COMPILER_FILE_LOCKS], -[m4_require([_LT_ENABLE_LOCK])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_COMPILER_C_O([$1]) - -hard_links="nottested" -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) -])# _LT_COMPILER_FILE_LOCKS - - -# _LT_CHECK_OBJDIR -# ---------------- -m4_defun([_LT_CHECK_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -_LT_DECL([], [objdir], [0], - [The name of the directory that contains temporary libtool files])dnl -m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", - [Define to the sub-directory in which libtool stores uninstalled libraries.]) -])# _LT_CHECK_OBJDIR - - -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) -# -------------------------------------- -# Check hardcoding attributes. -m4_defun([_LT_LINKER_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || - test -n "$_LT_TAGVAR(runpath_var, $1)" || - test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || - test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -_LT_TAGDECL([], [hardcode_action], [0], - [How to hardcode a shared library path into an executable]) -])# _LT_LINKER_HARDCODE_LIBPATH - - -# _LT_CMD_STRIPLIB -# ---------------- -m4_defun([_LT_CMD_STRIPLIB], -[m4_require([_LT_DECL_EGREP]) -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) -_LT_DECL([], [striplib], [1]) -])# _LT_CMD_STRIPLIB - - -# _LT_SYS_DYNAMIC_LINKER([TAG]) -# ----------------------------- -# PORTME Fill in your ld.so characteristics -m4_defun([_LT_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_MSG_CHECKING([dynamic linker characteristics]) -m4_if([$1], - [], [ -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[[lt_foo]]++; } - if (lt_freq[[lt_foo]] == 1) { print lt_foo; } -}'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[[4-9]]*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[123]]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ - freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -interix[[3-9]]*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux - need_lib_prefix=no - need_version=no - library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - -_LT_DECL([], [variables_saved_for_relink], [1], - [Variables whose values should be saved in libtool wrapper scripts and - restored at link time]) -_LT_DECL([], [need_lib_prefix], [0], - [Do we need the "lib" prefix for modules?]) -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) -_LT_DECL([], [version_type], [0], [Library versioning type]) -_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) -_LT_DECL([], [shlibpath_overrides_runpath], [0], - [Is shlibpath searched before the hard-coded library search path?]) -_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) -_LT_DECL([], [library_names_spec], [1], - [[List of archive names. First name is the real one, the rest are links. - The last name is the one that the linker finds with -lNAME]]) -_LT_DECL([], [soname_spec], [1], - [[The coded name of the library, if different from the real name]]) -_LT_DECL([], [postinstall_cmds], [2], - [Command to use after installation of a shared archive]) -_LT_DECL([], [postuninstall_cmds], [2], - [Command to use after uninstallation of a shared archive]) -_LT_DECL([], [finish_cmds], [2], - [Commands used to finish a libtool library installation in a directory]) -_LT_DECL([], [finish_eval], [1], - [[As "finish_cmds", except a single script fragment to be evaled but - not shown]]) -_LT_DECL([], [hardcode_into_libs], [0], - [Whether we should hardcode library paths into libraries]) -_LT_DECL([], [sys_lib_search_path_spec], [2], - [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) -])# _LT_SYS_DYNAMIC_LINKER - - -# _LT_PATH_TOOL_PREFIX(TOOL) -# -------------------------- -# find a file program which can recognize shared library -AC_DEFUN([_LT_PATH_TOOL_PREFIX], -[m4_require([_LT_DECL_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="m4_if([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -_LT_DECL([], [MAGIC_CMD], [0], - [Used to examine libraries when file_magic_cmd begins with "file"])dnl -])# _LT_PATH_TOOL_PREFIX - -# Old name: -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) - - -# _LT_PATH_MAGIC -# -------------- -# find a file program which can recognize a shared library -m4_defun([_LT_PATH_MAGIC], -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# _LT_PATH_MAGIC - - -# LT_PATH_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([LT_PATH_LD], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl - -AC_ARG_WITH([gnu-ld], - [AS_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no])dnl - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[[3-9]]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -_LT_DECL([], [deplibs_check_method], [1], - [Method to check whether dependent libraries are shared objects]) -_LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method == "file_magic"]) -])# _LT_CHECK_MAGIC_METHOD - - -# LT_PATH_NM -# ---------- -# find the pathname to a BSD- or MS-compatible name lister -AC_DEFUN([LT_PATH_NM], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi]) -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) - AC_SUBST([DUMPBIN]) - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm -AC_SUBST([NM]) -_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl - -AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], - [lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) - cat conftest.out >&AS_MESSAGE_LOG_FD - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest*]) -])# LT_PATH_NM - -# Old names: -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_PROG_NM], []) -dnl AC_DEFUN([AC_PROG_NM], []) - - -# LT_LIB_M -# -------- -# check for math library -AC_DEFUN([LT_LIB_M], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -AC_SUBST([LIBM]) -])# LT_LIB_M - -# Old name: -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_CHECK_LIBM], []) - - -# _LT_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------- -m4_defun([_LT_COMPILER_NO_RTTI], -[m4_require([_LT_TAG_COMPILER])dnl - -_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], - [Compiler flag to turn off builtin functions]) -])# _LT_COMPILER_NO_RTTI - - -# _LT_CMD_GLOBAL_SYMBOLS -# ---------------------- -m4_defun([_LT_CMD_GLOBAL_SYMBOLS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_NM])dnl -AC_REQUIRE([LT_PATH_LD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_TAG_COMPILER])dnl - -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris*) - symcode='[[BDRT]]' - ;; -sco3.2v5*) - symcode='[[DT]]' - ;; -sysv4.2uw2*) - symcode='[[DT]]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[[ABDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK ['"\ -" {last_section=section; section=\$ 3};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx]" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if AC_TRY_EVAL(ac_compile); then - # Now try to grab the symbols. - nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[[]] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi - -_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], - [Take the output of nm and produce a listing of raw symbols and C names]) -_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], - [Transform the output of nm in a proper C declaration]) -_LT_DECL([global_symbol_to_c_name_address], - [lt_cv_sys_global_symbol_to_c_name_address], [1], - [Transform the output of nm in a C name address pair]) -_LT_DECL([global_symbol_to_c_name_address_lib_prefix], - [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], - [Transform the output of nm in a C name address pair when lib prefix is needed]) -]) # _LT_CMD_GLOBAL_SYMBOLS - - -# _LT_COMPILER_PIC([TAGNAME]) -# --------------------------- -m4_defun([_LT_COMPILER_PIC], -[m4_require([_LT_TAG_COMPILER])dnl -_LT_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) -m4_if([$1], [CXX], [ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix[[4-9]]*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc* | ecpc* ) - # Intel C++ - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - hpux9* | hpux10* | hpux11*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - esac - ;; - esac - ;; - - newsos6) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - rdos*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" - ;; -esac -AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], - [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], - [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], - [Additional compiler flags for building library objects]) - -# -# Check to make sure the static flag actually works. -# -wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" -_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], - [Compiler flag to prevent dynamic linking]) -])# _LT_COMPILER_PIC - - -# _LT_LINKER_SHLIBS([TAGNAME]) -# ---------------------------- -# See if the linker supports building shared libraries. -m4_defun([_LT_LINKER_SHLIBS], -[AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -m4_if([$1], [CXX], [ - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix[[4-9]]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - ;; - linux* | k*bsd*-gnu) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] -], [ - runpath_var= - _LT_TAGVAR(allow_undefined_flag, $1)= - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(archive_cmds, $1)= - _LT_TAGVAR(archive_expsym_cmds, $1)= - _LT_TAGVAR(compiler_needs_object, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(hardcode_automatic, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_TAGVAR(hardcode_libdir_separator, $1)= - _LT_TAGVAR(hardcode_minus_L, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(inherit_rpath, $1)=no - _LT_TAGVAR(link_all_deplibs, $1)=unknown - _LT_TAGVAR(module_cmds, $1)= - _LT_TAGVAR(module_expsym_cmds, $1)= - _LT_TAGVAR(old_archive_from_new_cmds, $1)= - _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_TAGVAR(thread_safe_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. -dnl Note also adjust exclude_expsyms for C++ above. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - _LT_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[[3-9]]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag= - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix[[4-9]]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - _LT_TAGVAR(link_all_deplibs, $1)=no - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - bsdi[[45]]*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE(int foo(void) {}, - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - ) - LDFLAGS="$save_LDFLAGS" - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - fi - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' - ;; - esac - fi - fi -]) -AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld - -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl -_LT_DECL([], [extract_expsyms_cmds], [2], - [The commands to extract the exported symbol list from a shared archive]) - -# -# Do we need to explicitly link libc? -# -case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac - -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], - [Whether or not to add -lc for building shared libraries]) -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], - [enable_shared_with_static_runtimes], [0], - [Whether or not to disallow shared libs when runtime libs are static]) -_LT_TAGDECL([], [export_dynamic_flag_spec], [1], - [Compiler flag to allow reflexive dlopens]) -_LT_TAGDECL([], [whole_archive_flag_spec], [1], - [Compiler flag to generate shared objects directly from archives]) -_LT_TAGDECL([], [compiler_needs_object], [1], - [Whether the compiler copes with passing no objects directly]) -_LT_TAGDECL([], [old_archive_from_new_cmds], [2], - [Create an old-style archive from a shared archive]) -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], - [Create a temporary old-style archive to link instead of a shared archive]) -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) -_LT_TAGDECL([], [archive_expsym_cmds], [2]) -_LT_TAGDECL([], [module_cmds], [2], - [Commands used to build a loadable module if different from building - a shared archive.]) -_LT_TAGDECL([], [module_expsym_cmds], [2]) -_LT_TAGDECL([], [with_gnu_ld], [1], - [Whether we are building with GNU ld or not]) -_LT_TAGDECL([], [allow_undefined_flag], [1], - [Flag that allows shared libraries with undefined symbols to be built]) -_LT_TAGDECL([], [no_undefined_flag], [1], - [Flag that enforces no undefined symbols]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], - [Flag to hardcode $libdir into a binary during linking. - This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) -_LT_TAGDECL([], [hardcode_libdir_separator], [1], - [Whether we need a single "-rpath" flag with a separated argument]) -_LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary]) -_LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting ${shlibpath_var} if the - library is relocated]) -_LT_TAGDECL([], [hardcode_minus_L], [0], - [Set to "yes" if using the -LDIR flag during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_shlibpath_var], [0], - [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_automatic], [0], - [Set to "yes" if building a shared library automatically hardcodes DIR - into the library and all subsequent libraries and executables linked - against it]) -_LT_TAGDECL([], [inherit_rpath], [0], - [Set to yes if linker adds runtime paths of dependent libraries - to runtime path list]) -_LT_TAGDECL([], [link_all_deplibs], [0], - [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [fix_srcfile_path], [1], - [Fix the shell variable $srcfile for the compiler]) -_LT_TAGDECL([], [always_export_symbols], [0], - [Set to "yes" if exported symbols are required]) -_LT_TAGDECL([], [export_symbols_cmds], [2], - [The commands to list exported symbols]) -_LT_TAGDECL([], [exclude_expsyms], [1], - [Symbols that should not be listed in the preloaded symbols]) -_LT_TAGDECL([], [include_expsyms], [1], - [Symbols that must always be exported]) -_LT_TAGDECL([], [prelink_cmds], [2], - [Commands necessary for linking programs (against libraries) with templates]) -_LT_TAGDECL([], [file_list_spec], [1], - [Specify filename containing input files]) -dnl FIXME: Not yet implemented -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], -dnl [Compiler flag to generate thread safe objects]) -])# _LT_LINKER_SHLIBS - - -# _LT_LANG_C_CONFIG([TAG]) -# ------------------------ -# Ensure that the configuration variables for a C compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_C_CONFIG], -[m4_require([_LT_DECL_EGREP])dnl -lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - -_LT_TAG_COMPILER -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - LT_SYS_DLOPEN_SELF - _LT_CMD_STRIPLIB - - # Report which library types will actually be built - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_CONFIG($1) -fi -AC_LANG_POP -CC="$lt_save_CC" -])# _LT_LANG_C_CONFIG - - -# _LT_PROG_CXX -# ------------ -# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ -# compiler, we have our own version here. -m4_defun([_LT_PROG_CXX], -[ -pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) -AC_PROG_CXX -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_CXX - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_CXX], []) - - -# _LT_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a C++ compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_CXX_CONFIG], -[AC_REQUIRE([_LT_PROG_CXX])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl - -AC_LANG_PUSH(C++) -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(compiler_needs_object, $1)=no -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test "$GXX" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - else - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - fi - - if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - LT_PATH_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) - _LT_TAGVAR(ld_shlibs, $1)=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aix[[4-9]]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - - if test "$GXX" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty - # executable. - _LT_SYS_MODULE_PATH_AIX - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - freebsd-elf*) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - gnu*) - ;; - - hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' - ;; - *) - if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' - fi - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) - _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' - _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ - $RANLIB $oldlib' - _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - *) # Version 6 will use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' - ;; - xl*) - # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - - *nto* | *qnx*) - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - openbsd2*) - # C++ shared libraries are fairly broken - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd=echo - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - case $host in - osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - ;; - *) - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - case $host in - osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' - fi - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - - _LT_TAGVAR(GCC, $1)="$GXX" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - CC=$lt_save_CC - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes - -AC_LANG_POP -])# _LT_LANG_CXX_CONFIG - - -# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) -# --------------------------------- -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -m4_defun([_LT_SYS_HIDDEN_LIBDEPS], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -# Dependencies to place before and after the object being linked: -_LT_TAGVAR(predep_objects, $1)= -_LT_TAGVAR(postdep_objects, $1)= -_LT_TAGVAR(predeps, $1)= -_LT_TAGVAR(postdeps, $1)= -_LT_TAGVAR(compiler_lib_search_path, $1)= - -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF -int a; -void foo (void) { a = 0; } -_LT_EOF -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -_LT_EOF -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer a - a=0 - return - end -_LT_EOF -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -_LT_EOF -]) -dnl Parse the compiler output and extract the necessary -dnl objects, libraries and library flags. -if AC_TRY_EVAL(ac_compile); then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case $p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" || - test $p = "-R"; then - prev=$p - continue - else - prev= - fi - - if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" - else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)="${prev}${p}" - else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" - fi - fi - ;; - - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)="$p" - else - _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" - fi - else - if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)="$p" - else - _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling $1 test program" -fi - -$RM -f confest.$objext - -# PORTME: override above test on systems where it is broken -m4_if([$1], [CXX], -[case $host_os in -interix[[3-9]]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - _LT_TAGVAR(predep_objects,$1)= - _LT_TAGVAR(postdep_objects,$1)= - _LT_TAGVAR(postdeps,$1)= - ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; -esac -]) - -case " $_LT_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac - _LT_TAGVAR(compiler_lib_search_dirs, $1)= -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi -_LT_TAGDECL([], [compiler_lib_search_dirs], [1], - [The directories searched by this compiler when creating a shared library]) -_LT_TAGDECL([], [predep_objects], [1], - [Dependencies to place before and after the objects being linked to - create a shared library]) -_LT_TAGDECL([], [postdep_objects], [1]) -_LT_TAGDECL([], [predeps], [1]) -_LT_TAGDECL([], [postdeps], [1]) -_LT_TAGDECL([], [compiler_lib_search_path], [1], - [The library search path used internally by the compiler when linking - a shared library]) -])# _LT_SYS_HIDDEN_LIBDEPS - - -# _LT_PROG_F77 -# ------------ -# Since AC_PROG_F77 is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_F77], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) -AC_PROG_F77 -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_F77 - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_F77], []) - - -# _LT_LANG_F77_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a Fortran 77 compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_F77_CONFIG], -[AC_REQUIRE([_LT_PROG_F77])dnl -AC_LANG_PUSH(Fortran 77) - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the F77 compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_F77" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - CC=${F77-"f77"} - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - GCC=$G77 - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$G77" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC="$lt_save_CC" -fi # test "$_lt_disable_F77" != yes - -AC_LANG_POP -])# _LT_LANG_F77_CONFIG - - -# _LT_PROG_FC -# ----------- -# Since AC_PROG_FC is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_FC], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) -AC_PROG_FC -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_FC - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_FC], []) - - -# _LT_LANG_FC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for a Fortran compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_FC_CONFIG], -[AC_REQUIRE([_LT_PROG_FC])dnl -AC_LANG_PUSH(Fortran) - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} - -# Object file extension for compiled fc test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the FC compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_FC" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - CC=${FC-"f95"} - compiler=$CC - GCC=$ac_cv_fc_compiler_gnu - - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC="$lt_save_CC" -fi # test "$_lt_disable_FC" != yes - -AC_LANG_POP -])# _LT_LANG_FC_CONFIG - - -# _LT_LANG_GCJ_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Java Compiler compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_GCJ_CONFIG], -[AC_REQUIRE([LT_PROG_GCJ])dnl -AC_LANG_SAVE - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -lt_save_GCC=$GCC -GCC=yes -CC=${GCJ-"gcj"} -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" -_LT_CC_BASENAME([$compiler]) - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds - -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC="$lt_save_CC" -])# _LT_LANG_GCJ_CONFIG - - -# _LT_LANG_RC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for the Windows resource compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_RC_CONFIG], -[AC_REQUIRE([LT_PROG_RC])dnl -AC_LANG_SAVE - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -lt_save_GCC=$GCC -GCC= -CC=${RC-"windres"} -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - -if test -n "$compiler"; then - : - _LT_CONFIG($1) -fi - -GCC=$lt_save_GCC -AC_LANG_RESTORE -CC="$lt_save_CC" -])# _LT_LANG_RC_CONFIG - - -# LT_PROG_GCJ -# ----------- -AC_DEFUN([LT_PROG_GCJ], -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], - [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], - [AC_CHECK_TOOL(GCJ, gcj,) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS)])])[]dnl -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_GCJ], []) - - -# LT_PROG_RC -# ---------- -AC_DEFUN([LT_PROG_RC], -[AC_CHECK_TOOL(RC, windres,) -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_RC], []) - - -# _LT_DECL_EGREP -# -------------- -# If we don't have a new enough Autoconf to choose the best grep -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_EGREP], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_FGREP])dnl -test -z "$GREP" && GREP=grep -_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) -_LT_DECL([], [EGREP], [1], [An ERE matcher]) -_LT_DECL([], [FGREP], [1], [A literal string matcher]) -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too -AC_SUBST([GREP]) -]) - - -# _LT_DECL_SED -# ------------ -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -m4_defun([_LT_DECL_SED], -[AC_PROG_SED -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" -_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) -_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], - [Sed that helps us avoid accidentally triggering echo(1) options like -n]) -])# _LT_DECL_SED - -m4_ifndef([AC_PROG_SED], [ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # - -m4_defun([AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_SUBST([SED]) -AC_MSG_RESULT([$SED]) -])#AC_PROG_SED -])#m4_ifndef - -# Old name: -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_SED], []) - - -# _LT_CHECK_SHELL_FEATURES -# ------------------------ -# Find out whether the shell is Bourne or XSI compatible, -# or has some other useful features. -m4_defun([_LT_CHECK_SHELL_FEATURES], -[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -AC_MSG_RESULT([$xsi_shell]) -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) - -AC_MSG_CHECKING([whether the shell understands "+="]) -lt_shell_append=no -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -AC_MSG_RESULT([$lt_shell_append]) -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi -_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac -_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl -_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl -])# _LT_CHECK_SHELL_FEATURES - - -# _LT_PROG_XSI_SHELLFNS -# --------------------- -# Bourne and XSI compatible variants of some useful shell functions. -m4_defun([_LT_PROG_XSI_SHELLFNS], -[case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $[*] )) -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} - -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - -dnl func_dirname_and_basename -dnl A portable version of this function is already defined in general.m4sh -dnl so there is no need for it here. - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} - -# sed scripts: -my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[[^=]]*=//' - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$[@]"` -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` -} - -_LT_EOF -esac - -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]+=\$[2]" -} -_LT_EOF - ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]=\$$[1]\$[2]" -} - -_LT_EOF - ;; - esac -]) - -# Helper functions for option handling. -*- Autoconf -*- -# -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 6 ltoptions.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) - - -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) -# ------------------------------------------ -m4_define([_LT_MANGLE_OPTION], -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) - - -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) -# --------------------------------------- -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a -# matching handler defined, dispatch to it. Other OPTION-NAMEs are -# saved as a flag. -m4_define([_LT_SET_OPTION], -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), - _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option `$2'])])[]dnl -]) - - -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) -# ------------------------------------------------------------ -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -m4_define([_LT_IF_OPTION], -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) - - -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) -# ------------------------------------------------------- -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME -# are set. -m4_define([_LT_UNLESS_OPTIONS], -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), - [m4_define([$0_found])])])[]dnl -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 -])[]dnl -]) - - -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) -# ---------------------------------------- -# OPTION-LIST is a space-separated list of Libtool options associated -# with MACRO-NAME. If any OPTION has a matching handler declared with -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about -# the unknown option and exit. -m4_defun([_LT_SET_OPTIONS], -[# Set options -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [_LT_SET_OPTION([$1], _LT_Option)]) - -m4_if([$1],[LT_INIT],[ - dnl - dnl Simply set some default values (i.e off) if boolean options were not - dnl specified: - _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no - ]) - _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no - ]) - dnl - dnl If no reference was made to various pairs of opposing options, then - dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared - dnl archives by default: - _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) - _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) - ]) -])# _LT_SET_OPTIONS - - - -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) -# ----------------------------------------- -m4_define([_LT_MANGLE_DEFUN], -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) - - -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) -# ----------------------------------------------- -m4_define([LT_OPTION_DEFINE], -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl -])# LT_OPTION_DEFINE - - -# dlopen -# ------ -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes -]) - -AU_DEFUN([AC_LIBTOOL_DLOPEN], -[_LT_SET_OPTION([LT_INIT], [dlopen]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) - - -# win32-dll -# --------- -# Declare package support for building win32 dll's. -LT_OPTION_DEFINE([LT_INIT], [win32-dll], -[enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -esac - -test -z "$AS" && AS=as -_LT_DECL([], [AS], [0], [Assembler program])dnl - -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl - -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl -])# win32-dll - -AU_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -_LT_SET_OPTION([LT_INIT], [win32-dll]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) - - -# _LT_ENABLE_SHARED([DEFAULT]) -# ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_SHARED], -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([shared], - [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) - - _LT_DECL([build_libtool_libs], [enable_shared], [0], - [Whether or not to build shared libraries]) -])# _LT_ENABLE_SHARED - -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) -]) - -AC_DEFUN([AC_DISABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], [disable-shared]) -]) - -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_SHARED], []) -dnl AC_DEFUN([AM_DISABLE_SHARED], []) - - - -# _LT_ENABLE_STATIC([DEFAULT]) -# ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_STATIC], -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([static], - [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]_LT_ENABLE_STATIC_DEFAULT) - - _LT_DECL([build_old_libs], [enable_static], [0], - [Whether or not to build static libraries]) -])# _LT_ENABLE_STATIC - -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) -]) - -AC_DEFUN([AC_DISABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], [disable-static]) -]) - -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_STATIC], []) -dnl AC_DEFUN([AM_DISABLE_STATIC], []) - - - -# _LT_ENABLE_FAST_INSTALL([DEFAULT]) -# ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_FAST_INSTALL], -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([fast-install], - [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) - -_LT_DECL([fast_install], [enable_fast_install], [0], - [Whether or not to optimize for fast installation])dnl -])# _LT_ENABLE_FAST_INSTALL - -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.]) -]) - -AU_DEFUN([AC_DISABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) - - -# _LT_WITH_PIC([MODE]) -# -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' -# LT_INIT options. -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -m4_define([_LT_WITH_PIC], -[AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) - -test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) - -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl -])# _LT_WITH_PIC - -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) - -# Old name: -AU_DEFUN([AC_LIBTOOL_PICMODE], -[_LT_SET_OPTION([LT_INIT], [pic-only]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `pic-only' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) - - -m4_define([_LTDL_MODE], []) -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], - [m4_define([_LTDL_MODE], [nonrecursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [recursive], - [m4_define([_LTDL_MODE], [recursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [subproject], - [m4_define([_LTDL_MODE], [subproject])]) - -m4_define([_LTDL_TYPE], []) -LT_OPTION_DEFINE([LTDL_INIT], [installable], - [m4_define([_LTDL_TYPE], [installable])]) -LT_OPTION_DEFINE([LTDL_INIT], [convenience], - [m4_define([_LTDL_TYPE], [convenience])]) - -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 5 ltsugar.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) - - -# lt_join(SEP, ARG1, [ARG2...]) -# ----------------------------- -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their -# associated separator. -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier -# versions in m4sugar had bugs. -m4_define([lt_join], -[m4_if([$#], [1], [], - [$#], [2], [[$2]], - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) -m4_define([_lt_join], -[m4_if([$#$2], [2], [], - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) - - -# lt_car(LIST) -# lt_cdr(LIST) -# ------------ -# Manipulate m4 lists. -# These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. -m4_define([lt_car], [[$1]]) -m4_define([lt_cdr], -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], - [$#], 1, [], - [m4_dquote(m4_shift($@))])]) -m4_define([lt_unquote], $1) - - -# lt_append(MACRO-NAME, STRING, [SEPARATOR]) -# ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. -# Note that neither SEPARATOR nor STRING are expanded; they are appended -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). -# No SEPARATOR is output if MACRO-NAME was previously undefined (different -# than defined and empty). -# -# This macro is needed until we can rely on Autoconf 2.62, since earlier -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. -m4_define([lt_append], -[m4_define([$1], - m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) - - - -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) -# ---------------------------------------------------------- -# Produce a SEP delimited list of all paired combinations of elements of -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list -# has the form PREFIXmINFIXSUFFIXn. -m4_define([lt_combine], -[m4_if([$2], [], [], - [m4_if([$4], [], [], - [lt_join(m4_quote(m4_default([$1], [[, ]])), - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_prefix, [$2], - [m4_foreach(_Lt_suffix, lt_car([m4_shiftn(3, $@)]), - [_Lt_prefix[]$3[]_Lt_suffix ])])))))])])dnl -]) - - -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) -# ----------------------------------------------------------------------- -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. -m4_define([lt_if_append_uniq], -[m4_ifdef([$1], - [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], - [lt_append([$1], [$2], [$3])$4], - [$5])], - [lt_append([$1], [$2], [$3])$4])]) - - -# lt_dict_add(DICT, KEY, VALUE) -# ----------------------------- -m4_define([lt_dict_add], -[m4_define([$1($2)], [$3])]) - - -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) -# -------------------------------------------- -m4_define([lt_dict_add_subkey], -[m4_define([$1($2:$3)], [$4])]) - - -# lt_dict_fetch(DICT, KEY, [SUBKEY]) -# ---------------------------------- -m4_define([lt_dict_fetch], -[m4_ifval([$3], - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) - - -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------------------- -m4_define([lt_if_dict_fetch], -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], - [$5], - [$6])]) - - -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) -# -------------------------------------------------------------- -m4_define([lt_dict_filter], -[m4_if([$5], [], [], - [lt_join(m4_quote(m4_default([$4], [[, ]])), - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), - [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl -]) - -# ltversion.m4 -- version numbers -*- Autoconf -*- -# -# Copyright (C) 2004 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# Generated from ltversion.in. - -# serial 2976 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.2.4]) -m4_define([LT_PACKAGE_REVISION], [1.2976]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.4' -macro_revision='1.2976' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -]) - -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004. -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 4 lt~obsolete.m4 - -# These exist entirely to fool aclocal when bootstrapping libtool. -# -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) -# which have later been changed to m4_define as they aren't part of the -# exported API, or moved to Autoconf or Automake where they belong. -# -# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us -# using a macro with the same name in our local m4/libtool.m4 it'll -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define -# and doesn't know about Autoconf macros at all.) -# -# So we provide this file, which has a silly filename so it's always -# included after everything else. This provides aclocal with the -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything -# because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. -# -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. -# Yes, that means every name once taken will need to remain here until -# we give up compatibility with versions before 1.7, at which point -# we need to keep only those names which we still refer to. - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) - -m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) -m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) -m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) -m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) -m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) -m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) -m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) -m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) -m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) -m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) -m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) -m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) -m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) -m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) -m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) -m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) -m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) -m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) -m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) -m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) -m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) -m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) -m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) -m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) -m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) -m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) -m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) -m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) -m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) -m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) -m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) -m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) -m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) - -# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.10' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10.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 AC_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10.1])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 8 - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 9 - -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - case $depmode in - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - none) break ;; - esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -#serial 3 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 8 - -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 13 - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.60])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP -AC_REQUIRE([AM_PROG_MKDIR_P])dnl -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl -]) -]) - - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} -AC_SUBST(install_sh)]) - -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- -# From Jim Meyering - -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -AC_DEFUN([AM_MAINTAINER_MODE], -[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) - AC_MSG_RESULT([$USE_MAINTAINER_MODE]) - AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl -] -) - -AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 3 - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) - -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 3 - -# _AM_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], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor `install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Copyright (C) 2006 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) -m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir - -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - diff --git a/libjudy/bootstrap b/libjudy/bootstrap deleted file mode 100755 index 39480ed8d4..0000000000 --- a/libjudy/bootstrap +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/sh -set -x - -libtoolize --force --copy -#aclocal-1.9 -aclocal -#autoheader2.50 -autoheader -#add --include-deps if you want to bootstrap with any other compiler than gcc -#automake --add-missing --copy --include-deps -automake-1.9 --add-missing --force --copy -#autoconf2.50 -autoconf -rm -f config.cache diff --git a/libjudy/compile b/libjudy/compile deleted file mode 100755 index 1b1d232169..0000000000 --- a/libjudy/compile +++ /dev/null @@ -1,142 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand `-c -o'. - -scriptversion=2005-05-14.22 - -# Copyright (C) 1999, 2000, 2003, 2004, 2005 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, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -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 $? - ;; -esac - -ofile= -cfile= -eat= - -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 -e 's|^.*/||' -e '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 - mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/libjudy/config.guess b/libjudy/config.guess deleted file mode 100755 index 0f0fe712ae..0000000000 --- a/libjudy/config.guess +++ /dev/null @@ -1,1516 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. - -timestamp='2007-03-06' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T | authenticamd) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit ;; - xtensa:Linux:*:*) - echo xtensa-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/libjudy/config.h.in b/libjudy/config.h.in deleted file mode 100644 index 515eca80a9..0000000000 --- a/libjudy/config.h.in +++ /dev/null @@ -1,171 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the `getpagesize' function. */ -#undef HAVE_GETPAGESIZE - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define to 1 if you have the `munmap' function. */ -#undef HAVE_MUNMAP - -/* Define to 1 if you have the `pow' function. */ -#undef HAVE_POW - -/* Define to 1 if the system has the type `ptrdiff_t'. */ -#undef HAVE_PTRDIFF_T - -/* Define to 1 if `stat' has the bug that it succeeds when given the - zero-length file name argument. */ -#undef HAVE_STAT_EMPTY_STRING_BUG - -/* Define to 1 if stdbool.h conforms to C99. */ -#undef HAVE_STDBOOL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDDEF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the `strcspn' function. */ -#undef HAVE_STRCSPN - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strstr' function. */ -#undef HAVE_STRSTR - -/* Define to 1 if you have the `strtoul' function. */ -#undef HAVE_STRTOUL - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_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_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the `uname' function. */ -#undef HAVE_UNAME - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `vprintf' function. */ -#undef HAVE_VPRINTF - -/* Define to 1 if the system has the type `_Bool'. */ -#undef HAVE__BOOL - -/* Define to 1 on little-endian systems. */ -#undef JU_LITTLE_ENDIAN - -/* Define to 1 if `lstat' dereferences a symlink specified with a trailing - slash. */ -#undef LSTAT_FOLLOWS_SLASHED_SYMLINK - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* The size of `void *', as computed by sizeof. */ -#undef SIZEOF_VOID_P - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define to 1 if your declares `struct tm'. */ -#undef TM_IN_SYS_TIME - -/* Version number of package */ -#undef VERSION - -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to `unsigned int' if does not define. */ -#undef size_t - -/* Define to empty if the keyword `volatile' does not work. Warning: valid - code using `volatile' can become incorrect without. Disable with care. */ -#undef volatile diff --git a/libjudy/config.sub b/libjudy/config.sub deleted file mode 100755 index 5defff65a6..0000000000 --- a/libjudy/config.sub +++ /dev/null @@ -1,1622 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. - -timestamp='2007-01-18' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | mt \ - | msp430 \ - | nios | nios2 \ - | ns16k | ns32k \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16c) - basic_machine=cr16c-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/libjudy/configure b/libjudy/configure deleted file mode 100755 index 7207640e17..0000000000 --- a/libjudy/configure +++ /dev/null @@ -1,14076 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for Judy 1.0.5. -# -# Report bugs to . -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. -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 - -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - 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 : - # 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. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: dougbaskins@yahoo.com 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_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 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=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 - fi - $as_echo "$as_me: error: $1" >&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; } - - # 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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -$* -_LT_EOF - exit 0 -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - - -exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='Judy' -PACKAGE_TARNAME='judy' -PACKAGE_VERSION='1.0.5' -PACKAGE_STRING='Judy 1.0.5' -PACKAGE_BUGREPORT='dougbaskins@yahoo.com' -PACKAGE_URL='' - -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='LTLIBOBJS -WARN_CFLAGS -OTOOL64 -OTOOL -LIPO -NMEDIT -DSYMUTIL -lt_ECHO -NM -ac_ct_DUMPBIN -DUMPBIN -FGREP -SED -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -LIBTOOL -RANLIB -LD -AR -LIBOBJS -EGREP -GREP -LN_S -CPP -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__quote -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -FLAVOR -VERSION_INFO -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 -MAINT -MAINTAINER_MODE_FALSE -MAINTAINER_MODE_TRUE -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_maintainer_mode -enable_debug -enable_ccover -enable_dependency_tracking -enable_32_bit -enable_64_bit -enable_shared -enable_static -with_pic -enable_fast_install -with_gnu_ld -enable_libtool_lock -enable_build_warnings -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_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=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_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 Judy 1.0.5 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/judy] - --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 Judy 1.0.5:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer - --enable-debug enable debugging features - --enable-ccover enable use of ccover code coverage tools - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --enable-32-bit Generate code for a 32-bit environment - --enable-64-bit Generate code for a 64-bit environment - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) - --enable-build-warnings Enable build-time compiler warnings for gcc - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic try to use only PIC/non-PIC objects [default=use - both] - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -Judy configure 1.0.5 -generated by GNU Autoconf 2.64 - -Copyright (C) 2009 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval - -} # ac_fn_c_try_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; } >/dev/null && { - 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to dougbaskins@yahoo.com ## -## ------------------------------------ ## -_ASBOX - ) | 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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_mongrel - -# 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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_compile - -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_type - -# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -# -------------------------------------------- -# Tries to find the compile-time value of EXPR in a program that includes -# INCLUDES, setting VAR accordingly. Returns whether the value could be -# computed -ac_fn_c_compute_int () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in #(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - echo >>conftest.val; read $3 &5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval - -} # ac_fn_c_try_link - -# 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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_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 Judy $as_me 1.0.5, which was -generated by GNU Autoconf 2.64. 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 - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${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 - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; 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 - ac_site_file1=$CONFIG_SITE -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then - { $as_echo "$as_me:${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" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { $as_echo "$as_me:${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 - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - - -am__api_version='1.10' - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done -done -if test -z "$ac_aux_dir"; then - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# 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 test "${ac_cv_path_install+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi - - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi - -{ $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 test "${ac_cv_path_mkdir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${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 { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE=$PACKAGE_NAME - VERSION=$PACKAGE_VERSION - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} - -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${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" - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. - -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' - - - - - - -ac_config_headers="$ac_config_headers config.h" - - - -VERSION_INFO="-version-info 1:3:0" - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor to build" >&5 -$as_echo_n "checking which flavor to build... " >&6; } - -# Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : - enableval=$enable_debug; -else - enable_debug=no -fi - -if test "x$enable_debug" != xyes -a "x$enable_debug" != xno; then - as_fn_error "You may not pass an argument to --enable-debug" "$LINENO" 5 -fi - -# Check whether --enable-ccover was given. -if test "${enable_ccover+set}" = set; then : - enableval=$enable_ccover; -else - enable_ccover=no -fi - -if test "x$enable_ccover" != xyes -a "x$enable_ccover" != xno; then - as_fn_error "You may not pass an argument to --enable-ccover" "$LINENO" 5 -fi - -if test "x$enable_debug" = xyes -a "x$enable_ccover" = xyes; then - as_fn_error "You may not use --enable-debug and --enable-ccover together" "$LINENO" 5 -elif test "x$enable_debug" = xyes; then - FLAVOR=debug -elif test "x$enable_ccover" = xyes; then - FLAVOR=cov -else - FLAVOR=product -fi - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLAVOR" >&5 -$as_echo "$FLAVOR" >&6; } - - -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 test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${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 test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${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 test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${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 test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${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 - rm -f conftest.er1 conftest.err - fi - $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. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - 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 conftest.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 for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -if test -z "$ac_file"; then : - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } -fi -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${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: yes" >&5 -$as_echo "yes" >&6; } - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -{ $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$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 -{ $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 test "${ac_cv_objext+set}" = set; 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 test "${ac_cv_c_compiler_gnu+set}" = set; 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 test "${ac_cv_prog_cc_g+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat 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 test "${ac_cv_prog_cc_c89+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - case $depmode in - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - none) break ;; - esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${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 - - -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 test "${ac_cv_prog_CPP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat 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.$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.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${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.$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.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${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 whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${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 - - - - -{ $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 test "${ac_cv_path_GREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - 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 test "${ac_cv_path_EGREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - 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 ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat 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 -" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in fcntl.h inttypes.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } -if test "${ac_cv_header_stdbool_h+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#ifndef bool - "error: bool is not defined" -#endif -#ifndef false - "error: false is not defined" -#endif -#if false - "error: false is not 0" -#endif -#ifndef true - "error: true is not defined" -#endif -#if true != 1 - "error: true is not 1" -#endif -#ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" -#endif - - struct s { _Bool s: 1; _Bool t; } s; - - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) 0.5 == true ? 1 : -1]; - bool e = &s; - char f[(_Bool) 0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - enum { j = false, k = true, l = false * true, m = true * 256 }; - /* The following fails for - HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - _Bool n[m]; - char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; -# if defined __xlc__ || defined __GNUC__ - /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 - reported by James Lemley on 2005-10-05; see - http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html - This test is not quite right, since xlc is allowed to - reject this program, as the initializer for xlcbug is - not one of the forms that C requires support for. - However, doing the test right would require a runtime - test, and that would make cross-compilation harder. - Let us hope that IBM fixes the xlc bug, and also adds - support for this kind of constant expression. In the - meantime, this test will reject xlc, which is OK, since - our stdbool.h substitute should suffice. We also test - this with GCC, where it should work, to detect more - quickly whether someone messes up the test in the - future. */ - char digs[] = "0123456789"; - int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); -# endif - /* Catch a bug in an HP-UX C compiler. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - _Bool q = true; - _Bool *pq = &q; - -int -main () -{ - - *pq |= q; - *pq |= ! q; - /* Refer to every declared value, to avoid compiler optimizations. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdbool_h=yes -else - ac_cv_header_stdbool_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 -$as_echo "$ac_cv_header_stdbool_h" >&6; } -ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE__BOOL 1 -_ACEOF - - -fi - -if test $ac_cv_header_stdbool_h = yes; then - -$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if test "${ac_cv_c_const+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset cs; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_const=yes -else - ac_cv_c_const=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then - -$as_echo "#define const /**/" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = x""yes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if test "${ac_cv_header_time+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if test "${ac_cv_struct_tm+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main () -{ -struct tm tm; - int *p = &tm.tm_sec; - return !p; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_struct_tm=time.h -else - ac_cv_struct_tm=sys/time.h -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then - -$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 -$as_echo_n "checking for working volatile... " >&6; } -if test "${ac_cv_c_volatile+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - -volatile int x; -int * volatile y = (int *) 0; -return !x && !y; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_volatile=yes -else - ac_cv_c_volatile=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 -$as_echo "$ac_cv_c_volatile" >&6; } -if test $ac_cv_c_volatile = no; then - -$as_echo "#define volatile /**/" >>confdefs.h - -fi - -ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" -if test "x$ac_cv_type_ptrdiff_t" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_PTRDIFF_T 1 -_ACEOF - - -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - # Check for potential -arch flags. It is not universal unless - # there are at least two -arch flags with different values. - ac_arch= - ac_prev= - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do - if test -n "$ac_prev"; then - case $ac_word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then - ac_arch=$ac_word - else - ac_cv_c_bigendian=universal - break - fi - ;; - esac - ac_prev= - elif test "x$ac_word" = "x-arch"; then - ac_prev=arch - fi - done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include - -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef _BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then : - # Try to guess by grepping values from an object file. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; - -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_bigendian=no -else - ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h -;; #( - no) - -$as_echo "#define JU_LITTLE_ENDIAN 1" >>confdefs.h - ;; #( - universal) - -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h - - ;; #( - *) - as_fn_error "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 -$as_echo_n "checking size of void *... " >&6; } -if test "${ac_cv_sizeof_void_p+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (void *) -See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_void_p=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 -$as_echo "$ac_cv_sizeof_void_p" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOID_P $ac_cv_sizeof_void_p -_ACEOF - - -if test "$ac_cv_sizeof_void_p" = 8; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Detected 64-bit Build Environment" >&5 -$as_echo "Detected 64-bit Build Environment" >&6; } - CFLAGS="-DJU_64BIT $CFLAGS" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Detected 32-bit Build Environment" >&5 -$as_echo "Detected 32-bit Build Environment" >&6; } - CFLAGS="-UJU_64BIT $CFLAGS" -fi - -# Check whether --enable-32-bit was given. -if test "${enable_32_bit+set}" = set; then : - enableval=$enable_32_bit; b32="$enableval" -else - b32="no" -fi - -if test x"$b32" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Configured to Build 32-bit" >&5 -$as_echo "Configured to Build 32-bit" >&6; } - if test x"$GCC" = xyes; then - CFLAGS="-UJU_64BIT -m32 $CFLAGS" - else - CFLAGS="-UJU_64BIT $CFLAGS" - fi -fi - -# Check whether --enable-64-bit was given. -if test "${enable_64_bit+set}" = set; then : - enableval=$enable_64_bit; b64="$enableval" -else - b64="no" -fi - -if test x"$b64" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Configured to Building 64-bit" >&5 -$as_echo "Configured to Building 64-bit" >&6; } - if test x"$GCC" = xyes; then - CFLAGS="-DJU_64BIT -m64 $CFLAGS" - else - CFLAGS="-DJU_64BIT $CFLAGS" - fi -fi - - - -# dnl Determine whether or not we're compiling for a 64-bit system by looking -# dnl at the size of a 'long'. This will define SIZEOF_LONG in config.h. We -# dnl append some text to the bottom of config.h to set JU_64BIT appropriately. -# dnl we try to do the correct thing if the user doesn't chose for us. -# AC_CHECK_SIZEOF(long) -# AH_BOTTOM([/* Define JU_64BIT to 1 if we're on a 64-bit system. */ -# if SIZEOF_LONG == 8 -# define JU_64BIT 1 -# endif]) -#fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 -$as_echo_n "checking for error_at_line... " >&6; } -if test "${ac_cv_lib_error_at_line+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -error_at_line (0, 0, "", 0, "an error occurred"); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_error_at_line=yes -else - ac_cv_lib_error_at_line=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 -$as_echo "$ac_cv_lib_error_at_line" >&6; } -if test $ac_cv_lib_error_at_line = no; then - case " $LIBOBJS " in - *" error.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS error.$ac_objext" - ;; -esac - -fi - -for ac_header in stdlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDLIB_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 -$as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_malloc_0_nonnull=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *malloc (); -#endif - -int -main () -{ -return ! malloc (0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_malloc_0_nonnull=yes -else - ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then : - -$as_echo "#define HAVE_MALLOC 1" >>confdefs.h - -else - $as_echo "#define HAVE_MALLOC 0" >>confdefs.h - - case " $LIBOBJS " in - *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" - ;; -esac - - -$as_echo "#define malloc rpl_malloc" >>confdefs.h - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 -$as_echo_n "checking for working memcmp... " >&6; } -if test "${ac_cv_func_memcmp_working+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_memcmp_working=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - /* Some versions of memcmp are not 8-bit clean. */ - char c0 = '\100', c1 = '\200', c2 = '\201'; - if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) - return 1; - - /* The Next x86 OpenStep bug shows up only when comparing 16 bytes - or more and with at least one buffer not starting on a 4-byte boundary. - William Lewis provided this test program. */ - { - char foo[21]; - char bar[21]; - int i; - for (i = 0; i < 4; i++) - { - char *a = foo + i; - char *b = bar + i; - strcpy (a, "--------01111111"); - strcpy (b, "--------10000000"); - if (memcmp (a, b, 16) >= 0) - return 1; - } - return 0; - } - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_memcmp_working=yes -else - ac_cv_func_memcmp_working=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 -$as_echo "$ac_cv_func_memcmp_working" >&6; } -test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in - *" memcmp.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" - ;; -esac - - -for ac_header in stdlib.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -for ac_func in getpagesize -do : - ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" -if test "x$ac_cv_func_getpagesize" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETPAGESIZE 1 -_ACEOF - -fi -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 -$as_echo_n "checking for working mmap... " >&6; } -if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_mmap_fixed_mapped=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -/* malloc might have been renamed as rpl_malloc. */ -#undef malloc - -/* Thanks to Mike Haertel and Jim Avera for this test. - Here is a matrix of mmap possibilities: - mmap private not fixed - mmap private fixed at somewhere currently unmapped - mmap private fixed at somewhere already mapped - mmap shared not fixed - mmap shared fixed at somewhere currently unmapped - mmap shared fixed at somewhere already mapped - For private mappings, we should verify that changes cannot be read() - back from the file, nor mmap's back from the file at a different - address. (There have been systems where private was not correctly - implemented like the infamous i386 svr4.0, and systems where the - VM page cache was not coherent with the file system buffer cache - like early versions of FreeBSD and possibly contemporary NetBSD.) - For shared mappings, we should conversely verify that changes get - propagated back to all the places they're supposed to be. - - Grep wants private fixed already mapped. - The main things grep needs to know about mmap are: - * does it exist and is it safe to write into the mmap'd area - * how to use it (BSD variants) */ - -#include -#include - -#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H -char *malloc (); -#endif - -/* This mess was copied from the GNU getpagesize.h. */ -#ifndef HAVE_GETPAGESIZE -/* Assume that all systems that can run configure have sys/param.h. */ -# ifndef HAVE_SYS_PARAM_H -# define HAVE_SYS_PARAM_H 1 -# endif - -# ifdef _SC_PAGESIZE -# define getpagesize() sysconf(_SC_PAGESIZE) -# else /* no _SC_PAGESIZE */ -# ifdef HAVE_SYS_PARAM_H -# include -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else /* no EXEC_PAGESIZE */ -# ifdef NBPG -# define getpagesize() NBPG * CLSIZE -# ifndef CLSIZE -# define CLSIZE 1 -# endif /* no CLSIZE */ -# else /* no NBPG */ -# ifdef NBPC -# define getpagesize() NBPC -# else /* no NBPC */ -# ifdef PAGESIZE -# define getpagesize() PAGESIZE -# endif /* PAGESIZE */ -# endif /* no NBPC */ -# endif /* no NBPG */ -# endif /* no EXEC_PAGESIZE */ -# else /* no HAVE_SYS_PARAM_H */ -# define getpagesize() 8192 /* punt totally */ -# endif /* no HAVE_SYS_PARAM_H */ -# endif /* no _SC_PAGESIZE */ - -#endif /* no HAVE_GETPAGESIZE */ - -int -main () -{ - char *data, *data2, *data3; - int i, pagesize; - int fd; - - pagesize = getpagesize (); - - /* First, make a file with some known garbage in it. */ - data = (char *) malloc (pagesize); - if (!data) - return 1; - for (i = 0; i < pagesize; ++i) - *(data + i) = rand (); - umask (0); - fd = creat ("conftest.mmap", 0600); - if (fd < 0) - return 1; - if (write (fd, data, pagesize) != pagesize) - return 1; - close (fd); - - /* Next, try to mmap the file at a fixed address which already has - something else allocated at it. If we can, also make sure that - we see the same garbage. */ - fd = open ("conftest.mmap", O_RDWR); - if (fd < 0) - return 1; - data2 = (char *) malloc (2 * pagesize); - if (!data2) - return 1; - data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1); - if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) - return 1; - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data2 + i)) - return 1; - - /* Finally, make sure that changes to the mapped area do not - percolate back to the file as seen by read(). (This is a bug on - some variants of i386 svr4.0.) */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = (char *) malloc (pagesize); - if (!data3) - return 1; - if (read (fd, data3, pagesize) != pagesize) - return 1; - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - return 1; - close (fd); - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_mmap_fixed_mapped=yes -else - ac_cv_func_mmap_fixed_mapped=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 -$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } -if test $ac_cv_func_mmap_fixed_mapped = yes; then - -$as_echo "#define HAVE_MMAP 1" >>confdefs.h - -fi -rm -f conftest.mmap - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 -$as_echo_n "checking whether lstat dereferences a symlink specified with a trailing slash... " >&6; } -if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - rm -f conftest.sym conftest.file -echo >conftest.file -if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then - if test "$cross_compiling" = yes; then : - ac_cv_func_lstat_dereferences_slashed_symlink=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -struct stat sbuf; - /* Linux will dereference the symlink and fail. - That is better in the sense that it means we will not - have to compile and use the lstat wrapper. */ - return lstat ("conftest.sym/", &sbuf) == 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_lstat_dereferences_slashed_symlink=yes -else - ac_cv_func_lstat_dereferences_slashed_symlink=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -else - # If the `ln -s' command failed, then we probably don't even - # have an lstat function. - ac_cv_func_lstat_dereferences_slashed_symlink=no -fi -rm -f conftest.sym conftest.file - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 -$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } - -test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && - -cat >>confdefs.h <<_ACEOF -#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 -_ACEOF - - -if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then - case " $LIBOBJS " in - *" lstat.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS lstat.$ac_objext" - ;; -esac - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 -$as_echo_n "checking whether stat accepts an empty string... " >&6; } -if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_stat_empty_string_bug=yes -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -struct stat sbuf; - return stat ("", &sbuf) == 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_stat_empty_string_bug=no -else - ac_cv_func_stat_empty_string_bug=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 -$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } -if test $ac_cv_func_stat_empty_string_bug = yes; then - case " $LIBOBJS " in - *" stat.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS stat.$ac_objext" - ;; -esac - - -cat >>confdefs.h <<_ACEOF -#define HAVE_STAT_EMPTY_STRING_BUG 1 -_ACEOF - -fi - -for ac_func in vprintf -do : - ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" -if test "x$ac_cv_func_vprintf" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VPRINTF 1 -_ACEOF - -ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" -if test "x$ac_cv_func__doprnt" = x""yes; then : - -$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h - -fi - -fi -done - - -for ac_func in getpagesize gettimeofday memset munmap pow strchr strcspn strerror strstr strtoul uname -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - $as_echo "$as_me:${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 - - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:${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 - - if test "x$ac_ct_AR" = x; then - AR="" - 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 -else - AR="$ac_cv_prog_AR" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. -set dummy ${ac_tool_prefix}ld; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LD+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LD"; then - ac_cv_prog_LD="$LD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LD="${ac_tool_prefix}ld" - $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 -LD=$ac_cv_prog_LD -if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LD"; then - ac_ct_LD=$LD - # Extract the first word of "ld", so it can be a program name with args. -set dummy ld; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_LD+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LD"; then - ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_LD="ld" - $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_LD=$ac_cv_prog_ac_ct_LD -if test -n "$ac_ct_LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LD" >&5 -$as_echo "$ac_ct_LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_LD" = x; then - LD="" - 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 - LD=$ac_ct_LD - fi -else - LD="$ac_cv_prog_LD" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${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 - - -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.2.4' -macro_revision='1.2976' - - - - - - - - - - - - - -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 test "${ac_cv_build+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_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 test "${ac_cv_host+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if test "${ac_cv_path_SED+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if test "${ac_cv_path_FGREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - -test -z "$GREP" && GREP=grep - - - - - - - - - - - - - - - - - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if test "${lt_cv_path_LD+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${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 test "${lt_cv_prog_gnu_ld+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - - -{ $as_echo "$as_me:${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 test "${lt_cv_path_NM+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$ac_tool_prefix"; then - for ac_prog in "dumpbin -symbols" "link -dump -symbols" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DUMPBIN+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${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 -symbols" "link -dump -symbols" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${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 - - - 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 test "${lt_cv_nm_interface+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:6481: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:6484: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:6487: 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; } - -# 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 test "${lt_cv_sys_max_cmd_len+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } -fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - - - - - -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } - - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi - - - - - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if test "${lt_cv_ld_reload_flag+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ $as_echo "$as_me:${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 - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac - - - - - - - - - - -{ $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 test "${lt_cv_deplibs_check_method+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - $as_echo "$as_me:${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 - - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:${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 - - 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 -else - AR="$ac_cv_prog_AR" -fi - -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru - - - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${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 test "${ac_cv_prog_RANLIB+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: - - - - - - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${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 test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { { eval echo "\"\$as_me\":${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_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${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 - - - - - - - - - - - - - - - - - - - - - - -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : - enableval=$enable_libtool_lock; -fi - -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line 7574 "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_cc_needs_belf=yes -else - lt_cv_cc_needs_belf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks="$enable_libtool_lock" - - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${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 test "${ac_cv_prog_NMEDIT+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${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 test "${ac_cv_prog_LIPO+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${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 test "${ac_cv_prog_OTOOL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${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 test "${ac_cv_prog_OTOOL64+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${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 test "${lt_cv_apple_cc_single_mod+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ $as_echo "$as_me:${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 test "${lt_cv_ld_exported_symbols_list+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat 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; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac - -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" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi - -done - - - -# Set options - - - - enable_dlopen=no - - - enable_win32_dll=no - - - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=yes -fi - - - - - - - - - - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=yes -fi - - - - - - - - - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : - withval=$with_pic; pic_mode="$withval" -else - pic_mode=default -fi - - -test -z "$pic_mode" && pic_mode=default - - - - - - - - # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_fast_install=yes -fi - - - - - - - - - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - - - - - - - - - - - - - - - - - - - - - - - - - -test -z "$LN_S" && LN_S="ln -s" - - - - - - - - - - - - - - -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if test "${lt_cv_objdir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF - - - - - - - - - - - - - - - - - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${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 test "${lt_cv_path_MAGIC_CMD+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${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* - - -if test -n "$compiler"; then - -lt_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' - - { $as_echo "$as_me:${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 test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8832: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:8836: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - - - - - - - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - -{ $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 test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - esac - ;; - esac - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi - -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 -$as_echo "$lt_prog_compiler_pic" >&6; } - - - - - - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${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 test "${lt_cv_prog_compiler_pic_works+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9156: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:9160: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } - -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi - -fi - - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test "${lt_cv_prog_compiler_static_works+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } - -if test x"$lt_cv_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9261: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:9265: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${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 test "${lt_cv_prog_compiler_c_o+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9316: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:9320: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - ld_shlibs=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi - ;; - - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag= - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - link_all_deplibs=no - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - cat 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 - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - cat 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 - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes - ;; - - darwin* | rhapsody*) - - - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' - link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" - if test "$GCC" = "yes"; then - output_verbose_link_cmd=echo - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - - else - ld_shlibs=no - fi - - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo(void) {} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs=no - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' - ;; - esac - fi - fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no - -with_gnu_ld=$with_gnu_ld - - - - - - - - - - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } - $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 - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 -$as_echo "$archive_cmds_need_lc" >&6; } - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } - -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[4-9]*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -interix[3-9]*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat 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 : - 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 - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux - need_lib_prefix=no - need_version=no - library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } - -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - 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 test "${ac_cv_lib_dl_dlopen+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat 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" = x""yes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = x""yes; 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 test "${ac_cv_lib_dld_shl_load+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat 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" = x""yes; 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" = x""yes; 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 test "${ac_cv_lib_dl_dlopen+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat 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" = x""yes; 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 test "${ac_cv_lib_svld_dlopen+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat 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" = x""yes; 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 test "${ac_cv_lib_dld_dld_link+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat 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" = x""yes; then : - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line 11688 "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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line 11788 "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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - - - - - - - - - - - - - - - - -striplib= -old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -fi - - - - - - - - - - - - - # Report which library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } - - - - -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - - - - - - - - - - - - - ac_config_commands="$ac_config_commands libtool" - - - - -# Only expand once: - - - -WARN_CFLAGS="" -build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" -# Check whether --enable-build-warnings was given. -if test "${enable_build_warnings+set}" = set; then : - enableval=$enable_build_warnings; -fi - -if test x"$build_warnings" = xyes; then - if test x"$GCC" = xyes; then - WARN_CFLAGS="${build_warnings}" - fi -fi - - - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - 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= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error "conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - - -: ${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. -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 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=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 - fi - $as_echo "$as_me: error: $1" >&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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# 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 - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## 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 Judy $as_me 1.0.5, which was -generated by GNU Autoconf 2.64. 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_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_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 - -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 - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_version="\\ -Judy config.status 1.0.5 -configured by $0, generated by GNU Autoconf 2.64, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2009 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' -macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' -enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' -pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' -host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' -host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' -host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' -build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' -build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' -build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' -SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' -Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' -GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' -EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' -FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' -LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' -NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' -LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' -ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' -exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' -lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' -reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' -AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' -STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' -RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' -compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' -GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' -SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' -ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' -need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' -LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' -libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' -fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' -need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' -version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' -runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' -libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' -soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' -finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' -old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' -striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' - -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# Quote evaled strings. -for var in SED \ -GREP \ -EGREP \ -FGREP \ -LD \ -NM \ -LN_S \ -lt_SP2NL \ -lt_NL2SP \ -reload_flag \ -deplibs_check_method \ -file_magic_cmd \ -AR \ -AR_FLAGS \ -STRIP \ -RANLIB \ -CC \ -CFLAGS \ -compiler \ -lt_cv_sys_global_symbol_pipe \ -lt_cv_sys_global_symbol_to_cdecl \ -lt_cv_sys_global_symbol_to_c_name_address \ -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -SHELL \ -ECHO \ -lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_wl \ -lt_prog_compiler_pic \ -lt_prog_compiler_static \ -lt_cv_prog_compiler_c_o \ -need_locks \ -DSYMUTIL \ -NMEDIT \ -LIPO \ -OTOOL \ -OTOOL64 \ -shrext_cmds \ -export_dynamic_flag_spec \ -whole_archive_flag_spec \ -compiler_needs_object \ -with_gnu_ld \ -allow_undefined_flag \ -no_undefined_flag \ -hardcode_libdir_flag_spec \ -hardcode_libdir_flag_spec_ld \ -hardcode_libdir_separator \ -fix_srcfile_path \ -exclude_expsyms \ -include_expsyms \ -file_list_spec \ -variables_saved_for_relink \ -libname_spec \ -library_names_spec \ -soname_spec \ -finish_eval \ -old_striplib \ -striplib; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in reload_cmds \ -old_postinstall_cmds \ -old_postuninstall_cmds \ -old_archive_cmds \ -extract_expsyms_cmds \ -old_archive_from_new_cmds \ -old_archive_from_expsyms_cmds \ -archive_cmds \ -archive_expsym_cmds \ -module_cmds \ -module_expsym_cmds \ -export_symbols_cmds \ -prelink_cmds \ -postinstall_cmds \ -postuninstall_cmds \ -finish_cmds \ -sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec; do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` - ;; -esac - -ac_aux_dir='$ac_aux_dir' -xsi_shell='$xsi_shell' -lt_shell_append='$lt_shell_append' - -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - - - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile' - - - - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - - *) 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_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '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 -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then - break - elif $ac_last_try; then - as_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 " :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="$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 "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 >"$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 - - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$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 "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$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"" || for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done - ;; - "libtool":C) - - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -# The names of the tagged configurations supported by this script. -available_tags="" - -# ### BEGIN LIBTOOL CONFIG - -# 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 - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="\$SED -e 1s/^X//" - -# A grep program that handles long lines. -GREP=$lt_GREP - -# An ERE matcher. -EGREP=$lt_EGREP - -# A literal string matcher. -FGREP=$lt_FGREP - -# A BSD- or MS-compatible name lister. -NM=$lt_NM - -# Whether we need soft or hard links. -LN_S=$lt_LN_S - -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len - -# Object file suffix (normally "o"). -objext=$ac_objext - -# Executable file suffix (normally ""). -exeext=$exeext - -# whether the shell understands "unset". -lt_unset=$lt_unset - -# turn spaces into newlines. -SP2NL=$lt_lt_SP2NL - -# turn newlines into spaces. -NL2SP=$lt_lt_NL2SP - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == "file_magic". -file_magic_cmd=$lt_file_magic_cmd - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A symbol stripping program. -STRIP=$lt_STRIP - -# Commands used to install an old-style archive. -RANLIB=$lt_RANLIB -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# A C compiler. -LTCC=$lt_CC - -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that does not interpret backslashes. -ECHO=$lt_ECHO - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL - -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 - -# Old archive suffix (normally "a"). -libext=$libext - -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink - -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Library versioning type. -version_type=$version_type - -# Shared library runtime path variable. -runpath_var=$runpath_var - -# Shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - - -# The linker used to build libraries. -LD=$lt_LD - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds - -# A language specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU compiler? -with_gcc=$GCC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# If ld is used when linking, flag to hardcode \$libdir into a binary -# during linking. This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - -ltmain="$ac_aux_dir/ltmain.sh" - - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $* )) -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} - -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} - -# sed scripts: -my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[^=]*=//' - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$@"` -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` -} - -_LT_EOF -esac - -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1+=\$2" -} -_LT_EOF - ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1=\$$1\$2" -} - -_LT_EOF - ;; - esac - - - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - - ;; - - esac -done # for ac_tag - - -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 $? -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff --git a/libjudy/configure.ac b/libjudy/configure.ac deleted file mode 100644 index a25a737698..0000000000 --- a/libjudy/configure.ac +++ /dev/null @@ -1,258 +0,0 @@ -AC_PREREQ(2.57) -AC_INIT(Judy, 1.0.5, dougbaskins@yahoo.com) - -AM_MAINTAINER_MODE - -dnl Turn on automake, and pass it the PACKAGE_NAME and PACKAGE_VERSION, too. -AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION) - -dnl Tell autoconf we want to keep our preprocessor defines in a header named -dnl config.h. This keeps automake from passing a zillion -D directives to -dnl the C compiler. -AM_CONFIG_HEADER([config.h]) - -dnl========================================================================== -dnl WARNING - WARNING - Shared Library Versioning - WARNING - WARNING -dnl========================================================================== -dnl This is the most dangerous part of this file--making a mistake here can -dnl cause massively painful chaos for libJudy developers, and potentially -dnl even end users. So PLEASE pay attention, and read up on the theory of -dnl shared library versioning. Tens of thousands of Linux users (and several -dnl QA departments) may thank you someday. -dnl -dnl There are two major concerns: -dnl -dnl 1) When changing the libJudy ABI (application binary interface), -dnl VERSION_INFO *must* be updated according to libtool's rules. Failure -dnl to do this will make applications using libJudy dump core, typically -dnl under obscure conditions on user systems. I won't attempt to -dnl explain these rules here; please see 'info libtool' for details. -dnl -dnl 2) When changing the libJudy ABI, it is also desirable to make libJudy -dnl "parallel installable". This means that it should be possible to -dnl install development headers and libraries for more than one version -dnl of libJudy at once. Failure to do this may cause problems for -dnl Linux distributions which include libJudy. (For example, it's -dnl impossible to switch between libpng2-dev and libpng3-dev on a -dnl Debian system without uninstalling and reinstalling both the Gnome -dnl and KDE SDKs.) For more information, do a Google search for -dnl "parallel installable". -dnl -dnl Right now, this package only provides the mechanisms to handle concern -dnl (1). Concern (2) is slightly more complicated, and will require some -dnl careful thinking. Fortunately, concern (2) doesn't become important -dnl until other SDKs rely on the libJudy SDK. -dnl -dnl Of course, it's safe to avoid changing the libJudy ABI. :-) -dnl -dnl The version scheme used by Libtool tracks interfaces, where an interface is -dnl the set of exported entry points into the library. All Libtool libraries -dnl start with -version-info set to 0:0:0 - this will be the default version -dnl number if you don't explicitly set it on the Libtool link command line. The -dnl meaning of these numbers (from left to right) is as follows: -dnl -dnl current: -dnl The number of the current interface exported by the library. A current -dnl value of 0, means that you are calling the interface exported by this -dnl library interface 0. -dnl -dnl revision: -dnl The implementation number of the most recent interface exported by this -dnl library. In this case, a revision value of 0 means that this is the -dnl first implementation of the interface. -dnl -dnl If the next release of this library exports the same interface, but has -dnl different implementation (perhaps some bugs have been fixed), the -dnl revision number will be higher, but current number will be the same. In -dnl that case, when given a choice, the library with the highest revision -dnl will always be used by the runtime loader. -dnl -dnl age: -dnl The number of previous additional interfaces supported by this library. -dnl If age were 2, then this library can be linked into executables which -dnl were built with a release of this library that exported the current -dnl interface number, current, or any of the previous two interfaces. -dnl -dnl By definition age must be less than or equal to current. At the outset, only -dnl the first ever interface is implemented, so age can only be 0. -dnl - -VERSION_INFO="-version-info 1:3:0" -AC_SUBST(VERSION_INFO) - -dnl========================================================================== -dnl Flavors -dnl========================================================================== -dnl Judy can be compiled in one of three flavors: "product" (the default), -dnl "debug", or "cov". We allow the user to select flavors using -dnl --enable-debug and --enable-ccover arguments to automake, which is -dnl the typical way of doing things. -dnl -dnl Note how we perform string comparison: -dnl -dnl if test "x$enable_debug" = xyes; then -dnl -dnl We do several odd things here: -dnl -dnl 1) We use 'test' instead of '[ ]' for shell portability. -dnl 2) We prefix strings with 'x' when comparing them, to protect against -dnl empty strings. -dnl 3) We ALWAYS quote user-supplied shell variables, to protect against -dnl embedded spaces. -dnl -dnl The results of this test aren't used anywhere yet. - -dnl Keep the user entertained. -AC_MSG_CHECKING(which flavor to build) - -dnl Process our --enable-debug argument. -AC_ARG_ENABLE(debug, - AC_HELP_STRING([--enable-debug], - [enable debugging features]), - , enable_debug=no) -if test "x$enable_debug" != xyes -a "x$enable_debug" != xno; then - AC_MSG_ERROR(You may not pass an argument to --enable-debug) -fi - -dnl Process our --enable-ccover argument. -AC_ARG_ENABLE(ccover, - AC_HELP_STRING([--enable-ccover], - [enable use of ccover code coverage tools]), - , enable_ccover=no) -if test "x$enable_ccover" != xyes -a "x$enable_ccover" != xno; then - AC_MSG_ERROR(You may not pass an argument to --enable-ccover) -fi - -dnl Determine our flavor. -if test "x$enable_debug" = xyes -a "x$enable_ccover" = xyes; then - AC_MSG_ERROR(You may not use --enable-debug and --enable-ccover together) -elif test "x$enable_debug" = xyes; then - FLAVOR=debug -elif test "x$enable_ccover" = xyes; then - FLAVOR=cov -else - FLAVOR=product -fi - -dnl Define FLAVOR in our makefiles. -AC_SUBST(FLAVOR) - -dnl Tell the user what flavor we've decided to build. -AC_MSG_RESULT($FLAVOR) - - -dnl========================================================================== -dnl Checks for Programs -dnl========================================================================== -AC_PROG_CC -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET - -dnl========================================================================== -dnl Checks for Header Files -dnl========================================================================== -AC_HEADER_STDC -AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h]) - -dnl========================================================================== -dnl Checks for Typedefs, Structures, and Compiler Characteristics -dnl========================================================================== - -dnl Standard, boring stuff. -AC_HEADER_STDBOOL -AC_C_CONST -AC_C_INLINE -AC_TYPE_SIZE_T -AC_HEADER_TIME -AC_STRUCT_TM -AC_C_VOLATILE -AC_CHECK_TYPES([ptrdiff_t]) - -dnl If we're compiling for a little-endian system, define JU_LITTLE_ENDIAN. -dnl If we can't tell what kind of system we're compling for, alert the -dnl user as described in 'info autoconf'. -AC_C_BIGENDIAN(, AC_DEFINE(JU_LITTLE_ENDIAN, 1, - [Define to 1 on little-endian systems.])) - -dnl Figure out if we are 32-bit or 64-bit (LP64) -AC_CHECK_SIZEOF(void *) -if test "$ac_cv_sizeof_void_p" = 8; then - AC_MSG_RESULT(Detected 64-bit Build Environment) - CFLAGS="-DJU_64BIT $CFLAGS" -else - AC_MSG_RESULT(Detected 32-bit Build Environment) - CFLAGS="-UJU_64BIT $CFLAGS" -fi - -AC_ARG_ENABLE(32-bit, [ --enable-32-bit Generate code for a 32-bit environment], - b32="$enableval", b32="no") -if test x"$b32" != "xno"; then - AC_MSG_RESULT(Configured to Build 32-bit) - if test x"$GCC" = xyes; then - CFLAGS="-UJU_64BIT -m32 $CFLAGS" - else - CFLAGS="-UJU_64BIT $CFLAGS" - fi -fi - -AC_ARG_ENABLE(64-bit, [ --enable-64-bit Generate code for a 64-bit environment], - b64="$enableval", b64="no") -if test x"$b64" != "xno"; then - AC_MSG_RESULT(Configured to Building 64-bit) - if test x"$GCC" = xyes; then - CFLAGS="-DJU_64BIT -m64 $CFLAGS" - else - CFLAGS="-DJU_64BIT $CFLAGS" - fi -fi - - - -# dnl Determine whether or not we're compiling for a 64-bit system by looking -# dnl at the size of a 'long'. This will define SIZEOF_LONG in config.h. We -# dnl append some text to the bottom of config.h to set JU_64BIT appropriately. -# dnl we try to do the correct thing if the user doesn't chose for us. -# AC_CHECK_SIZEOF(long) -# AH_BOTTOM([/* Define JU_64BIT to 1 if we're on a 64-bit system. */ -# if SIZEOF_LONG == 8 -# define JU_64BIT 1 -# endif]) -#fi - -dnl========================================================================== -dnl Checks for Libraries -dnl========================================================================== - -AC_FUNC_ERROR_AT_LINE -AC_FUNC_MALLOC -AC_FUNC_MEMCMP -AC_FUNC_MMAP -AC_FUNC_STAT -AC_FUNC_VPRINTF -AC_CHECK_FUNCS([getpagesize gettimeofday memset munmap pow strchr strcspn strerror strstr strtoul uname]) - -dnl These must be called before AM_PROG_LIBTOOL, because it may want -dnl to call AC_CHECK_PROG. -AC_CHECK_TOOL(AR, ar) -AC_CHECK_TOOL(LD, ld) -AC_CHECK_TOOL(RANLIB, ranlib, :) - -dnl Checks for libtool - this must be done after we set cflags (abi issues) -dnl -AM_PROG_LIBTOOL - -WARN_CFLAGS="" -build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" -AC_ARG_ENABLE([build-warnings], - [ --enable-build-warnings Enable build-time compiler warnings for gcc]) -if test x"$build_warnings" = xyes; then - if test x"$GCC" = xyes; then - WARN_CFLAGS="${build_warnings}" - fi -fi - -AC_SUBST(WARN_CFLAGS) - -AC_OUTPUT diff --git a/libjudy/depcomp b/libjudy/depcomp deleted file mode 100755 index 04701da536..0000000000 --- a/libjudy/depcomp +++ /dev/null @@ -1,530 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2005-07-09.11 - -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> $depfile - echo >> $depfile - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> $depfile - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" - if test "$libtool" = yes; then - "$@" -Wc,-M - else - "$@" -M - fi - stat=$? - - if test -f "$tmpdepfile"; then : - else - stripped=`echo "$stripped" | sed 's,^.*/,,'` - tmpdepfile="$stripped.u" - fi - - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - - if test -f "$tmpdepfile"; then - outname="$stripped.o" - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mecanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no - for arg in "$@"; do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix="`echo $object | sed 's/^.*\././'`" - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. - "$@" || exit $? - IFS=" " - for arg - do - case "$arg" in - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/libjudy/doc/Makefile.am b/libjudy/doc/Makefile.am deleted file mode 100644 index 8e6706aaf1..0000000000 --- a/libjudy/doc/Makefile.am +++ /dev/null @@ -1,209 +0,0 @@ -man3_MANS = man/man3/Judy \ - man/man3/Judy1 \ - man/man3/Judy1_funcs \ - man/man3/JudyL \ - man/man3/JudyL_funcs \ - man/man3/JudySL \ - man/man3/JudySL_funcs \ - man/man3/JudyHS \ - man/man3/JudyHS_funcs \ - man/man3/J1T \ - man/man3/J1S \ - man/man3/J1U \ - man/man3/J1F \ - man/man3/J1N \ - man/man3/J1L \ - man/man3/J1P \ - man/man3/J1FE \ - man/man3/J1NE \ - man/man3/J1LE \ - man/man3/J1PE \ - man/man3/J1C \ - man/man3/J1BC \ - man/man3/J1FA \ - man/man3/J1MU \ - man/man3/Judy1Test \ - man/man3/Judy1Set \ - man/man3/Judy1Unset \ - man/man3/Judy1First \ - man/man3/Judy1Next \ - man/man3/Judy1Last \ - man/man3/Judy1Prev \ - man/man3/Judy1FirstEmpty \ - man/man3/Judy1NextEmpty \ - man/man3/Judy1LastEmpty \ - man/man3/Judy1PrevEmpty \ - man/man3/Judy1Count \ - man/man3/Judy1ByCount \ - man/man3/Judy1FreeArray \ - man/man3/Judy1MemUsed \ - man/man3/JudyL \ - man/man3/JLG \ - man/man3/JLI \ - man/man3/JLD \ - man/man3/JLF \ - man/man3/JLN \ - man/man3/JLL \ - man/man3/JLP \ - man/man3/JLFE \ - man/man3/JLNE \ - man/man3/JLLE \ - man/man3/JLPE \ - man/man3/JLC \ - man/man3/JLBC \ - man/man3/JLFA \ - man/man3/JLMU \ - man/man3/JudyLGet \ - man/man3/JudyLIns \ - man/man3/JudyLDel \ - man/man3/JudyLFirst \ - man/man3/JudyLNext \ - man/man3/JudyLLast \ - man/man3/JudyLPrev \ - man/man3/JudyLFirstEmpty \ - man/man3/JudyLNextEmpty \ - man/man3/JudyLLastEmpty \ - man/man3/JudyLPrevEmpty \ - man/man3/JudyLCount \ - man/man3/JudyLByCount \ - man/man3/JudyLFreeArray \ - man/man3/JudyLMemUsed \ - man/man3/JSLG \ - man/man3/JSLI \ - man/man3/JSLD \ - man/man3/JSLF \ - man/man3/JSLN \ - man/man3/JSLL \ - man/man3/JSLP \ - man/man3/JSLFA \ - man/man3/JudySLGet \ - man/man3/JudySLIns \ - man/man3/JudySLDel \ - man/man3/JudySLFirst \ - man/man3/JudySLNext \ - man/man3/JudySLLast \ - man/man3/JudySLPrev \ - man/man3/JudySLFreeArray \ - man/man3/JHSG \ - man/man3/JHSI \ - man/man3/JHSD \ - man/man3/JHSFA \ - man/man3/JudyHSGet \ - man/man3/JudyHSIns \ - man/man3/JudyHSDel \ - man/man3/JudyHSFreeArray - - - -man/man3/Judy: - ../tool/jhton ext/Judy_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/Judy - -man/man3/Judy1: - ../tool/jhton ext/Judy1_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/Judy1 - cd man/man3; ln -s Judy J1T - cd man/man3; ln -s Judy J1S - cd man/man3; ln -s Judy J1U - cd man/man3; ln -s Judy J1F - cd man/man3; ln -s Judy J1N - cd man/man3; ln -s Judy J1L - cd man/man3; ln -s Judy J1P - cd man/man3; ln -s Judy J1FE - cd man/man3; ln -s Judy J1NE - cd man/man3; ln -s Judy J1LE - cd man/man3; ln -s Judy J1PE - cd man/man3; ln -s Judy J1C - cd man/man3; ln -s Judy J1BC - cd man/man3; ln -s Judy J1FA - cd man/man3; ln -s Judy J1MU - -man/man3/Judy1_funcs: - ../tool/jhton ext/Judy1_funcs_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/Judy1_funcs - cd man/man3; ln -s Judy1_funcs Judy1Test - cd man/man3; ln -s Judy1_funcs Judy1Set - cd man/man3; ln -s Judy1_funcs Judy1Unset - cd man/man3; ln -s Judy1_funcs Judy1First - cd man/man3; ln -s Judy1_funcs Judy1Next - cd man/man3; ln -s Judy1_funcs Judy1Last - cd man/man3; ln -s Judy1_funcs Judy1Prev - cd man/man3; ln -s Judy1_funcs Judy1FirstEmpty - cd man/man3; ln -s Judy1_funcs Judy1NextEmpty - cd man/man3; ln -s Judy1_funcs Judy1LastEmpty - cd man/man3; ln -s Judy1_funcs Judy1PrevEmpty - cd man/man3; ln -s Judy1_funcs Judy1Count - cd man/man3; ln -s Judy1_funcs Judy1ByCount - cd man/man3; ln -s Judy1_funcs Judy1FreeArray - cd man/man3; ln -s Judy1_funcs Judy1MemUsed - -man/man3/JudyL: - ../tool/jhton ext/JudyL_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/JudyL - cd man/man3; ln -s JudyL JLG - cd man/man3; ln -s JudyL JLI - cd man/man3; ln -s JudyL JLD - cd man/man3; ln -s JudyL JLF - cd man/man3; ln -s JudyL JLN - cd man/man3; ln -s JudyL JLL - cd man/man3; ln -s JudyL JLP - cd man/man3; ln -s JudyL JLFE - cd man/man3; ln -s JudyL JLNE - cd man/man3; ln -s JudyL JLLE - cd man/man3; ln -s JudyL JLPE - cd man/man3; ln -s JudyL JLC - cd man/man3; ln -s JudyL JLBC - cd man/man3; ln -s JudyL JLFA - cd man/man3; ln -s JudyL JLMU - -man/man3/JudyL_funcs: - ../tool/jhton ext/JudyL_funcs_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/JudyL_funcs - cd man/man3; ln -s JudyL_funcs JudyLGet - cd man/man3; ln -s JudyL_funcs JudyLIns - cd man/man3; ln -s JudyL_funcs JudyLDel - cd man/man3; ln -s JudyL_funcs JudyLFirst - cd man/man3; ln -s JudyL_funcs JudyLNext - cd man/man3; ln -s JudyL_funcs JudyLLast - cd man/man3; ln -s JudyL_funcs JudyLPrev - cd man/man3; ln -s JudyL_funcs JudyLFirstEmpty - cd man/man3; ln -s JudyL_funcs JudyLNextEmpty - cd man/man3; ln -s JudyL_funcs JudyLLastEmpty - cd man/man3; ln -s JudyL_funcs JudyLPrevEmpty - cd man/man3; ln -s JudyL_funcs JudyLCount - cd man/man3; ln -s JudyL_funcs JudyLByCount - cd man/man3; ln -s JudyL_funcs JudyLFreeArray - cd man/man3; ln -s JudyL_funcs JudyLMemUsed - -man/man3/JudySL: - ../tool/jhton ext/JudySL_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/JudySL - cd man/man3; ln -s JudySL JSLG - cd man/man3; ln -s JudySL JSLI - cd man/man3; ln -s JudySL JSLD - cd man/man3; ln -s JudySL JSLF - cd man/man3; ln -s JudySL JSLN - cd man/man3; ln -s JudySL JSLL - cd man/man3; ln -s JudySL JSLP - cd man/man3; ln -s JudySL JSLFA - -man/man3/JudySL_funcs: - ../tool/jhton ext/JudySL_funcs_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/JudySL_funcs - cd man/man3; ln -s JudySL_funcs JudySLGet - cd man/man3; ln -s JudySL_funcs JudySLIns - cd man/man3; ln -s JudySL_funcs JudySLDel - cd man/man3; ln -s JudySL_funcs JudySLFirst - cd man/man3; ln -s JudySL_funcs JudySLNext - cd man/man3; ln -s JudySL_funcs JudySLLast - cd man/man3; ln -s JudySL_funcs JudySLPrev - cd man/man3; ln -s JudySL_funcs JudySLFreeArray - -man/man3/JudyHS: - ../tool/jhton ext/JudyHS_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/JudyHS - cd man/man3; ln -s JudyHS JHSG - cd man/man3; ln -s JudyHS JHSI - cd man/man3; ln -s JudyHS JHSD - cd man/man3; ln -s JudyHS JHSFA - -man/man3/JudyHS_funcs: - ../tool/jhton ext/JudyHS_funcs_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/JudyHS_funcs - cd man/man3; ln -s JudyHS_funcs JudyHSGet - cd man/man3; ln -s JudyHS_funcs JudyHSIns - cd man/man3; ln -s JudyHS_funcs JudyHSDel - cd man/man3; ln -s JudyHS_funcs JudyHSFreeArray - -CLEANFILES = man/man3/* diff --git a/libjudy/doc/Makefile.in b/libjudy/doc/Makefile.in deleted file mode 100644 index de4ef30afd..0000000000 --- a/libjudy/doc/Makefile.in +++ /dev/null @@ -1,589 +0,0 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = doc -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -man3dir = $(mandir)/man3 -am__installdirs = "$(DESTDIR)$(man3dir)" -NROFF = nroff -MANS = $(man3_MANS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FLAVOR = @FLAVOR@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -VERSION_INFO = @VERSION_INFO@ -WARN_CFLAGS = @WARN_CFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -man3_MANS = man/man3/Judy \ - man/man3/Judy1 \ - man/man3/Judy1_funcs \ - man/man3/JudyL \ - man/man3/JudyL_funcs \ - man/man3/JudySL \ - man/man3/JudySL_funcs \ - man/man3/JudyHS \ - man/man3/JudyHS_funcs \ - man/man3/J1T \ - man/man3/J1S \ - man/man3/J1U \ - man/man3/J1F \ - man/man3/J1N \ - man/man3/J1L \ - man/man3/J1P \ - man/man3/J1FE \ - man/man3/J1NE \ - man/man3/J1LE \ - man/man3/J1PE \ - man/man3/J1C \ - man/man3/J1BC \ - man/man3/J1FA \ - man/man3/J1MU \ - man/man3/Judy1Test \ - man/man3/Judy1Set \ - man/man3/Judy1Unset \ - man/man3/Judy1First \ - man/man3/Judy1Next \ - man/man3/Judy1Last \ - man/man3/Judy1Prev \ - man/man3/Judy1FirstEmpty \ - man/man3/Judy1NextEmpty \ - man/man3/Judy1LastEmpty \ - man/man3/Judy1PrevEmpty \ - man/man3/Judy1Count \ - man/man3/Judy1ByCount \ - man/man3/Judy1FreeArray \ - man/man3/Judy1MemUsed \ - man/man3/JudyL \ - man/man3/JLG \ - man/man3/JLI \ - man/man3/JLD \ - man/man3/JLF \ - man/man3/JLN \ - man/man3/JLL \ - man/man3/JLP \ - man/man3/JLFE \ - man/man3/JLNE \ - man/man3/JLLE \ - man/man3/JLPE \ - man/man3/JLC \ - man/man3/JLBC \ - man/man3/JLFA \ - man/man3/JLMU \ - man/man3/JudyLGet \ - man/man3/JudyLIns \ - man/man3/JudyLDel \ - man/man3/JudyLFirst \ - man/man3/JudyLNext \ - man/man3/JudyLLast \ - man/man3/JudyLPrev \ - man/man3/JudyLFirstEmpty \ - man/man3/JudyLNextEmpty \ - man/man3/JudyLLastEmpty \ - man/man3/JudyLPrevEmpty \ - man/man3/JudyLCount \ - man/man3/JudyLByCount \ - man/man3/JudyLFreeArray \ - man/man3/JudyLMemUsed \ - man/man3/JSLG \ - man/man3/JSLI \ - man/man3/JSLD \ - man/man3/JSLF \ - man/man3/JSLN \ - man/man3/JSLL \ - man/man3/JSLP \ - man/man3/JSLFA \ - man/man3/JudySLGet \ - man/man3/JudySLIns \ - man/man3/JudySLDel \ - man/man3/JudySLFirst \ - man/man3/JudySLNext \ - man/man3/JudySLLast \ - man/man3/JudySLPrev \ - man/man3/JudySLFreeArray \ - man/man3/JHSG \ - man/man3/JHSI \ - man/man3/JHSD \ - man/man3/JHSFA \ - man/man3/JudyHSGet \ - man/man3/JudyHSIns \ - man/man3/JudyHSDel \ - man/man3/JudyHSFreeArray - -CLEANFILES = man/man3/* -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu doc/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-man3: $(man3_MANS) $(man_MANS) - @$(NORMAL_INSTALL) - test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)" - @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.3*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 3*) ;; \ - *) ext='3' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \ - done -uninstall-man3: - @$(NORMAL_UNINSTALL) - @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.3*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 3*) ;; \ - *) ext='3' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man3dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man3dir)/$$inst"; \ - done -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(MANS) -installdirs: - for dir in "$(DESTDIR)$(man3dir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-man - -install-dvi: install-dvi-am - -install-exec-am: - -install-html: install-html-am - -install-info: install-info-am - -install-man: install-man3 - -install-pdf: install-pdf-am - -install-ps: 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 - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-man - -uninstall-man: uninstall-man3 - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-man3 \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am uninstall-man uninstall-man3 - - -man/man3/Judy: - ../tool/jhton ext/Judy_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/Judy - -man/man3/Judy1: - ../tool/jhton ext/Judy1_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/Judy1 - cd man/man3; ln -s Judy J1T - cd man/man3; ln -s Judy J1S - cd man/man3; ln -s Judy J1U - cd man/man3; ln -s Judy J1F - cd man/man3; ln -s Judy J1N - cd man/man3; ln -s Judy J1L - cd man/man3; ln -s Judy J1P - cd man/man3; ln -s Judy J1FE - cd man/man3; ln -s Judy J1NE - cd man/man3; ln -s Judy J1LE - cd man/man3; ln -s Judy J1PE - cd man/man3; ln -s Judy J1C - cd man/man3; ln -s Judy J1BC - cd man/man3; ln -s Judy J1FA - cd man/man3; ln -s Judy J1MU - -man/man3/Judy1_funcs: - ../tool/jhton ext/Judy1_funcs_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/Judy1_funcs - cd man/man3; ln -s Judy1_funcs Judy1Test - cd man/man3; ln -s Judy1_funcs Judy1Set - cd man/man3; ln -s Judy1_funcs Judy1Unset - cd man/man3; ln -s Judy1_funcs Judy1First - cd man/man3; ln -s Judy1_funcs Judy1Next - cd man/man3; ln -s Judy1_funcs Judy1Last - cd man/man3; ln -s Judy1_funcs Judy1Prev - cd man/man3; ln -s Judy1_funcs Judy1FirstEmpty - cd man/man3; ln -s Judy1_funcs Judy1NextEmpty - cd man/man3; ln -s Judy1_funcs Judy1LastEmpty - cd man/man3; ln -s Judy1_funcs Judy1PrevEmpty - cd man/man3; ln -s Judy1_funcs Judy1Count - cd man/man3; ln -s Judy1_funcs Judy1ByCount - cd man/man3; ln -s Judy1_funcs Judy1FreeArray - cd man/man3; ln -s Judy1_funcs Judy1MemUsed - -man/man3/JudyL: - ../tool/jhton ext/JudyL_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/JudyL - cd man/man3; ln -s JudyL JLG - cd man/man3; ln -s JudyL JLI - cd man/man3; ln -s JudyL JLD - cd man/man3; ln -s JudyL JLF - cd man/man3; ln -s JudyL JLN - cd man/man3; ln -s JudyL JLL - cd man/man3; ln -s JudyL JLP - cd man/man3; ln -s JudyL JLFE - cd man/man3; ln -s JudyL JLNE - cd man/man3; ln -s JudyL JLLE - cd man/man3; ln -s JudyL JLPE - cd man/man3; ln -s JudyL JLC - cd man/man3; ln -s JudyL JLBC - cd man/man3; ln -s JudyL JLFA - cd man/man3; ln -s JudyL JLMU - -man/man3/JudyL_funcs: - ../tool/jhton ext/JudyL_funcs_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/JudyL_funcs - cd man/man3; ln -s JudyL_funcs JudyLGet - cd man/man3; ln -s JudyL_funcs JudyLIns - cd man/man3; ln -s JudyL_funcs JudyLDel - cd man/man3; ln -s JudyL_funcs JudyLFirst - cd man/man3; ln -s JudyL_funcs JudyLNext - cd man/man3; ln -s JudyL_funcs JudyLLast - cd man/man3; ln -s JudyL_funcs JudyLPrev - cd man/man3; ln -s JudyL_funcs JudyLFirstEmpty - cd man/man3; ln -s JudyL_funcs JudyLNextEmpty - cd man/man3; ln -s JudyL_funcs JudyLLastEmpty - cd man/man3; ln -s JudyL_funcs JudyLPrevEmpty - cd man/man3; ln -s JudyL_funcs JudyLCount - cd man/man3; ln -s JudyL_funcs JudyLByCount - cd man/man3; ln -s JudyL_funcs JudyLFreeArray - cd man/man3; ln -s JudyL_funcs JudyLMemUsed - -man/man3/JudySL: - ../tool/jhton ext/JudySL_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/JudySL - cd man/man3; ln -s JudySL JSLG - cd man/man3; ln -s JudySL JSLI - cd man/man3; ln -s JudySL JSLD - cd man/man3; ln -s JudySL JSLF - cd man/man3; ln -s JudySL JSLN - cd man/man3; ln -s JudySL JSLL - cd man/man3; ln -s JudySL JSLP - cd man/man3; ln -s JudySL JSLFA - -man/man3/JudySL_funcs: - ../tool/jhton ext/JudySL_funcs_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/JudySL_funcs - cd man/man3; ln -s JudySL_funcs JudySLGet - cd man/man3; ln -s JudySL_funcs JudySLIns - cd man/man3; ln -s JudySL_funcs JudySLDel - cd man/man3; ln -s JudySL_funcs JudySLFirst - cd man/man3; ln -s JudySL_funcs JudySLNext - cd man/man3; ln -s JudySL_funcs JudySLLast - cd man/man3; ln -s JudySL_funcs JudySLPrev - cd man/man3; ln -s JudySL_funcs JudySLFreeArray - -man/man3/JudyHS: - ../tool/jhton ext/JudyHS_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/JudyHS - cd man/man3; ln -s JudyHS JHSG - cd man/man3; ln -s JudyHS JHSI - cd man/man3; ln -s JudyHS JHSD - cd man/man3; ln -s JudyHS JHSFA - -man/man3/JudyHS_funcs: - ../tool/jhton ext/JudyHS_funcs_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/JudyHS_funcs - cd man/man3; ln -s JudyHS_funcs JudyHSGet - cd man/man3; ln -s JudyHS_funcs JudyHSIns - cd man/man3; ln -s JudyHS_funcs JudyHSDel - cd man/man3; ln -s JudyHS_funcs JudyHSFreeArray -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/libjudy/doc/ext/COPYRIGHT b/libjudy/doc/ext/COPYRIGHT deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libjudy/doc/ext/Judy1_3.htm b/libjudy/doc/ext/Judy1_3.htm deleted file mode 100644 index d5694cb157..0000000000 --- a/libjudy/doc/ext/Judy1_3.htm +++ /dev/null @@ -1,309 +0,0 @@ - - - -Judy1(3) - - - - - - - -
Judy1(3) Judy1(3)
-

-

- -
NAME
-
-Judy1 macros - -C library for creating and accessing a dynamic array of bits, using -any value of a word as an index. - -

-

SYNOPSIS
-
-
-cc [flags] sourcefiles -lJudy
-
-

-

-#include <Judy.h>
-
-int     Rc_int;                          // return code - integer
-Word_t  Rc_word;                         // return code - unsigned word
-Word_t  Index, Index1, Index2, Nth;
-
-Pvoid_t PJ1Array = (Pvoid_t) NULL;       // initialize Judy1 array
-
-J1S( Rc_int,  PJ1Array, Index);          // Judy1Set()
-J1U( Rc_int,  PJ1Array, Index);          // Judy1Unset()
-J1T( Rc_int,  PJ1Array, Index);          // Judy1Test()
-J1C( Rc_word, PJ1Array, Index1, Index2); // Judy1Count()
-J1BC(Rc_int,  PJ1Array, Nth, Index);     // Judy1ByCount()
-J1FA(Rc_word, PJ1Array);                 // Judy1FreeArray()
-J1MU(Rc_word, PJ1Array);                 // Judy1MemUsed()
-J1F( Rc_int,  PJ1Array, Index);          // Judy1First()
-J1N( Rc_int,  PJ1Array, Index);          // Judy1Next()
-J1L( Rc_int,  PJ1Array, Index);          // Judy1Last()
-J1P( Rc_int,  PJ1Array, Index);          // Judy1Prev()
-J1FE(Rc_int,  PJ1Array, Index);          // Judy1FirstEmpty()
-J1NE(Rc_int,  PJ1Array, Index);          // Judy1NextEmpty()
-J1LE(Rc_int,  PJ1Array, Index);          // Judy1LastEmpty()
-J1PE(Rc_int,  PJ1Array, Index);          // Judy1PrevEmpty()
-
- -

-

DESCRIPTION
-
-A Judy1 array is the equivalent of a bit array or bit map. -A bit is addressed by an Index (key). -The array may be sparse, and the Index may be any word-sized Value. -If an index is present, it represents a set bit -(a bit set represents an index present). -If an index is absent, it represents an unset bit -(a bit unset represents an absent index). -

-A Judy1 array is allocated with a NULL pointer -

-Pvoid_t PJ1Array = (Pvoid_t) NULL;
-
-Memory to support the array is allocated as bits are set, -and released as bits are unset. -If the Judy1 pointer (PJ1Array) is NULL, all bits are unset (and -the Judy1 array requires no memory). -

-As with an ordinary array, a Judy1 array contains no duplicate indexes. -

-Using the macros described here, rather than the -Judy1 function calls, -the default error handling sends a -message to the standard error and terminates the program with -exit(1). -For other error handling methods, see the -ERRORS section. -

-Because the macro forms are sometimes faster and have a simpler error -handling interface than the equivalent -functions, -they are the preferred way of calling the Judy1 functions. -

-

-
J1S(Rc_int, PJ1Array, Index); // Judy1Set()
-
-Set Index's bit in the Judy1 array PJ1Array. -

-Return Rc_int set to 1 if Index's bit was previously unset -(successful), otherwise 0 -if the bit was already set (unsuccessful). -

-

J1U(Rc_int, PJ1Array, Index); // Judy1Unset()
-
-Unset Index's bit in the Judy1 array PJ1Array; -that is, remove Index from the Judy1 array. -

-Return Rc_int set to 1 if Index's bit was -previously set (successful), otherwise 0 -if the bit was already unset (unsuccessful). -

-

J1T(Rc_int, PJ1Array, Index); // Judy1Test()
-
-Test if Index's bit is set in the -Judy1 array PJ1Array. -

-Return Rc_int set to 1 if Index's bit is set -(Index is present), -0 if it is unset (Index is absent). -

-

J1C(Rc_word, PJ1Array, Index1, Index2); // Judy1Count()
-
-Count the number of indexes present in the Judy1 array -PJ1Array between -Index1 and Index2 (inclusive). -

-Return Rc_word set to the count. -A return Value of 0 can be valid as a count, -or it can indicate a special case for fully -populated array (32-bit machines only). See -Judy1Count() -for ways to resolve this. -

-To count all indexes present (population) in a Judy1 bit array, use: -

-J1C(Rc_word, PJ1Array, 0, -1);
-
-Note: The -1 promotes to the maximum index, that is, all ones. -

-

J1BC(Rc_int, PJ1Array, Nth, Index); // Judy1ByCount()
-
-Locate the Nth index that is present in the Judy1 array -PJ1Array (Nth = 1 returns the first index present). -To refer to the last index in a fully populated array (all indexes -present, which is rare), use Nth = 0. -

-Return Rc_int set to 1 and Index set to the -Nth index if found, otherwise return Rc_int -set to 0 (the Value of Index contains no -useful information). -

-

J1FA(Rc_word, PJ1Array); // Judy1FreeArray()
-
-Free the entire Judy1 array PJ1Array (much faster than using a -J1N(), J1U() loop). -

-Return Rc_word set to the number of bytes freed, -and PJ1Array set to NULL. -

-

J1MU(Rc_word, PJ1Array); // Judy1MemUsed()
-
-Return Rc_word set to the number of bytes of memory currently in use by -Judy1 array PJ1Array. This is a very fast routine, and may be used after -a J1S() or J1U() call with little performance impact. -

-

Judy1 Search Functions
-
-The Judy1 search functions allow you to search for set or unset bits in the array. -You may search inclusively or exclusively, -in either forward or reverse directions. -All of the search functions use a similar calling sequence. -Rc_int is returned set to 1 for a successful search and the found Index is returned. -Rc_int is returned set to 0 for an unsuccessful search, -and Index contains no useful information. -The return code Rc_int must be checked prior to using the returned Index, -since a search failure is possible. -

-

J1F(Rc_int, PJ1Array, Index); // Judy1First()
-
-Search (inclusive) for the first index present that is equal -to or greater than the passed Index. -(Start with Index = 0 to find the first index in the -array.) J1F() is typically used to begin a -sorted-order scan of the indexes present in a Judy1 array. -

-

J1N(Rc_int, PJ1Array, Index); // Judy1Next()
-
-Search (exclusive) for the next index present that is -greater than the passed Index. -J1N() is typically used to continue a -sorted-order scan of the indexes present -in a Judy1 array, or to locate a "neighbor" of a given index. -

-

J1L(Rc_int, PJ1Array, Index); // Judy1Last()
-
-Search (inclusive) for the last index present that is equal -to or less than the passed Index. (Start with -Index = -1, that is, all ones, to find the last index -in the array.) J1L() is typically used to begin -a reverse-sorted-order scan -of the indexes present in a Judy1 array. -

-

J1P(Rc_int, PJ1Array, Index); // Judy1Prev()
-
-Search (exclusive) for the previous index present that is -less than the passed Index. J1P() is typically -used to continue a reverse-sorted-order scan of the indexes -present in a Judy1 array, or to locate a "neighbor" of a given index. -

-

J1FE(Rc_int, PJ1Array, Index); // Judy1FirstEmpty()
-
-Search (inclusive) for the first absent index that is equal to -or greater than the passed Index. (Start with -Index = 0 to find the first index absent in the array.) -

-

J1NE(Rc_int, PJ1Array, Index); // Judy1NextEmpty()
-
-Search (exclusive) for the next absent index that is -greater than the passed Index. -

-

J1LE(Rc_int, PJ1Array, Index); // Judy1LastEmpty()
-
-Search (inclusive) for the last absent index that is -equal to or less than the passed Index. -(Start with Index = -1 to find the last index -absent in the array.) -

-

J1PE(Rc_int, PJ1Array, Index); // Judy1PrevEmpty()
-
-Search (exclusive) for the previous absent index that is -less than the passed Index. -
- -

-

ERRORS: See: Judy_3.htm#ERRORS
-
- -

-

EXAMPLE
-
-In the following example, errors in the J1S() or J1U() calls -go to a user-defined procedure, process_malloc_failure. This is not needed -when you use the default JUDYERROR() macro, since the default causes -your program to exit on all failures, -including malloc() failure. -

-

-#include <stdio.h>
-#include <Judy.h>
-
-int main()                       // Example program of Judy1 macro APIs
-{
-   Word_t Index;                 // index (or key)
-   Word_t Rcount;                // count of indexes (or bits set)
-   Word_t Rc_word;               // full word return value
-   int    Rc_int;                // boolean values returned (0 or 1)
-
-   Pvoid_t PJ1Array = (Pvoid_t) NULL; // initialize Judy1 array
-
-   Index = 123456;
-   J1S(Rc_int, J1Array, Index);  // set bit at 123456
-   if (Rc_int == JERR) goto process_malloc_failure;
-   if (Rc_int == 1) printf("OK - bit successfully set at %lu\n", Index);
-   if (Rc_int == 0) printf("BUG - bit already set at %lu\n", Index);
-
-   Index = 654321;
-   J1T(Rc_int, J1Array, Index);  // test if bit set at 654321
-   if (Rc_int == 1) printf("BUG - set bit at %lu\n", Index);
-   if (Rc_int == 0) printf("OK - bit not set at %lu\n", Index);
-
-   J1C(Rcount, J1Array, 0, -1);  // count all bits set in array
-   printf("%lu bits set in Judy1 array\n", Rcount);
-
-   Index = 0;
-   J1F(Rc_int, J1Array, Index);  // find first bit set in array
-   if (Rc_int == 1) printf("OK - first bit set is at %lu\n", Index);
-   if (Rc_int == 0) printf("BUG - no bits set in array\n");
-
-   J1MU(Rc_word, J1Array);       // how much memory was used?
-   printf("%lu Indexes used %lu bytes of memory\n", Rcount, Rc_word);
-
-   Index = 123456;
-   J1U(Rc_int, J1Array, Index);  // unset bit at 123456
-   if (Rc_int == JERR) goto process_malloc_failure;
-   if (Rc_int == 1) printf("OK - bit successfully unset at %lu\n", Index);
-   if (Rc_int == 0) printf("BUG - bit was not set at %lu\n", Index);
-
-   return(0);
-}
-
- -

-

AUTHOR
-
-Judy was invented by Doug Baskins and implemented by Hewlett-Packard. - -

-

SEE ALSO
-
-Judy(3), -JudyL(3), -JudySL(3), -JudyHS(3), -
-malloc(), -
-the Judy website, - -http://judy.sourceforge.net, -for more information and Application Notes. -
- - diff --git a/libjudy/doc/ext/Judy1_funcs_3.htm b/libjudy/doc/ext/Judy1_funcs_3.htm deleted file mode 100644 index 1f82d074bd..0000000000 --- a/libjudy/doc/ext/Judy1_funcs_3.htm +++ /dev/null @@ -1,260 +0,0 @@ - - - -Judy1_funcs(3) - - - - - - -
Judy1_funcs(3) Judy1_funcs(3)
-

-

- -
NAME
-
-Judy1 functions - -C library for creating and accessing a dynamic array of bits, using -any value of a word as an index - -

-

SYNOPSIS
-
-
-int    Judy1Set(       PPvoid_t PPJ1Array, Word_t   Index,  PJError_t PJError);
-int    Judy1Unset(     PPvoid_t PPJ1Array, Word_t   Index,  PJError_t PJError);
-int    Judy1Test(      Pcvoid_t  PJ1Array, Word_t   Index,  PJError_t PJError);
-Word_t Judy1Count(     Pcvoid_t  PJ1Array, Word_t   Index1, Word_t    Index2, PJError_t PJError);
-int    Judy1ByCount(   Pcvoid_t  PJ1Array, Word_t   Nth,    Word_t * PIndex,  PJError_t PJError);
-Word_t Judy1FreeArray( PPvoid_t PPJ1Array, PJError_t PJError);
-Word_t Judy1MemUsed(   Pcvoid_t  PJ1Array);
-int    Judy1First(     Pcvoid_t  PJ1Array, Word_t * PIndex, PJError_t PJError);
-int    Judy1Next(      Pcvoid_t  PJ1Array, Word_t * PIndex, PJError_t PJError);
-int    Judy1Last(      Pcvoid_t  PJ1Array, Word_t * PIndex, PJError_t PJError);
-int    Judy1Prev(      Pcvoid_t  PJ1Array, Word_t * PIndex, PJError_t PJError);
-int    Judy1FirstEmpty(Pcvoid_t  PJ1Array, Word_t * PIndex, PJError_t PJError);
-int    Judy1NextEmpty( Pcvoid_t  PJ1Array, Word_t * PIndex, PJError_t PJError);
-int    Judy1LastEmpty( Pcvoid_t  PJ1Array, Word_t * PIndex, PJError_t PJError);
-int    Judy1PrevEmpty( Pcvoid_t  PJ1Array, Word_t * PIndex, PJError_t PJError);
-
- -

-

DESCRIPTION
-
-A macro equivalent exists for each function call. -Because the macro forms are sometimes faster and have a simpler error -handling interface than the equivalent functions, -they are the preferred way of calling the Judy1 functions. -See Judy1(3) -for more information. -The function call definitions are included here for completeness. -

-One of the difficulties in using the Judy1 function calls lies in -determining whether to pass a pointer or the address of a pointer. -Since the functions that modify the Judy1 array must also modify the -pointer to the Judy1 array, you must pass the address of the pointer -rather than the pointer itself. -This often leads to hard-to-debug programmatic errors. -In practice, the macros allow the compiler to catch programming -errors when pointers instead of addresses of pointers are passed. -

-The Judy1 function calls have an additional parameter beyond -those specified in the macro calls. This parameter is either a -pointer to an error structure, or NULL (in which case the -detailed error information is not returned). -

-In the following descriptions, the functions are described in -terms of how the macros use them (only in the case of -#define JUDYERROR_NOTEST 1). This is the suggested use -of the macros after your program has been fully debugged. -When the JUDYERROR_NOTEST macro is not specified, -an error structure is declared to store error information -returned from the Judy1 functions when an error occurs. -

-Notice the placement of the & in the different functions. -

-

-
Judy1Set(&PJ1Array, Index, &JError)
-
-
-#define J1S(Rc_int, PJ1Array, Index) \
-   Rc_int = Judy1Set(&PJ1Array, Index, PJE0)
-
-
-

-

Judy1Unset(&PJ1Array, Index, &JError)
-
-
-#define J1U(Rc_int, PJ1Array, Index) \
-   Rc_int = Judy1Unset(&PJ1Array, Index, PJE0)
-
-
-

-

Judy1Test(PJ1Array, Index, &JError)
-
-
-#define J1T(Rc_int, PJ1Array, Index) \
-   Rc_int = Judy1Test(PJ1Array, Index, PJE0)
-
-
-

-

Judy1Count(PJ1Array, Index1, Index2, &JError)
-
-
-#define J1C(Rc_word, PJ1Array, Index1, Index2) \
-   Rc_word = Judy1Count(PJ1Array, Index1, Index2, PJE0)
-
-
-A return value of 0 can be an error, valid as a count, or it can indicate a special case -for a fully-populated array (32-bit machines only). If necessary, the following -code can be used to disambiguate this return: -
-JError_t JError;
-
-Rc_word = Judy1Count(PJ1Array, Index1, Index2, &JError);
-if (Rc_word == 0)
-{
-    if (JU_ERRNO(&JError) == JU_ERRNO_NONE)
-        printf("Judy1 array population == 0\n");
-    if (JU_ERRNO(&JError) == JU_ERRNO_FULL)
-        printf("Judy1 array population == 2^32\n");
-    if (JU_ERRNO(&JError) == JU_ERRNO_NULLPPARRAY)
-        goto NullArray;
-    if (JU_ERRNO(&JError) >  JU_ERRNO_NFMAX)
-        goto Null_or_CorruptArray;
-}
-
-

-

Judy1ByCount(PJ1Array, Nth, &Index, &JError)
-
-
-#define J1BC(Rc_int, PJ1Array, Nth, Index) \
-   Rc_int = Judy1ByCount(PJ1Array, Nth, &Index, PJE0)
-
-
-

-

Judy1FreeArray(&PJ1Array, &JError)
-
-
-#define J1FA(Rc_word, PJ1Array) \
-   Rc_word = Judy1FreeArray(&PJ1Array, PJE0)
-
-
-

-

Judy1MemUsed(PJ1Array)
-
-
-#define J1MU(Rc_word, PJ1Array) \
-   Rc_word = Judy1MemUsed(PJ1Array)
-
-
-

-

Judy1First(PJ1Array, &Index, &JError)
-
-
-#define J1F(Rc_int, PJ1Array, Index) \
-   Rc_int = Judy1First(PJ1Array, &Index, PJE0)
-
-
-

-

Judy1Next(PJ1Array, &Index, &JError)
-
-
-#define J1N(Rc_int, PJ1Array, Index) \
-   Rc_int = Judy1Next(PJ1Array, &Index, PJE0)
-
-
-

-

Judy1Last(PJ1Array, &Index, &JError)
-
-
-#define J1L(Rc_int, PJ1Array, Index) \
-   Rc_int = Judy1Last(PJ1Array, &Index, PJE0)
-
-
-

-

Judy1Prev(PJ1Array, &Index, &JError)
-
-
-#define J1P(Rc_int, PJ1Array, Index) \
-   Rc_int = Judy1Prev(PJ1Array, &Index, PJE0)
-
-
-

-

Judy1FirstEmpty(PJ1Array, &Index, &JError)
-
-
-#define J1FE(Rc_int, PJ1Array, Index) \
-   Rc_int = Judy1FirstEmpty(PJ1Array, &Index, PJE0)
-
-
-

-

Judy1NextEmpty(PJ1Array, &Index, &JError)
-
-
-#define J1NE(Rc_int, PJ1Array, Index) \
-   Rc_int = Judy1NextEmpty(PJ1Array, &Index, PJE0)
-
-
-

-

Judy1LastEmpty(PJ1Array, &Index, &JError)
-
-
-#define J1LE(Rc_int, PJ1Array, Index) \
-   Rc_int = Judy1LastEmpty(PJ1Array, &Index, PJE0)
-
-
-

-

Judy1PrevEmpty(PJ1Array, &Index, &JError)
-
-
-#define J1PE(Rc_int, PJ1Array, Index) \
-   Rc_int = Judy1PrevEmpty(PJ1Array, &Index, PJE0)
-
-
-
-

-Definitions for all of the Judy functions, the types -Pvoid_t, -Pcvoid_t, -PPvoid_t, -Word_t, -JError_t, -and -PJError_t, -the constants -NULL, -JU_ERRNO_*, -JERR, -and -PJE0, -are provided in the Judy.h header file -(/usr/include/Judy.h). -Note: Callers should define Judy1 arrays as type Pvoid_t, -which can be passed by value to functions that take -Pcvoid_t (constant Pvoid_t), -and also by address to functions that take PPvoid_t. - -

-

AUTHOR
-
-Judy was invented by Doug Baskins and implemented by Hewlett-Packard. - -

-

SEE ALSO
-
-Judy(3), -JudyL(3), -JudySL(3), -JudyHS(3), -
-malloc(), -
-the Judy website, - -http://judy.sourceforge.net, -for more information and Application Notes. -
- - diff --git a/libjudy/doc/ext/JudyHS_3.htm b/libjudy/doc/ext/JudyHS_3.htm deleted file mode 100644 index 66d60b5fde..0000000000 --- a/libjudy/doc/ext/JudyHS_3.htm +++ /dev/null @@ -1,197 +0,0 @@ - - - -JudyHS(3) - - - - - - -
JudyHS(3) JudyHS(3)
-

- -

NAME
-
-JudyHS macros - C library for creating and accessing a dynamic array, -using an array-of-bytes of Length as an Index and a word -as a Value. - -

-

SYNOPSIS
-
-
-cc [flags] sourcefiles -lJudy
-
-#include <Judy.h>
-
-Word_t  * PValue;                           // JudyHS array element
-int       Rc_int;                           // return flag
-Word_t    Rc_word;                          // full word return value
-Pvoid_t   PJHSArray = (Pvoid_t) NULL;       // initialize JudyHS array
-uint8_t * Index;                            // array-of-bytes pointer
-Word_t    Length;                           // number of bytes in Index
-
-JHSI( PValue,  PJHSArray, Index, Length);   // JudyHSIns()
-JHSD( Rc_int,  PJHSArray, Index, Length);   // JudyHSDel()
-JHSG( PValue,  PJHSArray, Index, Length);   // JudyHSGet()
-JHSFA(Rc_word, PJHSArray);                  // JudyHSFreeArray()
-
- -
DESCRIPTION
-
-A JudyHS array is the equivalent of an array of word-sized -value/pointers. An Index is a pointer to an array-of-bytes of -specified length: Length. Rather than using a null terminated -string, this difference from JudySL(3) -allows strings to contain all bits (specifically the null character). -This new addition (May 2004) to Judy arrays is a hybird using the best -capabilities of hashing and Judy methods. JudyHS does not have a -poor performance case where knowledge of the hash algorithm can be used -to degrade the performance. -

-Since JudyHS is based on a hash method, Indexes are not stored in -any particular order. Therefore the JudyHSFirst(), JudyHSNext(), -JudyHSPrev() and JudyHSLast() neighbor search functions are not -practical. The Length of each array-of-bytes can be from 0 to -the limits of malloc() (about 2GB). -

-The hallmark of JudyHS is speed with scalability, but memory -efficiency is excellent. The speed is very competitive with the best -hashing methods. The memory efficiency is similar to a linked list of -the same Indexes and Values. JudyHS is designed to -scale from 0 to billions of Indexes. -

-A JudyHS array is allocated with a NULL pointer -

-Pvoid_t PJHSArray = (Pvoid_t) NULL;
-
-

-Because the macro forms of the API have a simpler error handling -interface than the equivalent -functions, -they are the preferred way to use JudyHS. -

-

-JHSI(PValue, PJHSArray, Index, Length) // JudyHSIns()
-
-Given a pointer to a JudyHS array (PJHSArray), insert an -Index string of length: Length and a Value into the -JudyHS array: PJHSArray. If the Index is successfully -inserted, the Value is initialized to 0. If the Index was -already present, the Value is not modified. -

-Return PValue pointing to Value. Your program should use -this pointer to read or modify the Value, for example: -

-Value = *PValue;
-*PValue = 1234;
-
-

-Note: -JHSI() and JHSD can reorganize the JudyHS array. -Therefore, pointers returned from previous JudyHS calls become -invalid and must be re-acquired (using JHSG()). -

-

JHSD(Rc_int, PJHSArray, Index, Length) // JudyHSDel()
-
-Given a pointer to a JudyHS array (PJHSArray), delete the -specified Index along with the Value from the JudyHS -array. -

-Return Rc_int set to 1 if successfully removed from the array. -Return Rc_int set to 0 if Index was not present. -

-

JHSG(PValue, PJHSArray, Index, Length) // JudyHSGet()
-
-Given a pointer to a JudyHS array (PJHSArray), -find Value associated with Index. -

-Return PValue pointing to Index's Value. -Return PValue set to NULL if the Index was not present. -

-

JHSFA(Rc_word, PJHSArray) // JudyHSFreeArray()
-
-Given a pointer to a JudyHS array (PJHSArray), free the entire array. -

-Return Rc_word set to the number of bytes freed and PJHSArray set to NULL. - -

-

ERRORS: See: Judy_3.htm#ERRORS
-
-

-

EXAMPLES
-
-Show how to program with the JudyHS macros. This program will print -duplicate lines and their line number from stdin. -

-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-#include <Judy.h>
-
-//  Compiled:
-//  cc -O PrintDupLines.c -lJudy -o PrintDupLines
-
-#define MAXLINE 1000000                 /* max fgets length of line */
-uint8_t   Index[MAXLINE];               // string to check
-
-int     // Usage:  PrintDupLines < file
-main()
-{
-    Pvoid_t   PJArray = (PWord_t)NULL;  // Judy array.
-    PWord_t   PValue;                   // Judy array element pointer.
-    Word_t    Bytes;                    // size of JudyHS array.
-    Word_t    LineNumb = 0;             // current line number
-    Word_t    Dups = 0;                 // number of duplicate lines
-
-    while (fgets(Index, MAXLINE, stdin) != (char *)NULL)
-    {
-        LineNumb++;                     // line number
-
-        // store string into array
-        JHSI(PValue, PJArray, Index, strlen(Index)); 
-        if (PValue == PJERR)            // See ERRORS section
-        {
-            fprintf(stderr, "Out of memory -- exit\n");
-            exit(1);
-        }
-        if (*PValue == 0)               // check if duplicate
-        {
-            Dups++;
-            printf("Duplicate lines %lu:%lu:%s", *PValue, LineNumb, Index);
-        }
-        else
-        {
-            *PValue = LineNumb;         // store Line number
-        }
-    }
-    printf("%lu Duplicates, free JudyHS array of %lu Lines\n", 
-                    Dups, LineNumb - Dups);
-    JHSFA(Bytes, PJArray);              // free JudyHS array
-    printf("JudyHSFreeArray() free'ed %lu bytes of memory\n", Bytes);
-    return (0);
-}
-
- -

-

AUTHOR
-
-JudyHS was invented and implemented by Doug Baskins after retiring from Hewlett-Packard. - -

-

SEE ALSO
-
-Judy(3), -Judy1(3), -JudyL(3), -JudySL(3), -
-malloc(), -
-the Judy website, - -http://judy.sourceforge.net, -for further information and Application Notes. - - diff --git a/libjudy/doc/ext/JudyHS_funcs_3.htm b/libjudy/doc/ext/JudyHS_funcs_3.htm deleted file mode 100644 index 01c8dff439..0000000000 --- a/libjudy/doc/ext/JudyHS_funcs_3.htm +++ /dev/null @@ -1,150 +0,0 @@ - - - -JudyHS_funcs(3) - - - - - - -
JudyHS_funcs(3) JudyHS_funcs(3)
-

-

- -
NAME
-
-JudyHS functions - -C library for creating and accessing a dynamic array, -using an array-of-bytes of a length: Length as an Index and a word -as a Value. - -

-

SYNOPSIS
-
-
-PPvoid_t JudyHSIns(PPvoid_t PPJHS, void *Index, Word_t Length, PJError_t PJError);
-int      JudyHSDel(PPvoid_t PPJHS, void *Index, Word_t Length, PJError_t PJError);
-PPvoid_t JudyHSGet(Pcvoid_t  PJHS, void *Index, Word_t Length, PJError_t PJError);
-Word_t   JudyHSFreeArray(PPvoid_t PPJHS, PJError_t PJError);
-
- -

-

DESCRIPTION
-
-A macro equivalent exists for each function call. Because the macro -forms are sometimes faster and have a simpler error handling interface -than the equivalent functions, they are the preferred way of calling the -JudyHS functions. -See JudyHS(3) -for more information. -The function call definitions are included here for completeness. -

-One of the difficulties in using the JudyHS function calls lies in -determining whether to pass a pointer or the address of a pointer. -Since the functions that modify the JudyHS array must also modify the -pointer to the JudyHS array, you must pass the address of the pointer -rather than the pointer itself. -This often leads to hard-to-debug programmatic errors. -In practice, the macros allow the compiler to catch programming -errors when pointers instead of addresses of pointers are passed. -

-The JudyHS function calls have an additional parameter beyond those -specified in the macro calls. This parameter is either a pointer to an -error structure, or NULL (in which case the error information is -not returned -- only PJERR in the return parameter). -

-In the following descriptions, the functions are described in -terms of how the macros use them. -This is the suggested use -of the macros after your program has been fully debugged. -When the JUDYERROR_NOTEST macro is not specified, -an error structure is declared to store error information -returned from the JudyHS functions when an error occurs. -

-Notice the placement of the & in the different functions. -

-

-
JudyHSIns(&PJHS, Index, Length, &JError)
-
-
-#define JHSI(PValue, PJHS, Index) \
-   PValue = JudyLIns(&PJHS, Index, PJE0)
-
-
-

-

JudyHSDel(&PJHS, Index, Length, &JError)
-
-
-#define JHSD(Rc_int, PJHS, Index, Length) \
-   Rc_int = JudyHSDel(&PJHS, Index, Length, PJE0)
-
-
-

-

JudyHSGet(PJHS, Index, Length)
-
-
-#define JHSG(PValue, PJHS, Index, Length) \
-   PValue = JudyHSIns(PJHS, Index, Length)
-
-
-

-

JudyHSFreeArray(&PJHS, &JError)
-
-
-#define JHSFA(Rc_word, PJHS) \
-   Rc_word = JudyHSFreeArray(&PJHS, PJE0)
-
-
-
-

-Definitions for all the Judy functions, the types -Pvoid_t, -Pcvoid_t, -PPvoid_t, -Word_t , -JError_t, -and -PJError_t, -the constants -NULL, -JU_ERRNO_*, -JERR, -PPJERR, -and -PJE0 -are provided in the Judy.h header file -(/usr/include/Judy.h). -Note: Callers should define JudyHS arrays as type Pvoid_t, -which can be passed by value to functions that take -Pcvoid_t (constant Pvoid_t), -and also by address to functions that take PPvoid_t. -

-The return type from most JudyHS functions is PPvoid_t so -that the values stored in the array can be pointers to other objects, -which is a typical usage, or cast to a Word_t * when a pointer -to a value is required instead of a pointer to a pointer. - -

-

AUTHOR
-
-JudyHS was invented and implemented by Doug Baskins after retiring from Hewlett-Packard. - -

-

SEE ALSO
-
-Judy(3), -Judy1(3), -JudyL(3), -JudySL(3), -JudyHS(3), -
-malloc(), -
-the Judy website, - -http://judy.sourceforge.net, -for more information and Application Notes. -
- - diff --git a/libjudy/doc/ext/JudyL_3.htm b/libjudy/doc/ext/JudyL_3.htm deleted file mode 100644 index 5b6b8802a0..0000000000 --- a/libjudy/doc/ext/JudyL_3.htm +++ /dev/null @@ -1,358 +0,0 @@ - - - -JudyL(3) - - - - - - -
JudyL(3) JudyL(3)
-

-

- -
NAME
-
-JudyL macros - -C library for creating and accessing a dynamic array of words, using -a word as an index. - -

-

SYNOPSIS
-
-
-cc [flags] sourcefiles -lJudy
-
-#include <Judy.h>
-
-int      Rc_int;                          // return code - integer
-Word_t   Rc_word;                         // return code - unsigned word
-Word_t   Index, Index1, Index2, Nth;
-PWord_t  PValue;                          // pointer to return value
-Pvoid_t PJLArray = (Pvoid_t) NULL;        // initialize JudyL array
-
-JLI( PValue,  PJLArray, Index);          // JudyLIns()
-JLD( Rc_int,  PJLArray, Index);          // JudyLDel()
-JLG( PValue,  PJLArray, Index);          // JudyLGet()
-JLC( Rc_word, PJLArray, Index1, Index2); // JudyLCount()
-JLBC(PValue,  PJLArray, Nth, Index);     // JudyLByCount()
-JLFA(Rc_word, PJLArray);                 // JudyLFreeArray()
-JLMU(Rc_word, PJLArray);                 // JudyLMemUsed()
-JLF( PValue,  PJLArray, Index);          // JudyLFirst()
-JLN( PValue,  PJLArray, Index);          // JudyLNext()
-JLL( PValue,  PJLArray, Index);          // JudyLLast()
-JLP( PValue,  PJLArray, Index);          // JudyLPrev()
-JLFE(Rc_int,  PJLArray, Index);          // JudyLFirstEmpty()
-JLNE(Rc_int,  PJLArray, Index);          // JudyLNextEmpty()
-JLLE(Rc_int,  PJLArray, Index);          // JudyLLastEmpty()
-JLPE(Rc_int,  PJLArray, Index);          // JudyLPrevEmpty()
-
- -

-

-DESCRIPTION -
-
-A JudyL array is the equivalent of an array of word-sized values. -A Value is addressed by an Index (key). -The array may be sparse, and the Index may be any word-sized number. -Memory to support the array is allocated as index/value pairs are inserted, -and released as index/value pairs are deleted. A JudyL array can also be -thought of as a mapper, that is "map" a word to another word/pointer. -

-As with an ordinary array, there are no duplicate indexes in a JudyL array. -

-The value may be used as a scalar, or a pointer to a structure or block of data -(or even another Judy array). -

-A JudyL array is allocated with a NULL pointer -

-Pvoid_t PJLArray = (Pvoid_t) NULL;
-
-

-Using the macros described here, rather than the -JudyL function calls, -the default error handling sends a -message to the standard error and terminates the program with exit(1);. -For other error handling methods, see the -ERRORS section. -JLI( PValue, PJLArray, Index); // JudyLIns() -

-Because the macro forms are sometimes faster and have a simpler error -handling interface than the equivalent -JudyL functions, -they are the preferred way of calling the JudyL functions. -

-

-
JLI(PValue, PJLArray, Index) // JudyLIns()
-
-Insert an Index and Value into the JudyL array PJLArray. -If the Index is successfully inserted, -the Value is initialized to 0. If the Index was already present, -the Value is not modified. -

-Return PValue pointing to Value. -Your program can use this pointer to read or modify Value until the next -JLI() (insert), JLD() (delete) or JLFA() (freearray) -is executed on PJLArray. Examples: -

-*PValue = 1234;
-Value = *PValue;
-
-

-Return PValue set to PJERR if a malloc() fail occured. -Note: -JLI() and JLD() reorganize the JudyL array. -Therefore, PValue returned from previous JudyL calls become -invalid and must be re-acquired. -

-

JLD(Rc_int, PJLArray, Index) // JudyLDel()
-
-Delete the Index/Value pair from the JudyL array. -

-Return Rc_int set to 1 if successful. -Return Rc_int set to 0 if Index was not present. -Return Rc_int set to JERR if a malloc() fail occured. -

-

JLG(PValue, PJLArray, Index) // JudyLGet()
-
-Get the pointer PValue associated with Index in the PJLArray Judy array. -

-Return PValue pointing to Value. -Return PValue set to NULL if the Index was not present. -Return PValue set to PJERR if a malloc() fail occured. -

-

JLC(Rc_word, PJLArray, Index1, Index2) // JudyLCount()
-
-Count the number of indexes present in the JudyL array PJLArray between -Index1 and Index2 (inclusive). -

-Return Rc_word set to the count. -A return value of 0 can be valid as a count. -

-To count all indexes present in a JudyL array, use: -

-JLC(Rc_word, PJLArray, 0, -1);
-
-

-

JLBC(PValue, PJLArray, Nth, Index) // JudyLByCount()
-
-Locate the Nth index that is present in the JudyL array -PJLArray (Nth = 1 returns the first index present). -

-Return PValue pointing to its Value and Index -set to the Nth index if found, otherwise return -PValue set to NULL (the value of Index -is undefined). -

-

JLFA(Rc_word, PJLArray) // JudyLFreeArray()
-
-Given a pointer to a JudyL array, free the entire array (much faster -than using a -JLN(), JLD() loop). -

-Return Rc_word set to the number of bytes freed and PJLArray -set to NULL. -

-

JLMU(Rc_word, PJLArray) // JudyLMemUsed()
-
-Return Rc_word set to the number of bytes of memory malloc()'ed -by PJLArray. -This is a very fast routine, and may be used before and after -a JLI() or JLD() call with little performance impact. -

-

JudyL Search Functions
-
-JLF(), JLN(), JLL(), JLP() -allow you to search for indexes -in the array. -You may search inclusively or exclusively, -in either forward or reverse directions. -If successful, -Index is returned set to the found index, and -PValue is returned set to a pointer to Index's Value. -If unsuccessful, -PValue is returned set to NULL, -and Index contains no useful information. -PValue must be tested for non-NULL prior -to using Index, -since a search failure is possible. -

-JLFE(), JLNE(), JLLE(), JLPE() allow you to search for -indexes that are not present ("empty") in the array. -You may search inclusively or exclusively, -in either forward or reverse directions. -If successful, Index is returned set to a not present ("empty") index, and -Rc_int is returned set to 1. -If unsuccessful, Rc_int is returned set to 0, and and Index contains no useful information. -Rc_int must be checked prior to using Index, since a search failure is possible. -

-

JLF(PValue, PJLArray, Index) // JudyLFirst()
-
-Search (inclusive) for the first index present that is equal to or greater than the -passed Index. -(Start with Index = 0 to find the first index in the array.) -JLF() is typically used to begin a sorted-order scan of -the indexes present in a JudyL array. -

-

JLN(PValue, PJLArray, Index) // JudyLNext()
-
-Search (exclusive) for the next index present that is greater than the passed -Index. -JLN() is typically used to continue a sorted-order scan of -the indexes present in a JudyL array, or to locate a "neighbor" of a given index. -

-

JLL(PValue, PJLArray, Index) // JudyLLast()
-
-Search (inclusive) for the last index present that is equal to or less than the passed Index. -(Start with Index = -1, that is, all ones, to find the last index in the array.) -JLL() is typically used to begin a reverse-sorted-order -scan of the indexes present in a JudyL array. -

-

JLP(PValue, PJLArray, Index) // JudyLPrev()
-
-Search (exclusive) for the previous index present that is less than the -passed Index. -JLP() is typically used to continue a reverse-sorted-order -scan of the indexes present in a JudyL array, or to locate a "neighbor" of -a given index. -

-

JLFE(Rc_int, PJLArray, Index) // JudyLFirstEmpty()
-
-Search (inclusive) for the first index absent that is equal to or greater than the passed -Index. -(Start with Index = 0 to find the first index absent in the array.) -

-

JLNE(Rc_int, PJLArray, Index) // JudyLNextEmpty()
-
-Search (exclusive) for the next index absent that is greater than the passed Index. -

-

JLLE(Rc_int, PJLArray, Index) // JudyLLastEmpty()
-
-Search (inclusive) for the last index absent that is equal to or less than the passed Index. -(Start with Index = -1, that is, all ones, to find the last index absent -in the array.) -

-

JLPE(Rc_int, PJLArray, Index) // JudyLPrevEmpty()
-
-Search (exclusive) for the previous index absent that is less than the passed -Index. -
- -

-

Multi-dimensional JudyL Arrays
-
-Storing a pointer to another JudyL array in a JudyL array's Value -is a simple way to support dynamic multi-dimensional arrays. -These arrays (or trees) built using JudyL arrays are very fast and -memory efficient. (In fact, that is how JudySL and JudyHS are implemented). -An arbitrary number of dimensions can be realized this way. -To terminate the number of dimensions (or tree), the Value pointer is -marked to NOT point to another Judy array. A JLAP_INVALID flag is -used in the least significant bit(s) of the pointer. -After the flag JLAP_INVALID is removed, it is used as a pointer to the users data. -The Judy.h header file defines JLAP_INVALID. -See code fragment below. -

-Note: The current version of Judy.h changed this flag from 0x4 to 0x1 -to allow for a malloc() that does not deliver memory on an 8 byte -aligned boundry (such as old versions of valgrind). -

-The following example code segment can be used to determine whether or -not a pointer points to another JudyL: -

-

-PValue = (PWord_t)PMultiDimArray;
-
-for (Dim = 0; ;Dim++)
-{
-   if (PValue == (PWord_t)NULL) goto IndexNotFound;
-
-   /* Advance to next dimension in array */
-   JLG(PValue, (Pvoid_t)*PValue, Index[Dim]);
-
-   /* Check if pointer to user buffer: */
-   if (*PValue & JLAP_INVALID)) break;
-}
-UPointer = (UPointer_t) (*PValue & ~JLAP_INVALID);  // mask and cast.
-printf("User object pointer is 0x%lx\n", (Word_t) UPointer);
-       ...
-
-

-Note: This works because malloc() guarantees to return a pointer -with the least bit(s) == 0x0. -You must remove JLAP_INVALID before using the pointer. -

- -

-

ERRORS: See: Judy_3.htm#ERRORS
-
- -

-

EXAMPLE
-
-Read a series of index/value pairs from the standard input, store -in a JudyL array, and then print out in sorted order. -

-

-#include <stdio.h>
-#include <Judy.h>
-
-Word_t   Index;                     // array index
-Word_t   Value;                     // array element value
-Word_t * PValue;                    // pointer to array element value
-int      Rc_int;                    // return code
-
-Pvoid_t  PJLArray = (Pvoid_t) NULL; // initialize JudyL array
-
-while (scanf("%lu %lu", &Index, &Value))
-{
-    JLI(PValue, PJLArray, Index);
-    If (PValue == PJERR) goto process_malloc_failure;
-    *PValue = Value;                 // store new value
-}
-// Next, visit all the stored indexes in sorted order, first ascending,
-// then descending, and delete each index during the descending pass.
-
-Index = 0;
-JLF(PValue, PJLArray, Index);
-while (PValue != NULL)
-{
-    printf("%lu %lu\n", Index, *PValue));
-    JLN(PValue, PJLArray, Index);
-}
-
-Index = -1;
-JLL(PValue, PJLArray, Index);
-while (PValue != NULL)
-{
-    printf("%lu %lu\n", Index, *PValue));
-
-    JLD(Rc_int, PJLArray, Index);
-    if (Rc_int == JERR) goto process_malloc_failure;
-
-    JLP(PValue, PJLArray, Index);
-}
-
- -

-

AUTHOR
-
-Judy was invented by Doug Baskins and implemented by Hewlett-Packard. - -

-

SEE ALSO
-
-Judy(3), -Judy1(3), -JudySL(3), -JudyHS(3), -
-malloc(), -
- -http://judy.sourceforge.net, -for more information and Application Notes. - - diff --git a/libjudy/doc/ext/JudyL_funcs_3.htm b/libjudy/doc/ext/JudyL_funcs_3.htm deleted file mode 100644 index a06092cd17..0000000000 --- a/libjudy/doc/ext/JudyL_funcs_3.htm +++ /dev/null @@ -1,248 +0,0 @@ - - - -JudyL_funcs(3) - - - - - - -
JudyL_funcs(3) JudyL_funcs(3)
-

-

- -
NAME
-
-JudyL functions - -C library for creating and accessing a dynamic array of words, using -any value of a word as an index - -

-

SYNOPSIS
-
-
-PPvoid_t JudyLIns(       PPvoid_t PPJLArray, Word_t    Index, PJError_t PJError);
-int      JudyLDel(       PPvoid_t PPJLArray, Word_t    Index, PJError_t PJError);
-PPvoid_t JudyLGet(       Pcvoid_t  PJLArray, Word_t    Index, PJError_t PJError);
-Word_t   JudyLCount(     Pcvoid_t  PJLArray, Word_t    Index1, Word_t    Index2, PJError_t PJError);
-PPvoid_t JudyLByCount(   Pcvoid_t  PJLArray, Word_t    Nth,  Word_t * PIndex,  PJError_t PJError);
-Word_t   JudyLFreeArray( PPvoid_t PPJLArray, PJError_t PJError);
-Word_t   JudyLMemUsed(   Pcvoid_t  PJLArray);
-PPvoid_t JudyLFirst(     Pcvoid_t  PJLArray, Word_t * PIndex, PJError_t PJError);
-PPvoid_t JudyLNext(      Pcvoid_t  PJLArray, Word_t * PIndex, PJError_t PJError);
-PPvoid_t JudyLLast(      Pcvoid_t  PJLArray, Word_t * PIndex, PJError_t PJError);
-PPvoid_t JudyLPrev(      Pcvoid_t  PJLArray, Word_t * PIndex, PJError_t PJError);
-int      JudyLFirstEmpty(Pcvoid_t  PJLArray, Word_t * PIndex, PJError_t PJError);
-int      JudyLNextEmpty( Pcvoid_t  PJLArray, Word_t * PIndex, PJError_t PJError);
-int      JudyLLastEmpty( Pcvoid_t  PJLArray, Word_t * PIndex, PJError_t PJError);
-int      JudyLPrevEmpty( Pcvoid_t  PJLArray, Word_t * PIndex, PJError_t PJError);
-
- -

-

DESCRIPTION
-
-A macro equivalent exists for each function call. -Because the macro forms are sometimes faster and have a simpler error -handling interface than the equivalent functions, -they are the preferred way of calling the JudyL functions. -See JudyL(3) -for more information. -The function call definitions are included here for completeness. -

-One of the difficulties in using the JudyL function calls lies in -determining whether to pass a pointer or the address of a pointer. -Since the functions that modify the JudyL array must also modify the -pointer to the JudyL array, you must pass the address of the pointer -rather than the pointer itself. -This often leads to hard-to-debug programmatic errors. -In practice, the macros allow the compiler to catch programming -errors when pointers instead of addresses of pointers are passed. -

-The JudyL function calls have an additional parameter beyond -those specified in the macro calls. This parameter is either a -pointer to an error structure, or NULL (in which case the -detailed error information is not returned). -

-In the following descriptions, the functions are described in -terms of how the macros use them (only in the case of -#define JUDYERROR_NOTEST 1). This is the suggested use -of the macros after your program has been fully debugged. -When the JUDYERROR_NOTEST macro is not specified, -an error structure is declared to store error information -returned from the JudyL functions when an error occurs. -

-Notice the placement of the & in the different functions. -

-

-
JudyLIns(&PJLArray, Index, &JError)
-
-
-#define JLI(PValue, PJLArray, Index)  \
-   PValue = JudyLIns(&PJLArray, Index, PJE0)
-
-
-

-

JudyLDel(&PJLArray, Index, &JError)
-
-
-#define JLD(Rc_int, PJLArray, Index)  \
-   Rc_int = JudyLDel(&PJLArray, Index, PJE0)
-
-
-

-

JudyLGet(PJLArray, Index, &JError)
-
-
-#define JLG(PValue, PJLArray, Index)  \
-   PValue = JudyLGet(PJLArray, Index, PJE0)
-
-
-

-

JudyLCount(PJLArray, Index1, Index2, &JError)
-
-
-#define JLC(Rc_word, PJLArray, Index1, Index2)  \
-   Rc_word = JudyLCount(PJLArray, Index1, Index2, PJE0)
-
-
-

-

JudyLByCount(PJLArray, Nth, &Index, &JError)
-
-
-#define JLBC(PValue, PJLArray, Nth, Index) \
-   PValue = JudyLByCount(PJLArray, Nth, &Index, PJE0)
-
-
-

-

JudyLFreeArray(&PJLArray, &JError)
-
-
-#define JLFA(Rc_word, PJLArray) \
-   Rc_word = JudyLFreeArray(&PJLArray, PJE0)
-
-
-

-

JudyLMemUsed(PJLArray)
-
-
-#define JLMU(Rc_word, PJLArray) \
-   Rc_word = JudyLMemUsed(PJLArray)
-
-
-

-

JudyLFirst(PJLArray, &Index, &JError)
-
-
-#define JLF(PValue, PJLArray, Index) \
-   PValue = JudyLFirst(PJLArray, &Index, PJEO)
-
-
-

-

JudyLNext(PJLArray, &Index, &JError)
-
-
-#define JLN(PValue, PJLArray, Index) \
-   PValue = JudyLNext(PJLArray, &Index, PJEO)
-
-
-

-

JudyLLast(PJLArray, &Index, &JError)
-
-
-#define JLL(PValue, PJLArray, Index) \
-   PValue = JudyLLast(PJLArray, &Index, PJEO)
-
-
-

-

JudyLPrev(PJLArray, &Index, &JError)
-
-
-#define JLP(PValue, PJLArray, Index) \
-   PValue = JudyLPrev(PJLArray, &Index, PJEO)
-
-
-

-

JudyLFirstEmpty(PJLArray, &Index, &JError)
-
-
-#define JLFE(Rc_int, PJLArray, Index) \
-   Rc_int = JudyLFirstEmpty(PJLArray, &Index, PJEO)
-
-
-

-

JudyLNextEmpty(PJLArray, &Index, &JError)
-
-
-#define JLNE(Rc_int, PJLArray, Index) \
-   Rc_int = JudyLNextEmpty(PJLArray, &Index, PJEO)
-
-
-

-

JudyLLastEmpty(PJLArray, &Index, &JError)
-
-
-#define JLLE(Rc_int, PJLArray, Index) \
-   Rc_int = JudyLLastEmpty(PJLArray, &Index, PJEO)
-
-
-

-

JudyLPrevEmpty(PJLArray, &Index, &JError)
-
-
-#define JLPE(Rc_int, PJLArray, Index) \
-   Rc_int = JudyLPrevEmpty(PJLArray, &Index, PJEO)
-
-
-
-

-Definitions for all the Judy functions, the types -Pvoid_t, -Pcvoid_t, -PPvoid_t, -Word_t, -JError_t, -and -PJError_t, -the constants -NULL, -JU_ERRNO_*, -JERR, -PPJERR, -and -PJE0, -are provided in the Judy.h header file -(/usr/include/Judy.h). -Note: Callers should define JudyL arrays as type Pvoid_t, -which can be passed by value to functions that take -Pcvoid_t (constant Pvoid_t), -and also by address to functions that take PPvoid_t. -

-The return type from most JudyL functions is PPvoid_t so -that the values stored in the array can be pointers to other objects, -which is a typical usage, or cast to a Word_t * when a pointer -to a Value is required instead of a pointer to a pointer. - -

-

AUTHOR
-
-Judy was invented by Doug Baskins and implemented by Hewlett-Packard. - -

-

SEE ALSO
-
-Judy(3), -Judy1(3), -JudyL(3), -JudySL(3), -JudyHS(3), -
-malloc(), -
-the Judy website, - -http://judy.sourceforge.net, -for more information and Application Notes. -
- - diff --git a/libjudy/doc/ext/JudySL_3.htm b/libjudy/doc/ext/JudySL_3.htm deleted file mode 100644 index 05ed5c5d5b..0000000000 --- a/libjudy/doc/ext/JudySL_3.htm +++ /dev/null @@ -1,246 +0,0 @@ - - - -JudySL(3) - - - - - - -
JudySL(3) JudySL(3)
-

-

- -
NAME
-
-JudySL macros - -C library for creating and accessing a dynamic array, using -a null-terminated string as an Index (associative array) - -

-

SYNOPSIS
-
-
-cc [flags] sourcefiles -lJudy
-
-#include <Judy.h>
-
-#define MAXLINELEN 1000000           // define maximum string length
-
-Word_t * PValue;                     // JudySL array element
-uint8_t  Index[MAXLINELEN];          // string
-int      Rc_int;                     // return value
-Word_t   Rc_word;                    // full word return value
-
-Pvoid_t PJSLArray = (Pvoid_t) NULL;  // initialize JudySL array
-
-JSLI( PValue,  PJSLArray, Index);   // JudySLIns()
-JSLD( Rc_int,  PJSLArray, Index);   // JudySLDel()
-JSLG( PValue,  PJSLArray, Index);   // JudySLGet()
-JSLFA(Rc_word, PJSLArray);          // JudySLFreeArray()
-JSLF( PValue,  PJSLArray, Index);   // JudySLFirst()
-JSLN( PValue,  PJSLArray, Index);   // JudySLNext()
-JSLL( PValue,  PJSLArray, Index);   // JudySLLast()
-JSLP( PValue,  PJSLArray, Index);   // JudySLPrev()
-
-
- -

-

DESCRIPTION
-
-A JudySL array is the equivalent of a sorted set of strings, each associated -with a Value (word). -A Value is addressed by an Index (key), which is a null-terminated -character string of any length. -Memory to support the array is allocated as index/value pairs are inserted, -and released as index/value pairs are deleted. -This is a form of associative array, where array elements are also sorted -lexicographically (case-sensitive) by indexes. -This could be thought of as -

-void * JudySLArray["Toto, I don't think we're in Kansas any more"];
-
-

-A JudySL array is allocated with a NULL pointer -

-Pvoid_t PJSLArray = (Pvoid_t) NULL;
-
-As with an ordinary array, there are no duplicate indexes (strings) -in a JudySL array. -

-Using the macros described here, rather than the -JudySL function calls, -the default error handling sends a -message to the standard error and terminates the program with -exit(1). -

-

JSLI(PValue, PJSLArray, Index) // JudySLIns()
-
-Insert an Index string and Value in the JudySL array PJSLArray. -If the Index is successfully inserted, -the Value is initialized to 0. If the Index was already present, -the Value is not modified. -

-Return PValue pointing to Index's Value. -Your program must use this pointer to modify the Value, -for example: -

-*PValue = 1234;
-
-

-Note: -JSLI() and JSLD reorganize the JudySL array. -Therefore, pointers returned from previous JudySL calls become -invalid and must be reacquired. -

-

JSLD(Rc_int, PJSLArray, Index) // JudySLDel()
-
-Delete the specified Index/Value pair (array element) from the -JudySL array. -

-Return Rc_int set to 1 if successful. -array and it was previously inserted. -Return Rc_int set to 0 if Index was not present. -

-

JSLG(PValue, PJSLArray, Index) // JudySLGet()
-
-Get the pointer to Index's Value. -

-Return PValue pointing to Index's Value. -Return PValue set to NULL if the Index was not present. -

-

JSLFA(Rc_word, PJSLArray) // JudySLFreeArray()
-
-Given a pointer to a JudySL array (PJSLArray), free the entire array (much faster -than using a JSLN(), JSLD() loop.) -

-Return Rc_word set to the number of bytes freed and PJSLArray set to NULL. -

-

JudySL Search Functions
-
-The JudySL search functions allow you to search for indexes in the array. -You may search inclusively or exclusively, -in either forward or reverse directions. -

-If successful, -Index is returned set to the found index, and -PValue is returned set to a pointer to Index's Value. -If unsuccessful, -PValue is returned set to NULL, -and Index contains no useful information. -PValue must be tested for non-NULL prior -to using Index, -since a search failure is possible. -

-Note: -To accomodate all possible returns, the Index buffer must be -at least as large -as the largest string stored in the array. -

-

JSLF(PValue, PJSLArray, Index) // JudySLFirst()
-
-Search (inclusive) for the first index present that is equal to or greater than the -passed Index string. -(Start with a null string to find the first index in the array.) -JSLF() is typically used to begin a sorted-order scan of -the valid indexes in a JudySL array. -
-uint8_t Index[MAXLINELEN];
-strcpy (Index, "");
-JSLF(PValue, PJSLArray, Index);
-
-

-

JSLN(PValue, PJSLArray, Index) // JudySLNext()
-
-Search (exclusive) for the next index present that is greater than the passed -Index string. -JSLN() is typically used to continue a sorted-order scan of -the valid indexes in a JudySL array, or to locate a "neighbor" of a given -index. -

-

JSLL(PValue, PJSLArray, Index) // JudySLLast()
-
-Search (inclusive) for the last index present that is equal to or less -than the passed Index string. -(Start with a maximum-valued string to look up the last index in the array, -such as a max-length string of 0xff bytes.) -JSLL() is typically used to begin a reverse-sorted-order -scan of the valid indexes in a JudySL array. -

-

JSLP(PValue, PJSLArray, Index) // JudySLPrev()
-
-Search (exclusive) for the previous index present that is less than the -passed Index string. -JSLP() is typically used to continue a reverse-sorted-order -scan of the valid indexes in a JudySL array, or to locate a "neighbor" of -a given index. - -

-

ERRORS: See: Judy_3.htm#ERRORS
-
- -

-

EXAMPLE of a string sort routine
-

-#include <stdio.h>
-#include <Judy.h>
-
-#define MAXLINE 1000000                 // max string (line) length
-
-uint8_t   Index[MAXLINE];               // string to insert
-
-int     // Usage:  JudySort < file_to_sort
-main()
-{
-    Pvoid_t   PJArray = (PWord_t)NULL;  // Judy array.
-    PWord_t   PValue;                   // Judy array element.
-    Word_t    Bytes;                    // size of JudySL array.
-
-    while (fgets(Index, MAXLINE, stdin) != (char *)NULL)
-    {
-        JSLI(PValue, PJArray, Index);   // store string into array
-        if (PValue == PJERR)            // if out of memory?
-        {                               // so do something
-            printf("Malloc failed -- get more ram\n");
-            exit(1);
-        }
-        ++(*PValue);                    // count instances of string
-    }
-    Index[0] = '\0';                    // start with smallest string.
-    JSLF(PValue, PJArray, Index);       // get first string
-    while (PValue != NULL)
-    {
-        while ((*PValue)--)             // print duplicates
-            printf("%s", Index);
-        JSLN(PValue, PJArray, Index);   // get next string
-    }
-    JSLFA(Bytes, PJArray);              // free array
-
-    fprintf(stderr, "The JudySL array used %lu bytes of memory\n", Bytes);
-    return (0);
-}
-
- -

-

AUTHOR
-
-Judy was invented by Doug Baskins and implemented by Hewlett-Packard. - -

-

SEE ALSO
-
-Judy(3), -Judy1(3), -JudyL(3), -JudyHS(3), -
-malloc(), -
-the Judy website, - -http://judy.sourceforge.net, -for further information and Application Notes. -
- - diff --git a/libjudy/doc/ext/JudySL_funcs_3.htm b/libjudy/doc/ext/JudySL_funcs_3.htm deleted file mode 100644 index e4045bdda4..0000000000 --- a/libjudy/doc/ext/JudySL_funcs_3.htm +++ /dev/null @@ -1,186 +0,0 @@ - - - -JudySL_funcs(3) - - - - - - -
JudySL_funcs(3) JudySL_funcs(3)
-

-

- -
NAME
-
-JudySL functions - -C library for creating and accessing a dynamic array, using -a null-terminated string as an index (associative array) - -

-

SYNOPSIS
-
-
-
-PPvoid_t JudySLIns(      PPvoid_t PPJSLArray, const uint8_t * Index, PJError_t PJError);
-int      JudySLDel(      PPvoid_t PPJSLArray, const uint8_t * Index, PJError_t PJError);
-PPvoid_t JudySLGet(      Pcvoid_t  PJSLArray, const uint8_t * Index, PJError_t PJError);
-Word_t   JudySLFreeArray(PPvoid_t PPJSLArray, PJError_t PJError);
-PPvoid_t JudySLFirst(    Pcvoid_t  PJSLArray,       uint8_t * Index, PJError_t PJError);
-PPvoid_t JudySLNext(     Pcvoid_t  PJSLArray,       uint8_t * Index, PJError_t PJError);
-PPvoid_t JudySLLast(     Pcvoid_t  PJSLArray,       uint8_t * Index, PJError_t PJError);
-PPvoid_t JudySLPrev(     Pcvoid_t  PJSLArray,       uint8_t * Index, PJError_t PJError);
-
- -

-

DESCRIPTION
-
-A macro equivalent exists for each function call. -Because the macro forms are sometimes faster and have a simpler error -handling interface than the equivalent functions, -they are the preferred way of calling the JudySL functions. -See JudySL(3) -for more information. -The function call definitions are included here for completeness. -

-One of the difficulties in using the JudySL function calls lies in -determining whether to pass a pointer or the address of a pointer. -Since the functions that modify the JudySL array must also modify the -pointer to the JudySL array, you must pass the address of the pointer -rather than the pointer itself. -This often leads to hard-to-debug programmatic errors. -In practice, the macros allow the compiler to catch programming -errors when pointers instead of addresses of pointers are passed. -

-The JudySL function calls have an additional parameter beyond -those specified in the macro calls. This parameter is either a -pointer to an error structure, or NULL (in which case the -detailed error information is not returned). -

-In the following descriptions, the functions are described in -terms of how the macros use them (only in the case of -#define JUDYERROR_NOTEST 1). This is the suggested use -of the macros after your program has been fully debugged. -When the JUDYERROR_NOTEST macro is not specified, -an error structure is declared to store error information -returned from the JudySL functions when an error occurs. -

-Notice the placement of the & in the different functions. -

-

-
JudySLIns(&PJSLArray, Index, &JError)
-
-
-#define JSLI(PValue, PJSLArray, Index) \
-   PValue = JudyLIns(&PJSLArray, Index, PJE0)
-
-
-

-

JudySLDel(&PJSLArray, Index, &JError)
-
-
-#define JSLD(Rc_int, PJSLArray, Index) \
-   Rc_int = JudySLDel(&PJSLArray, Index, PJE0)
-
-
-

-

JudySLGet(PJSLArray, Index, &JError)
-
-
-#define JSLG(PValue, PJSLArray, Index) \
-   PValue = JudySLIns(PJSLArray, Index, PJE0)
-
-
-

-

JudySLFreeArray(&PJSLArray, &JError)
-
-
-#define JSLFA(Rc_word, PJSLArray) \
-   Rc_word = JudySLFreeArray(&PJSLArray, PJE0)
-
-
-

-

JudySLFirst(PJSLArray, Index, &JError)
-
-
-#define JSLF(PValue, PJSLArray, Index) \
-   PValue = JudySLFirst(PJSLArray, Index, PJE0)
-
-
-

-

JudySLNext(PJSLArray, Index, &JError)
-
-
-#define JSLN(PValue, PJSLArray, Index) \
-   PValue = JudySLNext(PJSLArray, Index, PJE0)
-
-
-

-

JudySLLast(PJSLArray, Index, &JError)
-
-
-#define JSLL(PValue, PJSLArray, Index) \
-   PValue = JudySLLast(PJSLArray, Index, PJE0)
-
-
-

-

JudySLPrev(PJSLArray, Index, &JError)
-
-
-#define JSLP(PValue, PJSLArray, Index) \
-   PValue = JudySLPrev(PJSLArray, Index, PJE0)
-
-
-
-

-Definitions for all the Judy functions, the types -Pvoid_t, -Pcvoid_t, -PPvoid_t, -Word_t , -JError_t, -and -PJError_t, -the constants -NULL, -JU_ERRNO_*, -JERR, -PPJERR, -and -PJE0 -are provided in the Judy.h header file -(/usr/include/Judy.h). -Note: Callers should define JudySL arrays as type Pvoid_t, -which can be passed by value to functions that take -Pcvoid_t (constant Pvoid_t), -and also by address to functions that take PPvoid_t. -

-The return type from most JudySL functions is PPvoid_t so -that the values stored in the array can be pointers to other objects, -which is a typical usage, or cast to a Word_t * when a pointer -to a value is required instead of a pointer to a pointer. - -

-

AUTHOR
-
-Judy was invented by Doug Baskins and implemented by Hewlett-Packard. - -

-

SEE ALSO
-
-Judy(3), -Judy1(3), -JudyL(3), -JudySL(3), -JudyHS(3), -
-malloc(), -
-the Judy website, - -http://judy.sourceforge.net, -for more information and Application Notes. -
- - diff --git a/libjudy/doc/ext/Judy_3.htm b/libjudy/doc/ext/Judy_3.htm deleted file mode 100644 index 1531a1a096..0000000000 --- a/libjudy/doc/ext/Judy_3.htm +++ /dev/null @@ -1,283 +0,0 @@ - - - -Judy(3) - - - - - - -
Judy(3) Judy(3)
-

- -

NAME
-
-Judy arrays - -C library functions for creating and accessing dynamic arrays -
- -

-

SYNOPSIS
-
-
-Judy1  - maps an Index (word) to a bit
-JudyL  - maps an Index (word) to a Value (word/pointer)
-JudySL - maps an Index (null terminated string) to a Value
-JudyHS - maps an Index (array-of-bytes) of Length to a Value
-
- -

-

DESCRIPTION
-
-The Judy family of functions supports fully dynamic arrays. These -arrays may be indexed by a 32- or 64-bit word (depending on processor -word size), a null terminated string or an array-of-bytes plus length. -A dynamic array (sparsely populated) can also be thought of as a -mapping function or associative memory. -

-A Word_t is a typedef unsigned long int in Judy.h -and must be the same size as sizeof(void *) I.E. a pointer. -

-Judy1 functions: Index is a -Word_t and Value is just a bit or simply -a flag that Index is present or missing from the array. -This can be thought of as a huge bitmap. -

-JudyL functions: Index is a -Word_t and Value is a Word_t. This makes -JudyL a pure word-to-word/pointer mapper. JudySL and -JudyHL are based on this property of JudyL. -

-JudySL functions: Index is a -null-terminated string and Value is a Word_t. -

-JudyHS functions: Index is an -array-of-bytes of length: Length. Value is a -Word_t. This new addition (May 2004) to Judy is a hybird using -the best features of hashing and Judy methods. The author believes -JudyHS is a good replacement for a hashing method when resizing -the hash table is done during population growth. A correctly tuned hash -method with a static hash table size and population is unbeatable -for speed. However, JudyHS will perform better than a hashing -method with smaller and larger populations than the optimum hash table -size. JudyHS does not have a degenerate performance case where -knowledge of the hash algorithm can be exploited. (I.E. JudyHS does -not use a linked list to handle hash collisions, it uses a tree of -JudyL arrays and a virtual hash table size of 4 billion). -

-Judy arrays are both speed- and memory-efficient, with no -tuning or configuration required, across a wide range of index set types -(sequential, periodic, clustered, random). Judy's speed and memory -usage are typically better than other data storage models such as -skiplists, linked lists, binary, ternary, b-trees, or even hashing, and -improves with very large data sets. -

-A Judy array is created merely by defining a null pointer and then -storing (inserting) the first element into the array under that pointer. -The memory used by a Judy array is nearly proportional to the population -(number of elements). -

-Judy has two Application Program Interfaces (APIs): a C macro -interface, and a function call interface. Because the macro forms are -sometimes faster and have a simpler error handling interface than the -equivalent functions, they are the preferred way of using the Judy -functions. -

-Since an initial (empty) Judy array is represented by a null pointer, it -is possible to construct an array of Judy arrays. In other words, a -Judy array's Values (except Judy1) can be pointers to other Judy -arrays. This makes it very simple to construct an array with an -arbitrary number of dimensions or Index sizes. (JudySL and -JudyHS are implemented using JudyL this way). - -

-

A 10 MINUTE TECHNICAL DESCRIPTION
-
-may be found at -http://judy.sourceforge.net/downloads/10minutes.htm - -

-

A 3 HOUR TECHNICAL DESCRIPTION (out of date and a bit corny)
-
-may be found at -http://judy.sourceforge.net/application/shop_interm.pdf - -

-

- DOWNLOADS
-
-Judy source downloads are available at -http://sourceforge.net/projects/judy
-Binarys may be built and installed in a minute or two -after downloading -

-For versions including more platforms and/or new features see: -http://judy.sourceforge.net/downloads/ - -

-

AUTHOR
-
-Judy was invented by Doug Baskins (dougbaskins .AT, yahoo.com) and -implemented by Hewlett-Packard. (Note: Judy is named for the -inventor's sister, after discarding many proposed names.) - -

-

- -FILES
-
-Locations of interest include: -
-http://sourceforge.net/projects/judy - -- project downloads
-file:/usr/share/doc/Judy/ --- for HTML version of man pages.
-/usr/share/doc/Judy/demo/ -- demonstration program source files.
-
-The author attempted to write interesting application notes using -advanced features of Judy. They may be found at -"http://judy.sourceforge.net/application/ -(Some may be out of date). - -

-

ERRORS
-
-A lot of thought (and time) went into making error handling in Judy -simple, while maintaining flexibility and capability. Error handling is -a very boring subject even to write about. So read this short section -and use the recommended second method. It generates the fastest code, -uses the least amount of memory and requires you to write extra code -only for insert/deletes functions. Also it is compatible with the other -two methods. This method is for production code that may want to handle -malloc() fails differently than the Judy default. If the Judy -default method of handling malloc() fails are OK, then use the -first method. -

-There are two (2) categories of Judy error returns, (or for any dynamic ADT): -

-1) User programming errors (bugs) such as memory corruption or -invalid pointers. -
-2) Out-of-memory (malloc() failure) with Insert -(Set) or Delete (Unset) when modifying a Judy -array. Not all calls to insert and delete call malloc(), so they -may succeed even when a call to malloc() would fail. -
-

-There are roughly three (3) methods of handling errors when using -the macros: -

-

-

1) Default Error Handling Method
-
-The default is to print error messages to stderr, for example: -

-

-File 'YourCfile.c', line 1234: JudyLIns(), JU_ERRNO_* == 2, ID == 321
-
-This indicates that an error occurred in the JudyLIns() function -at line 321. Line 1234 is the line in 'YourCfile.c' where the -JLI() call failed. JU_ERRNO_* == 2 is equal to JU_ERRNO_NOMEM -(as defined in the Judy.h file). The ID number indicates the -source line number in the function where the error originated. Your -program then terminates with an exit(1);. By default, both -categories of Judy error returns are printed this way. (The 'ID == 321' -is for die hards that want more detail or for debugging Judy itself.) -
-

-

2) Disable Macro Error Handling
-
-When your program is "bug free", the only errors returned should be -malloc() failures. Therefore all error returns can be treated as -a malloc() failure. By using the below #define, all -error testing and printing is turned off. Additional code needs to be -added to the code that can have malloc() failures. Judy was -designed to leave the same data in the array before the call if a -malloc() fail occurs. (During testing of Judy, we found very few -malloc()/OS's that were bug free after a malloc() failure. -Sometimes it took weeks to discover because most systems go into a -paging frenzy before running out of memory). -
-#define JUDYERROR_NOTEST 1
-
-(in your program code), or -
-cc -DJUDYERROR_NOTEST sourcefile -lJudy
-
-(on your command line). -
-// This is an example of how to program using method two (2).
-    
-JLI(PValue, PLArray, Index);
-if (PValue == PJERR) goto out_of_memory_handling;
-...
-
-JLD(RC_int, PLArray, Index);
-if (RC_int == JERR) goto out_of_memory_handling;
-...
-
-J1S(RC_int, P1Array, Index);
-if (RC_int == JERR) goto out_of_memory_handling;
-...
-
-J1U(RC_int, P1Array, Index);
-if (RC_int == JERR) goto out_of_memory_handling;
-...
-
-
-Note: Without 'JUDYERROR_NOTEST' defined, the 'goto -out_of_memory_handling' will never be executed and will be optimized out -by the compiler. The default method will be used -- Macro will print -error information if an error occurs as explained above. -

-With 'JUDYERROR_NOTEST' defined, the 'goto out_of_memory_handling' will -be executed when an error occurs -- which should only happen when -malloc() fails. -

3) User-Specified JUDYERROR() Macro Method
-
-The JUDYERROR() macro (in Judy.h) provides flexibility for -handling error returns as needed to suit your program while still using -the Judy array macros instead of function calls. You can use a -different JUDYERROR() macro to suit your needs. The following -example is a possible alternative to the default. It is used to -distinguish between the two types of errors (described above), and -explicitly test for the remaining JU_ERRNO_NOMEM errors possible in your -program. -

-

-// This is an example of Judy macro API to continue when out of memory 
-// and print and exit(1) when any other error occurs.
-
-#ifndef JUDYERROR_NOTEST
-#include <stdio.h>  // needed for fprintf()
-
-// This is the macro that the Judy macro APIs use for return codes of -1:
-
-#define JUDYERROR(CallerFile, CallerLine, JudyFunc, JudyErrno, JudyErrID) \
-{                                                                         \
-    if ((JudyErrno) != JU_ERRNO_NOMEM) /* ! a malloc() failure */         \
-    {                                                                     \
-        (void) fprintf(stderr, "File '%s', line %d: %s(), "               \
-            "JU_ERRNO_* == %d, ID == %d\n",                               \
-            CallerFile, CallerLine,                                       \
-            JudyFunc, JudyErrno, JudyErrID);                              \
-        exit(1);                                                          \
-    }                                                                     \
-}
-#endif // JUDYERROR_NOTEST not defined
-
-
-This error handling macro must be included before the #include <Judy.h> -statement in your program. -
- -

-

SEE ALSO
-
-Judy1(3), -JudyL(3), -JudySL(3), -JudyHS(3) - - diff --git a/libjudy/doc/ext/LICENSE b/libjudy/doc/ext/LICENSE deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libjudy/doc/ext/README b/libjudy/doc/ext/README deleted file mode 100644 index f0b0946dc7..0000000000 --- a/libjudy/doc/ext/README +++ /dev/null @@ -1,20 +0,0 @@ -# @(#) $Revision: 4.11 $ - -Judy_3.htm the Judy(3) overview manual entry in HTML format; - normally placed where a web browser can read it - -Judy1_3.htm describes the Judy1*() macros -Judy1_funcs_3.htm describes the Judy1*() functions -JudyL_3.htm describes the JudyL*() macros -JudyL_funcs_3.htm describes the JudyL*() functions -JudySL_3.htm describes the JudySL*() macros -JudySL_funcs_3.htm describes the JudySL*() functions -JudyHS_3.htm describes the JudyHS*() macros -JudyHS_funcs_3.htm describes the JudyHS*() functions - -# Note: The library package README file comes from the following file, but the -# hierarchy of example sources package README files come from each -# corresponding directory: - -README_deliver packaged with other Judy delivered files, renamed to just - "README" in that context diff --git a/libjudy/doc/ext/README_deliver b/libjudy/doc/ext/README_deliver deleted file mode 100644 index f0b0946dc7..0000000000 --- a/libjudy/doc/ext/README_deliver +++ /dev/null @@ -1,20 +0,0 @@ -# @(#) $Revision: 4.11 $ - -Judy_3.htm the Judy(3) overview manual entry in HTML format; - normally placed where a web browser can read it - -Judy1_3.htm describes the Judy1*() macros -Judy1_funcs_3.htm describes the Judy1*() functions -JudyL_3.htm describes the JudyL*() macros -JudyL_funcs_3.htm describes the JudyL*() functions -JudySL_3.htm describes the JudySL*() macros -JudySL_funcs_3.htm describes the JudySL*() functions -JudyHS_3.htm describes the JudyHS*() macros -JudyHS_funcs_3.htm describes the JudyHS*() functions - -# Note: The library package README file comes from the following file, but the -# hierarchy of example sources package README files come from each -# corresponding directory: - -README_deliver packaged with other Judy delivered files, renamed to just - "README" in that context diff --git a/libjudy/doc/int/10minutes.htm b/libjudy/doc/int/10minutes.htm deleted file mode 100644 index 7437f850ef..0000000000 --- a/libjudy/doc/int/10minutes.htm +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - A 10-MINUTE DESCRIPTION OF HOW JUDY ARRAYS WORK AND WHY THEY ARE SO FAST - -
-

- - -A 10-MINUTE DESCRIPTION OF HOW JUDY ARRAYS WORK AND WHY THEY ARE SO FAST

-

- - -By Doug Baskins, doug@sourcejudy.com

-

- - -October 16, 2001, Revised July 2002

-

- - - As the inventor of the Judy algorithm I've been asked repeatedly, "What makes Judy so fast?" The answer is not simple, but finally I can share all of the details. (In June 2002, Judy was opened sourced with a LGPL license and hosted at -http://sourceforge.net/projects/judy - Let's see if I can give you a good understanding in 10 minutes. (The Judy data structures are very well described in another paper, the -Judy Shop Manual -, but it took me about three hours to read!)

-

- - - A Judy tree is generally faster than and uses less memory than contemporary forms of trees such as binary (AVL) trees, b-trees, and skip-lists. When used in the "Judy Scalable Hashing" configuration, Judy is generally faster then a hashing method at all populations. (See also -http://www.sourcejudy.com/application/ -Judy_hashing.

-

- - - -Expanse -, -population -, and -density - are not commonly used terms in tree search literature, so let's define them here:

-
    -
  • - - - -Expanse - is a range of possible keys, such as: 256..511
  • -
  • - - - -Population - is the count of keys contained in an expanse, such as, 260, 300, 499, 500 = 4.
  • -
  • - - - -Density - is used to describe the sparseness of an expanse of keys; density = population / expanse. A density of 1.0 means that all possible keys are set or valid in that expanse.
  • -
-

- - - -Node - and -branch - are used interchangeably in this document.

-

- - - -Key - and -index - are used interchangeably. A Judy tree is thought of as an unbounded Judy array at the API level. The expanse of JudyL or Judy1 arrays are bounded by the expanse of the word (32[64]-bits) used for the index/key. A JudySL array is only bounded by the length of the key string that can be stored in the machine.

-

- - -A (CPU) -cache-line fill - is additional time required to do a read reference from RAM when a word is not found in cache. In today's computers the time for a cache-line fill is in the range of 50..2000 machine instructions. Therefore a cache-line fill should be avoided when fewer than 50 instructions can do the same job. (Modern machines tend to pipeline writes to RAM. They often take no additional time in the Judy design.)

-

- - -Some of the reasons Judy outperforms binary trees, b-trees, and skip-lists:

-
    -
  • - - -Judy rarely compromises speed/space performance for simplicity (Judy will never be called simple except at the API).
  • -
  • - - -Judy is designed to avoid cache-line fills wherever possible. (This is the main design criteria for Judy.)
  • -
  • - - -A b-tree requires a search of each node (branch), resulting in more cache-line fills.
  • -
  • - - -A binary-tree has many more levels (about 8X), resulting in more cache-line fills.
  • -
  • - - -A skip-list is roughly equivalent to a degree-4 (4-ary) tree, resulting in more cache-line fills.
  • -
  • - - -An "expanse"-based digital tree (of which Judy is a variation) never needs balancing as it grows.
  • -
  • - - -A portion (8 bits) of the key is used to subdivide an expanse into sub-trees. Only the remainder of the key need exist in the sub-trees, if at all, resulting in key compression.
  • -
-

- - -The Achilles heel of a simple digital tree is very poor memory utilization, especially when the N in N-ary (the degree or fanout of each branch) increases. The Judy tree design was able to solve this problem. In fact a Judy tree is more memory-efficient than almost any other competitive structure (including a simple linked list). A highly populated linear array[] is the notable exception.

-

- - -From a speed point of view Judy is chiefly a 256-ary digital tree or trie (per D. Knuth Volume 3 definitions). A degree of 256-ary is a somewhat "magic" N-ary for a variety of reasons -- mostly because a byte (the least addressable memory unit) is 8 bits. Also a higher degree means reduced cache-line fills per access. You see the theme here -- avoid cache-line fills like the plague.

-

- - -It is interesting to note that an early version of Judy used branch widening (sometimes called a level-compressed trie). Branch widening opportunities occur primarily in the upper level(s) of the tree. Since a tree is a hierarchy, the upper branches are likely to be in cache, thus branch widening did not significantly reduce the number of actual cache-line fills. Branch widening was removed in later versions of Judy. (However, Judy was also tuned to use as few instructions as possible when an access was likely to be in the cache.)

-

- - -The presence of a CPU cache in modern machines has changed many of the ways to write a performance algorithm. To take advantage of a cache, it is important to leverage as much as possible. In a Judy tree, the presence of a cache results in 1..3 (or more) fewer cache-line fills per access than would be possible without a cache.

-

- - - As a digression, note that a hash method loses the advantages of a cache as the size of the hash table approaches or exceeds the size of the cache. With very large hash tables, the cache is no help at all. Also, hash methods often use a linked list to handle collisions (synonyms) and typically use a slow hash algorithm (greater than 50ns) or suffer from numerous collisions. "Judy Scalable Hashing" is an effective replacement for common hash methods when very high performance is required for small in-cache data sets. (See also -http://www.sourcejudy.com/application/ - Judy_hashing.

-

- - - With an expanse of 2^32 (or 256^4), a maximum of 4 cache-line fills would be required for a worst-case highly populated 256-ary digital tree access. In an expanse of 2^64 (or 256^8), 8 cache-line fills would be the worst case. In practice, Judy does much better than this. The reason is (in part) due to the fact "density" of the keys is seldom the lowest possible number in a "majority" of the sub-expanses. It takes high density combined with high population to increase the depth of a Judy tree. It would take a long time to explain why. The short version is an analogy with sand. It takes a lot of sand to build a tall sand pile, especially if it takes 256 grains to support 1 grain above it. In a 64-bit Judy, it would probably require more RAM than exists on this planet to get it to have 8 levels. A binary tree reaches 8 levels with a population of 256. It is truly remarkable to me how much research has been done on binary trees and still being taught.

-

- - - Judy adapts efficiently to a wide range of populations and data set densities. Since the Judy data structure is a tree of trees, each sub-tree is a static expanse that is optimized to match the "character" or density of the keys it contains. To support this flexibility, in 32[64]-bit Judy there are approximately 25[85] major data structures and a similar number of minor structures. I am going to only describe a few of them so you can infer how density is synergistic with compression.

-

- - -From a memory consumption (size) point of view, a Judy tree shares (does not duplicate) common digits of a key in a tree. This form of key compression is a natural outcome from using a digital tree. This would be very awkward to do in trees balanced by population and, as far as I know, has never been done. Each pointer traversed in a Judy tree points to ever smaller sub-expanses, while decoding another 8 bits of the key. (In a pure digital tree, the keys are not stored in the tree, they are inferred by position.)

-

- - - Now let me try to describe the top of a small Judy (JudyL) tree and the bottom of a highly populated Judy1 tree. A Judy tree with a population of zero is simply a NULL pointer. A JudyL tree with a population of one key is a root pointer to a 2-word object containing a key and and associated value. -A JudyL tree with a population of 2 keys, is 4-word object with 2 values and 2 sorted keys. A tree with a population of 3 keys, is an 8-word object with a count word + 3 values and 3 sorted keys.

-

- - -This continues until the population grows to 32 keys. At this point an actual tree structure is formed with a "compressed" 256-ary node (branch) that decodes the first byte of each key. The value 32 was chosen because this is where a tree structure requires an equivalent number of cache-line fills. All objects below this top branch contain keys that are shortened by at least the first byte.

-

- - -There are three kinds of branches. Two are 1-cache-line fill objects to traverse, and one is a 2-cache-line fill object to traverse. In every path down the tree and at all populations, a maximum of one of the 2-cache-line fill branches is used. This means it is sometimes possible to have 1 additional (the branch design often subtracts 1) cache-line fill than you would expect from a pure 256-ary branch traversal in an otherwise complete Judy tree.

-

- - -On the other extreme, a highly populated Judy1 tree where the key has been decoded down to 1 byte, and the density of a 256-wide sub-expanse of keys grows to greater than 0.094 (25 keys / 256 expanse), a bitmap of 32 bytes (256 bits) is formed from an existing sorted array of 24 1-byte keys. (I am leaving out the handling of the values.) This results in a key using about an average of 1.3 (32/25) bytes of memory (up from 1.0). Note that increasing the density (population) at this point does NOT require more memory for keys. For example, when the density reaches 0.5 (population = 128 / expanse = 256), the memory consumed is about 2 bits ((32/128)*8) per key + some overhead (2.0+ words) for the tree structure.

-

- - -Notice that to insert or delete a key is almost as simple as setting or clearing a bit. Also notice, the memory consumption is almost the same for both 32- and 64-bit Judy trees. Given the same set of keys, both 32- and 64-bit Judy trees have remarkably similar key-memory, depth, and performance. However, the memory consumption for 64-bit Judy is higher because the pointers and values (JudyL) are double the size.

-

- - -In this short writeup it wasn't possible to describe all the data structure details such as: Root, JPM, narrow and rich pointers, linear, bitmap and uncompressed branches, value areas, immediate indexes, terminal nodes (leafs), least compressed form, memory management, fast leaf searches and counting trees.

-

- - - Well I cannot describe Judy in 10 minutes -- what possessed me? I hope you understand some of what I have said and question me on the rest -- particularly those doubts. I will try to elaborate on parts where I get questions. -

- Doug Baskins -
-doug@sourcejudy.com

-
- - diff --git a/libjudy/examples/Judy1Dup.c b/libjudy/examples/Judy1Dup.c deleted file mode 100644 index 75733e0315..0000000000 --- a/libjudy/examples/Judy1Dup.c +++ /dev/null @@ -1,47 +0,0 @@ -/* @(#) $Revision: 4.2 $ $Source: /judy/src/funcs/Judy1Dup.c $ */ - -#include "Judy.h" - -/******************************************************************* - * Name: Judy1Dup - * - * Description: - * Clone (duplicate) a Judy Array. - * - * Parameters: - * PPvoid_t PPDest (OUT) - * Pointer to a new Judy array with the same - * index/value pairs as PSource. - * Any initial value pointed to by PPDest is ignored. - * - * Pvoid_t PSource (IN) - * Ptr to source Judy array being duplicated. - * If PSource is NULL, TRUE is returned since this - * is simply a valid Null Judy array. - * - * JError_t *PJError (OUT) - * Judy error structure pointer. - * - * Returns: - * JERR - error, see PJError - * !JERR - success - */ - -int -Judy1Dup(PPvoid_t PPDest, Pvoid_t PSource, JError_t * PJError) -{ - Pvoid_t newJArray = 0; // new Judy1 array to ppopulate - Word_t kindex; // Key/index - int Ins_rv = 0; // Insert return value - - for (kindex = 0L, Ins_rv = Judy1First(PSource, &kindex, PJError); - Ins_rv == 1; Ins_rv = Judy1Next(PSource, &kindex, PJError)) - { - Ins_rv = Judy1Set(&newJArray, kindex, PJError); - } - if (Ins_rv == JERR) - return Ins_rv; - - *PPDest = newJArray; - return Ins_rv; -} /* Judy1Dup */ diff --git a/libjudy/examples/Judy1Dup.h b/libjudy/examples/Judy1Dup.h deleted file mode 100644 index 36d3e83e02..0000000000 --- a/libjudy/examples/Judy1Dup.h +++ /dev/null @@ -1,31 +0,0 @@ -/* @(#) $Revision: 4.2 $ $Source: /judy/src/funcs/Judy1Dup.H $ */ - -#include - -/* ****************************************************************** - * Name: Judy1Dup - * - * Description: - * Clone (duplicate) a Judy Array. - * - * Parameters: - * PPvoid_t PPDest (OUT) - * Pointer to a new Judy array with the same - * index/value pairs as PSource. - * Any initial value pointed to by PPDest is ignored. - * - * Pvoid_t PSource (IN) - * Ptr to source Judy array being duplicated. - * If PSource is NULL, TRUE is returned since this - * is simply a valid Null Judy array. - * - * JError_t *PJError (OUT) - * Judy error structure pointer. - * - * Returns: - * JERR - error, see PJError - * !JERR - success - */ - -int -Judy1Dup(PPvoid_t PPDest, Pvoid_t PSource, JError_t * PJError); diff --git a/libjudy/examples/Judy1DupCheck.c b/libjudy/examples/Judy1DupCheck.c deleted file mode 100644 index f98d57cebb..0000000000 --- a/libjudy/examples/Judy1DupCheck.c +++ /dev/null @@ -1,80 +0,0 @@ - -/* - * @(#) $Revision: 4.3 $ $Source: /judy/src/funcs/Judy1DupCheck.c $ - * - * Judy1DupCheck.c - * - * Test Judy1Dup.c - */ - -#include -#include -#include "Judy1Dup.h" - -#define LARRAYSIZE(array) sizeof(array)/sizeof(Word_t) - -// fcn to init a Judy array with an array of ulong's -Pvoid_t -ularray2Judy(Word_t *ularray, Word_t ularray_size) -{ - Word_t i; - Pvoid_t PJArray = 0; - JError_t JError; - - for (i = 0L; i < ularray_size; i++) - { - if (Judy1Set(&PJArray, ularray[i], &JError) == JERR) - { - printf("ularray2Judy: Judy1Set failure, error %d\n", - JU_ERRNO(&JError)); - exit(2); - } - } - return PJArray; -} /* ularray2Judy */ - -int -main() -{ - static Word_t knowns[] = { 0, 1, 1024, 4095, 4096, 4097, 4098, 123456 }; - int i; - Pvoid_t PJArray = 0; - Pvoid_t PJArrayNew = 0; - Word_t Index; - int Judy_rv; // Judy Return value - JError_t JError; - - // populate a judy array with known values - PJArray = ularray2Judy(knowns, LARRAYSIZE(knowns)); - - printf("Testing Judy1Dup ..."); - - // dup the judy array - if ((Judy1Dup(&PJArrayNew, PJArray, &JError)) == JERR) - { - printf("Judy1Dup failed: error %d\n", JU_ERRNO(&JError)); - return (2); - } - - // compare the duped array with known values - for (i = 0, Index = 0L, Judy_rv = Judy1First(PJArrayNew, &Index, &JError); - Judy_rv == 1; i++, Judy_rv = Judy1Next(PJArrayNew, &Index, &JError)) - { - if (Index != knowns[i]) - { - printf("Judy1DupCheck Failed: Judy1Dup does not match original\n"); - return (2); - } - } - - if (i != LARRAYSIZE(knowns)) - { - printf - ("Judy1DupCheck Failed: Judy1Dup does not match original (too short)\n"); - exit(2); - } - else - printf("Ok\n"); - - return (0); -} diff --git a/libjudy/examples/Judy1Op.c b/libjudy/examples/Judy1Op.c deleted file mode 100644 index 3bd541b436..0000000000 --- a/libjudy/examples/Judy1Op.c +++ /dev/null @@ -1,150 +0,0 @@ - -/* - * @(#) $Revision: 4.2 $ $Source: /judy/src/funcs/Judy1Op.c $ - * - * Judy1 set operations. - * - * The name of this function, "Judy1Op", was carefully chosen from - * a list of alternatives: - * - * Judy1Op() - It's hard to see that O is a letter and not a zero. - * Judy1Set() - Sounds like you are setting a bit. - * Judy1BS() - BS for Bit Set functions. - * Judy1SO() - SO for Set Operations - * Judy1AndIDontGiveADarn() - too long but goes with - * Judy1WhoseOnFirst() - now called Judy1First() and - * Judy1WhatsOnSecond() - now called Judy1Next() - * - * But Judy1SetOp() would conflict with Judy1Set() if we rename Judy1Set(), so - * Judy1Op() it is. - */ - -#include "Judy.h" -#include "Judy1Op.h" - -/******************************************************************* - * Name: Judy1Op - * - * Description: - * Logical set operations on Judy1 arrays. - * - * All of these operations can be done on an unbounded array because - * the dreaded "NOT" is avoided. The "NOT"'s can be implemented - * when Judy1 supports them. - * - * Parameters: - * PPvoid_t PPDest (OUT) - * Ptr to the Judy destination array. - * Any initial value pointed to by PPDest is ignored. - * - * Pvoid_t PSet1 (IN) - * First Judy1 set. - * This will be NULL for an empty Judy1 array. - * - * Pvoid_t PSet2 (IN) - * Second Judy1 set. - * This will be NULL for an empty Judy1 array. - * - * Word_t Operation (IN) - * Operation to be performed (ie. PSet1 {Operation} PSet2) - * Valid Operation values are: - * - * JUDY1OP_AND - intersection of two sets - * JUDY1OP_OR - union of two sets - * JUDY1OP_ANDNOT - set1 with set2 removed - * - * JError_t * PJError (OUT) - * Judy Error struct used to return Judy error. - * - * Returns: - * !JERR if successful - * JERR if an error occurs - * If the error is a caller error (invalid Operation or no PPDest) - * then the PJError error code will be JU_ERRNO_NONE. - */ -int -Judy1Op(PPvoid_t PPDest, Pvoid_t PSet1, Pvoid_t PSet2, - Word_t Operation, JError_t * PJError) -{ - Pvoid_t PnewJArray = 0; // empty Judy array - Word_t Index1 = 0L; - Word_t Index2 = 0L; - int Judy_rv; - - if (!PPDest) - return JERR; - - switch (Operation) - { - case JUDY1OP_AND: - // step through each array looking for index matches - Judy_rv = Judy1First(PSet1, &Index1, PJError); - Judy_rv += Judy1First(PSet2, &Index2, PJError); - while (Judy_rv == 2) - { - if (Index1 < Index2) - { - Index1 = Index2; - Judy_rv = Judy1First(PSet1, &Index1, PJError); - } - else if (Index1 > Index2) - { - Index2 = Index1; - Judy_rv = Judy1First(PSet2, &Index2, PJError); - } - else - { - // do the AND - Judy_rv = Judy1Set(&PnewJArray, Index1, PJError); - if (Judy_rv == JERR) - return JERR; - - // bump to the next bits - Judy_rv = Judy1Next(PSet1, &Index1, PJError); - Judy_rv += Judy1Next(PSet2, &Index2, PJError); - } - } - *PPDest = PnewJArray; - break; - - case JUDY1OP_OR: - /* Set all the bits from PSet1 */ - for (Index1 = 0L, Judy_rv = Judy1First(PSet1, &Index1, PJError); - Judy_rv == 1; Judy_rv = Judy1Next(PSet1, &Index1, PJError)) - { - if (Judy1Set(&PnewJArray, Index1, PJError) == JERR) - return JERR; - } - - /* Set all the bits from PSet2 */ - for (Index1 = 0L, Judy_rv = Judy1First(PSet2, &Index1, PJError); - Judy_rv == 1; Judy_rv = Judy1Next(PSet2, &Index1, PJError)) - { - if (Judy1Set(&PnewJArray, Index1, PJError) == JERR) - return JERR; - } - *PPDest = PnewJArray; - break; - - case JUDY1OP_ANDNOT: - // PSet1 with PSet2 removed - // 0010 = PSet1(1010) ANDNOT PSet2(1100) - - for (Index1 = 0L, Judy_rv = Judy1First(PSet1, &Index1, PJError); - Judy_rv == 1; Judy_rv = Judy1Next(PSet1, &Index1, PJError)) - { - // if bit doesn't exist in PSet2, then add to result - if (0 == Judy1Test(PSet2, Index1, PJError)) - { - if (Judy1Set(&PnewJArray, Index1, PJError) == JERR) - return JERR; - } - } - *PPDest = PnewJArray; - break; - - default: - return JERR; - } - return !JERR; -} /* Judy1Op */ diff --git a/libjudy/examples/Judy1Op.h b/libjudy/examples/Judy1Op.h deleted file mode 100644 index 207a5fd558..0000000000 --- a/libjudy/examples/Judy1Op.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _JUDY1OP_INCLUDED -#define _JUDY1OP_INCLUDED - -// @(#) $Revision: 4.1 $ $Source: /judy/src/funcs/Judy1Op.h $ -// -// HEADER FILE FOR EXPORTED FEATURES FROM Judy1Op(). - -#define JUDY1OP_AND 1L -#define JUDY1OP_OR 2L -#define JUDY1OP_ANDNOT 3L - -extern int Judy1Op(PPvoid_t PPDest, Pvoid_t PSet1, Pvoid_t PSet2, - Word_t Operation, JError_t * PJError); - -#endif // ! _JUDY1OP_INCLUDED diff --git a/libjudy/examples/Judy1OpCheck.c b/libjudy/examples/Judy1OpCheck.c deleted file mode 100644 index b138718a6d..0000000000 --- a/libjudy/examples/Judy1OpCheck.c +++ /dev/null @@ -1,150 +0,0 @@ -// @(#) $Revision: 4.3 $ $Source: /judy/src/funcs/Judy1OpCheck.c $ - -/* - * Judy1OpCheck.c - * - * Test Judy1Op.c - * - * Returns 0 if successful, -1 if test fails. - */ - -#include -#include -#include "Judy.h" -#include "Judy1Op.h" - -#define LARRAYSIZE(array) sizeof(array)/sizeof(Word_t) - -static Word_t set1[] = { 0L, - 5L, - 6L, - 7L, - 1024L, - 11111L, - 65534L, - 65535L, - 65536L, - 555555L, - ULONG_MAX -}; - -static Word_t set2[] = { 7L, - 9L, - 1023L, - 12345L, - 65535L, - ULONG_MAX -}; - -static Word_t resultAND[] = { 7L, - 65535L, - ULONG_MAX -}; - -static Word_t resultOR[] = { 0L, - 5L, - 6L, - 7L, - 9L, - 1023L, - 1024L, - 11111L, - 12345L, - 65534L, - 65535L, - 65536L, - 555555L, - ULONG_MAX -}; - -static Word_t result1ANDNOT2[] = { 0L, - 5L, - 6L, - 1024L, - 11111L, - 65534L, - 65536L, - 555555L -}; - -static Word_t result2ANDNOT1[] = { 9L, - 1023L, - 12345L -}; - -// fcn to init a Judy array with an array of ulong's -void * -ularray2Judy(Word_t *ularray, Word_t ularray_size) -{ - Word_t i; - void *PJArray = 0; - JError_t JError; - - for (i = 0L; i < ularray_size; i++) - { - if (Judy1Set(&PJArray, ularray[i], &JError) == JERR) - { - printf("ularray2Judy: Judy1Set failure, error %d\n", - JU_ERRNO(&JError)); - exit(2); - } - } - return PJArray; -} /* ularray2Judy */ - -// fcn to test Judy1Op and check the results -void -testandcheck(void *PJSet1, void *PJSet2, Word_t operation, - char *opstr, Word_t *result, int result_size) -{ - void *PJArrayNew; - Word_t Index; - int i; - int judy_rv = 0; - JError_t JError; - - printf("Testing Judy1Op(%s) ...", opstr); - if (Judy1Op(&PJArrayNew, PJSet1, PJSet2, operation, &JError) == JERR) - printf(" failed, error %d\n", JU_ERRNO(&JError)); - else - { // check results - for (i = 0, Index = 0L, judy_rv = - Judy1First(PJArrayNew, &Index, &JError); judy_rv == 1; - i++, judy_rv = Judy1Next(PJArrayNew, &Index, &JError)) - { - if ((i >= result_size) || (Index != result[i])) - { - printf("Failed\n"); - return; - } - } - if (i > result_size) - printf("Failed\n"); - else - printf("Ok\n"); - } - return; -} - -int -main() -{ - void *PJSet1 = 0; - void *PJSet2 = 0; - - // Test Judy1Op - // init PJSet1 and PJSet2 - PJSet1 = ularray2Judy(set1, LARRAYSIZE(set1)); - PJSet2 = ularray2Judy(set2, LARRAYSIZE(set2)); - - testandcheck(PJSet1, PJSet2, JUDY1OP_AND, "AND", - resultAND, LARRAYSIZE(resultAND)); - testandcheck(PJSet1, PJSet2, JUDY1OP_OR, "OR", - resultOR, LARRAYSIZE(resultOR)); - testandcheck(PJSet1, PJSet2, JUDY1OP_ANDNOT, "1ANDNOT2", - result1ANDNOT2, LARRAYSIZE(result1ANDNOT2)); - testandcheck(PJSet2, PJSet1, JUDY1OP_ANDNOT, "2ANDNOT1", - result2ANDNOT1, LARRAYSIZE(result2ANDNOT1)); - - return (0); -} diff --git a/libjudy/examples/Makefile b/libjudy/examples/Makefile deleted file mode 100644 index a85c98c0a6..0000000000 --- a/libjudy/examples/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -CCFLAGS += -ggdb -LIBS = -lJudy - -all: Judy1DupCheck Judy1OpCheck - -Judy1DupCheck: Judy1Dup.c Judy1DupCheck.c - $(CC) $(CCFLAGS) -o $@ $^ $(LIBS) - -Judy1OpCheck: Judy1Op.c Judy1OpCheck.c - $(CC) $(CCFLAGS) -o $@ $^ $(LIBS) - -clean: - rm -f Judy1DupCheck Judy1OpCheck *.o diff --git a/libjudy/examples/README b/libjudy/examples/README deleted file mode 100644 index 6e440b6994..0000000000 --- a/libjudy/examples/README +++ /dev/null @@ -1,8 +0,0 @@ -This directory contains example programs that show some of the many ways Judy -can be utilized, in other words it contains useful applications of Judy. - -Judy1Dup: Clone (duplicate) a Judy Array. - -Judy1Op: Support Logical "set" operations on Judy1 arrays. - -See the source code for more information. diff --git a/libjudy/install-sh b/libjudy/install-sh deleted file mode 100755 index a43fed406c..0000000000 --- a/libjudy/install-sh +++ /dev/null @@ -1,323 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2005-05-14.22 - -# This originates from X11R5 (mit/util/bin/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -chmodcmd="$chmodprog 0755" -chowncmd= -chgrpcmd= -stripcmd= -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src= -dst= -dir_arg= -dstarg= -no_target_directory= - -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: --c (ignored) --d create directories instead of installing files. --g GROUP $chgrpprog installed files to GROUP. --m MODE $chmodprog installed files to MODE. --o USER $chownprog installed files to USER. --s $stripprog installed files. --t DIRECTORY install into DIRECTORY. --T report an error if DSTFILE is a directory. ---help display this help and exit. ---version display version info and exit. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG -" - -while test -n "$1"; do - case $1 in - -c) shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - --help) echo "$usage"; exit $?;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t) dstarg=$2 - shift - shift - continue;; - - -T) no_target_directory=true - shift - continue;; - - --version) echo "$0 $scriptversion"; exit $?;; - - *) # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - test -n "$dir_arg$dstarg" && break - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dstarg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" - shift # fnord - fi - shift # arg - dstarg=$arg - done - break;; - esac -done - -if test -z "$1"; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src ;; - esac - - if test -n "$dir_arg"; then - dst=$src - src= - - if test -d "$dst"; then - mkdircmd=: - chmodcmd= - else - mkdircmd=$mkdirprog - fi - else - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dstarg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dstarg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst ;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dstarg: Is a directory" >&2 - exit 1 - fi - dst=$dst/`basename "$src"` - fi - fi - - # This sed command emulates the dirname command. - dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` - - # Make sure that the destination directory exists. - - # Skip lots of stat calls in the usual case. - if test ! -d "$dstdir"; then - defaultIFS=' - ' - IFS="${IFS-$defaultIFS}" - - oIFS=$IFS - # Some sh's can't handle IFS=/ for some reason. - IFS='%' - set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` - shift - IFS=$oIFS - - pathcomp= - - while test $# -ne 0 ; do - pathcomp=$pathcomp$1 - shift - if test ! -d "$pathcomp"; then - $mkdirprog "$pathcomp" - # mkdir can fail with a `File exist' error in case several - # install-sh are creating the directory concurrently. This - # is OK. - test -d "$pathcomp" || exit - fi - pathcomp=$pathcomp/ - done - fi - - if test -n "$dir_arg"; then - $doit $mkdircmd "$dst" \ - && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } - - else - dstfile=`basename "$dst"` - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - trap '(exit $?); exit' 1 2 13 15 - - # Copy the file name to the temp name. - $doit $cpprog "$src" "$dsttmp" && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && - - # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ - || { - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - if test -f "$dstdir/$dstfile"; then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ - || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ - || { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit 1 - } - else - : - fi - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - } - } - fi || { (exit 1); exit 1; } -done - -# The final little trick to "correctly" pass the exit status to the exit trap. -{ - (exit 0); exit 0 -} - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/libjudy/ltmain.sh b/libjudy/ltmain.sh deleted file mode 100644 index 6d056ecf33..0000000000 --- a/libjudy/ltmain.sh +++ /dev/null @@ -1,7880 +0,0 @@ -# Generated from ltmain.m4sh. - -# ltmain.sh (GNU libtool) 2.2.4 -# Written by Gordon Matzigkeit , 1996 - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print informational messages (default) -# --version print version information -# -h, --help print short or 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. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.4 Debian-2.2.4-0ubuntu4 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION="2.2.4 Debian-2.2.4-0ubuntu4" -TIMESTAMP="" -package_revision=1.2976 - -# 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 - -# NLS nuisances: We save the old values to restore during execute mode. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" - fi" -done - -$lt_unset CDPATH - - - - - -: ${CP="cp -f"} -: ${ECHO="echo"} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SED="/bin/sed"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} -: ${Xsed="$SED -e 1s/^X//"} - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -exit_status=$EXIT_SUCCESS - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" - -dirname="s,/[^/]*$,," -basename="s,^.*/,," - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - -# Generated shell functions inserted here. - -# 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: -# In the unlikely event $progname began with a '-', it would play havoc with -# func_echo (imagine progname=-n), so we prepend ./ in that case: -func_dirname_and_basename "$progpath" -progname=$func_basename_result -case $progname in - -*) progname=./$progname ;; -esac - -# Make sure we have an absolute path for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=$func_dirname_result - progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" - ;; - *) - save_IFS="$IFS" - IFS=: - for progdir in $PATH; do - IFS="$save_IFS" - test -x "$progdir/$progname" && break - done - IFS="$save_IFS" - test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([`"$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Re-`\' parameter expansions in output of double_quote_subst that were -# `\'-ed in input to the same. If an odd number of `\' preceded a '$' -# in input to double_quote_subst, that '$' was protected from expansion. -# Since each input `\' is now two `\'s, look for any number of runs of -# four `\'s followed by two `\'s and then a '$'. `\' that '$'. -bs='\\' -bs2='\\\\' -bs4='\\\\\\\\' -dollar='\$' -sed_double_backslash="\ - s/$bs4/&\\ -/g - s/^$bs2$dollar/$bs&/ - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g - s/\n//g" - -# Standard options: -opt_dry_run=false -opt_help=false -opt_quiet=false -opt_verbose=false -opt_warning=: - -# func_echo arg... -# Echo program name prefixed message, along with the current mode -# name if it has been set yet. -func_echo () -{ - $ECHO "$progname${mode+: }$mode: $*" -} - -# func_verbose arg... -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $opt_verbose && func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 -} - -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 - - # bash bug again: - : -} - -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" -} -help="Try \`$progname --help' for more information." ## default - - -# func_grep expression filename -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_mkdir_p directory-path -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - my_directory_path="$1" - my_dir_list= - - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" - - # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` - done - my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" - - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} - - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "X$my_tmpdir" | $Xsed -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () -{ - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac - - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac -} - - -# func_quote_for_expand arg -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "X$1" | $Xsed \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac - - case $my_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac - - func_quote_for_expand_result="$my_arg" -} - - -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - - - - -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} - -# func_usage -# Echo short help message to standard output and exit. -func_usage () -{ - $SED -n '/^# Usage:/,/# -h/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - $ECHO - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help -# Echo long help message to standard output and exit. -func_help () -{ - $SED -n '/^# Usage:/,/# Report bugs to/ { - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - s*\$LTCFLAGS*'"$LTCFLAGS"'* - s*\$LD*'"$LD"'* - s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ - p - }' < "$progpath" - exit $? -} - -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - func_error "missing argument for $1" - exit_cmd=exit -} - -exit_cmd=: - - - - - -# Check that we have a working $ECHO. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell, and then maybe $ECHO will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </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 -} - -# Parse options once, thoroughly. This comes as soon as possible in -# the script to make things like `libtool --version' happen quickly. -{ - - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - esac - - # Parse non-mode specific arguments: - while test "$#" -gt 0; do - opt="$1" - shift - - case $opt in - --config) func_config ;; - - --debug) preserve_args="$preserve_args $opt" - func_echo "enabling shell trace mode" - opt_debug='set -x' - $opt_debug - ;; - - -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break - execute_dlfiles="$execute_dlfiles $1" - shift - ;; - - --dry-run | -n) opt_dry_run=: ;; - --features) func_features ;; - --finish) mode="finish" ;; - - --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break - 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 $opt" - exit_cmd=exit - break - ;; - esac - - mode="$1" - shift - ;; - - --preserve-dup-deps) - opt_duplicate_deps=: ;; - - --quiet|--silent) preserve_args="$preserve_args $opt" - opt_silent=: - ;; - - --verbose| -v) preserve_args="$preserve_args $opt" - opt_silent=false - ;; - - --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break - preserve_args="$preserve_args $opt $1" - func_enable_tag "$1" # tagname is set here - shift - ;; - - # Separate optargs to long options: - -dlopen=*|--mode=*|--tag=*) - func_opt_split "$opt" - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} - shift - ;; - - -\?|-h) func_usage ;; - --help) opt_help=: ;; - --version) func_version ;; - - -*) func_fatal_help "unrecognized option \`$opt'" ;; - - *) nonopt="$opt" - break - ;; - esac - done - - - case $host in - *cygwin* | *mingw* | *pw32*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_duplicate_deps - ;; - esac - - # Having warned about all mis-specified options, bail out if - # anything was wrong. - $exit_cmd $EXIT_FAILURE -} - -# 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 -} - - -## ----------- ## -## Main. ## -## ----------- ## - -$opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi - - test -z "$mode" && func_fatal_error "error: you must specify a MODE." - - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$mode' for more information." -} - - -# 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 () -{ - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} - -# func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function implements the same check as func_lalib_p without -# resorting to external programs. To this end, it redirects stdin and -# closes it afterwards, without saving the original file descriptor. -# As a safety measure, use it only where a negative result would be -# fatal anyway. Works if `file' does not exist. -func_lalib_unsafe_p () -{ - lalib_p=no - if test -r "$1" && exec 5<&0 <"$1"; then - for lalib_p_l in 1 2 3 4 - do - read lalib_p_line - case "$lalib_p_line" in - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; - esac - done - exec 0<&5 5<&- - fi - test "$lalib_p" = yes -} - -# func_ltwrapper_script_p file -# True iff FILE is a libtool wrapper script -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_script_p () -{ - func_lalib_p "$1" -} - -# func_ltwrapper_executable_p file -# True iff FILE is a libtool wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_executable_p () -{ - func_ltwrapper_exec_suffix= - case $1 in - *.exe) ;; - *) func_ltwrapper_exec_suffix=.exe ;; - esac - $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 -} - -# func_ltwrapper_scriptname file -# Assumes file is an ltwrapper_executable -# uses $file to determine the appropriate filename for a -# temporary ltwrapper_script. -func_ltwrapper_scriptname () -{ - func_ltwrapper_scriptname_result="" - if func_ltwrapper_executable_p "$1"; then - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" - fi -} - -# func_ltwrapper_p file -# True iff FILE is a libtool wrapper script or wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_p () -{ - func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" -} - - -# func_execute_cmds commands fail_cmd -# Execute tilde-delimited COMMANDS. -# If FAIL_CMD is given, eval that upon failure. -# FAIL_CMD may read-access the current command in variable CMD! -func_execute_cmds () -{ - $opt_debug - save_ifs=$IFS; IFS='~' - for cmd in $1; do - IFS=$save_ifs - eval cmd=\"$cmd\" - func_show_eval "$cmd" "${2-:}" - done - IFS=$save_ifs -} - - -# func_source file -# Source FILE, adding directory component if necessary. -# Note that it is not necessary on cygwin/mingw to append a dot to -# FILE even if both FILE and FILE.exe exist: automatic-append-.exe -# behavior happens only for exec(3), not for open(2)! Also, sourcing -# `FILE.' does not work on cygwin managed mounts. -func_source () -{ - $opt_debug - case $1 in - */* | *\\*) . "$1" ;; - *) . "./$1" ;; - esac -} - - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - $opt_debug - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" - done - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" - done - case "$@ " in - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac - fi -} - - - -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' - else - write_lobj=none - fi - - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T <?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname - - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - removelist="$removelist $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi - - $opt_dry_run || $RM $removelist - removelist="$removelist $lockfile" - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi - - func_mkdir_p "$xdir$objdir" - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - command="$command -o $lobj" - fi - - func_show_eval_locale "$command" \ - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - func_show_eval '$MV "$output_obj" "$lobj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - - # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - command="$command -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" - func_show_eval_locale "$command" \ - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - func_show_eval '$MV "$output_obj" "$obj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - fi - - $opt_dry_run || { - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - removelist=$lockfile - $RM "$lockfile" - fi - } - - exit $EXIT_SUCCESS -} - -$opt_help || { -test "$mode" = compile && func_mode_compile ${1+"$@"} -} - -func_mode_help () -{ - # We need to display help for each of the modes. - case $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 building PIC objects only - -prefer-non-pic try to building 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 - -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 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 - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -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 \`$mode'" - ;; - esac - - $ECHO - $ECHO "Try \`$progname --help' for more information about other modes." - - exit $? -} - - # Now that we've collected a possible --mode arg, show help if necessary - $opt_help && func_mode_help - - -# func_mode_execute arg... -func_mode_execute () -{ - $opt_debug - # The first argument is the command name. - cmd="$nonopt" - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - test -f "$file" \ - || func_fatal_help "\`$file' is not a file" - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$lib' is not a valid libtool archive" - - # Read the libtool library. - dlname= - library_names= - func_source "$file" - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && \ - func_warning "\`$file' was not linked with \`-export-dynamic'" - continue - fi - - func_dirname "$file" "" "." - dir="$func_dirname_result" - - if test -f "$dir/$objdir/$dlname"; then - dir="$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 - -*) ;; - *) - # 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_quote_for_eval "$file" - args="$args $func_quote_for_eval_result" - done - - if test "X$opt_dry_run" = Xfalse; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - $ECHO "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - fi -} - -test "$mode" = execute && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - func_execute_cmds "$finish_cmds" 'admincmds="$admincmds -'"$cmd"'"' - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS - - $ECHO "X----------------------------------------------------------------------" | $Xsed - $ECHO "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - $ECHO - $ECHO "If you ever happen to want to link against installed libraries" - $ECHO "in a given directory, LIBDIR, you must either use libtool, and" - $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" - $ECHO "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" - $ECHO " during execution" - fi - if test -n "$runpath_var"; then - $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" - $ECHO " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $ECHO - - $ECHO "See any operating system documentation about shared libraries for" - 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 "X----------------------------------------------------------------------" | $Xsed - exit $EXIT_SUCCESS -} - -test "$mode" = finish && func_mode_finish ${1+"$@"} - - -# func_mode_install arg... -func_mode_install () -{ - $opt_debug - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $ECHO "X$nonopt" | $GREP shtool >/dev/null; then - # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " - arg=$1 - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - func_quote_for_eval "$arg" - install_prog="$install_prog$func_quote_for_eval_result" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - install_prog="$install_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 -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" - - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - func_fatal_help "\`$destdir' must be an absolute directory name" - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$file' is not a valid libtool archive" - - library_names= - old_library= - relink_command= - func_source "$file" - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - func_dirname "$file" "/" "" - dir="$func_dirname_result" - dir="$dir$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -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 "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "X$relink_command" | $Xsed -e "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_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme="$stripme" - case $host_os in - cygwin* | mingw* | pw32*) - case $realname in - *.dll.a) - tstripme="" - ;; - esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - func_execute_cmds "$postinstall_cmds" 'exit $?' - fi - - # Install the pseudo-library for information purposes. - func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - func_lo2o "$destfile" - staticdest=$func_lo2o_result - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - func_fatal_help "cannot copy a libtool object to \`$destfile'" - ;; - esac - - # Install the libtool object if requested. - test -n "$destfile" && \ - func_show_eval "$install_prog $file $destfile" 'exit $?' - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - func_lo2o "$file" - staticobj=$func_lo2o_result - func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - func_stripname '' '.exe' "$file" - file=$func_stripname_result - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin*|*mingw*) - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - wrapper=$func_ltwrapper_scriptname_result - else - func_stripname '' '.exe' "$file" - wrapper=$func_stripname_result - fi - ;; - *) - wrapper=$file - ;; - esac - if func_ltwrapper_script_p "$wrapper"; then - notinst_deplibs= - relink_command= - - func_source "$wrapper" - - # Check the variables that should have been set. - test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script \`$wrapper'" - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - func_source "$lib" - fi - libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - $opt_dry_run || { - if test "$finalize" = yes; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_silent || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink \`$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file="$outputname" - else - func_warning "cannot relink \`$file'" - fi - } - else - # Install the binary that we compiled earlier. - file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done - - for file in $staticlibs; do - func_basename "$file" - name="$func_basename_result" - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - func_show_eval "$install_prog \$file \$oldlib" 'exit $?' - - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $oldlib" 'exit $?' - fi - - # Do each command in the postinstall commands. - func_execute_cmds "$old_postinstall_cmds" 'exit $?' - done - - test -n "$future_libdirs" && \ - func_warning "remember to run \`$progname --finish$future_libdirs'" - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi -} - -test "$mode" = install && func_mode_install ${1+"$@"} - - -# func_generate_dlsyms outputname originator pic_p -# Extract symbols from dlprefiles and create ${outputname}S.o with -# a dlpreopen symbol table. -func_generate_dlsyms () -{ - $opt_debug - my_outputname="$1" - my_originator="$2" - my_pic_p="${3-no}" - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` - my_dlsyms= - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms="${my_outputname}S.c" - else - func_error "not configured to extract global symbols from dlpreopened files" - fi - fi - - if test -n "$my_dlsyms"; then - case $my_dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${my_outputname}.nm" - - func_show_eval "$RM $nlist ${nlist}S ${nlist}T" - - # Parse the name list into a source file. - func_verbose "creating $output_objdir/$my_dlsyms" - - $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" - - $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_verbose "extracting global C symbols from \`$progfile'" - $opt_dry_run || eval "$NM $progfile | $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* ) - 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* ) - 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" - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - done - - $opt_dry_run || { - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $MV "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if $GREP -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - $GREP -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' - else - $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" - fi - - $ECHO >> "$output_objdir/$my_dlsyms" "\ - -/* The mapping between symbol names and symbols. */ -typedef struct { - const char *name; - void *address; -} lt_dlsymlist; -" - case $host in - *cygwin* | *mingw* ) - $ECHO >> "$output_objdir/$my_dlsyms" "\ -/* DATA imports from DLLs on WIN32 con't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs. */" - lt_dlsym_const= ;; - *osf5*) - echo >> "$output_objdir/$my_dlsyms" "\ -/* This system does not cope well with relocations in const data */" - lt_dlsym_const= ;; - *) - lt_dlsym_const=const ;; - esac - - $ECHO >> "$output_objdir/$my_dlsyms" "\ -extern $lt_dlsym_const lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[]; -$lt_dlsym_const lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," - - case $need_lib_prefix in - no) - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - *) - eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - esac - $ECHO >> "$output_objdir/$my_dlsyms" "\ - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_${my_prefix}_LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - } # !$opt_dry_run - - pic_flag_for_symtable= - case "$compile_command " in - *" -static "*) ;; - *) - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; - *-*-hpux*) - pic_flag_for_symtable=" $pic_flag" ;; - *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi - ;; - esac - ;; - esac - symtab_cflags= - for arg in $LTCFLAGS; do - case $arg in - -pie | -fpie | -fPIE) ;; - *) symtab_cflags="$symtab_cflags $arg" ;; - esac - done - - # Now compile the dynamic symbol file. - func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' - - # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' - - # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" - case $host in - *cygwin* | *mingw* ) - if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "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 "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -func_win32_libid () -{ - $opt_debug - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | - $SED -n -e ' - 1,100{ - / I /{ - s,.*,import, - p - q - } - }'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $ECHO "$win32_libid_type" -} - - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - $opt_debug - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $opt_debug - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib="$func_basename_result" - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - func_mkdir_p "$my_xdir" - - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $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 | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} - - - -# func_emit_wrapper arg -# -# 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 variable -# set therein. -# -# arg is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the '.lib' directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=no - if test -n "$1" ; then - func_emit_wrapper_arg1=$1 - fi - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' -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 - ECHO=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$ECHO works! - : - else - # Restart under the correct shell, and then maybe \$ECHO will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $ECHO "\ - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # 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 \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" - - $ECHO "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 - fi - fi - - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $ECHO "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $ECHO "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $ECHO "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 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\ -" -} -# end: func_emit_wrapper - -# 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 -# define setmode _setmode -#else -# include -# include -# ifdef __CYGWIN__ -# include -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0 -#endif - -#ifdef _MSC_VER -# define S_IXUSR _S_IEXEC -# define stat _stat -# ifndef _INTPTR_T_DEFINED -# define intptr_t int -# endif -#endif - -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# 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 */ - -#ifdef __CYGWIN__ -# define FOPEN_WB "wb" -#endif - -#ifndef FOPEN_WB -# define FOPEN_WB "w" -#endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -#undef LTWRAPPER_DEBUGPRINTF -#if defined DEBUGWRAPPER -# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args -static void -ltwrapper_debugprintf (const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); -} -#else -# define LTWRAPPER_DEBUGPRINTF(args) -#endif - -const char *program_name = NULL; - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -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_fatal (const char *message, ...); - -static const char *script_text = -EOF - - func_emit_wrapper yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ "/' -e 's/$/\\n"/' - echo ";" - - cat </dev/null || echo $SHELL` - case $lt_newargv0 in - *.exe | *.EXE) ;; - *) lt_newargv0=$lt_newargv0.exe ;; - esac - ;; - * ) lt_newargv0=$SHELL ;; - esac - fi - - 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; - - LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); - if ((!path) || (!*path)) - return 0; - - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char *concat_name; - - LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", - wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -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) - { - LTWRAPPER_DEBUGPRINTF (("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 - { - char *errstr = strerror (errno); - lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal ("Could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} - -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; - - assert (str != NULL); - assert (pat != NULL); - - len = strlen (str); - patlen = strlen (pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp (str, pat) == 0) - *str = '\0'; - } - return str; -} - -static void -lt_error_core (int exit_status, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} -EOF -} -# end: func_emit_cwrapperexe_src - -# func_mode_link arg... -func_mode_link () -{ - $opt_debug - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= - - avoid_version=no - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module="${wl}-single_module" - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - func_append compile_command " @OUTPUT@" - func_append finalize_command " @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - test -f "$arg" \ - || func_fatal_error "symbol file \`$arg' does not exist" - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - framework) - case $host in - *-*-darwin*) - case "$deplibs " in - *" $qarg.ltframework "*) ;; - *) deplibs="$deplibs $qarg.ltframework" # this is fixed later - ;; - esac - ;; - esac - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat "$save_arg"` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - done - else - func_fatal_error "link input file \`$arg' does not exist" - fi - arg=$save_arg - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - weak) - weak_libs="$weak_libs $arg" - prev= - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$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 - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=framework - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - func_append compile_command " $arg" - func_append finalize_command " $arg" - ;; - esac - continue - ;; - - -L*) - func_stripname '-L' '' "$arg" - dir=$func_stripname_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 "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs System.ltframework" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot) - compiler_flags="$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) - compiler_flags="$compiler_flags $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) new_inherited_linker_flags="$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*) - # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. - func_warning "\`-no-install' is ignored for $host" - func_warning "assuming \`-no-fast-install' instead" - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - func_stripname '-R' '' "$arg" - dir=$func_stripname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -shared) - # The effects of -shared are defined in a previous loop. - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -weak) - prev=weak - continue - ;; - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$compiler_flags $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Wl,*) - func_stripname '-Wl,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" - linker_flags="$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" - ;; - - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -F/path gives path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC - # @file GCC response files - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - func_append compile_command " $arg" - func_append finalize_command " $arg" - compiler_flags="$compiler_flags $arg" - continue - ;; - - # Some other compiler flag. - -* | +*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - done # argument parsing loop - - test -n "$prev" && \ - func_fatal_help "the \`$prevarg' option requires an argument" - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - func_basename "$output" - outputname="$func_basename_result" - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" - # 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_duplicate_deps ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$libs $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if $opt_duplicate_compiler_generated_deps; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$pre_post_deps $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - - case $linkmode in - lib) - passes="conv dlpreopen link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - - for pass in $passes; do - # The preopen pass in lib mode reverses $deplibs; put it back here - # so that -L comes before libs that need it for instance... - if test "$linkmode,$pass" = "lib,link"; then - ## FIXME: Find the place where the list is rebuilt in the wrong - ## order, and fix it there properly - tmp_deplibs= - for deplib in $deplibs; do - tmp_deplibs="$deplib $tmp_deplibs" - done - deplibs="$tmp_deplibs" - fi - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; - esac - fi - if test "$linkmode,$pass" = "lib,dlpreopen"; then - # Collect and forward deplibs of preopened libtool libs - for lib in $dlprefiles; do - # Ignore non-libtool-libs - dependency_libs= - case $lib in - *.la) func_source "$lib" ;; - esac - - # Collect preopened libtool deplibs, except any this library - # has declared as weak libs - for deplib in $dependency_libs; do - deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` - case " $weak_libs " in - *" $deplib_base "*) ;; - *) deplibs="$deplibs $deplib" ;; - esac - done - done - libs="$dlprefiles" - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - compiler_flags="$compiler_flags $deplib" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; - esac - fi - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" - continue - fi - func_stripname '-l' '' "$deplib" - name=$func_stripname_result - if test "$linkmode" = lib; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if func_lalib_p "$lib"; then - library_names= - old_library= - func_source "$lib" - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; - esac - fi - fi - continue - ;; - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" - ;; - *) - func_warning "\`-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - func_stripname '-R' '' "$deplib" - dir=$func_stripname_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - # Linking convenience modules into shared libraries is allowed, - # but linking other static libraries is non-portable. - case " $dlpreconveniencelibs " in - *" $deplib "*) ;; - *) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - $ECHO - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because the file extensions .$libext of this argument makes me believe" - $ECHO "*** that it is just a static archive that I should not use here." - else - $ECHO - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - ;; - esac - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - - if test "$found" = yes || test -f "$lib"; then : - else - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" - fi - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$lib" \ - || func_fatal_error "\`$lib' is not a valid libtool archive" - - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - inherited_linker_flags= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - func_source "$lib" - - # Convert "-framework foo" to "foo.ltframework" - if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do - case " $new_inherited_linker_flags " in - *" $tmp_inherited_linker_flag "*) ;; - *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" - fi - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_duplicate_deps ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - func_fatal_error "cannot -dlopen a convenience library: \`$lib'" - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of \`$ladir'" - func_warning "passing it literally to the linker, although it might fail" - abs_ladir="$ladir" - fi - ;; - esac - func_basename "$lib" - laname="$func_basename_result" - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi - fi # $installed = yes - func_stripname 'lib' '.la' "$laname" - name=$func_stripname_result - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir" && test "$linkmode" = prog; then - func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" - ;; - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if $opt_duplicate_deps ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in - *"$absdir:"*) ;; - *) temp_rpath="$temp_rpath$absdir:" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw*) - # No point in relinking DLLs because paths are not encoded - notinst_deplibs="$notinst_deplibs $lib" - need_relink=no - ;; - *) - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - ;; - esac - # This is a shared library - - # Warn about portability, can't link against -module's on some - # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule="" - for dlpremoduletest in $dlprefiles; do - if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule="$dlpremoduletest" - break - fi - done - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - $ECHO - if test "$linkmode" = prog; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" - else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" - fi - $ECHO "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - 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*) - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - func_basename "$soroot" - soname="$func_basename_result" - func_stripname 'lib' '.dll' "$soname" - newlib=libimp-$func_stripname_result.a - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - func_verbose "extracting exported symbol list from \`$soname'" - func_execute_cmds "$extract_expsyms_cmds" 'exit $?' - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for \`$soname'" - func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not - # link against it, someone is ignoring the earlier warnings - if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null ; then - if test "X$dlopenmodule" != "X$lib"; then - $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - $ECHO - $ECHO "*** And there doesn't seem to be a static archive available" - $ECHO "*** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - elif test -n "$old_library"; then - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - func_fatal_configuration "unsupported hardcode properties" - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && - test "$hardcode_minus_L" != yes && - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - $ECHO - $ECHO "*** Warning: This system can not link to static lib archive $lib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - $ECHO "*** But as you try to build a module library, libtool will still create " - $ECHO "*** a static module, that should work as long as the dlopening application" - $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - $ECHO - $ECHO "*** However, this would only work if libtool was able to extract symbol" - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" - $ECHO "*** not find such a program. So, this module is probably useless." - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) func_stripname '-R' '' "$libdir" - temp_xrpath=$func_stripname_result - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - if $opt_duplicate_deps ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - func_dirname "$deplib" "" "." - dir="$func_dirname_result" - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of \`$dir'" - absdir="$dir" - fi - ;; - esac - if $GREP "^installed=no" $deplib > /dev/null; then - case $host in - *-*-darwin*) - depdepl= - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$absdir/$objdir/$depdepl" ; then - depdepl="$absdir/$objdir/$depdepl" - darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - if test -z "$darwin_install_name"; then - darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - fi - compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" - path= - fi - fi - ;; - *) - path="-L$absdir/$objdir" - ;; - esac - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - test "$absdir" != "$libdir" && \ - func_warning "\`$deplib' seems to be moved" - - path="-L$absdir" - fi - ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test "$pass" = link; then - if test "$linkmode" = "prog"; then - compile_deplibs="$new_inherited_linker_flags $compile_deplibs" - finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" - else - compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for archives" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for archives" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for archives" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for archives" - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for archives" - - test -n "$release" && \ - func_warning "\`-release' is ignored for archives" - - test -n "$export_symbols$export_symbols_regex" && \ - func_warning "\`-export-symbols' is ignored for archives" - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - func_stripname 'lib' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - test "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" - - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - func_stripname '' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - func_stripname '' '.la' "$outputname" - libname=$func_stripname_result - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" - else - $ECHO - $ECHO "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" - - set dummy $rpath - shift - test "$#" -gt 1 && \ - func_warning "ignoring multiple \`-rpath's for a libtool library" - - install_libdir="$1" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for convenience libraries" - - test -n "$release" && \ - func_warning "\`-release' is ignored for convenience libraries" - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - shift - IFS="$save_ifs" - - test -n "$7" && \ - func_fatal_help "too many parameters to \`-version-info'" - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$1" - number_minor="$2" - number_revision="$3" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows|none) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_minor" - lt_irix_increment=no - ;; - *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" - ;; - esac - ;; - no) - current="$1" - revision="$2" - age="$3" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current" - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - ;; - - osf) - func_arith $current - $age - major=.$func_arith_result - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - func_arith $current - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - qnx) - major=".$current" - versuffix=".$current" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - - *) - func_fatal_configuration "unknown library version type \`$version_type'" - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - func_warning "undefined symbols not allowed in $host shared libraries" - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - fi - - func_generate_dlsyms "$libname" "$libname" "yes" - libobjs="$libobjs $symfileobj" - test "X$libobjs" = "X " && libobjs= - - if test "$mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$ECHO "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - removelist="$removelist $p" - ;; - *) ;; - esac - done - test -n "$removelist" && \ - func_show_eval "${RM}r \$removelist" - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` - # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` - # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs System.ltframework" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - deplibs="$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` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null | - $GREP " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $ECHO - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for file magic test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a file magic. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - for a_deplib in $deplibs; do - case $a_deplib in - -l*) - func_stripname -l '' "$a_deplib" - name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$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 \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ - $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $ECHO - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a regex pattern. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ - -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` - done - fi - if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | - $GREP . >/dev/null; then - $ECHO - if test "X$deplibs_check_method" = "Xnone"; then - $ECHO "*** Warning: inter-library dependencies are not supported in this platform." - else - $ECHO "*** Warning: inter-library dependencies are not known to be supported." - fi - $ECHO "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - $ECHO - $ECHO "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - $ECHO "*** a static module, that should work as long as the dlopening" - $ECHO "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - $ECHO - $ECHO "*** However, this would only work if libtool was able to extract symbol" - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" - $ECHO "*** not find such a program. So, this module is probably useless." - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - $ECHO "*** The inter-library dependencies that have been dropped here will be" - $ECHO "*** automatically added whenever a program is linked with this library" - $ECHO "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - $ECHO - $ECHO "*** Since this library must not contain undefined symbols," - $ECHO "*** because either the platform does not support them or" - $ECHO "*** it was explicitly requested with -no-undefined," - $ECHO "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - deplibs="$new_libs" - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - shift - realname="$1" - shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - test "X$libobjs" = "X " && libobjs= - - delfiles= - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols="$output_objdir/$libname.uexp" - delfiles="$delfiles $export_symbols" - fi - - orig_export_symbols= - case $host_os in - cygwin* | mingw*) - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then - # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then - # and it's NOT already a .def file. Must figure out - # which of the given symbols are data symbols and tag - # them as such. So, trigger use of export_symbols_cmds. - # export_symbols gets reassigned inside the "prepare - # the list of exported symbols" if statement, so the - # include_expsyms logic still works. - orig_export_symbols="$export_symbols" - export_symbols= - always_export_symbols=yes - fi - fi - ;; - esac - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - func_len " $cmd" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - else - # The command line is too long to execute in one step. - func_verbose "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' - fi - - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && - test -z "$libobjs"; then - # extract the archives, so we have objects to list. - # TODO: could optimize this to just extract one archive. - whole_archive_flag_spec= - fi - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - else - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - func_len " $test_cmds" && - len=$func_len_result && - test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise - # or, if using GNU ld and skipped_export is not :, use a linker - # script. - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - output_la=`$ECHO "X$output" | $Xsed -e "$basename"` - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript - func_verbose "creating GNU ld script: $output" - $ECHO 'INPUT (' > $output - for obj in $save_libobjs - do - $ECHO "$obj" >> $output - done - $ECHO ')' >> $output - delfiles="$delfiles $output" - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then - output=${output_objdir}/${output_la}.lnk - func_verbose "creating linker input file list: $output" - : > $output - set x $save_libobjs - shift - firstobj= - if test "$compiler_needs_object" = yes; then - firstobj="$1 " - shift - fi - for obj - do - $ECHO "$obj" >> $output - done - delfiles="$delfiles $output" - output=$firstobj\"$file_list_spec$output\" - else - if test -n "$save_libobjs"; then - func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-${k}.$objext - eval test_cmds=\"$reload_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - if test "X$objlist" = X || - test "$len" -lt "$max_cmd_len"; then - func_append objlist " $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$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~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" - fi - delfiles="$delfiles $output" - - else - output= - fi - - if ${skipped_export-false}; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - libobjs=$output - # Append the command to create the export file. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - fi - - test -n "$save_libobjs" && - func_verbose "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - if test -n "$export_symbols_regex" && ${skipped_export-false}; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - - if ${skipped_export-false}; then - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - fi - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - fi - - if test -n "$delfiles"; then - # Append the command to remove temporary files to $cmds. - eval cmds=\"\$cmds~\$RM $delfiles\" - fi - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $dlprefiles - libobjs="$libobjs $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - func_show_eval '${RM}r "$gentop"' - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for objects" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for objects" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for objects" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for objects" - - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for objects" - - test -n "$release" && \ - func_warning "\`-release' is ignored for objects" - - case $output in - *.lo) - test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object \`$output' from non-libtool objects" - - libobj=$output - func_lo2o "$libobj" - obj=$func_lo2o_result - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $opt_dry_run || $RM $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - func_execute_cmds "$reload_cmds" 'exit $?' - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - func_execute_cmds "$reload_cmds" 'exit $?' - fi - - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "\`-release' is ignored for programs" - - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` - ;; - esac - - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - ;; - esac - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=yes - case $host in - *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - esac - if test "$wrappers_required" = no; then - # Replace the output file specification. - compile_command=`$ECHO "X$compile_command" | $Xsed -e '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=$?' - - # Delete the generated files. - if test -f "$output_objdir/${outputname}S.${objext}"; then - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' - fi - - exit $exit_status - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e '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 $?' - - # 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 "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $ECHO for shipping. - if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if 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 - - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } - - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result - else - func_emit_wrapper no > $func_ltwrapper_scriptname_result - fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 - - func_emit_wrapper no > $output - chmod +x $output - ;; - esac - } - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - oldobjs="$oldobjs $symfileobj" - fi - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $dlprefiles - oldobjs="$oldobjs $func_extract_archives_result" - fi - - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - func_basename "$obj" - $ECHO "$func_basename_result" - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $ECHO "copying selected object files to avoid basename conflicts..." - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - func_mkdir_p "$gentop" - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - func_basename "$obj" - objbase="$func_basename_result" - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - func_arith $counter + 1 - counter=$func_arith_result - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" - ;; - *) oldobjs="$oldobjs $obj" ;; - esac - done - fi - eval cmds=\"$old_archive_cmds\" - - func_len " $cmds" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - func_verbose "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - oldobjs= - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - eval test_cmds=\"$old_archive_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - for obj in $save_oldobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - func_append objlist " $obj" - if test "$len" -lt "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - len=$len0 - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - func_execute_cmds "$cmds" 'exit $?' - done - - test -n "$generated" && \ - func_show_eval "${RM}r$generated" - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - func_verbose "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - - for lib in $dlfiles; do - case $lib in - *.la) - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - newdlfiles="$newdlfiles $libdir/$name" - ;; - *) newdlfiles="$newdlfiles $lib" ;; - esac - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - *.la) - # Only pass preopened files to the pseudo-archive (for - # eventual linking with the app. that links it) if we - # didn't already link the preopened objects directly into - # the library: - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - newdlprefiles="$newdlprefiles $libdir/$name" - ;; - esac - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $RM $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Linker flags that can not go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} - -{ test "$mode" = link || test "$mode" = relink; } && - func_mode_link ${1+"$@"} - - -# func_mode_uninstall arg... -func_mode_uninstall () -{ - $opt_debug - RM="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) RM="$RM $arg"; rmforce=yes ;; - -*) RM="$RM $arg" ;; - *) files="$files $arg" ;; - esac - done - - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - func_basename "$file" - name="$func_basename_result" - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if { test -L "$file"; } >/dev/null 2>&1 || - { test -h "$file"; } >/dev/null 2>&1 || - test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if func_lalib_p "$file"; then - func_source $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - - case "$mode" in - clean) - case " $library_names " in - # " " in the beginning catches empty $dlname - *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; - esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if func_lalib_p "$file"; then - - # Read the .lo file - func_source $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" && - test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && - test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - func_stripname '' '.exe' "$file" - file=$func_stripname_result - func_stripname '' '.exe' "$name" - noexename=$func_stripname_result - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles="$rmfiles $file" - ;; - esac - # Do a test to see if this is a libtool program. - if func_ltwrapper_p "$file"; then - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - relink_command= - func_source $func_ltwrapper_scriptname_result - rmfiles="$rmfiles $func_ltwrapper_scriptname_result" - else - relink_command= - func_source $dir/$noexename - fi - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - func_show_eval "$RM $rmfiles" 'exit_status=1' - done - objdir="$origobjdir" - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - func_show_eval "rmdir $dir >/dev/null 2>&1" - fi - done - - exit $exit_status -} - -{ test "$mode" = uninstall || test "$mode" = clean; } && - func_mode_uninstall ${1+"$@"} - -test -z "$mode" && { - help="$generic_help" - func_fatal_help "you must specify a MODE" -} - -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$mode'" - -if test -n "$exec_cmd"; then - eval exec "$exec_cmd" - exit $EXIT_FAILURE -fi - -exit $exit_status - - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: -# vi:sw=2 - diff --git a/libjudy/missing b/libjudy/missing deleted file mode 100755 index 894e786e16..0000000000 --- a/libjudy/missing +++ /dev/null @@ -1,360 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. - -scriptversion=2005-06-08.21 - -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -msg="missing on your system" - -case "$1" in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] - -Send bug reports to ." - exit $? - ;; - - -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 - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). -case "$1" in - lex|yacc) - # Not GNU programs, they don't have --version. - ;; - - tar) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case "$1" in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` - test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` - fi - if [ -f "$file" ]; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit 1 - fi - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - tar) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case "$firstarg" in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case "$firstarg" in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/libjudy/src/Judy.h b/libjudy/src/Judy.h deleted file mode 100644 index adfb5b53bb..0000000000 --- a/libjudy/src/Judy.h +++ /dev/null @@ -1,622 +0,0 @@ -#ifndef _JUDY_INCLUDED -#define _JUDY_INCLUDED -// _________________ -// -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.52 $ $Source: /judy/src/Judy.h $ -// -// HEADER FILE FOR EXPORTED FEATURES IN JUDY LIBRARY, libJudy.* -// -// See the manual entries for details. -// -// Note: This header file uses old-style comments on #-directive lines and -// avoids "()" on macro names in comments for compatibility with older cc -Aa -// and some tools on some platforms. - - -// PLATFORM-SPECIFIC - -#ifdef JU_WIN /* =============================================== */ - -typedef __int8 int8_t; -typedef __int16 int16_t; -typedef __int32 int32_t; -typedef __int64 int64_t; - -typedef unsigned __int8 uint8_t; -typedef unsigned __int16 uint16_t; -typedef unsigned __int32 uint32_t; -typedef unsigned __int64 uint64_t; - -#else /* ================ ! JU_WIN ============================= */ - -// ISO C99: 7.8 Format conversion of integer types -#include /* if this FAILS, try #include */ - -// ISO C99: 7.18 Integer types uint*_t -//#include - -#endif /* ================ ! JU_WIN ============================= */ - -// ISO C99 Standard: 7.20 General utilities -#include - -// ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types -#include - -#ifdef __cplusplus /* support use by C++ code */ -extern "C" { -#endif - - -// **************************************************************************** -// DECLARE SOME BASE TYPES IN CASE THEY ARE MISSING: -// -// These base types include "const" where appropriate, but only where of -// interest to the caller. For example, a caller cares that a variable passed -// by reference will not be modified, such as, "const void * Pindex", but not -// that the called function internally does not modify the pointer itself, such -// as, "void * const Pindex". -// -// Note that its OK to pass a Pvoid_t to a Pcvoid_t; the latter is the same, -// only constant. Callers need to do this so they can also pass & Pvoid_t to -// PPvoid_t (non-constant). - -#ifndef _PCVOID_T -#define _PCVOID_T -typedef const void * Pcvoid_t; -#endif - -#ifndef _PVOID_T -#define _PVOID_T -typedef void * Pvoid_t; -typedef void ** PPvoid_t; -#endif - -#ifndef _WORD_T -#define _WORD_T -typedef unsigned long Word_t, * PWord_t; // expect 32-bit or 64-bit words. -#endif - -#ifndef NULL -#define NULL 0 -#endif - - -// **************************************************************************** -// SUPPORT FOR ERROR HANDLING: -// -// Judy error numbers: -// -// Note: These are an enum so theres a related typedef, but the numbers are -// spelled out so you can map a number back to its name. - -typedef enum // uint8_t -- but C does not support this type of enum. -{ - -// Note: JU_ERRNO_NONE and JU_ERRNO_FULL are not real errors. They specify -// conditions which are otherwise impossible return values from 32-bit -// Judy1Count, which has 2^32 + 1 valid returns (0..2^32) plus one error -// return. These pseudo-errors support the return values that cannot otherwise -// be unambiguously represented in a 32-bit word, and will never occur on a -// 64-bit system. - - JU_ERRNO_NONE = 0, - JU_ERRNO_FULL = 1, - JU_ERRNO_NFMAX = JU_ERRNO_FULL, - -// JU_ERRNO_NOMEM comes from malloc(3C) when Judy cannot obtain needed memory. -// The system errno value is also set to ENOMEM. This error can be recoverable -// if the calling application frees other memory. -// -// TBD: Currently there is no guarantee the Judy array has no memory leaks -// upon JU_ERRNO_NOMEM. - - JU_ERRNO_NOMEM = 2, - -// Problems with parameters from the calling program: -// -// JU_ERRNO_NULLPPARRAY means PPArray was null; perhaps PArray was passed where -// &PArray was intended. Similarly, JU_ERRNO_NULLPINDEX means PIndex was null; -// perhaps &Index was intended. Also, JU_ERRNO_NONNULLPARRAY, -// JU_ERRNO_NULLPVALUE, and JU_ERRNO_UNSORTED, all added later (hence with -// higher numbers), mean: A non-null array was passed in where a null pointer -// was required; PValue was null; and unsorted indexes were detected. - - JU_ERRNO_NULLPPARRAY = 3, // see above. - JU_ERRNO_NONNULLPARRAY = 10, // see above. - JU_ERRNO_NULLPINDEX = 4, // see above. - JU_ERRNO_NULLPVALUE = 11, // see above. - JU_ERRNO_NOTJUDY1 = 5, // PArray is not to a Judy1 array. - JU_ERRNO_NOTJUDYL = 6, // PArray is not to a JudyL array. - JU_ERRNO_NOTJUDYSL = 7, // PArray is not to a JudySL array. - JU_ERRNO_UNSORTED = 12, // see above. - -// Errors below this point are not recoverable; further tries to access the -// Judy array might result in EFAULT and a core dump: -// -// JU_ERRNO_OVERRUN occurs when Judy detects, upon reallocation, that a block -// of memory in its own freelist was modified since being freed. - - JU_ERRNO_OVERRUN = 8, - -// JU_ERRNO_CORRUPT occurs when Judy detects an impossible value in a Judy data -// structure: -// -// Note: The Judy data structure contains some redundant elements that support -// this type of checking. - - JU_ERRNO_CORRUPT = 9 - -// Warning: At least some C or C++ compilers do not tolerate a trailing comma -// above here. At least we know of one case, in aCC; see JAGad58928. - -} JU_Errno_t; - - -// Judy errno structure: -// -// WARNING: For compatibility with possible future changes, the fields of this -// struct should not be referenced directly. Instead use the macros supplied -// below. - -// This structure should be declared on the stack in a threaded process. - -typedef struct J_UDY_ERROR_STRUCT -{ - JU_Errno_t je_Errno; // one of the enums above. - int je_ErrID; // often an internal source line number. - Word_t je_reserved[4]; // for future backward compatibility. - -} JError_t, * PJError_t; - - -// Related macros: -// -// Fields from error struct: - -#define JU_ERRNO(PJError) ((PJError)->je_Errno) -#define JU_ERRID(PJError) ((PJError)->je_ErrID) - -// For checking return values from various Judy functions: -// -// Note: Define JERR as -1, not as the seemingly more portable (Word_t) -// (~0UL), to avoid a compiler "overflow in implicit constant conversion" -// warning. - -#define JERR (-1) /* functions returning int or Word_t */ -#define PJERR ((Pvoid_t) (~0UL)) /* mainly for use here, see below */ -#define PPJERR ((PPvoid_t) (~0UL)) /* functions that return PPvoid_t */ - -// Convenience macro for when detailed error information (PJError_t) is not -// desired by the caller; a purposely short name: - -#define PJE0 ((PJError_t) NULL) - - -// **************************************************************************** -// JUDY FUNCTIONS: -// -// P_JE is a shorthand for use below: - -#define P_JE PJError_t PJError - -// **************************************************************************** -// JUDY1 FUNCTIONS: - -extern int Judy1Test( Pcvoid_t PArray, Word_t Index, P_JE); -extern int Judy1Set( PPvoid_t PPArray, Word_t Index, P_JE); -extern int Judy1SetArray( PPvoid_t PPArray, Word_t Count, - const Word_t * const PIndex, - P_JE); -extern int Judy1Unset( PPvoid_t PPArray, Word_t Index, P_JE); -extern Word_t Judy1Count( Pcvoid_t PArray, Word_t Index1, - Word_t Index2, P_JE); -extern int Judy1ByCount( Pcvoid_t PArray, Word_t Count, - Word_t * PIndex, P_JE); -extern Word_t Judy1FreeArray( PPvoid_t PPArray, P_JE); -extern Word_t Judy1MemUsed( Pcvoid_t PArray); -extern Word_t Judy1MemActive( Pcvoid_t PArray); -extern int Judy1First( Pcvoid_t PArray, Word_t * PIndex, P_JE); -extern int Judy1Next( Pcvoid_t PArray, Word_t * PIndex, P_JE); -extern int Judy1Last( Pcvoid_t PArray, Word_t * PIndex, P_JE); -extern int Judy1Prev( Pcvoid_t PArray, Word_t * PIndex, P_JE); -extern int Judy1FirstEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE); -extern int Judy1NextEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE); -extern int Judy1LastEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE); -extern int Judy1PrevEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE); - -extern PPvoid_t JudyLGet( Pcvoid_t PArray, Word_t Index, P_JE); -extern PPvoid_t JudyLIns( PPvoid_t PPArray, Word_t Index, P_JE); -extern int JudyLInsArray( PPvoid_t PPArray, Word_t Count, - const Word_t * const PIndex, - const Word_t * const PValue, - -// **************************************************************************** -// JUDYL FUNCTIONS: - P_JE); -extern int JudyLDel( PPvoid_t PPArray, Word_t Index, P_JE); -extern Word_t JudyLCount( Pcvoid_t PArray, Word_t Index1, - Word_t Index2, P_JE); -extern PPvoid_t JudyLByCount( Pcvoid_t PArray, Word_t Count, - Word_t * PIndex, P_JE); -extern Word_t JudyLFreeArray( PPvoid_t PPArray, P_JE); -extern Word_t JudyLMemUsed( Pcvoid_t PArray); -extern Word_t JudyLMemActive( Pcvoid_t PArray); -extern PPvoid_t JudyLFirst( Pcvoid_t PArray, Word_t * PIndex, P_JE); -extern PPvoid_t JudyLNext( Pcvoid_t PArray, Word_t * PIndex, P_JE); -extern PPvoid_t JudyLLast( Pcvoid_t PArray, Word_t * PIndex, P_JE); -extern PPvoid_t JudyLPrev( Pcvoid_t PArray, Word_t * PIndex, P_JE); -extern int JudyLFirstEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE); -extern int JudyLNextEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE); -extern int JudyLLastEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE); -extern int JudyLPrevEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE); - -// **************************************************************************** -// JUDYSL FUNCTIONS: - -extern PPvoid_t JudySLGet( Pcvoid_t, const uint8_t * Index, P_JE); -extern PPvoid_t JudySLIns( PPvoid_t, const uint8_t * Index, P_JE); -extern int JudySLDel( PPvoid_t, const uint8_t * Index, P_JE); -extern Word_t JudySLFreeArray( PPvoid_t, P_JE); -extern PPvoid_t JudySLFirst( Pcvoid_t, uint8_t * Index, P_JE); -extern PPvoid_t JudySLNext( Pcvoid_t, uint8_t * Index, P_JE); -extern PPvoid_t JudySLLast( Pcvoid_t, uint8_t * Index, P_JE); -extern PPvoid_t JudySLPrev( Pcvoid_t, uint8_t * Index, P_JE); - -// **************************************************************************** -// JUDYHSL FUNCTIONS: - -extern PPvoid_t JudyHSGet( Pcvoid_t, void *, Word_t); -extern PPvoid_t JudyHSIns( PPvoid_t, void *, Word_t, P_JE); -extern int JudyHSDel( PPvoid_t, void *, Word_t, P_JE); -extern Word_t JudyHSFreeArray( PPvoid_t, P_JE); - -extern const char *Judy1MallocSizes; -extern const char *JudyLMallocSizes; - -// **************************************************************************** -// JUDY memory interface to malloc() FUNCTIONS: - -extern Word_t JudyMalloc(Word_t); // words reqd => words allocd. -extern Word_t JudyMallocVirtual(Word_t); // words reqd => words allocd. -extern void JudyFree(Pvoid_t, Word_t); // free, size in words. -extern void JudyFreeVirtual(Pvoid_t, Word_t); // free, size in words. - -#define JLAP_INVALID 0x1 /* flag to mark pointer "not a Judy array" */ - -// **************************************************************************** -// MACRO EQUIVALENTS FOR JUDY FUNCTIONS: -// -// The following macros, such as J1T, are shorthands for calling Judy functions -// with parameter address-of and detailed error checking included. Since they -// are macros, the error checking code is replicated each time the macro is -// used, but it runs fast in the normal case of no error. -// -// If the caller does not like the way the default JUDYERROR macro handles -// errors (such as an exit(1) call when out of memory), they may define their -// own before the "#include ". A routine such as HandleJudyError -// could do checking on specific error numbers and print a different message -// dependent on the error. The following is one example: -// -// Note: the back-slashes are removed because some compilers will not accept -// them in comments. -// -// void HandleJudyError(uint8_t *, int, uint8_t *, int, int); -// #define JUDYERROR(CallerFile, CallerLine, JudyFunc, JudyErrno, JudyErrID) -// { -// HandleJudyError(CallerFile, CallerLine, JudyFunc, JudyErrno, JudyErrID); -// } -// -// The routine HandleJudyError could do checking on specific error numbers and -// print a different message dependent on the error. -// -// The macro receives five parameters that are: -// -// 1. CallerFile: Source filename where a Judy call returned a serious error. -// 2. CallerLine: Line number in that source file. -// 3. JudyFunc: Name of Judy function reporting the error. -// 4. JudyErrno: One of the JU_ERRNO* values enumerated above. -// 5. JudyErrID: The je_ErrID field described above. - -#ifndef JUDYERROR_NOTEST -#ifndef JUDYERROR /* supply a default error macro */ -#include - -#define JUDYERROR(CallerFile, CallerLine, JudyFunc, JudyErrno, JudyErrID) \ - { \ - (void) fprintf(stderr, "File '%s', line %d: %s(), " \ - "JU_ERRNO_* == %d, ID == %d\n", \ - CallerFile, CallerLine, \ - JudyFunc, JudyErrno, JudyErrID); \ - exit(1); \ - } - -#endif /* JUDYERROR */ -#endif /* JUDYERROR_NOTEST */ - -// If the JUDYERROR macro is not desired at all, then the following eliminates -// it. However, the return code from each Judy function (that is, the first -// parameter of each macro) must be checked by the caller to assure that an -// error did not occur. -// -// Example: -// -// #define JUDYERROR_NOTEST 1 -// #include -// -// or use this cc option at compile time: -// -// cc -DJUDYERROR_NOTEST ... -// -// Example code: -// -// J1S(Rc, PArray, Index); -// if (Rc == JERR) goto ...error -// -// or: -// -// JLI(PValue, PArray, Index); -// if (PValue == PJERR) goto ...error - - -// Internal shorthand macros for writing the J1S, etc. macros: - -#ifdef JUDYERROR_NOTEST /* ============================================ */ - -// "Judy Set Error": - -#define J_SE(FuncName,Errno) ((void) 0) - -// Note: In each J_*() case below, the digit is the number of key parameters -// to the Judy*() call. Just assign the Func result to the callers Rc value -// without a cast because none is required, and this keeps the API simpler. -// However, a family of different J_*() macros is needed to support the -// different numbers of key parameters (0,1,2) and the Func return type. -// -// In the names below, "I" = integer result; "P" = pointer result. Note, the -// Funcs for J_*P() return PPvoid_t, but cast this to a Pvoid_t for flexible, -// error-free assignment, and then compare to PJERR. - -#define J_0I(Rc,PArray,Func,FuncName) \ - { (Rc) = Func(PArray, PJE0); } - -#define J_1I(Rc,PArray,Index,Func,FuncName) \ - { (Rc) = Func(PArray, Index, PJE0); } - -#define J_1P(PV,PArray,Index,Func,FuncName) \ - { (PV) = (Pvoid_t) Func(PArray, Index, PJE0); } - -#define J_2I(Rc,PArray,Index,Arg2,Func,FuncName) \ - { (Rc) = Func(PArray, Index, Arg2, PJE0); } - -#define J_2C(Rc,PArray,Index1,Index2,Func,FuncName) \ - { (Rc) = Func(PArray, Index1, Index2, PJE0); } - -#define J_2P(PV,PArray,Index,Arg2,Func,FuncName) \ - { (PV) = (Pvoid_t) Func(PArray, Index, Arg2, PJE0); } - -// Variations for Judy*Set/InsArray functions: - -#define J_2AI(Rc,PArray,Count,PIndex,Func,FuncName) \ - { (Rc) = Func(PArray, Count, PIndex, PJE0); } -#define J_3AI(Rc,PArray,Count,PIndex,PValue,Func,FuncName) \ - { (Rc) = Func(PArray, Count, PIndex, PValue, PJE0); } - -#else /* ================ ! JUDYERROR_NOTEST ============================= */ - -#define J_E(FuncName,PJE) \ - JUDYERROR(__FILE__, __LINE__, FuncName, JU_ERRNO(PJE), JU_ERRID(PJE)) - -#define J_SE(FuncName,Errno) \ - { \ - JError_t J_Error; \ - JU_ERRNO(&J_Error) = (Errno); \ - JU_ERRID(&J_Error) = __LINE__; \ - J_E(FuncName, &J_Error); \ - } - -// Note: In each J_*() case below, the digit is the number of key parameters -// to the Judy*() call. Just assign the Func result to the callers Rc value -// without a cast because none is required, and this keeps the API simpler. -// However, a family of different J_*() macros is needed to support the -// different numbers of key parameters (0,1,2) and the Func return type. -// -// In the names below, "I" = integer result; "P" = pointer result. Note, the -// Funcs for J_*P() return PPvoid_t, but cast this to a Pvoid_t for flexible, -// error-free assignment, and then compare to PJERR. - -#define J_0I(Rc,PArray,Func,FuncName) \ - { \ - JError_t J_Error; \ - if (((Rc) = Func(PArray, &J_Error)) == JERR) \ - J_E(FuncName, &J_Error); \ - } - -#define J_1I(Rc,PArray,Index,Func,FuncName) \ - { \ - JError_t J_Error; \ - if (((Rc) = Func(PArray, Index, &J_Error)) == JERR) \ - J_E(FuncName, &J_Error); \ - } - -#define J_1P(Rc,PArray,Index,Func,FuncName) \ - { \ - JError_t J_Error; \ - if (((Rc) = (Pvoid_t) Func(PArray, Index, &J_Error)) == PJERR) \ - J_E(FuncName, &J_Error); \ - } - -#define J_2I(Rc,PArray,Index,Arg2,Func,FuncName) \ - { \ - JError_t J_Error; \ - if (((Rc) = Func(PArray, Index, Arg2, &J_Error)) == JERR) \ - J_E(FuncName, &J_Error); \ - } - -// Variation for Judy*Count functions, which return 0, not JERR, for error (and -// also for other non-error cases): -// -// Note: JU_ERRNO_NFMAX should only apply to 32-bit Judy1, but this header -// file lacks the necessary ifdefs to make it go away otherwise, so always -// check against it. - -#define J_2C(Rc,PArray,Index1,Index2,Func,FuncName) \ - { \ - JError_t J_Error; \ - if ((((Rc) = Func(PArray, Index1, Index2, &J_Error)) == 0) \ - && (JU_ERRNO(&J_Error) > JU_ERRNO_NFMAX)) \ - { \ - J_E(FuncName, &J_Error); \ - } \ - } - -#define J_2P(PV,PArray,Index,Arg2,Func,FuncName) \ - { \ - JError_t J_Error; \ - if (((PV) = (Pvoid_t) Func(PArray, Index, Arg2, &J_Error)) \ - == PJERR) J_E(FuncName, &J_Error); \ - } - -// Variations for Judy*Set/InsArray functions: - -#define J_2AI(Rc,PArray,Count,PIndex,Func,FuncName) \ - { \ - JError_t J_Error; \ - if (((Rc) = Func(PArray, Count, PIndex, &J_Error)) == JERR) \ - J_E(FuncName, &J_Error); \ - } - -#define J_3AI(Rc,PArray,Count,PIndex,PValue,Func,FuncName) \ - { \ - JError_t J_Error; \ - if (((Rc) = Func(PArray, Count, PIndex, PValue, &J_Error)) \ - == JERR) J_E(FuncName, &J_Error); \ - } - -#endif /* ================ ! JUDYERROR_NOTEST ============================= */ - -// Some of the macros are special cases that use inlined shortcuts for speed -// with root-level leaves: - -// This is a slower version with current processors, but in the future... - -#define J1T(Rc,PArray,Index) \ - (Rc) = Judy1Test((Pvoid_t)(PArray), Index, PJE0) - -#define J1S( Rc, PArray, Index) \ - J_1I(Rc, (&(PArray)), Index, Judy1Set, "Judy1Set") -#define J1SA(Rc, PArray, Count, PIndex) \ - J_2AI(Rc,(&(PArray)), Count, PIndex, Judy1SetArray, "Judy1SetArray") -#define J1U( Rc, PArray, Index) \ - J_1I(Rc, (&(PArray)), Index, Judy1Unset, "Judy1Unset") -#define J1F( Rc, PArray, Index) \ - J_1I(Rc, PArray, &(Index), Judy1First, "Judy1First") -#define J1N( Rc, PArray, Index) \ - J_1I(Rc, PArray, &(Index), Judy1Next, "Judy1Next") -#define J1L( Rc, PArray, Index) \ - J_1I(Rc, PArray, &(Index), Judy1Last, "Judy1Last") -#define J1P( Rc, PArray, Index) \ - J_1I(Rc, PArray, &(Index), Judy1Prev, "Judy1Prev") -#define J1FE(Rc, PArray, Index) \ - J_1I(Rc, PArray, &(Index), Judy1FirstEmpty, "Judy1FirstEmpty") -#define J1NE(Rc, PArray, Index) \ - J_1I(Rc, PArray, &(Index), Judy1NextEmpty, "Judy1NextEmpty") -#define J1LE(Rc, PArray, Index) \ - J_1I(Rc, PArray, &(Index), Judy1LastEmpty, "Judy1LastEmpty") -#define J1PE(Rc, PArray, Index) \ - J_1I(Rc, PArray, &(Index), Judy1PrevEmpty, "Judy1PrevEmpty") -#define J1C( Rc, PArray, Index1, Index2) \ - J_2C(Rc, PArray, Index1, Index2, Judy1Count, "Judy1Count") -#define J1BC(Rc, PArray, Count, Index) \ - J_2I(Rc, PArray, Count, &(Index), Judy1ByCount, "Judy1ByCount") -#define J1FA(Rc, PArray) \ - J_0I(Rc, (&(PArray)), Judy1FreeArray, "Judy1FreeArray") -#define J1MU(Rc, PArray) \ - (Rc) = Judy1MemUsed(PArray) - -#define JLG(PV,PArray,Index) \ - (PV) = (Pvoid_t)JudyLGet((Pvoid_t)PArray, Index, PJE0) - -#define JLI( PV, PArray, Index) \ - J_1P(PV, (&(PArray)), Index, JudyLIns, "JudyLIns") - -#define JLIA(Rc, PArray, Count, PIndex, PValue) \ - J_3AI(Rc,(&(PArray)), Count, PIndex, PValue, JudyLInsArray, \ - "JudyLInsArray") -#define JLD( Rc, PArray, Index) \ - J_1I(Rc, (&(PArray)), Index, JudyLDel, "JudyLDel") - -#define JLF( PV, PArray, Index) \ - J_1P(PV, PArray, &(Index), JudyLFirst, "JudyLFirst") - -#define JLN( PV, PArray, Index) \ - J_1P(PV, PArray, &(Index), JudyLNext, "JudyLNext") - -#define JLL( PV, PArray, Index) \ - J_1P(PV, PArray, &(Index), JudyLLast, "JudyLLast") -#define JLP( PV, PArray, Index) \ - J_1P(PV, PArray, &(Index), JudyLPrev, "JudyLPrev") -#define JLFE(Rc, PArray, Index) \ - J_1I(Rc, PArray, &(Index), JudyLFirstEmpty, "JudyLFirstEmpty") -#define JLNE(Rc, PArray, Index) \ - J_1I(Rc, PArray, &(Index), JudyLNextEmpty, "JudyLNextEmpty") -#define JLLE(Rc, PArray, Index) \ - J_1I(Rc, PArray, &(Index), JudyLLastEmpty, "JudyLLastEmpty") -#define JLPE(Rc, PArray, Index) \ - J_1I(Rc, PArray, &(Index), JudyLPrevEmpty, "JudyLPrevEmpty") -#define JLC( Rc, PArray, Index1, Index2) \ - J_2C(Rc, PArray, Index1, Index2, JudyLCount, "JudyLCount") -#define JLBC(PV, PArray, Count, Index) \ - J_2P(PV, PArray, Count, &(Index), JudyLByCount, "JudyLByCount") -#define JLFA(Rc, PArray) \ - J_0I(Rc, (&(PArray)), JudyLFreeArray, "JudyLFreeArray") -#define JLMU(Rc, PArray) \ - (Rc) = JudyLMemUsed(PArray) - -#define JHSI(PV, PArray, PIndex, Count) \ - J_2P(PV, (&(PArray)), PIndex, Count, JudyHSIns, "JudyHSIns") -#define JHSG(PV, PArray, PIndex, Count) \ - (PV) = (Pvoid_t) JudyHSGet(PArray, PIndex, Count) -#define JHSD(Rc, PArray, PIndex, Count) \ - J_2I(Rc, (&(PArray)), PIndex, Count, JudyHSDel, "JudyHSDel") -#define JHSFA(Rc, PArray) \ - J_0I(Rc, (&(PArray)), JudyHSFreeArray, "JudyHSFreeArray") - -#define JSLG( PV, PArray, Index) \ - J_1P( PV, PArray, Index, JudySLGet, "JudySLGet") -#define JSLI( PV, PArray, Index) \ - J_1P( PV, (&(PArray)), Index, JudySLIns, "JudySLIns") -#define JSLD( Rc, PArray, Index) \ - J_1I( Rc, (&(PArray)), Index, JudySLDel, "JudySLDel") -#define JSLF( PV, PArray, Index) \ - J_1P( PV, PArray, Index, JudySLFirst, "JudySLFirst") -#define JSLN( PV, PArray, Index) \ - J_1P( PV, PArray, Index, JudySLNext, "JudySLNext") -#define JSLL( PV, PArray, Index) \ - J_1P( PV, PArray, Index, JudySLLast, "JudySLLast") -#define JSLP( PV, PArray, Index) \ - J_1P( PV, PArray, Index, JudySLPrev, "JudySLPrev") -#define JSLFA(Rc, PArray) \ - J_0I( Rc, (&(PArray)), JudySLFreeArray, "JudySLFreeArray") - -#ifdef __cplusplus -} -#endif -#endif /* ! _JUDY_INCLUDED */ diff --git a/libjudy/src/Judy.h.check.c b/libjudy/src/Judy.h.check.c deleted file mode 100644 index bc921924db..0000000000 --- a/libjudy/src/Judy.h.check.c +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.17 $ $Source: /judy/src/Judy.h.check.c $ -// -// Fake "program" to test the exports in Judy.h by exercising each one. This -// program should compile OK (with libJudy.a) but does not run OK. - -#include "Judy.h" - -int -main() -{ - Pvoid_t PArray = (Pvoid_t) NULL; - PPvoid_t PPArray = &PArray; - Word_t Index = 0; - PWord_t PIndex = &Index; - uint8_t *CIndex = NULL; - PPvoid_t PPvoid; - Word_t myword; - Word_t Length; - int myint; - -// JUDY FUNCTIONS: - - myint = Judy1Test ( PArray, Index, PJE0); - myint = Judy1Set (PPArray, Index, PJE0); - myint = Judy1SetArray (PPArray, Index, &Index, PJE0); - myint = Judy1Unset (PPArray, Index, PJE0); - myword = Judy1Count ( PArray, Index, Index, PJE0); - myint = Judy1ByCount ( PArray, Index, PIndex, PJE0); - myword = Judy1FreeArray (PPArray, PJE0); - myword = Judy1MemUsed ( PArray ); - myword = Judy1MemActive ( PArray ); - myint = Judy1First ( PArray, PIndex, PJE0); - myint = Judy1Next ( PArray, PIndex, PJE0); - myint = Judy1Last ( PArray, PIndex, PJE0); - myint = Judy1Prev ( PArray, PIndex, PJE0); - myint = Judy1FirstEmpty ( PArray, PIndex, PJE0); - myint = Judy1NextEmpty ( PArray, PIndex, PJE0); - myint = Judy1LastEmpty ( PArray, PIndex, PJE0); - myint = Judy1PrevEmpty ( PArray, PIndex, PJE0); - - PPvoid = JudyLGet ( PArray, Index, PJE0); - PPvoid = JudyLIns (PPArray, Index, PJE0); - myint = JudyLInsArray (PPArray, Index, &Index, &Index, PJE0); - myint = JudyLDel (PPArray, Index, PJE0); - myword = JudyLCount ( PArray, Index, Index, PJE0); - PPvoid = JudyLByCount ( PArray, Index, PIndex, PJE0); - myword = JudyLFreeArray (PPArray, PJE0); - myword = JudyLMemUsed ( PArray ); - myword = JudyLMemActive ( PArray ); - PPvoid = JudyLFirst ( PArray, PIndex, PJE0); - PPvoid = JudyLNext ( PArray, PIndex, PJE0); - PPvoid = JudyLLast ( PArray, PIndex, PJE0); - PPvoid = JudyLPrev ( PArray, PIndex, PJE0); - myint = JudyLFirstEmpty ( PArray, PIndex, PJE0); - myint = JudyLNextEmpty ( PArray, PIndex, PJE0); - myint = JudyLLastEmpty ( PArray, PIndex, PJE0); - myint = JudyLPrevEmpty ( PArray, PIndex, PJE0); - - PPvoid = JudySLGet ( PArray, CIndex, PJE0); - PPvoid = JudySLIns (PPArray, CIndex, PJE0); - myint = JudySLDel (PPArray, CIndex, PJE0); - myword = JudySLFreeArray (PPArray, PJE0); - PPvoid = JudySLFirst ( PArray, CIndex, PJE0); - PPvoid = JudySLNext ( PArray, CIndex, PJE0); - PPvoid = JudySLLast ( PArray, CIndex, PJE0); - PPvoid = JudySLPrev ( PArray, CIndex, PJE0); - - PPvoid = JudyHSGet ( PArray, CIndex, Length); - PPvoid = JudyHSIns (PPArray, CIndex, Length, PJE0); - myint = JudyHSDel (PPArray, CIndex, Length, PJE0); - - -// MACRO EQUIVALENTS: - - J1T (myint, PArray, Index); - J1S (myint, PArray, Index); - J1SA (myint, PArray, Index, &Index); - J1U (myint, PArray, Index); - J1F (myint, PArray, Index); - J1N (myint, PArray, Index); - J1L (myint, PArray, Index); - J1P (myint, PArray, Index); - J1FE (myint, PArray, Index); - J1NE (myint, PArray, Index); - J1LE (myint, PArray, Index); - J1PE (myint, PArray, Index); - J1C (myword, PArray, Index, Index); - J1BC (myint, PArray, Index, Index); - J1FA (myword, PArray); - - JLG (PPvoid, PArray, Index); - JLI (PPvoid, PArray, Index); - JLIA (myint, PArray, Index, &Index, &Index); - JLD (myint, PArray, Index); - JLF (PPvoid, PArray, Index); - JLN (PPvoid, PArray, Index); - JLL (PPvoid, PArray, Index); - JLP (PPvoid, PArray, Index); - JLFE (myint, PArray, Index); - JLNE (myint, PArray, Index); - JLLE (myint, PArray, Index); - JLPE (myint, PArray, Index); - JLC (myword, PArray, Index, Index); - JLBC (PPvoid, PArray, myword, Index); - JLFA (myword, PArray); - - JSLG (PPvoid, PArray, CIndex); - JSLI (PPvoid, PArray, CIndex); - JSLD (myint, PArray, CIndex); - JSLF (PPvoid, PArray, CIndex); - JSLN (PPvoid, PArray, CIndex); - JSLL (PPvoid, PArray, CIndex); - JSLP (PPvoid, PArray, CIndex); - JSLFA (myword, PArray); - - JHSI (PPvoid, PArray, CIndex, Length); - JHSG (PPvoid, PArray, CIndex, Length); - JHSD (myint, PArray, CIndex, Length); - - return(0); - -} // main() diff --git a/libjudy/src/Judy1/Judy1.h b/libjudy/src/Judy1/Judy1.h deleted file mode 100644 index 3f48f55939..0000000000 --- a/libjudy/src/Judy1/Judy1.h +++ /dev/null @@ -1,551 +0,0 @@ -#ifndef _JUDY1_INCLUDED -#define _JUDY1_INCLUDED -// _________________ -// -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.76 $ $Source: /judy/src/Judy1/Judy1.h $ - -// **************************************************************************** -// JUDY1 -- SMALL/LARGE AND/OR CLUSTERED/SPARSE BIT ARRAYS -// -// -by- -// -// Douglas L. Baskins -// doug@sourcejudy.com -// -// Judy arrays are designed to be used instead of arrays. The performance -// suggests the reason why Judy arrays are thought of as arrays, instead of -// trees. They are remarkably memory efficient at all populations. -// Implemented as a hybrid digital tree (but really a state machine, see -// below), Judy arrays feature fast insert/retrievals, fast near neighbor -// searching, and contain a population tree for extremely fast ordinal related -// retrievals. -// -// CONVENTIONS: -// -// - The comments here refer to 32-bit [64-bit] systems. -// -// - BranchL, LeafL refer to linear branches and leaves (small populations), -// except LeafL does not actually appear as such; rather, Leaf1..3 [Leaf1..7] -// is used to represent leaf Index sizes, and LeafW refers to a Leaf with -// full (long) word Indexes, which is also a type of linear leaf. Note that -// root-level LeafW (Leaf4 [Leaf8]) leaves are also called LEAFW. -// -// - BranchB, LeafB1 refer to bitmap branches and leaves (intermediate -// populations). -// -// - BranchU refers to uncompressed branches. An uncompressed branch has 256 -// JPs, some of which could be null. Note: All leaves are compressed (and -// sorted), or else an expanse is full (FullPopu), so there is no LeafU -// equivalent to BranchU. -// -// - "Popu" is short for "Population". -// - "Pop1" refers to actual population (base 1). -// - "Pop0" refers to Pop1 - 1 (base 0), the way populations are stored in data -// structures. -// -// - Branches and Leaves are both named by the number of bytes in their Pop0 -// field. In the case of Leaves, the same number applies to the Index sizes. -// -// - The representation of many numbers as hex is a relatively safe and -// portable way to get desired bitpatterns as unsigned longs. -// -// - Some preprocessors cant handle single apostrophe characters within -// #ifndef code, so here, use delete all instead. - -#include "JudyPrivate.h" // includes Judy.h in turn. -#include "JudyPrivateBranch.h" - - -// **************************************************************************** -// JUDY1 ROOT POINTER (JRP) AND JUDY1 POINTER (JP) TYPE FIELDS -// **************************************************************************** -// -// The following enum lists all possible JP Type fields. - -typedef enum // uint8_t -- but C does not support this type of enum. -{ - -// JP NULL TYPES: -// -// There is a series of cJ1_JPNULL* Types because each one pre-records a -// different Index Size for when the first Index is inserted in the previously -// null JP. They must start >= 8 (three bits). -// -// Note: These Types must be in sequential order for doing relative -// calculations between them. - - cJ1_JPNULL1 = 1, - // Index Size 1[1] byte when 1 Index inserted. - cJ1_JPNULL2, // Index Size 2[2] bytes when 1 Index inserted. - cJ1_JPNULL3, // Index Size 3[3] bytes when 1 Index inserted. - -#ifndef JU_64BIT -#define cJ1_JPNULLMAX cJ1_JPNULL3 -#else - cJ1_JPNULL4, // Index Size 4[4] bytes when 1 Index inserted. - cJ1_JPNULL5, // Index Size 5[5] bytes when 1 Index inserted. - cJ1_JPNULL6, // Index Size 6[6] bytes when 1 Index inserted. - cJ1_JPNULL7, // Index Size 7[7] bytes when 1 Index inserted. -#define cJ1_JPNULLMAX cJ1_JPNULL7 -#endif - - -// JP BRANCH TYPES: -// -// Note: There are no state-1 branches; only leaves reside at state 1. - -// Linear branches: -// -// Note: These Types must be in sequential order for doing relative -// calculations between them. - - cJ1_JPBRANCH_L2, // 2[2] bytes Pop0, 1[5] bytes Dcd. - cJ1_JPBRANCH_L3, // 3[3] bytes Pop0, 0[4] bytes Dcd. - -#ifdef JU_64BIT - cJ1_JPBRANCH_L4, // [4] bytes Pop0, [3] bytes Dcd. - cJ1_JPBRANCH_L5, // [5] bytes Pop0, [2] bytes Dcd. - cJ1_JPBRANCH_L6, // [6] bytes Pop0, [1] byte Dcd. - cJ1_JPBRANCH_L7, // [7] bytes Pop0, [0] bytes Dcd. -#endif - - cJ1_JPBRANCH_L, // note: DcdPopO field not used. - -// Bitmap branches: -// -// Note: These Types must be in sequential order for doing relative -// calculations between them. - - cJ1_JPBRANCH_B2, // 2[2] bytes Pop0, 1[5] bytes Dcd. - cJ1_JPBRANCH_B3, // 3[3] bytes Pop0, 0[4] bytes Dcd. - -#ifdef JU_64BIT - cJ1_JPBRANCH_B4, // [4] bytes Pop0, [3] bytes Dcd. - cJ1_JPBRANCH_B5, // [5] bytes Pop0, [2] bytes Dcd. - cJ1_JPBRANCH_B6, // [6] bytes Pop0, [1] byte Dcd. - cJ1_JPBRANCH_B7, // [7] bytes Pop0, [0] bytes Dcd. -#endif - - cJ1_JPBRANCH_B, // note: DcdPopO field not used. - -// Uncompressed branches: -// -// Note: These Types must be in sequential order for doing relative -// calculations between them. - - cJ1_JPBRANCH_U2, // 2[2] bytes Pop0, 1[5] bytes Dcd. - cJ1_JPBRANCH_U3, // 3[3] bytes Pop0, 0[4] bytes Dcd. - -#ifdef JU_64BIT - cJ1_JPBRANCH_U4, // [4] bytes Pop0, [3] bytes Dcd. - cJ1_JPBRANCH_U5, // [5] bytes Pop0, [2] bytes Dcd. - cJ1_JPBRANCH_U6, // [6] bytes Pop0, [1] byte Dcd. - cJ1_JPBRANCH_U7, // [7] bytes Pop0, [0] bytes Dcd. -#endif - - cJ1_JPBRANCH_U, // note: DcdPopO field not used. - - -// JP LEAF TYPES: - -// Linear leaves: -// -// Note: These Types must be in sequential order for doing relative -// calculations between them. -// -// Note: There is no cJ1_JPLEAF1 for 64-bit for a subtle reason. An immediate -// JP can hold 15 1-byte Indexes, and a bitmap leaf would be used for 17 -// Indexes, so rather than support a linear leaf for only the case of exactly -// 16 Indexes, a bitmap leaf is used in that case. See also below regarding -// cJ1_LEAF1_MAXPOP1 on 64-bit systems. -// -// Note: There is no full-word (4-byte [8-byte]) Index leaf under a JP because -// non-root-state leaves only occur under branches that decode at least one -// byte. Full-word, root-state leaves are under a JRP, not a JP. However, in -// the code a "fake" JP can be created temporarily above a root-state leaf. - -#ifndef JU_64BIT // 32-bit only; see above. - cJ1_JPLEAF1, // 1 byte Pop0, 2 bytes Dcd. -#endif - - cJ1_JPLEAF2, // 2[2] bytes Pop0, 1[5] bytes Dcd. - cJ1_JPLEAF3, // 3[3] bytes Pop0, 0[4] bytes Dcd. - -#ifdef JU_64BIT - cJ1_JPLEAF4, // [4] bytes Pop0, [3] bytes Dcd. - cJ1_JPLEAF5, // [5] bytes Pop0, [2] bytes Dcd. - cJ1_JPLEAF6, // [6] bytes Pop0, [1] byte Dcd. - cJ1_JPLEAF7, // [7] bytes Pop0, [0] bytes Dcd. -#endif - -// Bitmap leaf; Index Size == 1: -// -// Note: These are currently only supported at state 1. At other states the -// bitmap would grow from 256 to 256^2, 256^3, ... bits, which would not be -// efficient.. - - cJ1_JPLEAF_B1, // 1[1] byte Pop0, 2[6] bytes Dcd. - - -// Full population; Index Size == 1 virtual leaf: -// -// Note: These are currently only supported at state 1. At other states they -// could be used, but they would be rare and the savings are dubious. - - cJ1_JPFULLPOPU1, // 1[1] byte Pop0, 2[6] bytes Dcd. - -#ifdef notdef // for future enhancements - cJ1_JPFULLPOPU1m1, // Full Population - 1 - cJ1_JPFULLPOPU1m2, // Full Population - 2 - cJ1_JPFULLPOPU1m3, // Full Population - 3 - cJ1_JPFULLPOPU1m4, // Full Population - 4 - cJ1_JPFULLPOPU1m5, // Full Population - 5 - cJ1_JPFULLPOPU1m6, // Full Population - 6 - cJ1_JPFULLPOPU1m7, // Full Population - 7 - -#ifdef JU_64BIT - cJ1_JPFULLPOPU1m8, // Full Population - 8 - cJ1_JPFULLPOPU1m9, // Full Population - 9 - cJ1_JPFULLPOPU1m10, // Full Population - 10 - cJ1_JPFULLPOPU1m11, // Full Population - 11 - cJ1_JPFULLPOPU1m12, // Full Population - 12 - cJ1_JPFULLPOPU1m13, // Full Population - 13 - cJ1_JPFULLPOPU1m14, // Full Population - 14 - cJ1_JPFULLPOPU1m15, // Full Population - 15 -#endif -#endif // notdef -- for future enhancements - - -// JP IMMEDIATES; leaves (Indexes) stored inside a JP: -// -// The second numeric suffix is the Pop1 for each type. As the Index Size -// increases, the maximum possible population decreases. -// -// Note: These Types must be in sequential order in each group (Index Size), -// and the groups in correct order too, for doing relative calculations between -// them. For example, since these Types enumerate the Pop1 values (unlike -// other JP Types where there is a Pop0 value in the JP), the maximum Pop1 for -// each Index Size is computable. - - cJ1_JPIMMED_1_01, // Index Size = 1, Pop1 = 1. - cJ1_JPIMMED_2_01, // Index Size = 2, Pop1 = 1. - cJ1_JPIMMED_3_01, // Index Size = 3, Pop1 = 1. -#ifdef JU_64BIT - cJ1_JPIMMED_4_01, // Index Size = 4, Pop1 = 1. - cJ1_JPIMMED_5_01, // Index Size = 5, Pop1 = 1. - cJ1_JPIMMED_6_01, // Index Size = 6, Pop1 = 1. - cJ1_JPIMMED_7_01, // Index Size = 7, Pop1 = 1. -#endif - - cJ1_JPIMMED_1_02, // Index Size = 1, Pop1 = 2. - cJ1_JPIMMED_1_03, // Index Size = 1, Pop1 = 3. - cJ1_JPIMMED_1_04, // Index Size = 1, Pop1 = 4. - cJ1_JPIMMED_1_05, // Index Size = 1, Pop1 = 5. - cJ1_JPIMMED_1_06, // Index Size = 1, Pop1 = 6. - cJ1_JPIMMED_1_07, // Index Size = 1, Pop1 = 7. - -#ifdef JU_64BIT - cJ1_JPIMMED_1_08, // Index Size = 1, Pop1 = 8. - cJ1_JPIMMED_1_09, // Index Size = 1, Pop1 = 9. - cJ1_JPIMMED_1_10, // Index Size = 1, Pop1 = 10. - cJ1_JPIMMED_1_11, // Index Size = 1, Pop1 = 11. - cJ1_JPIMMED_1_12, // Index Size = 1, Pop1 = 12. - cJ1_JPIMMED_1_13, // Index Size = 1, Pop1 = 13. - cJ1_JPIMMED_1_14, // Index Size = 1, Pop1 = 14. - cJ1_JPIMMED_1_15, // Index Size = 1, Pop1 = 15. -#endif - - cJ1_JPIMMED_2_02, // Index Size = 2, Pop1 = 2. - cJ1_JPIMMED_2_03, // Index Size = 2, Pop1 = 3. - -#ifdef JU_64BIT - cJ1_JPIMMED_2_04, // Index Size = 2, Pop1 = 4. - cJ1_JPIMMED_2_05, // Index Size = 2, Pop1 = 5. - cJ1_JPIMMED_2_06, // Index Size = 2, Pop1 = 6. - cJ1_JPIMMED_2_07, // Index Size = 2, Pop1 = 7. -#endif - - cJ1_JPIMMED_3_02, // Index Size = 3, Pop1 = 2. - -#ifdef JU_64BIT - cJ1_JPIMMED_3_03, // Index Size = 3, Pop1 = 3. - cJ1_JPIMMED_3_04, // Index Size = 3, Pop1 = 4. - cJ1_JPIMMED_3_05, // Index Size = 3, Pop1 = 5. - - cJ1_JPIMMED_4_02, // Index Size = 4, Pop1 = 2. - cJ1_JPIMMED_4_03, // Index Size = 4, Pop1 = 3. - - cJ1_JPIMMED_5_02, // Index Size = 5, Pop1 = 2. - cJ1_JPIMMED_5_03, // Index Size = 3, Pop1 = 3. - - cJ1_JPIMMED_6_02, // Index Size = 6, Pop1 = 2. - - cJ1_JPIMMED_7_02, // Index Size = 7, Pop1 = 2. -#endif - -// This special Type is merely a sentinel for doing relative calculations. -// This value should not be used in switch statements (to avoid allocating code -// for it), which is also why it appears at the end of the enum list. - - cJ1_JPIMMED_CAP - -} jp1_Type_t; - - -// RELATED VALUES: -// -// Index Size (state) for leaf JP, and JP type based on Index Size (state): - -#ifndef JU_64BIT // 32-bit -#define J1_LEAFINDEXSIZE(jpType) ((jpType) - cJ1_JPLEAF1 + 1) -#define J1_LEAFTYPE(IndexSize) ((IndexSize) + cJ1_JPLEAF1 - 1) -#else -#define J1_LEAFINDEXSIZE(jpType) ((jpType) - cJ1_JPLEAF2 + 2) -#define J1_LEAFTYPE(IndexSize) ((IndexSize) + cJ1_JPLEAF2 - 2) -#endif - - -// **************************************************************************** -// JUDY1 POINTER (JP) -- RELATED MACROS AND CONSTANTS -// **************************************************************************** - -// MAXIMUM POPULATIONS OF LINEAR LEAVES: -// -// Allow up to 2 cache lines per leaf, with N bytes per index. -// -// J_1_MAXB is the maximum number of bytes (sort of) to allocate per leaf. -// ALLOCSIZES is defined here, not there, for single-point control of these key -// definitions. See JudyTables.c for "TERMINATOR". - -#define J_1_MAXB (sizeof(Word_t) * 32) -#define ALLOCSIZES { 3, 5, 7, 11, 15, 23, 32, 47, 64, TERMINATOR } // in words. -#define cJ1_LEAF1_MAXWORDS 5 // Leaf1 max alloc size in words. - -// Under JRP (root-state leaves): -// -// Includes a count (Population) word. -// -// Under JP (non-root-state leaves), which have no count (Population) words: -// -// When a 1-byte index leaf grows above cJ1_LEAF1_MAXPOP1 Indexes (bytes), -// the memory chunk required grows to a size where a bitmap is just as -// efficient, so use a bitmap instead for all greater Populations, on both -// 32-bit and 64-bit systems. However, on a 32-bit system this occurs upon -// going from 6 to 8 words (24 to 32 bytes) in the memory chunk, but on a -// 64-bit system this occurs upon going from 2 to 4 words (16 to 32 bytes). It -// would be silly to go from a 15-Index Immediate JP to a 16-Index linear leaf -// to a 17-Index bitmap leaf, so just use a bitmap leaf for 16+ Indexes, which -// means set cJ1_LEAF1_MAXPOP1 to cJ1_IMMED1_MAXPOP1 (15) to cause the -// transition at that point. -// -// Note: cJ1_LEAF1_MAXPOP1 is not used on 64-bit systems. - -#ifndef JU_64BIT // 32-bit - -#define cJ1_LEAF1_MAXPOP1 (cJ1_LEAF1_MAXWORDS * cJU_BYTESPERWORD) -#define cJ1_LEAF2_MAXPOP1 (J_1_MAXB / 2) -#define cJ1_LEAF3_MAXPOP1 (J_1_MAXB / 3) -#define cJ1_LEAFW_MAXPOP1 ((J_1_MAXB - cJU_BYTESPERWORD) / cJU_BYTESPERWORD) - -#else // 64-bit - -// #define cJ1_LEAF1_MAXPOP1 // no LEAF1 in 64-bit. -#define cJ1_LEAF2_MAXPOP1 (J_1_MAXB / 2) -#define cJ1_LEAF3_MAXPOP1 (J_1_MAXB / 3) -#define cJ1_LEAF4_MAXPOP1 (J_1_MAXB / 4) -#define cJ1_LEAF5_MAXPOP1 (J_1_MAXB / 5) -#define cJ1_LEAF6_MAXPOP1 (J_1_MAXB / 6) -#define cJ1_LEAF7_MAXPOP1 (J_1_MAXB / 7) -#define cJ1_LEAFW_MAXPOP1 ((J_1_MAXB - cJU_BYTESPERWORD) / cJU_BYTESPERWORD) - -#endif - - -// MAXIMUM POPULATIONS OF IMMEDIATE JPs: -// -// These specify the maximum Population of immediate JPs with various Index -// Sizes (== sizes of remaining undecoded Index bits). - -#define cJ1_IMMED1_MAXPOP1 ((sizeof(jp_t) - 1) / 1) // 7 [15]. -#define cJ1_IMMED2_MAXPOP1 ((sizeof(jp_t) - 1) / 2) // 3 [7]. -#define cJ1_IMMED3_MAXPOP1 ((sizeof(jp_t) - 1) / 3) // 2 [5]. - -#ifdef JU_64BIT -#define cJ1_IMMED4_MAXPOP1 ((sizeof(jp_t) - 1) / 4) // [3]. -#define cJ1_IMMED5_MAXPOP1 ((sizeof(jp_t) - 1) / 5) // [3]. -#define cJ1_IMMED6_MAXPOP1 ((sizeof(jp_t) - 1) / 6) // [2]. -#define cJ1_IMMED7_MAXPOP1 ((sizeof(jp_t) - 1) / 7) // [2]. -#endif - - -// **************************************************************************** -// JUDY1 BITMAP LEAF (J1LB) SUPPORT -// **************************************************************************** - -#define J1_JLB_BITMAP(Pjlb,Subexp) ((Pjlb)->j1lb_Bitmap[Subexp]) - -typedef struct J__UDY1_BITMAP_LEAF -{ - BITMAPL_t j1lb_Bitmap[cJU_NUMSUBEXPL]; - -} j1lb_t, * Pj1lb_t; - - -// **************************************************************************** -// MEMORY ALLOCATION SUPPORT -// **************************************************************************** - -// ARRAY-GLOBAL INFORMATION: -// -// At the cost of an occasional additional cache fill, this object, which is -// pointed at by a JRP and in turn points to a JP_BRANCH*, carries array-global -// information about a Judy1 array that has sufficient population to amortize -// the cost. The jpm_Pop0 field prevents having to add up the total population -// for the array in insert, delete, and count code. The jpm_JP field prevents -// having to build a fake JP for entry to a state machine; however, the -// jp_DcdPopO field in jpm_JP, being one byte too small, is not used. -// -// Note: Struct fields are ordered to keep "hot" data in the first 8 words -// (see left-margin comments) for machines with 8-word cache lines, and to keep -// sub-word fields together for efficient packing. - -typedef struct J_UDY1_POPULATION_AND_MEMORY -{ -/* 1 */ Word_t jpm_Pop0; // total population-1 in array. -/* 2 */ jp_t jpm_JP; // JP to first branch; see above. -/* 4 */ Word_t jpm_LastUPop0; // last jpm_Pop0 when convert to BranchU -// Note: Field names match PJError_t for convenience in macros: -/* 7 */ char je_Errno; // one of the enums in Judy.h. -/* 7/8 */ int je_ErrID; // often an internal source line number. -/* 8/9 */ Word_t jpm_TotalMemWords; // words allocated in array. -} j1pm_t, *Pj1pm_t; - - -// TABLES FOR DETERMINING IF LEAVES HAVE ROOM TO GROW: -// -// These tables indicate if a given memory chunk can support growth of a given -// object into wasted (rounded-up) memory in the chunk. This violates the -// hiddenness of the JudyMalloc code. -// -// Also define macros to hide the details in the code using these tables. - -#ifndef JU_64BIT -extern const uint8_t j__1_Leaf1PopToWords[cJ1_LEAF1_MAXPOP1 + 1]; -#endif -extern const uint8_t j__1_Leaf2PopToWords[cJ1_LEAF2_MAXPOP1 + 1]; -extern const uint8_t j__1_Leaf3PopToWords[cJ1_LEAF3_MAXPOP1 + 1]; -#ifdef JU_64BIT -extern const uint8_t j__1_Leaf4PopToWords[cJ1_LEAF4_MAXPOP1 + 1]; -extern const uint8_t j__1_Leaf5PopToWords[cJ1_LEAF5_MAXPOP1 + 1]; -extern const uint8_t j__1_Leaf6PopToWords[cJ1_LEAF6_MAXPOP1 + 1]; -extern const uint8_t j__1_Leaf7PopToWords[cJ1_LEAF7_MAXPOP1 + 1]; -#endif -extern const uint8_t j__1_LeafWPopToWords[cJ1_LEAFW_MAXPOP1 + 1]; - -// Check if increase of population will fit in same leaf: - -#ifndef JU_64BIT -#define J1_LEAF1GROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJ1_LEAF1_MAXPOP1, j__1_Leaf1PopToWords) -#endif -#define J1_LEAF2GROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJ1_LEAF2_MAXPOP1, j__1_Leaf2PopToWords) -#define J1_LEAF3GROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJ1_LEAF3_MAXPOP1, j__1_Leaf3PopToWords) -#ifdef JU_64BIT -#define J1_LEAF4GROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJ1_LEAF4_MAXPOP1, j__1_Leaf4PopToWords) -#define J1_LEAF5GROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJ1_LEAF5_MAXPOP1, j__1_Leaf5PopToWords) -#define J1_LEAF6GROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJ1_LEAF6_MAXPOP1, j__1_Leaf6PopToWords) -#define J1_LEAF7GROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJ1_LEAF7_MAXPOP1, j__1_Leaf7PopToWords) -#endif -#define J1_LEAFWGROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJ1_LEAFW_MAXPOP1, j__1_LeafWPopToWords) - -#ifndef JU_64BIT -#define J1_LEAF1POPTOWORDS(Pop1) (j__1_Leaf1PopToWords[Pop1]) -#endif -#define J1_LEAF2POPTOWORDS(Pop1) (j__1_Leaf2PopToWords[Pop1]) -#define J1_LEAF3POPTOWORDS(Pop1) (j__1_Leaf3PopToWords[Pop1]) -#ifdef JU_64BIT -#define J1_LEAF4POPTOWORDS(Pop1) (j__1_Leaf4PopToWords[Pop1]) -#define J1_LEAF5POPTOWORDS(Pop1) (j__1_Leaf5PopToWords[Pop1]) -#define J1_LEAF6POPTOWORDS(Pop1) (j__1_Leaf6PopToWords[Pop1]) -#define J1_LEAF7POPTOWORDS(Pop1) (j__1_Leaf7PopToWords[Pop1]) -#endif -#define J1_LEAFWPOPTOWORDS(Pop1) (j__1_LeafWPopToWords[Pop1]) - - -// FUNCTIONS TO ALLOCATE OBJECTS: - -Pj1pm_t j__udy1AllocJ1PM(void); // constant size. - -Pjbl_t j__udy1AllocJBL( Pj1pm_t); // constant size. -Pjbb_t j__udy1AllocJBB( Pj1pm_t); // constant size. -Pjp_t j__udy1AllocJBBJP(Word_t, Pj1pm_t); -Pjbu_t j__udy1AllocJBU( Pj1pm_t); // constant size. - -#ifndef JU_64BIT -Pjll_t j__udy1AllocJLL1( Word_t, Pj1pm_t); -#endif -Pjll_t j__udy1AllocJLL2( Word_t, Pj1pm_t); -Pjll_t j__udy1AllocJLL3( Word_t, Pj1pm_t); - -#ifdef JU_64BIT -Pjll_t j__udy1AllocJLL4( Word_t, Pj1pm_t); -Pjll_t j__udy1AllocJLL5( Word_t, Pj1pm_t); -Pjll_t j__udy1AllocJLL6( Word_t, Pj1pm_t); -Pjll_t j__udy1AllocJLL7( Word_t, Pj1pm_t); -#endif - -Pjlw_t j__udy1AllocJLW( Word_t ); // no Pj1pm needed. -Pj1lb_t j__udy1AllocJLB1( Pj1pm_t); // constant size. - - -// FUNCTIONS TO FREE OBJECTS: - -void j__udy1FreeJ1PM( Pj1pm_t, Pj1pm_t); // constant size. - -void j__udy1FreeJBL( Pjbl_t, Pj1pm_t); // constant size. -void j__udy1FreeJBB( Pjbb_t, Pj1pm_t); // constant size. -void j__udy1FreeJBBJP(Pjp_t, Word_t, Pj1pm_t); -void j__udy1FreeJBU( Pjbu_t, Pj1pm_t); // constant size. - -#ifndef JU_64BIT -void j__udy1FreeJLL1( Pjll_t, Word_t, Pj1pm_t); -#endif -void j__udy1FreeJLL2( Pjll_t, Word_t, Pj1pm_t); -void j__udy1FreeJLL3( Pjll_t, Word_t, Pj1pm_t); - -#ifdef JU_64BIT -void j__udy1FreeJLL4( Pjll_t, Word_t, Pj1pm_t); -void j__udy1FreeJLL5( Pjll_t, Word_t, Pj1pm_t); -void j__udy1FreeJLL6( Pjll_t, Word_t, Pj1pm_t); -void j__udy1FreeJLL7( Pjll_t, Word_t, Pj1pm_t); -#endif - -void j__udy1FreeJLW( Pjlw_t, Word_t, Pj1pm_t); -void j__udy1FreeJLB1( Pj1lb_t, Pj1pm_t); // constant size. -void j__udy1FreeSM( Pjp_t, Pj1pm_t); // everything below Pjp. - -#endif // ! _JUDY1_INCLUDED diff --git a/libjudy/src/Judy1/Judy1ByCount.c b/libjudy/src/Judy1/Judy1ByCount.c deleted file mode 100644 index 40caf89b74..0000000000 --- a/libjudy/src/Judy1/Judy1ByCount.c +++ /dev/null @@ -1,954 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.28 $ $Source: /judy/src/JudyCommon/JudyByCount.c $ -// -// Judy*ByCount() function for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DNOSMARTJBB, -DNOSMARTJBU, and/or -DNOSMARTJLB to build a -// version with cache line optimizations deleted, for testing. -// -// Judy*ByCount() is a conceptual although not literal inverse of Judy*Count(). -// Judy*Count() takes a pair of Indexes, and allows finding the ordinal of a -// given Index (that is, its position in the list of valid indexes from the -// beginning) as a degenerate case, because in general the count between two -// Indexes, inclusive, is not always just the difference in their ordinals. -// However, it suffices for Judy*ByCount() to simply be an ordinal-to-Index -// mapper. -// -// Note: Like Judy*Count(), this code must "count sideways" in branches, which -// can result in a lot of cache line fills. However, unlike Judy*Count(), this -// code does not receive a specific Index, hence digit, where to start in each -// branch, so it cant accurately calculate cache line fills required in each -// direction. The best it can do is an approximation based on the total -// population of the expanse (pop1 from Pjp) and the ordinal of the target -// Index (see SETOFFSET()) within the expanse. -// -// Compile with -DSMARTMETRICS to obtain global variables containing smart -// cache line metrics. Note: Dont turn this on simultaneously for this file -// and JudyCount.c because they export the same globals. -// **************************************************************************** - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -// These are imported from JudyCount.c: -// -// TBD: Should this be in common code? Exported from a header file? - -#ifdef JUDY1 -extern Word_t j__udy1JPPop1(const Pjp_t Pjp); -#define j__udyJPPop1 j__udy1JPPop1 -#else -extern Word_t j__udyLJPPop1(const Pjp_t Pjp); -#define j__udyJPPop1 j__udyLJPPop1 -#endif - -// Avoid duplicate symbols since this file is multi-compiled: - -#ifdef SMARTMETRICS -#ifdef JUDY1 -Word_t jbb_upward = 0; // counts of directions taken: -Word_t jbb_downward = 0; -Word_t jbu_upward = 0; -Word_t jbu_downward = 0; -Word_t jlb_upward = 0; -Word_t jlb_downward = 0; -#else -extern Word_t jbb_upward; -extern Word_t jbb_downward; -extern Word_t jbu_upward; -extern Word_t jbu_downward; -extern Word_t jlb_upward; -extern Word_t jlb_downward; -#endif -#endif - - -// **************************************************************************** -// J U D Y 1 B Y C O U N T -// J U D Y L B Y C O U N T -// -// See the manual entry. - -#ifdef JUDY1 -FUNCTION int Judy1ByCount -#else -FUNCTION PPvoid_t JudyLByCount -#endif - ( - Pcvoid_t PArray, // root pointer to first branch/leaf in SM. - Word_t Count, // ordinal of Index to find, 1..MAX. - Word_t * PIndex, // to return found Index. - PJError_t PJError // optional, for returning error info. - ) -{ - Word_t Count0; // Count, base-0, to match pop0. - Word_t state; // current state in SM. - Word_t pop1; // of current branch or leaf, or of expanse. - Word_t pop1lower; // pop1 of expanses (JPs) below that for Count. - Word_t digit; // current word in branch. - Word_t jpcount; // JPs in a BranchB subexpanse. - long jpnum; // JP number in a branch (base 0). - long subexp; // for stepping through layer 1 (subexpanses). - int offset; // index ordinal within a leaf, base 0. - - Pjp_t Pjp; // current JP in branch. - Pjll_t Pjll; // current Judy linear leaf. - - -// CHECK FOR EMPTY ARRAY OR NULL PINDEX: - - if (PArray == (Pvoid_t) NULL) JU_RET_NOTFOUND; - - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -// Convert Count to Count0; assume special case of Count = 0 maps to ~0, as -// desired, to represent the last index in a full array: -// -// Note: Think of Count0 as a reliable "number of Indexes below the target." - - Count0 = Count - 1; - assert((Count || Count0 == ~0)); // ensure CPU is sane about 0 - 1. - pop1lower = 0; - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - - if (Count0 > Pjlw[0]) JU_RET_NOTFOUND; // too high. - - *PIndex = Pjlw[Count]; // Index, base 1. - - JU_RET_FOUND_LEAFW(Pjlw, Pjlw[0] + 1, Count0); - } - else - { - Pjpm_t Pjpm = P_JPM(PArray); - - if (Count0 > (Pjpm->jpm_Pop0)) JU_RET_NOTFOUND; // too high. - - Pjp = &(Pjpm->jpm_JP); - pop1 = (Pjpm->jpm_Pop0) + 1; - -// goto SMByCount; - } - -// COMMON CODE: -// -// Prepare to handle a root-level or lower-level branch: Save the current -// state, obtain the total population for the branch in a state-dependent way, -// and then branch to common code for multiple cases. -// -// For root-level branches, the state is always cJU_ROOTSTATE, and the array -// population must already be set in pop1; it is not available in jp_DcdPopO. -// -// Note: The total population is only needed in cases where the common code -// "counts down" instead of up to minimize cache line fills. However, its -// available cheaply, and its better to do it with a constant shift (constant -// state value) instead of a variable shift later "when needed". - -#define PREPB_ROOT(Next) \ - state = cJU_ROOTSTATE; \ - goto Next - -// Use PREPB_DCD() to first copy the Dcd bytes to *PIndex if there are any -// (only if state < cJU_ROOTSTATE - 1): - -#define PREPB_DCD(Pjp,cState,Next) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - PREPB((Pjp), cState, Next) - -#define PREPB(Pjp,cState,Next) \ - state = (cState); \ - pop1 = JU_JPBRANCH_POP0(Pjp, (cState)) + 1; \ - goto Next - -// Calculate whether the ordinal of an Index within a given expanse falls in -// the lower or upper half of the expanses population, taking care with -// unsigned math and boundary conditions: -// -// Note: Assume the ordinal falls within the expanses population, that is, -// 0 < (Count - Pop1lower) <= Pop1exp (assuming infinite math). -// -// Note: If the ordinal is the middle element, it doesnt matter whether -// LOWERHALF() is TRUE or FALSE. - -#define LOWERHALF(Count0,Pop1lower,Pop1exp) \ - (((Count0) - (Pop1lower)) < ((Pop1exp) / 2)) - -// Calculate the (signed) offset within a leaf to the desired ordinal (Count - -// Pop1lower; offset is one less), and optionally ensure its in range: - -#define SETOFFSET(Offset,Count0,Pop1lower,Pjp) \ - (Offset) = (Count0) - (Pop1lower); \ - assert((Offset) >= 0); \ - assert((Offset) <= JU_JPLEAF_POP0(Pjp)) - -// Variations for immediate indexes, with and without pop1-specific assertions: - -#define SETOFFSET_IMM_CK(Offset,Count0,Pop1lower,cPop1) \ - (Offset) = (Count0) - (Pop1lower); \ - assert((Offset) >= 0); \ - assert((Offset) < (cPop1)) - -#define SETOFFSET_IMM(Offset,Count0,Pop1lower) \ - (Offset) = (Count0) - (Pop1lower) - - -// STATE MACHINE -- TRAVERSE TREE: -// -// In branches, look for the expanse (digit), if any, where the total pop1 -// below or at that expanse would meet or exceed Count, meaning the Index must -// be in this expanse. - -SMByCount: // return here for next branch/leaf. - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH; count populations in JPs in the JBL upwards until finding the -// expanse (digit) containing Count, and "recurse". -// -// Note: There are no null JPs in a JBL; watch out for pop1 == 0. -// -// Note: A JBL should always fit in one cache line => no need to count up -// versus down to save cache line fills. -// -// TBD: The previous is no longer true. Consider enhancing this code to count -// up/down, but it can wait for a later tuning phase. In the meantime, PREPB() -// sets pop1 for the whole array, but that value is not used here. 001215: -// Maybe its true again? - - case cJU_JPBRANCH_L2: PREPB_DCD(Pjp, 2, BranchL); -#ifndef JU_64BIT - case cJU_JPBRANCH_L3: PREPB( Pjp, 3, BranchL); -#else - case cJU_JPBRANCH_L3: PREPB_DCD(Pjp, 3, BranchL); - case cJU_JPBRANCH_L4: PREPB_DCD(Pjp, 4, BranchL); - case cJU_JPBRANCH_L5: PREPB_DCD(Pjp, 5, BranchL); - case cJU_JPBRANCH_L6: PREPB_DCD(Pjp, 6, BranchL); - case cJU_JPBRANCH_L7: PREPB( Pjp, 7, BranchL); -#endif - case cJU_JPBRANCH_L: PREPB_ROOT( BranchL); - { - Pjbl_t Pjbl; - -// Common code (state-independent) for all cases of linear branches: - -BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - - for (jpnum = 0; jpnum < (Pjbl->jbl_NumJPs); ++jpnum) - { - if ((pop1 = j__udyJPPop1((Pjbl->jbl_jp) + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, so do not subtract 1 and compare -// >=, but instead use the following expression: - - if (pop1lower + pop1 > Count0) // Index is in this expanse. - { - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[jpnum], state); - Pjp = (Pjbl->jbl_jp) + jpnum; - goto SMByCount; // look under this expanse. - } - - pop1lower += pop1; // add this JPs pop1. - } - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // should never get here. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // case cJU_JPBRANCH_L - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH; count populations in JPs in the JBB upwards or downwards -// until finding the expanse (digit) containing Count, and "recurse". -// -// Note: There are no null JPs in a JBB; watch out for pop1 == 0. - - case cJU_JPBRANCH_B2: PREPB_DCD(Pjp, 2, BranchB); -#ifndef JU_64BIT - case cJU_JPBRANCH_B3: PREPB( Pjp, 3, BranchB); -#else - case cJU_JPBRANCH_B3: PREPB_DCD(Pjp, 3, BranchB); - case cJU_JPBRANCH_B4: PREPB_DCD(Pjp, 4, BranchB); - case cJU_JPBRANCH_B5: PREPB_DCD(Pjp, 5, BranchB); - case cJU_JPBRANCH_B6: PREPB_DCD(Pjp, 6, BranchB); - case cJU_JPBRANCH_B7: PREPB( Pjp, 7, BranchB); -#endif - case cJU_JPBRANCH_B: PREPB_ROOT( BranchB); - { - Pjbb_t Pjbb; - -// Common code (state-independent) for all cases of bitmap branches: - -BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - -// Shorthand for one subexpanse in a bitmap and for one JP in a bitmap branch: -// -// Note: BMPJP0 exists separately to support assertions. - -#define BMPJP0(Subexp) (P_JP(JU_JBB_PJP(Pjbb, Subexp))) -#define BMPJP(Subexp,JPnum) (BMPJP0(Subexp) + (JPnum)) - - -// Common code for descending through a JP: -// -// Determine the digit for the expanse and save it in *PIndex; then "recurse". - -#define JBB_FOUNDEXPANSE \ - { \ - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb,subexp), jpnum); \ - JU_SETDIGIT(*PIndex, digit, state); \ - Pjp = BMPJP(subexp, jpnum); \ - goto SMByCount; \ - } - - -#ifndef NOSMARTJBB // enable to turn off smart code for comparison purposes. - -// FIGURE OUT WHICH DIRECTION CAUSES FEWER CACHE LINE FILLS; adding the pop1s -// in JPs upwards, or subtracting the pop1s in JPs downwards: -// -// See header comments about limitations of this for Judy*ByCount(). - -#endif - -// COUNT UPWARD, adding each "below" JPs pop1: - -#ifndef NOSMARTJBB // enable to turn off smart code for comparison purposes. - - if (LOWERHALF(Count0, pop1lower, pop1)) - { -#endif -#ifdef SMARTMETRICS - ++jbb_upward; -#endif - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - if ((jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb,subexp))) - && (BMPJP0(subexp) == (Pjp_t) NULL)) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // null ptr. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -// Note: An empty subexpanse (jpcount == 0) is handled "for free": - - for (jpnum = 0; jpnum < jpcount; ++jpnum) - { - if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum))) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - if (pop1lower + pop1 > Count0) - JBB_FOUNDEXPANSE; // Index is in this expanse. - - pop1lower += pop1; // add this JPs pop1. - } - } -#ifndef NOSMARTJBB // enable to turn off smart code for comparison purposes. - } - - -// COUNT DOWNWARD, subtracting each "above" JPs pop1 from the whole expanses -// pop1: - - else - { -#ifdef SMARTMETRICS - ++jbb_downward; -#endif - pop1lower += pop1; // add whole branch to start. - - for (subexp = cJU_NUMSUBEXPB - 1; subexp >= 0; --subexp) - { - if ((jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp))) - && (BMPJP0(subexp) == (Pjp_t) NULL)) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // null ptr. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -// Note: An empty subexpanse (jpcount == 0) is handled "for free": - - for (jpnum = jpcount - 1; jpnum >= 0; --jpnum) - { - if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum))) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - pop1lower -= pop1; - -// Beware unsigned math problems: - - if ((pop1lower == 0) || (pop1lower - 1 < Count0)) - JBB_FOUNDEXPANSE; // Index is in this expanse. - } - } - } -#endif // NOSMARTJBB - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // should never get here. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // case cJU_JPBRANCH_B - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH; count populations in JPs in the JBU upwards or -// downwards until finding the expanse (digit) containing Count, and "recurse". - - case cJU_JPBRANCH_U2: PREPB_DCD(Pjp, 2, BranchU); -#ifndef JU_64BIT - case cJU_JPBRANCH_U3: PREPB( Pjp, 3, BranchU); -#else - case cJU_JPBRANCH_U3: PREPB_DCD(Pjp, 3, BranchU); - case cJU_JPBRANCH_U4: PREPB_DCD(Pjp, 4, BranchU); - case cJU_JPBRANCH_U5: PREPB_DCD(Pjp, 5, BranchU); - case cJU_JPBRANCH_U6: PREPB_DCD(Pjp, 6, BranchU); - case cJU_JPBRANCH_U7: PREPB( Pjp, 7, BranchU); -#endif - case cJU_JPBRANCH_U: PREPB_ROOT( BranchU); - { - Pjbu_t Pjbu; - -// Common code (state-independent) for all cases of uncompressed branches: - -BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - -// Common code for descending through a JP: -// -// Save the digit for the expanse in *PIndex, then "recurse". - -#define JBU_FOUNDEXPANSE \ - { \ - JU_SETDIGIT(*PIndex, jpnum, state); \ - Pjp = (Pjbu->jbu_jp) + jpnum; \ - goto SMByCount; \ - } - - -#ifndef NOSMARTJBU // enable to turn off smart code for comparison purposes. - -// FIGURE OUT WHICH DIRECTION CAUSES FEWER CACHE LINE FILLS; adding the pop1s -// in JPs upwards, or subtracting the pop1s in JPs downwards: -// -// See header comments about limitations of this for Judy*ByCount(). - -#endif - -// COUNT UPWARD, simply adding the pop1 of each JP: - -#ifndef NOSMARTJBU // enable to turn off smart code for comparison purposes. - - if (LOWERHALF(Count0, pop1lower, pop1)) - { -#endif -#ifdef SMARTMETRICS - ++jbu_upward; -#endif - - for (jpnum = 0; jpnum < cJU_BRANCHUNUMJPS; ++jpnum) - { - // shortcut, save a function call: - - if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX) - continue; - - if ((pop1 = j__udyJPPop1((Pjbu->jbu_jp) + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - if (pop1lower + pop1 > Count0) - JBU_FOUNDEXPANSE; // Index is in this expanse. - - pop1lower += pop1; // add this JPs pop1. - } -#ifndef NOSMARTJBU // enable to turn off smart code for comparison purposes. - } - - -// COUNT DOWNWARD, subtracting the pop1 of each JP above from the whole -// expanses pop1: - - else - { -#ifdef SMARTMETRICS - ++jbu_downward; -#endif - pop1lower += pop1; // add whole branch to start. - - for (jpnum = cJU_BRANCHUNUMJPS - 1; jpnum >= 0; --jpnum) - { - // shortcut, save a function call: - - if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX) - continue; - - if ((pop1 = j__udyJPPop1(Pjbu->jbu_jp + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - pop1lower -= pop1; - -// Beware unsigned math problems: - - if ((pop1lower == 0) || (pop1lower - 1 < Count0)) - JBU_FOUNDEXPANSE; // Index is in this expanse. - } - } -#endif // NOSMARTJBU - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // should never get here. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // case cJU_JPBRANCH_U - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Return the Index at the proper ordinal (see SETOFFSET()) in the leaf. First -// copy Dcd bytes, if there are any (only if state < cJU_ROOTSTATE - 1), to -// *PIndex. -// -// Note: The preceding branch traversal code MIGHT set pop1 for this expanse -// (linear leaf) as a side-effect, but dont depend on that (for JUDYL, which -// is the only cases that need it anyway). - -#define PREPL_DCD(cState) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - PREPL - -#ifdef JUDY1 -#define PREPL_SETPOP1 // not needed in any cases. -#else -#define PREPL_SETPOP1 pop1 = JU_JPLEAF_POP0(Pjp) + 1 -#endif - -#define PREPL \ - Pjll = P_JLL(Pjp->jp_Addr); \ - PREPL_SETPOP1; \ - SETOFFSET(offset, Count0, pop1lower, Pjp) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - PREPL_DCD(1); - JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]); - JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - - case cJU_JPLEAF2: - - PREPL_DCD(2); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - -#ifndef JU_64BIT - case cJU_JPLEAF3: - { - Word_t lsb; - PREPL; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - -#else - case cJU_JPLEAF3: - { - Word_t lsb; - PREPL_DCD(3); - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - - case cJU_JPLEAF4: - - PREPL_DCD(4); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - - case cJU_JPLEAF5: - { - Word_t lsb; - PREPL_DCD(5); - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - } - - case cJU_JPLEAF6: - { - Word_t lsb; - PREPL_DCD(6); - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - } - - case cJU_JPLEAF7: - { - Word_t lsb; - PREPL; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_LEAF7(Pjll, pop1, offset); - } -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Return the Index at the proper ordinal (see SETOFFSET()) in the leaf by -// counting bits. First copy Dcd bytes (always present since state 1 < -// cJU_ROOTSTATE) to *PIndex. -// -// Note: The preceding branch traversal code MIGHT set pop1 for this expanse -// (bitmap leaf) as a side-effect, but dont depend on that. - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; - - JU_SETDCD(*PIndex, Pjp, 1); - Pjlb = P_JLB(Pjp->jp_Addr); - pop1 = JU_JPLEAF_POP0(Pjp) + 1; - -// COUNT UPWARD, adding the pop1 of each subexpanse: -// -// The entire bitmap should fit in one cache line, but still try to save some -// CPU time by counting the fewest possible number of subexpanses from the -// bitmap. -// -// See header comments about limitations of this for Judy*ByCount(). - -#ifndef NOSMARTJLB // enable to turn off smart code for comparison purposes. - - if (LOWERHALF(Count0, pop1lower, pop1)) - { -#endif -#ifdef SMARTMETRICS - ++jlb_upward; -#endif - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - { - pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - if (pop1lower + pop1 > Count0) - goto LeafB1; // Index is in this subexpanse. - - pop1lower += pop1; // add this subexpanses pop1. - } -#ifndef NOSMARTJLB // enable to turn off smart code for comparison purposes. - } - - -// COUNT DOWNWARD, subtracting each "above" subexpanses pop1 from the whole -// expanses pop1: - - else - { -#ifdef SMARTMETRICS - ++jlb_downward; -#endif - pop1lower += pop1; // add whole leaf to start. - - for (subexp = cJU_NUMSUBEXPL - 1; subexp >= 0; --subexp) - { - pop1lower -= j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - -// Beware unsigned math problems: - - if ((pop1lower == 0) || (pop1lower - 1 < Count0)) - goto LeafB1; // Index is in this subexpanse. - } - } -#endif // NOSMARTJLB - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // should never get here. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - -// RETURN INDEX FOUND: -// -// Come here with subexp set to the correct subexpanse, and pop1lower set to -// the sum for all lower expanses and subexpanses in the Judy tree. Calculate -// and save in *PIndex the digit corresponding to the ordinal in this -// subexpanse. - -LeafB1: - SETOFFSET(offset, Count0, pop1lower, Pjp); - JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset); - JU_SETDIGIT1(*PIndex, digit); - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + offset)) - - } // case cJU_JPLEAF_B1 - - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// Copy Dcd bytes (always present since state 1 < cJU_ROOTSTATE) to *PIndex, -// then set the appropriate digit for the ordinal (see SETOFFSET()) in the leaf -// as the LSB in *PIndex. - - case cJ1_JPFULLPOPU1: - - JU_SETDCD(*PIndex, Pjp, 1); - SETOFFSET(offset, Count0, pop1lower, Pjp); - assert(offset >= 0); - assert(offset <= cJU_JPFULLPOPU1_POP0); - JU_SETDIGIT1(*PIndex, offset); - JU_RET_FOUND_FULLPOPU1; -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: -// -// Locate the Index with the proper ordinal (see SETOFFSET()) in the Immediate, -// depending on leaf Index Size and pop1. Note: There are no Dcd bytes in an -// Immediate JP, but in a cJU_JPIMMED_*_01 JP, the field holds the least bytes -// of the immediate Index. - -#define SET_01(cState) JU_SETDIGITS(*PIndex, JU_JPDCDPOP0(Pjp), cState) - - case cJU_JPIMMED_1_01: SET_01(1); goto Imm_01; - case cJU_JPIMMED_2_01: SET_01(2); goto Imm_01; - case cJU_JPIMMED_3_01: SET_01(3); goto Imm_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: SET_01(4); goto Imm_01; - case cJU_JPIMMED_5_01: SET_01(5); goto Imm_01; - case cJU_JPIMMED_6_01: SET_01(6); goto Imm_01; - case cJU_JPIMMED_7_01: SET_01(7); goto Imm_01; -#endif - -Imm_01: - - DBGCODE(SETOFFSET_IMM_CK(offset, Count0, pop1lower, 1);) - JU_RET_FOUND_IMM_01(Pjp); - -// Shorthand for where to find start of Index bytes array: - -#ifdef JUDY1 -#define PJI (Pjp->jp_1Index) -#else -#define PJI (Pjp->jp_LIndex) -#endif - -// Optional code to check the remaining ordinal (see SETOFFSET_IMM()) against -// the Index Size of the Immediate: - -#ifndef DEBUG // simple placeholder: -#define IMM(cPop1,Next) \ - goto Next -#else // extra pop1-specific checking: -#define IMM(cPop1,Next) \ - SETOFFSET_IMM_CK(offset, Count0, pop1lower, cPop1); \ - goto Next -#endif - - case cJU_JPIMMED_1_02: IMM( 2, Imm1); - case cJU_JPIMMED_1_03: IMM( 3, Imm1); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: IMM( 4, Imm1); - case cJU_JPIMMED_1_05: IMM( 5, Imm1); - case cJU_JPIMMED_1_06: IMM( 6, Imm1); - case cJU_JPIMMED_1_07: IMM( 7, Imm1); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: IMM( 8, Imm1); - case cJ1_JPIMMED_1_09: IMM( 9, Imm1); - case cJ1_JPIMMED_1_10: IMM(10, Imm1); - case cJ1_JPIMMED_1_11: IMM(11, Imm1); - case cJ1_JPIMMED_1_12: IMM(12, Imm1); - case cJ1_JPIMMED_1_13: IMM(13, Imm1); - case cJ1_JPIMMED_1_14: IMM(14, Imm1); - case cJ1_JPIMMED_1_15: IMM(15, Imm1); -#endif - -Imm1: SETOFFSET_IMM(offset, Count0, pop1lower); - JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]); - JU_RET_FOUND_IMM(Pjp, offset); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: IMM(2, Imm2); - case cJU_JPIMMED_2_03: IMM(3, Imm2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: IMM(4, Imm2); - case cJ1_JPIMMED_2_05: IMM(5, Imm2); - case cJ1_JPIMMED_2_06: IMM(6, Imm2); - case cJ1_JPIMMED_2_07: IMM(7, Imm2); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -Imm2: SETOFFSET_IMM(offset, Count0, pop1lower); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: IMM(2, Imm3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: IMM(3, Imm3); - case cJ1_JPIMMED_3_04: IMM(4, Imm3); - case cJ1_JPIMMED_3_05: IMM(5, Imm3); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -Imm3: - { - Word_t lsb; - SETOFFSET_IMM(offset, Count0, pop1lower); - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: IMM(2, Imm4); - case cJ1_JPIMMED_4_03: IMM(3, Imm4); - -Imm4: SETOFFSET_IMM(offset, Count0, pop1lower); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); - - case cJ1_JPIMMED_5_02: IMM(2, Imm5); - case cJ1_JPIMMED_5_03: IMM(3, Imm5); - -Imm5: - { - Word_t lsb; - SETOFFSET_IMM(offset, Count0, pop1lower); - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_6_02: IMM(2, Imm6); - -Imm6: - { - Word_t lsb; - SETOFFSET_IMM(offset, Count0, pop1lower); - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_7_02: IMM(2, Imm7); - -Imm7: - { - Word_t lsb; - SETOFFSET_IMM(offset, Count0, pop1lower); - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif // (JUDY1 && JU_64BIT) - - -// ---------------------------------------------------------------------------- -// UNEXPECTED JP TYPES: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SMByCount switch. - - /*NOTREACHED*/ - -} // Judy1ByCount() / JudyLByCount() diff --git a/libjudy/src/Judy1/Judy1Cascade.c b/libjudy/src/Judy1/Judy1Cascade.c deleted file mode 100644 index 998a9d727f..0000000000 --- a/libjudy/src/Judy1/Judy1Cascade.c +++ /dev/null @@ -1,1942 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.38 $ $Source: /judy/src/JudyCommon/JudyCascade.c $ - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -extern int j__udyCreateBranchL(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); -extern int j__udyCreateBranchB(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); - -DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);) - -static const jbb_t StageJBBZero; // zeroed versions of namesake struct. - -// TBD: There are multiple copies of (some of) these CopyWto3, Copy3toW, -// CopyWto7 and Copy7toW functions in Judy1Cascade.c, JudyLCascade.c, and -// JudyDecascade.c. These static functions should probably be moved to a -// common place, made macros, or something to avoid having four copies. - - -// **************************************************************************** -// __ J U D Y C O P Y X T O W - - -FUNCTION static void j__udyCopy3toW( - PWord_t PDest, - uint8_t * PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY3_PINDEX_TO_LONG(*PDest, PSrc); - PSrc += 3; - PDest += 1; - - } while(--LeafIndexes); - -} //j__udyCopy3toW() - - -#ifdef JU_64BIT - -FUNCTION static void j__udyCopy4toW( - PWord_t PDest, - uint32_t * PSrc, - Word_t LeafIndexes) -{ - do { *PDest++ = *PSrc++; - } while(--LeafIndexes); - -} // j__udyCopy4toW() - - -FUNCTION static void j__udyCopy5toW( - PWord_t PDest, - uint8_t * PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY5_PINDEX_TO_LONG(*PDest, PSrc); - PSrc += 5; - PDest += 1; - - } while(--LeafIndexes); - -} // j__udyCopy5toW() - - -FUNCTION static void j__udyCopy6toW( - PWord_t PDest, - uint8_t * PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY6_PINDEX_TO_LONG(*PDest, PSrc); - PSrc += 6; - PDest += 1; - - } while(--LeafIndexes); - -} // j__udyCopy6toW() - - -FUNCTION static void j__udyCopy7toW( - PWord_t PDest, - uint8_t * PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY7_PINDEX_TO_LONG(*PDest, PSrc); - PSrc += 7; - PDest += 1; - - } while(--LeafIndexes); - -} // j__udyCopy7toW() - -#endif // JU_64BIT - - -// **************************************************************************** -// __ J U D Y C O P Y W T O X - - -FUNCTION static void j__udyCopyWto3( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY3_LONG_TO_PINDEX(PDest, *PSrc); - PSrc += 1; - PDest += 3; - - } while(--LeafIndexes); - -} // j__udyCopyWto3() - - -#ifdef JU_64BIT - -FUNCTION static void j__udyCopyWto4( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - uint32_t *PDest32 = (uint32_t *)PDest; - - do - { - *PDest32 = *PSrc; - PSrc += 1; - PDest32 += 1; - } while(--LeafIndexes); - -} // j__udyCopyWto4() - - -FUNCTION static void j__udyCopyWto5( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY5_LONG_TO_PINDEX(PDest, *PSrc); - PSrc += 1; - PDest += 5; - - } while(--LeafIndexes); - -} // j__udyCopyWto5() - - -FUNCTION static void j__udyCopyWto6( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY6_LONG_TO_PINDEX(PDest, *PSrc); - PSrc += 1; - PDest += 6; - - } while(--LeafIndexes); - -} // j__udyCopyWto6() - - -FUNCTION static void j__udyCopyWto7( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY7_LONG_TO_PINDEX(PDest, *PSrc); - PSrc += 1; - PDest += 7; - - } while(--LeafIndexes); - -} // j__udyCopyWto7() - -#endif // JU_64BIT - - -// **************************************************************************** -// COMMON CODE (MACROS): -// -// Free objects in an array of valid JPs, StageJP[ExpCnt] == last one may -// include Immeds, which are ignored. - -#define FREEALLEXIT(ExpCnt,StageJP,Pjpm) \ - { \ - Word_t _expct = (ExpCnt); \ - while (_expct--) j__udyFreeSM(&((StageJP)[_expct]), Pjpm); \ - return(-1); \ - } - -// Clear the array that keeps track of the number of JPs in a subexpanse: - -#define ZEROJP(SubJPCount) \ - { \ - int ii; \ - for (ii = 0; ii < cJU_NUMSUBEXPB; ii++) (SubJPCount[ii]) = 0; \ - } - -// **************************************************************************** -// __ J U D Y S T A G E J B B T O J B B -// -// Create a mallocd BranchB (jbb_t) from a staged BranchB while "splaying" a -// single old leaf. Return -1 if out of memory, otherwise 1. - -static int j__udyStageJBBtoJBB( - Pjp_t PjpLeaf, // JP of leaf being splayed. - Pjbb_t PStageJBB, // temp jbb_t on stack. - Pjp_t PjpArray, // array of JPs to splayed new leaves. - uint8_t * PSubCount, // count of JPs for each subexpanse. - Pjpm_t Pjpm) // the jpm_t for JudyAlloc*(). -{ - Pjbb_t PjbbRaw; // pointer to new bitmap branch. - Pjbb_t Pjbb; - Word_t subexp; - -// Get memory for new BranchB: - - if ((PjbbRaw = j__udyAllocJBB(Pjpm)) == (Pjbb_t) NULL) return(-1); - Pjbb = P_JBB(PjbbRaw); - -// Copy staged BranchB into just-allocated BranchB: - - *Pjbb = *PStageJBB; - -// Allocate the JP subarrays (BJP) for the new BranchB: - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; subexp++) - { - Pjp_t PjpRaw; - Pjp_t Pjp; - Word_t NumJP; // number of JPs in each subexpanse. - - if ((NumJP = PSubCount[subexp]) == 0) continue; // empty. - -// Out of memory, back out previous allocations: - - if ((PjpRaw = j__udyAllocJBBJP(NumJP, Pjpm)) == (Pjp_t) NULL) - { - while(subexp--) - { - if ((NumJP = PSubCount[subexp]) == 0) continue; - - PjpRaw = JU_JBB_PJP(Pjbb, subexp); - j__udyFreeJBBJP(PjpRaw, NumJP, Pjpm); - } - j__udyFreeJBB(PjbbRaw, Pjpm); - return(-1); // out of memory. - } - Pjp = P_JP(PjpRaw); - -// Place the JP subarray pointer in the new BranchB, copy subarray JPs, and -// advance to the next subexpanse: - - JU_JBB_PJP(Pjbb, subexp) = PjpRaw; - JU_COPYMEM(Pjp, PjpArray, NumJP); - PjpArray += NumJP; - - } // for each subexpanse. - -// Change the PjpLeaf from Leaf to BranchB: - - PjpLeaf->jp_Addr = (Word_t) PjbbRaw; - PjpLeaf->jp_Type += cJU_JPBRANCH_B2 - cJU_JPLEAF2; // Leaf to BranchB. - - return(1); - -} // j__udyStageJBBtoJBB() - - -// **************************************************************************** -// __ J U D Y J L L 2 T O J L B 1 -// -// Create a LeafB1 (jlb_t = JLB1) from a Leaf2 (2-byte Indexes and for JudyL, -// Word_t Values). Return NULL if out of memory, else a pointer to the new -// LeafB1. -// -// NOTE: Caller must release the Leaf2 that was passed in. - -FUNCTION static Pjlb_t j__udyJLL2toJLB1( - uint16_t * Pjll, // array of 16-bit indexes. -#ifdef JUDYL - Pjv_t Pjv, // array of associated values. -#endif - Word_t LeafPop1, // number of indexes/values. - Pvoid_t Pjpm) // jpm_t for JudyAlloc*()/JudyFree*(). -{ - Pjlb_t PjlbRaw; - Pjlb_t Pjlb; - int offset; -JUDYLCODE(int subexp;) - -// Allocate the LeafB1: - - if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL) - return((Pjlb_t) NULL); - Pjlb = P_JLB(PjlbRaw); - -// Copy Leaf2 indexes to LeafB1: - - for (offset = 0; offset < LeafPop1; ++offset) - JU_BITMAPSETL(Pjlb, Pjll[offset]); - -#ifdef JUDYL - -// Build LeafVs from bitmap: - - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - { - struct _POINTER_VALUES - { - Word_t pv_Pop1; // size of value area. - Pjv_t pv_Pjv; // raw pointer to value area. - } pv[cJU_NUMSUBEXPL]; - -// Get the population of the subexpanse, and if any, allocate a LeafV: - - pv[subexp].pv_Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - - if (pv[subexp].pv_Pop1) - { - Pjv_t Pjvnew; - -// TBD: There is an opportunity to put pop == 1 value in pointer: - - pv[subexp].pv_Pjv = j__udyLAllocJV(pv[subexp].pv_Pop1, Pjpm); - -// Upon out of memory, free all previously allocated: - - if (pv[subexp].pv_Pjv == (Pjv_t) NULL) - { - while(subexp--) - { - if (pv[subexp].pv_Pop1) - { - j__udyLFreeJV(pv[subexp].pv_Pjv, pv[subexp].pv_Pop1, - Pjpm); - } - } - j__udyFreeJLB1(PjlbRaw, Pjpm); - return((Pjlb_t) NULL); - } - - Pjvnew = P_JV(pv[subexp].pv_Pjv); - JU_COPYMEM(Pjvnew, Pjv, pv[subexp].pv_Pop1); - Pjv += pv[subexp].pv_Pop1; // advance value pointer. - -// Place raw pointer to value array in bitmap subexpanse: - - JL_JLB_PVALUE(Pjlb, subexp) = pv[subexp].pv_Pjv; - - } // populated subexpanse. - } // each subexpanse. - -#endif // JUDYL - - return(PjlbRaw); // pointer to LeafB1. - -} // j__udyJLL2toJLB1() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 1 -// -// Create bitmap leaf from 1-byte Indexes and Word_t Values. -// -// TBD: There must be a better way. -// -// Only for JudyL 32 bit: (note, unifdef disallows comment on next line) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -FUNCTION int j__udyCascade1( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - Word_t DcdP0; - uint8_t * PLeaf; - Pjlb_t PjlbRaw; - Pjlb_t Pjlb; - Word_t Pop1; - Word_t ii; // temp for loop counter -JUDYLCODE(Pjv_t Pjv;) - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF1); - assert((JU_JPDCDPOP0(Pjp) & 0xFF) == (cJU_LEAF1_MAXPOP1-1)); - - PjlbRaw = j__udyAllocJLB1(Pjpm); - if (PjlbRaw == (Pjlb_t) NULL) return(-1); - - Pjlb = P_JLB(PjlbRaw); - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - - JUDYLCODE(Pjv = JL_LEAF1VALUEAREA(PLeaf, Pop1);) - -// Copy 1 byte index Leaf to bitmap Leaf - for (ii = 0; ii < Pop1; ii++) JU_BITMAPSETL(Pjlb, PLeaf[ii]); - -#ifdef JUDYL -// Build 8 subexpanse Value leaves from bitmap - for (ii = 0; ii < cJU_NUMSUBEXPL; ii++) - { -// Get number of Indexes in subexpanse - if ((Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, ii)))) - { - Pjv_t PjvnewRaw; // value area of new leaf. - Pjv_t Pjvnew; - - PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm); - if (PjvnewRaw == (Pjv_t) NULL) // out of memory. - { -// Free prevously allocated LeafVs: - while(ii--) - { - if ((Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, ii)))) - { - PjvnewRaw = JL_JLB_PVALUE(Pjlb, ii); - j__udyLFreeJV(PjvnewRaw, Pop1, Pjpm); - } - } -// Free the bitmap leaf - j__udyLFreeJLB1(PjlbRaw,Pjpm); - return(-1); - } - Pjvnew = P_JV(PjvnewRaw); - JU_COPYMEM(Pjvnew, Pjv, Pop1); - - Pjv += Pop1; - JL_JLB_PVALUE(Pjlb, ii) = PjvnewRaw; - } - } -#endif // JUDYL - - DcdP0 = JU_JPDCDPOP0(Pjp) | (PLeaf[0] & cJU_DCDMASK(1)); - JU_JPSETADT(Pjp, (Word_t)PjlbRaw, DcdP0, cJU_JPLEAF_B1); - - return(1); // return success - -} // j__udyCascade1() - -#endif // (!(JUDY1 && JU_64BIT)) - - -// **************************************************************************** -// __ J U D Y C A S C A D E 2 -// -// Entry PLeaf of size LeafPop1 is either compressed or splayed with pointer -// returned in Pjp. Entry Levels sizeof(Word_t) down to level 2. -// -// Splay or compress the 2-byte Index Leaf that Pjp point to. Return *Pjp as a -// (compressed) cJU_LEAFB1 or a cJU_BRANCH_*2 - -FUNCTION int j__udyCascade2( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint16_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF2_MAXPOP1]; // JPs of new leaves - uint8_t StageExp [cJU_LEAF2_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF2); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFF) == (cJU_LEAF2_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint16_t *) P_JLL(Pjp->jp_Addr); - -// And its Value area - JUDYLCODE(Pjv = JL_LEAF2VALUEAREA(PLeaf, cJU_LEAF2_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it to a Bitmap Leaf - - CIndex = PLeaf[0]; - if (!JU_DIGITATSTATE(CIndex ^ PLeaf[cJU_LEAF2_MAXPOP1-1], 2)) - { -// cJU_JPLEAF_B1 - Word_t DcdP0; - Pjlb_t PjlbRaw; - PjlbRaw = j__udyJLL2toJLB1(PLeaf, -#ifdef JUDYL - Pjv, -#endif - cJU_LEAF2_MAXPOP1, Pjpm); - if (PjlbRaw == (Pjlb_t)NULL) return(-1); // out of memory - -// Merge in another Dcd byte because compressing - DcdP0 = (CIndex & cJU_DCDMASK(1)) | JU_JPDCDPOP0(Pjp); - JU_JPSETADT(Pjp, (Word_t)PjlbRaw, DcdP0, cJU_JPLEAF_B1); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 2 byte index Leaf to 1 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF2_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ PLeaf[End], 2)) - ) - { -// Build a leaf below the previous expanse -// - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 2); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 2); - - if (Pop1 == 1) // cJU_JPIMMED_1_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(1)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_1_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_1_01); -#endif // JUDYL - } - else if (Pop1 <= cJU_IMMED1_MAXPOP1) // bigger - { -// cJL_JPIMMED_1_02..3: JudyL 32 -// cJ1_JPIMMED_1_02..7: Judy1 32 -// cJL_JPIMMED_1_02..7: JudyL 64 -// cJ1_JPIMMED_1_02..15: Judy1 64 -#ifdef JUDYL - Pjv_t PjvnewRaw; // value area of leaf. - Pjv_t Pjvnew; - -// Allocate Value area for Immediate Leaf - PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm); - if (PjvnewRaw == (Pjv_t) NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjvnew = P_JV(PjvnewRaw); - -// Copy to Values to Value Leaf - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); - PjpJP->jp_Addr = (Word_t) PjvnewRaw; - -// Copy to JP as an immediate Leaf - JU_COPYMEM(PjpJP->jp_LIndex, PLeaf + Start, - Pop1); -#else - JU_COPYMEM(PjpJP->jp_1Index, PLeaf + Start, - Pop1); -#endif -// Set Type, Population and Index size - PjpJP->jp_Type = cJU_JPIMMED_1_02 + Pop1 - 2; - } - -// 64Bit Judy1 does not have Leaf1: (note, unifdef disallows comment on next -// line) - -#if (! (defined(JUDY1) && defined(JU_64BIT))) - else if (Pop1 <= cJU_LEAF1_MAXPOP1) // still bigger - { -// cJU_JPLEAF1 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get a new Leaf - PjllRaw = j__udyAllocJLL1(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF1VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif -// Copy Indexes to new Leaf - JU_COPYMEM((uint8_t *)Pjll, PLeaf+Start, Pop1); - - DBGCODE(JudyCheckSorted(Pjll, Pop1, 1);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(2)) - | - (CIndex & cJU_DCDMASK(2-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF1); - } -#endif // (!(JUDY1 && JU_64BIT)) // Not 64Bit Judy1 - - else // biggest - { -// cJU_JPLEAF_B1 - Word_t DcdP0; - Pjlb_t PjlbRaw; - PjlbRaw = j__udyJLL2toJLB1( - PLeaf + Start, -#ifdef JUDYL - Pjv + Start, -#endif - Pop1, Pjpm); - if (PjlbRaw == (Pjlb_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(2)) - | - (CIndex & cJU_DCDMASK(2-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjlbRaw, DcdP0, - cJU_JPLEAF_B1); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF2_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = PLeaf[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L2; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade2() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 3 -// -// Return *Pjp as a (compressed) cJU_LEAF2, cJU_BRANCH_L3, cJU_BRANCH_B3. - -FUNCTION int j__udyCascade3( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint8_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF3_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF3_MAXPOP1]; - uint8_t StageExp [cJU_LEAF3_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF3); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFF) == (cJU_LEAF3_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - -// Extract leaf to Word_t and insert-sort Index into it - j__udyCopy3toW(StageA, PLeaf, cJU_LEAF3_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF3VALUEAREA(PLeaf, cJU_LEAF3_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF3_MAXPOP1-1], 3)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Alloc a 2 byte Index Leaf - PjllRaw = j__udyAllocJLL2(cJU_LEAF3_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy just 2 bytes Indexes to new Leaf -// j__udyCopyWto2((uint16_t *) Pjll, StageA, cJU_LEAF3_MAXPOP1); - JU_COPYMEM ((uint16_t *) Pjll, StageA, cJU_LEAF3_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF2VALUEAREA(Pjll, cJU_LEAF3_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF3_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF3_MAXPOP1, 2);) - -// Form new JP, Pop0 field is unchanged -// Add in another Dcd byte because compressing - DcdP0 = (CIndex & cJU_DCDMASK(2)) | JU_JPDCDPOP0(Pjp); - - JU_JPSETADT(Pjp, (Word_t) PjllRaw, DcdP0, cJU_JPLEAF2); - - return(1); // Success - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 3 byte index Leaf to 2 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF3_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 3)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 3); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 3); - - if (Pop1 == 1) // cJU_JPIMMED_2_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(2)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_2_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_2_01); -#endif // JUDYL - } -#if (defined(JUDY1) || defined(JU_64BIT)) - else if (Pop1 <= cJU_IMMED2_MAXPOP1) - { -// cJ1_JPIMMED_2_02..3: Judy1 32 -// cJL_JPIMMED_2_02..3: JudyL 64 -// cJ1_JPIMMED_2_02..7: Judy1 64 -#ifdef JUDYL -// Alloc is 1st in case of malloc fail - Pjv_t PjvnewRaw; // value area of new leaf. - Pjv_t Pjvnew; - -// Allocate Value area for Immediate Leaf - PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm); - if (PjvnewRaw == (Pjv_t) NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjvnew = P_JV(PjvnewRaw); - -// Copy to Values to Value Leaf - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); - - PjpJP->jp_Addr = (Word_t) PjvnewRaw; - -// Copy to Index to JP as an immediate Leaf - JU_COPYMEM((uint16_t *) (PjpJP->jp_LIndex), - StageA + Start, Pop1); -#else // JUDY1 - JU_COPYMEM((uint16_t *) (PjpJP->jp_1Index), - StageA + Start, Pop1); -#endif // JUDY1 -// Set Type, Population and Index size - PjpJP->jp_Type = cJU_JPIMMED_2_02 + Pop1 - 2; - } -#endif // (JUDY1 || JU_64BIT) - - else // Make a linear leaf2 - { -// cJU_JPLEAF2 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - - PjllRaw = j__udyAllocJLL2(Pop1, Pjpm); - if (PjllRaw == (Pjll_t) NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF2VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif -// Copy least 2 bytes per Index of Leaf to new Leaf - JU_COPYMEM((uint16_t *) Pjll, StageA+Start, - Pop1); - - DBGCODE(JudyCheckSorted(Pjll, Pop1, 2);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(3)) - | - (CIndex & cJU_DCDMASK(3-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF2); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF3_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L3; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade3() - - -#ifdef JU_64BIT // JudyCascade[4567] - -// **************************************************************************** -// __ J U D Y C A S C A D E 4 -// -// Cascade from a cJU_JPLEAF4 to one of the following: -// 1. if leaf is in 1 expanse: -// compress it into a JPLEAF3 -// 2. if leaf contains multiple expanses: -// create linear or bitmap branch containing -// each new expanse is either a: -// JPIMMED_3_01 branch -// JPIMMED_3_02 branch -// JPLEAF3 - -FUNCTION int j__udyCascade4( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint32_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF4_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF4_MAXPOP1]; - uint8_t StageExp [cJU_LEAF4_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF4); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFFFF) == (cJU_LEAF4_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint32_t *) P_JLL(Pjp->jp_Addr); - -// Extract 4 byte index Leaf to Word_t - j__udyCopy4toW(StageA, PLeaf, cJU_LEAF4_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF4VALUEAREA(PLeaf, cJU_LEAF4_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF4_MAXPOP1-1], 4)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new Leaf. - -// Alloc a 3 byte Index Leaf - PjllRaw = j__udyAllocJLL3(cJU_LEAF4_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy Index area into new Leaf - j__udyCopyWto3((uint8_t *) Pjll, StageA, cJU_LEAF4_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF3VALUEAREA(Pjll, cJU_LEAF4_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF4_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF4_MAXPOP1, 3);) - - DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(3)); - JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF3); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 4 byte index Leaf to 3 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF4_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 4)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 4); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 4); - - if (Pop1 == 1) // cJU_JPIMMED_3_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(3)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_3_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_3_01); -#endif // JUDYL - } - else if (Pop1 <= cJU_IMMED3_MAXPOP1) - { -// cJ1_JPIMMED_3_02 : Judy1 32 -// cJL_JPIMMED_3_02 : JudyL 64 -// cJ1_JPIMMED_3_02..5: Judy1 64 - -#ifdef JUDYL -// Alloc is 1st in case of malloc fail - Pjv_t PjvnewRaw; // value area of new leaf. - Pjv_t Pjvnew; - -// Allocate Value area for Immediate Leaf - PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm); - if (PjvnewRaw == (Pjv_t) NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjvnew = P_JV(PjvnewRaw); - -// Copy to Values to Value Leaf - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); - PjpJP->jp_Addr = (Word_t) PjvnewRaw; - -// Copy to Index to JP as an immediate Leaf - j__udyCopyWto3(PjpJP->jp_LIndex, - StageA + Start, Pop1); -#else - j__udyCopyWto3(PjpJP->jp_1Index, - StageA + Start, Pop1); -#endif -// Set type, population and Index size - PjpJP->jp_Type = cJU_JPIMMED_3_02 + Pop1 - 2; - } - else - { -// cJU_JPLEAF3 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - - PjllRaw = j__udyAllocJLL3(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); - -// Copy Indexes to new Leaf - j__udyCopyWto3((uint8_t *) Pjll, StageA + Start, - Pop1); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF3VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif - DBGCODE(JudyCheckSorted(Pjll, Pop1, 3);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(4)) - | - (CIndex & cJU_DCDMASK(4-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF3); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF4_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L4; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade4() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 5 -// -// Cascade from a cJU_JPLEAF5 to one of the following: -// 1. if leaf is in 1 expanse: -// compress it into a JPLEAF4 -// 2. if leaf contains multiple expanses: -// create linear or bitmap branch containing -// each new expanse is either a: -// JPIMMED_4_01 branch -// JPLEAF4 - -FUNCTION int j__udyCascade5( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint8_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF5_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF5_MAXPOP1]; - uint8_t StageExp [cJU_LEAF5_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF5); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFFFFFF) == (cJU_LEAF5_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - -// Extract 5 byte index Leaf to Word_t - j__udyCopy5toW(StageA, PLeaf, cJU_LEAF5_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF5VALUEAREA(PLeaf, cJU_LEAF5_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF5_MAXPOP1-1], 5)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Alloc a 4 byte Index Leaf - PjllRaw = j__udyAllocJLL4(cJU_LEAF5_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy Index area into new Leaf - j__udyCopyWto4((uint8_t *) Pjll, StageA, cJU_LEAF5_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF4VALUEAREA(Pjll, cJU_LEAF5_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF5_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF5_MAXPOP1, 4);) - - DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(4)); - JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF4); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 5 byte index Leaf to 4 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF5_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 5)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 5); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 5); - - if (Pop1 == 1) // cJU_JPIMMED_4_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(4)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_4_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_4_01); -#endif // JUDYL - } -#ifdef JUDY1 - else if (Pop1 <= cJ1_IMMED4_MAXPOP1) - { -// cJ1_JPIMMED_4_02..3: Judy1 64 - -// Copy to Index to JP as an immediate Leaf - j__udyCopyWto4(PjpJP->jp_1Index, - StageA + Start, Pop1); - -// Set pointer, type, population and Index size - PjpJP->jp_Type = cJ1_JPIMMED_4_02 + Pop1 - 2; - } -#endif - else - { -// cJU_JPLEAF4 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get a new Leaf - PjllRaw = j__udyAllocJLL4(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); - -// Copy Indexes to new Leaf - j__udyCopyWto4((uint8_t *) Pjll, StageA + Start, - Pop1); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF4VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif - DBGCODE(JudyCheckSorted(Pjll, Pop1, 4);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(5)) - | - (CIndex & cJU_DCDMASK(5-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF4); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF5_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L5; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade5() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 6 -// -// Cascade from a cJU_JPLEAF6 to one of the following: -// 1. if leaf is in 1 expanse: -// compress it into a JPLEAF5 -// 2. if leaf contains multiple expanses: -// create linear or bitmap branch containing -// each new expanse is either a: -// JPIMMED_5_01 ... JPIMMED_5_03 branch -// JPIMMED_5_01 branch -// JPLEAF5 - -FUNCTION int j__udyCascade6( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint8_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF6_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF6_MAXPOP1]; - uint8_t StageExp [cJU_LEAF6_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF6); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFFFFFFFF) == (cJU_LEAF6_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - -// Extract 6 byte index Leaf to Word_t - j__udyCopy6toW(StageA, PLeaf, cJU_LEAF6_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF6VALUEAREA(PLeaf, cJU_LEAF6_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF6_MAXPOP1-1], 6)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Alloc a 5 byte Index Leaf - PjllRaw = j__udyAllocJLL5(cJU_LEAF6_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy Index area into new Leaf - j__udyCopyWto5((uint8_t *) Pjll, StageA, cJU_LEAF6_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF5VALUEAREA(Pjll, cJU_LEAF6_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF6_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF6_MAXPOP1, 5);) - - DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(5)); - JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF5); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 6 byte index Leaf to 5 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF6_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 6)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 6); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 6); - - if (Pop1 == 1) // cJU_JPIMMED_5_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(5)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_5_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_5_01); -#endif // JUDYL - } -#ifdef JUDY1 - else if (Pop1 <= cJ1_IMMED5_MAXPOP1) - { -// cJ1_JPIMMED_5_02..3: Judy1 64 - -// Copy to Index to JP as an immediate Leaf - j__udyCopyWto5(PjpJP->jp_1Index, - StageA + Start, Pop1); - -// Set pointer, type, population and Index size - PjpJP->jp_Type = cJ1_JPIMMED_5_02 + Pop1 - 2; - } -#endif - else - { -// cJU_JPLEAF5 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get a new Leaf - PjllRaw = j__udyAllocJLL5(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); - -// Copy Indexes to new Leaf - j__udyCopyWto5((uint8_t *) Pjll, StageA + Start, - Pop1); - -// Copy to Values to new Leaf -#ifdef JUDYL - Pjvnew = JL_LEAF5VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif - DBGCODE(JudyCheckSorted(Pjll, Pop1, 5);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(6)) - | - (CIndex & cJU_DCDMASK(6-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF5); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF6_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L6; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade6() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 7 -// -// Cascade from a cJU_JPLEAF7 to one of the following: -// 1. if leaf is in 1 expanse: -// compress it into a JPLEAF6 -// 2. if leaf contains multiple expanses: -// create linear or bitmap branch containing -// each new expanse is either a: -// JPIMMED_6_01 ... JPIMMED_6_02 branch -// JPIMMED_6_01 branch -// JPLEAF6 - -FUNCTION int j__udyCascade7( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint8_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF7_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF7_MAXPOP1]; - uint8_t StageExp [cJU_LEAF7_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF7); - assert(JU_JPDCDPOP0(Pjp) == (cJU_LEAF7_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - -// Extract 7 byte index Leaf to Word_t - j__udyCopy7toW(StageA, PLeaf, cJU_LEAF7_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF7VALUEAREA(PLeaf, cJU_LEAF7_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF7_MAXPOP1-1], 7)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Alloc a 6 byte Index Leaf - PjllRaw = j__udyAllocJLL6(cJU_LEAF7_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy Index area into new Leaf - j__udyCopyWto6((uint8_t *) Pjll, StageA, cJU_LEAF7_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF6VALUEAREA(Pjll, cJU_LEAF7_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF7_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF7_MAXPOP1, 6);) - - DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(6)); - JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF6); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 7 byte index Leaf to 6 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF7_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 7)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 7); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 7); - - if (Pop1 == 1) // cJU_JPIMMED_6_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(6)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_6_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_6_01); -#endif // JUDYL - } -#ifdef JUDY1 - else if (Pop1 == cJ1_IMMED6_MAXPOP1) - { -// cJ1_JPIMMED_6_02: Judy1 64 - -// Copy to Index to JP as an immediate Leaf - j__udyCopyWto6(PjpJP->jp_1Index, - StageA + Start, 2); - -// Set pointer, type, population and Index size - PjpJP->jp_Type = cJ1_JPIMMED_6_02; - } -#endif - else - { -// cJU_JPLEAF6 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get a new Leaf - PjllRaw = j__udyAllocJLL6(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - Pjll = P_JLL(PjllRaw); - -// Copy Indexes to new Leaf - j__udyCopyWto6((uint8_t *) Pjll, StageA + Start, - Pop1); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF6VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif - DBGCODE(JudyCheckSorted(Pjll, Pop1, 6);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(7)) - | - (CIndex & cJU_DCDMASK(7-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF6); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF7_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L7; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade7() - -#endif // JU_64BIT - - -// **************************************************************************** -// __ J U D Y C A S C A D E L -// -// (Compressed) cJU_LEAF3[7], cJ1_JPBRANCH_L. -// -// Cascade from a LEAFW (under Pjp) to one of the following: -// 1. if LEAFW is in 1 expanse: -// create linear branch with a JPLEAF3[7] under it -// 2. LEAFW contains multiple expanses: -// create linear or bitmap branch containing new expanses -// each new expanse is either a: 32 64 -// JPIMMED_3_01 branch Y N -// JPIMMED_7_01 branch N Y -// JPLEAF3 Y N -// JPLEAF7 N Y - -FUNCTION int j__udyCascadeL( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - Pjlw_t Pjlw; // leaf to work on. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAFW_MAXPOP1]; - uint8_t StageExp[cJU_LEAFW_MAXPOP1]; - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - -// Get the address of the Leaf - Pjlw = P_JLW(Pjp->jp_Addr); - - assert(Pjlw[0] == (cJU_LEAFW_MAXPOP1 - 1)); - -// Get pointer to Value area of old Leaf - JUDYLCODE(Pjv = JL_LEAFWVALUEAREA(Pjlw, cJU_LEAFW_MAXPOP1);) - - Pjlw++; // Now point to Index area - -// If Leaf is in 1 expanse -- first compress it (compare 1st, last & Index): - - CIndex = Pjlw[0]; // also used far below - if (!JU_DIGITATSTATE(CIndex ^ Pjlw[cJU_LEAFW_MAXPOP1 - 1], - cJU_ROOTSTATE)) - { - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get the common expanse to all elements in Leaf - StageExp[0] = JU_DIGITATSTATE(CIndex, cJU_ROOTSTATE); - -// Alloc a 3[7] byte Index Leaf -#ifdef JU_64BIT - PjllRaw = j__udyAllocJLL7(cJU_LEAFW_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy LEAFW to a cJU_JPLEAF7 - j__udyCopyWto7((uint8_t *) Pjll, Pjlw, cJU_LEAFW_MAXPOP1); -#ifdef JUDYL -// Get the Value area of new Leaf - Pjvnew = JL_LEAF7VALUEAREA(Pjll, cJU_LEAFW_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAFW_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAFW_MAXPOP1, 7);) -#else // 32 Bit - PjllRaw = j__udyAllocJLL3(cJU_LEAFW_MAXPOP1, Pjpm); - if (PjllRaw == (Pjll_t) NULL) return(-1); - - Pjll = P_JLL(PjllRaw); - -// Copy LEAFW to a cJU_JPLEAF3 - j__udyCopyWto3((uint8_t *) Pjll, Pjlw, cJU_LEAFW_MAXPOP1); -#ifdef JUDYL -// Get the Value area of new Leaf - Pjvnew = JL_LEAF3VALUEAREA(Pjll, cJU_LEAFW_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAFW_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAFW_MAXPOP1, 3);) -#endif // 32 Bit - -// Following not needed because cJU_DCDMASK(3[7]) is == 0 -////// StageJP[0].jp_DcdPopO |= (CIndex & cJU_DCDMASK(3[7])); -#ifdef JU_64BIT - JU_JPSETADT(&(StageJP[0]), (Word_t)PjllRaw, cJU_LEAFW_MAXPOP1-1, - cJU_JPLEAF7); -#else // 32BIT - JU_JPSETADT(&(StageJP[0]), (Word_t)PjllRaw, cJU_LEAFW_MAXPOP1-1, - cJU_JPLEAF3); -#endif // 32BIT -// Create a 1 element Linear branch - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, 1, Pjpm) == -1) - return(-1); - -// Change the type of callers JP - Pjp->jp_Type = cJU_JPBRANCH_L; - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 4[8] byte Index Leaf to 3[7] byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAFW_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ Pjlw[End], cJU_ROOTSTATE)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, cJU_ROOTSTATE); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, - cJU_ROOTSTATE); - - if (Pop1 == 1) // cJU_JPIMMED_3[7]_01 - { -#ifdef JU_64BIT -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, CIndex, cJ1_JPIMMED_7_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], CIndex, - cJL_JPIMMED_7_01); -#endif // JUDYL - -#else // JU_32BIT -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, CIndex, cJ1_JPIMMED_3_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], CIndex, - cJL_JPIMMED_3_01); -#endif // JUDYL -#endif // JU_32BIT - } -#ifdef JUDY1 -#ifdef JU_64BIT - else if (Pop1 <= cJ1_IMMED7_MAXPOP1) -#else - else if (Pop1 <= cJ1_IMMED3_MAXPOP1) -#endif - { -// cJ1_JPIMMED_3_02 : Judy1 32 -// cJ1_JPIMMED_7_02 : Judy1 64 -// Copy to JP as an immediate Leaf -#ifdef JU_64BIT - j__udyCopyWto7(PjpJP->jp_1Index, Pjlw+Start, 2); - PjpJP->jp_Type = cJ1_JPIMMED_7_02; -#else - j__udyCopyWto3(PjpJP->jp_1Index, Pjlw+Start, 2); - PjpJP->jp_Type = cJ1_JPIMMED_3_02; -#endif // 32 Bit - } -#endif // JUDY1 - else // Linear Leaf JPLEAF3[7] - { -// cJU_JPLEAF3[7] - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. -#ifdef JU_64BIT - PjllRaw = j__udyAllocJLL7(Pop1, Pjpm); - if (PjllRaw == (Pjll_t) NULL) return(-1); - Pjll = P_JLL(PjllRaw); - - j__udyCopyWto7((uint8_t *) Pjll, Pjlw + Start, - Pop1); -#ifdef JUDYL - Pjvnew = JL_LEAF7VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif // JUDYL - DBGCODE(JudyCheckSorted(Pjll, Pop1, 7);) -#else // JU_64BIT - 32 Bit - PjllRaw = j__udyAllocJLL3(Pop1, Pjpm); - if (PjllRaw == (Pjll_t) NULL) return(-1); - Pjll = P_JLL(PjllRaw); - - j__udyCopyWto3((uint8_t *) Pjll, Pjlw + Start, - Pop1); -#ifdef JUDYL - Pjvnew = JL_LEAF3VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif // JUDYL - DBGCODE(JudyCheckSorted(Pjll, Pop1, 3);) -#endif // 32 Bit - -#ifdef JU_64BIT - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, Pop1 - 1, - cJU_JPLEAF7); -#else // JU_64BIT - 32 Bit - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, Pop1 - 1, - cJU_JPLEAF3); -#endif // 32 Bit - } - ExpCnt++; -// Done? - if (End == cJU_LEAFW_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = Pjlw[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_B; // cJU_LEAFW is out of sequence - } - return(1); - -} // j__udyCascadeL() diff --git a/libjudy/src/Judy1/Judy1Count.c b/libjudy/src/Judy1/Judy1Count.c deleted file mode 100644 index 220e1def48..0000000000 --- a/libjudy/src/Judy1/Judy1Count.c +++ /dev/null @@ -1,1195 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.78 $ $Source: /judy/src/JudyCommon/JudyCount.c $ -// -// Judy*Count() function for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DNOSMARTJBB, -DNOSMARTJBU, and/or -DNOSMARTJLB to build a -// version with cache line optimizations deleted, for testing. -// -// Compile with -DSMARTMETRICS to obtain global variables containing smart -// cache line metrics. Note: Dont turn this on simultaneously for this file -// and JudyByCount.c because they export the same globals. -// -// Judy*Count() returns the "count of Indexes" (inclusive) between the two -// specified limits (Indexes). This code is remarkably fast. It traverses the -// "Judy array" data structure. -// -// This count code is the GENERIC untuned version (minimum code size). It -// might be possible to tuned to a specific architecture to be faster. -// However, in real applications, with a modern machine, it is expected that -// the instruction times will be swamped by cache line fills. -// **************************************************************************** - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - - -// define a phoney that is for sure - -#define cJU_LEAFW cJU_JPIMMED_CAP - -// Avoid duplicate symbols since this file is multi-compiled: - -#ifdef SMARTMETRICS -#ifdef JUDY1 -Word_t jbb_upward = 0; // counts of directions taken: -Word_t jbb_downward = 0; -Word_t jbu_upward = 0; -Word_t jbu_downward = 0; -Word_t jlb_upward = 0; -Word_t jlb_downward = 0; -#else -extern Word_t jbb_upward; -extern Word_t jbb_downward; -extern Word_t jbu_upward; -extern Word_t jbu_downward; -extern Word_t jlb_upward; -extern Word_t jlb_downward; -#endif -#endif - - -// FORWARD DECLARATIONS (prototypes): - -static Word_t j__udy1LCountSM(const Pjp_t Pjp, const Word_t Index, - const Pjpm_t Pjpm); - -// Each of Judy1 and JudyL get their own private (static) version of this -// function: - -static int j__udyCountLeafB1(const Pjll_t Pjll, const Word_t Pop1, - const Word_t Index); - -// These functions are not static because they are exported to Judy*ByCount(): -// -// TBD: Should be made static for performance reasons? And thus duplicated? -// -// Note: There really are two different functions, but for convenience they -// are referred to here with a generic name. - -#ifdef JUDY1 -#define j__udyJPPop1 j__udy1JPPop1 -#else -#define j__udyJPPop1 j__udyLJPPop1 -#endif - -Word_t j__udyJPPop1(const Pjp_t Pjp); - - -// LOCAL ERROR HANDLING: -// -// The Judy*Count() functions are unusual because they return 0 instead of JERR -// for an error. In this source file, define C_JERR for clarity. - -#define C_JERR 0 - - -// **************************************************************************** -// J U D Y 1 C O U N T -// J U D Y L C O U N T -// -// See the manual entry for details. -// -// This code is written recursively, at least at first, because thats much -// simpler; hope its fast enough. - -#ifdef JUDY1 -FUNCTION Word_t Judy1Count -#else -FUNCTION Word_t JudyLCount -#endif - ( - Pcvoid_t PArray, // JRP to first branch/leaf in SM. - Word_t Index1, // starting Index. - Word_t Index2, // ending Index. - PJError_t PJError // optional, for returning error info. - ) -{ - jpm_t fakejpm; // local temporary for small arrays. - Pjpm_t Pjpm; // top JPM or local temporary for error info. - jp_t fakejp; // constructed for calling j__udy1LCountSM(). - Pjp_t Pjp; // JP to pass to j__udy1LCountSM(). - Word_t pop1; // total for the array. - Word_t pop1above1; // indexes at or above Index1, inclusive. - Word_t pop1above2; // indexes at or above Index2, exclusive. - int retcode; // from Judy*First() calls. -JUDYLCODE(PPvoid_t PPvalue); // from JudyLFirst() calls. - - -// CHECK FOR SHORTCUTS: -// -// As documented, return C_JERR if the Judy array is empty or Index1 > Index2. - - if ((PArray == (Pvoid_t) NULL) || (Index1 > Index2)) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } - -// If Index1 == Index2, simply check if the specified Index is set; pass -// through the return value from Judy1Test() or JudyLGet() with appropriate -// translations. - - if (Index1 == Index2) - { -#ifdef JUDY1 - retcode = Judy1Test(PArray, Index1, PJError); - - if (retcode == JERRI) return(C_JERR); // pass through error. - - if (retcode == 0) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } -#else - PPvalue = JudyLGet(PArray, Index1, PJError); - - if (PPvalue == PPJERR) return(C_JERR); // pass through error. - - if (PPvalue == (PPvoid_t) NULL) // Index is not set. - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } -#endif - return(1); // single index is set. - } - - -// CHECK JRP TYPE: -// -// Use an if/then for speed rather than a switch, and put the most common cases -// first. -// -// Note: Since even cJU_LEAFW types require counting between two Indexes, -// prepare them here for common code below that calls j__udy1LCountSM(), rather -// than handling them even more specially here. - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - Pjpm = & fakejpm; - Pjp = & fakejp; - Pjp->jp_Addr = (Word_t) Pjlw; - Pjp->jp_Type = cJU_LEAFW; - Pjpm->jpm_Pop0 = Pjlw[0]; // from first word of leaf. - pop1 = Pjpm->jpm_Pop0 + 1; - } - else - { - Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); - pop1 = (Pjpm->jpm_Pop0) + 1; // note: can roll over to 0. - -#if (defined(JUDY1) && (! defined(JU_64BIT))) - if (pop1 == 0) // rare special case of full array: - { - Word_t count = Index2 - Index1 + 1; // can roll over again. - - if (count == 0) - { - JU_SET_ERRNO(PJError, JU_ERRNO_FULL); - return(C_JERR); - } - return(count); - } -#else - assert(pop1); // JudyL or 64-bit cannot create a full array! -#endif - } - - -// COUNT POP1 ABOVE INDEX1, INCLUSIVE: - - assert(pop1); // just to be safe. - - if (Index1 == 0) // shortcut, pop1above1 is entire population: - { - pop1above1 = pop1; - } - else // find first valid Index above Index1, if any: - { -#ifdef JUDY1 - if ((retcode = Judy1First(PArray, & Index1, PJError)) == JERRI) - return(C_JERR); // pass through error. -#else - if ((PPvalue = JudyLFirst(PArray, & Index1, PJError)) == PPJERR) - return(C_JERR); // pass through error. - - retcode = (PPvalue != (PPvoid_t) NULL); // found a next Index. -#endif - -// If theres no Index at or above Index1, just return C_JERR (early exit): - - if (retcode == 0) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } - -// If a first/next Index was found, call the counting motor starting with that -// known valid Index, meaning the return should be positive, not C_JERR except -// in case of a real error: - - if ((pop1above1 = j__udy1LCountSM(Pjp, Index1, Pjpm)) == C_JERR) - { - JU_COPY_ERRNO(PJError, Pjpm); // pass through error. - return(C_JERR); - } - } - - -// COUNT POP1 ABOVE INDEX2, EXCLUSIVE, AND RETURN THE DIFFERENCE: -// -// In principle, calculate the ordinal of each Index and take the difference, -// with caution about off-by-one errors due to the specified Indexes being set -// or unset. In practice: -// -// - The ordinals computed here are inverse ordinals, that is, the populations -// ABOVE the specified Indexes (Index1 inclusive, Index2 exclusive), so -// subtract pop1above2 from pop1above1, rather than vice-versa. -// -// - Index1s result already includes a count for Index1 and/or Index2 if -// either is set, so calculate pop1above2 exclusive of Index2. -// -// TBD: If Index1 and Index2 fall in the same expanse in the top-state -// branch(es), would it be faster to walk the SM only once, to their divergence -// point, before calling j__udy1LCountSM() or equivalent? Possibly a non-issue -// if a top-state pop1 becomes stored with each Judy1 array. Also, consider -// whether the first call of j__udy1LCountSM() fills the cache, for common tree -// branches, for the second call. -// -// As for pop1above1, look for shortcuts for special cases when pop1above2 is -// zero. Otherwise call the counting "motor". - - assert(pop1above1); // just to be safe. - - if (Index2++ == cJU_ALLONES) return(pop1above1); // Index2 at limit. - -#ifdef JUDY1 - if ((retcode = Judy1First(PArray, & Index2, PJError)) == JERRI) - return(C_JERR); -#else - if ((PPvalue = JudyLFirst(PArray, & Index2, PJError)) == PPJERR) - return(C_JERR); - - retcode = (PPvalue != (PPvoid_t) NULL); // found a next Index. -#endif - if (retcode == 0) return(pop1above1); // no Index above Index2. - -// Just as for Index1, j__udy1LCountSM() cannot return 0 (locally == C_JERR) -// except in case of a real error: - - if ((pop1above2 = j__udy1LCountSM(Pjp, Index2, Pjpm)) == C_JERR) - { - JU_COPY_ERRNO(PJError, Pjpm); // pass through error. - return(C_JERR); - } - - if (pop1above1 == pop1above2) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } - - return(pop1above1 - pop1above2); - -} // Judy1Count() / JudyLCount() - - -// **************************************************************************** -// __ J U D Y 1 L C O U N T S M -// -// Given a pointer to a JP (with invalid jp_DcdPopO at cJU_ROOTSTATE), a known -// valid Index, and a Pjpm for returning error info, recursively visit a Judy -// array state machine (SM) and return the count of Indexes, including Index, -// through the end of the Judy array at this state or below. In case of error -// or a count of 0 (should never happen), return C_JERR with appropriate -// JU_ERRNO in the Pjpm. -// -// Note: This function is not told the current state because its encoded in -// the JP Type. -// -// Method: To minimize cache line fills, while studying each branch, if Index -// resides above the midpoint of the branch (which often consists of multiple -// cache lines), ADD the populations at or above Index; otherwise, SUBTRACT -// from the population of the WHOLE branch (available from the JP) the -// populations at or above Index. This is especially tricky for bitmap -// branches. -// -// Note: Unlike, say, the Ins and Del walk routines, this function returns the -// same type of returns as Judy*Count(), so it can use *_SET_ERRNO*() macros -// the same way. - -FUNCTION static Word_t j__udy1LCountSM( -const Pjp_t Pjp, // top of Judy (sub)SM. -const Word_t Index, // count at or above this Index. -const Pjpm_t Pjpm) // for returning error info. -{ - Pjbl_t Pjbl; // Pjp->jp_Addr masked and cast to types: - Pjbb_t Pjbb; - Pjbu_t Pjbu; - Pjll_t Pjll; // a Judy lower-level linear leaf. - - Word_t digit; // next digit to decode from Index. - long jpnum; // JP number in a branch (base 0). - int offset; // index ordinal within a leaf, base 0. - Word_t pop1; // total population of an expanse. - Word_t pop1above; // to return. - -// Common code to check Decode bits in a JP against the equivalent portion of -// Index; XOR together, then mask bits of interest; must be all 0: -// -// Note: Why does this code only assert() compliance rather than actively -// checking for outliers? Its because Index is supposed to be valid, hence -// always match any Dcd bits traversed. -// -// Note: This assertion turns out to be always true for cState = 3 on 32-bit -// and 7 on 64-bit, but its harmless, probably removed by the compiler. - -#define CHECKDCD(Pjp,cState) \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cState)) - -// Common code to prepare to handle a root-level or lower-level branch: -// Extract a state-dependent digit from Index in a "constant" way, obtain the -// total population for the branch in a state-dependent way, and then branch to -// common code for multiple cases: -// -// For root-level branches, the state is always cJU_ROOTSTATE, and the -// population is received in Pjpm->jpm_Pop0. -// -// Note: The total population is only needed in cases where the common code -// "counts up" instead of down to minimize cache line fills. However, its -// available cheaply, and its better to do it with a constant shift (constant -// state value) instead of a variable shift later "when needed". - -#define PREPB_ROOT(Pjp,Next) \ - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); \ - pop1 = (Pjpm->jpm_Pop0) + 1; \ - goto Next - -#define PREPB(Pjp,cState,Next) \ - digit = JU_DIGITATSTATE(Index, cState); \ - pop1 = JU_JPBRANCH_POP0(Pjp, (cState)) + 1; \ - goto Next - - -// SWITCH ON JP TYPE: -// -// WARNING: For run-time efficiency the following cases replicate code with -// varying constants, rather than using common code with variable values! - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// ROOT-STATE LEAF that starts with a Pop0 word; just count within the leaf: - - case cJU_LEAFW: - { - Pjlw_t Pjlw = P_JLW(Pjp->jp_Addr); // first word of leaf. - - assert((Pjpm->jpm_Pop0) + 1 == Pjlw[0] + 1); // sent correctly. - offset = j__udySearchLeafW(Pjlw + 1, Pjpm->jpm_Pop0 + 1, Index); - assert(offset >= 0); // Index must exist. - assert(offset < (Pjpm->jpm_Pop0) + 1); // Index be in range. - return((Pjpm->jpm_Pop0) + 1 - offset); // INCLUSIVE of Index. - } - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH; count populations in JPs in the JBL ABOVE the next digit in -// Index, and recurse for the next digit in Index: -// -// Note: There are no null JPs in a JBL; watch out for pop1 == 0. -// -// Note: A JBL should always fit in one cache line => no need to count up -// versus down to save cache line fills. (PREPB() sets pop1 for no reason.) - - case cJU_JPBRANCH_L2: CHECKDCD(Pjp, 2); PREPB(Pjp, 2, BranchL); - case cJU_JPBRANCH_L3: CHECKDCD(Pjp, 3); PREPB(Pjp, 3, BranchL); - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: CHECKDCD(Pjp, 4); PREPB(Pjp, 4, BranchL); - case cJU_JPBRANCH_L5: CHECKDCD(Pjp, 5); PREPB(Pjp, 5, BranchL); - case cJU_JPBRANCH_L6: CHECKDCD(Pjp, 6); PREPB(Pjp, 6, BranchL); - case cJU_JPBRANCH_L7: CHECKDCD(Pjp, 7); PREPB(Pjp, 7, BranchL); -#endif - case cJU_JPBRANCH_L: PREPB_ROOT(Pjp, BranchL); - -// Common code (state-independent) for all cases of linear branches: - -BranchL: - - Pjbl = P_JBL(Pjp->jp_Addr); - jpnum = Pjbl->jbl_NumJPs; // above last JP. - pop1above = 0; - - while (digit < (Pjbl->jbl_Expanse[--jpnum])) // still ABOVE digit. - { - if ((pop1 = j__udyJPPop1((Pjbl->jbl_jp) + jpnum)) == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above += pop1; - assert(jpnum > 0); // should find digit. - } - - assert(digit == (Pjbl->jbl_Expanse[jpnum])); // should find digit. - - pop1 = j__udy1LCountSM((Pjbl->jbl_jp) + jpnum, Index, Pjpm); - if (pop1 == C_JERR) return(C_JERR); // pass error up. - - assert(pop1above + pop1); - return(pop1above + pop1); - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH; count populations in JPs in the JBB ABOVE the next digit in -// Index, and recurse for the next digit in Index: -// -// Note: There are no null JPs in a JBB; watch out for pop1 == 0. - - case cJU_JPBRANCH_B2: CHECKDCD(Pjp, 2); PREPB(Pjp, 2, BranchB); - case cJU_JPBRANCH_B3: CHECKDCD(Pjp, 3); PREPB(Pjp, 3, BranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: CHECKDCD(Pjp, 4); PREPB(Pjp, 4, BranchB); - case cJU_JPBRANCH_B5: CHECKDCD(Pjp, 5); PREPB(Pjp, 5, BranchB); - case cJU_JPBRANCH_B6: CHECKDCD(Pjp, 6); PREPB(Pjp, 6, BranchB); - case cJU_JPBRANCH_B7: CHECKDCD(Pjp, 7); PREPB(Pjp, 7, BranchB); -#endif - case cJU_JPBRANCH_B: PREPB_ROOT(Pjp, BranchB); - -// Common code (state-independent) for all cases of bitmap branches: - -BranchB: - { - long subexp; // for stepping through layer 1 (subexpanses). - long findsub; // subexpanse containing Index (digit). - Word_t findbit; // bit representing Index (digit). - Word_t lowermask; // bits for indexes at or below Index. - Word_t jpcount; // JPs in a subexpanse. - Word_t clbelow; // cache lines below digits cache line. - Word_t clabove; // cache lines above digits cache line. - - Pjbb = P_JBB(Pjp->jp_Addr); - findsub = digit / cJU_BITSPERSUBEXPB; - findbit = digit % cJU_BITSPERSUBEXPB; - lowermask = JU_MASKLOWERINC(JU_BITPOSMASKB(findbit)); - clbelow = clabove = 0; // initial/default => always downward. - - assert(JU_BITMAPTESTB(Pjbb, digit)); // digit must have a JP. - assert(findsub < cJU_NUMSUBEXPB); // falls in expected range. - -// Shorthand for one subexpanse in a bitmap and for one JP in a bitmap branch: -// -// Note: BMPJP0 exists separately to support assertions. - -#define BMPJP0(Subexp) (P_JP(JU_JBB_PJP(Pjbb, Subexp))) -#define BMPJP(Subexp,JPnum) (BMPJP0(Subexp) + (JPnum)) - -#ifndef NOSMARTJBB // enable to turn off smart code for comparison purposes. - -// FIGURE OUT WHICH DIRECTION CAUSES FEWER CACHE LINE FILLS; adding the pop1s -// in JPs above Indexs JP, or subtracting the pop1s in JPs below Indexs JP. -// -// This is tricky because, while each set bit in the bitmap represents a JP, -// the JPs are scattered over cJU_NUMSUBEXPB subexpanses, each of which can -// contain JPs packed into multiple cache lines, and this code must visit every -// JP either BELOW or ABOVE the JP for Index. -// -// Number of cache lines required to hold a linear list of the given number of -// JPs, assuming the first JP is at the start of a cache line or the JPs in -// jpcount fit wholly within a single cache line, which is ensured by -// JudyMalloc(): - -#define CLPERJPS(jpcount) \ - ((((jpcount) * cJU_WORDSPERJP) + cJU_WORDSPERCL - 1) / cJU_WORDSPERCL) - -// Count cache lines below/above for each subexpanse: - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - -// When at the subexpanse containing Index (digit), add cache lines -// below/above appropriately, excluding the cache line containing the JP for -// Index itself: - - if (subexp < findsub) clbelow += CLPERJPS(jpcount); - else if (subexp > findsub) clabove += CLPERJPS(jpcount); - else // (subexp == findsub) - { - Word_t clfind; // cache line containing Index (digit). - - clfind = CLPERJPS(j__udyCountBitsB( - JU_JBB_BITMAP(Pjbb, subexp) & lowermask)); - - assert(clfind > 0); // digit itself should have 1 CL. - clbelow += clfind - 1; - clabove += CLPERJPS(jpcount) - clfind; - } - } -#endif // ! NOSMARTJBB - -// Note: Its impossible to get through the following "if" without setting -// jpnum -- see some of the assertions below -- but gcc -Wall doesnt know -// this, so preset jpnum to make it happy: - - jpnum = 0; - - -// COUNT POPULATION FOR A BITMAP BRANCH, in whichever direction should result -// in fewer cache line fills: -// -// Note: If the remainder of Index is zero, pop1above is the pop1 of the -// entire expanse and theres no point in recursing to lower levels; but this -// should be so rare that its not worth checking for; -// Judy1Count()/JudyLCount() never even calls the motor for Index == 0 (all -// bytes). - - -// COUNT UPWARD, subtracting each "below or at" JPs pop1 from the whole -// expanses pop1: -// -// Note: If this causes clbelow + 1 cache line fills including JPs cache -// line, thats OK; at worst this is the same as clabove. - - if (clbelow < clabove) - { -#ifdef SMARTMETRICS - ++jbb_upward; -#endif - pop1above = pop1; // subtract JPs at/below Index. - -// Count JPs for which to accrue pop1s in this subexpanse: -// -// TBD: If JU_JBB_BITMAP is cJU_FULLBITMAPB, dont bother counting. - - for (subexp = 0; subexp <= findsub; ++subexp) - { - jpcount = j__udyCountBitsB((subexp < findsub) ? - JU_JBB_BITMAP(Pjbb, subexp) : - JU_JBB_BITMAP(Pjbb, subexp) & lowermask); - - // should always find findbit: - assert((subexp < findsub) || jpcount); - -// Subtract pop1s from JPs BELOW OR AT Index (digit): -// -// Note: The pop1 for Indexs JP itself is partially added back later at a -// lower state. -// -// Note: An empty subexpanse (jpcount == 0) is handled "for free". -// -// Note: Must be null JP subexp pointer in empty subexpanse and non-empty in -// non-empty subexpanse: - - assert( jpcount || (BMPJP0(subexp) == (Pjp_t) NULL)); - assert((! jpcount) || (BMPJP0(subexp) != (Pjp_t) NULL)); - - for (jpnum = 0; jpnum < jpcount; ++jpnum) - { - if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum))) - == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above -= pop1; - } - - jpnum = jpcount - 1; // make correct for digit. - } - } - -// COUNT DOWNWARD, adding each "above" JPs pop1: - - else - { - long jpcountbf; // below findbit, inclusive. -#ifdef SMARTMETRICS - ++jbb_downward; -#endif - pop1above = 0; // add JPs above Index. - jpcountbf = 0; // until subexp == findsub. - -// Count JPs for which to accrue pop1s in this subexpanse: -// -// This is more complicated than counting upward because the scan of digits -// subexpanse must count ALL JPs, to know where to START counting down, and -// ALSO note the offset of digits JP to know where to STOP counting down. - - for (subexp = cJU_NUMSUBEXPB - 1; subexp >= findsub; --subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - - // should always find findbit: - assert((subexp > findsub) || jpcount); - - if (! jpcount) continue; // empty subexpanse, save time. - -// Count JPs below digit, inclusive: - - if (subexp == findsub) - { - jpcountbf = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp) - & lowermask); - } - - // should always find findbit: - assert((subexp > findsub) || jpcountbf); - assert(jpcount >= jpcountbf); // proper relationship. - -// Add pop1s from JPs ABOVE Index (digit): - - // no null JP subexp pointers: - assert(BMPJP0(subexp) != (Pjp_t) NULL); - - for (jpnum = jpcount - 1; jpnum >= jpcountbf; --jpnum) - { - if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum))) - == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above += pop1; - } - // jpnum is now correct for digit. - } - } // else. - -// Return the net population ABOVE the digits JP at this state (in this JBB) -// plus the population AT OR ABOVE Index in the SM under the digits JP: - - pop1 = j__udy1LCountSM(BMPJP(findsub, jpnum), Index, Pjpm); - if (pop1 == C_JERR) return(C_JERR); // pass error up. - - assert(pop1above + pop1); - return(pop1above + pop1); - - } // case. - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH; count populations in JPs in the JBU ABOVE the next -// digit in Index, and recurse for the next digit in Index: -// -// Note: If the remainder of Index is zero, pop1above is the pop1 of the -// entire expanse and theres no point in recursing to lower levels; but this -// should be so rare that its not worth checking for; -// Judy1Count()/JudyLCount() never even calls the motor for Index == 0 (all -// bytes). - - case cJU_JPBRANCH_U2: CHECKDCD(Pjp, 2); PREPB(Pjp, 2, BranchU); - case cJU_JPBRANCH_U3: CHECKDCD(Pjp, 3); PREPB(Pjp, 3, BranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: CHECKDCD(Pjp, 4); PREPB(Pjp, 4, BranchU); - case cJU_JPBRANCH_U5: CHECKDCD(Pjp, 5); PREPB(Pjp, 5, BranchU); - case cJU_JPBRANCH_U6: CHECKDCD(Pjp, 6); PREPB(Pjp, 6, BranchU); - case cJU_JPBRANCH_U7: CHECKDCD(Pjp, 7); PREPB(Pjp, 7, BranchU); -#endif - case cJU_JPBRANCH_U: PREPB_ROOT(Pjp, BranchU); - -// Common code (state-independent) for all cases of uncompressed branches: - -BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - -#ifndef NOSMARTJBU // enable to turn off smart code for comparison purposes. - -// FIGURE OUT WHICH WAY CAUSES FEWER CACHE LINE FILLS; adding the JPs above -// Indexs JP, or subtracting the JPs below Indexs JP. -// -// COUNT UPWARD, subtracting the pop1 of each JP BELOW OR AT Index, from the -// whole expanses pop1: - - if (digit < (cJU_BRANCHUNUMJPS / 2)) - { - pop1above = pop1; // subtract JPs below Index. -#ifdef SMARTMETRICS - ++jbu_upward; -#endif - for (jpnum = 0; jpnum <= digit; ++jpnum) - { - if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX) - continue; // shortcut, save a function call. - - if ((pop1 = j__udyJPPop1(Pjbu->jbu_jp + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above -= pop1; - } - } - -// COUNT DOWNWARD, simply adding the pop1 of each JP ABOVE Index: - - else -#endif // NOSMARTJBU - { - assert(digit < cJU_BRANCHUNUMJPS); -#ifdef SMARTMETRICS - ++jbu_downward; -#endif - pop1above = 0; // add JPs above Index. - - for (jpnum = cJU_BRANCHUNUMJPS - 1; jpnum > digit; --jpnum) - { - if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX) - continue; // shortcut, save a function call. - - if ((pop1 = j__udyJPPop1(Pjbu->jbu_jp + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above += pop1; - } - } - - if ((pop1 = j__udy1LCountSM(Pjbu->jbu_jp + digit, Index, Pjpm)) - == C_JERR) return(C_JERR); // pass error up. - - assert(pop1above + pop1); - return(pop1above + pop1); - - -// ---------------------------------------------------------------------------- -// LEAF COUNT MACROS: -// -// LEAF*ABOVE() are common code for different JP types (linear leaves, bitmap -// leaves, and immediates) and different leaf Index Sizes, which result in -// calling different leaf search functions. Linear leaves get the leaf address -// from jp_Addr and the Population from jp_DcdPopO, while immediates use Pjp -// itself as the leaf address and get Population from jp_Type. - -#define LEAFLABOVE(Func) \ - Pjll = P_JLL(Pjp->jp_Addr); \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - LEAFABOVE(Func, Pjll, pop1) - -#define LEAFB1ABOVE(Func) LEAFLABOVE(Func) // different Func, otherwise same. - -#ifdef JUDY1 -#define IMMABOVE(Func,Pop1) \ - Pjll = (Pjll_t) Pjp; \ - LEAFABOVE(Func, Pjll, Pop1) -#else -// Note: For JudyL immediates with >= 2 Indexes, the index bytes are in a -// different place than for Judy1: - -#define IMMABOVE(Func,Pop1) \ - LEAFABOVE(Func, (Pjll_t) (Pjp->jp_LIndex), Pop1) -#endif - -// For all leaf types, the population AT OR ABOVE is the total pop1 less the -// offset of Index; and Index should always be found: - -#define LEAFABOVE(Func,Pjll,Pop1) \ - offset = Func(Pjll, Pop1, Index); \ - assert(offset >= 0); \ - assert(offset < (Pop1)); \ - return((Pop1) - offset) - -// IMMABOVE_01 handles the special case of an immediate JP with 1 index, which -// the search functions arent used for anyway: -// -// The target Index should be the one in this Immediate, in which case the -// count above (inclusive) is always 1. - -#define IMMABOVE_01 \ - assert((JU_JPDCDPOP0(Pjp)) == JU_TRIMTODCDSIZE(Index)); \ - return(1) - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF; search the leaf for Index; size is computed from jp_Type: - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: LEAFLABOVE(j__udySearchLeaf1); -#endif - case cJU_JPLEAF2: LEAFLABOVE(j__udySearchLeaf2); - case cJU_JPLEAF3: LEAFLABOVE(j__udySearchLeaf3); - -#ifdef JU_64BIT - case cJU_JPLEAF4: LEAFLABOVE(j__udySearchLeaf4); - case cJU_JPLEAF5: LEAFLABOVE(j__udySearchLeaf5); - case cJU_JPLEAF6: LEAFLABOVE(j__udySearchLeaf6); - case cJU_JPLEAF7: LEAFLABOVE(j__udySearchLeaf7); -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF; search the leaf for Index: -// -// Since the bitmap describes Indexes digitally rather than linearly, this is -// not really a search, but just a count. - - case cJU_JPLEAF_B1: LEAFB1ABOVE(j__udyCountLeafB1); - - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// Return the count of Indexes AT OR ABOVE Index, which is the total population -// of the expanse (a constant) less the value of the undecoded digit remaining -// in Index (its base-0 offset in the expanse), which yields an inclusive count -// above. -// -// TBD: This only supports a 1-byte full expanse. Should this extract a -// stored value for pop0 and possibly more LSBs of Index, to handle larger full -// expanses? - - case cJ1_JPFULLPOPU1: - return(cJU_JPFULLPOPU1_POP0 + 1 - JU_DIGITATSTATE(Index, 1)); -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: - - case cJU_JPIMMED_1_01: IMMABOVE_01; - case cJU_JPIMMED_2_01: IMMABOVE_01; - case cJU_JPIMMED_3_01: IMMABOVE_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: IMMABOVE_01; - case cJU_JPIMMED_5_01: IMMABOVE_01; - case cJU_JPIMMED_6_01: IMMABOVE_01; - case cJU_JPIMMED_7_01: IMMABOVE_01; -#endif - - case cJU_JPIMMED_1_02: IMMABOVE(j__udySearchLeaf1, 2); - case cJU_JPIMMED_1_03: IMMABOVE(j__udySearchLeaf1, 3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: IMMABOVE(j__udySearchLeaf1, 4); - case cJU_JPIMMED_1_05: IMMABOVE(j__udySearchLeaf1, 5); - case cJU_JPIMMED_1_06: IMMABOVE(j__udySearchLeaf1, 6); - case cJU_JPIMMED_1_07: IMMABOVE(j__udySearchLeaf1, 7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: IMMABOVE(j__udySearchLeaf1, 8); - case cJ1_JPIMMED_1_09: IMMABOVE(j__udySearchLeaf1, 9); - case cJ1_JPIMMED_1_10: IMMABOVE(j__udySearchLeaf1, 10); - case cJ1_JPIMMED_1_11: IMMABOVE(j__udySearchLeaf1, 11); - case cJ1_JPIMMED_1_12: IMMABOVE(j__udySearchLeaf1, 12); - case cJ1_JPIMMED_1_13: IMMABOVE(j__udySearchLeaf1, 13); - case cJ1_JPIMMED_1_14: IMMABOVE(j__udySearchLeaf1, 14); - case cJ1_JPIMMED_1_15: IMMABOVE(j__udySearchLeaf1, 15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: IMMABOVE(j__udySearchLeaf2, 2); - case cJU_JPIMMED_2_03: IMMABOVE(j__udySearchLeaf2, 3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: IMMABOVE(j__udySearchLeaf2, 4); - case cJ1_JPIMMED_2_05: IMMABOVE(j__udySearchLeaf2, 5); - case cJ1_JPIMMED_2_06: IMMABOVE(j__udySearchLeaf2, 6); - case cJ1_JPIMMED_2_07: IMMABOVE(j__udySearchLeaf2, 7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: IMMABOVE(j__udySearchLeaf3, 2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: IMMABOVE(j__udySearchLeaf3, 3); - case cJ1_JPIMMED_3_04: IMMABOVE(j__udySearchLeaf3, 4); - case cJ1_JPIMMED_3_05: IMMABOVE(j__udySearchLeaf3, 5); - - case cJ1_JPIMMED_4_02: IMMABOVE(j__udySearchLeaf4, 2); - case cJ1_JPIMMED_4_03: IMMABOVE(j__udySearchLeaf4, 3); - - case cJ1_JPIMMED_5_02: IMMABOVE(j__udySearchLeaf5, 2); - case cJ1_JPIMMED_5_03: IMMABOVE(j__udySearchLeaf5, 3); - - case cJ1_JPIMMED_6_02: IMMABOVE(j__udySearchLeaf6, 2); - - case cJ1_JPIMMED_7_02: IMMABOVE(j__udySearchLeaf7, 2); -#endif - - -// ---------------------------------------------------------------------------- -// OTHER CASES: - - default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); return(C_JERR); - - } // switch on JP type - - /*NOTREACHED*/ - -} // j__udy1LCountSM() - - -// **************************************************************************** -// J U D Y C O U N T L E A F B 1 -// -// This is a private analog of the j__udySearchLeaf*() functions for counting -// in bitmap 1-byte leaves. Since a bitmap leaf describes Indexes digitally -// rather than linearly, this is not really a search, but just a count of the -// valid Indexes == set bits below or including Index, which should be valid. -// Return the "offset" (really the ordinal), 0 .. Pop1 - 1, of Index in Pjll; -// if Indexs bit is not set (which should never happen, so this is DEBUG-mode -// only), return the 1s-complement equivalent (== negative offset minus 1). -// -// Note: The source code for this function looks identical for both Judy1 and -// JudyL, but the JU_JLB_BITMAP macro varies. -// -// Note: For simpler calling, the first arg is of type Pjll_t but then cast to -// Pjlb_t. - -FUNCTION static int j__udyCountLeafB1( -const Pjll_t Pjll, // bitmap leaf, as Pjll_t for consistency. -const Word_t Pop1, // Population of whole leaf. -const Word_t Index) // to which to count. -{ - Pjlb_t Pjlb = (Pjlb_t) Pjll; // to proper type. - Word_t digit = Index & cJU_MASKATSTATE(1); - Word_t findsub = digit / cJU_BITSPERSUBEXPL; - Word_t findbit = digit % cJU_BITSPERSUBEXPL; - int count; // in leaf through Index. - long subexp; // for stepping through subexpanses. - - -// COUNT UPWARD: -// -// The entire bitmap should fit in one cache line, but still try to save some -// CPU time by counting the fewest possible number of subexpanses from the -// bitmap. - -#ifndef NOSMARTJLB // enable to turn off smart code for comparison purposes. - - if (findsub < (cJU_NUMSUBEXPL / 2)) - { -#ifdef SMARTMETRICS - ++jlb_upward; -#endif - count = 0; - - for (subexp = 0; subexp < findsub; ++subexp) - { - count += ((JU_JLB_BITMAP(Pjlb, subexp) == cJU_FULLBITMAPL) ? - cJU_BITSPERSUBEXPL : - j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp))); - } - -// This count includes findbit, which should be set, resulting in a base-1 -// offset: - - count += j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, findsub) - & JU_MASKLOWERINC(JU_BITPOSMASKL(findbit))); - - DBGCODE(if (! JU_BITMAPTESTL(Pjlb, digit)) return(~count);) - assert(count >= 1); - return(count - 1); // convert to base-0 offset. - } -#endif // NOSMARTJLB - - -// COUNT DOWNWARD: -// -// Count the valid Indexes above or at Index, and subtract from Pop1. - -#ifdef SMARTMETRICS - ++jlb_downward; -#endif - count = Pop1; // base-1 for now. - - for (subexp = cJU_NUMSUBEXPL - 1; subexp > findsub; --subexp) - { - count -= ((JU_JLB_BITMAP(Pjlb, subexp) == cJU_FULLBITMAPL) ? - cJU_BITSPERSUBEXPL : - j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp))); - } - -// This count includes findbit, which should be set, resulting in a base-0 -// offset: - - count -= j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, findsub) - & JU_MASKHIGHERINC(JU_BITPOSMASKL(findbit))); - - DBGCODE(if (! JU_BITMAPTESTL(Pjlb, digit)) return(~count);) - assert(count >= 0); // should find Index itself. - return(count); // is already a base-0 offset. - -} // j__udyCountLeafB1() - - -// **************************************************************************** -// J U D Y J P P O P 1 -// -// This function takes any type of JP other than a root-level JP (cJU_LEAFW* or -// cJU_JPBRANCH* with no number suffix) and extracts the Pop1 from it. In some -// sense this is a wrapper around the JU_JP*_POP0 macros. Why write it as a -// function instead of a complex macro containing a trinary? (See version -// Judy1.h version 4.17.) We think its cheaper to call a function containing -// a switch statement with "constant" cases than to do the variable -// calculations in a trinary. -// -// For invalid JP Types return cJU_ALLONES. Note that this is an impossibly -// high Pop1 for any JP below a top level branch. - -FUNCTION Word_t j__udyJPPop1( -const Pjp_t Pjp) // JP to count. -{ - switch (JU_JPTYPE(Pjp)) - { -#ifdef notdef // caller should shortcut and not even call with these: - - case cJU_JPNULL1: - case cJU_JPNULL2: - case cJU_JPNULL3: return(0); -#ifdef JU_64BIT - case cJU_JPNULL4: - case cJU_JPNULL5: - case cJU_JPNULL6: - case cJU_JPNULL7: return(0); -#endif -#endif // notdef - - case cJU_JPBRANCH_L2: - case cJU_JPBRANCH_B2: - case cJU_JPBRANCH_U2: return(JU_JPBRANCH_POP0(Pjp,2) + 1); - - case cJU_JPBRANCH_L3: - case cJU_JPBRANCH_B3: - case cJU_JPBRANCH_U3: return(JU_JPBRANCH_POP0(Pjp,3) + 1); - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - case cJU_JPBRANCH_B4: - case cJU_JPBRANCH_U4: return(JU_JPBRANCH_POP0(Pjp,4) + 1); - - case cJU_JPBRANCH_L5: - case cJU_JPBRANCH_B5: - case cJU_JPBRANCH_U5: return(JU_JPBRANCH_POP0(Pjp,5) + 1); - - case cJU_JPBRANCH_L6: - case cJU_JPBRANCH_B6: - case cJU_JPBRANCH_U6: return(JU_JPBRANCH_POP0(Pjp,6) + 1); - - case cJU_JPBRANCH_L7: - case cJU_JPBRANCH_B7: - case cJU_JPBRANCH_U7: return(JU_JPBRANCH_POP0(Pjp,7) + 1); -#endif - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: -#endif - case cJU_JPLEAF2: - case cJU_JPLEAF3: -#ifdef JU_64BIT - case cJU_JPLEAF4: - case cJU_JPLEAF5: - case cJU_JPLEAF6: - case cJU_JPLEAF7: -#endif - case cJU_JPLEAF_B1: return(JU_JPLEAF_POP0(Pjp) + 1); - -#ifdef JUDY1 - case cJ1_JPFULLPOPU1: return(cJU_JPFULLPOPU1_POP0 + 1); -#endif - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: return(1); -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: return(1); -#endif - - case cJU_JPIMMED_1_02: return(2); - case cJU_JPIMMED_1_03: return(3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: return(4); - case cJU_JPIMMED_1_05: return(5); - case cJU_JPIMMED_1_06: return(6); - case cJU_JPIMMED_1_07: return(7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: return(8); - case cJ1_JPIMMED_1_09: return(9); - case cJ1_JPIMMED_1_10: return(10); - case cJ1_JPIMMED_1_11: return(11); - case cJ1_JPIMMED_1_12: return(12); - case cJ1_JPIMMED_1_13: return(13); - case cJ1_JPIMMED_1_14: return(14); - case cJ1_JPIMMED_1_15: return(15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: return(2); - case cJU_JPIMMED_2_03: return(3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: return(4); - case cJ1_JPIMMED_2_05: return(5); - case cJ1_JPIMMED_2_06: return(6); - case cJ1_JPIMMED_2_07: return(7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: return(2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: return(3); - case cJ1_JPIMMED_3_04: return(4); - case cJ1_JPIMMED_3_05: return(5); - - case cJ1_JPIMMED_4_02: return(2); - case cJ1_JPIMMED_4_03: return(3); - - case cJ1_JPIMMED_5_02: return(2); - case cJ1_JPIMMED_5_03: return(3); - - case cJ1_JPIMMED_6_02: return(2); - - case cJ1_JPIMMED_7_02: return(2); -#endif - - default: return(cJU_ALLONES); - } - - /*NOTREACHED*/ - -} // j__udyJPPop1() diff --git a/libjudy/src/Judy1/Judy1CreateBranch.c b/libjudy/src/Judy1/Judy1CreateBranch.c deleted file mode 100644 index e0f7428025..0000000000 --- a/libjudy/src/Judy1/Judy1CreateBranch.c +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.26 $ $Source: /judy/src/JudyCommon/JudyCreateBranch.c $ - -// Branch creation functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - - -// **************************************************************************** -// J U D Y C R E A T E B R A N C H L -// -// Build a BranchL from an array of JPs and associated 1 byte digits -// (expanses). Return with Pjp pointing to the BranchL. Caller must -// deallocate passed arrays, if necessary. -// -// We have no idea what kind of BranchL it is, so caller must set the jp_Type. -// -// Return -1 if error (details in Pjpm), otherwise return 1. - -FUNCTION int j__udyCreateBranchL( - Pjp_t Pjp, // Build JPs from this place - Pjp_t PJPs, // Array of JPs to put into Bitmap branch - uint8_t Exp[], // Array of expanses to put into bitmap - Word_t ExpCnt, // Number of above JPs and Expanses - Pvoid_t Pjpm) -{ - Pjbl_t PjblRaw; // pointer to linear branch. - Pjbl_t Pjbl; - - assert(ExpCnt <= cJU_BRANCHLMAXJPS); - - PjblRaw = j__udyAllocJBL(Pjpm); - if (PjblRaw == (Pjbl_t) NULL) return(-1); - Pjbl = P_JBL(PjblRaw); - -// Build a Linear Branch - Pjbl->jbl_NumJPs = ExpCnt; - -// Copy from the Linear branch from splayed leaves - JU_COPYMEM(Pjbl->jbl_Expanse, Exp, ExpCnt); - JU_COPYMEM(Pjbl->jbl_jp, PJPs, ExpCnt); - -// Pass back new pointer to the Linear branch in JP - Pjp->jp_Addr = (Word_t) PjblRaw; - - return(1); - -} // j__udyCreateBranchL() - - -// **************************************************************************** -// J U D Y C R E A T E B R A N C H B -// -// Build a BranchB from an array of JPs and associated 1 byte digits -// (expanses). Return with Pjp pointing to the BranchB. Caller must -// deallocate passed arrays, if necessary. -// -// We have no idea what kind of BranchB it is, so caller must set the jp_Type. -// -// Return -1 if error (details in Pjpm), otherwise return 1. - -FUNCTION int j__udyCreateBranchB( - Pjp_t Pjp, // Build JPs from this place - Pjp_t PJPs, // Array of JPs to put into Bitmap branch - uint8_t Exp[], // Array of expanses to put into bitmap - Word_t ExpCnt, // Number of above JPs and Expanses - Pvoid_t Pjpm) -{ - Pjbb_t PjbbRaw; // pointer to bitmap branch. - Pjbb_t Pjbb; - Word_t ii, jj; // Temps - uint8_t CurrSubExp; // Current sub expanse for BM - -// This assertion says the number of populated subexpanses is not too large. -// This function is only called when a BranchL overflows to a BranchB or when a -// cascade occurs, meaning a leaf overflows. Either way ExpCnt cant be very -// large, in fact a lot smaller than cJU_BRANCHBMAXJPS. (Otherwise a BranchU -// would be used.) Popping this assertion means something (unspecified) has -// gone very wrong, or else Judys design criteria have changed, although in -// fact there should be no HARM in creating a BranchB with higher actual -// fanout. - - assert(ExpCnt <= cJU_BRANCHBMAXJPS); - -// Get memory for a Bitmap branch - PjbbRaw = j__udyAllocJBB(Pjpm); - if (PjbbRaw == (Pjbb_t) NULL) return(-1); - Pjbb = P_JBB(PjbbRaw); - -// Get 1st "sub" expanse (0..7) of bitmap branch - CurrSubExp = Exp[0] / cJU_BITSPERSUBEXPB; - -// Index thru all 1 byte sized expanses: - - for (jj = ii = 0; ii <= ExpCnt; ii++) - { - Word_t SubExp; // Cannot be a uint8_t - -// Make sure we cover the last one - if (ii == ExpCnt) - { - SubExp = cJU_ALLONES; // Force last one - } - else - { -// Calculate the "sub" expanse of the byte expanse - SubExp = Exp[ii] / cJU_BITSPERSUBEXPB; // Bits 5..7. - -// Set the bit that represents the expanse in Exp[] - JU_JBB_BITMAP(Pjbb, SubExp) |= JU_BITPOSMASKB(Exp[ii]); - } -// Check if a new "sub" expanse range needed - if (SubExp != CurrSubExp) - { -// Get number of JPs in this sub expanse - Word_t NumJP = ii - jj; - Pjp_t PjpRaw; - Pjp_t Pjp; - - PjpRaw = j__udyAllocJBBJP(NumJP, Pjpm); - Pjp = P_JP(PjpRaw); - - if (PjpRaw == (Pjp_t) NULL) // out of memory. - { - -// Free any previous allocations: - - while(CurrSubExp--) - { - NumJP = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, - CurrSubExp)); - if (NumJP) - { - j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, - CurrSubExp), NumJP, Pjpm); - } - } - j__udyFreeJBB(PjbbRaw, Pjpm); - return(-1); - } - -// Place the array of JPs in bitmap branch: - - JU_JBB_PJP(Pjbb, CurrSubExp) = PjpRaw; - -// Copy the JPs to new leaf: - - JU_COPYMEM(Pjp, PJPs + jj, NumJP); - -// On to the next bitmap branch "sub" expanse: - - jj = ii; - CurrSubExp = SubExp; - } - } // for each 1-byte expanse - -// Pass back some of the JP to the new Bitmap branch: - - Pjp->jp_Addr = (Word_t) PjbbRaw; - - return(1); - -} // j__udyCreateBranchB() - - -// **************************************************************************** -// J U D Y C R E A T E B R A N C H U -// -// Build a BranchU from a BranchB. Return with Pjp pointing to the BranchU. -// Free the BranchB and its JP subarrays. -// -// Return -1 if error (details in Pjpm), otherwise return 1. - -FUNCTION int j__udyCreateBranchU( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - jp_t JPNull; - Pjbu_t PjbuRaw; - Pjbu_t Pjbu; - Pjbb_t PjbbRaw; - Pjbb_t Pjbb; - Word_t ii, jj; - BITMAPB_t BitMap; - Pjp_t PDstJP; -#ifdef JU_STAGED_EXP - jbu_t BranchU; // Staged uncompressed branch -#else - -// Allocate memory for a BranchU: - - PjbuRaw = j__udyAllocJBU(Pjpm); - if (PjbuRaw == (Pjbu_t) NULL) return(-1); - Pjbu = P_JBU(PjbuRaw); -#endif - JU_JPSETADT(&JPNull, 0, 0, JU_JPTYPE(Pjp) - cJU_JPBRANCH_B2 + cJU_JPNULL1); - -// Get the pointer to the BranchB: - - PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); - Pjbb = P_JBB(PjbbRaw); - -// Set the pointer to the Uncompressed branch -#ifdef JU_STAGED_EXP - PDstJP = BranchU.jbu_jp; -#else - PDstJP = Pjbu->jbu_jp; -#endif - for (ii = 0; ii < cJU_NUMSUBEXPB; ii++) - { - Pjp_t PjpA; - Pjp_t PjpB; - - PjpB = PjpA = P_JP(JU_JBB_PJP(Pjbb, ii)); - -// Get the bitmap for this subexpanse - BitMap = JU_JBB_BITMAP(Pjbb, ii); - -// NULL empty subexpanses - if (BitMap == 0) - { -// But, fill with NULLs - for (jj = 0; jj < cJU_BITSPERSUBEXPB; jj++) - { - PDstJP[jj] = JPNull; - } - PDstJP += cJU_BITSPERSUBEXPB; - continue; - } -// Check if Uncompressed subexpanse - if (BitMap == cJU_FULLBITMAPB) - { -// Copy subexpanse to the Uncompressed branch intact - JU_COPYMEM(PDstJP, PjpA, cJU_BITSPERSUBEXPB); - -// Bump to next subexpanse - PDstJP += cJU_BITSPERSUBEXPB; - -// Set length of subexpanse - jj = cJU_BITSPERSUBEXPB; - } - else - { - for (jj = 0; jj < cJU_BITSPERSUBEXPB; jj++) - { -// Copy JP or NULLJP depending on bit - if (BitMap & 1) { *PDstJP = *PjpA++; } - else { *PDstJP = JPNull; } - - PDstJP++; // advance to next JP - BitMap >>= 1; - } - jj = PjpA - PjpB; - } - -// Free the subexpanse: - - j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, ii), jj, Pjpm); - - } // for each JP in BranchU - -#ifdef JU_STAGED_EXP - -// Allocate memory for a BranchU: - - PjbuRaw = j__udyAllocJBU(Pjpm); - if (PjbuRaw == (Pjbu_t) NULL) return(-1); - Pjbu = P_JBU(PjbuRaw); - -// Copy staged branch to newly allocated branch: -// -// TBD: I think this code is broken. - - *Pjbu = BranchU; - -#endif // JU_STAGED_EXP - -// Finally free the BranchB and put the BranchU in its place: - - j__udyFreeJBB(PjbbRaw, Pjpm); - - Pjp->jp_Addr = (Word_t) PjbuRaw; - Pjp->jp_Type += cJU_JPBRANCH_U - cJU_JPBRANCH_B; - - return(1); - -} // j__udyCreateBranchU() diff --git a/libjudy/src/Judy1/Judy1Decascade.c b/libjudy/src/Judy1/Judy1Decascade.c deleted file mode 100644 index 4f50da1854..0000000000 --- a/libjudy/src/Judy1/Judy1Decascade.c +++ /dev/null @@ -1,1206 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.25 $ $Source: /judy/src/JudyCommon/JudyDecascade.c $ -// -// "Decascade" support functions for JudyDel.c: These functions convert -// smaller-index-size leaves to larger-index-size leaves, and also, bitmap -// leaves (LeafB1s) to Leaf1s, and some types of branches to smaller branches -// at the same index size. Some "decascading" occurs explicitly in JudyDel.c, -// but rare or large subroutines appear as functions here, and the overhead to -// call them is negligible. -// -// Compile with one of -DJUDY1 or -DJUDYL. Note: Function names are converted -// to Judy1 or JudyL specific values by external #defines. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#endif -#ifdef JUDYL -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);) - - -// **************************************************************************** -// __ J U D Y C O P Y 2 T O 3 -// -// Copy one or more 2-byte Indexes to a series of 3-byte Indexes. - -FUNCTION static void j__udyCopy2to3( - uint8_t * PDest, // to where to copy 3-byte Indexes. - uint16_t * PSrc, // from where to copy 2-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 3-byte Index. - - assert(Pop1); - - do { - Temp = MSByte | *PSrc++; - JU_COPY3_LONG_TO_PINDEX(PDest, Temp); - PDest += 3; - } while (--Pop1); - -} // j__udyCopy2to3() - - -#ifdef JU_64BIT - -// **************************************************************************** -// __ J U D Y C O P Y 3 T O 4 -// -// Copy one or more 3-byte Indexes to a series of 4-byte Indexes. - -FUNCTION static void j__udyCopy3to4( - uint32_t * PDest, // to where to copy 4-byte Indexes. - uint8_t * PSrc, // from where to copy 3-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 4-byte Index. - - assert(Pop1); - - do { - JU_COPY3_PINDEX_TO_LONG(Temp, PSrc); - Temp |= MSByte; - PSrc += 3; - *PDest++ = Temp; // truncates to uint32_t. - } while (--Pop1); - -} // j__udyCopy3to4() - - -// **************************************************************************** -// __ J U D Y C O P Y 4 T O 5 -// -// Copy one or more 4-byte Indexes to a series of 5-byte Indexes. - -FUNCTION static void j__udyCopy4to5( - uint8_t * PDest, // to where to copy 4-byte Indexes. - uint32_t * PSrc, // from where to copy 4-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 5-byte Index. - - assert(Pop1); - - do { - Temp = MSByte | *PSrc++; - JU_COPY5_LONG_TO_PINDEX(PDest, Temp); - PDest += 5; - } while (--Pop1); - -} // j__udyCopy4to5() - - -// **************************************************************************** -// __ J U D Y C O P Y 5 T O 6 -// -// Copy one or more 5-byte Indexes to a series of 6-byte Indexes. - -FUNCTION static void j__udyCopy5to6( - uint8_t * PDest, // to where to copy 6-byte Indexes. - uint8_t * PSrc, // from where to copy 5-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 6-byte Index. - - assert(Pop1); - - do { - JU_COPY5_PINDEX_TO_LONG(Temp, PSrc); - Temp |= MSByte; - JU_COPY6_LONG_TO_PINDEX(PDest, Temp); - PSrc += 5; - PDest += 6; - } while (--Pop1); - -} // j__udyCopy5to6() - - -// **************************************************************************** -// __ J U D Y C O P Y 6 T O 7 -// -// Copy one or more 6-byte Indexes to a series of 7-byte Indexes. - -FUNCTION static void j__udyCopy6to7( - uint8_t * PDest, // to where to copy 6-byte Indexes. - uint8_t * PSrc, // from where to copy 5-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 6-byte Index. - - assert(Pop1); - - do { - JU_COPY6_PINDEX_TO_LONG(Temp, PSrc); - Temp |= MSByte; - JU_COPY7_LONG_TO_PINDEX(PDest, Temp); - PSrc += 6; - PDest += 7; - } while (--Pop1); - -} // j__udyCopy6to7() - -#endif // JU_64BIT - - -#ifndef JU_64BIT // 32-bit - -// **************************************************************************** -// __ J U D Y C O P Y 3 T O W -// -// Copy one or more 3-byte Indexes to a series of longs (words, always 4-byte). - -FUNCTION static void j__udyCopy3toW( - PWord_t PDest, // to where to copy full-word Indexes. - uint8_t * PSrc, // from where to copy 3-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - assert(Pop1); - - do { - JU_COPY3_PINDEX_TO_LONG(*PDest, PSrc); - *PDest++ |= MSByte; - PSrc += 3; - } while (--Pop1); - -} // j__udyCopy3toW() - - -#else // JU_64BIT - -// **************************************************************************** -// __ J U D Y C O P Y 7 T O W -// -// Copy one or more 7-byte Indexes to a series of longs (words, always 8-byte). - -FUNCTION static void j__udyCopy7toW( - PWord_t PDest, // to where to copy full-word Indexes. - uint8_t * PSrc, // from where to copy 7-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - assert(Pop1); - - do { - JU_COPY7_PINDEX_TO_LONG(*PDest, PSrc); - *PDest++ |= MSByte; - PSrc += 7; - } while (--Pop1); - -} // j__udyCopy7toW() - -#endif // JU_64BIT - - -// **************************************************************************** -// __ J U D Y B R A N C H B T O B R A N C H L -// -// When a BranchB shrinks to have few enough JPs, call this function to convert -// it to a BranchL. Return 1 for success, or -1 for failure (with details in -// Pjpm). - -FUNCTION int j__udyBranchBToBranchL( - Pjp_t Pjp, // points to BranchB to shrink. - Pvoid_t Pjpm) // for global accounting. -{ - Pjbb_t PjbbRaw; // old BranchB to shrink. - Pjbb_t Pjbb; - Pjbl_t PjblRaw; // new BranchL to create. - Pjbl_t Pjbl; - Word_t Digit; // in BranchB. - Word_t NumJPs; // non-null JPs in BranchB. - uint8_t Expanse[cJU_BRANCHLMAXJPS]; // for building jbl_Expanse[]. - Pjp_t Pjpjbl; // current JP in BranchL. - Word_t SubExp; // in BranchB. - - assert(JU_JPTYPE(Pjp) >= cJU_JPBRANCH_B2); - assert(JU_JPTYPE(Pjp) <= cJU_JPBRANCH_B); - - PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); - Pjbb = P_JBB(PjbbRaw); - -// Copy 1-byte subexpanse digits from BranchB to temporary buffer for BranchL, -// for each bit set in the BranchB: -// -// TBD: The following supports variable-sized linear branches, but they are no -// longer variable; this could be simplified to save the copying. -// -// TBD: Since cJU_BRANCHLMAXJP == 7 now, and cJU_BRANCHUNUMJPS == 256, the -// following might be inefficient; is there a faster way to do it? At least -// skip wholly empty subexpanses? - - for (NumJPs = Digit = 0; Digit < cJU_BRANCHUNUMJPS; ++Digit) - { - if (JU_BITMAPTESTB(Pjbb, Digit)) - { - Expanse[NumJPs++] = Digit; - assert(NumJPs <= cJU_BRANCHLMAXJPS); // required of caller. - } - } - -// Allocate and populate the BranchL: - - if ((PjblRaw = j__udyAllocJBL(Pjpm)) == (Pjbl_t) NULL) return(-1); - Pjbl = P_JBL(PjblRaw); - - JU_COPYMEM(Pjbl->jbl_Expanse, Expanse, NumJPs); - - Pjbl->jbl_NumJPs = NumJPs; - DBGCODE(JudyCheckSorted((Pjll_t) (Pjbl->jbl_Expanse), NumJPs, 1);) - -// Copy JPs from each BranchB subexpanse subarray: - - Pjpjbl = P_JP(Pjbl->jbl_jp); // start at first JP in array. - - for (SubExp = 0; SubExp < cJU_NUMSUBEXPB; ++SubExp) - { - Pjp_t PjpRaw = JU_JBB_PJP(Pjbb, SubExp); // current Pjp. - Pjp_t Pjp; - - if (PjpRaw == (Pjp_t) NULL) continue; // skip empty subexpanse. - Pjp = P_JP(PjpRaw); - - NumJPs = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, SubExp)); - assert(NumJPs); - JU_COPYMEM(Pjpjbl, Pjp, NumJPs); // one subarray at a time. - - Pjpjbl += NumJPs; - j__udyFreeJBBJP(PjpRaw, NumJPs, Pjpm); // subarray. - } - j__udyFreeJBB(PjbbRaw, Pjpm); // BranchB itself. - -// Finish up: Calculate new JP type (same index size = level in new class), -// and tie new BranchB into parent JP: - - Pjp->jp_Type += cJU_JPBRANCH_L - cJU_JPBRANCH_B; - Pjp->jp_Addr = (Word_t) PjblRaw; - - return(1); - -} // j__udyBranchBToBranchL() - - -#ifdef notdef - -// **************************************************************************** -// __ J U D Y B R A N C H U T O B R A N C H B -// -// When a BranchU shrinks to need little enough memory, call this function to -// convert it to a BranchB to save memory (at the cost of some speed). Return -// 1 for success, or -1 for failure (with details in Pjpm). -// -// TBD: Fill out if/when needed. Not currently used in JudyDel.c for reasons -// explained there. - -FUNCTION int j__udyBranchUToBranchB( - Pjp_t Pjp, // points to BranchU to shrink. - Pvoid_t Pjpm) // for global accounting. -{ - assert(FALSE); - return(1); -} -#endif // notdef - - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -// **************************************************************************** -// __ J U D Y L E A F B 1 T O L E A F 1 -// -// Shrink a bitmap leaf (cJU_LEAFB1) to linear leaf (cJU_JPLEAF1). -// Return 1 for success, or -1 for failure (with details in Pjpm). -// -// Note: This function is different than the other JudyLeaf*ToLeaf*() -// functions because it receives a Pjp, not just a leaf, and handles its own -// allocation and free, in order to allow the caller to continue with a LeafB1 -// if allocation fails. - -FUNCTION int j__udyLeafB1ToLeaf1( - Pjp_t Pjp, // points to LeafB1 to shrink. - Pvoid_t Pjpm) // for global accounting. -{ - Pjlb_t PjlbRaw; // bitmap in old leaf. - Pjlb_t Pjlb; - Pjll_t PjllRaw; // new Leaf1. - uint8_t * Pleaf1; // Leaf1 pointer type. - Word_t Digit; // in LeafB1 bitmap. -#ifdef JUDYL - Pjv_t PjvNew; // value area in new Leaf1. - Word_t Pop1; - Word_t SubExp; -#endif - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF_B1); - assert(((JU_JPDCDPOP0(Pjp) & 0xFF) + 1) == cJU_LEAF1_MAXPOP1); - -// Allocate JPLEAF1 and prepare pointers: - - if ((PjllRaw = j__udyAllocJLL1(cJU_LEAF1_MAXPOP1, Pjpm)) == 0) - return(-1); - - Pleaf1 = (uint8_t *) P_JLL(PjllRaw); - PjlbRaw = (Pjlb_t) (Pjp->jp_Addr); - Pjlb = P_JLB(PjlbRaw); - JUDYLCODE(PjvNew = JL_LEAF1VALUEAREA(Pleaf1, cJL_LEAF1_MAXPOP1);) - -// Copy 1-byte indexes from old LeafB1 to new Leaf1: - - for (Digit = 0; Digit < cJU_BRANCHUNUMJPS; ++Digit) - if (JU_BITMAPTESTL(Pjlb, Digit)) - *Pleaf1++ = Digit; - -#ifdef JUDYL - -// Copy all old-LeafB1 value areas from value subarrays to new Leaf1: - - for (SubExp = 0; SubExp < cJU_NUMSUBEXPL; ++SubExp) - { - Pjv_t PjvRaw = JL_JLB_PVALUE(Pjlb, SubExp); - Pjv_t Pjv = P_JV(PjvRaw); - - if (Pjv == (Pjv_t) NULL) continue; // skip empty subarray. - - Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, SubExp)); // subarray. - assert(Pop1); - - JU_COPYMEM(PjvNew, Pjv, Pop1); // copy value areas. - j__udyLFreeJV(PjvRaw, Pop1, Pjpm); - PjvNew += Pop1; // advance through new. - } - - assert((((Word_t) Pleaf1) - (Word_t) P_JLL(PjllRaw)) - == (PjvNew - JL_LEAF1VALUEAREA(P_JLL(PjllRaw), cJL_LEAF1_MAXPOP1))); -#endif // JUDYL - - DBGCODE(JudyCheckSorted((Pjll_t) P_JLL(PjllRaw), - (((Word_t) Pleaf1) - (Word_t) P_JLL(PjllRaw)), 1);) - -// Finish up: Free the old LeafB1 and plug the new Leaf1 into the JP: -// -// Note: jp_DcdPopO does not change here. - - j__udyFreeJLB1(PjlbRaw, Pjpm); - - Pjp->jp_Addr = (Word_t) PjllRaw; - Pjp->jp_Type = cJU_JPLEAF1; - - return(1); - -} // j__udyLeafB1ToLeaf1() - -#endif // (JUDYL || (! JU_64BIT)) - - -// **************************************************************************** -// __ J U D Y L E A F 1 T O L E A F 2 -// -// Copy 1-byte Indexes from a LeafB1 or Leaf1 to 2-byte Indexes in a Leaf2. -// Pjp MUST be one of: cJU_JPLEAF_B1, cJU_JPLEAF1, or cJU_JPIMMED_1_*. -// Return number of Indexes copied. -// -// TBD: In this and all following functions, the caller should already be able -// to compute the Pop1 return value, so why return it? - -FUNCTION Word_t j__udyLeaf1ToLeaf2( - uint16_t * PLeaf2, // destination uint16_t * Index portion of leaf. -#ifdef JUDYL - Pjv_t Pjv2, // destination value part of leaf. -#endif - Pjp_t Pjp, // 1-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. - Word_t Offset; // in linear leaf list. -JUDYLCODE(Pjv_t Pjv1Raw;) // source object value area. -JUDYLCODE(Pjv_t Pjv1;) - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF_B1: - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb = P_JLB(Pjp->jp_Addr); - Word_t Digit; // in LeafB1 bitmap. - JUDYLCODE(Word_t SubExp;) // in LeafB1. - - Pop1 = JU_JPBRANCH_POP0(Pjp, 1) + 1; assert(Pop1); - -// Copy 1-byte indexes from old LeafB1 to new Leaf2, including splicing in -// the missing MSByte needed in the Leaf2: - - for (Digit = 0; Digit < cJU_BRANCHUNUMJPS; ++Digit) - if (JU_BITMAPTESTL(Pjlb, Digit)) - *PLeaf2++ = MSByte | Digit; - -#ifdef JUDYL - -// Copy all old-LeafB1 value areas from value subarrays to new Leaf2: - - for (SubExp = 0; SubExp < cJU_NUMSUBEXPL; ++SubExp) - { - Word_t SubExpPop1; - - Pjv1Raw = JL_JLB_PVALUE(Pjlb, SubExp); - if (Pjv1Raw == (Pjv_t) NULL) continue; // skip empty. - Pjv1 = P_JV(Pjv1Raw); - - SubExpPop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, SubExp)); - assert(SubExpPop1); - - JU_COPYMEM(Pjv2, Pjv1, SubExpPop1); // copy value areas. - j__udyLFreeJV(Pjv1Raw, SubExpPop1, Pjpm); - Pjv2 += SubExpPop1; // advance through new. - } -#endif // JUDYL - - j__udyFreeJLB1((Pjlb_t) (Pjp->jp_Addr), Pjpm); // LeafB1 itself. - return(Pop1); - - } // case cJU_JPLEAF_B1 - - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -// JPLEAF1: - - case cJU_JPLEAF1: - { - uint8_t * PLeaf1 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPBRANCH_POP0(Pjp, 1) + 1; assert(Pop1); - JUDYLCODE(Pjv1 = JL_LEAF1VALUEAREA(PLeaf1, Pop1);) - -// Copy all Index bytes including splicing in missing MSByte needed in Leaf2 -// (plus, for JudyL, value areas): - - for (Offset = 0; Offset < Pop1; ++Offset) - { - PLeaf2[Offset] = MSByte | PLeaf1[Offset]; - JUDYLCODE(Pjv2[Offset] = Pjv1[Offset];) - } - j__udyFreeJLL1((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } -#endif // (JUDYL || (! JU_64BIT)) - - -// JPIMMED_1_01: -// -// Note: jp_DcdPopO has 3 [7] bytes of Index (all but most significant byte), -// so the assignment to PLeaf2[] truncates and MSByte is not needed. - - case cJU_JPIMMED_1_01: - { - PLeaf2[0] = JU_JPDCDPOP0(Pjp); // see above. - JUDYLCODE(Pjv2[0] = Pjp->jp_Addr;) - return(1); - } - - -// JPIMMED_1_0[2+]: - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - { - Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_1_02 + 2; assert(Pop1); - JUDYLCODE(Pjv1Raw = (Pjv_t) (Pjp->jp_Addr);) - JUDYLCODE(Pjv1 = P_JV(Pjv1Raw);) - - for (Offset = 0; Offset < Pop1; ++Offset) - { -#ifdef JUDY1 - PLeaf2[Offset] = MSByte | Pjp->jp_1Index[Offset]; -#else - PLeaf2[Offset] = MSByte | Pjp->jp_LIndex[Offset]; - Pjv2 [Offset] = Pjv1[Offset]; -#endif - } - JUDYLCODE(j__udyLFreeJV(Pjv1Raw, Pop1, Pjpm);) - return(Pop1); - } - - -// UNEXPECTED CASES, including JPNULL1, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf1ToLeaf2() - - -// ***************************************************************************** -// __ J U D Y L E A F 2 T O L E A F 3 -// -// Copy 2-byte Indexes from a Leaf2 to 3-byte Indexes in a Leaf3. -// Pjp MUST be one of: cJU_JPLEAF2 or cJU_JPIMMED_2_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-3 branch to a -// Leaf3, the branch has no narrow pointers under it, meaning only level-2 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf2ToLeaf3( - uint8_t * PLeaf3, // destination "uint24_t *" Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv3, // destination value part of leaf. -#endif - Pjp_t Pjp, // 2-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -#if (defined(JUDYL) && defined(JU_64BIT)) - Pjv_t Pjv2Raw; // source object value area. -#endif -JUDYLCODE(Pjv_t Pjv2;) - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF2: - - case cJU_JPLEAF2: - { - uint16_t * PLeaf2 = (uint16_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1); - j__udyCopy2to3(PLeaf3, PLeaf2, Pop1, MSByte); -#ifdef JUDYL - Pjv2 = JL_LEAF2VALUEAREA(PLeaf2, Pop1); - JU_COPYMEM(Pjv3, Pjv2, Pop1); -#endif - j__udyFreeJLL2((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_2_01: -// -// Note: jp_DcdPopO has 3 [7] bytes of Index (all but most significant byte), -// so the "assignment" to PLeaf3[] is exact [truncates] and MSByte is not -// needed. - - case cJU_JPIMMED_2_01: - { - JU_COPY3_LONG_TO_PINDEX(PLeaf3, JU_JPDCDPOP0(Pjp)); // see above. - JUDYLCODE(Pjv3[0] = Pjp->jp_Addr;) - return(1); - } - - -// JPIMMED_2_0[2+]: - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - { - JUDY1CODE(uint16_t * PLeaf2 = (uint16_t *) (Pjp->jp_1Index);) - JUDYLCODE(uint16_t * PLeaf2 = (uint16_t *) (Pjp->jp_LIndex);) - - Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_2_02 + 2; assert(Pop1); - j__udyCopy2to3(PLeaf3, PLeaf2, Pop1, MSByte); -#ifdef JUDYL - Pjv2Raw = (Pjv_t) (Pjp->jp_Addr); - Pjv2 = P_JV(Pjv2Raw); - JU_COPYMEM(Pjv3, Pjv2, Pop1); - j__udyLFreeJV(Pjv2Raw, Pop1, Pjpm); -#endif - return(Pop1); - } -#endif // (JUDY1 || JU_64BIT) - - -// UNEXPECTED CASES, including JPNULL2, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf2ToLeaf3() - - -#ifdef JU_64BIT - -// **************************************************************************** -// __ J U D Y L E A F 3 T O L E A F 4 -// -// Copy 3-byte Indexes from a Leaf3 to 4-byte Indexes in a Leaf4. -// Pjp MUST be one of: cJU_JPLEAF3 or cJU_JPIMMED_3_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-4 branch to a -// Leaf4, the branch has no narrow pointers under it, meaning only level-3 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf3ToLeaf4( - uint32_t * PLeaf4, // destination uint32_t * Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv4, // destination value part of leaf. -#endif - Pjp_t Pjp, // 3-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv3Raw;) // source object value area. -JUDYLCODE(Pjv_t Pjv3;) - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF3: - - case cJU_JPLEAF3: - { - uint8_t * PLeaf3 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1); - j__udyCopy3to4(PLeaf4, (uint8_t *) PLeaf3, Pop1, MSByte); -#ifdef JUDYL - Pjv3 = JL_LEAF3VALUEAREA(PLeaf3, Pop1); - JU_COPYMEM(Pjv4, Pjv3, Pop1); -#endif - j__udyFreeJLL3((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_3_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), so -// the assignment to PLeaf4[] truncates and MSByte is not needed. - - case cJU_JPIMMED_3_01: - { - PLeaf4[0] = JU_JPDCDPOP0(Pjp); // see above. - JUDYLCODE(Pjv4[0] = Pjp->jp_Addr;) - return(1); - } - - -// JPIMMED_3_0[2+]: - - case cJU_JPIMMED_3_02: -#ifdef JUDY1 - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: -#endif - { - JUDY1CODE(uint8_t * PLeaf3 = (uint8_t *) (Pjp->jp_1Index);) - JUDYLCODE(uint8_t * PLeaf3 = (uint8_t *) (Pjp->jp_LIndex);) - - JUDY1CODE(Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_3_02 + 2;) - JUDYLCODE(Pop1 = 2;) - - j__udyCopy3to4(PLeaf4, PLeaf3, Pop1, MSByte); -#ifdef JUDYL - Pjv3Raw = (Pjv_t) (Pjp->jp_Addr); - Pjv3 = P_JV(Pjv3Raw); - JU_COPYMEM(Pjv4, Pjv3, Pop1); - j__udyLFreeJV(Pjv3Raw, Pop1, Pjpm); -#endif - return(Pop1); - } - - -// UNEXPECTED CASES, including JPNULL3, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf3ToLeaf4() - - -// Note: In all following j__udyLeaf*ToLeaf*() functions, JPIMMED_*_0[2+] -// cases exist for Judy1 (&& 64-bit) only. JudyL has no equivalent Immeds. - - -// ***************************************************************************** -// __ J U D Y L E A F 4 T O L E A F 5 -// -// Copy 4-byte Indexes from a Leaf4 to 5-byte Indexes in a Leaf5. -// Pjp MUST be one of: cJU_JPLEAF4 or cJU_JPIMMED_4_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-5 branch to a -// Leaf5, the branch has no narrow pointers under it, meaning only level-4 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf4ToLeaf5( - uint8_t * PLeaf5, // destination "uint40_t *" Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv5, // destination value part of leaf. -#endif - Pjp_t Pjp, // 4-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv4;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF4: - - case cJU_JPLEAF4: - { - uint32_t * PLeaf4 = (uint32_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1); - j__udyCopy4to5(PLeaf5, PLeaf4, Pop1, MSByte); -#ifdef JUDYL - Pjv4 = JL_LEAF4VALUEAREA(PLeaf4, Pop1); - JU_COPYMEM(Pjv5, Pjv4, Pop1); -#endif - j__udyFreeJLL4((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_4_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), so -// the assignment to PLeaf5[] truncates and MSByte is not needed. - - case cJU_JPIMMED_4_01: - { - JU_COPY5_LONG_TO_PINDEX(PLeaf5, JU_JPDCDPOP0(Pjp)); // see above. - JUDYLCODE(Pjv5[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_4_0[4+]: - - case cJ1_JPIMMED_4_02: - case cJ1_JPIMMED_4_03: - { - uint32_t * PLeaf4 = (uint32_t *) (Pjp->jp_1Index); - - Pop1 = JU_JPTYPE(Pjp) - cJ1_JPIMMED_4_02 + 2; - j__udyCopy4to5(PLeaf5, PLeaf4, Pop1, MSByte); - return(Pop1); - } -#endif // JUDY1 - - -// UNEXPECTED CASES, including JPNULL4, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf4ToLeaf5() - - -// **************************************************************************** -// __ J U D Y L E A F 5 T O L E A F 6 -// -// Copy 5-byte Indexes from a Leaf5 to 6-byte Indexes in a Leaf6. -// Pjp MUST be one of: cJU_JPLEAF5 or cJU_JPIMMED_5_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-6 branch to a -// Leaf6, the branch has no narrow pointers under it, meaning only level-5 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf5ToLeaf6( - uint8_t * PLeaf6, // destination uint8_t * Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv6, // destination value part of leaf. -#endif - Pjp_t Pjp, // 5-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv5;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF5: - - case cJU_JPLEAF5: - { - uint8_t * PLeaf5 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1); - j__udyCopy5to6(PLeaf6, PLeaf5, Pop1, MSByte); -#ifdef JUDYL - Pjv5 = JL_LEAF5VALUEAREA(PLeaf5, Pop1); - JU_COPYMEM(Pjv6, Pjv5, Pop1); -#endif - j__udyFreeJLL5((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_5_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), so -// the assignment to PLeaf6[] truncates and MSByte is not needed. - - case cJU_JPIMMED_5_01: - { - JU_COPY6_LONG_TO_PINDEX(PLeaf6, JU_JPDCDPOP0(Pjp)); // see above. - JUDYLCODE(Pjv6[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_5_0[2+]: - - case cJ1_JPIMMED_5_02: - case cJ1_JPIMMED_5_03: - { - uint8_t * PLeaf5 = (uint8_t *) (Pjp->jp_1Index); - - Pop1 = JU_JPTYPE(Pjp) - cJ1_JPIMMED_5_02 + 2; - j__udyCopy5to6(PLeaf6, PLeaf5, Pop1, MSByte); - return(Pop1); - } -#endif // JUDY1 - - -// UNEXPECTED CASES, including JPNULL5, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf5ToLeaf6() - - -// ***************************************************************************** -// __ J U D Y L E A F 6 T O L E A F 7 -// -// Copy 6-byte Indexes from a Leaf2 to 7-byte Indexes in a Leaf7. -// Pjp MUST be one of: cJU_JPLEAF6 or cJU_JPIMMED_6_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-7 branch to a -// Leaf7, the branch has no narrow pointers under it, meaning only level-6 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf6ToLeaf7( - uint8_t * PLeaf7, // destination "uint24_t *" Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv7, // destination value part of leaf. -#endif - Pjp_t Pjp, // 6-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv6;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF6: - - case cJU_JPLEAF6: - { - uint8_t * PLeaf6 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyCopy6to7(PLeaf7, PLeaf6, Pop1, MSByte); -#ifdef JUDYL - Pjv6 = JL_LEAF6VALUEAREA(PLeaf6, Pop1); - JU_COPYMEM(Pjv7, Pjv6, Pop1); -#endif - j__udyFreeJLL6((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_6_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), so -// the "assignment" to PLeaf7[] is exact and MSByte is not needed. - - case cJU_JPIMMED_6_01: - { - JU_COPY7_LONG_TO_PINDEX(PLeaf7, JU_JPDCDPOP0(Pjp)); // see above. - JUDYLCODE(Pjv7[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_6_02: - - case cJ1_JPIMMED_6_02: - { - uint8_t * PLeaf6 = (uint8_t *) (Pjp->jp_1Index); - - j__udyCopy6to7(PLeaf7, PLeaf6, /* Pop1 = */ 2, MSByte); - return(2); - } -#endif // JUDY1 - - -// UNEXPECTED CASES, including JPNULL6, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf6ToLeaf7() - -#endif // JU_64BIT - - -#ifndef JU_64BIT // 32-bit version first - -// **************************************************************************** -// __ J U D Y L E A F 3 T O L E A F W -// -// Copy 3-byte Indexes from a Leaf3 to 4-byte Indexes in a LeafW. Pjp MUST be -// one of: cJU_JPLEAF3 or cJU_JPIMMED_3_*. Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-L branch to a -// LeafW, the branch has no narrow pointers under it, meaning only level-3 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf3ToLeafW( - Pjlw_t Pjlw, // destination Index part of leaf. -#ifdef JUDYL - Pjv_t PjvW, // destination value part of leaf. -#endif - Pjp_t Pjp, // 3-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv3;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF3: - - case cJU_JPLEAF3: - { - uint8_t * PLeaf3 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyCopy3toW((PWord_t) Pjlw, PLeaf3, Pop1, MSByte); -#ifdef JUDYL - Pjv3 = JL_LEAF3VALUEAREA(PLeaf3, Pop1); - JU_COPYMEM(PjvW, Pjv3, Pop1); -#endif - j__udyFreeJLL3((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_3_01: -// -// Note: jp_DcdPopO has 3 bytes of Index (all but most significant byte), and -// MSByte must be ord in. - - case cJU_JPIMMED_3_01: - { - Pjlw[0] = MSByte | JU_JPDCDPOP0(Pjp); // see above. - JUDYLCODE(PjvW[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_3_02: - - case cJU_JPIMMED_3_02: - { - uint8_t * PLeaf3 = (uint8_t *) (Pjp->jp_1Index); - - j__udyCopy3toW((PWord_t) Pjlw, PLeaf3, /* Pop1 = */ 2, MSByte); - return(2); - } -#endif // JUDY1 - - -// UNEXPECTED CASES, including JPNULL3, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf3ToLeafW() - - -#else // JU_64BIT - - -// **************************************************************************** -// __ J U D Y L E A F 7 T O L E A F W -// -// Copy 7-byte Indexes from a Leaf7 to 8-byte Indexes in a LeafW. -// Pjp MUST be one of: cJU_JPLEAF7 or cJU_JPIMMED_7_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-L branch to a -// LeafW, the branch has no narrow pointers under it, meaning only level-7 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf7ToLeafW( - Pjlw_t Pjlw, // destination Index part of leaf. -#ifdef JUDYL - Pjv_t PjvW, // destination value part of leaf. -#endif - Pjp_t Pjp, // 7-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv7;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF7: - - case cJU_JPLEAF7: - { - uint8_t * PLeaf7 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyCopy7toW((PWord_t) Pjlw, PLeaf7, Pop1, MSByte); -#ifdef JUDYL - Pjv7 = JL_LEAF7VALUEAREA(PLeaf7, Pop1); - JU_COPYMEM(PjvW, Pjv7, Pop1); -#endif - j__udyFreeJLL7((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_7_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), and -// MSByte must be ord in. - - case cJU_JPIMMED_7_01: - { - Pjlw[0] = MSByte | JU_JPDCDPOP0(Pjp); // see above. - JUDYLCODE(PjvW[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_7_02: - - case cJ1_JPIMMED_7_02: - { - uint8_t * PLeaf7 = (uint8_t *) (Pjp->jp_1Index); - - j__udyCopy7toW((PWord_t) Pjlw, PLeaf7, /* Pop1 = */ 2, MSByte); - return(2); - } -#endif - - -// UNEXPECTED CASES, including JPNULL7, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf7ToLeafW() - -#endif // JU_64BIT diff --git a/libjudy/src/Judy1/Judy1First.c b/libjudy/src/Judy1/Judy1First.c deleted file mode 100644 index 49d427adaf..0000000000 --- a/libjudy/src/Judy1/Judy1First.c +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.12 $ $Source: /judy/src/JudyCommon/JudyFirst.c $ -// -// Judy*First[Empty]() and Judy*Last[Empty]() routines for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// These are inclusive versions of Judy*Next[Empty]() and Judy*Prev[Empty](). - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - - -// **************************************************************************** -// J U D Y 1 F I R S T -// J U D Y L F I R S T -// -// See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1First -#else -FUNCTION PPvoid_t JudyLFirst -#endif - ( - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError // optional, for returning error info. - ) -{ - if (PIndex == (PWord_t) NULL) // caller error: - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -#ifdef JUDY1 - switch (Judy1Test(PArray, *PIndex, PJError)) - { - case 1: return(1); // found *PIndex itself. - case 0: return(Judy1Next(PArray, PIndex, PJError)); - default: return(JERRI); - } -#else - { - PPvoid_t PValue; - - if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR) - return(PPJERR); - - if (PValue != (PPvoid_t) NULL) return(PValue); // found *PIndex. - - return(JudyLNext(PArray, PIndex, PJError)); - } -#endif - -} // Judy1First() / JudyLFirst() - - -// **************************************************************************** -// J U D Y 1 L A S T -// J U D Y L L A S T -// -// See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1Last( -#else -FUNCTION PPvoid_t JudyLLast( -#endif - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError) // optional, for returning error info. -{ - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); // caller error. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -#ifdef JUDY1 - switch (Judy1Test(PArray, *PIndex, PJError)) - { - case 1: return(1); // found *PIndex itself. - case 0: return(Judy1Prev(PArray, PIndex, PJError)); - default: return(JERRI); - } -#else - { - PPvoid_t PValue; - - if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR) - return(PPJERR); - - if (PValue != (PPvoid_t) NULL) return(PValue); // found *PIndex. - - return(JudyLPrev(PArray, PIndex, PJError)); - } -#endif - -} // Judy1Last() / JudyLLast() - - -// **************************************************************************** -// J U D Y 1 F I R S T E M P T Y -// J U D Y L F I R S T E M P T Y -// -// See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1FirstEmpty( -#else -FUNCTION int JudyLFirstEmpty( -#endif - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError) // optional, for returning error info. -{ - if (PIndex == (PWord_t) NULL) // caller error: - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return(JERRI); - } - -#ifdef JUDY1 - switch (Judy1Test(PArray, *PIndex, PJError)) - { - case 0: return(1); // found *PIndex itself. - case 1: return(Judy1NextEmpty(PArray, PIndex, PJError)); - default: return(JERRI); - } -#else - { - PPvoid_t PValue; - - if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR) - return(JERRI); - - if (PValue == (PPvoid_t) NULL) return(1); // found *PIndex. - - return(JudyLNextEmpty(PArray, PIndex, PJError)); - } -#endif - -} // Judy1FirstEmpty() / JudyLFirstEmpty() - - -// **************************************************************************** -// J U D Y 1 L A S T E M P T Y -// J U D Y L L A S T E M P T Y -// -// See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1LastEmpty( -#else -FUNCTION int JudyLLastEmpty( -#endif - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError) // optional, for returning error info. -{ - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); // caller error. - return(JERRI); - } - -#ifdef JUDY1 - switch (Judy1Test(PArray, *PIndex, PJError)) - { - case 0: return(1); // found *PIndex itself. - case 1: return(Judy1PrevEmpty(PArray, PIndex, PJError)); - default: return(JERRI); - } -#else - { - PPvoid_t PValue; - - if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR) - return(JERRI); - - if (PValue == (PPvoid_t) NULL) return(1); // found *PIndex. - - return(JudyLPrevEmpty(PArray, PIndex, PJError)); - } -#endif - -} // Judy1LastEmpty() / JudyLLastEmpty() diff --git a/libjudy/src/Judy1/Judy1FreeArray.c b/libjudy/src/Judy1/Judy1FreeArray.c deleted file mode 100644 index 1161d7dba2..0000000000 --- a/libjudy/src/Judy1/Judy1FreeArray.c +++ /dev/null @@ -1,363 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.51 $ $Source: /judy/src/JudyCommon/JudyFreeArray.c $ -// -// Judy1FreeArray() and JudyLFreeArray() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// Return the number of bytes freed from the array. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);) - - -// **************************************************************************** -// J U D Y 1 F R E E A R R A Y -// J U D Y L F R E E A R R A Y -// -// See the Judy*(3C) manual entry for details. -// -// This code is written recursively, at least at first, because thats much -// simpler. Hope its fast enough. - -#ifdef JUDY1 -FUNCTION Word_t Judy1FreeArray -#else -FUNCTION Word_t JudyLFreeArray -#endif - ( - PPvoid_t PPArray, // array to free. - PJError_t PJError // optional, for returning error info. - ) -{ - jpm_t jpm; // local to accumulate free statistics. - -// CHECK FOR NULL POINTER (error by caller): - - if (PPArray == (PPvoid_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); - return(JERR); - } - - DBGCODE(JudyCheckPop(*PPArray);) - -// Zero jpm.jpm_Pop0 (meaning the array will be empty in a moment) for accurate -// logging in TRACEMI2. - - jpm.jpm_Pop0 = 0; // see above. - jpm.jpm_TotalMemWords = 0; // initialize memory freed. - -// Empty array: - - if (P_JLW(*PPArray) == (Pjlw_t) NULL) return(0); - -// PROCESS TOP LEVEL "JRP" BRANCHES AND LEAF: - - if (JU_LEAFW_POP0(*PPArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(*PPArray); // first word of leaf. - - j__udyFreeJLW(Pjlw, Pjlw[0] + 1, &jpm); - *PPArray = (Pvoid_t) NULL; // make an empty array. - return (-(jpm.jpm_TotalMemWords * cJU_BYTESPERWORD)); // see above. - } - else - -// Rootstate leaves: just free the leaf: - -// Common code for returning the amount of memory freed. -// -// Note: In a an ordinary LEAFW, pop0 = *PPArray[0]. -// -// Accumulate (negative) words freed, while freeing objects. -// Return the positive bytes freed. - - { - Pjpm_t Pjpm = P_JPM(*PPArray); - Word_t TotalMem = Pjpm->jpm_TotalMemWords; - - j__udyFreeSM(&(Pjpm->jpm_JP), &jpm); // recurse through tree. - j__udyFreeJPM(Pjpm, &jpm); - -// Verify the array was not corrupt. This means that amount of memory freed -// (which is negative) is equal to the initial amount: - - if (TotalMem + jpm.jpm_TotalMemWords) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - return(JERR); - } - - *PPArray = (Pvoid_t) NULL; // make an empty array. - return (TotalMem * cJU_BYTESPERWORD); - } - -} // Judy1FreeArray() / JudyLFreeArray() - - -// **************************************************************************** -// __ J U D Y F R E E S M -// -// Given a pointer to a JP, recursively visit and free (depth first) all nodes -// in a Judy array BELOW the JP, but not the JP itself. Accumulate in *Pjpm -// the total words freed (as a negative value). "SM" = State Machine. -// -// Note: Corruption is not detected at this level because during a FreeArray, -// if the code hasnt already core dumped, its better to remain silent, even -// if some memory has not been freed, than to bother the caller about the -// corruption. TBD: Is this true? If not, must list all legitimate JPNULL -// and JPIMMED above first, and revert to returning bool_t (see 4.34). - -FUNCTION void j__udyFreeSM( - Pjp_t Pjp, // top of Judy (top-state). - Pjpm_t Pjpm) // to return words freed. -{ - Word_t Pop1; - - switch (JU_JPTYPE(Pjp)) - { - -#ifdef JUDY1 - -// FULL EXPANSE -- nothing to free for this jp_Type. - - case cJ1_JPFULLPOPU1: - break; -#endif - -// JUDY BRANCH -- free the sub-tree depth first: - -// LINEAR BRANCH -- visit each JP in the JBLs list, then free the JBL: -// -// Note: There are no null JPs in a JBL. - - case cJU_JPBRANCH_L: - case cJU_JPBRANCH_L2: - case cJU_JPBRANCH_L3: -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - case cJU_JPBRANCH_L5: - case cJU_JPBRANCH_L6: - case cJU_JPBRANCH_L7: -#endif // JU_64BIT - { - Pjbl_t Pjbl = P_JBL(Pjp->jp_Addr); - Word_t offset; - - for (offset = 0; offset < Pjbl->jbl_NumJPs; ++offset) - j__udyFreeSM((Pjbl->jbl_jp) + offset, Pjpm); - - j__udyFreeJBL((Pjbl_t) (Pjp->jp_Addr), Pjpm); - break; - } - - -// BITMAP BRANCH -- visit each JP in the JBBs list based on the bitmap, also -// -// Note: There are no null JPs in a JBB. - - case cJU_JPBRANCH_B: - case cJU_JPBRANCH_B2: - case cJU_JPBRANCH_B3: -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - case cJU_JPBRANCH_B5: - case cJU_JPBRANCH_B6: - case cJU_JPBRANCH_B7: -#endif // JU_64BIT - { - Word_t subexp; - Word_t offset; - Word_t jpcount; - - Pjbb_t Pjbb = P_JBB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - - if (jpcount) - { - for (offset = 0; offset < jpcount; ++offset) - { - j__udyFreeSM(P_JP(JU_JBB_PJP(Pjbb, subexp)) + offset, - Pjpm); - } - j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, subexp), jpcount, Pjpm); - } - } - j__udyFreeJBB((Pjbb_t) (Pjp->jp_Addr), Pjpm); - - break; - } - - -// UNCOMPRESSED BRANCH -- visit each JP in the JBU array, then free the JBU -// itself: -// -// Note: Null JPs are handled during recursion at a lower state. - - case cJU_JPBRANCH_U: - case cJU_JPBRANCH_U2: - case cJU_JPBRANCH_U3: -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: - case cJU_JPBRANCH_U5: - case cJU_JPBRANCH_U6: - case cJU_JPBRANCH_U7: -#endif // JU_64BIT - { - Word_t offset; - Pjbu_t Pjbu = P_JBU(Pjp->jp_Addr); - - for (offset = 0; offset < cJU_BRANCHUNUMJPS; ++offset) - j__udyFreeSM((Pjbu->jbu_jp) + offset, Pjpm); - - j__udyFreeJBU((Pjbu_t) (Pjp->jp_Addr), Pjpm); - break; - } - - -// -- Cases below here terminate and do not recurse. -- - - -// LINEAR LEAF -- just free the leaf; size is computed from jp_Type: -// -// Note: cJU_JPLEAF1 is a special case, see discussion in ../Judy1/Judy1.h - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL1((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; -#endif - - case cJU_JPLEAF2: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL2((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPLEAF3: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL3((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - -#ifdef JU_64BIT - case cJU_JPLEAF4: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL4((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPLEAF5: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL5((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPLEAF6: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL6((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPLEAF7: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL7((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; -#endif // JU_64BIT - - -// BITMAP LEAF -- free sub-expanse arrays of JPs, then free the JBB. - - case cJU_JPLEAF_B1: - { -#ifdef JUDYL - Word_t subexp; - Word_t jpcount; - Pjlb_t Pjlb = P_JLB(Pjp->jp_Addr); - -// Free the value areas in the bitmap leaf: - - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - { - jpcount = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - - if (jpcount) - j__udyLFreeJV(JL_JLB_PVALUE(Pjlb, subexp), jpcount, Pjpm); - } -#endif // JUDYL - - j__udyFreeJLB1((Pjlb_t) (Pjp->jp_Addr), Pjpm); - break; - - } // case cJU_JPLEAF_B1 - -#ifdef JUDYL - - -// IMMED*: -// -// For JUDYL, all non JPIMMED_*_01s have a LeafV which must be freed: - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#ifdef JU_64BIT - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif - Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_1_02 + 2; - j__udyLFreeJV((Pjv_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - -#ifdef JU_64BIT - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: - - Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_2_02 + 2; - j__udyLFreeJV((Pjv_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPIMMED_3_02: - j__udyLFreeJV((Pjv_t) (Pjp->jp_Addr), 2, Pjpm); - break; - -#endif // JU_64BIT -#endif // JUDYL - - -// OTHER JPNULL, JPIMMED, OR UNEXPECTED TYPE -- nothing to free for this type: -// -// Note: Lump together no-op and invalid JP types; see function header -// comments. - - default: break; - - } // switch (JU_JPTYPE(Pjp)) - -} // j__udyFreeSM() diff --git a/libjudy/src/Judy1/Judy1InsertBranch.c b/libjudy/src/Judy1/Judy1InsertBranch.c deleted file mode 100644 index eaf8a5c94f..0000000000 --- a/libjudy/src/Judy1/Judy1InsertBranch.c +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.17 $ $Source: /judy/src/JudyCommon/JudyInsertBranch.c $ - -// BranchL insertion functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -extern int j__udyCreateBranchL(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); - - -// **************************************************************************** -// __ J U D Y I N S E R T B R A N C H -// -// Insert 2-element BranchL in between Pjp and Pjp->jp_Addr. -// -// Return -1 if out of memory, otherwise return 1. - -FUNCTION int j__udyInsertBranch( - Pjp_t Pjp, // JP containing narrow pointer. - Word_t Index, // outlier to Pjp. - Word_t BranchLevel, // of what JP points to, mapped from JP type. - Pjpm_t Pjpm) // for global accounting. -{ - jp_t JP2 [2]; - jp_t JP; - Pjp_t PjpNull; - Word_t XorExp; - Word_t Inew, Iold; - Word_t DCDMask; // initially for original BranchLevel. - int Ret; - uint8_t Exp2[2]; - uint8_t DecodeByteN, DecodeByteO; - -// Get the current mask for the DCD digits: - - DCDMask = cJU_DCDMASK(BranchLevel); - -// Obtain Dcd bits that differ between Index and JP, shifted so the -// digit for BranchLevel is the LSB: - - XorExp = ((Index ^ JU_JPDCDPOP0(Pjp)) & (cJU_ALLONES >> cJU_BITSPERBYTE)) - >> (BranchLevel * cJU_BITSPERBYTE); - assert(XorExp); // Index must be an outlier. - -// Count levels between object under narrow pointer and the level at which -// the outlier diverges from it, which is always at least initial -// BranchLevel + 1, to end up with the level (JP type) at which to insert -// the new intervening BranchL: - - do { ++BranchLevel; } while ((XorExp >>= cJU_BITSPERBYTE)); - assert((BranchLevel > 1) && (BranchLevel < cJU_ROOTSTATE)); - -// Get the MSB (highest digit) that differs between the old expanse and -// the new Index to insert: - - DecodeByteO = JU_DIGITATSTATE(JU_JPDCDPOP0(Pjp), BranchLevel); - DecodeByteN = JU_DIGITATSTATE(Index, BranchLevel); - - assert(DecodeByteO != DecodeByteN); - -// Determine sorted order for old expanse and new Index digits: - - if (DecodeByteN > DecodeByteO) { Iold = 0; Inew = 1; } - else { Iold = 1; Inew = 0; } - -// Copy old JP into staging area for new Branch - JP2 [Iold] = *Pjp; - Exp2[Iold] = DecodeByteO; - Exp2[Inew] = DecodeByteN; - -// Create a 2 Expanse Linear branch -// -// Note: Pjp->jp_Addr is set by j__udyCreateBranchL() - - Ret = j__udyCreateBranchL(Pjp, JP2, Exp2, 2, Pjpm); - if (Ret == -1) return(-1); - -// Get Pjp to the NULL of where to do insert - PjpNull = ((P_JBL(Pjp->jp_Addr))->jbl_jp) + Inew; - -// Convert to a cJU_JPIMMED_*_01 at the correct level: -// Build JP and set type below to: cJU_JPIMMED_X_01 - JU_JPSETADT(PjpNull, 0, Index, cJU_JPIMMED_1_01 - 2 + BranchLevel); - -// Return pointer to Value area in cJU_JPIMMED_X_01 - JUDYLCODE(Pjpm->jpm_PValue = (Pjv_t) PjpNull;) - -// The old JP now points to a BranchL that is at higher level. Therefore -// it contains excess DCD bits (in the least significant position) that -// must be removed (zeroed); that is, they become part of the Pop0 -// subfield. Note that the remaining (lower) bytes in the Pop0 field do -// not change. -// -// Take from the old DCDMask, which went "down" to a lower BranchLevel, -// and zero any high bits that are still in the mask at the new, higher -// BranchLevel; then use this mask to zero the bits in jp_DcdPopO: - -// Set old JP to a BranchL at correct level - - Pjp->jp_Type = cJU_JPBRANCH_L2 - 2 + BranchLevel; - DCDMask ^= cJU_DCDMASK(BranchLevel); - DCDMask = ~DCDMask & JU_JPDCDPOP0(Pjp); - JP = *Pjp; - JU_JPSETADT(Pjp, JP.jp_Addr, DCDMask, JP.jp_Type); - - return(1); - -} // j__udyInsertBranch() diff --git a/libjudy/src/Judy1/Judy1MallocIF.c b/libjudy/src/Judy1/Judy1MallocIF.c deleted file mode 100644 index 9a7d02f210..0000000000 --- a/libjudy/src/Judy1/Judy1MallocIF.c +++ /dev/null @@ -1,782 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.45 $ $Source: /judy/src/JudyCommon/JudyMallocIF.c $ -// -// Judy malloc/free interface functions for Judy1 and JudyL. -// -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DTRACEMI (Malloc Interface) to turn on tracing of malloc/free -// calls at the interface level. (See also TRACEMF in lower-level code.) -// Use -DTRACEMI2 for a terser format suitable for trace analysis. -// -// There can be malloc namespace bits in the LSBs of "raw" addresses from most, -// but not all, of the j__udy*Alloc*() functions; see also JudyPrivate.h. To -// test the Judy code, compile this file with -DMALLOCBITS and use debug flavor -// only (for assertions). This test ensures that (a) all callers properly mask -// the namespace bits out before dereferencing a pointer (or else a core dump -// occurs), and (b) all callers send "raw" (unmasked) addresses to -// j__udy*Free*() calls. -// -// Note: Currently -DDEBUG turns on MALLOCBITS automatically. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -// Set "hidden" global j__uMaxWords to the maximum number of words to allocate -// to any one array (large enough to have a JPM, otherwise j__uMaxWords is -// ignored), to trigger a fake malloc error when the number is exceeded. Note, -// this code is always executed, not #ifdefd, because its virtually free. -// -// Note: To keep the MALLOC macro faster and simpler, set j__uMaxWords to -// MAXINT, not zero, by default. - -Word_t j__uMaxWords = ~0UL; - -// This macro hides the faking of a malloc failure: -// -// Note: To keep this fast, just compare WordsPrev to j__uMaxWords without the -// complexity of first adding WordsNow, meaning the trigger point is not -// exactly where you might assume, but it shouldnt matter. - -#define MALLOC(MallocFunc,WordsPrev,WordsNow) \ - (((WordsPrev) > j__uMaxWords) ? 0UL : MallocFunc(WordsNow)) - -// Clear words starting at address: -// -// Note: Only use this for objects that care; in other cases, it doesnt -// matter if the objects memory is pre-zeroed. - -#define ZEROWORDS(Addr,Words) \ - { \ - Word_t Words__ = (Words); \ - PWord_t Addr__ = (PWord_t) (Addr); \ - while (Words__--) *Addr__++ = 0UL; \ - } - -#ifdef TRACEMI - -// TRACING SUPPORT: -// -// Note: For TRACEMI, use a format for address printing compatible with other -// tracing facilities; in particular, %x not %lx, to truncate the "noisy" high -// part on 64-bit systems. -// -// TBD: The trace macros need fixing for alternate address types. -// -// Note: TRACEMI2 supports trace analysis no matter the underlying malloc/free -// engine used. - -#include - -static Word_t j__udyMemSequence = 0L; // event sequence number. - -#define TRACE_ALLOC5(a,b,c,d,e) (void) printf(a, (b), c, d) -#define TRACE_FREE5( a,b,c,d,e) (void) printf(a, (b), c, d) -#define TRACE_ALLOC6(a,b,c,d,e,f) (void) printf(a, (b), c, d, e) -#define TRACE_FREE6( a,b,c,d,e,f) (void) printf(a, (b), c, d, e) - -#else - -#ifdef TRACEMI2 - -#include - -#define b_pw cJU_BYTESPERWORD - -#define TRACE_ALLOC5(a,b,c,d,e) \ - (void) printf("a %lx %lx %lx\n", (b), (d) * b_pw, e) -#define TRACE_FREE5( a,b,c,d,e) \ - (void) printf("f %lx %lx %lx\n", (b), (d) * b_pw, e) -#define TRACE_ALLOC6(a,b,c,d,e,f) \ - (void) printf("a %lx %lx %lx\n", (b), (e) * b_pw, f) -#define TRACE_FREE6( a,b,c,d,e,f) \ - (void) printf("f %lx %lx %lx\n", (b), (e) * b_pw, f) - -static Word_t j__udyMemSequence = 0L; // event sequence number. - -#else - -#define TRACE_ALLOC5(a,b,c,d,e) // null. -#define TRACE_FREE5( a,b,c,d,e) // null. -#define TRACE_ALLOC6(a,b,c,d,e,f) // null. -#define TRACE_FREE6( a,b,c,d,e,f) // null. - -#endif // ! TRACEMI2 -#endif // ! TRACEMI - - -// MALLOC NAMESPACE SUPPORT: - -#if (defined(DEBUG) && (! defined(MALLOCBITS))) // for now, DEBUG => MALLOCBITS: -#define MALLOCBITS 1 -#endif - -#ifdef MALLOCBITS -#define MALLOCBITS_VALUE 0x3 // bit pattern to use. -#define MALLOCBITS_MASK 0x7 // note: matches mask__ in JudyPrivate.h. - -#define MALLOCBITS_SET( Type,Addr) \ - ((Addr) = (Type) ((Word_t) (Addr) | MALLOCBITS_VALUE)) -#define MALLOCBITS_TEST(Type,Addr) \ - assert((((Word_t) (Addr)) & MALLOCBITS_MASK) == MALLOCBITS_VALUE); \ - ((Addr) = (Type) ((Word_t) (Addr) & ~MALLOCBITS_VALUE)) -#else -#define MALLOCBITS_SET( Type,Addr) // null. -#define MALLOCBITS_TEST(Type,Addr) // null. -#endif - - -// SAVE ERROR INFORMATION IN A Pjpm: -// -// "Small" (invalid) Addr values are used to distinguish overrun and no-mem -// errors. (TBD, non-zero invalid values are no longer returned from -// lower-level functions, that is, JU_ERRNO_OVERRUN is no longer detected.) - -#define J__UDYSETALLOCERROR(Addr) \ - { \ - JU_ERRID(Pjpm) = __LINE__; \ - if ((Word_t) (Addr) > 0) JU_ERRNO(Pjpm) = JU_ERRNO_OVERRUN; \ - else JU_ERRNO(Pjpm) = JU_ERRNO_NOMEM; \ - return(0); \ - } - - -// **************************************************************************** -// ALLOCATION FUNCTIONS: -// -// To help the compiler catch coding errors, each function returns a specific -// object type. -// -// Note: Only j__udyAllocJPM() and j__udyAllocJLW() return multiple values <= -// sizeof(Word_t) to indicate the type of memory allocation failure. Other -// allocation functions convert this failure to a JU_ERRNO. - - -// Note: Unlike other j__udyAlloc*() functions, Pjpms are returned non-raw, -// that is, without malloc namespace or root pointer type bits: - -FUNCTION Pjpm_t j__udyAllocJPM(void) -{ - Word_t Words = (sizeof(jpm_t) + cJU_BYTESPERWORD - 1) / cJU_BYTESPERWORD; - Pjpm_t Pjpm = (Pjpm_t) MALLOC(JudyMalloc, Words, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jpm_t)); - - if ((Word_t) Pjpm > sizeof(Word_t)) - { - ZEROWORDS(Pjpm, Words); - Pjpm->jpm_TotalMemWords = Words; - } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJPM(), Words = %lu\n", - Pjpm, j__udyMemSequence++, Words, cJU_LEAFW_MAXPOP1 + 1); - // MALLOCBITS_SET(Pjpm_t, Pjpm); // see above. - return(Pjpm); - -} // j__udyAllocJPM() - - -FUNCTION Pjbl_t j__udyAllocJBL(Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbl_t) / cJU_BYTESPERWORD; - Pjbl_t PjblRaw = (Pjbl_t) MALLOC(JudyMallocVirtual, - Pjpm->jpm_TotalMemWords, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jbl_t)); - - if ((Word_t) PjblRaw > sizeof(Word_t)) - { - ZEROWORDS(P_JBL(PjblRaw), Words); - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjblRaw); } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJBL(), Words = %lu\n", PjblRaw, - j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjbl_t, PjblRaw); - return(PjblRaw); - -} // j__udyAllocJBL() - - -FUNCTION Pjbb_t j__udyAllocJBB(Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbb_t) / cJU_BYTESPERWORD; - Pjbb_t PjbbRaw = (Pjbb_t) MALLOC(JudyMallocVirtual, - Pjpm->jpm_TotalMemWords, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jbb_t)); - - if ((Word_t) PjbbRaw > sizeof(Word_t)) - { - ZEROWORDS(P_JBB(PjbbRaw), Words); - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjbbRaw); } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJBB(), Words = %lu\n", PjbbRaw, - j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjbb_t, PjbbRaw); - return(PjbbRaw); - -} // j__udyAllocJBB() - - -FUNCTION Pjp_t j__udyAllocJBBJP(Word_t NumJPs, Pjpm_t Pjpm) -{ - Word_t Words = JU_BRANCHJP_NUMJPSTOWORDS(NumJPs); - Pjp_t PjpRaw; - - PjpRaw = (Pjp_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjpRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjpRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJBBJP(%lu), Words = %lu\n", PjpRaw, - j__udyMemSequence++, NumJPs, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjp_t, PjpRaw); - return(PjpRaw); - -} // j__udyAllocJBBJP() - - -FUNCTION Pjbu_t j__udyAllocJBU(Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbu_t) / cJU_BYTESPERWORD; - Pjbu_t PjbuRaw = (Pjbu_t) MALLOC(JudyMallocVirtual, - Pjpm->jpm_TotalMemWords, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jbu_t)); - - if ((Word_t) PjbuRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjbuRaw); } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJBU(), Words = %lu\n", PjbuRaw, - j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjbu_t, PjbuRaw); - return(PjbuRaw); - -} // j__udyAllocJBU() - - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -FUNCTION Pjll_t j__udyAllocJLL1(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF1POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL1(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL1() - -#endif // (JUDYL || (! JU_64BIT)) - - -FUNCTION Pjll_t j__udyAllocJLL2(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF2POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL2(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL2() - - -FUNCTION Pjll_t j__udyAllocJLL3(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF3POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL3(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL3() - - -#ifdef JU_64BIT - -FUNCTION Pjll_t j__udyAllocJLL4(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF4POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL4(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL4() - - -FUNCTION Pjll_t j__udyAllocJLL5(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF5POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL5(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL5() - - -FUNCTION Pjll_t j__udyAllocJLL6(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF6POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL6(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL6() - - -FUNCTION Pjll_t j__udyAllocJLL7(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF7POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL7(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL7() - -#endif // JU_64BIT - - -// Note: Root-level leaf addresses are always whole words (Pjlw_t), and unlike -// other j__udyAlloc*() functions, they are returned non-raw, that is, without -// malloc namespace or root pointer type bits (the latter are added later by -// the caller): - -FUNCTION Pjlw_t j__udyAllocJLW(Word_t Pop1) -{ - Word_t Words = JU_LEAFWPOPTOWORDS(Pop1); - Pjlw_t Pjlw = (Pjlw_t) MALLOC(JudyMalloc, Words, Words); - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLW(%lu), Words = %lu\n", Pjlw, - j__udyMemSequence++, Pop1, Words, Pop1); - // MALLOCBITS_SET(Pjlw_t, Pjlw); // see above. - return(Pjlw); - -} // j__udyAllocJLW() - - -FUNCTION Pjlb_t j__udyAllocJLB1(Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jlb_t) / cJU_BYTESPERWORD; - Pjlb_t PjlbRaw; - - PjlbRaw = (Pjlb_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jlb_t)); - - if ((Word_t) PjlbRaw > sizeof(Word_t)) - { - ZEROWORDS(P_JLB(PjlbRaw), Words); - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjlbRaw); } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJLB1(), Words = %lu\n", PjlbRaw, - j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjlb_t, PjlbRaw); - return(PjlbRaw); - -} // j__udyAllocJLB1() - - -#ifdef JUDYL - -FUNCTION Pjv_t j__udyLAllocJV(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JL_LEAFVPOPTOWORDS(Pop1); - Pjv_t PjvRaw; - - PjvRaw = (Pjv_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjvRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjvRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyLAllocJV(%lu), Words = %lu\n", PjvRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjv_t, PjvRaw); - return(PjvRaw); - -} // j__udyLAllocJV() - -#endif // JUDYL - - -// **************************************************************************** -// FREE FUNCTIONS: -// -// To help the compiler catch coding errors, each function takes a specific -// object type to free. - - -// Note: j__udyFreeJPM() receives a root pointer with NO root pointer type -// bits present, that is, they must be stripped by the caller using P_JPM(): - -FUNCTION void j__udyFreeJPM(Pjpm_t PjpmFree, Pjpm_t PjpmStats) -{ - Word_t Words = (sizeof(jpm_t) + cJU_BYTESPERWORD - 1) / cJU_BYTESPERWORD; - - // MALLOCBITS_TEST(Pjpm_t, PjpmFree); // see above. - JudyFree((Pvoid_t) PjpmFree, Words); - - if (PjpmStats != (Pjpm_t) NULL) PjpmStats->jpm_TotalMemWords -= Words; - -// Note: Log PjpmFree->jpm_Pop0, similar to other j__udyFree*() functions, not -// an assumed value of cJU_LEAFW_MAXPOP1, for when the caller is -// Judy*FreeArray(), jpm_Pop0 is set to 0, and the population after the free -// really will be 0, not cJU_LEAFW_MAXPOP1. - - TRACE_FREE6("0x%x %8lu = j__udyFreeJPM(%lu), Words = %lu\n", PjpmFree, - j__udyMemSequence++, Words, Words, PjpmFree->jpm_Pop0); - - -} // j__udyFreeJPM() - - -FUNCTION void j__udyFreeJBL(Pjbl_t Pjbl, Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbl_t) / cJU_BYTESPERWORD; - - MALLOCBITS_TEST(Pjbl_t, Pjbl); - JudyFreeVirtual((Pvoid_t) Pjbl, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE5("0x%x %8lu = j__udyFreeJBL(), Words = %lu\n", Pjbl, - j__udyMemSequence++, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJBL() - - -FUNCTION void j__udyFreeJBB(Pjbb_t Pjbb, Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbb_t) / cJU_BYTESPERWORD; - - MALLOCBITS_TEST(Pjbb_t, Pjbb); - JudyFreeVirtual((Pvoid_t) Pjbb, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE5("0x%x %8lu = j__udyFreeJBB(), Words = %lu\n", Pjbb, - j__udyMemSequence++, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJBB() - - -FUNCTION void j__udyFreeJBBJP(Pjp_t Pjp, Word_t NumJPs, Pjpm_t Pjpm) -{ - Word_t Words = JU_BRANCHJP_NUMJPSTOWORDS(NumJPs); - - MALLOCBITS_TEST(Pjp_t, Pjp); - JudyFree((Pvoid_t) Pjp, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJBBJP(%lu), Words = %lu\n", Pjp, - j__udyMemSequence++, NumJPs, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJBBJP() - - -FUNCTION void j__udyFreeJBU(Pjbu_t Pjbu, Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbu_t) / cJU_BYTESPERWORD; - - MALLOCBITS_TEST(Pjbu_t, Pjbu); - JudyFreeVirtual((Pvoid_t) Pjbu, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE5("0x%x %8lu = j__udyFreeJBU(), Words = %lu\n", Pjbu, - j__udyMemSequence++, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJBU() - - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -FUNCTION void j__udyFreeJLL1(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF1POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL1(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL1() - -#endif // (JUDYL || (! JU_64BIT)) - - -FUNCTION void j__udyFreeJLL2(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF2POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL2(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL2() - - -FUNCTION void j__udyFreeJLL3(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF3POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL3(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL3() - - -#ifdef JU_64BIT - -FUNCTION void j__udyFreeJLL4(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF4POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL4(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL4() - - -FUNCTION void j__udyFreeJLL5(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF5POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL5(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL5() - - -FUNCTION void j__udyFreeJLL6(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF6POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL6(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL6() - - -FUNCTION void j__udyFreeJLL7(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF7POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL7(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL7() - -#endif // JU_64BIT - - -// Note: j__udyFreeJLW() receives a root pointer with NO root pointer type -// bits present, that is, they are stripped by P_JLW(): - -FUNCTION void j__udyFreeJLW(Pjlw_t Pjlw, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAFWPOPTOWORDS(Pop1); - - // MALLOCBITS_TEST(Pjlw_t, Pjlw); // see above. - JudyFree((Pvoid_t) Pjlw, Words); - - if (Pjpm) Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLW(%lu), Words = %lu\n", Pjlw, - j__udyMemSequence++, Pop1, Words, Pop1 - 1); - - -} // j__udyFreeJLW() - - -FUNCTION void j__udyFreeJLB1(Pjlb_t Pjlb, Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jlb_t) / cJU_BYTESPERWORD; - - MALLOCBITS_TEST(Pjlb_t, Pjlb); - JudyFree((Pvoid_t) Pjlb, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE5("0x%x %8lu = j__udyFreeJLB1(), Words = %lu\n", Pjlb, - j__udyMemSequence++, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLB1() - - -#ifdef JUDYL - -FUNCTION void j__udyLFreeJV(Pjv_t Pjv, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JL_LEAFVPOPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjv_t, Pjv); - JudyFree((Pvoid_t) Pjv, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyLFreeJV(%lu), Words = %lu\n", Pjv, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyLFreeJV() - -#endif // JUDYL diff --git a/libjudy/src/Judy1/Judy1MemActive.c b/libjudy/src/Judy1/Judy1MemActive.c deleted file mode 100644 index 701cc34910..0000000000 --- a/libjudy/src/Judy1/Judy1MemActive.c +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.7 $ $Source: /judy/src/JudyCommon/JudyMemActive.c $ -// -// Return number of bytes of memory used to support a Judy1/L array. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -FUNCTION static Word_t j__udyGetMemActive(Pjp_t); - - -// **************************************************************************** -// J U D Y 1 M E M A C T I V E -// J U D Y L M E M A C T I V E - -#ifdef JUDY1 -FUNCTION Word_t Judy1MemActive -#else -FUNCTION Word_t JudyLMemActive -#endif - ( - Pcvoid_t PArray // from which to retrieve. - ) -{ - if (PArray == (Pcvoid_t)NULL) return(0); - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - Word_t Words = Pjlw[0] + 1; // population. -#ifdef JUDY1 - return((Words + 1) * sizeof(Word_t)); -#else - return(((Words * 2) + 1) * sizeof(Word_t)); -#endif - } - else - { - Pjpm_t Pjpm = P_JPM(PArray); - return(j__udyGetMemActive(&Pjpm->jpm_JP) + sizeof(jpm_t)); - } - -} // JudyMemActive() - - -// **************************************************************************** -// __ J U D Y G E T M E M A C T I V E - -FUNCTION static Word_t j__udyGetMemActive( - Pjp_t Pjp) // top of subtree. -{ - Word_t offset; // in a branch. - Word_t Bytes = 0; // actual bytes used at this level. - Word_t IdxSz; // bytes per index in leaves - - switch (JU_JPTYPE(Pjp)) - { - - case cJU_JPBRANCH_L2: - case cJU_JPBRANCH_L3: -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - case cJU_JPBRANCH_L5: - case cJU_JPBRANCH_L6: - case cJU_JPBRANCH_L7: -#endif - case cJU_JPBRANCH_L: - { - Pjbl_t Pjbl = P_JBL(Pjp->jp_Addr); - - for (offset = 0; offset < (Pjbl->jbl_NumJPs); ++offset) - Bytes += j__udyGetMemActive((Pjbl->jbl_jp) + offset); - - return(Bytes + sizeof(jbl_t)); - } - - case cJU_JPBRANCH_B2: - case cJU_JPBRANCH_B3: -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - case cJU_JPBRANCH_B5: - case cJU_JPBRANCH_B6: - case cJU_JPBRANCH_B7: -#endif - case cJU_JPBRANCH_B: - { - Word_t subexp; - Word_t jpcount; - Pjbb_t Pjbb = P_JBB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - Bytes += jpcount * sizeof(jp_t); - - for (offset = 0; offset < jpcount; ++offset) - { - Bytes += j__udyGetMemActive(P_JP(JU_JBB_PJP(Pjbb, subexp)) - + offset); - } - } - - return(Bytes + sizeof(jbb_t)); - } - - case cJU_JPBRANCH_U2: - case cJU_JPBRANCH_U3: -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: - case cJU_JPBRANCH_U5: - case cJU_JPBRANCH_U6: - case cJU_JPBRANCH_U7: -#endif - case cJU_JPBRANCH_U: - { - Pjbu_t Pjbu = P_JBU(Pjp->jp_Addr); - - for (offset = 0; offset < cJU_BRANCHUNUMJPS; ++offset) - { - if (((Pjbu->jbu_jp[offset].jp_Type) >= cJU_JPNULL1) - && ((Pjbu->jbu_jp[offset].jp_Type) <= cJU_JPNULLMAX)) - { - continue; // skip null JP to save time. - } - - Bytes += j__udyGetMemActive(Pjbu->jbu_jp + offset); - } - - return(Bytes + sizeof(jbu_t)); - } - - -// -- Cases below here terminate and do not recurse. -- - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: IdxSz = 1; goto LeafWords; -#endif - case cJU_JPLEAF2: IdxSz = 2; goto LeafWords; - case cJU_JPLEAF3: IdxSz = 3; goto LeafWords; -#ifdef JU_64BIT - case cJU_JPLEAF4: IdxSz = 4; goto LeafWords; - case cJU_JPLEAF5: IdxSz = 5; goto LeafWords; - case cJU_JPLEAF6: IdxSz = 6; goto LeafWords; - case cJU_JPLEAF7: IdxSz = 7; goto LeafWords; -#endif -LeafWords: - -#ifdef JUDY1 - return(IdxSz * (JU_JPLEAF_POP0(Pjp) + 1)); -#else - return((IdxSz + sizeof(Word_t)) - * (JU_JPLEAF_POP0(Pjp) + 1)); -#endif - case cJU_JPLEAF_B1: - { -#ifdef JUDY1 - return(sizeof(jlb_t)); -#else - Bytes = (JU_JPLEAF_POP0(Pjp) + 1) * sizeof(Word_t); - - return(Bytes + sizeof(jlb_t)); -#endif - } - - JUDY1CODE(case cJ1_JPFULLPOPU1: return(0);) - -#ifdef JUDY1 -#define J__Mpy 0 -#else -#define J__Mpy sizeof(Word_t) -#endif - - case cJU_JPIMMED_1_01: return(0); - case cJU_JPIMMED_2_01: return(0); - case cJU_JPIMMED_3_01: return(0); -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: return(0); - case cJU_JPIMMED_5_01: return(0); - case cJU_JPIMMED_6_01: return(0); - case cJU_JPIMMED_7_01: return(0); -#endif - - case cJU_JPIMMED_1_02: return(J__Mpy * 2); - case cJU_JPIMMED_1_03: return(J__Mpy * 3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: return(J__Mpy * 4); - case cJU_JPIMMED_1_05: return(J__Mpy * 5); - case cJU_JPIMMED_1_06: return(J__Mpy * 6); - case cJU_JPIMMED_1_07: return(J__Mpy * 7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: return(0); - case cJ1_JPIMMED_1_09: return(0); - case cJ1_JPIMMED_1_10: return(0); - case cJ1_JPIMMED_1_11: return(0); - case cJ1_JPIMMED_1_12: return(0); - case cJ1_JPIMMED_1_13: return(0); - case cJ1_JPIMMED_1_14: return(0); - case cJ1_JPIMMED_1_15: return(0); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: return(J__Mpy * 2); - case cJU_JPIMMED_2_03: return(J__Mpy * 3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: return(0); - case cJ1_JPIMMED_2_05: return(0); - case cJ1_JPIMMED_2_06: return(0); - case cJ1_JPIMMED_2_07: return(0); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: return(J__Mpy * 2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: return(0); - case cJ1_JPIMMED_3_04: return(0); - case cJ1_JPIMMED_3_05: return(0); - - case cJ1_JPIMMED_4_02: return(0); - case cJ1_JPIMMED_4_03: return(0); - case cJ1_JPIMMED_5_02: return(0); - case cJ1_JPIMMED_5_03: return(0); - case cJ1_JPIMMED_6_02: return(0); - case cJ1_JPIMMED_7_02: return(0); -#endif - - } // switch (JU_JPTYPE(Pjp)) - - return(0); // to make some compilers happy. - -} // j__udyGetMemActive() diff --git a/libjudy/src/Judy1/Judy1MemUsed.c b/libjudy/src/Judy1/Judy1MemUsed.c deleted file mode 100644 index fc92d48800..0000000000 --- a/libjudy/src/Judy1/Judy1MemUsed.c +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.5 $ $Source: /judy/src/JudyCommon/JudyMemUsed.c $ -// -// Return number of bytes of memory used to support a Judy1/L array. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -#ifdef JUDY1 -FUNCTION Word_t Judy1MemUsed -#else // JUDYL -FUNCTION Word_t JudyLMemUsed -#endif - ( - Pcvoid_t PArray // from which to retrieve. - ) -{ - Word_t Words = 0; - - if (PArray == (Pcvoid_t) NULL) return(0); - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - Words = JU_LEAFWPOPTOWORDS(Pjlw[0] + 1); // based on pop1. - } - else - { - Pjpm_t Pjpm = P_JPM(PArray); - Words = Pjpm->jpm_TotalMemWords; - } - - return(Words * sizeof(Word_t)); // convert to bytes. - -} // Judy1MemUsed() / JudyLMemUsed() diff --git a/libjudy/src/Judy1/Judy1Next.c b/libjudy/src/Judy1/Judy1Next.c deleted file mode 100644 index d15db1596c..0000000000 --- a/libjudy/src/Judy1/Judy1Next.c +++ /dev/null @@ -1,1890 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.54 $ $Source: /judy/src/JudyCommon/JudyPrevNext.c $ -// -// Judy*Prev() and Judy*Next() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DJUDYNEXT for the Judy*Next() function; otherwise defaults to -// Judy*Prev(). - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifndef JUDYNEXT -#ifndef JUDYPREV -#define JUDYPREV 1 // neither set => use default. -#endif -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - - -// **************************************************************************** -// J U D Y 1 P R E V -// J U D Y 1 N E X T -// J U D Y L P R E V -// J U D Y L N E X T -// -// See the manual entry for the API. -// -// OVERVIEW OF Judy*Prev(): -// -// Use a reentrant switch statement (state machine, SM1 = "get") to decode the -// callers *PIndex-1, starting with the (PArray), through branches, if -// any, down to an immediate or a leaf. Look for *PIndex-1 in that leaf, and -// if found, return it. -// -// A dead end is either a branch that does not contain a JP for the appropriate -// digit in *PIndex-1, or a leaf that does not contain the undecoded digits of -// *PIndex-1. Upon reaching a dead end, backtrack through the leaf/branches -// that were just traversed, using a list (history) of parent JPs that is built -// while going forward in SM1Get. Start with the current leaf or branch. In a -// backtracked leaf, look for an Index less than *PIndex-1. In each -// backtracked branch, look "sideways" for the next JP, if any, lower than the -// one for the digit (from *PIndex-1) that was previously decoded. While -// backtracking, if a leaf has no previous Index or a branch has no lower JP, -// go to its parent branch in turn. Upon reaching the JRP, return failure, "no -// previous Index". The backtrack process is sufficiently different from -// SM1Get to merit its own separate reentrant switch statement (SM2 = -// "backtrack"). -// -// While backtracking, upon finding a lower JP in a branch, there is certain to -// be a "prev" Index under that JP (unless the Judy array is corrupt). -// Traverse forward again, this time taking the last (highest, right-most) JP -// in each branch, and the last (highest) Index upon reaching an immediate or a -// leaf. This traversal is sufficiently different from SM1Get and SM2Backtrack -// to merit its own separate reentrant switch statement (SM3 = "findlimit"). -// -// "Decode" bytes in JPs complicate this process a little. In SM1Get, when a -// JP is a narrow pointer, that is, when states are skipped (so the skipped -// digits are stored in jp_DcdPopO), compare the relevant digits to the same -// digits in *PIndex-1. If they are EQUAL, proceed in SM1Get as before. If -// jp_DcdPopOs digits are GREATER, treat the JP as a dead end and proceed in -// SM2Backtrack. If jp_DcdPopOs digits are LESS, treat the JP as if it had -// just been found during a backtrack and proceed directly in SM3Findlimit. -// -// Note that Decode bytes can be ignored in SM3Findlimit; they dont matter. -// Also note that in practice the Decode bytes are routinely compared with -// *PIndex-1 because thats simpler and no slower than first testing for -// narrowness. -// -// Decode bytes also make it unnecessary to construct the Index to return (the -// revised *PIndex) during the search. This step is deferred until finding an -// Index during backtrack or findlimit, before returning it. The first digit -// of *PIndex is derived (saved) based on which JP is used in a JRP branch. -// The remaining digits are obtained from the jp_DcdPopO field in the JP (if -// any) above the immediate or leaf containing the found (prev) Index, plus the -// remaining digit(s) in the immediate or leaf itself. In the case of a LEAFW, -// the Index to return is found directly in the leaf. -// -// Note: Theoretically, as described above, upon reaching a dead end, SM1Get -// passes control to SM2Backtrack to look sideways, even in a leaf. Actually -// its a little more efficient for the SM1Get leaf cases to shortcut this and -// take care of the sideways searches themselves. Hence the history list only -// contains branch JPs, and SM2Backtrack only handles branches. In fact, even -// the branch handling cases in SM1Get do some shortcutting (sideways -// searching) to avoid pushing history and calling SM2Backtrack unnecessarily. -// -// Upon reaching an Index to return after backtracking, *PIndex must be -// modified to the found Index. In principle this could be done by building -// the Index from a saved rootdigit (in the top branch) plus the Dcd bytes from -// the parent JP plus the appropriate Index bytes from the leaf. However, -// Immediates are difficult because their parent JPs lack one (last) digit. So -// instead just build the *PIndex to return "top down" while backtracking and -// findlimiting. -// -// This function is written iteratively for speed, rather than recursively. -// -// CAVEATS: -// -// Why use a backtrack list (history stack), since it has finite size? The -// size is small for Judy on both 32-bit and 64-bit systems, and a list (really -// just an array) is fast to maintain and use. Other alternatives include -// doing a lookahead (lookaside) in each branch while traversing forward -// (decoding), and restarting from the top upon a dead end. -// -// A lookahead means noting the last branch traversed which contained a -// non-null JP lower than the one specified by a digit in *PIndex-1, and -// returning to that point for SM3Findlimit. This seems like a good idea, and -// should be pretty cheap for linear and bitmap branches, but it could result -// in up to 31 unnecessary additional cache line fills (in extreme cases) for -// every uncompressed branch traversed. We have considered means of attaching -// to or hiding within an uncompressed branch (in null JPs) a "cache line map" -// or other structure, such as an offset to the next non-null JP, that would -// speed this up, but it seems unnecessary merely to avoid having a -// finite-length list (array). (If JudySL is ever made "native", the finite -// list length will be an issue.) -// -// Restarting at the top of the Judy array after a dead end requires a careful -// modification of *PIndex-1 to decrement the digit for the parent branch and -// set the remaining lower digits to all 1s. This must be repeated each time a -// parent branch contains another dead end, so even though it should all happen -// in cache, the CPU time can be excessive. (For JudySL or an equivalent -// "infinitely deep" Judy array, consider a hybrid of a large, finite, -// "circular" list and a restart-at-top when the list is backtracked to -// exhaustion.) -// -// Why search for *PIndex-1 instead of *PIndex during SM1Get? In rare -// instances this prevents an unnecessary decode down the wrong path followed -// by a backtrack; its pretty cheap to set up initially; and it means the -// SM1Get machine can simply return if/when it finds that Index. -// -// TBD: Wed like to enhance this function to make successive searches faster. -// This would require saving some previous state, including the previous Index -// returned, and in which leaf it was found. If the next call is for the same -// Index and the array has not been modified, start at the same leaf. This -// should be much easier to implement since this is iterative rather than -// recursive code. -// -// VARIATIONS FOR Judy*Next(): -// -// The Judy*Next() code is nearly a perfect mirror of the Judy*Prev() code. -// See the Judy*Prev() overview comments, and mentally switch the following: -// -// - "*PIndex-1" => "*PIndex+1" -// - "less than" => "greater than" -// - "lower" => "higher" -// - "lowest" => "highest" -// - "next-left" => "next-right" -// - "right-most" => "left-most" -// -// Note: SM3Findlimit could be called SM3Findmax/SM3Findmin, but a common name -// for both Prev and Next means many fewer ifdefs in this code. -// -// TBD: Currently this code traverses a JP whether its expanse is partially or -// completely full (populated). For Judy1 (only), since there is no value area -// needed, consider shortcutting to a "success" return upon encountering a full -// JP in SM1Get (or even SM3Findlimit?) A full JP looks like this: -// -// (((JU_JPDCDPOP0(Pjp) ^ cJU_ALLONES) & cJU_POP0MASK(cLevel)) == 0) - -#ifdef JUDY1 -#ifdef JUDYPREV -FUNCTION int Judy1Prev -#else -FUNCTION int Judy1Next -#endif -#else -#ifdef JUDYPREV -FUNCTION PPvoid_t JudyLPrev -#else -FUNCTION PPvoid_t JudyLNext -#endif -#endif - ( - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError // optional, for returning error info. - ) -{ - Pjp_t Pjp, Pjp2; // current JPs. - Pjbl_t Pjbl; // Pjp->jp_Addr masked and cast to types: - Pjbb_t Pjbb; - Pjbu_t Pjbu; - -// Note: The following initialization is not strictly required but it makes -// gcc -Wall happy because there is an "impossible" path from Immed handling to -// SM1LeafLImm code that looks like Pjll might be used before set: - - Pjll_t Pjll = (Pjll_t) NULL; - Word_t state; // current state in SM. - Word_t digit; // next digit to decode from Index. - -// Note: The following initialization is not strictly required but it makes -// gcc -Wall happy because there is an "impossible" path from Immed handling to -// SM1LeafLImm code (for JudyL & JudyPrev only) that looks like pop1 might be -// used before set: - -#if (defined(JUDYL) && defined(JUDYPREV)) - Word_t pop1 = 0; // in a leaf. -#else - Word_t pop1; // in a leaf. -#endif - int offset; // linear branch/leaf, from j__udySearchLeaf*(). - int subexp; // subexpanse in a bitmap branch. - Word_t bitposmask; // bit in bitmap for Index. - -// History for SM2Backtrack: -// -// For a given histnum, APjphist[histnum] is a parent JP that points to a -// branch, and Aoffhist[histnum] is the offset of the NEXT JP in the branch to -// which the parent JP points. The meaning of Aoffhist[histnum] depends on the -// type of branch to which the parent JP points: -// -// Linear: Offset of the next JP in the JP list. -// -// Bitmap: Which subexpanse, plus the offset of the next JP in the -// subexpanses JP list (to avoid bit-counting again), plus for Judy*Next(), -// hidden one byte to the left, which digit, because Judy*Next() also needs -// this. -// -// Uncompressed: Digit, which is actually the offset of the JP in the branch. -// -// Note: Only branch JPs are stored in APjphist[] because, as explained -// earlier, SM1Get shortcuts sideways searches in leaves (and even in branches -// in some cases), so SM2Backtrack only handles branches. - -#define HISTNUMMAX cJU_ROOTSTATE // maximum branches traversable. - Pjp_t APjphist[HISTNUMMAX]; // list of branch JPs traversed. - int Aoffhist[HISTNUMMAX]; // list of next JP offsets; see above. - int histnum = 0; // number of JPs now in list. - - -// ---------------------------------------------------------------------------- -// M A C R O S -// -// These are intended to make the code a bit more readable and less redundant. - - -// "PUSH" AND "POP" Pjp AND offset ON HISTORY STACKS: -// -// Note: Ensure a corrupt Judy array does not overflow *hist[]. Meanwhile, -// underflowing *hist[] simply means theres no more room to backtrack => -// "no previous/next Index". - -#define HISTPUSH(Pjp,Offset) \ - APjphist[histnum] = (Pjp); \ - Aoffhist[histnum] = (Offset); \ - \ - if (++histnum >= HISTNUMMAX) \ - { \ - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT) \ - JUDY1CODE(return(JERRI );) \ - JUDYLCODE(return(PPJERR);) \ - } - -#define HISTPOP(Pjp,Offset) \ - if ((histnum--) < 1) JU_RET_NOTFOUND; \ - (Pjp) = APjphist[histnum]; \ - (Offset) = Aoffhist[histnum] - -// How to pack/unpack Aoffhist[] values for bitmap branches: - -#ifdef JUDYPREV - -#define HISTPUSHBOFF(Subexp,Offset,Digit) \ - (((Subexp) * cJU_BITSPERSUBEXPB) | (Offset)) - -#define HISTPOPBOFF(Subexp,Offset,Digit) \ - (Subexp) = (Offset) / cJU_BITSPERSUBEXPB; \ - (Offset) %= cJU_BITSPERSUBEXPB -#else - -#define HISTPUSHBOFF(Subexp,Offset,Digit) \ - (((Digit) << cJU_BITSPERBYTE) \ - | ((Subexp) * cJU_BITSPERSUBEXPB) | (Offset)) - -#define HISTPOPBOFF(Subexp,Offset,Digit) \ - (Digit) = (Offset) >> cJU_BITSPERBYTE; \ - (Subexp) = ((Offset) & JU_LEASTBYTESMASK(1)) / cJU_BITSPERSUBEXPB; \ - (Offset) %= cJU_BITSPERSUBEXPB -#endif - - -// CHECK FOR NULL JP: - -#define JPNULL(Type) (((Type) >= cJU_JPNULL1) && ((Type) <= cJU_JPNULLMAX)) - - -// SEARCH A BITMAP: -// -// This is a weak analog of j__udySearchLeaf*() for bitmaps. Return the actual -// or next-left position, base 0, of Digit in the single uint32_t bitmap, also -// given a Bitposmask for Digit. -// -// Unlike j__udySearchLeaf*(), the offset is not returned bit-complemented if -// Digits bit is unset, because the caller can check the bitmap themselves to -// determine that. Also, if Digits bit is unset, the returned offset is to -// the next-left JP (including -1), not to the "ideal" position for the Index = -// next-right JP. -// -// Shortcut and skip calling j__udyCountBits*() if the bitmap is full, in which -// case (Digit % cJU_BITSPERSUBEXP*) itself is the base-0 offset. -// -// TBD for Judy*Next(): Should this return next-right instead of next-left? -// That is, +1 from current value? Maybe not, if Digits bit IS set, +1 would -// be wrong. - -#define SEARCHBITMAPB(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPB) ? (Digit % cJU_BITSPERSUBEXPB) : \ - j__udyCountBitsB((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#define SEARCHBITMAPL(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPL) ? (Digit % cJU_BITSPERSUBEXPL) : \ - j__udyCountBitsL((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#ifdef JUDYPREV -// Equivalent to search for the highest offset in Bitmap: - -#define SEARCHBITMAPMAXB(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPB) ? cJU_BITSPERSUBEXPB - 1 : \ - j__udyCountBitsB(Bitmap) - 1) - -#define SEARCHBITMAPMAXL(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPL) ? cJU_BITSPERSUBEXPL - 1 : \ - j__udyCountBitsL(Bitmap) - 1) -#endif - - -// CHECK DECODE BYTES: -// -// Check Decode bytes in a JP against the equivalent portion of *PIndex. If -// *PIndex is lower (for Judy*Prev()) or higher (for Judy*Next()), this JP is a -// dead end (the same as if it had been absent in a linear or bitmap branch or -// null in an uncompressed branch), enter SM2Backtrack; otherwise enter -// SM3Findlimit to find the highest/lowest Index under this JP, as if the code -// had already backtracked to this JP. - -#ifdef JUDYPREV -#define CDcmp__ < -#else -#define CDcmp__ > -#endif - -#define CHECKDCD(cState) \ - if (JU_DCDNOTMATCHINDEX(*PIndex, Pjp, cState)) \ - { \ - if ((*PIndex & cJU_DCDMASK(cState)) \ - CDcmp__(JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(cState))) \ - { \ - goto SM2Backtrack; \ - } \ - goto SM3Findlimit; \ - } - - -// PREPARE TO HANDLE A LEAFW OR JRP BRANCH IN SM1: -// -// Extract a state-dependent digit from Index in a "constant" way, then jump to -// common code for multiple cases. - -#define SM1PREPB(cState,Next) \ - state = (cState); \ - digit = JU_DIGITATSTATE(*PIndex, cState); \ - goto Next - - -// PREPARE TO HANDLE A LEAFW OR JRP BRANCH IN SM3: -// -// Optionally save Dcd bytes into *PIndex, then save state and jump to common -// code for multiple cases. - -#define SM3PREPB_DCD(cState,Next) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - SM3PREPB(cState,Next) - -#define SM3PREPB(cState,Next) state = (cState); goto Next - - -// ---------------------------------------------------------------------------- -// CHECK FOR SHORTCUTS: -// -// Error out if PIndex is null. Execute JU_RET_NOTFOUND if the Judy array is -// empty or *PIndex is already the minimum/maximum Index possible. -// -// Note: As documented, in case of failure *PIndex may be modified. - - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -#ifdef JUDYPREV - if ((PArray == (Pvoid_t) NULL) || ((*PIndex)-- == 0)) -#else - if ((PArray == (Pvoid_t) NULL) || ((*PIndex)++ == cJU_ALLONES)) -#endif - JU_RET_NOTFOUND; - - -// HANDLE JRP: -// -// Before even entering SM1Get, check the JRP type. For JRP branches, traverse -// the JPM; handle LEAFW leaves directly; but look for the most common cases -// first. - -// ROOT-STATE LEAF that starts with a Pop0 word; just look within the leaf: -// -// If *PIndex is in the leaf, return it; otherwise return the Index, if any, -// below where it would belong. - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - pop1 = Pjlw[0] + 1; - - if ((offset = j__udySearchLeafW(Pjlw + 1, pop1, *PIndex)) - >= 0) // Index is present. - { - assert(offset < pop1); // in expected range. - JU_RET_FOUND_LEAFW(Pjlw, pop1, offset); // *PIndex is set. - } - -#ifdef JUDYPREV - if ((offset = ~offset) == 0) // no next-left Index. -#else - if ((offset = ~offset) >= pop1) // no next-right Index. -#endif - JU_RET_NOTFOUND; - - assert(offset <= pop1); // valid result. - -#ifdef JUDYPREV - *PIndex = Pjlw[offset--]; // next-left Index, base 1. -#else - *PIndex = Pjlw[offset + 1]; // next-right Index, base 1. -#endif - JU_RET_FOUND_LEAFW(Pjlw, pop1, offset); // base 0. - - } - else // JRP BRANCH - { - Pjpm_t Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); - -// goto SM1Get; - } - -// ============================================================================ -// STATE MACHINE 1 -- GET INDEX: -// -// Search for *PIndex (already decremented/incremented so as to be inclusive). -// If found, return it. Otherwise in theory hand off to SM2Backtrack or -// SM3Findlimit, but in practice "shortcut" by first sideways searching the -// current branch or leaf upon hitting a dead end. During sideways search, -// modify *PIndex to a new path taken. -// -// ENTRY: Pjp points to next JP to interpret, whose Decode bytes have not yet -// been checked. This JP is not yet listed in history. -// -// Note: Check Decode bytes at the start of each loop, not after looking up a -// new JP, so its easy to do constant shifts/masks, although this requires -// cautious handling of Pjp, offset, and *hist[] for correct entry to -// SM2Backtrack. -// -// EXIT: Return, or branch to SM2Backtrack or SM3Findlimit with correct -// interface, as described elsewhere. -// -// WARNING: For run-time efficiency the following cases replicate code with -// varying constants, rather than using common code with variable values! - -SM1Get: // return here for next branch/leaf. - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_L2: CHECKDCD(2); SM1PREPB(2, SM1BranchL); - case cJU_JPBRANCH_L3: CHECKDCD(3); SM1PREPB(3, SM1BranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: CHECKDCD(4); SM1PREPB(4, SM1BranchL); - case cJU_JPBRANCH_L5: CHECKDCD(5); SM1PREPB(5, SM1BranchL); - case cJU_JPBRANCH_L6: CHECKDCD(6); SM1PREPB(6, SM1BranchL); - case cJU_JPBRANCH_L7: CHECKDCD(7); SM1PREPB(7, SM1BranchL); -#endif - case cJU_JPBRANCH_L: SM1PREPB(cJU_ROOTSTATE, SM1BranchL); - -// Common code (state-independent) for all cases of linear branches: - -SM1BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -// Found JP matching current digit in *PIndex; record parent JP and the next -// JPs offset, and iterate to the next JP: - - if ((offset = j__udySearchLeaf1((Pjll_t) (Pjbl->jbl_Expanse), - Pjbl->jbl_NumJPs, digit)) >= 0) - { - HISTPUSH(Pjp, offset); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM1Get; - } - -// Dead end, no JP in BranchL for next digit in *PIndex: -// -// Get the ideal location of digits JP, and if theres no next-left/right JP -// in the BranchL, shortcut and start backtracking one level up; ignore the -// current Pjp because it points to a BranchL with no next-left/right JP. - -#ifdef JUDYPREV - if ((offset = (~offset) - 1) < 0) // no next-left JP in BranchL. -#else - if ((offset = (~offset)) >= Pjbl->jbl_NumJPs) // no next-right. -#endif - goto SM2Backtrack; - -// Theres a next-left/right JP in the current BranchL; save its digit in -// *PIndex and shortcut to SM3Findlimit: - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Check Decode bytes, if any, in the current JP, then look for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_B2: CHECKDCD(2); SM1PREPB(2, SM1BranchB); - case cJU_JPBRANCH_B3: CHECKDCD(3); SM1PREPB(3, SM1BranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: CHECKDCD(4); SM1PREPB(4, SM1BranchB); - case cJU_JPBRANCH_B5: CHECKDCD(5); SM1PREPB(5, SM1BranchB); - case cJU_JPBRANCH_B6: CHECKDCD(6); SM1PREPB(6, SM1BranchB); - case cJU_JPBRANCH_B7: CHECKDCD(7); SM1PREPB(7, SM1BranchB); -#endif - case cJU_JPBRANCH_B: SM1PREPB(cJU_ROOTSTATE, SM1BranchB); - -// Common code (state-independent) for all cases of bitmap branches: - -SM1BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - -// Locate the digits JP in the subexpanse list, if present, otherwise the -// offset of the next-left JP, if any: - - subexp = digit / cJU_BITSPERSUBEXPB; - assert(subexp < cJU_NUMSUBEXPB); // falls in expected range. - bitposmask = JU_BITPOSMASKB(digit); - offset = SEARCHBITMAPB(JU_JBB_BITMAP(Pjbb, subexp), digit, - bitposmask); - // right range: - assert((offset >= -1) && (offset < (int) cJU_BITSPERSUBEXPB)); - -// Found JP matching current digit in *PIndex: -// -// Record the parent JP and the next JPs offset; and iterate to the next JP. - -// if (JU_BITMAPTESTB(Pjbb, digit)) // slower. - if (JU_JBB_BITMAP(Pjbb, subexp) & bitposmask) // faster. - { - // not negative since at least one bit is set: - assert(offset >= 0); - - HISTPUSH(Pjp, HISTPUSHBOFF(subexp, offset, digit)); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM1Get; // iterate to next JP. - } - -// Dead end, no JP in BranchB for next digit in *PIndex: -// -// If theres a next-left/right JP in the current BranchB, shortcut to -// SM3Findlimit. Note: offset is already set to the correct value for the -// next-left/right JP. - -#ifdef JUDYPREV - if (offset >= 0) // next-left JP is in this subexpanse. - goto SM1BranchBFindlimit; - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JBB_BITMAP(Pjbb, subexp) & JU_MASKHIGHEREXC(bitposmask)) - { - ++offset; // next-left => next-right. - goto SM1BranchBFindlimit; - } - - while (++subexp < cJU_NUMSUBEXPB) // search next-right subexps. -#endif - { - if (! JU_JBB_PJP(Pjbb, subexp)) continue; // empty subexpanse. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - offset = 0; -#endif - -// Save the next-left/right JPs digit in *PIndex: - -SM1BranchBFindlimit: - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), - offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchB: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a BranchB with no next-left/right JP. - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Check Decode bytes, if any, in the current JP, then look for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_U2: CHECKDCD(2); SM1PREPB(2, SM1BranchU); - case cJU_JPBRANCH_U3: CHECKDCD(3); SM1PREPB(3, SM1BranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: CHECKDCD(4); SM1PREPB(4, SM1BranchU); - case cJU_JPBRANCH_U5: CHECKDCD(5); SM1PREPB(5, SM1BranchU); - case cJU_JPBRANCH_U6: CHECKDCD(6); SM1PREPB(6, SM1BranchU); - case cJU_JPBRANCH_U7: CHECKDCD(7); SM1PREPB(7, SM1BranchU); -#endif - case cJU_JPBRANCH_U: SM1PREPB(cJU_ROOTSTATE, SM1BranchU); - -// Common code (state-independent) for all cases of uncompressed branches: - -SM1BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - Pjp2 = (Pjbu->jbu_jp) + digit; - -// Found JP matching current digit in *PIndex: -// -// Record the parent JP and the next JPs digit, and iterate to the next JP. -// -// TBD: Instead of this, just goto SM1Get, and add cJU_JPNULL* cases to the -// SM1Get state machine? Then backtrack? However, it means you cant detect -// an inappropriate cJU_JPNULL*, when it occurs in other than a BranchU, and -// return JU_RET_CORRUPT. - - if (! JPNULL(JU_JPTYPE(Pjp2))) // digit has a JP. - { - HISTPUSH(Pjp, digit); - Pjp = Pjp2; - goto SM1Get; - } - -// Dead end, no JP in BranchU for next digit in *PIndex: -// -// Search for a next-left/right JP in the current BranchU, and if one is found, -// save its digit in *PIndex and shortcut to SM3Findlimit: - -#ifdef JUDYPREV - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - while (digit < cJU_BRANCHUNUMJPS - 1) - { - Pjp = (Pjbu->jbu_jp) + (++digit); -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchU: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a BranchU with no next-left/right JP. - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for -// *PIndex. - -#define SM1LEAFL(Func) \ - Pjll = P_JLL(Pjp->jp_Addr); \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - offset = Func(Pjll, pop1, *PIndex); \ - goto SM1LeafLImm - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKDCD(1); SM1LEAFL(j__udySearchLeaf1); -#endif - case cJU_JPLEAF2: CHECKDCD(2); SM1LEAFL(j__udySearchLeaf2); - case cJU_JPLEAF3: CHECKDCD(3); SM1LEAFL(j__udySearchLeaf3); - -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKDCD(4); SM1LEAFL(j__udySearchLeaf4); - case cJU_JPLEAF5: CHECKDCD(5); SM1LEAFL(j__udySearchLeaf5); - case cJU_JPLEAF6: CHECKDCD(6); SM1LEAFL(j__udySearchLeaf6); - case cJU_JPLEAF7: CHECKDCD(7); SM1LEAFL(j__udySearchLeaf7); -#endif - -// Common code (state-independent) for all cases of linear leaves and -// immediates: - -SM1LeafLImm: - if (offset >= 0) // *PIndex is in LeafL / Immed. -#ifdef JUDY1 - JU_RET_FOUND; -#else - { // JudyL is trickier... - switch (JU_JPTYPE(Pjp)) - { -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - case cJU_JPLEAF2: JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - case cJU_JPLEAF3: JU_RET_FOUND_LEAF3(Pjll, pop1, offset); -#ifdef JU_64BIT - case cJU_JPLEAF4: JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - case cJU_JPLEAF5: JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - case cJU_JPLEAF6: JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - case cJU_JPLEAF7: JU_RET_FOUND_LEAF7(Pjll, pop1, offset); -#endif - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - JU_RET_FOUND_IMM_01(Pjp); - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#ifdef JU_64BIT - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: - case cJU_JPIMMED_3_02: -#endif - JU_RET_FOUND_IMM(Pjp, offset); - } - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // impossible? - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // found *PIndex - -#endif // JUDYL - -// Dead end, no Index in LeafL / Immed for remaining digit(s) in *PIndex: -// -// Get the ideal location of Index, and if theres no next-left/right Index in -// the LeafL / Immed, shortcut and start backtracking one level up; ignore the -// current Pjp because it points to a LeafL / Immed with no next-left/right -// Index. - -#ifdef JUDYPREV - if ((offset = (~offset) - 1) < 0) // no next-left Index. -#else - if ((offset = (~offset)) >= pop1) // no next-right Index. -#endif - goto SM2Backtrack; - -// Theres a next-left/right Index in the current LeafL / Immed; shortcut by -// copying its digit(s) to *PIndex and returning it. -// -// Unfortunately this is pretty hairy, especially avoiding endian issues. -// -// The cJU_JPLEAF* cases are very similar to same-index-size cJU_JPIMMED* cases -// for *_02 and above, but must return differently, at least for JudyL, so -// spell them out separately here at the cost of a little redundant code for -// Judy1. - - switch (JU_JPTYPE(Pjp)) - { -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]); - JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - - case cJU_JPLEAF2: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - - case cJU_JPLEAF3: - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - -#ifdef JU_64BIT - case cJU_JPLEAF4: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - - case cJU_JPLEAF5: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - } - - case cJU_JPLEAF6: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - } - - case cJU_JPLEAF7: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_LEAF7(Pjll, pop1, offset); - } - -#endif // JU_64BIT - -#define SET_01(cState) JU_SETDIGITS(*PIndex, JU_JPDCDPOP0(Pjp), cState) - - case cJU_JPIMMED_1_01: SET_01(1); goto SM1Imm_01; - case cJU_JPIMMED_2_01: SET_01(2); goto SM1Imm_01; - case cJU_JPIMMED_3_01: SET_01(3); goto SM1Imm_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: SET_01(4); goto SM1Imm_01; - case cJU_JPIMMED_5_01: SET_01(5); goto SM1Imm_01; - case cJU_JPIMMED_6_01: SET_01(6); goto SM1Imm_01; - case cJU_JPIMMED_7_01: SET_01(7); goto SM1Imm_01; -#endif -SM1Imm_01: JU_RET_FOUND_IMM_01(Pjp); - -// Shorthand for where to find start of Index bytes array: - -#ifdef JUDY1 -#define PJI (Pjp->jp_1Index) -#else -#define PJI (Pjp->jp_LIndex) -#endif - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]); - JU_RET_FOUND_IMM(Pjp, offset); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: - case cJ1_JPIMMED_4_03: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); - - case cJ1_JPIMMED_5_02: - case cJ1_JPIMMED_5_03: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_6_02: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_7_02: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - -#endif // (JUDY1 && JU_64BIT) - - } // switch for not-found *PIndex - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // impossible? - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Check Decode bytes, if any, in the current JP, then look in the leaf for -// *PIndex. - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; - CHECKDCD(1); - - Pjlb = P_JLB(Pjp->jp_Addr); - digit = JU_DIGITATSTATE(*PIndex, 1); - subexp = JU_SUBEXPL(digit); - bitposmask = JU_BITPOSMASKL(digit); - assert(subexp < cJU_NUMSUBEXPL); // falls in expected range. - -// *PIndex exists in LeafB1: - -// if (JU_BITMAPTESTL(Pjlb, digit)) // slower. - if (JU_JLB_BITMAP(Pjlb, subexp) & bitposmask) // faster. - { -#ifdef JUDYL // needs offset at this point: - offset = SEARCHBITMAPL(JU_JLB_BITMAP(Pjlb, subexp), digit, bitposmask); -#endif - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - } - -// Dead end, no Index in LeafB1 for remaining digit in *PIndex: -// -// If theres a next-left/right Index in the current LeafB1, which for -// Judy*Next() is true if any bits are set for higher Indexes, shortcut by -// returning it. Note: For Judy*Prev(), offset is set here to the correct -// value for the next-left JP. - - offset = SEARCHBITMAPL(JU_JLB_BITMAP(Pjlb, subexp), digit, - bitposmask); - // right range: - assert((offset >= -1) && (offset < (int) cJU_BITSPERSUBEXPL)); - -#ifdef JUDYPREV - if (offset >= 0) // next-left JP is in this subexpanse. - goto SM1LeafB1Findlimit; - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JLB_BITMAP(Pjlb, subexp) & JU_MASKHIGHEREXC(bitposmask)) - { - ++offset; // next-left => next-right. - goto SM1LeafB1Findlimit; - } - - while (++subexp < cJU_NUMSUBEXPL) // search next-right subexps. -#endif - { - if (! JU_JLB_BITMAP(Pjlb, subexp)) continue; // empty subexp. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXL(JU_JLB_BITMAP(Pjlb, subexp)); - // expected range: - assert((offset >= 0) && (offset < (int) cJU_BITSPERSUBEXPL)); -#else - offset = 0; -#endif - -// Save the next-left/right Indexess digit in *PIndex: - -SM1LeafB1Findlimit: - JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset); - JU_SETDIGIT1(*PIndex, digit); - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - } - -// Theres no next-left/right Index in the LeafB1: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a LeafB1 with no next-left/right Index. - - goto SM2Backtrack; - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// If the Decode bytes match, *PIndex is found (without modification). - - case cJ1_JPFULLPOPU1: - - CHECKDCD(1); - JU_RET_FOUND_FULLPOPU1; -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: - -#ifdef JUDYPREV -#define SM1IMM_SETPOP1(cPop1) -#else -#define SM1IMM_SETPOP1(cPop1) pop1 = (cPop1) -#endif - -#define SM1IMM(Func,cPop1) \ - SM1IMM_SETPOP1(cPop1); \ - offset = Func((Pjll_t) (PJI), cPop1, *PIndex); \ - goto SM1LeafLImm - -// Special case for Pop1 = 1 Immediate JPs: -// -// If *PIndex is in the immediate, offset is 0, otherwise the binary NOT of the -// offset where it belongs, 0 or 1, same as from the search functions. - -#ifdef JUDYPREV -#define SM1IMM_01_SETPOP1 -#else -#define SM1IMM_01_SETPOP1 pop1 = 1 -#endif - -#define SM1IMM_01 \ - SM1IMM_01_SETPOP1; \ - offset = ((JU_JPDCDPOP0(Pjp) < JU_TRIMTODCDSIZE(*PIndex)) ? ~1 : \ - (JU_JPDCDPOP0(Pjp) == JU_TRIMTODCDSIZE(*PIndex)) ? 0 : \ - ~0); \ - goto SM1LeafLImm - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - SM1IMM_01; - -// TBD: Doug says it would be OK to have fewer calls and calculate arg 2, here -// and in Judy*Count() also. - - case cJU_JPIMMED_1_02: SM1IMM(j__udySearchLeaf1, 2); - case cJU_JPIMMED_1_03: SM1IMM(j__udySearchLeaf1, 3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: SM1IMM(j__udySearchLeaf1, 4); - case cJU_JPIMMED_1_05: SM1IMM(j__udySearchLeaf1, 5); - case cJU_JPIMMED_1_06: SM1IMM(j__udySearchLeaf1, 6); - case cJU_JPIMMED_1_07: SM1IMM(j__udySearchLeaf1, 7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: SM1IMM(j__udySearchLeaf1, 8); - case cJ1_JPIMMED_1_09: SM1IMM(j__udySearchLeaf1, 9); - case cJ1_JPIMMED_1_10: SM1IMM(j__udySearchLeaf1, 10); - case cJ1_JPIMMED_1_11: SM1IMM(j__udySearchLeaf1, 11); - case cJ1_JPIMMED_1_12: SM1IMM(j__udySearchLeaf1, 12); - case cJ1_JPIMMED_1_13: SM1IMM(j__udySearchLeaf1, 13); - case cJ1_JPIMMED_1_14: SM1IMM(j__udySearchLeaf1, 14); - case cJ1_JPIMMED_1_15: SM1IMM(j__udySearchLeaf1, 15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: SM1IMM(j__udySearchLeaf2, 2); - case cJU_JPIMMED_2_03: SM1IMM(j__udySearchLeaf2, 3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: SM1IMM(j__udySearchLeaf2, 4); - case cJ1_JPIMMED_2_05: SM1IMM(j__udySearchLeaf2, 5); - case cJ1_JPIMMED_2_06: SM1IMM(j__udySearchLeaf2, 6); - case cJ1_JPIMMED_2_07: SM1IMM(j__udySearchLeaf2, 7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: SM1IMM(j__udySearchLeaf3, 2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: SM1IMM(j__udySearchLeaf3, 3); - case cJ1_JPIMMED_3_04: SM1IMM(j__udySearchLeaf3, 4); - case cJ1_JPIMMED_3_05: SM1IMM(j__udySearchLeaf3, 5); - - case cJ1_JPIMMED_4_02: SM1IMM(j__udySearchLeaf4, 2); - case cJ1_JPIMMED_4_03: SM1IMM(j__udySearchLeaf4, 3); - - case cJ1_JPIMMED_5_02: SM1IMM(j__udySearchLeaf5, 2); - case cJ1_JPIMMED_5_03: SM1IMM(j__udySearchLeaf5, 3); - - case cJ1_JPIMMED_6_02: SM1IMM(j__udySearchLeaf6, 2); - - case cJ1_JPIMMED_7_02: SM1IMM(j__udySearchLeaf7, 2); -#endif - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM1Get switch. - - /*NOTREACHED*/ - - -// ============================================================================ -// STATE MACHINE 2 -- BACKTRACK BRANCH TO PREVIOUS JP: -// -// Look for the next-left/right JP in a branch, backing up the history list as -// necessary. Upon finding a next-left/right JP, modify the corresponding -// digit in *PIndex before passing control to SM3Findlimit. -// -// Note: As described earlier, only branch JPs are expected here; other types -// fall into the default case. -// -// Note: If a found JP contains needed Dcd bytes, thats OK, theyre copied to -// *PIndex in SM3Findlimit. -// -// TBD: This code has a lot in common with similar code in the shortcut cases -// in SM1Get. Can combine this code somehow? -// -// ENTRY: List, possibly empty, of JPs and offsets in APjphist[] and -// Aoffhist[]; see earlier comments. -// -// EXIT: Execute JU_RET_NOTFOUND if no previous/next JP; otherwise jump to -// SM3Findlimit to resume a new but different downward search. - -SM2Backtrack: // come or return here for first/next sideways search. - - HISTPOP(Pjp, offset); - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: - - case cJU_JPBRANCH_L2: state = 2; goto SM2BranchL; - case cJU_JPBRANCH_L3: state = 3; goto SM2BranchL; -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: state = 4; goto SM2BranchL; - case cJU_JPBRANCH_L5: state = 5; goto SM2BranchL; - case cJU_JPBRANCH_L6: state = 6; goto SM2BranchL; - case cJU_JPBRANCH_L7: state = 7; goto SM2BranchL; -#endif - case cJU_JPBRANCH_L: state = cJU_ROOTSTATE; goto SM2BranchL; - -SM2BranchL: -#ifdef JUDYPREV - if (--offset < 0) goto SM2Backtrack; // no next-left JP in BranchL. -#endif - Pjbl = P_JBL(Pjp->jp_Addr); -#ifdef JUDYNEXT - if (++offset >= (Pjbl->jbl_NumJPs)) goto SM2Backtrack; - // no next-right JP in BranchL. -#endif - -// Theres a next-left/right JP in the current BranchL; save its digit in -// *PIndex and continue with SM3Findlimit: - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: - - case cJU_JPBRANCH_B2: state = 2; goto SM2BranchB; - case cJU_JPBRANCH_B3: state = 3; goto SM2BranchB; -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: state = 4; goto SM2BranchB; - case cJU_JPBRANCH_B5: state = 5; goto SM2BranchB; - case cJU_JPBRANCH_B6: state = 6; goto SM2BranchB; - case cJU_JPBRANCH_B7: state = 7; goto SM2BranchB; -#endif - case cJU_JPBRANCH_B: state = cJU_ROOTSTATE; goto SM2BranchB; - -SM2BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - HISTPOPBOFF(subexp, offset, digit); // unpack values. - -// If theres a next-left/right JP in the current BranchB, which for -// Judy*Next() is true if any bits are set for higher Indexes, continue to -// SM3Findlimit: -// -// Note: offset is set to the JP previously traversed; go one to the -// left/right. - -#ifdef JUDYPREV - if (offset > 0) // next-left JP is in this subexpanse. - { - --offset; - goto SM2BranchBFindlimit; - } - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JBB_BITMAP(Pjbb, subexp) - & JU_MASKHIGHEREXC(JU_BITPOSMASKB(digit))) - { - ++offset; // next-left => next-right. - goto SM2BranchBFindlimit; - } - - while (++subexp < cJU_NUMSUBEXPB) // search next-right subexps. -#endif - { - if (! JU_JBB_PJP(Pjbb, subexp)) continue; // empty subexpanse. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - offset = 0; -#endif - -// Save the next-left/right JPs digit in *PIndex: - -SM2BranchBFindlimit: - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), - offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchB: - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: - - case cJU_JPBRANCH_U2: state = 2; goto SM2BranchU; - case cJU_JPBRANCH_U3: state = 3; goto SM2BranchU; -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: state = 4; goto SM2BranchU; - case cJU_JPBRANCH_U5: state = 5; goto SM2BranchU; - case cJU_JPBRANCH_U6: state = 6; goto SM2BranchU; - case cJU_JPBRANCH_U7: state = 7; goto SM2BranchU; -#endif - case cJU_JPBRANCH_U: state = cJU_ROOTSTATE; goto SM2BranchU; - -SM2BranchU: - -// Search for a next-left/right JP in the current BranchU, and if one is found, -// save its digit in *PIndex and continue to SM3Findlimit: - - Pjbu = P_JBU(Pjp->jp_Addr); - digit = offset; - -#ifdef JUDYPREV - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - while (digit < cJU_BRANCHUNUMJPS - 1) - { - Pjp = (Pjbu->jbu_jp) + (++digit); -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchU: - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM2Backtrack switch. - - /*NOTREACHED*/ - - -// ============================================================================ -// STATE MACHINE 3 -- FIND LIMIT JP/INDEX: -// -// Look for the highest/lowest (right/left-most) JP in each branch and the -// highest/lowest Index in a leaf or immediate, and return it. While -// traversing, modify appropriate digit(s) in *PIndex to reflect the path -// taken, including Dcd bytes in each JP (which could hold critical missing -// digits for skipped branches). -// -// ENTRY: Pjp set to a JP under which to find max/min JPs (if a branch JP) or -// a max/min Index and return (if a leaf or immediate JP). -// -// EXIT: Execute JU_RET_FOUND* upon reaching a leaf or immediate. Should be -// impossible to fail, unless the Judy array is corrupt. - -SM3Findlimit: // come or return here for first/next branch/leaf. - - switch (JU_JPTYPE(Pjp)) - { -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Simply use the highest/lowest (right/left-most) JP in the BranchL, but first -// copy the Dcd bytes to *PIndex if there are any (only if state < -// cJU_ROOTSTATE - 1). - - case cJU_JPBRANCH_L2: SM3PREPB_DCD(2, SM3BranchL); -#ifndef JU_64BIT - case cJU_JPBRANCH_L3: SM3PREPB( 3, SM3BranchL); -#else - case cJU_JPBRANCH_L3: SM3PREPB_DCD(3, SM3BranchL); - case cJU_JPBRANCH_L4: SM3PREPB_DCD(4, SM3BranchL); - case cJU_JPBRANCH_L5: SM3PREPB_DCD(5, SM3BranchL); - case cJU_JPBRANCH_L6: SM3PREPB_DCD(6, SM3BranchL); - case cJU_JPBRANCH_L7: SM3PREPB( 7, SM3BranchL); -#endif - case cJU_JPBRANCH_L: SM3PREPB( cJU_ROOTSTATE, SM3BranchL); - -SM3BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -#ifdef JUDYPREV - if ((offset = (Pjbl->jbl_NumJPs) - 1) < 0) -#else - offset = 0; if ((Pjbl->jbl_NumJPs) == 0) -#endif - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Look for the highest/lowest (right/left-most) non-null subexpanse, then use -// the highest/lowest JP in that subexpanse, but first copy Dcd bytes, if there -// are any (only if state < cJU_ROOTSTATE - 1), to *PIndex. - - case cJU_JPBRANCH_B2: SM3PREPB_DCD(2, SM3BranchB); -#ifndef JU_64BIT - case cJU_JPBRANCH_B3: SM3PREPB( 3, SM3BranchB); -#else - case cJU_JPBRANCH_B3: SM3PREPB_DCD(3, SM3BranchB); - case cJU_JPBRANCH_B4: SM3PREPB_DCD(4, SM3BranchB); - case cJU_JPBRANCH_B5: SM3PREPB_DCD(5, SM3BranchB); - case cJU_JPBRANCH_B6: SM3PREPB_DCD(6, SM3BranchB); - case cJU_JPBRANCH_B7: SM3PREPB( 7, SM3BranchB); -#endif - case cJU_JPBRANCH_B: SM3PREPB( cJU_ROOTSTATE, SM3BranchB); - -SM3BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); -#ifdef JUDYPREV - subexp = cJU_NUMSUBEXPB; - - while (! (JU_JBB_BITMAP(Pjbb, --subexp))) // find non-empty subexp. - { - if (subexp <= 0) // wholly empty bitmap. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - subexp = -1; - - while (! (JU_JBB_BITMAP(Pjbb, ++subexp))) // find non-empty subexp. - { - if (subexp >= cJU_NUMSUBEXPB - 1) // didnt find one. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = 0; -#endif - - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Look for the highest/lowest (right/left-most) non-null JP, and use it, but -// first copy Dcd bytes to *PIndex if there are any (only if state < -// cJU_ROOTSTATE - 1). - - case cJU_JPBRANCH_U2: SM3PREPB_DCD(2, SM3BranchU); -#ifndef JU_64BIT - case cJU_JPBRANCH_U3: SM3PREPB( 3, SM3BranchU); -#else - case cJU_JPBRANCH_U3: SM3PREPB_DCD(3, SM3BranchU); - case cJU_JPBRANCH_U4: SM3PREPB_DCD(4, SM3BranchU); - case cJU_JPBRANCH_U5: SM3PREPB_DCD(5, SM3BranchU); - case cJU_JPBRANCH_U6: SM3PREPB_DCD(6, SM3BranchU); - case cJU_JPBRANCH_U7: SM3PREPB( 7, SM3BranchU); -#endif - case cJU_JPBRANCH_U: SM3PREPB( cJU_ROOTSTATE, SM3BranchU); - -SM3BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); -#ifdef JUDYPREV - digit = cJU_BRANCHUNUMJPS; - - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - - for (digit = 0; digit < cJU_BRANCHUNUMJPS; ++digit) - { - Pjp = (Pjbu->jbu_jp) + digit; -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// No non-null JPs in BranchU: - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Simply use the highest/lowest (right/left-most) Index in the LeafL, but the -// details vary depending on leaf Index Size. First copy Dcd bytes, if there -// are any (only if state < cJU_ROOTSTATE - 1), to *PIndex. - -#define SM3LEAFLDCD(cState) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - SM3LEAFLNODCD - -#ifdef JUDY1 -#define SM3LEAFL_SETPOP1 // not needed in any cases. -#else -#define SM3LEAFL_SETPOP1 pop1 = JU_JPLEAF_POP0(Pjp) + 1 -#endif - -#ifdef JUDYPREV -#define SM3LEAFLNODCD \ - Pjll = P_JLL(Pjp->jp_Addr); \ - SM3LEAFL_SETPOP1; \ - offset = JU_JPLEAF_POP0(Pjp); assert(offset >= 0) -#else -#define SM3LEAFLNODCD \ - Pjll = P_JLL(Pjp->jp_Addr); \ - SM3LEAFL_SETPOP1; \ - offset = 0; assert(JU_JPLEAF_POP0(Pjp) >= 0); -#endif - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - SM3LEAFLDCD(1); - JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]); - JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - - case cJU_JPLEAF2: - - SM3LEAFLDCD(2); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - -#ifndef JU_64BIT - case cJU_JPLEAF3: - { - Word_t lsb; - SM3LEAFLNODCD; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - -#else - case cJU_JPLEAF3: - { - Word_t lsb; - SM3LEAFLDCD(3); - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - - case cJU_JPLEAF4: - - SM3LEAFLDCD(4); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - - case cJU_JPLEAF5: - { - Word_t lsb; - SM3LEAFLDCD(5); - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - } - - case cJU_JPLEAF6: - { - Word_t lsb; - SM3LEAFLDCD(6); - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - } - - case cJU_JPLEAF7: - { - Word_t lsb; - SM3LEAFLNODCD; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_LEAF7(Pjll, pop1, offset); - } -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Look for the highest/lowest (right/left-most) non-null subexpanse, then use -// the highest/lowest Index in that subexpanse, but first copy Dcd bytes -// (always present since state 1 < cJU_ROOTSTATE) to *PIndex. - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; - - JU_SETDCD(*PIndex, Pjp, 1); - - Pjlb = P_JLB(Pjp->jp_Addr); -#ifdef JUDYPREV - subexp = cJU_NUMSUBEXPL; - - while (! JU_JLB_BITMAP(Pjlb, --subexp)) // find non-empty subexp. - { - if (subexp <= 0) // wholly empty bitmap. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - -// TBD: Might it be faster to just use a variant of BITMAPDIGIT*() that yields -// the digit for the right-most Index with a bit set? - - offset = SEARCHBITMAPMAXL(JU_JLB_BITMAP(Pjlb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPL)); -#else - subexp = -1; - - while (! JU_JLB_BITMAP(Pjlb, ++subexp)) // find non-empty subexp. - { - if (subexp >= cJU_NUMSUBEXPL - 1) // didnt find one. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = 0; -#endif - - JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset); - JU_SETDIGIT1(*PIndex, digit); - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// Copy Dcd bytes to *PIndex (always present since state 1 < cJU_ROOTSTATE), -// then set the highest/lowest possible digit as the LSB in *PIndex. - - case cJ1_JPFULLPOPU1: - - JU_SETDCD( *PIndex, Pjp, 1); -#ifdef JUDYPREV - JU_SETDIGIT1(*PIndex, cJU_BITSPERBITMAP - 1); -#else - JU_SETDIGIT1(*PIndex, 0); -#endif - JU_RET_FOUND_FULLPOPU1; -#endif // JUDY1 - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: -// -// Simply use the highest/lowest (right/left-most) Index in the Imm, but the -// details vary depending on leaf Index Size and pop1. Note: There are no Dcd -// bytes in an Immediate JP, but in a cJU_JPIMMED_*_01 JP, the field holds the -// least bytes of the immediate Index. - - case cJU_JPIMMED_1_01: SET_01(1); goto SM3Imm_01; - case cJU_JPIMMED_2_01: SET_01(2); goto SM3Imm_01; - case cJU_JPIMMED_3_01: SET_01(3); goto SM3Imm_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: SET_01(4); goto SM3Imm_01; - case cJU_JPIMMED_5_01: SET_01(5); goto SM3Imm_01; - case cJU_JPIMMED_6_01: SET_01(6); goto SM3Imm_01; - case cJU_JPIMMED_7_01: SET_01(7); goto SM3Imm_01; -#endif -SM3Imm_01: JU_RET_FOUND_IMM_01(Pjp); - -#ifdef JUDYPREV -#define SM3IMM_OFFSET(cPop1) (cPop1) - 1 // highest. -#else -#define SM3IMM_OFFSET(cPop1) 0 // lowest. -#endif - -#define SM3IMM(cPop1,Next) \ - offset = SM3IMM_OFFSET(cPop1); \ - goto Next - - case cJU_JPIMMED_1_02: SM3IMM( 2, SM3Imm1); - case cJU_JPIMMED_1_03: SM3IMM( 3, SM3Imm1); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: SM3IMM( 4, SM3Imm1); - case cJU_JPIMMED_1_05: SM3IMM( 5, SM3Imm1); - case cJU_JPIMMED_1_06: SM3IMM( 6, SM3Imm1); - case cJU_JPIMMED_1_07: SM3IMM( 7, SM3Imm1); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: SM3IMM( 8, SM3Imm1); - case cJ1_JPIMMED_1_09: SM3IMM( 9, SM3Imm1); - case cJ1_JPIMMED_1_10: SM3IMM(10, SM3Imm1); - case cJ1_JPIMMED_1_11: SM3IMM(11, SM3Imm1); - case cJ1_JPIMMED_1_12: SM3IMM(12, SM3Imm1); - case cJ1_JPIMMED_1_13: SM3IMM(13, SM3Imm1); - case cJ1_JPIMMED_1_14: SM3IMM(14, SM3Imm1); - case cJ1_JPIMMED_1_15: SM3IMM(15, SM3Imm1); -#endif - -SM3Imm1: JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]); - JU_RET_FOUND_IMM(Pjp, offset); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: SM3IMM(2, SM3Imm2); - case cJU_JPIMMED_2_03: SM3IMM(3, SM3Imm2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: SM3IMM(4, SM3Imm2); - case cJ1_JPIMMED_2_05: SM3IMM(5, SM3Imm2); - case cJ1_JPIMMED_2_06: SM3IMM(6, SM3Imm2); - case cJ1_JPIMMED_2_07: SM3IMM(7, SM3Imm2); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -SM3Imm2: *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: SM3IMM(2, SM3Imm3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: SM3IMM(3, SM3Imm3); - case cJ1_JPIMMED_3_04: SM3IMM(4, SM3Imm3); - case cJ1_JPIMMED_3_05: SM3IMM(5, SM3Imm3); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -SM3Imm3: - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: SM3IMM(2, SM3Imm4); - case cJ1_JPIMMED_4_03: SM3IMM(3, SM3Imm4); - -SM3Imm4: *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); - - case cJ1_JPIMMED_5_02: SM3IMM(2, SM3Imm5); - case cJ1_JPIMMED_5_03: SM3IMM(3, SM3Imm5); - -SM3Imm5: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_6_02: SM3IMM(2, SM3Imm6); - -SM3Imm6: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_7_02: SM3IMM(2, SM3Imm7); - -SM3Imm7: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif // (JUDY1 && JU_64BIT) - - -// ---------------------------------------------------------------------------- -// OTHER CASES: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM3Findlimit switch. - - /*NOTREACHED*/ - -} // Judy1Prev() / Judy1Next() / JudyLPrev() / JudyLNext() diff --git a/libjudy/src/Judy1/Judy1NextEmpty.c b/libjudy/src/Judy1/Judy1NextEmpty.c deleted file mode 100644 index 96a5901e3d..0000000000 --- a/libjudy/src/Judy1/Judy1NextEmpty.c +++ /dev/null @@ -1,1390 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.32 $ $Source: /judy/src/JudyCommon/JudyPrevNextEmpty.c $ -// -// Judy*PrevEmpty() and Judy*NextEmpty() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DJUDYNEXT for the Judy*NextEmpty() function; otherwise -// defaults to Judy*PrevEmpty(). -// -// Compile with -DTRACEJPSE to trace JP traversals. -// -// This file is separate from JudyPrevNext.c because it differs too greatly for -// ifdefs. This might be a bit surprising, but there are two reasons: -// -// - First, down in the details, searching for an empty index (SearchEmpty) is -// remarkably asymmetric with searching for a valid index (SearchValid), -// mainly with respect to: No return of a value area for JudyL; partially- -// full versus totally-full JPs; and handling of narrow pointers. -// -// - Second, we chose to implement SearchEmpty without a backtrack stack or -// backtrack engine, partly as an experiment, and partly because we think -// restarting from the top of the tree is less likely for SearchEmpty than -// for SearchValid, because empty indexes are more likely than valid indexes. -// -// A word about naming: A prior version of this feature (see 4.13) was named -// Judy*Free(), but there were concerns about that being read as a verb rather -// than an adjective. After prolonged debate and based on user input, we -// changed "Free" to "Empty". - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifndef JUDYNEXT -#ifndef JUDYPREV -#define JUDYPREV 1 // neither set => use default. -#endif -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -#ifdef TRACEJPSE -#include "JudyPrintJP.c" -#endif - - -// **************************************************************************** -// J U D Y 1 P R E V E M P T Y -// J U D Y 1 N E X T E M P T Y -// J U D Y L P R E V E M P T Y -// J U D Y L N E X T E M P T Y -// -// See the manual entry for the API. -// -// OVERVIEW OF Judy*PrevEmpty() / Judy*NextEmpty(): -// -// See also for comparison the equivalent comments in JudyPrevNext.c. -// -// Take the callers *PIndex and subtract/add 1, but watch out for -// underflow/overflow, which means "no previous/next empty index found." Use a -// reentrant switch statement (state machine, see SMGetRestart and -// SMGetContinue) to decode Index, starting with the JRP (PArray), through a -// JPM and branches, if any, down to an immediate or a leaf. Look for Index in -// that immediate or leaf, and if not found (invalid index), return success -// (Index is empty). -// -// This search can result in a dead end where taking a different path is -// required. There are four kinds of dead ends: -// -// BRANCH PRIMARY dead end: Encountering a fully-populated JP for the -// appropriate digit in Index. Search sideways in the branch for the -// previous/next absent/null/non-full JP, and if one is found, set Index to the -// highest/lowest index possible in that JPs expanse. Then if the JP is an -// absent or null JP, return success; otherwise for a non-full JP, traverse -// through the partially populated JP. -// -// BRANCH SECONDARY dead end: Reaching the end of a branch during a sideways -// search after a branch primary dead end. Set Index to the lowest/highest -// index possible in the whole branchs expanse (one higher/lower than the -// previous/next branchs expanse), then restart at the top of the tree, which -// includes pre-decrementing/incrementing Index (again) and watching for -// underflow/overflow (again). -// -// LEAF PRIMARY dead end: Finding a valid (non-empty) index in an immediate or -// leaf matching Index. Search sideways in the immediate/leaf for the -// previous/next empty index; if found, set *PIndex to match and return success. -// -// LEAF SECONDARY dead end: Reaching the end of an immediate or leaf during a -// sideways search after a leaf primary dead end. Just as for a branch -// secondary dead end, restart at the top of the tree with Index set to the -// lowest/highest index possible in the whole immediate/leafs expanse. -// TBD: If leaf secondary dead end occurs, could shortcut and treat it as a -// branch primary dead end; but this would require remembering the parent -// branchs type and offset (a "one-deep stack"), and also wrestling with -// narrow pointers, at least for leaves (but not for immediates). -// -// Note some ASYMMETRIES between SearchValid and SearchEmpty: -// -// - The SearchValid code, upon descending through a narrow pointer, if Index -// is outside the expanse of the subsidiary node (effectively a secondary -// dead end), must decide whether to backtrack or findlimit. But the -// SearchEmpty code simply returns success (Index is empty). -// -// - Similarly, the SearchValid code, upon finding no previous/next index in -// the expanse of a narrow pointer (again, a secondary dead end), can simply -// start to backtrack at the parent JP. But the SearchEmpty code would have -// to first determine whether or not the parent JPs narrow expanse contains -// a previous/next empty index outside the subexpanse. Rather than keeping a -// parent state stack and backtracking this way, upon a secondary dead end, -// the SearchEmpty code simply restarts at the top of the tree, whether or -// not a narrow pointer is involved. Again, see the equivalent comments in -// JudyPrevNext.c for comparison. -// -// This function is written iteratively for speed, rather than recursively. -// -// TBD: Wed like to enhance this function to make successive searches faster. -// This would require saving some previous state, including the previous Index -// returned, and in which leaf it was found. If the next call is for the same -// Index and the array has not been modified, start at the same leaf. This -// should be much easier to implement since this is iterative rather than -// recursive code. - -#ifdef JUDY1 -#ifdef JUDYPREV -FUNCTION int Judy1PrevEmpty -#else -FUNCTION int Judy1NextEmpty -#endif -#else -#ifdef JUDYPREV -FUNCTION int JudyLPrevEmpty -#else -FUNCTION int JudyLNextEmpty -#endif -#endif - ( - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError // optional, for returning error info. - ) -{ - Word_t Index; // fast copy, in a register. - Pjp_t Pjp; // current JP. - Pjbl_t Pjbl; // Pjp->jp_Addr masked and cast to types: - Pjbb_t Pjbb; - Pjbu_t Pjbu; - Pjlb_t Pjlb; - PWord_t Pword; // alternate name for use by GET* macros. - - Word_t digit; // next digit to decode from Index. - Word_t digits; // current state in SM = digits left to decode. - Word_t pop0; // in a leaf. - Word_t pop0mask; // precalculated to avoid variable shifts. - long offset; // within a branch or leaf (can be large). - int subexp; // subexpanse in a bitmap branch. - BITMAPB_t bitposmaskB; // bit in bitmap for bitmap branch. - BITMAPL_t bitposmaskL; // bit in bitmap for bitmap leaf. - Word_t possfullJP1; // JP types for possibly full subexpanses: - Word_t possfullJP2; - Word_t possfullJP3; - - -// ---------------------------------------------------------------------------- -// M A C R O S -// -// These are intended to make the code a bit more readable and less redundant. - - -// CHECK FOR NULL JP: -// -// TBD: In principle this can be reduced (here and in other *.c files) to just -// the latter clause since no Type should ever be below cJU_JPNULL1, but in -// fact some root pointer types can be lower, so for safety do both checks. - -#define JPNULL(Type) (((Type) >= cJU_JPNULL1) && ((Type) <= cJU_JPNULLMAX)) - - -// CHECK FOR A FULL JP: -// -// Given a JP, indicate if it is fully populated. Use digits, pop0mask, and -// possfullJP1..3 in the context. -// -// This is a difficult problem because it requires checking the Pop0 bits for -// all-ones, but the number of bytes depends on the JP type, which is not -// directly related to the parent branchs type or level -- the JPs child -// could be under a narrow pointer (hence not full). The simple answer -// requires switching on or otherwise calculating the JP type, which could be -// slow. Instead, in SMPREPB* precalculate pop0mask and also record in -// possfullJP1..3 the child JP (branch) types that could possibly be full (one -// level down), and use them here. For level-2 branches (with digits == 2), -// the test for a full child depends on Judy1/JudyL. -// -// Note: This cannot be applied to the JP in a JPM because it doesnt have -// enough pop0 digits. -// -// TBD: JPFULL_BRANCH diligently checks for BranchL or BranchB, where neither -// of those can ever be full as it turns out. Could just check for a BranchU -// at the right level. Also, pop0mask might be overkill, its not used much, -// so perhaps just call cJU_POP0MASK(digits - 1) here? -// -// First, JPFULL_BRANCH checks for a full expanse for a JP whose child can be a -// branch, that is, a JP in a branch at level 3 or higher: - -#define JPFULL_BRANCH(Pjp) \ - ((((JU_JPDCDPOP0(Pjp) ^ cJU_ALLONES) & pop0mask) == 0) \ - && ((JU_JPTYPE(Pjp) == possfullJP1) \ - || (JU_JPTYPE(Pjp) == possfullJP2) \ - || (JU_JPTYPE(Pjp) == possfullJP3))) - -#ifdef JUDY1 -#define JPFULL(Pjp) \ - ((digits == 2) ? \ - (JU_JPTYPE(Pjp) == cJ1_JPFULLPOPU1) : JPFULL_BRANCH(Pjp)) -#else -#define JPFULL(Pjp) \ - ((digits == 2) ? \ - (JU_JPTYPE(Pjp) == cJU_JPLEAF_B1) \ - && (((JU_JPDCDPOP0(Pjp) & cJU_POP0MASK(1)) == cJU_POP0MASK(1))) : \ - JPFULL_BRANCH(Pjp)) -#endif - - -// RETURN SUCCESS: -// -// This hides the need to set *PIndex back to the local value of Index -- use a -// local value for faster operation. Note that the callers *PIndex is ALWAYS -// modified upon success, at least decremented/incremented. - -#define RET_SUCCESS { *PIndex = Index; return(1); } - - -// RETURN A CORRUPTION: - -#define RET_CORRUPT { JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); return(JERRI); } - - -// SEARCH A BITMAP BRANCH: -// -// This is a weak analog of j__udySearchLeaf*() for bitmap branches. Return -// the actual or next-left position, base 0, of Digit in a BITMAPB_t bitmap -// (subexpanse of a full bitmap), also given a Bitposmask for Digit. The -// position is the offset within the set bits. -// -// Unlike j__udySearchLeaf*(), the offset is not returned bit-complemented if -// Digits bit is unset, because the caller can check the bitmap themselves to -// determine that. Also, if Digits bit is unset, the returned offset is to -// the next-left JP or index (including -1), not to the "ideal" position for -// the index = next-right JP or index. -// -// Shortcut and skip calling j__udyCountBitsB() if the bitmap is full, in which -// case (Digit % cJU_BITSPERSUBEXPB) itself is the base-0 offset. - -#define SEARCHBITMAPB(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPB) ? (Digit % cJU_BITSPERSUBEXPB) : \ - j__udyCountBitsB((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#ifdef JUDYPREV -// Equivalent to search for the highest offset in Bitmap, that is, one less -// than the number of bits set: - -#define SEARCHBITMAPMAXB(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPB) ? cJU_BITSPERSUBEXPB - 1 : \ - j__udyCountBitsB(Bitmap) - 1) -#endif - - -// CHECK DECODE BYTES: -// -// Check Decode bytes in a JP against the equivalent portion of Index. If they -// dont match, Index is outside the subexpanse of a narrow pointer, hence is -// empty. - -#define CHECKDCD(cDigits) \ - if (JU_DCDNOTMATCHINDEX(Index, Pjp, cDigits)) RET_SUCCESS - - -// REVISE REMAINDER OF INDEX: -// -// Put one digit in place in Index and clear/set the lower digits, if any, so -// the resulting Index is at the start/end of an expanse, or just clear/set the -// least digits. -// -// Actually, to make simple use of JU_LEASTBYTESMASK, first clear/set all least -// digits of Index including the digit to be overridden, then set the value of -// that one digit. If Digits == 1 the first operation is redundant, but either -// very fast or even removed by the optimizer. - -#define CLEARLEASTDIGITS(Digits) Index &= ~JU_LEASTBYTESMASK(Digits) -#define SETLEASTDIGITS( Digits) Index |= JU_LEASTBYTESMASK(Digits) - -#define CLEARLEASTDIGITS_D(Digit,Digits) \ - { \ - CLEARLEASTDIGITS(Digits); \ - JU_SETDIGIT(Index, Digit, Digits); \ - } - -#define SETLEASTDIGITS_D(Digit,Digits) \ - { \ - SETLEASTDIGITS(Digits); \ - JU_SETDIGIT(Index, Digit, Digits); \ - } - - -// SET REMAINDER OF INDEX AND THEN RETURN OR CONTINUE: - -#define SET_AND_RETURN(OpLeastDigits,Digit,Digits) \ - { \ - OpLeastDigits(Digit, Digits); \ - RET_SUCCESS; \ - } - -#define SET_AND_CONTINUE(OpLeastDigits,Digit,Digits) \ - { \ - OpLeastDigits(Digit, Digits); \ - goto SMGetContinue; \ - } - - -// PREPARE TO HANDLE A LEAFW OR JP BRANCH IN THE STATE MACHINE: -// -// Extract a state-dependent digit from Index in a "constant" way, then jump to -// common code for multiple cases. -// -// TBD: Should this macro do more, such as preparing variable-shift masks for -// use in CLEARLEASTDIGITS and SETLEASTDIGITS? - -#define SMPREPB(cDigits,Next,PossFullJP1,PossFullJP2,PossFullJP3) \ - digits = (cDigits); \ - digit = JU_DIGITATSTATE(Index, cDigits); \ - pop0mask = cJU_POP0MASK((cDigits) - 1); /* for branchs JPs */ \ - possfullJP1 = (PossFullJP1); \ - possfullJP2 = (PossFullJP2); \ - possfullJP3 = (PossFullJP3); \ - goto Next - -// Variations for specific-level branches and for shorthands: -// -// Note: SMPREPB2 need not initialize possfullJP* because JPFULL does not use -// them for digits == 2, but gcc -Wall isnt quite smart enough to see this, so -// waste a bit of time and space to get rid of the warning: - -#define SMPREPB2(Next) \ - digits = 2; \ - digit = JU_DIGITATSTATE(Index, 2); \ - pop0mask = cJU_POP0MASK(1); /* for branchs JPs */ \ - possfullJP1 = possfullJP2 = possfullJP3 = 0; \ - goto Next - -#define SMPREPB3(Next) SMPREPB(3, Next, cJU_JPBRANCH_L2, \ - cJU_JPBRANCH_B2, \ - cJU_JPBRANCH_U2) -#ifndef JU_64BIT -#define SMPREPBL(Next) SMPREPB(cJU_ROOTSTATE, Next, cJU_JPBRANCH_L3, \ - cJU_JPBRANCH_B3, \ - cJU_JPBRANCH_U3) -#else -#define SMPREPB4(Next) SMPREPB(4, Next, cJU_JPBRANCH_L3, \ - cJU_JPBRANCH_B3, \ - cJU_JPBRANCH_U3) -#define SMPREPB5(Next) SMPREPB(5, Next, cJU_JPBRANCH_L4, \ - cJU_JPBRANCH_B4, \ - cJU_JPBRANCH_U4) -#define SMPREPB6(Next) SMPREPB(6, Next, cJU_JPBRANCH_L5, \ - cJU_JPBRANCH_B5, \ - cJU_JPBRANCH_U5) -#define SMPREPB7(Next) SMPREPB(7, Next, cJU_JPBRANCH_L6, \ - cJU_JPBRANCH_B6, \ - cJU_JPBRANCH_U6) -#define SMPREPBL(Next) SMPREPB(cJU_ROOTSTATE, Next, cJU_JPBRANCH_L7, \ - cJU_JPBRANCH_B7, \ - cJU_JPBRANCH_U7) -#endif - - -// RESTART AFTER SECONDARY DEAD END: -// -// Set Index to the first/last index in the branch or leaf subexpanse and start -// over at the top of the tree. - -#ifdef JUDYPREV -#define SMRESTART(Digits) { CLEARLEASTDIGITS(Digits); goto SMGetRestart; } -#else -#define SMRESTART(Digits) { SETLEASTDIGITS( Digits); goto SMGetRestart; } -#endif - - -// CHECK EDGE OF LEAFS EXPANSE: -// -// Given the LSBs of the lowest/highest valid index in a leaf (or equivalently -// in an immediate JP), the level (index size) of the leaf, and the full index -// to return (as Index in the context) already set to the full index matching -// the lowest/highest one, determine if there is an empty index in the leafs -// expanse below/above the lowest/highest index, which is true if the -// lowest/highest index is not at the "edge" of the leafs expanse based on its -// LSBs. If so, return Index decremented/incremented; otherwise restart at the -// top of the tree. -// -// Note: In many cases Index is already at the right spot and calling -// SMRESTART instead of just going directly to SMGetRestart is a bit of -// overkill. -// -// Note: Variable shift occurs if Digits is not a constant. - -#ifdef JUDYPREV -#define LEAF_EDGE(MinIndex,Digits) \ - { \ - if (MinIndex) { --Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#else -#define LEAF_EDGE(MaxIndex,Digits) \ - { \ - if ((MaxIndex) != JU_LEASTBYTES(cJU_ALLONES, Digits)) \ - { ++Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#endif - -// Same as above except Index is not already set to match the lowest/highest -// index, so do that before decrementing/incrementing it: - -#ifdef JUDYPREV -#define LEAF_EDGE_SET(MinIndex,Digits) \ - { \ - if (MinIndex) \ - { JU_SETDIGITS(Index, MinIndex, Digits); --Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#else -#define LEAF_EDGE_SET(MaxIndex,Digits) \ - { \ - if ((MaxIndex) != JU_LEASTBYTES(cJU_ALLONES, Digits)) \ - { JU_SETDIGITS(Index, MaxIndex, Digits); ++Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#endif - - -// FIND A HOLE (EMPTY INDEX) IN AN IMMEDIATE OR LEAF: -// -// Given an index location in a leaf (or equivalently an immediate JP) known to -// contain a usable hole (an empty index less/greater than Index), and the LSBs -// of a minimum/maximum index to locate, find the previous/next empty index and -// return it. -// -// Note: "Even" index sizes (1,2,4[,8] bytes) have corresponding native C -// types; "odd" index sizes dont, but they are not represented here because -// they are handled completely differently; see elsewhere. - -#ifdef JUDYPREV - -#define LEAF_HOLE_EVEN(cDigits,Pjll,IndexLSB) \ - { \ - while (*(Pjll) > (IndexLSB)) --(Pjll); /* too high */ \ - if (*(Pjll) < (IndexLSB)) RET_SUCCESS /* Index is empty */ \ - while (*(--(Pjll)) == --(IndexLSB)) /* null, find a hole */;\ - JU_SETDIGITS(Index, IndexLSB, cDigits); \ - RET_SUCCESS; \ - } -#else -#define LEAF_HOLE_EVEN(cDigits,Pjll,IndexLSB) \ - { \ - while (*(Pjll) < (IndexLSB)) ++(Pjll); /* too low */ \ - if (*(Pjll) > (IndexLSB)) RET_SUCCESS /* Index is empty */ \ - while (*(++(Pjll)) == ++(IndexLSB)) /* null, find a hole */;\ - JU_SETDIGITS(Index, IndexLSB, cDigits); \ - RET_SUCCESS; \ - } -#endif - - -// SEARCH FOR AN EMPTY INDEX IN AN IMMEDIATE OR LEAF: -// -// Given a pointer to the first index in a leaf (or equivalently an immediate -// JP), the population of the leaf, and a first empty Index to find (inclusive, -// as Index in the context), where Index is known to fall within the expanse of -// the leaf to search, efficiently find the previous/next empty index in the -// leaf, if any. For simplicity the following overview is stated in terms of -// Judy*NextEmpty() only, but the same concepts apply symmetrically for -// Judy*PrevEmpty(). Also, in each case the comparisons are for the LSBs of -// Index and leaf indexes, according to the leafs level. -// -// 1. If Index is GREATER than the last (highest) index in the leaf -// (maxindex), return success, Index is empty. (Remember, Index is known -// to be in the leafs expanse.) -// -// 2. If Index is EQUAL to maxindex: If maxindex is not at the edge of the -// leafs expanse, increment Index and return success, there is an empty -// Index one higher than any in the leaf; otherwise restart with Index -// reset to the upper edge of the leafs expanse. Note: This might cause -// an extra cache line fill, but this is OK for repeatedly-called search -// code, and it saves CPU time. -// -// 3. If Index is LESS than maxindex, check for "dense to end of leaf": -// Subtract Index from maxindex, and back up that many slots in the leaf. -// If the resulting offset is not before the start of the leaf then compare -// the index at this offset (baseindex) with Index: -// -// 3a. If GREATER, the leaf must be corrupt, since indexes are sorted and -// there are no duplicates. -// -// 3b. If EQUAL, the leaf is "dense" from Index to maxindex, meaning there is -// no reason to search it. "Slide right" to the high end of the leaf -// (modify Index to maxindex) and continue with step 2 above. -// -// 3c. If LESS, continue with step 4. -// -// 4. If the offset based on maxindex minus Index falls BEFORE the start of -// the leaf, or if, per 3c above, baseindex is LESS than Index, the leaf is -// guaranteed "not dense to the end" and a usable empty Index must exist. -// This supports a more efficient search loop. Start at the FIRST index in -// the leaf, or one BEYOND baseindex, respectively, and search the leaf as -// follows, comparing each current index (currindex) with Index: -// -// 4a. If LESS, keep going to next index. Note: This is certain to terminate -// because maxindex is known to be greater than Index, hence the loop can -// be small and fast. -// -// 4b. If EQUAL, loop and increment Index until finding currindex greater than -// Index, and return success with the modified Index. -// -// 4c. If GREATER, return success, Index (unmodified) is empty. -// -// Note: These are macros rather than functions for speed. - -#ifdef JUDYPREV - -#define JSLE_EVEN(Addr,Pop0,cDigits,LeafType) \ - { \ - LeafType * PjllLSB = (LeafType *) (Addr); \ - LeafType IndexLSB = Index; /* auto-masking */ \ - \ - /* Index before or at start of leaf: */ \ - \ - if (*PjllLSB >= IndexLSB) /* no need to search */ \ - { \ - if (*PjllLSB > IndexLSB) RET_SUCCESS; /* Index empty */ \ - LEAF_EDGE(*PjllLSB, cDigits); \ - } \ - \ - /* Index in or after leaf: */ \ - \ - offset = IndexLSB - *PjllLSB; /* tentative offset */ \ - if (offset <= (Pop0)) /* can check density */ \ - { \ - PjllLSB += offset; /* move to slot */ \ - \ - if (*PjllLSB <= IndexLSB) /* dense or corrupt */ \ - { \ - if (*PjllLSB == IndexLSB) /* dense, check edge */ \ - LEAF_EDGE_SET(PjllLSB[-offset], cDigits); \ - RET_CORRUPT; \ - } \ - --PjllLSB; /* not dense, start at previous */ \ - } \ - else PjllLSB = ((LeafType *) (Addr)) + (Pop0); /* start at max */ \ - \ - LEAF_HOLE_EVEN(cDigits, PjllLSB, IndexLSB); \ - } - -// JSLE_ODD is completely different from JSLE_EVEN because its important to -// minimize copying odd indexes to compare them (see 4.14). Furthermore, a -// very complex version (4.17, but abandoned before fully debugged) that -// avoided calling j__udySearchLeaf*() ran twice as fast as 4.14, but still -// half as fast as SearchValid. Doug suggested that to minimize complexity and -// share common code we should use j__udySearchLeaf*() for the initial search -// to establish if Index is empty, which should be common. If Index is valid -// in a leaf or immediate indexes, odds are good that an empty Index is nearby, -// so for simplicity just use a *COPY* function to linearly search the -// remainder. -// -// TBD: Pathological case? Average performance should be good, but worst-case -// might suffer. When Search says the initial Index is valid, so a linear -// copy-and-compare is begun, if the caller builds fairly large leaves with -// dense clusters AND frequently does a SearchEmpty at one end of such a -// cluster, performance wont be very good. Might a dense-check help? This -// means checking offset against the index at offset, and then against the -// first/last index in the leaf. We doubt the pathological case will appear -// much in real applications because they will probably alternate SearchValid -// and SearchEmpty calls. - -#define JSLE_ODD(cDigits,Pjll,Pop0,Search,Copy) \ - { \ - Word_t IndexLSB; /* least bytes only */ \ - Word_t IndexFound; /* in leaf */ \ - \ - if ((offset = Search(Pjll, (Pop0) + 1, Index)) < 0) \ - RET_SUCCESS; /* Index is empty */ \ - \ - IndexLSB = JU_LEASTBYTES(Index, cDigits); \ - offset *= (cDigits); \ - \ - while ((offset -= (cDigits)) >= 0) \ - { /* skip until empty or start */ \ - Copy(IndexFound, ((uint8_t *) (Pjll)) + offset); \ - if (IndexFound != (--IndexLSB)) /* found an empty */ \ - { JU_SETDIGITS(Index, IndexLSB, cDigits); RET_SUCCESS; }\ - } \ - LEAF_EDGE_SET(IndexLSB, cDigits); \ - } - -#else // JUDYNEXT - -#define JSLE_EVEN(Addr,Pop0,cDigits,LeafType) \ - { \ - LeafType * PjllLSB = ((LeafType *) (Addr)) + (Pop0); \ - LeafType IndexLSB = Index; /* auto-masking */ \ - \ - /* Index at or after end of leaf: */ \ - \ - if (*PjllLSB <= IndexLSB) /* no need to search */ \ - { \ - if (*PjllLSB < IndexLSB) RET_SUCCESS; /* Index empty */\ - LEAF_EDGE(*PjllLSB, cDigits); \ - } \ - \ - /* Index before or in leaf: */ \ - \ - offset = *PjllLSB - IndexLSB; /* tentative offset */ \ - if (offset <= (Pop0)) /* can check density */ \ - { \ - PjllLSB -= offset; /* move to slot */ \ - \ - if (*PjllLSB >= IndexLSB) /* dense or corrupt */ \ - { \ - if (*PjllLSB == IndexLSB) /* dense, check edge */ \ - LEAF_EDGE_SET(PjllLSB[offset], cDigits); \ - RET_CORRUPT; \ - } \ - ++PjllLSB; /* not dense, start at next */ \ - } \ - else PjllLSB = (LeafType *) (Addr); /* start at minimum */ \ - \ - LEAF_HOLE_EVEN(cDigits, PjllLSB, IndexLSB); \ - } - -#define JSLE_ODD(cDigits,Pjll,Pop0,Search,Copy) \ - { \ - Word_t IndexLSB; /* least bytes only */ \ - Word_t IndexFound; /* in leaf */ \ - int offsetmax; /* in bytes */ \ - \ - if ((offset = Search(Pjll, (Pop0) + 1, Index)) < 0) \ - RET_SUCCESS; /* Index is empty */ \ - \ - IndexLSB = JU_LEASTBYTES(Index, cDigits); \ - offset *= (cDigits); \ - offsetmax = (Pop0) * (cDigits); /* single multiply */ \ - \ - while ((offset += (cDigits)) <= offsetmax) \ - { /* skip until empty or end */ \ - Copy(IndexFound, ((uint8_t *) (Pjll)) + offset); \ - if (IndexFound != (++IndexLSB)) /* found an empty */ \ - { JU_SETDIGITS(Index, IndexLSB, cDigits); RET_SUCCESS; } \ - } \ - LEAF_EDGE_SET(IndexLSB, cDigits); \ - } - -#endif // JUDYNEXT - -// Note: Immediate indexes never fill a single index group, so for odd index -// sizes, save time by calling JSLE_ODD_IMM instead of JSLE_ODD. - -#define j__udySearchLeafEmpty1(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 1, uint8_t) - -#define j__udySearchLeafEmpty2(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 2, uint16_t) - -#define j__udySearchLeafEmpty3(Addr,Pop0) \ - JSLE_ODD(3, Addr, Pop0, j__udySearchLeaf3, JU_COPY3_PINDEX_TO_LONG) - -#ifndef JU_64BIT - -#define j__udySearchLeafEmptyL(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 4, Word_t) - -#else - -#define j__udySearchLeafEmpty4(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 4, uint32_t) - -#define j__udySearchLeafEmpty5(Addr,Pop0) \ - JSLE_ODD(5, Addr, Pop0, j__udySearchLeaf5, JU_COPY5_PINDEX_TO_LONG) - -#define j__udySearchLeafEmpty6(Addr,Pop0) \ - JSLE_ODD(6, Addr, Pop0, j__udySearchLeaf6, JU_COPY6_PINDEX_TO_LONG) - -#define j__udySearchLeafEmpty7(Addr,Pop0) \ - JSLE_ODD(7, Addr, Pop0, j__udySearchLeaf7, JU_COPY7_PINDEX_TO_LONG) - -#define j__udySearchLeafEmptyL(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 8, Word_t) - -#endif // JU_64BIT - - -// ---------------------------------------------------------------------------- -// START OF CODE: -// -// CHECK FOR SHORTCUTS: -// -// Error out if PIndex is null. - - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return(JERRI); - } - - Index = *PIndex; // fast local copy. - -// Set and pre-decrement/increment Index, watching for underflow/overflow: -// -// An out-of-bounds Index means failure: No previous/next empty index. - -SMGetRestart: // return here with revised Index. - -#ifdef JUDYPREV - if (Index-- == 0) return(0); -#else - if (++Index == 0) return(0); -#endif - -// An empty array with an in-bounds (not underflowed/overflowed) Index means -// success: -// -// Note: This check is redundant after restarting at SMGetRestart, but should -// take insignificant time. - - if (PArray == (Pvoid_t) NULL) RET_SUCCESS; - -// ---------------------------------------------------------------------------- -// ROOT-LEVEL LEAF that starts with a Pop0 word; just look within the leaf: -// -// If Index is not in the leaf, return success; otherwise return the first -// empty Index, if any, below/above where it would belong. - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - pop0 = Pjlw[0]; - -#ifdef JUDY1 - if (pop0 == 0) // special case. - { -#ifdef JUDYPREV - if ((Index != Pjlw[1]) || (Index-- != 0)) RET_SUCCESS; -#else - if ((Index != Pjlw[1]) || (++Index != 0)) RET_SUCCESS; -#endif - return(0); // no previous/next empty index. - } -#endif // JUDY1 - - j__udySearchLeafEmptyL(Pjlw + 1, pop0); - -// No return -- thanks ALAN - - } - else - -// ---------------------------------------------------------------------------- -// HANDLE JRP Branch: -// -// For JRP branches, traverse the JPM; handle LEAFW -// directly; but look for the most common cases first. - - { - Pjpm_t Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); - -// goto SMGetContinue; - } - - -// ============================================================================ -// STATE MACHINE -- GET INDEX: -// -// Search for Index (already decremented/incremented so as to be an inclusive -// search). If not found (empty index), return success. Otherwise do a -// previous/next search, and if successful modify Index to the empty index -// found. See function header comments. -// -// ENTRY: Pjp points to next JP to interpret, whose Decode bytes have not yet -// been checked. -// -// Note: Check Decode bytes at the start of each loop, not after looking up a -// new JP, so its easy to do constant shifts/masks. -// -// EXIT: Return, or branch to SMGetRestart with modified Index, or branch to -// SMGetContinue with a modified Pjp, as described elsewhere. -// -// WARNING: For run-time efficiency the following cases replicate code with -// varying constants, rather than using common code with variable values! - -SMGetContinue: // return here for next branch/leaf. - -#ifdef TRACEJPSE - JudyPrintJP(Pjp, "sf", __LINE__); -#endif - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_L2: CHECKDCD(2); SMPREPB2(SMBranchL); - case cJU_JPBRANCH_L3: CHECKDCD(3); SMPREPB3(SMBranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: CHECKDCD(4); SMPREPB4(SMBranchL); - case cJU_JPBRANCH_L5: CHECKDCD(5); SMPREPB5(SMBranchL); - case cJU_JPBRANCH_L6: CHECKDCD(6); SMPREPB6(SMBranchL); - case cJU_JPBRANCH_L7: CHECKDCD(7); SMPREPB7(SMBranchL); -#endif - case cJU_JPBRANCH_L: SMPREPBL(SMBranchL); - -// Common code (state-independent) for all cases of linear branches: - -SMBranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -// First, check if Indexs expanse (digit) is below/above the first/last -// populated expanse in the BranchL, in which case Index is empty; otherwise -// find the offset of the lowest/highest populated expanse at or above/below -// digit, if any: -// -// Note: The for-loop is guaranteed to exit eventually because the first/last -// expanse is known to be a terminator. -// -// Note: Cannot use j__udySearchLeaf*Empty1() here because it only applies to -// leaves and does not know about partial versus full JPs, unlike the use of -// j__udySearchLeaf1() for BranchLs in SearchValid code. Also, since linear -// leaf expanse lists are small, dont waste time calling j__udySearchLeaf1(), -// just scan the expanse list. - -#ifdef JUDYPREV - if ((Pjbl->jbl_Expanse[0]) > digit) RET_SUCCESS; - - for (offset = (Pjbl->jbl_NumJPs) - 1; /* null */; --offset) -#else - if ((Pjbl->jbl_Expanse[(Pjbl->jbl_NumJPs) - 1]) < digit) - RET_SUCCESS; - - for (offset = 0; /* null */; ++offset) -#endif - { - -// Too low/high, keep going; or too high/low, meaning the loop passed a hole -// and the initial Index is empty: - -#ifdef JUDYPREV - if ((Pjbl->jbl_Expanse[offset]) > digit) continue; - if ((Pjbl->jbl_Expanse[offset]) < digit) RET_SUCCESS; -#else - if ((Pjbl->jbl_Expanse[offset]) < digit) continue; - if ((Pjbl->jbl_Expanse[offset]) > digit) RET_SUCCESS; -#endif - -// Found expanse matching digit; if its not full, traverse through it: - - if (! JPFULL((Pjbl->jbl_jp) + offset)) - { - Pjp = (Pjbl->jbl_jp) + offset; - goto SMGetContinue; - } - -// Common code: While searching for a lower/higher hole or a non-full JP, upon -// finding a lower/higher hole, adjust Index using the revised digit and -// return; or upon finding a consecutive lower/higher expanse, if the expanses -// JP is non-full, modify Index and traverse through the JP: - -#define BRANCHL_CHECK(OpIncDec,OpLeastDigits,Digit,Digits) \ - { \ - if ((Pjbl->jbl_Expanse[offset]) != OpIncDec digit) \ - SET_AND_RETURN(OpLeastDigits, Digit, Digits); \ - \ - if (! JPFULL((Pjbl->jbl_jp) + offset)) \ - { \ - Pjp = (Pjbl->jbl_jp) + offset; \ - SET_AND_CONTINUE(OpLeastDigits, Digit, Digits); \ - } \ - } - -// BranchL primary dead end: Expanse matching Index/digit is full (rare except -// for dense/sequential indexes): -// -// Search for a lower/higher hole, a non-full JP, or the end of the expanse -// list, while decrementing/incrementing digit. - -#ifdef JUDYPREV - while (--offset >= 0) - BRANCHL_CHECK(--, SETLEASTDIGITS_D, digit, digits) -#else - while (++offset < Pjbl->jbl_NumJPs) - BRANCHL_CHECK(++, CLEARLEASTDIGITS_D, digit, digits) -#endif - -// Passed end of BranchL expanse list after finding a matching but full -// expanse: -// -// Digit now matches the lowest/highest expanse, which is a full expanse; if -// digit is at the end of BranchLs expanse (no hole before/after), break out -// of the loop; otherwise modify Index to the next lower/higher digit and -// return success: - -#ifdef JUDYPREV - if (digit == 0) break; - --digit; SET_AND_RETURN(SETLEASTDIGITS_D, digit, digits); -#else - if (digit == JU_LEASTBYTES(cJU_ALLONES, 1)) break; - ++digit; SET_AND_RETURN(CLEARLEASTDIGITS_D, digit, digits); -#endif - } // for-loop - -// BranchL secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_B2: CHECKDCD(2); SMPREPB2(SMBranchB); - case cJU_JPBRANCH_B3: CHECKDCD(3); SMPREPB3(SMBranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: CHECKDCD(4); SMPREPB4(SMBranchB); - case cJU_JPBRANCH_B5: CHECKDCD(5); SMPREPB5(SMBranchB); - case cJU_JPBRANCH_B6: CHECKDCD(6); SMPREPB6(SMBranchB); - case cJU_JPBRANCH_B7: CHECKDCD(7); SMPREPB7(SMBranchB); -#endif - case cJU_JPBRANCH_B: SMPREPBL(SMBranchB); - -// Common code (state-independent) for all cases of bitmap branches: - -SMBranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - -// Locate the digits JP in the subexpanse list, if present: - - subexp = digit / cJU_BITSPERSUBEXPB; - assert(subexp < cJU_NUMSUBEXPB); // falls in expected range. - bitposmaskB = JU_BITPOSMASKB(digit); - -// Absent JP = no JP matches current digit in Index: - -// if (! JU_BITMAPTESTB(Pjbb, digit)) // slower. - if (! (JU_JBB_BITMAP(Pjbb, subexp) & bitposmaskB)) // faster. - RET_SUCCESS; - -// Non-full JP matches current digit in Index: -// -// Iterate to the subsidiary non-full JP. - - offset = SEARCHBITMAPB(JU_JBB_BITMAP(Pjbb, subexp), digit, - bitposmaskB); - // not negative since at least one bit is set: - assert(offset >= 0); - assert(offset < (int) cJU_BITSPERSUBEXPB); - -// Watch for null JP subarray pointer with non-null bitmap (a corruption): - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) - == (Pjp_t) NULL) RET_CORRUPT; - - Pjp += offset; - if (! JPFULL(Pjp)) goto SMGetContinue; - -// BranchB primary dead end: -// -// Upon hitting a full JP in a BranchB for the next digit in Index, search -// sideways for a previous/next absent JP (unset bit) or non-full JP (set bit -// with non-full JP); first in the current bitmap subexpanse, then in -// lower/higher subexpanses. Upon entry, Pjp points to a known-unusable JP, -// ready to decrement/increment. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. -// -// TBD: For speed, shift bitposmaskB instead of using JU_BITMAPTESTB or -// JU_BITPOSMASKB, but this shift has knowledge of bit order that really should -// be encapsulated in a header file. - -#define BRANCHB_CHECKBIT(OpLeastDigits) \ - if (! (JU_JBB_BITMAP(Pjbb, subexp) & bitposmaskB)) /* absent JP */ \ - SET_AND_RETURN(OpLeastDigits, digit, digits) - -#define BRANCHB_CHECKJPFULL(OpLeastDigits) \ - if (! JPFULL(Pjp)) \ - SET_AND_CONTINUE(OpLeastDigits, digit, digits) - -#define BRANCHB_STARTSUBEXP(OpLeastDigits) \ - if (! JU_JBB_BITMAP(Pjbb, subexp)) /* empty subexpanse, shortcut */ \ - SET_AND_RETURN(OpLeastDigits, digit, digits) \ - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) RET_CORRUPT - -#ifdef JUDYPREV - - --digit; // skip initial digit. - bitposmaskB >>= 1; // see TBD above. - -BranchBNextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskB) // more bits to check in subexp. - { - BRANCHB_CHECKBIT(SETLEASTDIGITS_D); - --Pjp; // previous in subarray. - BRANCHB_CHECKJPFULL(SETLEASTDIGITS_D); - assert(digit >= 0); - --digit; - bitposmaskB >>= 1; - } - - if (subexp-- > 0) // more subexpanses. - { - BRANCHB_STARTSUBEXP(SETLEASTDIGITS_D); - Pjp += SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)) + 1; - bitposmaskB = (1U << (cJU_BITSPERSUBEXPB - 1)); - goto BranchBNextSubexp; - } - -#else // JUDYNEXT - - ++digit; // skip initial digit. - bitposmaskB <<= 1; // note: BITMAPB_t. - -BranchBNextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskB) // more bits to check in subexp. - { - BRANCHB_CHECKBIT(CLEARLEASTDIGITS_D); - ++Pjp; // previous in subarray. - BRANCHB_CHECKJPFULL(CLEARLEASTDIGITS_D); - assert(digit < cJU_SUBEXPPERSTATE); - ++digit; - bitposmaskB <<= 1; // note: BITMAPB_t. - } - - if (++subexp < cJU_NUMSUBEXPB) // more subexpanses. - { - BRANCHB_STARTSUBEXP(CLEARLEASTDIGITS_D); - --Pjp; // pre-decrement. - bitposmaskB = 1; - goto BranchBNextSubexp; - } - -#endif // JUDYNEXT - -// BranchB secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_U2: CHECKDCD(2); SMPREPB2(SMBranchU); - case cJU_JPBRANCH_U3: CHECKDCD(3); SMPREPB3(SMBranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: CHECKDCD(4); SMPREPB4(SMBranchU); - case cJU_JPBRANCH_U5: CHECKDCD(5); SMPREPB5(SMBranchU); - case cJU_JPBRANCH_U6: CHECKDCD(6); SMPREPB6(SMBranchU); - case cJU_JPBRANCH_U7: CHECKDCD(7); SMPREPB7(SMBranchU); -#endif - case cJU_JPBRANCH_U: SMPREPBL(SMBranchU); - -// Common code (state-independent) for all cases of uncompressed branches: - -SMBranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - Pjp = (Pjbu->jbu_jp) + digit; - -// Absent JP = null JP for current digit in Index: - - if (JPNULL(JU_JPTYPE(Pjp))) RET_SUCCESS; - -// Non-full JP matches current digit in Index: -// -// Iterate to the subsidiary JP. - - if (! JPFULL(Pjp)) goto SMGetContinue; - -// BranchU primary dead end: -// -// Upon hitting a full JP in a BranchU for the next digit in Index, search -// sideways for a previous/next null or non-full JP. BRANCHU_CHECKJP() is -// shorthand for common code. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. - -#define BRANCHU_CHECKJP(OpIncDec,OpLeastDigits) \ - { \ - OpIncDec Pjp; \ - \ - if (JPNULL(JU_JPTYPE(Pjp))) \ - SET_AND_RETURN(OpLeastDigits, digit, digits) \ - \ - if (! JPFULL(Pjp)) \ - SET_AND_CONTINUE(OpLeastDigits, digit, digits) \ - } - -#ifdef JUDYPREV - while (digit-- > 0) - BRANCHU_CHECKJP(--, SETLEASTDIGITS_D); -#else - while (++digit < cJU_BRANCHUNUMJPS) - BRANCHU_CHECKJP(++, CLEARLEASTDIGITS_D); -#endif - -// BranchU secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for the -// previous/next empty index starting at Index. Primary leaf dead end is -// hidden within j__udySearchLeaf*Empty*(). In case of secondary leaf dead -// end, restart at the top of the tree. -// -// Note: Pword is the name known to GET*; think of it as Pjlw. - -#define SMLEAFL(cDigits,Func) \ - Pword = (PWord_t) P_JLW(Pjp->jp_Addr); \ - pop0 = JU_JPLEAF_POP0(Pjp); \ - Func(Pword, pop0) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKDCD(1); SMLEAFL(1, j__udySearchLeafEmpty1); -#endif - case cJU_JPLEAF2: CHECKDCD(2); SMLEAFL(2, j__udySearchLeafEmpty2); - case cJU_JPLEAF3: CHECKDCD(3); SMLEAFL(3, j__udySearchLeafEmpty3); - -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKDCD(4); SMLEAFL(4, j__udySearchLeafEmpty4); - case cJU_JPLEAF5: CHECKDCD(5); SMLEAFL(5, j__udySearchLeafEmpty5); - case cJU_JPLEAF6: CHECKDCD(6); SMLEAFL(6, j__udySearchLeafEmpty6); - case cJU_JPLEAF7: CHECKDCD(7); SMLEAFL(7, j__udySearchLeafEmpty7); -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for the -// previous/next empty index starting at Index. - - case cJU_JPLEAF_B1: - - CHECKDCD(1); - - Pjlb = P_JLB(Pjp->jp_Addr); - digit = JU_DIGITATSTATE(Index, 1); - subexp = digit / cJU_BITSPERSUBEXPL; - bitposmaskL = JU_BITPOSMASKL(digit); - assert(subexp < cJU_NUMSUBEXPL); // falls in expected range. - -// Absent index = no index matches current digit in Index: - -// if (! JU_BITMAPTESTL(Pjlb, digit)) // slower. - if (! (JU_JLB_BITMAP(Pjlb, subexp) & bitposmaskL)) // faster. - RET_SUCCESS; - -// LeafB1 primary dead end: -// -// Upon hitting a valid (non-empty) index in a LeafB1 for the last digit in -// Index, search sideways for a previous/next absent index, first in the -// current bitmap subexpanse, then in lower/higher subexpanses. -// LEAFB1_CHECKBIT() is shorthand for common code to handle one bit in one -// bitmap subexpanse. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. -// -// TBD: For speed, shift bitposmaskL instead of using JU_BITMAPTESTL or -// JU_BITPOSMASKL, but this shift has knowledge of bit order that really should -// be encapsulated in a header file. - -#define LEAFB1_CHECKBIT(OpLeastDigits) \ - if (! (JU_JLB_BITMAP(Pjlb, subexp) & bitposmaskL)) \ - SET_AND_RETURN(OpLeastDigits, digit, 1) - -#define LEAFB1_STARTSUBEXP(OpLeastDigits) \ - if (! JU_JLB_BITMAP(Pjlb, subexp)) /* empty subexp */ \ - SET_AND_RETURN(OpLeastDigits, digit, 1) - -#ifdef JUDYPREV - - --digit; // skip initial digit. - bitposmaskL >>= 1; // see TBD above. - -LeafB1NextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskL) // more bits to check in subexp. - { - LEAFB1_CHECKBIT(SETLEASTDIGITS_D); - assert(digit >= 0); - --digit; - bitposmaskL >>= 1; - } - - if (subexp-- > 0) // more subexpanses. - { - LEAFB1_STARTSUBEXP(SETLEASTDIGITS_D); - bitposmaskL = (1UL << (cJU_BITSPERSUBEXPL - 1)); - goto LeafB1NextSubexp; - } - -#else // JUDYNEXT - - ++digit; // skip initial digit. - bitposmaskL <<= 1; // note: BITMAPL_t. - -LeafB1NextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskL) // more bits to check in subexp. - { - LEAFB1_CHECKBIT(CLEARLEASTDIGITS_D); - assert(digit < cJU_SUBEXPPERSTATE); - ++digit; - bitposmaskL <<= 1; // note: BITMAPL_t. - } - - if (++subexp < cJU_NUMSUBEXPL) // more subexpanses. - { - LEAFB1_STARTSUBEXP(CLEARLEASTDIGITS_D); - bitposmaskL = 1; - goto LeafB1NextSubexp; - } - -#endif // JUDYNEXT - -// LeafB1 secondary dead end, no empty index: - - SMRESTART(1); - - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// If the Decode bytes do not match, Index is empty (without modification); -// otherwise restart. - - case cJ1_JPFULLPOPU1: - - CHECKDCD(1); - SMRESTART(1); -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: -// -// Pop1 = 1 Immediate JPs: -// -// If Index is not in the immediate JP, return success; otherwise check if -// there is an empty index below/above the immediate JPs index, and if so, -// return success with modified Index, else restart. -// -// Note: Doug says its fast enough to calculate the index size (digits) in -// the following; no need to set it separately for each case. - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - if (JU_JPDCDPOP0(Pjp) != JU_TRIMTODCDSIZE(Index)) RET_SUCCESS; - digits = JU_JPTYPE(Pjp) - cJU_JPIMMED_1_01 + 1; - LEAF_EDGE(JU_LEASTBYTES(JU_JPDCDPOP0(Pjp), digits), digits); - -// Immediate JPs with Pop1 > 1: - -#define IMM_MULTI(Func,BaseJPType) \ - JUDY1CODE(Pword = (PWord_t) (Pjp->jp_1Index);) \ - JUDYLCODE(Pword = (PWord_t) (Pjp->jp_LIndex);) \ - Func(Pword, JU_JPTYPE(Pjp) - (BaseJPType) + 1) - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - IMM_MULTI(j__udySearchLeafEmpty1, cJU_JPIMMED_1_02); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - IMM_MULTI(j__udySearchLeafEmpty2, cJU_JPIMMED_2_02); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - IMM_MULTI(j__udySearchLeafEmpty3, cJU_JPIMMED_3_02); -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: - case cJ1_JPIMMED_4_03: - IMM_MULTI(j__udySearchLeafEmpty4, cJ1_JPIMMED_4_02); - - case cJ1_JPIMMED_5_02: - case cJ1_JPIMMED_5_03: - IMM_MULTI(j__udySearchLeafEmpty5, cJ1_JPIMMED_5_02); - - case cJ1_JPIMMED_6_02: - IMM_MULTI(j__udySearchLeafEmpty6, cJ1_JPIMMED_6_02); - - case cJ1_JPIMMED_7_02: - IMM_MULTI(j__udySearchLeafEmpty7, cJ1_JPIMMED_7_02); -#endif - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: RET_CORRUPT; - - } // SMGet switch. - -} // Judy1PrevEmpty() / Judy1NextEmpty() / JudyLPrevEmpty() / JudyLNextEmpty() diff --git a/libjudy/src/Judy1/Judy1Prev.c b/libjudy/src/Judy1/Judy1Prev.c deleted file mode 100644 index d15db1596c..0000000000 --- a/libjudy/src/Judy1/Judy1Prev.c +++ /dev/null @@ -1,1890 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.54 $ $Source: /judy/src/JudyCommon/JudyPrevNext.c $ -// -// Judy*Prev() and Judy*Next() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DJUDYNEXT for the Judy*Next() function; otherwise defaults to -// Judy*Prev(). - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifndef JUDYNEXT -#ifndef JUDYPREV -#define JUDYPREV 1 // neither set => use default. -#endif -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - - -// **************************************************************************** -// J U D Y 1 P R E V -// J U D Y 1 N E X T -// J U D Y L P R E V -// J U D Y L N E X T -// -// See the manual entry for the API. -// -// OVERVIEW OF Judy*Prev(): -// -// Use a reentrant switch statement (state machine, SM1 = "get") to decode the -// callers *PIndex-1, starting with the (PArray), through branches, if -// any, down to an immediate or a leaf. Look for *PIndex-1 in that leaf, and -// if found, return it. -// -// A dead end is either a branch that does not contain a JP for the appropriate -// digit in *PIndex-1, or a leaf that does not contain the undecoded digits of -// *PIndex-1. Upon reaching a dead end, backtrack through the leaf/branches -// that were just traversed, using a list (history) of parent JPs that is built -// while going forward in SM1Get. Start with the current leaf or branch. In a -// backtracked leaf, look for an Index less than *PIndex-1. In each -// backtracked branch, look "sideways" for the next JP, if any, lower than the -// one for the digit (from *PIndex-1) that was previously decoded. While -// backtracking, if a leaf has no previous Index or a branch has no lower JP, -// go to its parent branch in turn. Upon reaching the JRP, return failure, "no -// previous Index". The backtrack process is sufficiently different from -// SM1Get to merit its own separate reentrant switch statement (SM2 = -// "backtrack"). -// -// While backtracking, upon finding a lower JP in a branch, there is certain to -// be a "prev" Index under that JP (unless the Judy array is corrupt). -// Traverse forward again, this time taking the last (highest, right-most) JP -// in each branch, and the last (highest) Index upon reaching an immediate or a -// leaf. This traversal is sufficiently different from SM1Get and SM2Backtrack -// to merit its own separate reentrant switch statement (SM3 = "findlimit"). -// -// "Decode" bytes in JPs complicate this process a little. In SM1Get, when a -// JP is a narrow pointer, that is, when states are skipped (so the skipped -// digits are stored in jp_DcdPopO), compare the relevant digits to the same -// digits in *PIndex-1. If they are EQUAL, proceed in SM1Get as before. If -// jp_DcdPopOs digits are GREATER, treat the JP as a dead end and proceed in -// SM2Backtrack. If jp_DcdPopOs digits are LESS, treat the JP as if it had -// just been found during a backtrack and proceed directly in SM3Findlimit. -// -// Note that Decode bytes can be ignored in SM3Findlimit; they dont matter. -// Also note that in practice the Decode bytes are routinely compared with -// *PIndex-1 because thats simpler and no slower than first testing for -// narrowness. -// -// Decode bytes also make it unnecessary to construct the Index to return (the -// revised *PIndex) during the search. This step is deferred until finding an -// Index during backtrack or findlimit, before returning it. The first digit -// of *PIndex is derived (saved) based on which JP is used in a JRP branch. -// The remaining digits are obtained from the jp_DcdPopO field in the JP (if -// any) above the immediate or leaf containing the found (prev) Index, plus the -// remaining digit(s) in the immediate or leaf itself. In the case of a LEAFW, -// the Index to return is found directly in the leaf. -// -// Note: Theoretically, as described above, upon reaching a dead end, SM1Get -// passes control to SM2Backtrack to look sideways, even in a leaf. Actually -// its a little more efficient for the SM1Get leaf cases to shortcut this and -// take care of the sideways searches themselves. Hence the history list only -// contains branch JPs, and SM2Backtrack only handles branches. In fact, even -// the branch handling cases in SM1Get do some shortcutting (sideways -// searching) to avoid pushing history and calling SM2Backtrack unnecessarily. -// -// Upon reaching an Index to return after backtracking, *PIndex must be -// modified to the found Index. In principle this could be done by building -// the Index from a saved rootdigit (in the top branch) plus the Dcd bytes from -// the parent JP plus the appropriate Index bytes from the leaf. However, -// Immediates are difficult because their parent JPs lack one (last) digit. So -// instead just build the *PIndex to return "top down" while backtracking and -// findlimiting. -// -// This function is written iteratively for speed, rather than recursively. -// -// CAVEATS: -// -// Why use a backtrack list (history stack), since it has finite size? The -// size is small for Judy on both 32-bit and 64-bit systems, and a list (really -// just an array) is fast to maintain and use. Other alternatives include -// doing a lookahead (lookaside) in each branch while traversing forward -// (decoding), and restarting from the top upon a dead end. -// -// A lookahead means noting the last branch traversed which contained a -// non-null JP lower than the one specified by a digit in *PIndex-1, and -// returning to that point for SM3Findlimit. This seems like a good idea, and -// should be pretty cheap for linear and bitmap branches, but it could result -// in up to 31 unnecessary additional cache line fills (in extreme cases) for -// every uncompressed branch traversed. We have considered means of attaching -// to or hiding within an uncompressed branch (in null JPs) a "cache line map" -// or other structure, such as an offset to the next non-null JP, that would -// speed this up, but it seems unnecessary merely to avoid having a -// finite-length list (array). (If JudySL is ever made "native", the finite -// list length will be an issue.) -// -// Restarting at the top of the Judy array after a dead end requires a careful -// modification of *PIndex-1 to decrement the digit for the parent branch and -// set the remaining lower digits to all 1s. This must be repeated each time a -// parent branch contains another dead end, so even though it should all happen -// in cache, the CPU time can be excessive. (For JudySL or an equivalent -// "infinitely deep" Judy array, consider a hybrid of a large, finite, -// "circular" list and a restart-at-top when the list is backtracked to -// exhaustion.) -// -// Why search for *PIndex-1 instead of *PIndex during SM1Get? In rare -// instances this prevents an unnecessary decode down the wrong path followed -// by a backtrack; its pretty cheap to set up initially; and it means the -// SM1Get machine can simply return if/when it finds that Index. -// -// TBD: Wed like to enhance this function to make successive searches faster. -// This would require saving some previous state, including the previous Index -// returned, and in which leaf it was found. If the next call is for the same -// Index and the array has not been modified, start at the same leaf. This -// should be much easier to implement since this is iterative rather than -// recursive code. -// -// VARIATIONS FOR Judy*Next(): -// -// The Judy*Next() code is nearly a perfect mirror of the Judy*Prev() code. -// See the Judy*Prev() overview comments, and mentally switch the following: -// -// - "*PIndex-1" => "*PIndex+1" -// - "less than" => "greater than" -// - "lower" => "higher" -// - "lowest" => "highest" -// - "next-left" => "next-right" -// - "right-most" => "left-most" -// -// Note: SM3Findlimit could be called SM3Findmax/SM3Findmin, but a common name -// for both Prev and Next means many fewer ifdefs in this code. -// -// TBD: Currently this code traverses a JP whether its expanse is partially or -// completely full (populated). For Judy1 (only), since there is no value area -// needed, consider shortcutting to a "success" return upon encountering a full -// JP in SM1Get (or even SM3Findlimit?) A full JP looks like this: -// -// (((JU_JPDCDPOP0(Pjp) ^ cJU_ALLONES) & cJU_POP0MASK(cLevel)) == 0) - -#ifdef JUDY1 -#ifdef JUDYPREV -FUNCTION int Judy1Prev -#else -FUNCTION int Judy1Next -#endif -#else -#ifdef JUDYPREV -FUNCTION PPvoid_t JudyLPrev -#else -FUNCTION PPvoid_t JudyLNext -#endif -#endif - ( - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError // optional, for returning error info. - ) -{ - Pjp_t Pjp, Pjp2; // current JPs. - Pjbl_t Pjbl; // Pjp->jp_Addr masked and cast to types: - Pjbb_t Pjbb; - Pjbu_t Pjbu; - -// Note: The following initialization is not strictly required but it makes -// gcc -Wall happy because there is an "impossible" path from Immed handling to -// SM1LeafLImm code that looks like Pjll might be used before set: - - Pjll_t Pjll = (Pjll_t) NULL; - Word_t state; // current state in SM. - Word_t digit; // next digit to decode from Index. - -// Note: The following initialization is not strictly required but it makes -// gcc -Wall happy because there is an "impossible" path from Immed handling to -// SM1LeafLImm code (for JudyL & JudyPrev only) that looks like pop1 might be -// used before set: - -#if (defined(JUDYL) && defined(JUDYPREV)) - Word_t pop1 = 0; // in a leaf. -#else - Word_t pop1; // in a leaf. -#endif - int offset; // linear branch/leaf, from j__udySearchLeaf*(). - int subexp; // subexpanse in a bitmap branch. - Word_t bitposmask; // bit in bitmap for Index. - -// History for SM2Backtrack: -// -// For a given histnum, APjphist[histnum] is a parent JP that points to a -// branch, and Aoffhist[histnum] is the offset of the NEXT JP in the branch to -// which the parent JP points. The meaning of Aoffhist[histnum] depends on the -// type of branch to which the parent JP points: -// -// Linear: Offset of the next JP in the JP list. -// -// Bitmap: Which subexpanse, plus the offset of the next JP in the -// subexpanses JP list (to avoid bit-counting again), plus for Judy*Next(), -// hidden one byte to the left, which digit, because Judy*Next() also needs -// this. -// -// Uncompressed: Digit, which is actually the offset of the JP in the branch. -// -// Note: Only branch JPs are stored in APjphist[] because, as explained -// earlier, SM1Get shortcuts sideways searches in leaves (and even in branches -// in some cases), so SM2Backtrack only handles branches. - -#define HISTNUMMAX cJU_ROOTSTATE // maximum branches traversable. - Pjp_t APjphist[HISTNUMMAX]; // list of branch JPs traversed. - int Aoffhist[HISTNUMMAX]; // list of next JP offsets; see above. - int histnum = 0; // number of JPs now in list. - - -// ---------------------------------------------------------------------------- -// M A C R O S -// -// These are intended to make the code a bit more readable and less redundant. - - -// "PUSH" AND "POP" Pjp AND offset ON HISTORY STACKS: -// -// Note: Ensure a corrupt Judy array does not overflow *hist[]. Meanwhile, -// underflowing *hist[] simply means theres no more room to backtrack => -// "no previous/next Index". - -#define HISTPUSH(Pjp,Offset) \ - APjphist[histnum] = (Pjp); \ - Aoffhist[histnum] = (Offset); \ - \ - if (++histnum >= HISTNUMMAX) \ - { \ - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT) \ - JUDY1CODE(return(JERRI );) \ - JUDYLCODE(return(PPJERR);) \ - } - -#define HISTPOP(Pjp,Offset) \ - if ((histnum--) < 1) JU_RET_NOTFOUND; \ - (Pjp) = APjphist[histnum]; \ - (Offset) = Aoffhist[histnum] - -// How to pack/unpack Aoffhist[] values for bitmap branches: - -#ifdef JUDYPREV - -#define HISTPUSHBOFF(Subexp,Offset,Digit) \ - (((Subexp) * cJU_BITSPERSUBEXPB) | (Offset)) - -#define HISTPOPBOFF(Subexp,Offset,Digit) \ - (Subexp) = (Offset) / cJU_BITSPERSUBEXPB; \ - (Offset) %= cJU_BITSPERSUBEXPB -#else - -#define HISTPUSHBOFF(Subexp,Offset,Digit) \ - (((Digit) << cJU_BITSPERBYTE) \ - | ((Subexp) * cJU_BITSPERSUBEXPB) | (Offset)) - -#define HISTPOPBOFF(Subexp,Offset,Digit) \ - (Digit) = (Offset) >> cJU_BITSPERBYTE; \ - (Subexp) = ((Offset) & JU_LEASTBYTESMASK(1)) / cJU_BITSPERSUBEXPB; \ - (Offset) %= cJU_BITSPERSUBEXPB -#endif - - -// CHECK FOR NULL JP: - -#define JPNULL(Type) (((Type) >= cJU_JPNULL1) && ((Type) <= cJU_JPNULLMAX)) - - -// SEARCH A BITMAP: -// -// This is a weak analog of j__udySearchLeaf*() for bitmaps. Return the actual -// or next-left position, base 0, of Digit in the single uint32_t bitmap, also -// given a Bitposmask for Digit. -// -// Unlike j__udySearchLeaf*(), the offset is not returned bit-complemented if -// Digits bit is unset, because the caller can check the bitmap themselves to -// determine that. Also, if Digits bit is unset, the returned offset is to -// the next-left JP (including -1), not to the "ideal" position for the Index = -// next-right JP. -// -// Shortcut and skip calling j__udyCountBits*() if the bitmap is full, in which -// case (Digit % cJU_BITSPERSUBEXP*) itself is the base-0 offset. -// -// TBD for Judy*Next(): Should this return next-right instead of next-left? -// That is, +1 from current value? Maybe not, if Digits bit IS set, +1 would -// be wrong. - -#define SEARCHBITMAPB(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPB) ? (Digit % cJU_BITSPERSUBEXPB) : \ - j__udyCountBitsB((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#define SEARCHBITMAPL(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPL) ? (Digit % cJU_BITSPERSUBEXPL) : \ - j__udyCountBitsL((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#ifdef JUDYPREV -// Equivalent to search for the highest offset in Bitmap: - -#define SEARCHBITMAPMAXB(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPB) ? cJU_BITSPERSUBEXPB - 1 : \ - j__udyCountBitsB(Bitmap) - 1) - -#define SEARCHBITMAPMAXL(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPL) ? cJU_BITSPERSUBEXPL - 1 : \ - j__udyCountBitsL(Bitmap) - 1) -#endif - - -// CHECK DECODE BYTES: -// -// Check Decode bytes in a JP against the equivalent portion of *PIndex. If -// *PIndex is lower (for Judy*Prev()) or higher (for Judy*Next()), this JP is a -// dead end (the same as if it had been absent in a linear or bitmap branch or -// null in an uncompressed branch), enter SM2Backtrack; otherwise enter -// SM3Findlimit to find the highest/lowest Index under this JP, as if the code -// had already backtracked to this JP. - -#ifdef JUDYPREV -#define CDcmp__ < -#else -#define CDcmp__ > -#endif - -#define CHECKDCD(cState) \ - if (JU_DCDNOTMATCHINDEX(*PIndex, Pjp, cState)) \ - { \ - if ((*PIndex & cJU_DCDMASK(cState)) \ - CDcmp__(JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(cState))) \ - { \ - goto SM2Backtrack; \ - } \ - goto SM3Findlimit; \ - } - - -// PREPARE TO HANDLE A LEAFW OR JRP BRANCH IN SM1: -// -// Extract a state-dependent digit from Index in a "constant" way, then jump to -// common code for multiple cases. - -#define SM1PREPB(cState,Next) \ - state = (cState); \ - digit = JU_DIGITATSTATE(*PIndex, cState); \ - goto Next - - -// PREPARE TO HANDLE A LEAFW OR JRP BRANCH IN SM3: -// -// Optionally save Dcd bytes into *PIndex, then save state and jump to common -// code for multiple cases. - -#define SM3PREPB_DCD(cState,Next) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - SM3PREPB(cState,Next) - -#define SM3PREPB(cState,Next) state = (cState); goto Next - - -// ---------------------------------------------------------------------------- -// CHECK FOR SHORTCUTS: -// -// Error out if PIndex is null. Execute JU_RET_NOTFOUND if the Judy array is -// empty or *PIndex is already the minimum/maximum Index possible. -// -// Note: As documented, in case of failure *PIndex may be modified. - - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -#ifdef JUDYPREV - if ((PArray == (Pvoid_t) NULL) || ((*PIndex)-- == 0)) -#else - if ((PArray == (Pvoid_t) NULL) || ((*PIndex)++ == cJU_ALLONES)) -#endif - JU_RET_NOTFOUND; - - -// HANDLE JRP: -// -// Before even entering SM1Get, check the JRP type. For JRP branches, traverse -// the JPM; handle LEAFW leaves directly; but look for the most common cases -// first. - -// ROOT-STATE LEAF that starts with a Pop0 word; just look within the leaf: -// -// If *PIndex is in the leaf, return it; otherwise return the Index, if any, -// below where it would belong. - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - pop1 = Pjlw[0] + 1; - - if ((offset = j__udySearchLeafW(Pjlw + 1, pop1, *PIndex)) - >= 0) // Index is present. - { - assert(offset < pop1); // in expected range. - JU_RET_FOUND_LEAFW(Pjlw, pop1, offset); // *PIndex is set. - } - -#ifdef JUDYPREV - if ((offset = ~offset) == 0) // no next-left Index. -#else - if ((offset = ~offset) >= pop1) // no next-right Index. -#endif - JU_RET_NOTFOUND; - - assert(offset <= pop1); // valid result. - -#ifdef JUDYPREV - *PIndex = Pjlw[offset--]; // next-left Index, base 1. -#else - *PIndex = Pjlw[offset + 1]; // next-right Index, base 1. -#endif - JU_RET_FOUND_LEAFW(Pjlw, pop1, offset); // base 0. - - } - else // JRP BRANCH - { - Pjpm_t Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); - -// goto SM1Get; - } - -// ============================================================================ -// STATE MACHINE 1 -- GET INDEX: -// -// Search for *PIndex (already decremented/incremented so as to be inclusive). -// If found, return it. Otherwise in theory hand off to SM2Backtrack or -// SM3Findlimit, but in practice "shortcut" by first sideways searching the -// current branch or leaf upon hitting a dead end. During sideways search, -// modify *PIndex to a new path taken. -// -// ENTRY: Pjp points to next JP to interpret, whose Decode bytes have not yet -// been checked. This JP is not yet listed in history. -// -// Note: Check Decode bytes at the start of each loop, not after looking up a -// new JP, so its easy to do constant shifts/masks, although this requires -// cautious handling of Pjp, offset, and *hist[] for correct entry to -// SM2Backtrack. -// -// EXIT: Return, or branch to SM2Backtrack or SM3Findlimit with correct -// interface, as described elsewhere. -// -// WARNING: For run-time efficiency the following cases replicate code with -// varying constants, rather than using common code with variable values! - -SM1Get: // return here for next branch/leaf. - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_L2: CHECKDCD(2); SM1PREPB(2, SM1BranchL); - case cJU_JPBRANCH_L3: CHECKDCD(3); SM1PREPB(3, SM1BranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: CHECKDCD(4); SM1PREPB(4, SM1BranchL); - case cJU_JPBRANCH_L5: CHECKDCD(5); SM1PREPB(5, SM1BranchL); - case cJU_JPBRANCH_L6: CHECKDCD(6); SM1PREPB(6, SM1BranchL); - case cJU_JPBRANCH_L7: CHECKDCD(7); SM1PREPB(7, SM1BranchL); -#endif - case cJU_JPBRANCH_L: SM1PREPB(cJU_ROOTSTATE, SM1BranchL); - -// Common code (state-independent) for all cases of linear branches: - -SM1BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -// Found JP matching current digit in *PIndex; record parent JP and the next -// JPs offset, and iterate to the next JP: - - if ((offset = j__udySearchLeaf1((Pjll_t) (Pjbl->jbl_Expanse), - Pjbl->jbl_NumJPs, digit)) >= 0) - { - HISTPUSH(Pjp, offset); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM1Get; - } - -// Dead end, no JP in BranchL for next digit in *PIndex: -// -// Get the ideal location of digits JP, and if theres no next-left/right JP -// in the BranchL, shortcut and start backtracking one level up; ignore the -// current Pjp because it points to a BranchL with no next-left/right JP. - -#ifdef JUDYPREV - if ((offset = (~offset) - 1) < 0) // no next-left JP in BranchL. -#else - if ((offset = (~offset)) >= Pjbl->jbl_NumJPs) // no next-right. -#endif - goto SM2Backtrack; - -// Theres a next-left/right JP in the current BranchL; save its digit in -// *PIndex and shortcut to SM3Findlimit: - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Check Decode bytes, if any, in the current JP, then look for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_B2: CHECKDCD(2); SM1PREPB(2, SM1BranchB); - case cJU_JPBRANCH_B3: CHECKDCD(3); SM1PREPB(3, SM1BranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: CHECKDCD(4); SM1PREPB(4, SM1BranchB); - case cJU_JPBRANCH_B5: CHECKDCD(5); SM1PREPB(5, SM1BranchB); - case cJU_JPBRANCH_B6: CHECKDCD(6); SM1PREPB(6, SM1BranchB); - case cJU_JPBRANCH_B7: CHECKDCD(7); SM1PREPB(7, SM1BranchB); -#endif - case cJU_JPBRANCH_B: SM1PREPB(cJU_ROOTSTATE, SM1BranchB); - -// Common code (state-independent) for all cases of bitmap branches: - -SM1BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - -// Locate the digits JP in the subexpanse list, if present, otherwise the -// offset of the next-left JP, if any: - - subexp = digit / cJU_BITSPERSUBEXPB; - assert(subexp < cJU_NUMSUBEXPB); // falls in expected range. - bitposmask = JU_BITPOSMASKB(digit); - offset = SEARCHBITMAPB(JU_JBB_BITMAP(Pjbb, subexp), digit, - bitposmask); - // right range: - assert((offset >= -1) && (offset < (int) cJU_BITSPERSUBEXPB)); - -// Found JP matching current digit in *PIndex: -// -// Record the parent JP and the next JPs offset; and iterate to the next JP. - -// if (JU_BITMAPTESTB(Pjbb, digit)) // slower. - if (JU_JBB_BITMAP(Pjbb, subexp) & bitposmask) // faster. - { - // not negative since at least one bit is set: - assert(offset >= 0); - - HISTPUSH(Pjp, HISTPUSHBOFF(subexp, offset, digit)); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM1Get; // iterate to next JP. - } - -// Dead end, no JP in BranchB for next digit in *PIndex: -// -// If theres a next-left/right JP in the current BranchB, shortcut to -// SM3Findlimit. Note: offset is already set to the correct value for the -// next-left/right JP. - -#ifdef JUDYPREV - if (offset >= 0) // next-left JP is in this subexpanse. - goto SM1BranchBFindlimit; - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JBB_BITMAP(Pjbb, subexp) & JU_MASKHIGHEREXC(bitposmask)) - { - ++offset; // next-left => next-right. - goto SM1BranchBFindlimit; - } - - while (++subexp < cJU_NUMSUBEXPB) // search next-right subexps. -#endif - { - if (! JU_JBB_PJP(Pjbb, subexp)) continue; // empty subexpanse. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - offset = 0; -#endif - -// Save the next-left/right JPs digit in *PIndex: - -SM1BranchBFindlimit: - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), - offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchB: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a BranchB with no next-left/right JP. - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Check Decode bytes, if any, in the current JP, then look for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_U2: CHECKDCD(2); SM1PREPB(2, SM1BranchU); - case cJU_JPBRANCH_U3: CHECKDCD(3); SM1PREPB(3, SM1BranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: CHECKDCD(4); SM1PREPB(4, SM1BranchU); - case cJU_JPBRANCH_U5: CHECKDCD(5); SM1PREPB(5, SM1BranchU); - case cJU_JPBRANCH_U6: CHECKDCD(6); SM1PREPB(6, SM1BranchU); - case cJU_JPBRANCH_U7: CHECKDCD(7); SM1PREPB(7, SM1BranchU); -#endif - case cJU_JPBRANCH_U: SM1PREPB(cJU_ROOTSTATE, SM1BranchU); - -// Common code (state-independent) for all cases of uncompressed branches: - -SM1BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - Pjp2 = (Pjbu->jbu_jp) + digit; - -// Found JP matching current digit in *PIndex: -// -// Record the parent JP and the next JPs digit, and iterate to the next JP. -// -// TBD: Instead of this, just goto SM1Get, and add cJU_JPNULL* cases to the -// SM1Get state machine? Then backtrack? However, it means you cant detect -// an inappropriate cJU_JPNULL*, when it occurs in other than a BranchU, and -// return JU_RET_CORRUPT. - - if (! JPNULL(JU_JPTYPE(Pjp2))) // digit has a JP. - { - HISTPUSH(Pjp, digit); - Pjp = Pjp2; - goto SM1Get; - } - -// Dead end, no JP in BranchU for next digit in *PIndex: -// -// Search for a next-left/right JP in the current BranchU, and if one is found, -// save its digit in *PIndex and shortcut to SM3Findlimit: - -#ifdef JUDYPREV - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - while (digit < cJU_BRANCHUNUMJPS - 1) - { - Pjp = (Pjbu->jbu_jp) + (++digit); -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchU: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a BranchU with no next-left/right JP. - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for -// *PIndex. - -#define SM1LEAFL(Func) \ - Pjll = P_JLL(Pjp->jp_Addr); \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - offset = Func(Pjll, pop1, *PIndex); \ - goto SM1LeafLImm - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKDCD(1); SM1LEAFL(j__udySearchLeaf1); -#endif - case cJU_JPLEAF2: CHECKDCD(2); SM1LEAFL(j__udySearchLeaf2); - case cJU_JPLEAF3: CHECKDCD(3); SM1LEAFL(j__udySearchLeaf3); - -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKDCD(4); SM1LEAFL(j__udySearchLeaf4); - case cJU_JPLEAF5: CHECKDCD(5); SM1LEAFL(j__udySearchLeaf5); - case cJU_JPLEAF6: CHECKDCD(6); SM1LEAFL(j__udySearchLeaf6); - case cJU_JPLEAF7: CHECKDCD(7); SM1LEAFL(j__udySearchLeaf7); -#endif - -// Common code (state-independent) for all cases of linear leaves and -// immediates: - -SM1LeafLImm: - if (offset >= 0) // *PIndex is in LeafL / Immed. -#ifdef JUDY1 - JU_RET_FOUND; -#else - { // JudyL is trickier... - switch (JU_JPTYPE(Pjp)) - { -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - case cJU_JPLEAF2: JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - case cJU_JPLEAF3: JU_RET_FOUND_LEAF3(Pjll, pop1, offset); -#ifdef JU_64BIT - case cJU_JPLEAF4: JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - case cJU_JPLEAF5: JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - case cJU_JPLEAF6: JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - case cJU_JPLEAF7: JU_RET_FOUND_LEAF7(Pjll, pop1, offset); -#endif - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - JU_RET_FOUND_IMM_01(Pjp); - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#ifdef JU_64BIT - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: - case cJU_JPIMMED_3_02: -#endif - JU_RET_FOUND_IMM(Pjp, offset); - } - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // impossible? - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // found *PIndex - -#endif // JUDYL - -// Dead end, no Index in LeafL / Immed for remaining digit(s) in *PIndex: -// -// Get the ideal location of Index, and if theres no next-left/right Index in -// the LeafL / Immed, shortcut and start backtracking one level up; ignore the -// current Pjp because it points to a LeafL / Immed with no next-left/right -// Index. - -#ifdef JUDYPREV - if ((offset = (~offset) - 1) < 0) // no next-left Index. -#else - if ((offset = (~offset)) >= pop1) // no next-right Index. -#endif - goto SM2Backtrack; - -// Theres a next-left/right Index in the current LeafL / Immed; shortcut by -// copying its digit(s) to *PIndex and returning it. -// -// Unfortunately this is pretty hairy, especially avoiding endian issues. -// -// The cJU_JPLEAF* cases are very similar to same-index-size cJU_JPIMMED* cases -// for *_02 and above, but must return differently, at least for JudyL, so -// spell them out separately here at the cost of a little redundant code for -// Judy1. - - switch (JU_JPTYPE(Pjp)) - { -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]); - JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - - case cJU_JPLEAF2: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - - case cJU_JPLEAF3: - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - -#ifdef JU_64BIT - case cJU_JPLEAF4: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - - case cJU_JPLEAF5: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - } - - case cJU_JPLEAF6: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - } - - case cJU_JPLEAF7: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_LEAF7(Pjll, pop1, offset); - } - -#endif // JU_64BIT - -#define SET_01(cState) JU_SETDIGITS(*PIndex, JU_JPDCDPOP0(Pjp), cState) - - case cJU_JPIMMED_1_01: SET_01(1); goto SM1Imm_01; - case cJU_JPIMMED_2_01: SET_01(2); goto SM1Imm_01; - case cJU_JPIMMED_3_01: SET_01(3); goto SM1Imm_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: SET_01(4); goto SM1Imm_01; - case cJU_JPIMMED_5_01: SET_01(5); goto SM1Imm_01; - case cJU_JPIMMED_6_01: SET_01(6); goto SM1Imm_01; - case cJU_JPIMMED_7_01: SET_01(7); goto SM1Imm_01; -#endif -SM1Imm_01: JU_RET_FOUND_IMM_01(Pjp); - -// Shorthand for where to find start of Index bytes array: - -#ifdef JUDY1 -#define PJI (Pjp->jp_1Index) -#else -#define PJI (Pjp->jp_LIndex) -#endif - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]); - JU_RET_FOUND_IMM(Pjp, offset); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: - case cJ1_JPIMMED_4_03: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); - - case cJ1_JPIMMED_5_02: - case cJ1_JPIMMED_5_03: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_6_02: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_7_02: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - -#endif // (JUDY1 && JU_64BIT) - - } // switch for not-found *PIndex - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // impossible? - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Check Decode bytes, if any, in the current JP, then look in the leaf for -// *PIndex. - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; - CHECKDCD(1); - - Pjlb = P_JLB(Pjp->jp_Addr); - digit = JU_DIGITATSTATE(*PIndex, 1); - subexp = JU_SUBEXPL(digit); - bitposmask = JU_BITPOSMASKL(digit); - assert(subexp < cJU_NUMSUBEXPL); // falls in expected range. - -// *PIndex exists in LeafB1: - -// if (JU_BITMAPTESTL(Pjlb, digit)) // slower. - if (JU_JLB_BITMAP(Pjlb, subexp) & bitposmask) // faster. - { -#ifdef JUDYL // needs offset at this point: - offset = SEARCHBITMAPL(JU_JLB_BITMAP(Pjlb, subexp), digit, bitposmask); -#endif - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - } - -// Dead end, no Index in LeafB1 for remaining digit in *PIndex: -// -// If theres a next-left/right Index in the current LeafB1, which for -// Judy*Next() is true if any bits are set for higher Indexes, shortcut by -// returning it. Note: For Judy*Prev(), offset is set here to the correct -// value for the next-left JP. - - offset = SEARCHBITMAPL(JU_JLB_BITMAP(Pjlb, subexp), digit, - bitposmask); - // right range: - assert((offset >= -1) && (offset < (int) cJU_BITSPERSUBEXPL)); - -#ifdef JUDYPREV - if (offset >= 0) // next-left JP is in this subexpanse. - goto SM1LeafB1Findlimit; - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JLB_BITMAP(Pjlb, subexp) & JU_MASKHIGHEREXC(bitposmask)) - { - ++offset; // next-left => next-right. - goto SM1LeafB1Findlimit; - } - - while (++subexp < cJU_NUMSUBEXPL) // search next-right subexps. -#endif - { - if (! JU_JLB_BITMAP(Pjlb, subexp)) continue; // empty subexp. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXL(JU_JLB_BITMAP(Pjlb, subexp)); - // expected range: - assert((offset >= 0) && (offset < (int) cJU_BITSPERSUBEXPL)); -#else - offset = 0; -#endif - -// Save the next-left/right Indexess digit in *PIndex: - -SM1LeafB1Findlimit: - JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset); - JU_SETDIGIT1(*PIndex, digit); - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - } - -// Theres no next-left/right Index in the LeafB1: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a LeafB1 with no next-left/right Index. - - goto SM2Backtrack; - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// If the Decode bytes match, *PIndex is found (without modification). - - case cJ1_JPFULLPOPU1: - - CHECKDCD(1); - JU_RET_FOUND_FULLPOPU1; -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: - -#ifdef JUDYPREV -#define SM1IMM_SETPOP1(cPop1) -#else -#define SM1IMM_SETPOP1(cPop1) pop1 = (cPop1) -#endif - -#define SM1IMM(Func,cPop1) \ - SM1IMM_SETPOP1(cPop1); \ - offset = Func((Pjll_t) (PJI), cPop1, *PIndex); \ - goto SM1LeafLImm - -// Special case for Pop1 = 1 Immediate JPs: -// -// If *PIndex is in the immediate, offset is 0, otherwise the binary NOT of the -// offset where it belongs, 0 or 1, same as from the search functions. - -#ifdef JUDYPREV -#define SM1IMM_01_SETPOP1 -#else -#define SM1IMM_01_SETPOP1 pop1 = 1 -#endif - -#define SM1IMM_01 \ - SM1IMM_01_SETPOP1; \ - offset = ((JU_JPDCDPOP0(Pjp) < JU_TRIMTODCDSIZE(*PIndex)) ? ~1 : \ - (JU_JPDCDPOP0(Pjp) == JU_TRIMTODCDSIZE(*PIndex)) ? 0 : \ - ~0); \ - goto SM1LeafLImm - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - SM1IMM_01; - -// TBD: Doug says it would be OK to have fewer calls and calculate arg 2, here -// and in Judy*Count() also. - - case cJU_JPIMMED_1_02: SM1IMM(j__udySearchLeaf1, 2); - case cJU_JPIMMED_1_03: SM1IMM(j__udySearchLeaf1, 3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: SM1IMM(j__udySearchLeaf1, 4); - case cJU_JPIMMED_1_05: SM1IMM(j__udySearchLeaf1, 5); - case cJU_JPIMMED_1_06: SM1IMM(j__udySearchLeaf1, 6); - case cJU_JPIMMED_1_07: SM1IMM(j__udySearchLeaf1, 7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: SM1IMM(j__udySearchLeaf1, 8); - case cJ1_JPIMMED_1_09: SM1IMM(j__udySearchLeaf1, 9); - case cJ1_JPIMMED_1_10: SM1IMM(j__udySearchLeaf1, 10); - case cJ1_JPIMMED_1_11: SM1IMM(j__udySearchLeaf1, 11); - case cJ1_JPIMMED_1_12: SM1IMM(j__udySearchLeaf1, 12); - case cJ1_JPIMMED_1_13: SM1IMM(j__udySearchLeaf1, 13); - case cJ1_JPIMMED_1_14: SM1IMM(j__udySearchLeaf1, 14); - case cJ1_JPIMMED_1_15: SM1IMM(j__udySearchLeaf1, 15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: SM1IMM(j__udySearchLeaf2, 2); - case cJU_JPIMMED_2_03: SM1IMM(j__udySearchLeaf2, 3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: SM1IMM(j__udySearchLeaf2, 4); - case cJ1_JPIMMED_2_05: SM1IMM(j__udySearchLeaf2, 5); - case cJ1_JPIMMED_2_06: SM1IMM(j__udySearchLeaf2, 6); - case cJ1_JPIMMED_2_07: SM1IMM(j__udySearchLeaf2, 7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: SM1IMM(j__udySearchLeaf3, 2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: SM1IMM(j__udySearchLeaf3, 3); - case cJ1_JPIMMED_3_04: SM1IMM(j__udySearchLeaf3, 4); - case cJ1_JPIMMED_3_05: SM1IMM(j__udySearchLeaf3, 5); - - case cJ1_JPIMMED_4_02: SM1IMM(j__udySearchLeaf4, 2); - case cJ1_JPIMMED_4_03: SM1IMM(j__udySearchLeaf4, 3); - - case cJ1_JPIMMED_5_02: SM1IMM(j__udySearchLeaf5, 2); - case cJ1_JPIMMED_5_03: SM1IMM(j__udySearchLeaf5, 3); - - case cJ1_JPIMMED_6_02: SM1IMM(j__udySearchLeaf6, 2); - - case cJ1_JPIMMED_7_02: SM1IMM(j__udySearchLeaf7, 2); -#endif - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM1Get switch. - - /*NOTREACHED*/ - - -// ============================================================================ -// STATE MACHINE 2 -- BACKTRACK BRANCH TO PREVIOUS JP: -// -// Look for the next-left/right JP in a branch, backing up the history list as -// necessary. Upon finding a next-left/right JP, modify the corresponding -// digit in *PIndex before passing control to SM3Findlimit. -// -// Note: As described earlier, only branch JPs are expected here; other types -// fall into the default case. -// -// Note: If a found JP contains needed Dcd bytes, thats OK, theyre copied to -// *PIndex in SM3Findlimit. -// -// TBD: This code has a lot in common with similar code in the shortcut cases -// in SM1Get. Can combine this code somehow? -// -// ENTRY: List, possibly empty, of JPs and offsets in APjphist[] and -// Aoffhist[]; see earlier comments. -// -// EXIT: Execute JU_RET_NOTFOUND if no previous/next JP; otherwise jump to -// SM3Findlimit to resume a new but different downward search. - -SM2Backtrack: // come or return here for first/next sideways search. - - HISTPOP(Pjp, offset); - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: - - case cJU_JPBRANCH_L2: state = 2; goto SM2BranchL; - case cJU_JPBRANCH_L3: state = 3; goto SM2BranchL; -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: state = 4; goto SM2BranchL; - case cJU_JPBRANCH_L5: state = 5; goto SM2BranchL; - case cJU_JPBRANCH_L6: state = 6; goto SM2BranchL; - case cJU_JPBRANCH_L7: state = 7; goto SM2BranchL; -#endif - case cJU_JPBRANCH_L: state = cJU_ROOTSTATE; goto SM2BranchL; - -SM2BranchL: -#ifdef JUDYPREV - if (--offset < 0) goto SM2Backtrack; // no next-left JP in BranchL. -#endif - Pjbl = P_JBL(Pjp->jp_Addr); -#ifdef JUDYNEXT - if (++offset >= (Pjbl->jbl_NumJPs)) goto SM2Backtrack; - // no next-right JP in BranchL. -#endif - -// Theres a next-left/right JP in the current BranchL; save its digit in -// *PIndex and continue with SM3Findlimit: - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: - - case cJU_JPBRANCH_B2: state = 2; goto SM2BranchB; - case cJU_JPBRANCH_B3: state = 3; goto SM2BranchB; -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: state = 4; goto SM2BranchB; - case cJU_JPBRANCH_B5: state = 5; goto SM2BranchB; - case cJU_JPBRANCH_B6: state = 6; goto SM2BranchB; - case cJU_JPBRANCH_B7: state = 7; goto SM2BranchB; -#endif - case cJU_JPBRANCH_B: state = cJU_ROOTSTATE; goto SM2BranchB; - -SM2BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - HISTPOPBOFF(subexp, offset, digit); // unpack values. - -// If theres a next-left/right JP in the current BranchB, which for -// Judy*Next() is true if any bits are set for higher Indexes, continue to -// SM3Findlimit: -// -// Note: offset is set to the JP previously traversed; go one to the -// left/right. - -#ifdef JUDYPREV - if (offset > 0) // next-left JP is in this subexpanse. - { - --offset; - goto SM2BranchBFindlimit; - } - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JBB_BITMAP(Pjbb, subexp) - & JU_MASKHIGHEREXC(JU_BITPOSMASKB(digit))) - { - ++offset; // next-left => next-right. - goto SM2BranchBFindlimit; - } - - while (++subexp < cJU_NUMSUBEXPB) // search next-right subexps. -#endif - { - if (! JU_JBB_PJP(Pjbb, subexp)) continue; // empty subexpanse. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - offset = 0; -#endif - -// Save the next-left/right JPs digit in *PIndex: - -SM2BranchBFindlimit: - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), - offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchB: - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: - - case cJU_JPBRANCH_U2: state = 2; goto SM2BranchU; - case cJU_JPBRANCH_U3: state = 3; goto SM2BranchU; -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: state = 4; goto SM2BranchU; - case cJU_JPBRANCH_U5: state = 5; goto SM2BranchU; - case cJU_JPBRANCH_U6: state = 6; goto SM2BranchU; - case cJU_JPBRANCH_U7: state = 7; goto SM2BranchU; -#endif - case cJU_JPBRANCH_U: state = cJU_ROOTSTATE; goto SM2BranchU; - -SM2BranchU: - -// Search for a next-left/right JP in the current BranchU, and if one is found, -// save its digit in *PIndex and continue to SM3Findlimit: - - Pjbu = P_JBU(Pjp->jp_Addr); - digit = offset; - -#ifdef JUDYPREV - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - while (digit < cJU_BRANCHUNUMJPS - 1) - { - Pjp = (Pjbu->jbu_jp) + (++digit); -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchU: - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM2Backtrack switch. - - /*NOTREACHED*/ - - -// ============================================================================ -// STATE MACHINE 3 -- FIND LIMIT JP/INDEX: -// -// Look for the highest/lowest (right/left-most) JP in each branch and the -// highest/lowest Index in a leaf or immediate, and return it. While -// traversing, modify appropriate digit(s) in *PIndex to reflect the path -// taken, including Dcd bytes in each JP (which could hold critical missing -// digits for skipped branches). -// -// ENTRY: Pjp set to a JP under which to find max/min JPs (if a branch JP) or -// a max/min Index and return (if a leaf or immediate JP). -// -// EXIT: Execute JU_RET_FOUND* upon reaching a leaf or immediate. Should be -// impossible to fail, unless the Judy array is corrupt. - -SM3Findlimit: // come or return here for first/next branch/leaf. - - switch (JU_JPTYPE(Pjp)) - { -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Simply use the highest/lowest (right/left-most) JP in the BranchL, but first -// copy the Dcd bytes to *PIndex if there are any (only if state < -// cJU_ROOTSTATE - 1). - - case cJU_JPBRANCH_L2: SM3PREPB_DCD(2, SM3BranchL); -#ifndef JU_64BIT - case cJU_JPBRANCH_L3: SM3PREPB( 3, SM3BranchL); -#else - case cJU_JPBRANCH_L3: SM3PREPB_DCD(3, SM3BranchL); - case cJU_JPBRANCH_L4: SM3PREPB_DCD(4, SM3BranchL); - case cJU_JPBRANCH_L5: SM3PREPB_DCD(5, SM3BranchL); - case cJU_JPBRANCH_L6: SM3PREPB_DCD(6, SM3BranchL); - case cJU_JPBRANCH_L7: SM3PREPB( 7, SM3BranchL); -#endif - case cJU_JPBRANCH_L: SM3PREPB( cJU_ROOTSTATE, SM3BranchL); - -SM3BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -#ifdef JUDYPREV - if ((offset = (Pjbl->jbl_NumJPs) - 1) < 0) -#else - offset = 0; if ((Pjbl->jbl_NumJPs) == 0) -#endif - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Look for the highest/lowest (right/left-most) non-null subexpanse, then use -// the highest/lowest JP in that subexpanse, but first copy Dcd bytes, if there -// are any (only if state < cJU_ROOTSTATE - 1), to *PIndex. - - case cJU_JPBRANCH_B2: SM3PREPB_DCD(2, SM3BranchB); -#ifndef JU_64BIT - case cJU_JPBRANCH_B3: SM3PREPB( 3, SM3BranchB); -#else - case cJU_JPBRANCH_B3: SM3PREPB_DCD(3, SM3BranchB); - case cJU_JPBRANCH_B4: SM3PREPB_DCD(4, SM3BranchB); - case cJU_JPBRANCH_B5: SM3PREPB_DCD(5, SM3BranchB); - case cJU_JPBRANCH_B6: SM3PREPB_DCD(6, SM3BranchB); - case cJU_JPBRANCH_B7: SM3PREPB( 7, SM3BranchB); -#endif - case cJU_JPBRANCH_B: SM3PREPB( cJU_ROOTSTATE, SM3BranchB); - -SM3BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); -#ifdef JUDYPREV - subexp = cJU_NUMSUBEXPB; - - while (! (JU_JBB_BITMAP(Pjbb, --subexp))) // find non-empty subexp. - { - if (subexp <= 0) // wholly empty bitmap. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - subexp = -1; - - while (! (JU_JBB_BITMAP(Pjbb, ++subexp))) // find non-empty subexp. - { - if (subexp >= cJU_NUMSUBEXPB - 1) // didnt find one. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = 0; -#endif - - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Look for the highest/lowest (right/left-most) non-null JP, and use it, but -// first copy Dcd bytes to *PIndex if there are any (only if state < -// cJU_ROOTSTATE - 1). - - case cJU_JPBRANCH_U2: SM3PREPB_DCD(2, SM3BranchU); -#ifndef JU_64BIT - case cJU_JPBRANCH_U3: SM3PREPB( 3, SM3BranchU); -#else - case cJU_JPBRANCH_U3: SM3PREPB_DCD(3, SM3BranchU); - case cJU_JPBRANCH_U4: SM3PREPB_DCD(4, SM3BranchU); - case cJU_JPBRANCH_U5: SM3PREPB_DCD(5, SM3BranchU); - case cJU_JPBRANCH_U6: SM3PREPB_DCD(6, SM3BranchU); - case cJU_JPBRANCH_U7: SM3PREPB( 7, SM3BranchU); -#endif - case cJU_JPBRANCH_U: SM3PREPB( cJU_ROOTSTATE, SM3BranchU); - -SM3BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); -#ifdef JUDYPREV - digit = cJU_BRANCHUNUMJPS; - - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - - for (digit = 0; digit < cJU_BRANCHUNUMJPS; ++digit) - { - Pjp = (Pjbu->jbu_jp) + digit; -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// No non-null JPs in BranchU: - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Simply use the highest/lowest (right/left-most) Index in the LeafL, but the -// details vary depending on leaf Index Size. First copy Dcd bytes, if there -// are any (only if state < cJU_ROOTSTATE - 1), to *PIndex. - -#define SM3LEAFLDCD(cState) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - SM3LEAFLNODCD - -#ifdef JUDY1 -#define SM3LEAFL_SETPOP1 // not needed in any cases. -#else -#define SM3LEAFL_SETPOP1 pop1 = JU_JPLEAF_POP0(Pjp) + 1 -#endif - -#ifdef JUDYPREV -#define SM3LEAFLNODCD \ - Pjll = P_JLL(Pjp->jp_Addr); \ - SM3LEAFL_SETPOP1; \ - offset = JU_JPLEAF_POP0(Pjp); assert(offset >= 0) -#else -#define SM3LEAFLNODCD \ - Pjll = P_JLL(Pjp->jp_Addr); \ - SM3LEAFL_SETPOP1; \ - offset = 0; assert(JU_JPLEAF_POP0(Pjp) >= 0); -#endif - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - SM3LEAFLDCD(1); - JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]); - JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - - case cJU_JPLEAF2: - - SM3LEAFLDCD(2); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - -#ifndef JU_64BIT - case cJU_JPLEAF3: - { - Word_t lsb; - SM3LEAFLNODCD; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - -#else - case cJU_JPLEAF3: - { - Word_t lsb; - SM3LEAFLDCD(3); - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - - case cJU_JPLEAF4: - - SM3LEAFLDCD(4); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - - case cJU_JPLEAF5: - { - Word_t lsb; - SM3LEAFLDCD(5); - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - } - - case cJU_JPLEAF6: - { - Word_t lsb; - SM3LEAFLDCD(6); - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - } - - case cJU_JPLEAF7: - { - Word_t lsb; - SM3LEAFLNODCD; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_LEAF7(Pjll, pop1, offset); - } -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Look for the highest/lowest (right/left-most) non-null subexpanse, then use -// the highest/lowest Index in that subexpanse, but first copy Dcd bytes -// (always present since state 1 < cJU_ROOTSTATE) to *PIndex. - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; - - JU_SETDCD(*PIndex, Pjp, 1); - - Pjlb = P_JLB(Pjp->jp_Addr); -#ifdef JUDYPREV - subexp = cJU_NUMSUBEXPL; - - while (! JU_JLB_BITMAP(Pjlb, --subexp)) // find non-empty subexp. - { - if (subexp <= 0) // wholly empty bitmap. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - -// TBD: Might it be faster to just use a variant of BITMAPDIGIT*() that yields -// the digit for the right-most Index with a bit set? - - offset = SEARCHBITMAPMAXL(JU_JLB_BITMAP(Pjlb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPL)); -#else - subexp = -1; - - while (! JU_JLB_BITMAP(Pjlb, ++subexp)) // find non-empty subexp. - { - if (subexp >= cJU_NUMSUBEXPL - 1) // didnt find one. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = 0; -#endif - - JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset); - JU_SETDIGIT1(*PIndex, digit); - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// Copy Dcd bytes to *PIndex (always present since state 1 < cJU_ROOTSTATE), -// then set the highest/lowest possible digit as the LSB in *PIndex. - - case cJ1_JPFULLPOPU1: - - JU_SETDCD( *PIndex, Pjp, 1); -#ifdef JUDYPREV - JU_SETDIGIT1(*PIndex, cJU_BITSPERBITMAP - 1); -#else - JU_SETDIGIT1(*PIndex, 0); -#endif - JU_RET_FOUND_FULLPOPU1; -#endif // JUDY1 - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: -// -// Simply use the highest/lowest (right/left-most) Index in the Imm, but the -// details vary depending on leaf Index Size and pop1. Note: There are no Dcd -// bytes in an Immediate JP, but in a cJU_JPIMMED_*_01 JP, the field holds the -// least bytes of the immediate Index. - - case cJU_JPIMMED_1_01: SET_01(1); goto SM3Imm_01; - case cJU_JPIMMED_2_01: SET_01(2); goto SM3Imm_01; - case cJU_JPIMMED_3_01: SET_01(3); goto SM3Imm_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: SET_01(4); goto SM3Imm_01; - case cJU_JPIMMED_5_01: SET_01(5); goto SM3Imm_01; - case cJU_JPIMMED_6_01: SET_01(6); goto SM3Imm_01; - case cJU_JPIMMED_7_01: SET_01(7); goto SM3Imm_01; -#endif -SM3Imm_01: JU_RET_FOUND_IMM_01(Pjp); - -#ifdef JUDYPREV -#define SM3IMM_OFFSET(cPop1) (cPop1) - 1 // highest. -#else -#define SM3IMM_OFFSET(cPop1) 0 // lowest. -#endif - -#define SM3IMM(cPop1,Next) \ - offset = SM3IMM_OFFSET(cPop1); \ - goto Next - - case cJU_JPIMMED_1_02: SM3IMM( 2, SM3Imm1); - case cJU_JPIMMED_1_03: SM3IMM( 3, SM3Imm1); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: SM3IMM( 4, SM3Imm1); - case cJU_JPIMMED_1_05: SM3IMM( 5, SM3Imm1); - case cJU_JPIMMED_1_06: SM3IMM( 6, SM3Imm1); - case cJU_JPIMMED_1_07: SM3IMM( 7, SM3Imm1); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: SM3IMM( 8, SM3Imm1); - case cJ1_JPIMMED_1_09: SM3IMM( 9, SM3Imm1); - case cJ1_JPIMMED_1_10: SM3IMM(10, SM3Imm1); - case cJ1_JPIMMED_1_11: SM3IMM(11, SM3Imm1); - case cJ1_JPIMMED_1_12: SM3IMM(12, SM3Imm1); - case cJ1_JPIMMED_1_13: SM3IMM(13, SM3Imm1); - case cJ1_JPIMMED_1_14: SM3IMM(14, SM3Imm1); - case cJ1_JPIMMED_1_15: SM3IMM(15, SM3Imm1); -#endif - -SM3Imm1: JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]); - JU_RET_FOUND_IMM(Pjp, offset); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: SM3IMM(2, SM3Imm2); - case cJU_JPIMMED_2_03: SM3IMM(3, SM3Imm2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: SM3IMM(4, SM3Imm2); - case cJ1_JPIMMED_2_05: SM3IMM(5, SM3Imm2); - case cJ1_JPIMMED_2_06: SM3IMM(6, SM3Imm2); - case cJ1_JPIMMED_2_07: SM3IMM(7, SM3Imm2); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -SM3Imm2: *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: SM3IMM(2, SM3Imm3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: SM3IMM(3, SM3Imm3); - case cJ1_JPIMMED_3_04: SM3IMM(4, SM3Imm3); - case cJ1_JPIMMED_3_05: SM3IMM(5, SM3Imm3); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -SM3Imm3: - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: SM3IMM(2, SM3Imm4); - case cJ1_JPIMMED_4_03: SM3IMM(3, SM3Imm4); - -SM3Imm4: *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); - - case cJ1_JPIMMED_5_02: SM3IMM(2, SM3Imm5); - case cJ1_JPIMMED_5_03: SM3IMM(3, SM3Imm5); - -SM3Imm5: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_6_02: SM3IMM(2, SM3Imm6); - -SM3Imm6: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_7_02: SM3IMM(2, SM3Imm7); - -SM3Imm7: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif // (JUDY1 && JU_64BIT) - - -// ---------------------------------------------------------------------------- -// OTHER CASES: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM3Findlimit switch. - - /*NOTREACHED*/ - -} // Judy1Prev() / Judy1Next() / JudyLPrev() / JudyLNext() diff --git a/libjudy/src/Judy1/Judy1PrevEmpty.c b/libjudy/src/Judy1/Judy1PrevEmpty.c deleted file mode 100644 index 96a5901e3d..0000000000 --- a/libjudy/src/Judy1/Judy1PrevEmpty.c +++ /dev/null @@ -1,1390 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.32 $ $Source: /judy/src/JudyCommon/JudyPrevNextEmpty.c $ -// -// Judy*PrevEmpty() and Judy*NextEmpty() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DJUDYNEXT for the Judy*NextEmpty() function; otherwise -// defaults to Judy*PrevEmpty(). -// -// Compile with -DTRACEJPSE to trace JP traversals. -// -// This file is separate from JudyPrevNext.c because it differs too greatly for -// ifdefs. This might be a bit surprising, but there are two reasons: -// -// - First, down in the details, searching for an empty index (SearchEmpty) is -// remarkably asymmetric with searching for a valid index (SearchValid), -// mainly with respect to: No return of a value area for JudyL; partially- -// full versus totally-full JPs; and handling of narrow pointers. -// -// - Second, we chose to implement SearchEmpty without a backtrack stack or -// backtrack engine, partly as an experiment, and partly because we think -// restarting from the top of the tree is less likely for SearchEmpty than -// for SearchValid, because empty indexes are more likely than valid indexes. -// -// A word about naming: A prior version of this feature (see 4.13) was named -// Judy*Free(), but there were concerns about that being read as a verb rather -// than an adjective. After prolonged debate and based on user input, we -// changed "Free" to "Empty". - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifndef JUDYNEXT -#ifndef JUDYPREV -#define JUDYPREV 1 // neither set => use default. -#endif -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -#ifdef TRACEJPSE -#include "JudyPrintJP.c" -#endif - - -// **************************************************************************** -// J U D Y 1 P R E V E M P T Y -// J U D Y 1 N E X T E M P T Y -// J U D Y L P R E V E M P T Y -// J U D Y L N E X T E M P T Y -// -// See the manual entry for the API. -// -// OVERVIEW OF Judy*PrevEmpty() / Judy*NextEmpty(): -// -// See also for comparison the equivalent comments in JudyPrevNext.c. -// -// Take the callers *PIndex and subtract/add 1, but watch out for -// underflow/overflow, which means "no previous/next empty index found." Use a -// reentrant switch statement (state machine, see SMGetRestart and -// SMGetContinue) to decode Index, starting with the JRP (PArray), through a -// JPM and branches, if any, down to an immediate or a leaf. Look for Index in -// that immediate or leaf, and if not found (invalid index), return success -// (Index is empty). -// -// This search can result in a dead end where taking a different path is -// required. There are four kinds of dead ends: -// -// BRANCH PRIMARY dead end: Encountering a fully-populated JP for the -// appropriate digit in Index. Search sideways in the branch for the -// previous/next absent/null/non-full JP, and if one is found, set Index to the -// highest/lowest index possible in that JPs expanse. Then if the JP is an -// absent or null JP, return success; otherwise for a non-full JP, traverse -// through the partially populated JP. -// -// BRANCH SECONDARY dead end: Reaching the end of a branch during a sideways -// search after a branch primary dead end. Set Index to the lowest/highest -// index possible in the whole branchs expanse (one higher/lower than the -// previous/next branchs expanse), then restart at the top of the tree, which -// includes pre-decrementing/incrementing Index (again) and watching for -// underflow/overflow (again). -// -// LEAF PRIMARY dead end: Finding a valid (non-empty) index in an immediate or -// leaf matching Index. Search sideways in the immediate/leaf for the -// previous/next empty index; if found, set *PIndex to match and return success. -// -// LEAF SECONDARY dead end: Reaching the end of an immediate or leaf during a -// sideways search after a leaf primary dead end. Just as for a branch -// secondary dead end, restart at the top of the tree with Index set to the -// lowest/highest index possible in the whole immediate/leafs expanse. -// TBD: If leaf secondary dead end occurs, could shortcut and treat it as a -// branch primary dead end; but this would require remembering the parent -// branchs type and offset (a "one-deep stack"), and also wrestling with -// narrow pointers, at least for leaves (but not for immediates). -// -// Note some ASYMMETRIES between SearchValid and SearchEmpty: -// -// - The SearchValid code, upon descending through a narrow pointer, if Index -// is outside the expanse of the subsidiary node (effectively a secondary -// dead end), must decide whether to backtrack or findlimit. But the -// SearchEmpty code simply returns success (Index is empty). -// -// - Similarly, the SearchValid code, upon finding no previous/next index in -// the expanse of a narrow pointer (again, a secondary dead end), can simply -// start to backtrack at the parent JP. But the SearchEmpty code would have -// to first determine whether or not the parent JPs narrow expanse contains -// a previous/next empty index outside the subexpanse. Rather than keeping a -// parent state stack and backtracking this way, upon a secondary dead end, -// the SearchEmpty code simply restarts at the top of the tree, whether or -// not a narrow pointer is involved. Again, see the equivalent comments in -// JudyPrevNext.c for comparison. -// -// This function is written iteratively for speed, rather than recursively. -// -// TBD: Wed like to enhance this function to make successive searches faster. -// This would require saving some previous state, including the previous Index -// returned, and in which leaf it was found. If the next call is for the same -// Index and the array has not been modified, start at the same leaf. This -// should be much easier to implement since this is iterative rather than -// recursive code. - -#ifdef JUDY1 -#ifdef JUDYPREV -FUNCTION int Judy1PrevEmpty -#else -FUNCTION int Judy1NextEmpty -#endif -#else -#ifdef JUDYPREV -FUNCTION int JudyLPrevEmpty -#else -FUNCTION int JudyLNextEmpty -#endif -#endif - ( - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError // optional, for returning error info. - ) -{ - Word_t Index; // fast copy, in a register. - Pjp_t Pjp; // current JP. - Pjbl_t Pjbl; // Pjp->jp_Addr masked and cast to types: - Pjbb_t Pjbb; - Pjbu_t Pjbu; - Pjlb_t Pjlb; - PWord_t Pword; // alternate name for use by GET* macros. - - Word_t digit; // next digit to decode from Index. - Word_t digits; // current state in SM = digits left to decode. - Word_t pop0; // in a leaf. - Word_t pop0mask; // precalculated to avoid variable shifts. - long offset; // within a branch or leaf (can be large). - int subexp; // subexpanse in a bitmap branch. - BITMAPB_t bitposmaskB; // bit in bitmap for bitmap branch. - BITMAPL_t bitposmaskL; // bit in bitmap for bitmap leaf. - Word_t possfullJP1; // JP types for possibly full subexpanses: - Word_t possfullJP2; - Word_t possfullJP3; - - -// ---------------------------------------------------------------------------- -// M A C R O S -// -// These are intended to make the code a bit more readable and less redundant. - - -// CHECK FOR NULL JP: -// -// TBD: In principle this can be reduced (here and in other *.c files) to just -// the latter clause since no Type should ever be below cJU_JPNULL1, but in -// fact some root pointer types can be lower, so for safety do both checks. - -#define JPNULL(Type) (((Type) >= cJU_JPNULL1) && ((Type) <= cJU_JPNULLMAX)) - - -// CHECK FOR A FULL JP: -// -// Given a JP, indicate if it is fully populated. Use digits, pop0mask, and -// possfullJP1..3 in the context. -// -// This is a difficult problem because it requires checking the Pop0 bits for -// all-ones, but the number of bytes depends on the JP type, which is not -// directly related to the parent branchs type or level -- the JPs child -// could be under a narrow pointer (hence not full). The simple answer -// requires switching on or otherwise calculating the JP type, which could be -// slow. Instead, in SMPREPB* precalculate pop0mask and also record in -// possfullJP1..3 the child JP (branch) types that could possibly be full (one -// level down), and use them here. For level-2 branches (with digits == 2), -// the test for a full child depends on Judy1/JudyL. -// -// Note: This cannot be applied to the JP in a JPM because it doesnt have -// enough pop0 digits. -// -// TBD: JPFULL_BRANCH diligently checks for BranchL or BranchB, where neither -// of those can ever be full as it turns out. Could just check for a BranchU -// at the right level. Also, pop0mask might be overkill, its not used much, -// so perhaps just call cJU_POP0MASK(digits - 1) here? -// -// First, JPFULL_BRANCH checks for a full expanse for a JP whose child can be a -// branch, that is, a JP in a branch at level 3 or higher: - -#define JPFULL_BRANCH(Pjp) \ - ((((JU_JPDCDPOP0(Pjp) ^ cJU_ALLONES) & pop0mask) == 0) \ - && ((JU_JPTYPE(Pjp) == possfullJP1) \ - || (JU_JPTYPE(Pjp) == possfullJP2) \ - || (JU_JPTYPE(Pjp) == possfullJP3))) - -#ifdef JUDY1 -#define JPFULL(Pjp) \ - ((digits == 2) ? \ - (JU_JPTYPE(Pjp) == cJ1_JPFULLPOPU1) : JPFULL_BRANCH(Pjp)) -#else -#define JPFULL(Pjp) \ - ((digits == 2) ? \ - (JU_JPTYPE(Pjp) == cJU_JPLEAF_B1) \ - && (((JU_JPDCDPOP0(Pjp) & cJU_POP0MASK(1)) == cJU_POP0MASK(1))) : \ - JPFULL_BRANCH(Pjp)) -#endif - - -// RETURN SUCCESS: -// -// This hides the need to set *PIndex back to the local value of Index -- use a -// local value for faster operation. Note that the callers *PIndex is ALWAYS -// modified upon success, at least decremented/incremented. - -#define RET_SUCCESS { *PIndex = Index; return(1); } - - -// RETURN A CORRUPTION: - -#define RET_CORRUPT { JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); return(JERRI); } - - -// SEARCH A BITMAP BRANCH: -// -// This is a weak analog of j__udySearchLeaf*() for bitmap branches. Return -// the actual or next-left position, base 0, of Digit in a BITMAPB_t bitmap -// (subexpanse of a full bitmap), also given a Bitposmask for Digit. The -// position is the offset within the set bits. -// -// Unlike j__udySearchLeaf*(), the offset is not returned bit-complemented if -// Digits bit is unset, because the caller can check the bitmap themselves to -// determine that. Also, if Digits bit is unset, the returned offset is to -// the next-left JP or index (including -1), not to the "ideal" position for -// the index = next-right JP or index. -// -// Shortcut and skip calling j__udyCountBitsB() if the bitmap is full, in which -// case (Digit % cJU_BITSPERSUBEXPB) itself is the base-0 offset. - -#define SEARCHBITMAPB(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPB) ? (Digit % cJU_BITSPERSUBEXPB) : \ - j__udyCountBitsB((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#ifdef JUDYPREV -// Equivalent to search for the highest offset in Bitmap, that is, one less -// than the number of bits set: - -#define SEARCHBITMAPMAXB(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPB) ? cJU_BITSPERSUBEXPB - 1 : \ - j__udyCountBitsB(Bitmap) - 1) -#endif - - -// CHECK DECODE BYTES: -// -// Check Decode bytes in a JP against the equivalent portion of Index. If they -// dont match, Index is outside the subexpanse of a narrow pointer, hence is -// empty. - -#define CHECKDCD(cDigits) \ - if (JU_DCDNOTMATCHINDEX(Index, Pjp, cDigits)) RET_SUCCESS - - -// REVISE REMAINDER OF INDEX: -// -// Put one digit in place in Index and clear/set the lower digits, if any, so -// the resulting Index is at the start/end of an expanse, or just clear/set the -// least digits. -// -// Actually, to make simple use of JU_LEASTBYTESMASK, first clear/set all least -// digits of Index including the digit to be overridden, then set the value of -// that one digit. If Digits == 1 the first operation is redundant, but either -// very fast or even removed by the optimizer. - -#define CLEARLEASTDIGITS(Digits) Index &= ~JU_LEASTBYTESMASK(Digits) -#define SETLEASTDIGITS( Digits) Index |= JU_LEASTBYTESMASK(Digits) - -#define CLEARLEASTDIGITS_D(Digit,Digits) \ - { \ - CLEARLEASTDIGITS(Digits); \ - JU_SETDIGIT(Index, Digit, Digits); \ - } - -#define SETLEASTDIGITS_D(Digit,Digits) \ - { \ - SETLEASTDIGITS(Digits); \ - JU_SETDIGIT(Index, Digit, Digits); \ - } - - -// SET REMAINDER OF INDEX AND THEN RETURN OR CONTINUE: - -#define SET_AND_RETURN(OpLeastDigits,Digit,Digits) \ - { \ - OpLeastDigits(Digit, Digits); \ - RET_SUCCESS; \ - } - -#define SET_AND_CONTINUE(OpLeastDigits,Digit,Digits) \ - { \ - OpLeastDigits(Digit, Digits); \ - goto SMGetContinue; \ - } - - -// PREPARE TO HANDLE A LEAFW OR JP BRANCH IN THE STATE MACHINE: -// -// Extract a state-dependent digit from Index in a "constant" way, then jump to -// common code for multiple cases. -// -// TBD: Should this macro do more, such as preparing variable-shift masks for -// use in CLEARLEASTDIGITS and SETLEASTDIGITS? - -#define SMPREPB(cDigits,Next,PossFullJP1,PossFullJP2,PossFullJP3) \ - digits = (cDigits); \ - digit = JU_DIGITATSTATE(Index, cDigits); \ - pop0mask = cJU_POP0MASK((cDigits) - 1); /* for branchs JPs */ \ - possfullJP1 = (PossFullJP1); \ - possfullJP2 = (PossFullJP2); \ - possfullJP3 = (PossFullJP3); \ - goto Next - -// Variations for specific-level branches and for shorthands: -// -// Note: SMPREPB2 need not initialize possfullJP* because JPFULL does not use -// them for digits == 2, but gcc -Wall isnt quite smart enough to see this, so -// waste a bit of time and space to get rid of the warning: - -#define SMPREPB2(Next) \ - digits = 2; \ - digit = JU_DIGITATSTATE(Index, 2); \ - pop0mask = cJU_POP0MASK(1); /* for branchs JPs */ \ - possfullJP1 = possfullJP2 = possfullJP3 = 0; \ - goto Next - -#define SMPREPB3(Next) SMPREPB(3, Next, cJU_JPBRANCH_L2, \ - cJU_JPBRANCH_B2, \ - cJU_JPBRANCH_U2) -#ifndef JU_64BIT -#define SMPREPBL(Next) SMPREPB(cJU_ROOTSTATE, Next, cJU_JPBRANCH_L3, \ - cJU_JPBRANCH_B3, \ - cJU_JPBRANCH_U3) -#else -#define SMPREPB4(Next) SMPREPB(4, Next, cJU_JPBRANCH_L3, \ - cJU_JPBRANCH_B3, \ - cJU_JPBRANCH_U3) -#define SMPREPB5(Next) SMPREPB(5, Next, cJU_JPBRANCH_L4, \ - cJU_JPBRANCH_B4, \ - cJU_JPBRANCH_U4) -#define SMPREPB6(Next) SMPREPB(6, Next, cJU_JPBRANCH_L5, \ - cJU_JPBRANCH_B5, \ - cJU_JPBRANCH_U5) -#define SMPREPB7(Next) SMPREPB(7, Next, cJU_JPBRANCH_L6, \ - cJU_JPBRANCH_B6, \ - cJU_JPBRANCH_U6) -#define SMPREPBL(Next) SMPREPB(cJU_ROOTSTATE, Next, cJU_JPBRANCH_L7, \ - cJU_JPBRANCH_B7, \ - cJU_JPBRANCH_U7) -#endif - - -// RESTART AFTER SECONDARY DEAD END: -// -// Set Index to the first/last index in the branch or leaf subexpanse and start -// over at the top of the tree. - -#ifdef JUDYPREV -#define SMRESTART(Digits) { CLEARLEASTDIGITS(Digits); goto SMGetRestart; } -#else -#define SMRESTART(Digits) { SETLEASTDIGITS( Digits); goto SMGetRestart; } -#endif - - -// CHECK EDGE OF LEAFS EXPANSE: -// -// Given the LSBs of the lowest/highest valid index in a leaf (or equivalently -// in an immediate JP), the level (index size) of the leaf, and the full index -// to return (as Index in the context) already set to the full index matching -// the lowest/highest one, determine if there is an empty index in the leafs -// expanse below/above the lowest/highest index, which is true if the -// lowest/highest index is not at the "edge" of the leafs expanse based on its -// LSBs. If so, return Index decremented/incremented; otherwise restart at the -// top of the tree. -// -// Note: In many cases Index is already at the right spot and calling -// SMRESTART instead of just going directly to SMGetRestart is a bit of -// overkill. -// -// Note: Variable shift occurs if Digits is not a constant. - -#ifdef JUDYPREV -#define LEAF_EDGE(MinIndex,Digits) \ - { \ - if (MinIndex) { --Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#else -#define LEAF_EDGE(MaxIndex,Digits) \ - { \ - if ((MaxIndex) != JU_LEASTBYTES(cJU_ALLONES, Digits)) \ - { ++Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#endif - -// Same as above except Index is not already set to match the lowest/highest -// index, so do that before decrementing/incrementing it: - -#ifdef JUDYPREV -#define LEAF_EDGE_SET(MinIndex,Digits) \ - { \ - if (MinIndex) \ - { JU_SETDIGITS(Index, MinIndex, Digits); --Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#else -#define LEAF_EDGE_SET(MaxIndex,Digits) \ - { \ - if ((MaxIndex) != JU_LEASTBYTES(cJU_ALLONES, Digits)) \ - { JU_SETDIGITS(Index, MaxIndex, Digits); ++Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#endif - - -// FIND A HOLE (EMPTY INDEX) IN AN IMMEDIATE OR LEAF: -// -// Given an index location in a leaf (or equivalently an immediate JP) known to -// contain a usable hole (an empty index less/greater than Index), and the LSBs -// of a minimum/maximum index to locate, find the previous/next empty index and -// return it. -// -// Note: "Even" index sizes (1,2,4[,8] bytes) have corresponding native C -// types; "odd" index sizes dont, but they are not represented here because -// they are handled completely differently; see elsewhere. - -#ifdef JUDYPREV - -#define LEAF_HOLE_EVEN(cDigits,Pjll,IndexLSB) \ - { \ - while (*(Pjll) > (IndexLSB)) --(Pjll); /* too high */ \ - if (*(Pjll) < (IndexLSB)) RET_SUCCESS /* Index is empty */ \ - while (*(--(Pjll)) == --(IndexLSB)) /* null, find a hole */;\ - JU_SETDIGITS(Index, IndexLSB, cDigits); \ - RET_SUCCESS; \ - } -#else -#define LEAF_HOLE_EVEN(cDigits,Pjll,IndexLSB) \ - { \ - while (*(Pjll) < (IndexLSB)) ++(Pjll); /* too low */ \ - if (*(Pjll) > (IndexLSB)) RET_SUCCESS /* Index is empty */ \ - while (*(++(Pjll)) == ++(IndexLSB)) /* null, find a hole */;\ - JU_SETDIGITS(Index, IndexLSB, cDigits); \ - RET_SUCCESS; \ - } -#endif - - -// SEARCH FOR AN EMPTY INDEX IN AN IMMEDIATE OR LEAF: -// -// Given a pointer to the first index in a leaf (or equivalently an immediate -// JP), the population of the leaf, and a first empty Index to find (inclusive, -// as Index in the context), where Index is known to fall within the expanse of -// the leaf to search, efficiently find the previous/next empty index in the -// leaf, if any. For simplicity the following overview is stated in terms of -// Judy*NextEmpty() only, but the same concepts apply symmetrically for -// Judy*PrevEmpty(). Also, in each case the comparisons are for the LSBs of -// Index and leaf indexes, according to the leafs level. -// -// 1. If Index is GREATER than the last (highest) index in the leaf -// (maxindex), return success, Index is empty. (Remember, Index is known -// to be in the leafs expanse.) -// -// 2. If Index is EQUAL to maxindex: If maxindex is not at the edge of the -// leafs expanse, increment Index and return success, there is an empty -// Index one higher than any in the leaf; otherwise restart with Index -// reset to the upper edge of the leafs expanse. Note: This might cause -// an extra cache line fill, but this is OK for repeatedly-called search -// code, and it saves CPU time. -// -// 3. If Index is LESS than maxindex, check for "dense to end of leaf": -// Subtract Index from maxindex, and back up that many slots in the leaf. -// If the resulting offset is not before the start of the leaf then compare -// the index at this offset (baseindex) with Index: -// -// 3a. If GREATER, the leaf must be corrupt, since indexes are sorted and -// there are no duplicates. -// -// 3b. If EQUAL, the leaf is "dense" from Index to maxindex, meaning there is -// no reason to search it. "Slide right" to the high end of the leaf -// (modify Index to maxindex) and continue with step 2 above. -// -// 3c. If LESS, continue with step 4. -// -// 4. If the offset based on maxindex minus Index falls BEFORE the start of -// the leaf, or if, per 3c above, baseindex is LESS than Index, the leaf is -// guaranteed "not dense to the end" and a usable empty Index must exist. -// This supports a more efficient search loop. Start at the FIRST index in -// the leaf, or one BEYOND baseindex, respectively, and search the leaf as -// follows, comparing each current index (currindex) with Index: -// -// 4a. If LESS, keep going to next index. Note: This is certain to terminate -// because maxindex is known to be greater than Index, hence the loop can -// be small and fast. -// -// 4b. If EQUAL, loop and increment Index until finding currindex greater than -// Index, and return success with the modified Index. -// -// 4c. If GREATER, return success, Index (unmodified) is empty. -// -// Note: These are macros rather than functions for speed. - -#ifdef JUDYPREV - -#define JSLE_EVEN(Addr,Pop0,cDigits,LeafType) \ - { \ - LeafType * PjllLSB = (LeafType *) (Addr); \ - LeafType IndexLSB = Index; /* auto-masking */ \ - \ - /* Index before or at start of leaf: */ \ - \ - if (*PjllLSB >= IndexLSB) /* no need to search */ \ - { \ - if (*PjllLSB > IndexLSB) RET_SUCCESS; /* Index empty */ \ - LEAF_EDGE(*PjllLSB, cDigits); \ - } \ - \ - /* Index in or after leaf: */ \ - \ - offset = IndexLSB - *PjllLSB; /* tentative offset */ \ - if (offset <= (Pop0)) /* can check density */ \ - { \ - PjllLSB += offset; /* move to slot */ \ - \ - if (*PjllLSB <= IndexLSB) /* dense or corrupt */ \ - { \ - if (*PjllLSB == IndexLSB) /* dense, check edge */ \ - LEAF_EDGE_SET(PjllLSB[-offset], cDigits); \ - RET_CORRUPT; \ - } \ - --PjllLSB; /* not dense, start at previous */ \ - } \ - else PjllLSB = ((LeafType *) (Addr)) + (Pop0); /* start at max */ \ - \ - LEAF_HOLE_EVEN(cDigits, PjllLSB, IndexLSB); \ - } - -// JSLE_ODD is completely different from JSLE_EVEN because its important to -// minimize copying odd indexes to compare them (see 4.14). Furthermore, a -// very complex version (4.17, but abandoned before fully debugged) that -// avoided calling j__udySearchLeaf*() ran twice as fast as 4.14, but still -// half as fast as SearchValid. Doug suggested that to minimize complexity and -// share common code we should use j__udySearchLeaf*() for the initial search -// to establish if Index is empty, which should be common. If Index is valid -// in a leaf or immediate indexes, odds are good that an empty Index is nearby, -// so for simplicity just use a *COPY* function to linearly search the -// remainder. -// -// TBD: Pathological case? Average performance should be good, but worst-case -// might suffer. When Search says the initial Index is valid, so a linear -// copy-and-compare is begun, if the caller builds fairly large leaves with -// dense clusters AND frequently does a SearchEmpty at one end of such a -// cluster, performance wont be very good. Might a dense-check help? This -// means checking offset against the index at offset, and then against the -// first/last index in the leaf. We doubt the pathological case will appear -// much in real applications because they will probably alternate SearchValid -// and SearchEmpty calls. - -#define JSLE_ODD(cDigits,Pjll,Pop0,Search,Copy) \ - { \ - Word_t IndexLSB; /* least bytes only */ \ - Word_t IndexFound; /* in leaf */ \ - \ - if ((offset = Search(Pjll, (Pop0) + 1, Index)) < 0) \ - RET_SUCCESS; /* Index is empty */ \ - \ - IndexLSB = JU_LEASTBYTES(Index, cDigits); \ - offset *= (cDigits); \ - \ - while ((offset -= (cDigits)) >= 0) \ - { /* skip until empty or start */ \ - Copy(IndexFound, ((uint8_t *) (Pjll)) + offset); \ - if (IndexFound != (--IndexLSB)) /* found an empty */ \ - { JU_SETDIGITS(Index, IndexLSB, cDigits); RET_SUCCESS; }\ - } \ - LEAF_EDGE_SET(IndexLSB, cDigits); \ - } - -#else // JUDYNEXT - -#define JSLE_EVEN(Addr,Pop0,cDigits,LeafType) \ - { \ - LeafType * PjllLSB = ((LeafType *) (Addr)) + (Pop0); \ - LeafType IndexLSB = Index; /* auto-masking */ \ - \ - /* Index at or after end of leaf: */ \ - \ - if (*PjllLSB <= IndexLSB) /* no need to search */ \ - { \ - if (*PjllLSB < IndexLSB) RET_SUCCESS; /* Index empty */\ - LEAF_EDGE(*PjllLSB, cDigits); \ - } \ - \ - /* Index before or in leaf: */ \ - \ - offset = *PjllLSB - IndexLSB; /* tentative offset */ \ - if (offset <= (Pop0)) /* can check density */ \ - { \ - PjllLSB -= offset; /* move to slot */ \ - \ - if (*PjllLSB >= IndexLSB) /* dense or corrupt */ \ - { \ - if (*PjllLSB == IndexLSB) /* dense, check edge */ \ - LEAF_EDGE_SET(PjllLSB[offset], cDigits); \ - RET_CORRUPT; \ - } \ - ++PjllLSB; /* not dense, start at next */ \ - } \ - else PjllLSB = (LeafType *) (Addr); /* start at minimum */ \ - \ - LEAF_HOLE_EVEN(cDigits, PjllLSB, IndexLSB); \ - } - -#define JSLE_ODD(cDigits,Pjll,Pop0,Search,Copy) \ - { \ - Word_t IndexLSB; /* least bytes only */ \ - Word_t IndexFound; /* in leaf */ \ - int offsetmax; /* in bytes */ \ - \ - if ((offset = Search(Pjll, (Pop0) + 1, Index)) < 0) \ - RET_SUCCESS; /* Index is empty */ \ - \ - IndexLSB = JU_LEASTBYTES(Index, cDigits); \ - offset *= (cDigits); \ - offsetmax = (Pop0) * (cDigits); /* single multiply */ \ - \ - while ((offset += (cDigits)) <= offsetmax) \ - { /* skip until empty or end */ \ - Copy(IndexFound, ((uint8_t *) (Pjll)) + offset); \ - if (IndexFound != (++IndexLSB)) /* found an empty */ \ - { JU_SETDIGITS(Index, IndexLSB, cDigits); RET_SUCCESS; } \ - } \ - LEAF_EDGE_SET(IndexLSB, cDigits); \ - } - -#endif // JUDYNEXT - -// Note: Immediate indexes never fill a single index group, so for odd index -// sizes, save time by calling JSLE_ODD_IMM instead of JSLE_ODD. - -#define j__udySearchLeafEmpty1(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 1, uint8_t) - -#define j__udySearchLeafEmpty2(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 2, uint16_t) - -#define j__udySearchLeafEmpty3(Addr,Pop0) \ - JSLE_ODD(3, Addr, Pop0, j__udySearchLeaf3, JU_COPY3_PINDEX_TO_LONG) - -#ifndef JU_64BIT - -#define j__udySearchLeafEmptyL(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 4, Word_t) - -#else - -#define j__udySearchLeafEmpty4(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 4, uint32_t) - -#define j__udySearchLeafEmpty5(Addr,Pop0) \ - JSLE_ODD(5, Addr, Pop0, j__udySearchLeaf5, JU_COPY5_PINDEX_TO_LONG) - -#define j__udySearchLeafEmpty6(Addr,Pop0) \ - JSLE_ODD(6, Addr, Pop0, j__udySearchLeaf6, JU_COPY6_PINDEX_TO_LONG) - -#define j__udySearchLeafEmpty7(Addr,Pop0) \ - JSLE_ODD(7, Addr, Pop0, j__udySearchLeaf7, JU_COPY7_PINDEX_TO_LONG) - -#define j__udySearchLeafEmptyL(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 8, Word_t) - -#endif // JU_64BIT - - -// ---------------------------------------------------------------------------- -// START OF CODE: -// -// CHECK FOR SHORTCUTS: -// -// Error out if PIndex is null. - - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return(JERRI); - } - - Index = *PIndex; // fast local copy. - -// Set and pre-decrement/increment Index, watching for underflow/overflow: -// -// An out-of-bounds Index means failure: No previous/next empty index. - -SMGetRestart: // return here with revised Index. - -#ifdef JUDYPREV - if (Index-- == 0) return(0); -#else - if (++Index == 0) return(0); -#endif - -// An empty array with an in-bounds (not underflowed/overflowed) Index means -// success: -// -// Note: This check is redundant after restarting at SMGetRestart, but should -// take insignificant time. - - if (PArray == (Pvoid_t) NULL) RET_SUCCESS; - -// ---------------------------------------------------------------------------- -// ROOT-LEVEL LEAF that starts with a Pop0 word; just look within the leaf: -// -// If Index is not in the leaf, return success; otherwise return the first -// empty Index, if any, below/above where it would belong. - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - pop0 = Pjlw[0]; - -#ifdef JUDY1 - if (pop0 == 0) // special case. - { -#ifdef JUDYPREV - if ((Index != Pjlw[1]) || (Index-- != 0)) RET_SUCCESS; -#else - if ((Index != Pjlw[1]) || (++Index != 0)) RET_SUCCESS; -#endif - return(0); // no previous/next empty index. - } -#endif // JUDY1 - - j__udySearchLeafEmptyL(Pjlw + 1, pop0); - -// No return -- thanks ALAN - - } - else - -// ---------------------------------------------------------------------------- -// HANDLE JRP Branch: -// -// For JRP branches, traverse the JPM; handle LEAFW -// directly; but look for the most common cases first. - - { - Pjpm_t Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); - -// goto SMGetContinue; - } - - -// ============================================================================ -// STATE MACHINE -- GET INDEX: -// -// Search for Index (already decremented/incremented so as to be an inclusive -// search). If not found (empty index), return success. Otherwise do a -// previous/next search, and if successful modify Index to the empty index -// found. See function header comments. -// -// ENTRY: Pjp points to next JP to interpret, whose Decode bytes have not yet -// been checked. -// -// Note: Check Decode bytes at the start of each loop, not after looking up a -// new JP, so its easy to do constant shifts/masks. -// -// EXIT: Return, or branch to SMGetRestart with modified Index, or branch to -// SMGetContinue with a modified Pjp, as described elsewhere. -// -// WARNING: For run-time efficiency the following cases replicate code with -// varying constants, rather than using common code with variable values! - -SMGetContinue: // return here for next branch/leaf. - -#ifdef TRACEJPSE - JudyPrintJP(Pjp, "sf", __LINE__); -#endif - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_L2: CHECKDCD(2); SMPREPB2(SMBranchL); - case cJU_JPBRANCH_L3: CHECKDCD(3); SMPREPB3(SMBranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: CHECKDCD(4); SMPREPB4(SMBranchL); - case cJU_JPBRANCH_L5: CHECKDCD(5); SMPREPB5(SMBranchL); - case cJU_JPBRANCH_L6: CHECKDCD(6); SMPREPB6(SMBranchL); - case cJU_JPBRANCH_L7: CHECKDCD(7); SMPREPB7(SMBranchL); -#endif - case cJU_JPBRANCH_L: SMPREPBL(SMBranchL); - -// Common code (state-independent) for all cases of linear branches: - -SMBranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -// First, check if Indexs expanse (digit) is below/above the first/last -// populated expanse in the BranchL, in which case Index is empty; otherwise -// find the offset of the lowest/highest populated expanse at or above/below -// digit, if any: -// -// Note: The for-loop is guaranteed to exit eventually because the first/last -// expanse is known to be a terminator. -// -// Note: Cannot use j__udySearchLeaf*Empty1() here because it only applies to -// leaves and does not know about partial versus full JPs, unlike the use of -// j__udySearchLeaf1() for BranchLs in SearchValid code. Also, since linear -// leaf expanse lists are small, dont waste time calling j__udySearchLeaf1(), -// just scan the expanse list. - -#ifdef JUDYPREV - if ((Pjbl->jbl_Expanse[0]) > digit) RET_SUCCESS; - - for (offset = (Pjbl->jbl_NumJPs) - 1; /* null */; --offset) -#else - if ((Pjbl->jbl_Expanse[(Pjbl->jbl_NumJPs) - 1]) < digit) - RET_SUCCESS; - - for (offset = 0; /* null */; ++offset) -#endif - { - -// Too low/high, keep going; or too high/low, meaning the loop passed a hole -// and the initial Index is empty: - -#ifdef JUDYPREV - if ((Pjbl->jbl_Expanse[offset]) > digit) continue; - if ((Pjbl->jbl_Expanse[offset]) < digit) RET_SUCCESS; -#else - if ((Pjbl->jbl_Expanse[offset]) < digit) continue; - if ((Pjbl->jbl_Expanse[offset]) > digit) RET_SUCCESS; -#endif - -// Found expanse matching digit; if its not full, traverse through it: - - if (! JPFULL((Pjbl->jbl_jp) + offset)) - { - Pjp = (Pjbl->jbl_jp) + offset; - goto SMGetContinue; - } - -// Common code: While searching for a lower/higher hole or a non-full JP, upon -// finding a lower/higher hole, adjust Index using the revised digit and -// return; or upon finding a consecutive lower/higher expanse, if the expanses -// JP is non-full, modify Index and traverse through the JP: - -#define BRANCHL_CHECK(OpIncDec,OpLeastDigits,Digit,Digits) \ - { \ - if ((Pjbl->jbl_Expanse[offset]) != OpIncDec digit) \ - SET_AND_RETURN(OpLeastDigits, Digit, Digits); \ - \ - if (! JPFULL((Pjbl->jbl_jp) + offset)) \ - { \ - Pjp = (Pjbl->jbl_jp) + offset; \ - SET_AND_CONTINUE(OpLeastDigits, Digit, Digits); \ - } \ - } - -// BranchL primary dead end: Expanse matching Index/digit is full (rare except -// for dense/sequential indexes): -// -// Search for a lower/higher hole, a non-full JP, or the end of the expanse -// list, while decrementing/incrementing digit. - -#ifdef JUDYPREV - while (--offset >= 0) - BRANCHL_CHECK(--, SETLEASTDIGITS_D, digit, digits) -#else - while (++offset < Pjbl->jbl_NumJPs) - BRANCHL_CHECK(++, CLEARLEASTDIGITS_D, digit, digits) -#endif - -// Passed end of BranchL expanse list after finding a matching but full -// expanse: -// -// Digit now matches the lowest/highest expanse, which is a full expanse; if -// digit is at the end of BranchLs expanse (no hole before/after), break out -// of the loop; otherwise modify Index to the next lower/higher digit and -// return success: - -#ifdef JUDYPREV - if (digit == 0) break; - --digit; SET_AND_RETURN(SETLEASTDIGITS_D, digit, digits); -#else - if (digit == JU_LEASTBYTES(cJU_ALLONES, 1)) break; - ++digit; SET_AND_RETURN(CLEARLEASTDIGITS_D, digit, digits); -#endif - } // for-loop - -// BranchL secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_B2: CHECKDCD(2); SMPREPB2(SMBranchB); - case cJU_JPBRANCH_B3: CHECKDCD(3); SMPREPB3(SMBranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: CHECKDCD(4); SMPREPB4(SMBranchB); - case cJU_JPBRANCH_B5: CHECKDCD(5); SMPREPB5(SMBranchB); - case cJU_JPBRANCH_B6: CHECKDCD(6); SMPREPB6(SMBranchB); - case cJU_JPBRANCH_B7: CHECKDCD(7); SMPREPB7(SMBranchB); -#endif - case cJU_JPBRANCH_B: SMPREPBL(SMBranchB); - -// Common code (state-independent) for all cases of bitmap branches: - -SMBranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - -// Locate the digits JP in the subexpanse list, if present: - - subexp = digit / cJU_BITSPERSUBEXPB; - assert(subexp < cJU_NUMSUBEXPB); // falls in expected range. - bitposmaskB = JU_BITPOSMASKB(digit); - -// Absent JP = no JP matches current digit in Index: - -// if (! JU_BITMAPTESTB(Pjbb, digit)) // slower. - if (! (JU_JBB_BITMAP(Pjbb, subexp) & bitposmaskB)) // faster. - RET_SUCCESS; - -// Non-full JP matches current digit in Index: -// -// Iterate to the subsidiary non-full JP. - - offset = SEARCHBITMAPB(JU_JBB_BITMAP(Pjbb, subexp), digit, - bitposmaskB); - // not negative since at least one bit is set: - assert(offset >= 0); - assert(offset < (int) cJU_BITSPERSUBEXPB); - -// Watch for null JP subarray pointer with non-null bitmap (a corruption): - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) - == (Pjp_t) NULL) RET_CORRUPT; - - Pjp += offset; - if (! JPFULL(Pjp)) goto SMGetContinue; - -// BranchB primary dead end: -// -// Upon hitting a full JP in a BranchB for the next digit in Index, search -// sideways for a previous/next absent JP (unset bit) or non-full JP (set bit -// with non-full JP); first in the current bitmap subexpanse, then in -// lower/higher subexpanses. Upon entry, Pjp points to a known-unusable JP, -// ready to decrement/increment. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. -// -// TBD: For speed, shift bitposmaskB instead of using JU_BITMAPTESTB or -// JU_BITPOSMASKB, but this shift has knowledge of bit order that really should -// be encapsulated in a header file. - -#define BRANCHB_CHECKBIT(OpLeastDigits) \ - if (! (JU_JBB_BITMAP(Pjbb, subexp) & bitposmaskB)) /* absent JP */ \ - SET_AND_RETURN(OpLeastDigits, digit, digits) - -#define BRANCHB_CHECKJPFULL(OpLeastDigits) \ - if (! JPFULL(Pjp)) \ - SET_AND_CONTINUE(OpLeastDigits, digit, digits) - -#define BRANCHB_STARTSUBEXP(OpLeastDigits) \ - if (! JU_JBB_BITMAP(Pjbb, subexp)) /* empty subexpanse, shortcut */ \ - SET_AND_RETURN(OpLeastDigits, digit, digits) \ - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) RET_CORRUPT - -#ifdef JUDYPREV - - --digit; // skip initial digit. - bitposmaskB >>= 1; // see TBD above. - -BranchBNextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskB) // more bits to check in subexp. - { - BRANCHB_CHECKBIT(SETLEASTDIGITS_D); - --Pjp; // previous in subarray. - BRANCHB_CHECKJPFULL(SETLEASTDIGITS_D); - assert(digit >= 0); - --digit; - bitposmaskB >>= 1; - } - - if (subexp-- > 0) // more subexpanses. - { - BRANCHB_STARTSUBEXP(SETLEASTDIGITS_D); - Pjp += SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)) + 1; - bitposmaskB = (1U << (cJU_BITSPERSUBEXPB - 1)); - goto BranchBNextSubexp; - } - -#else // JUDYNEXT - - ++digit; // skip initial digit. - bitposmaskB <<= 1; // note: BITMAPB_t. - -BranchBNextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskB) // more bits to check in subexp. - { - BRANCHB_CHECKBIT(CLEARLEASTDIGITS_D); - ++Pjp; // previous in subarray. - BRANCHB_CHECKJPFULL(CLEARLEASTDIGITS_D); - assert(digit < cJU_SUBEXPPERSTATE); - ++digit; - bitposmaskB <<= 1; // note: BITMAPB_t. - } - - if (++subexp < cJU_NUMSUBEXPB) // more subexpanses. - { - BRANCHB_STARTSUBEXP(CLEARLEASTDIGITS_D); - --Pjp; // pre-decrement. - bitposmaskB = 1; - goto BranchBNextSubexp; - } - -#endif // JUDYNEXT - -// BranchB secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_U2: CHECKDCD(2); SMPREPB2(SMBranchU); - case cJU_JPBRANCH_U3: CHECKDCD(3); SMPREPB3(SMBranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: CHECKDCD(4); SMPREPB4(SMBranchU); - case cJU_JPBRANCH_U5: CHECKDCD(5); SMPREPB5(SMBranchU); - case cJU_JPBRANCH_U6: CHECKDCD(6); SMPREPB6(SMBranchU); - case cJU_JPBRANCH_U7: CHECKDCD(7); SMPREPB7(SMBranchU); -#endif - case cJU_JPBRANCH_U: SMPREPBL(SMBranchU); - -// Common code (state-independent) for all cases of uncompressed branches: - -SMBranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - Pjp = (Pjbu->jbu_jp) + digit; - -// Absent JP = null JP for current digit in Index: - - if (JPNULL(JU_JPTYPE(Pjp))) RET_SUCCESS; - -// Non-full JP matches current digit in Index: -// -// Iterate to the subsidiary JP. - - if (! JPFULL(Pjp)) goto SMGetContinue; - -// BranchU primary dead end: -// -// Upon hitting a full JP in a BranchU for the next digit in Index, search -// sideways for a previous/next null or non-full JP. BRANCHU_CHECKJP() is -// shorthand for common code. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. - -#define BRANCHU_CHECKJP(OpIncDec,OpLeastDigits) \ - { \ - OpIncDec Pjp; \ - \ - if (JPNULL(JU_JPTYPE(Pjp))) \ - SET_AND_RETURN(OpLeastDigits, digit, digits) \ - \ - if (! JPFULL(Pjp)) \ - SET_AND_CONTINUE(OpLeastDigits, digit, digits) \ - } - -#ifdef JUDYPREV - while (digit-- > 0) - BRANCHU_CHECKJP(--, SETLEASTDIGITS_D); -#else - while (++digit < cJU_BRANCHUNUMJPS) - BRANCHU_CHECKJP(++, CLEARLEASTDIGITS_D); -#endif - -// BranchU secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for the -// previous/next empty index starting at Index. Primary leaf dead end is -// hidden within j__udySearchLeaf*Empty*(). In case of secondary leaf dead -// end, restart at the top of the tree. -// -// Note: Pword is the name known to GET*; think of it as Pjlw. - -#define SMLEAFL(cDigits,Func) \ - Pword = (PWord_t) P_JLW(Pjp->jp_Addr); \ - pop0 = JU_JPLEAF_POP0(Pjp); \ - Func(Pword, pop0) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKDCD(1); SMLEAFL(1, j__udySearchLeafEmpty1); -#endif - case cJU_JPLEAF2: CHECKDCD(2); SMLEAFL(2, j__udySearchLeafEmpty2); - case cJU_JPLEAF3: CHECKDCD(3); SMLEAFL(3, j__udySearchLeafEmpty3); - -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKDCD(4); SMLEAFL(4, j__udySearchLeafEmpty4); - case cJU_JPLEAF5: CHECKDCD(5); SMLEAFL(5, j__udySearchLeafEmpty5); - case cJU_JPLEAF6: CHECKDCD(6); SMLEAFL(6, j__udySearchLeafEmpty6); - case cJU_JPLEAF7: CHECKDCD(7); SMLEAFL(7, j__udySearchLeafEmpty7); -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for the -// previous/next empty index starting at Index. - - case cJU_JPLEAF_B1: - - CHECKDCD(1); - - Pjlb = P_JLB(Pjp->jp_Addr); - digit = JU_DIGITATSTATE(Index, 1); - subexp = digit / cJU_BITSPERSUBEXPL; - bitposmaskL = JU_BITPOSMASKL(digit); - assert(subexp < cJU_NUMSUBEXPL); // falls in expected range. - -// Absent index = no index matches current digit in Index: - -// if (! JU_BITMAPTESTL(Pjlb, digit)) // slower. - if (! (JU_JLB_BITMAP(Pjlb, subexp) & bitposmaskL)) // faster. - RET_SUCCESS; - -// LeafB1 primary dead end: -// -// Upon hitting a valid (non-empty) index in a LeafB1 for the last digit in -// Index, search sideways for a previous/next absent index, first in the -// current bitmap subexpanse, then in lower/higher subexpanses. -// LEAFB1_CHECKBIT() is shorthand for common code to handle one bit in one -// bitmap subexpanse. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. -// -// TBD: For speed, shift bitposmaskL instead of using JU_BITMAPTESTL or -// JU_BITPOSMASKL, but this shift has knowledge of bit order that really should -// be encapsulated in a header file. - -#define LEAFB1_CHECKBIT(OpLeastDigits) \ - if (! (JU_JLB_BITMAP(Pjlb, subexp) & bitposmaskL)) \ - SET_AND_RETURN(OpLeastDigits, digit, 1) - -#define LEAFB1_STARTSUBEXP(OpLeastDigits) \ - if (! JU_JLB_BITMAP(Pjlb, subexp)) /* empty subexp */ \ - SET_AND_RETURN(OpLeastDigits, digit, 1) - -#ifdef JUDYPREV - - --digit; // skip initial digit. - bitposmaskL >>= 1; // see TBD above. - -LeafB1NextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskL) // more bits to check in subexp. - { - LEAFB1_CHECKBIT(SETLEASTDIGITS_D); - assert(digit >= 0); - --digit; - bitposmaskL >>= 1; - } - - if (subexp-- > 0) // more subexpanses. - { - LEAFB1_STARTSUBEXP(SETLEASTDIGITS_D); - bitposmaskL = (1UL << (cJU_BITSPERSUBEXPL - 1)); - goto LeafB1NextSubexp; - } - -#else // JUDYNEXT - - ++digit; // skip initial digit. - bitposmaskL <<= 1; // note: BITMAPL_t. - -LeafB1NextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskL) // more bits to check in subexp. - { - LEAFB1_CHECKBIT(CLEARLEASTDIGITS_D); - assert(digit < cJU_SUBEXPPERSTATE); - ++digit; - bitposmaskL <<= 1; // note: BITMAPL_t. - } - - if (++subexp < cJU_NUMSUBEXPL) // more subexpanses. - { - LEAFB1_STARTSUBEXP(CLEARLEASTDIGITS_D); - bitposmaskL = 1; - goto LeafB1NextSubexp; - } - -#endif // JUDYNEXT - -// LeafB1 secondary dead end, no empty index: - - SMRESTART(1); - - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// If the Decode bytes do not match, Index is empty (without modification); -// otherwise restart. - - case cJ1_JPFULLPOPU1: - - CHECKDCD(1); - SMRESTART(1); -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: -// -// Pop1 = 1 Immediate JPs: -// -// If Index is not in the immediate JP, return success; otherwise check if -// there is an empty index below/above the immediate JPs index, and if so, -// return success with modified Index, else restart. -// -// Note: Doug says its fast enough to calculate the index size (digits) in -// the following; no need to set it separately for each case. - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - if (JU_JPDCDPOP0(Pjp) != JU_TRIMTODCDSIZE(Index)) RET_SUCCESS; - digits = JU_JPTYPE(Pjp) - cJU_JPIMMED_1_01 + 1; - LEAF_EDGE(JU_LEASTBYTES(JU_JPDCDPOP0(Pjp), digits), digits); - -// Immediate JPs with Pop1 > 1: - -#define IMM_MULTI(Func,BaseJPType) \ - JUDY1CODE(Pword = (PWord_t) (Pjp->jp_1Index);) \ - JUDYLCODE(Pword = (PWord_t) (Pjp->jp_LIndex);) \ - Func(Pword, JU_JPTYPE(Pjp) - (BaseJPType) + 1) - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - IMM_MULTI(j__udySearchLeafEmpty1, cJU_JPIMMED_1_02); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - IMM_MULTI(j__udySearchLeafEmpty2, cJU_JPIMMED_2_02); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - IMM_MULTI(j__udySearchLeafEmpty3, cJU_JPIMMED_3_02); -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: - case cJ1_JPIMMED_4_03: - IMM_MULTI(j__udySearchLeafEmpty4, cJ1_JPIMMED_4_02); - - case cJ1_JPIMMED_5_02: - case cJ1_JPIMMED_5_03: - IMM_MULTI(j__udySearchLeafEmpty5, cJ1_JPIMMED_5_02); - - case cJ1_JPIMMED_6_02: - IMM_MULTI(j__udySearchLeafEmpty6, cJ1_JPIMMED_6_02); - - case cJ1_JPIMMED_7_02: - IMM_MULTI(j__udySearchLeafEmpty7, cJ1_JPIMMED_7_02); -#endif - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: RET_CORRUPT; - - } // SMGet switch. - -} // Judy1PrevEmpty() / Judy1NextEmpty() / JudyLPrevEmpty() / JudyLNextEmpty() diff --git a/libjudy/src/Judy1/Judy1Set.c b/libjudy/src/Judy1/Judy1Set.c deleted file mode 100644 index f96df4101d..0000000000 --- a/libjudy/src/Judy1/Judy1Set.c +++ /dev/null @@ -1,1873 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.116 $ $Source: /judy/src/JudyCommon/JudyIns.c $ -// -// Judy1Set() and JudyLIns() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// TBD: Should some of the assertions here be converted to product code that -// returns JU_ERRNO_CORRUPT? - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -// Note: Call JudyCheckPop() even before "already inserted" returns, to catch -// population errors; see fix in 4.84: - -DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);) -DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);) - -#ifdef TRACEJP -#include "JudyPrintJP.c" -#endif - - -// These are defined to generic values in JudyCommon/JudyPrivateTypes.h: -// -// TBD: These should be exported from a header file, but perhaps not, as they -// are only used here, and exported from Judy*Decascade, which is a separate -// file for profiling reasons (to prevent inlining), but which potentially -// could be merged with this file, either in SoftCM or at compile-time. - -#ifdef JUDY1 -extern int j__udy1CreateBranchB(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); -extern int j__udy1CreateBranchU(Pjp_t, Pvoid_t); - -#ifndef JU_64BIT -extern int j__udy1Cascade1(Pjp_t, Pvoid_t); -#endif -extern int j__udy1Cascade2(Pjp_t, Pvoid_t); -extern int j__udy1Cascade3(Pjp_t, Pvoid_t); -#ifdef JU_64BIT -extern int j__udy1Cascade4(Pjp_t, Pvoid_t); -extern int j__udy1Cascade5(Pjp_t, Pvoid_t); -extern int j__udy1Cascade6(Pjp_t, Pvoid_t); -extern int j__udy1Cascade7(Pjp_t, Pvoid_t); -#endif -extern int j__udy1CascadeL(Pjp_t, Pvoid_t); - -extern int j__udy1InsertBranch(Pjp_t Pjp, Word_t Index, Word_t Btype, Pjpm_t); - -#else // JUDYL - -extern int j__udyLCreateBranchB(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); -extern int j__udyLCreateBranchU(Pjp_t, Pvoid_t); - -extern int j__udyLCascade1(Pjp_t, Pvoid_t); -extern int j__udyLCascade2(Pjp_t, Pvoid_t); -extern int j__udyLCascade3(Pjp_t, Pvoid_t); -#ifdef JU_64BIT -extern int j__udyLCascade4(Pjp_t, Pvoid_t); -extern int j__udyLCascade5(Pjp_t, Pvoid_t); -extern int j__udyLCascade6(Pjp_t, Pvoid_t); -extern int j__udyLCascade7(Pjp_t, Pvoid_t); -#endif -extern int j__udyLCascadeL(Pjp_t, Pvoid_t); - -extern int j__udyLInsertBranch(Pjp_t Pjp, Word_t Index, Word_t Btype, Pjpm_t); -#endif - - -// **************************************************************************** -// MACROS FOR COMMON CODE: -// -// Check if Index is an outlier to (that is, not a member of) this expanse: -// -// An outlier is an Index in-the-expanse of the slot containing the pointer, -// but not-in-the-expanse of the "narrow" pointer in that slot. (This means -// the Dcd part of the Index differs from the equivalent part of jp_DcdPopO.) -// Therefore, the remedy is to put a cJU_JPBRANCH_L* between the narrow pointer -// and the object to which it points, and add the outlier Index as an Immediate -// in the cJU_JPBRANCH_L*. The "trick" is placing the cJU_JPBRANCH_L* at a -// Level that is as low as possible. This is determined by counting the digits -// in the existing narrow pointer that are the same as the digits in the new -// Index (see j__udyInsertBranch()). -// -// Note: At some high Levels, cJU_DCDMASK() is all zeros => dead code; assume -// the compiler optimizes this out. - -#define JU_CHECK_IF_OUTLIER(Pjp, Index, cLevel, Pjpm) \ - if (JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel)) \ - return(j__udyInsertBranch(Pjp, Index, cLevel, Pjpm)) - -// Check if an Index is already in a leaf or immediate, after calling -// j__udySearchLeaf*() to set Offset: -// -// A non-negative Offset means the Index already exists, so return 0; otherwise -// complement Offset to proceed. - -#ifdef JUDY1 -#define Pjv ignore // placeholder. -#define JU_CHECK_IF_EXISTS(Offset,ignore,Pjpm) \ - { \ - if ((Offset) >= 0) return(0); \ - (Offset) = ~(Offset); \ - } -#else -// For JudyL, also set the value area pointer in the Pjpm: - -#define JU_CHECK_IF_EXISTS(Offset,Pjv,Pjpm) \ - { \ - if ((Offset) >= 0) \ - { \ - (Pjpm)->jpm_PValue = (Pjv) + (Offset); \ - return(0); \ - } \ - (Offset) = ~(Offset); \ - } -#endif - - -// **************************************************************************** -// __ J U D Y I N S W A L K -// -// Walk the Judy tree to do a set/insert. This is only called internally, and -// recursively. Unlike Judy1Test() and JudyLGet(), the extra time required for -// recursion should be negligible compared with the total. -// -// Return -1 for error (details in JPM), 0 for Index already inserted, 1 for -// new Index inserted. - -FUNCTION static int j__udyInsWalk( - Pjp_t Pjp, // current JP to descend. - Word_t Index, // to insert. - Pjpm_t Pjpm) // for returning info to top Level. -{ - uint8_t digit; // from Index, current offset into a branch. - jp_t newJP; // for creating a new Immed JP. - Word_t exppop1; // expanse (leaf) population. - int retcode; // return codes: -1, 0, 1. - -#ifdef SUBEXPCOUNTS -// Pointer to BranchB/U subexpanse counter: -// -// Note: Very important for performance reasons (avoids cache fills). - - PWord_t PSubExp = (PWord_t) NULL; -#endif - -ContinueInsWalk: // for modifying state without recursing. - -#ifdef TRACEJP - JudyPrintJP(Pjp, "i", __LINE__); -#endif - - switch (JU_JPTYPE(Pjp)) // entry: Pjp, Index. - { - - -// **************************************************************************** -// JPNULL*: -// -// Convert JP in place from current null type to cJU_JPIMMED_*_01 by -// calculating new JP type. - - case cJU_JPNULL1: - case cJU_JPNULL2: - case cJU_JPNULL3: -#ifdef JU_64BIT - case cJU_JPNULL4: - case cJU_JPNULL5: - case cJU_JPNULL6: - case cJU_JPNULL7: -#endif - assert((Pjp->jp_Addr) == 0); - JU_JPSETADT(Pjp, 0, Index, JU_JPTYPE(Pjp) + cJU_JPIMMED_1_01 - cJU_JPNULL1); -#ifdef JUDYL - // value area is first word of new Immed_01 JP: - Pjpm->jpm_PValue = (Pjv_t) (&(Pjp->jp_Addr)); -#endif - return(1); - - -// **************************************************************************** -// JPBRANCH_L*: -// -// If the new Index is not an outlier to the branchs expanse, and the branch -// should not be converted to uncompressed, extract the digit and record the -// Immediate type to create for a new Immed JP, before going to common code. -// -// Note: JU_CHECK_IF_OUTLIER() is a no-op for BranchB3[7] on 32[64]-bit. - -#define JU_BRANCH_OUTLIER(DIGIT,POP1,cLEVEL,PJP,INDEX,PJPM) \ - JU_CHECK_IF_OUTLIER(PJP, INDEX, cLEVEL, PJPM); \ - (DIGIT) = JU_DIGITATSTATE(INDEX, cLEVEL); \ - (POP1) = JU_JPBRANCH_POP0(PJP, cLEVEL) - - case cJU_JPBRANCH_L2: - JU_BRANCH_OUTLIER(digit, exppop1, 2, Pjp, Index, Pjpm); - goto JudyBranchL; - - case cJU_JPBRANCH_L3: - JU_BRANCH_OUTLIER(digit, exppop1, 3, Pjp, Index, Pjpm); - goto JudyBranchL; - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - JU_BRANCH_OUTLIER(digit, exppop1, 4, Pjp, Index, Pjpm); - goto JudyBranchL; - - case cJU_JPBRANCH_L5: - JU_BRANCH_OUTLIER(digit, exppop1, 5, Pjp, Index, Pjpm); - goto JudyBranchL; - - case cJU_JPBRANCH_L6: - JU_BRANCH_OUTLIER(digit, exppop1, 6, Pjp, Index, Pjpm); - goto JudyBranchL; - - case cJU_JPBRANCH_L7: - JU_BRANCH_OUTLIER(digit, exppop1, 7, Pjp, Index, Pjpm); - goto JudyBranchL; -#endif - -// Similar to common code above, but no outlier check is needed, and the Immed -// type depends on the word size: - - case cJU_JPBRANCH_L: - { - Pjbl_t PjblRaw; // pointer to old linear branch. - Pjbl_t Pjbl; - Pjbu_t PjbuRaw; // pointer to new uncompressed branch. - Pjbu_t Pjbu; - Word_t numJPs; // number of JPs = populated expanses. - int offset; // in branch. - - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - exppop1 = Pjpm->jpm_Pop0; - - // fall through: - -// COMMON CODE FOR LINEAR BRANCHES: -// -// Come here with digit and exppop1 already set. - -JudyBranchL: - PjblRaw = (Pjbl_t) (Pjp->jp_Addr); - Pjbl = P_JBL(PjblRaw); - -// If population under this branch greater than: - - if (exppop1 > JU_BRANCHL_MAX_POP) - goto ConvertBranchLtoU; - - numJPs = Pjbl->jbl_NumJPs; - - if ((numJPs == 0) || (numJPs > cJU_BRANCHLMAXJPS)) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(-1); - } - -// Search for a match to the digit: - - offset = j__udySearchLeaf1((Pjll_t) (Pjbl->jbl_Expanse), numJPs, - digit); - -// If Index is found, offset is into an array of 1..cJU_BRANCHLMAXJPS JPs: - - if (offset >= 0) - { - Pjp = (Pjbl->jbl_jp) + offset; // address of next JP. - break; // continue walk. - } - -// Expanse is missing (not populated) for the passed Index, so insert an Immed -// -- if theres room: - - if (numJPs < cJU_BRANCHLMAXJPS) - { - offset = ~offset; // insertion offset. - - JU_JPSETADT(&newJP, 0, Index, - JU_JPTYPE(Pjp) + cJU_JPIMMED_1_01-cJU_JPBRANCH_L2); - - JU_INSERTINPLACE(Pjbl->jbl_Expanse, numJPs, offset, digit); - JU_INSERTINPLACE(Pjbl->jbl_jp, numJPs, offset, newJP); - - DBGCODE(JudyCheckSorted((Pjll_t) (Pjbl->jbl_Expanse), - numJPs + 1, /* IndexSize = */ 1);) - ++(Pjbl->jbl_NumJPs); -#ifdef JUDYL - // value area is first word of new Immed 01 JP: - Pjpm->jpm_PValue = (Pjv_t) ((Pjbl->jbl_jp) + offset); -#endif - return(1); - } - - -// MAXED OUT LINEAR BRANCH, CONVERT TO A BITMAP BRANCH, THEN INSERT: -// -// Copy the linear branch to a bitmap branch. -// -// TBD: Consider renaming j__udyCreateBranchB() to j__udyConvertBranchLtoB(). - - assert((numJPs) <= cJU_BRANCHLMAXJPS); - - if (j__udyCreateBranchB(Pjp, Pjbl->jbl_jp, Pjbl->jbl_Expanse, - numJPs, Pjpm) == -1) - { - return(-1); - } - -// Convert jp_Type from linear branch to equivalent bitmap branch: - - Pjp->jp_Type += cJU_JPBRANCH_B - cJU_JPBRANCH_L; - - j__udyFreeJBL(PjblRaw, Pjpm); // free old BranchL. - -// Having changed branch types, now do the insert in the new branch type: - - goto ContinueInsWalk; - - -// OPPORTUNISTICALLY CONVERT FROM BRANCHL TO BRANCHU: -// -// Memory efficiency is no object because the branchs pop1 is large enough, so -// speed up array access. Come here with PjblRaw set. Note: This is goto -// code because the previous block used to fall through into it as well, but no -// longer. - -ConvertBranchLtoU: - -// Allocate memory for an uncompressed branch: - - if ((PjbuRaw = j__udyAllocJBU(Pjpm)) == (Pjbu_t) NULL) - return(-1); - Pjbu = P_JBU(PjbuRaw); - -// Set the proper NULL type for most of the uncompressed branchs JPs: - - JU_JPSETADT(&newJP, 0, 0, - JU_JPTYPE(Pjp) - cJU_JPBRANCH_L2 + cJU_JPNULL1); - -// Initialize: Pre-set uncompressed branch to mostly JPNULL*s: - - for (numJPs = 0; numJPs < cJU_BRANCHUNUMJPS; ++numJPs) - Pjbu->jbu_jp[numJPs] = newJP; - -// Copy JPs from linear branch to uncompressed branch: - - { -#ifdef SUBEXPCOUNTS - Word_t popmask = cJU_POP0MASK(JU_JPTYPE(Pjp)) - - cJU_JPBRANCH_L2 - 2; - - for (numJPs = 0; numJPs < cJU_NUMSUBEXPU; ++numJPs) - Pjbu->jbu_subPop1[numJPs] = 0; -#endif - for (numJPs = 0; numJPs < Pjbl->jbl_NumJPs; ++numJPs) - { - Pjp_t Pjp1 = &(Pjbl->jbl_jp[numJPs]); - offset = Pjbl->jbl_Expanse[numJPs]; - Pjbu->jbu_jp[offset] = *Pjp1; -#ifdef SUBEXPCOUNTS - Pjbu->jbu_subPop1[offset/cJU_NUMSUBEXPU] += - JU_JPDCDPOP0(Pjp1) & popmask + 1; -#endif - } - } - j__udyFreeJBL(PjblRaw, Pjpm); // free old BranchL. - -// Plug new values into parent JP: - - Pjp->jp_Addr = (Word_t) PjbuRaw; - Pjp->jp_Type += cJU_JPBRANCH_U - cJU_JPBRANCH_L; // to BranchU. - -// Save global population of last BranchU conversion: - - Pjpm->jpm_LastUPop0 = Pjpm->jpm_Pop0; - goto ContinueInsWalk; - - } // case cJU_JPBRANCH_L. - - -// **************************************************************************** -// JPBRANCH_B*: -// -// If the new Index is not an outlier to the branchs expanse, extract the -// digit and record the Immediate type to create for a new Immed JP, before -// going to common code. -// -// Note: JU_CHECK_IF_OUTLIER() is a no-op for BranchB3[7] on 32[64]-bit. - - case cJU_JPBRANCH_B2: - JU_BRANCH_OUTLIER(digit, exppop1, 2, Pjp, Index, Pjpm); - goto JudyBranchB; - - case cJU_JPBRANCH_B3: - JU_BRANCH_OUTLIER(digit, exppop1, 3, Pjp, Index, Pjpm); - goto JudyBranchB; - -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - JU_BRANCH_OUTLIER(digit, exppop1, 4, Pjp, Index, Pjpm); - goto JudyBranchB; - - case cJU_JPBRANCH_B5: - JU_BRANCH_OUTLIER(digit, exppop1, 5, Pjp, Index, Pjpm); - goto JudyBranchB; - - case cJU_JPBRANCH_B6: - JU_BRANCH_OUTLIER(digit, exppop1, 6, Pjp, Index, Pjpm); - goto JudyBranchB; - - case cJU_JPBRANCH_B7: - JU_BRANCH_OUTLIER(digit, exppop1, 7, Pjp, Index, Pjpm); - goto JudyBranchB; -#endif - - case cJU_JPBRANCH_B: - { - Pjbb_t Pjbb; // pointer to bitmap branch. - Pjbb_t PjbbRaw; // pointer to bitmap branch. - Pjp_t Pjp2Raw; // 1 of N arrays of JPs. - Pjp_t Pjp2; // 1 of N arrays of JPs. - Word_t subexp; // 1 of N subexpanses in bitmap. - BITMAPB_t bitmap; // for one subexpanse. - BITMAPB_t bitmask; // bit set for Indexs digit. - Word_t numJPs; // number of JPs = populated expanses. - int offset; // in bitmap branch. - -// Similar to common code above, but no outlier check is needed, and the Immed -// type depends on the word size: - - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - exppop1 = Pjpm->jpm_Pop0; - - // fall through: - - -// COMMON CODE FOR BITMAP BRANCHES: -// -// Come here with digit and exppop1 already set. - -JudyBranchB: - -// If population increment is greater than.. (300): - - if ((Pjpm->jpm_Pop0 - Pjpm->jpm_LastUPop0) > JU_BTOU_POP_INCREMENT) - { - -// If total population of array is greater than.. (750): - - if (Pjpm->jpm_Pop0 > JU_BRANCHB_MAX_POP) - { - -// If population under the branch is greater than.. (135): - - if (exppop1 > JU_BRANCHB_MIN_POP) - { - if (j__udyCreateBranchU(Pjp, Pjpm) == -1) return(-1); - -// Save global population of last BranchU conversion: - - Pjpm->jpm_LastUPop0 = Pjpm->jpm_Pop0; - - goto ContinueInsWalk; - } - } - } - -// CONTINUE TO USE BRANCHB: -// -// Get pointer to bitmap branch (JBB): - - PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); - Pjbb = P_JBB(PjbbRaw); - -// Form the Int32 offset, and Bit offset values: -// -// 8 bit Decode | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -// |SubExpanse | Bit offset | -// -// Get the 1 of 8 expanses from digit, Bits 5..7 = 1 of 8, and get the 32-bit -// word that may have a bit set: - - subexp = digit / cJU_BITSPERSUBEXPB; - bitmap = JU_JBB_BITMAP(Pjbb, subexp); - - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); - Pjp2 = P_JP(Pjp2Raw); - -// Get the bit position that represents the desired expanse, and get the offset -// into the array of JPs for the JP that matches the bit. - - bitmask = JU_BITPOSMASKB(digit); - offset = j__udyCountBitsB(bitmap & (bitmask - 1)); - -// If JP is already in this expanse, get Pjp and continue the walk: - - if (bitmap & bitmask) - { -#ifdef SUBEXPCOUNTS - PSubExp = &(Pjbb->jbb_Counts[subexp]); // ptr to subexp counts. -#endif - Pjp = Pjp2 + offset; - break; // continue walk. - } - - -// ADD NEW EXPANSE FOR NEW INDEX: -// -// The new expanse always an cJU_JPIMMED_*_01 containing just the new Index, so -// finish setting up an Immed JP. - - JU_JPSETADT(&newJP, 0, Index, - JU_JPTYPE(Pjp) + cJU_JPIMMED_1_01-cJU_JPBRANCH_B2); - -// Get 1 of the 8 JP arrays and calculate number of JPs in subexpanse array: - - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); - Pjp2 = P_JP(Pjp2Raw); - numJPs = j__udyCountBitsB(bitmap); - -// Expand branch JP subarray in-place: - - if (JU_BRANCHBJPGROWINPLACE(numJPs)) - { - assert(numJPs > 0); - JU_INSERTINPLACE(Pjp2, numJPs, offset, newJP); -#ifdef JUDYL - // value area is first word of new Immed 01 JP: - Pjpm->jpm_PValue = (Pjv_t) (Pjp2 + offset); -#endif - } - -// No room, allocate a bigger bitmap branch JP subarray: - - else - { - Pjp_t PjpnewRaw; - Pjp_t Pjpnew; - - if ((PjpnewRaw = j__udyAllocJBBJP(numJPs + 1, Pjpm)) == 0) - return(-1); - Pjpnew = P_JP(PjpnewRaw); - -// If there was an old JP array, then copy it, insert the new Immed JP, and -// free the old array: - - if (numJPs) - { - JU_INSERTCOPY(Pjpnew, Pjp2, numJPs, offset, newJP); - j__udyFreeJBBJP(Pjp2Raw, numJPs, Pjpm); -#ifdef JUDYL - // value area is first word of new Immed 01 JP: - Pjpm->jpm_PValue = (Pjv_t) (Pjpnew + offset); -#endif - } - -// New JP subarray; point to cJU_JPIMMED_*_01 and place it: - - else - { - assert(JU_JBB_PJP(Pjbb, subexp) == (Pjp_t) NULL); - Pjp = Pjpnew; - *Pjp = newJP; // copy to new memory. -#ifdef JUDYL - // value area is first word of new Immed 01 JP: - Pjpm->jpm_PValue = (Pjv_t) (&(Pjp->jp_Addr)); -#endif - } - -// Place new JP subarray in BranchB: - - JU_JBB_PJP(Pjbb, subexp) = PjpnewRaw; - - } // else - -// Set the new Indexs bit: - - JU_JBB_BITMAP(Pjbb, subexp) |= bitmask; - - return(1); - - } // case - - -// **************************************************************************** -// JPBRANCH_U*: -// -// Just drop through the JP for the correct digit. If the JP turns out to be a -// JPNULL*, thats OK, the memory is already allocated, and the next walk -// simply places an Immed in it. -// -#ifdef SUBEXPCOUNTS -#define JU_GETSUBEXP(PSubExp,Pjbu,Digit) \ - (PSubExp) = &((Pjbu)->jbu_subPop1[(Digit) / cJU_NUMSUBEXPU]) -#else -#define JU_GETSUBEXP(PSubExp,Pjbu,Digit) // null. -#endif - -#define JU_JBU_PJP_SUBEXP(Pjp,PSubExp,Index,Level) \ - { \ - uint8_t digit = JU_DIGITATSTATE(Index, Level); \ - Pjbu_t P_jbu = P_JBU((Pjp)->jp_Addr); \ - (Pjp) = &(P_jbu->jbu_jp[digit]); \ - JU_GETSUBEXP(PSubExp, P_jbu, digit); \ - } - - case cJU_JPBRANCH_U2: - JU_CHECK_IF_OUTLIER(Pjp, Index, 2, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 2); - break; - -#ifdef JU_64BIT - case cJU_JPBRANCH_U3: - JU_CHECK_IF_OUTLIER(Pjp, Index, 3, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 3); - break; - - case cJU_JPBRANCH_U4: - JU_CHECK_IF_OUTLIER(Pjp, Index, 4, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 4); - break; - - case cJU_JPBRANCH_U5: - JU_CHECK_IF_OUTLIER(Pjp, Index, 5, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 5); - break; - - case cJU_JPBRANCH_U6: - JU_CHECK_IF_OUTLIER(Pjp, Index, 6, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 6); - break; - - case cJU_JPBRANCH_U7: - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 7); -#else - case cJU_JPBRANCH_U3: - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 3); -#endif - break; - - case cJU_JPBRANCH_U: - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, cJU_ROOTSTATE); - break; - - -// **************************************************************************** -// JPLEAF*: -// -// COMMON CODE FRAGMENTS TO MINIMIZE REDUNDANCY BELOW: -// -// These are necessary to support performance by function and loop unrolling -// while avoiding huge amounts of nearly identical code. -// -// Prepare to handle a linear leaf: Check for an outlier; set pop1 and pointer -// to leaf: - -#ifdef JUDY1 -#define JU_LEAFVALUE(Pjv) // null. -#define JU_LEAFPREPVALUE(Pjv, ValueArea) // null. -#else -#define JU_LEAFVALUE(Pjv) Pjv_t Pjv -#define JU_LEAFPREPVALUE(Pjv, ValueArea) (Pjv) = ValueArea(Pleaf, exppop1) -#endif - -#define JU_LEAFPREP(cIS,Type,MaxPop1,ValueArea) \ - Pjll_t PjllRaw; \ - Type Pleaf; /* specific type */ \ - int offset; \ - JU_LEAFVALUE(Pjv); \ - \ - JU_CHECK_IF_OUTLIER(Pjp, Index, cIS, Pjpm); \ - \ - exppop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - assert(exppop1 <= (MaxPop1)); \ - PjllRaw = (Pjll_t) (Pjp->jp_Addr); \ - Pleaf = (Type) P_JLL(PjllRaw); \ - JU_LEAFPREPVALUE(Pjv, ValueArea) - -// Add to, or grow, a linear leaf: Find Index position; if the Index is -// absent, if theres room in the leaf, insert the Index [and value of 0] in -// place, otherwise grow the leaf: -// -// Note: These insertions always take place with whole words, using -// JU_INSERTINPLACE() or JU_INSERTCOPY(). - -#ifdef JUDY1 -#define JU_LEAFGROWVALUEADD(Pjv,ExpPop1,Offset) // null. -#else -#define JU_LEAFGROWVALUEADD(Pjv,ExpPop1,Offset) \ - JU_INSERTINPLACE(Pjv, ExpPop1, Offset, 0); \ - Pjpm->jpm_PValue = (Pjv) + (Offset) -#endif - -#ifdef JUDY1 -#define JU_LEAFGROWVALUENEW(ValueArea,Pjv,ExpPop1,Offset) // null. -#else -#define JU_LEAFGROWVALUENEW(ValueArea,Pjv,ExpPop1,Offset) \ - { \ - Pjv_t Pjvnew = ValueArea(Pleafnew, (ExpPop1) + 1); \ - JU_INSERTCOPY(Pjvnew, Pjv, ExpPop1, Offset, 0); \ - Pjpm->jpm_PValue = (Pjvnew) + (Offset); \ - } -#endif - -#define JU_LEAFGROW(cIS,Type,MaxPop1,Search,ValueArea,GrowInPlace, \ - InsertInPlace,InsertCopy,Alloc,Free) \ - \ - offset = Search(Pleaf, exppop1, Index); \ - JU_CHECK_IF_EXISTS(offset, Pjv, Pjpm); \ - \ - if (GrowInPlace(exppop1)) /* add to current leaf */ \ - { \ - InsertInPlace(Pleaf, exppop1, offset, Index); \ - JU_LEAFGROWVALUEADD(Pjv, exppop1, offset); \ - DBGCODE(JudyCheckSorted((Pjll_t) Pleaf, exppop1 + 1, cIS);) \ - return(1); \ - } \ - \ - if (exppop1 < (MaxPop1)) /* grow to new leaf */ \ - { \ - Pjll_t PjllnewRaw; \ - Type Pleafnew; \ - if ((PjllnewRaw = Alloc(exppop1 + 1, Pjpm)) == 0) return(-1); \ - Pleafnew = (Type) P_JLL(PjllnewRaw); \ - InsertCopy(Pleafnew, Pleaf, exppop1, offset, Index); \ - JU_LEAFGROWVALUENEW(ValueArea, Pjv, exppop1, offset); \ - DBGCODE(JudyCheckSorted((Pjll_t) Pleafnew, exppop1 + 1, cIS);) \ - Free(PjllRaw, exppop1, Pjpm); \ - (Pjp->jp_Addr) = (Word_t) PjllnewRaw; \ - return(1); \ - } \ - assert(exppop1 == (MaxPop1)) - -// Handle linear leaf overflow (cascade): Splay or compress into smaller -// leaves: - -#define JU_LEAFCASCADE(MaxPop1,Cascade,Free) \ - if (Cascade(Pjp, Pjpm) == -1) return(-1); \ - Free(PjllRaw, MaxPop1, Pjpm); \ - goto ContinueInsWalk - -// Wrapper around all of the above: - -#define JU_LEAFSET(cIS,Type,MaxPop1,Search,GrowInPlace,InsertInPlace, \ - InsertCopy,Cascade,Alloc,Free,ValueArea) \ - { \ - JU_LEAFPREP(cIS,Type,MaxPop1,ValueArea); \ - JU_LEAFGROW(cIS,Type,MaxPop1,Search,ValueArea,GrowInPlace, \ - InsertInPlace,InsertCopy,Alloc,Free); \ - JU_LEAFCASCADE(MaxPop1,Cascade,Free); \ - } - -// END OF MACROS; LEAFL CASES START HERE: -// -// 64-bit Judy1 does not have 1-byte leaves: - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - - case cJU_JPLEAF1: - - JU_LEAFSET(1, uint8_t *, cJU_LEAF1_MAXPOP1, j__udySearchLeaf1, - JU_LEAF1GROWINPLACE, JU_INSERTINPLACE, JU_INSERTCOPY, - j__udyCascade1, j__udyAllocJLL1, j__udyFreeJLL1, - JL_LEAF1VALUEAREA); - -#endif // (JUDYL || ! JU_64BIT) - - case cJU_JPLEAF2: - - JU_LEAFSET(2, uint16_t *, cJU_LEAF2_MAXPOP1, j__udySearchLeaf2, - JU_LEAF2GROWINPLACE, JU_INSERTINPLACE, JU_INSERTCOPY, - j__udyCascade2, j__udyAllocJLL2, j__udyFreeJLL2, - JL_LEAF2VALUEAREA); - - case cJU_JPLEAF3: - - JU_LEAFSET(3, uint8_t *, cJU_LEAF3_MAXPOP1, j__udySearchLeaf3, - JU_LEAF3GROWINPLACE, JU_INSERTINPLACE3, JU_INSERTCOPY3, - j__udyCascade3, j__udyAllocJLL3, j__udyFreeJLL3, - JL_LEAF3VALUEAREA); - -#ifdef JU_64BIT - case cJU_JPLEAF4: - - JU_LEAFSET(4, uint32_t *, cJU_LEAF4_MAXPOP1, j__udySearchLeaf4, - JU_LEAF4GROWINPLACE, JU_INSERTINPLACE, JU_INSERTCOPY, - j__udyCascade4, j__udyAllocJLL4, j__udyFreeJLL4, - JL_LEAF4VALUEAREA); - - case cJU_JPLEAF5: - - JU_LEAFSET(5, uint8_t *, cJU_LEAF5_MAXPOP1, j__udySearchLeaf5, - JU_LEAF5GROWINPLACE, JU_INSERTINPLACE5, JU_INSERTCOPY5, - j__udyCascade5, j__udyAllocJLL5, j__udyFreeJLL5, - JL_LEAF5VALUEAREA); - - case cJU_JPLEAF6: - - JU_LEAFSET(6, uint8_t *, cJU_LEAF6_MAXPOP1, j__udySearchLeaf6, - JU_LEAF6GROWINPLACE, JU_INSERTINPLACE6, JU_INSERTCOPY6, - j__udyCascade6, j__udyAllocJLL6, j__udyFreeJLL6, - JL_LEAF6VALUEAREA); - - case cJU_JPLEAF7: - - JU_LEAFSET(7, uint8_t *, cJU_LEAF7_MAXPOP1, j__udySearchLeaf7, - JU_LEAF7GROWINPLACE, JU_INSERTINPLACE7, JU_INSERTCOPY7, - j__udyCascade7, j__udyAllocJLL7, j__udyFreeJLL7, - JL_LEAF7VALUEAREA); -#endif // JU_64BIT - - -// **************************************************************************** -// JPLEAF_B1: -// -// 8 bit Decode | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -// |SubExpanse | Bit offset | -// -// Note: For JudyL, values are stored in 8 subexpanses, each a linear word -// array of up to 32 values each. - - case cJU_JPLEAF_B1: - { -#ifdef JUDYL - Pjv_t PjvRaw; // pointer to value part of the leaf. - Pjv_t Pjv; // pointer to value part of the leaf. - Pjv_t PjvnewRaw; // new value area. - Pjv_t Pjvnew; // new value area. - Word_t subexp; // 1 of 8 subexpanses in bitmap. - Pjlb_t Pjlb; // pointer to bitmap part of the leaf. - BITMAPL_t bitmap; // for one subexpanse. - BITMAPL_t bitmask; // bit set for Indexs digit. - int offset; // of index in value area. -#endif - - JU_CHECK_IF_OUTLIER(Pjp, Index, 1, Pjpm); - -#ifdef JUDY1 - -// If Index (bit) is already set, return now: - - if (JU_BITMAPTESTL(P_JLB(Pjp->jp_Addr), Index)) return(0); - -// If bitmap is not full, set the new Indexs bit; otherwise convert to a Full: - - if ((exppop1 = JU_JPLEAF_POP0(Pjp) + 1) - < cJU_JPFULLPOPU1_POP0) - { - JU_BITMAPSETL(P_JLB(Pjp->jp_Addr), Index); - } - else - { - j__udyFreeJLB1((Pjlb_t) (Pjp->jp_Addr), Pjpm); // free LeafB1. - Pjp->jp_Type = cJ1_JPFULLPOPU1; - Pjp->jp_Addr = 0; - } - -#else // JUDYL - -// This is very different from Judy1 because of the need to return a value area -// even for an existing Index, or manage the value area for a new Index, and -// because JudyL has no Full type: - -// Get last byte to decode from Index, and pointer to bitmap leaf: - - digit = JU_DIGITATSTATE(Index, 1); - Pjlb = P_JLB(Pjp->jp_Addr); - -// Prepare additional values: - - subexp = digit / cJU_BITSPERSUBEXPL; // which subexpanse. - bitmap = JU_JLB_BITMAP(Pjlb, subexp); // subexps 32-bit map. - PjvRaw = JL_JLB_PVALUE(Pjlb, subexp); // corresponding values. - Pjv = P_JV(PjvRaw); // corresponding values. - bitmask = JU_BITPOSMASKL(digit); // mask for Index. - offset = j__udyCountBitsL(bitmap & (bitmask - 1)); // of Index. - -// If Index already exists, get value pointer and exit: - - if (bitmap & bitmask) - { - assert(Pjv); - Pjpm->jpm_PValue = Pjv + offset; // existing value. - return(0); - } - -// Get the total bits set = expanse population of Value area: - - exppop1 = j__udyCountBitsL(bitmap); - -// If the value area can grow in place, do it: - - if (JL_LEAFVGROWINPLACE(exppop1)) - { - JU_INSERTINPLACE(Pjv, exppop1, offset, 0); - JU_JLB_BITMAP(Pjlb, subexp) |= bitmask; // set Indexs bit. - Pjpm->jpm_PValue = Pjv + offset; // new value area. - return(1); - } - -// Increase size of value area: - - if ((PjvnewRaw = j__udyLAllocJV(exppop1 + 1, Pjpm)) - == (Pjv_t) NULL) return(-1); - Pjvnew = P_JV(PjvnewRaw); - - if (exppop1) // have existing value area. - { - assert(Pjv); - JU_INSERTCOPY(Pjvnew, Pjv, exppop1, offset, 0); - Pjpm->jpm_PValue = Pjvnew + offset; - j__udyLFreeJV(PjvRaw, exppop1, Pjpm); // free old values. - } - else // first index, new value area: - { - Pjpm->jpm_PValue = Pjvnew; - *(Pjpm->jpm_PValue) = 0; - } - -// Set bit for new Index and place new leaf value area in bitmap: - - JU_JLB_BITMAP(Pjlb, subexp) |= bitmask; - JL_JLB_PVALUE(Pjlb, subexp) = PjvnewRaw; - -#endif // JUDYL - - return(1); - - } // case - - -#ifdef JUDY1 -// **************************************************************************** -// JPFULLPOPU1: -// -// If Index is not an outlier, then by definition its already set. - - case cJ1_JPFULLPOPU1: - - JU_CHECK_IF_OUTLIER(Pjp, Index, 1, Pjpm); - return(0); -#endif - - -// **************************************************************************** -// JPIMMED*: -// -// This is some of the most complex code in Judy considering Judy1 versus JudyL -// and 32-bit versus 64-bit variations. The following comments attempt to make -// this clearer. -// -// Of the 2 words in a JP, for immediate indexes Judy1 can use 2 words - 1 byte -// = 7 [15] bytes, but JudyL can only use 1 word - 1 byte = 3 [7] bytes because -// the other word is needed for a value area or a pointer to a value area. -// -// For both Judy1 and JudyL, cJU_JPIMMED_*_01 indexes are in word 2; otherwise -// for Judy1 only, a list of 2 or more indexes starts in word 1. JudyL keeps -// the list in word 2 because word 1 is a pointer (to a LeafV, that is, a leaf -// containing only values). Furthermore, cJU_JPIMMED_*_01 indexes are stored -// all-but-first-byte in jp_DcdPopO, not just the Index Sizes bytes. -// -// TBD: This can be confusing because Doug didnt use data structures for it. -// Instead he often directly accesses Pjp for the first word and jp_DcdPopO for -// the second word. It would be nice to use data structs, starting with -// jp_1Index and jp_LIndex where possible. -// -// Maximum Immed JP types for Judy1/JudyL, depending on Index Size (cIS): -// -// 32-bit 64-bit -// -// bytes: 7/ 3 15/ 7 (Judy1/JudyL) -// -// cIS -// 1_ 07/03 15/07 (as in: cJ1_JPIMMED_1_07) -// 2_ 03/01 07/03 -// 3_ 02/01 05/02 -// 4_ 03/01 -// 5_ 03/01 -// 6_ 02/01 -// 7_ 02/01 -// -// State transitions while inserting an Index, matching the above table: -// (Yes, this is very terse... Study it and it will make sense.) -// (Note, parts of this diagram are repeated below for quick reference.) -// -// +-- reformat JP here for Judy1 only, from word-2 to word-1 -// | -// | JUDY1 || JU_64BIT JUDY1 && JU_64BIT -// V -// 1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] Leaf1 (*) -// 2_01 => [ 2_02 => 2_03 => [ 2_04..07 => ]] Leaf2 -// 3_01 => [ 3_02 => [ 3_03..05 => ]] Leaf3 -// JU_64BIT only: -// 4_01 => [[ 4_02..03 => ]] Leaf4 -// 5_01 => [[ 5_02..03 => ]] Leaf5 -// 6_01 => [[ 6_02 => ]] Leaf6 -// 7_01 => [[ 7_02 => ]] Leaf7 -// -// (*) For Judy1 & 64-bit, go directly from cJU_JPIMMED_1_15 to a LeafB1; skip -// Leaf1, as described in Judy1.h regarding cJ1_JPLEAF1. - - -// COMMON CODE FRAGMENTS TO MINIMIZE REDUNDANCY BELOW: -// -// These are necessary to support performance by function and loop unrolling -// while avoiding huge amounts of nearly identical code. -// -// The differences between Judy1 and JudyL with respect to value area handling -// are just too large for completely common code between them... Oh well, some -// big ifdefs follow. However, even in the following ifdefd code, use cJU_*, -// JU_*, and Judy*() instead of cJ1_* / cJL_*, J1_* / JL_*, and -// Judy1*()/JudyL*(), for minimum diffs. -// -// Handle growth of cJU_JPIMMED_*_01 to cJU_JPIMMED_*_02, for an even or odd -// Index Size (cIS), given oldIndex, Index, and Pjll in the context: -// -// Put oldIndex and Index in their proper order. For odd indexes, must copy -// bytes. - -#ifdef JUDY1 - -#define JU_IMMSET_01_COPY_EVEN(ignore1,ignore2) \ - if (oldIndex < Index) { Pjll[0] = oldIndex; Pjll[1] = Index; } \ - else { Pjll[0] = Index; Pjll[1] = oldIndex; } - -#define JU_IMMSET_01_COPY_ODD(cIS,CopyWord) \ - if (oldIndex < Index) \ - { \ - CopyWord(Pjll + 0, oldIndex); \ - CopyWord(Pjll + (cIS), Index); \ - } \ - else \ - { \ - CopyWord(Pjll + 0, Index); \ - CopyWord(Pjll + (cIS), oldIndex); \ - } - -// The "real" *_01 Copy macro: -// -// Trim the high byte off Index, look for a match with the old Index, and if -// none, insert the new Index in the leaf in the correct place, given Pjp and -// Index in the context. -// -// Note: A single immediate index lives in the jp_DcdPopO field, but two or -// more reside starting at Pjp->jp_1Index. - -#define JU_IMMSET_01_COPY(cIS,LeafType,NewJPType,Copy,CopyWord) \ - { \ - LeafType Pjll; \ - Word_t oldIndex = JU_JPDCDPOP0(Pjp); \ - \ - Index = JU_TRIMTODCDSIZE(Index); \ - if (oldIndex == Index) return(0); \ - \ - Pjll = (LeafType) (Pjp->jp_1Index); \ - Copy(cIS,CopyWord); \ - DBGCODE(JudyCheckSorted(Pjll, 2, cIS);) \ - \ - Pjp->jp_Type = (NewJPType); \ - return(1); \ - } - -#else // JUDYL - -// Variations to also handle value areas; see comments above: -// -// For JudyL, Pjv (start of value area) and oldValue are also in the context; -// leave Pjv set to the value area for Index. - -#define JU_IMMSET_01_COPY_EVEN(cIS,CopyWord) \ - if (oldIndex < Index) \ - { \ - Pjll[0] = oldIndex; \ - Pjv [0] = oldValue; \ - Pjll[1] = Index; \ - ++Pjv; \ - } \ - else \ - { \ - Pjll[0] = Index; \ - Pjll[1] = oldIndex; \ - Pjv [1] = oldValue; \ - } - -#define JU_IMMSET_01_COPY_ODD(cIS,CopyWord) \ - if (oldIndex < Index) \ - { \ - CopyWord(Pjll + 0, oldIndex); \ - CopyWord(Pjll + (cIS), Index); \ - Pjv[0] = oldValue; \ - ++Pjv; \ - } \ - else \ - { \ - CopyWord(Pjll + 0, Index); \ - CopyWord(Pjll + (cIS), oldIndex); \ - Pjv[1] = oldValue; \ - } - -// The old value area is in the first word (*Pjp), and Pjv and Pjpm are also in -// the context. Also, unlike Judy1, indexes remain in word 2 (jp_LIndex), -// meaning insert-in-place rather than copy. -// -// Return jpm_PValue pointing to Indexs value area. If Index is new, allocate -// a 2-value-leaf and attach it to the JP. - -#define JU_IMMSET_01_COPY(cIS,LeafType,NewJPType,Copy,CopyWord) \ - { \ - LeafType Pjll; \ - Word_t oldIndex = JU_JPDCDPOP0(Pjp); \ - Word_t oldValue; \ - Pjv_t PjvRaw; \ - Pjv_t Pjv; \ - \ - Index = JU_TRIMTODCDSIZE(Index); \ - \ - if (oldIndex == Index) \ - { \ - Pjpm->jpm_PValue = (Pjv_t) Pjp; \ - return(0); \ - } \ - \ - if ((PjvRaw = j__udyLAllocJV(2, Pjpm)) == (Pjv_t) NULL) \ - return(-1); \ - Pjv = P_JV(PjvRaw); \ - \ - oldValue = Pjp->jp_Addr; \ - (Pjp->jp_Addr) = (Word_t) PjvRaw; \ - Pjll = (LeafType) (Pjp->jp_LIndex); \ - \ - Copy(cIS,CopyWord); \ - DBGCODE(JudyCheckSorted(Pjll, 2, cIS);) \ - \ - Pjp->jp_Type = (NewJPType); \ - *Pjv = 0; \ - Pjpm->jpm_PValue = Pjv; \ - return(1); \ - } - -// The following is a unique mix of JU_IMMSET_01() and JU_IMMSETCASCADE() for -// going from cJU_JPIMMED_*_01 directly to a cJU_JPLEAF* for JudyL: -// -// If Index is not already set, allocate a leaf, copy the old and new indexes -// into it, clear and return the new value area, and modify the current JP. -// Note that jp_DcdPop is set to a pop0 of 0 for now, and incremented later. - - -#define JU_IMMSET_01_CASCADE(cIS,LeafType,NewJPType,ValueArea, \ - Copy,CopyWord,Alloc) \ - { \ - Word_t D_P0; \ - LeafType PjllRaw; \ - LeafType Pjll; \ - Word_t oldIndex = JU_JPDCDPOP0(Pjp); \ - Word_t oldValue; \ - Pjv_t Pjv; \ - \ - Index = JU_TRIMTODCDSIZE(Index); \ - \ - if (oldIndex == Index) \ - { \ - Pjpm->jpm_PValue = (Pjv_t) (&(Pjp->jp_Addr)); \ - return(0); \ - } \ - \ - if ((PjllRaw = (LeafType) Alloc(2, Pjpm)) == (LeafType) NULL) \ - return(-1); \ - Pjll = (LeafType) P_JLL(PjllRaw); \ - Pjv = ValueArea(Pjll, 2); \ - \ - oldValue = Pjp->jp_Addr; \ - \ - Copy(cIS,CopyWord); \ - DBGCODE(JudyCheckSorted(Pjll, 2, cIS);) \ - \ - *Pjv = 0; \ - Pjpm->jpm_PValue = Pjv; \ - D_P0 = Index & cJU_DCDMASK(cIS); /* pop0 = 0 */ \ - JU_JPSETADT(Pjp, (Word_t)PjllRaw, D_P0, NewJPType); \ - \ - return(1); \ - } - -#endif // JUDYL - -// Handle growth of cJU_JPIMMED_*_[02..15]: - -#ifdef JUDY1 - -// Insert an Index into an immediate JP that has room for more, if the Index is -// not already present; given Pjp, Index, exppop1, Pjv, and Pjpm in the -// context: -// -// Note: Use this only when the JP format doesnt change, that is, going from -// cJU_JPIMMED_X_0Y to cJU_JPIMMED_X_0Z, where X >= 2 and Y+1 = Z. -// -// Note: Incrementing jp_Type is how to increase the Index population. - -#define JU_IMMSETINPLACE(cIS,LeafType,BaseJPType_02,Search,InsertInPlace) \ - { \ - LeafType Pjll; \ - int offset; \ - \ - exppop1 = JU_JPTYPE(Pjp) - (BaseJPType_02) + 2; \ - offset = Search((Pjll_t) (Pjp->jp_1Index), exppop1, Index); \ - \ - JU_CHECK_IF_EXISTS(offset, ignore, Pjpm); \ - \ - Pjll = (LeafType) (Pjp->jp_1Index); \ - InsertInPlace(Pjll, exppop1, offset, Index); \ - DBGCODE(JudyCheckSorted(Pjll, exppop1 + 1, cIS);) \ - ++(Pjp->jp_Type); \ - return(1); \ - } - -// Insert an Index into an immediate JP that has no room for more: -// -// If the Index is not already present, do a cascade (to a leaf); given Pjp, -// Index, Pjv, and Pjpm in the context. - - -#define JU_IMMSETCASCADE(cIS,OldPop1,LeafType,NewJPType, \ - ignore,Search,InsertCopy,Alloc) \ - { \ - Word_t D_P0; \ - Pjll_t PjllRaw; \ - Pjll_t Pjll; \ - int offset; \ - \ - offset = Search((Pjll_t) (Pjp->jp_1Index), (OldPop1), Index); \ - JU_CHECK_IF_EXISTS(offset, ignore, Pjpm); \ - \ - if ((PjllRaw = Alloc((OldPop1) + 1, Pjpm)) == 0) return(-1); \ - Pjll = P_JLL(PjllRaw); \ - \ - InsertCopy((LeafType) Pjll, (LeafType) (Pjp->jp_1Index), \ - OldPop1, offset, Index); \ - DBGCODE(JudyCheckSorted(Pjll, (OldPop1) + 1, cIS);) \ - \ - D_P0 = (Index & cJU_DCDMASK(cIS)) + (OldPop1) - 1; \ - JU_JPSETADT(Pjp, (Word_t)PjllRaw, D_P0, NewJPType); \ - return(1); \ - } - -#else // JUDYL - -// Variations to also handle value areas; see comments above: -// -// For JudyL, Pjv (start of value area) is also in the context. -// -// TBD: This code makes a true but weak assumption that a JudyL 32-bit 2-index -// value area must be copied to a new 3-index value area. AND it doesnt know -// anything about JudyL 64-bit cases (cJU_JPIMMED_1_0[3-7] only) where the -// value area can grow in place! However, this should not break it, just slow -// it down. - -#define JU_IMMSETINPLACE(cIS,LeafType,BaseJPType_02,Search,InsertInPlace) \ - { \ - LeafType Pleaf; \ - int offset; \ - Pjv_t PjvRaw; \ - Pjv_t Pjv; \ - Pjv_t PjvnewRaw; \ - Pjv_t Pjvnew; \ - \ - exppop1 = JU_JPTYPE(Pjp) - (BaseJPType_02) + 2; \ - offset = Search((Pjll_t) (Pjp->jp_LIndex), exppop1, Index); \ - PjvRaw = (Pjv_t) (Pjp->jp_Addr); \ - Pjv = P_JV(PjvRaw); \ - \ - JU_CHECK_IF_EXISTS(offset, Pjv, Pjpm); \ - \ - if ((PjvnewRaw = j__udyLAllocJV(exppop1 + 1, Pjpm)) \ - == (Pjv_t) NULL) return(-1); \ - Pjvnew = P_JV(PjvnewRaw); \ - \ - Pleaf = (LeafType) (Pjp->jp_LIndex); \ - \ - InsertInPlace(Pleaf, exppop1, offset, Index); \ - /* see TBD above about this: */ \ - JU_INSERTCOPY(Pjvnew, Pjv, exppop1, offset, 0); \ - DBGCODE(JudyCheckSorted(Pleaf, exppop1 + 1, cIS);) \ - j__udyLFreeJV(PjvRaw, exppop1, Pjpm); \ - Pjp->jp_Addr = (Word_t) PjvnewRaw; \ - Pjpm->jpm_PValue = Pjvnew + offset; \ - \ - ++(Pjp->jp_Type); \ - return(1); \ - } - -#define JU_IMMSETCASCADE(cIS,OldPop1,LeafType,NewJPType, \ - ValueArea,Search,InsertCopy,Alloc) \ - { \ - Word_t D_P0; \ - Pjll_t PjllRaw; \ - Pjll_t Pjll; \ - int offset; \ - Pjv_t PjvRaw; \ - Pjv_t Pjv; \ - Pjv_t Pjvnew; \ - \ - PjvRaw = (Pjv_t) (Pjp->jp_Addr); \ - Pjv = P_JV(PjvRaw); \ - offset = Search((Pjll_t) (Pjp->jp_LIndex), (OldPop1), Index); \ - JU_CHECK_IF_EXISTS(offset, Pjv, Pjpm); \ - \ - if ((PjllRaw = Alloc((OldPop1) + 1, Pjpm)) == 0) \ - return(-1); \ - Pjll = P_JLL(PjllRaw); \ - InsertCopy((LeafType) Pjll, (LeafType) (Pjp->jp_LIndex), \ - OldPop1, offset, Index); \ - DBGCODE(JudyCheckSorted(Pjll, (OldPop1) + 1, cIS);) \ - \ - Pjvnew = ValueArea(Pjll, (OldPop1) + 1); \ - JU_INSERTCOPY(Pjvnew, Pjv, OldPop1, offset, 0); \ - j__udyLFreeJV(PjvRaw, (OldPop1), Pjpm); \ - Pjpm->jpm_PValue = Pjvnew + offset; \ - \ - D_P0 = (Index & cJU_DCDMASK(cIS)) + (OldPop1) - 1; \ - JU_JPSETADT(Pjp, (Word_t)PjllRaw, D_P0, NewJPType); \ - return(1); \ - } - -#endif // JUDYL - -// Common convenience/shorthand wrappers around JU_IMMSET_01_COPY() for -// even/odd index sizes: - -#define JU_IMMSET_01( cIS, LeafType, NewJPType) \ - JU_IMMSET_01_COPY(cIS, LeafType, NewJPType, JU_IMMSET_01_COPY_EVEN, \ - ignore) - -#define JU_IMMSET_01_ODD( cIS, NewJPType, CopyWord) \ - JU_IMMSET_01_COPY(cIS, uint8_t *, NewJPType, JU_IMMSET_01_COPY_ODD, \ - CopyWord) - - -// END OF MACROS; IMMED CASES START HERE: - -// cJU_JPIMMED_*_01 cases: -// -// 1_01 always leads to 1_02: -// -// (1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] LeafL) - - case cJU_JPIMMED_1_01: JU_IMMSET_01(1, uint8_t *, cJU_JPIMMED_1_02); - -// 2_01 leads to 2_02, and 3_01 leads to 3_02, except for JudyL 32-bit, where -// they lead to a leaf: -// -// (2_01 => [ 2_02 => 2_03 => [ 2_04..07 => ]] LeafL) -// (3_01 => [ 3_02 => [ 3_03..05 => ]] LeafL) - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_01: JU_IMMSET_01(2, uint16_t *, cJU_JPIMMED_2_02); - case cJU_JPIMMED_3_01: JU_IMMSET_01_ODD (3, cJU_JPIMMED_3_02, - JU_COPY3_LONG_TO_PINDEX); -#else - case cJU_JPIMMED_2_01: - JU_IMMSET_01_CASCADE(2, uint16_t *, cJU_JPLEAF2, JL_LEAF2VALUEAREA, - JU_IMMSET_01_COPY_EVEN, ignore, - j__udyAllocJLL2); - case cJU_JPIMMED_3_01: - JU_IMMSET_01_CASCADE(3, uint8_t *, cJU_JPLEAF3, JL_LEAF3VALUEAREA, - JU_IMMSET_01_COPY_ODD, - JU_COPY3_LONG_TO_PINDEX, j__udyAllocJLL3); -#endif - -#ifdef JU_64BIT - -// [4-7]_01 lead to [4-7]_02 for Judy1, and to leaves for JudyL: -// -// (4_01 => [[ 4_02..03 => ]] LeafL) -// (5_01 => [[ 5_02..03 => ]] LeafL) -// (6_01 => [[ 6_02 => ]] LeafL) -// (7_01 => [[ 7_02 => ]] LeafL) - -#ifdef JUDY1 - case cJU_JPIMMED_4_01: JU_IMMSET_01(4, uint32_t *, cJ1_JPIMMED_4_02); - case cJU_JPIMMED_5_01: JU_IMMSET_01_ODD(5, cJ1_JPIMMED_5_02, - JU_COPY5_LONG_TO_PINDEX); - case cJU_JPIMMED_6_01: JU_IMMSET_01_ODD(6, cJ1_JPIMMED_6_02, - JU_COPY6_LONG_TO_PINDEX); - case cJU_JPIMMED_7_01: JU_IMMSET_01_ODD(7, cJ1_JPIMMED_7_02, - JU_COPY7_LONG_TO_PINDEX); -#else // JUDYL - case cJU_JPIMMED_4_01: - JU_IMMSET_01_CASCADE(4, uint32_t *, cJU_JPLEAF4, JL_LEAF4VALUEAREA, - JU_IMMSET_01_COPY_EVEN, ignore, - j__udyAllocJLL4); - case cJU_JPIMMED_5_01: - JU_IMMSET_01_CASCADE(5, uint8_t *, cJU_JPLEAF5, JL_LEAF5VALUEAREA, - JU_IMMSET_01_COPY_ODD, - JU_COPY5_LONG_TO_PINDEX, j__udyAllocJLL5); - case cJU_JPIMMED_6_01: - JU_IMMSET_01_CASCADE(6, uint8_t *, cJU_JPLEAF6, JL_LEAF6VALUEAREA, - JU_IMMSET_01_COPY_ODD, - JU_COPY6_LONG_TO_PINDEX, j__udyAllocJLL6); - case cJU_JPIMMED_7_01: - JU_IMMSET_01_CASCADE(7, uint8_t *, cJU_JPLEAF7, JL_LEAF7VALUEAREA, - JU_IMMSET_01_COPY_ODD, - JU_COPY7_LONG_TO_PINDEX, j__udyAllocJLL7); -#endif // JUDYL -#endif // JU_64BIT - -// cJU_JPIMMED_1_* cases that can grow in place: -// -// (1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] LeafL) - - case cJU_JPIMMED_1_02: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_03: - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJU_JPIMMED_1_07: - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: -#endif - JU_IMMSETINPLACE(1, uint8_t *, cJU_JPIMMED_1_02, j__udySearchLeaf1, - JU_INSERTINPLACE); - -// cJU_JPIMMED_1_* cases that must cascade: -// -// (1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] LeafL) - -#if (defined(JUDYL) && (! defined(JU_64BIT))) - case cJU_JPIMMED_1_03: - JU_IMMSETCASCADE(1, 3, uint8_t *, cJU_JPLEAF1, JL_LEAF1VALUEAREA, - j__udySearchLeaf1, JU_INSERTCOPY, - j__udyAllocJLL1); -#endif -#if (defined(JUDY1) && (! defined(JU_64BIT))) - case cJU_JPIMMED_1_07: - JU_IMMSETCASCADE(1, 7, uint8_t *, cJU_JPLEAF1, ignore, - j__udySearchLeaf1, JU_INSERTCOPY, - j__udyAllocJLL1); - -#endif -#if (defined(JUDYL) && defined(JU_64BIT)) - case cJU_JPIMMED_1_07: - JU_IMMSETCASCADE(1, 7, uint8_t *, cJU_JPLEAF1, JL_LEAF1VALUEAREA, - j__udySearchLeaf1, JU_INSERTCOPY, - j__udyAllocJLL1); - -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) -// Special case, as described above, go directly from Immed to LeafB1: - - case cJ1_JPIMMED_1_15: - { - Word_t DcdP0; - int offset; - Pjlb_t PjlbRaw; - Pjlb_t Pjlb; - - offset = j__udySearchLeaf1((Pjll_t) Pjp->jp_1Index, 15, Index); - - JU_CHECK_IF_EXISTS(offset, ignore, Pjpm); - -// Create a bitmap leaf (special case for Judy1 64-bit only, see usage): Set -// new Index in bitmap, copy an Immed1_15 to the bitmap, and set the parent JP -// EXCEPT jp_DcdPopO, leaving any followup to the caller: - - if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL) - return(-1); - Pjlb = P_JLB(PjlbRaw); - - JU_BITMAPSETL(Pjlb, Index); - - for (offset = 0; offset < 15; ++offset) - JU_BITMAPSETL(Pjlb, Pjp->jp_1Index[offset]); - -// Set jp_DcdPopO including the current pop0; incremented later: - DcdP0 = (Index & cJU_DCDMASK(1)) + 15 - 1; - JU_JPSETADT(Pjp, (Word_t)PjlbRaw, DcdP0, cJU_JPLEAF_B1); - - return(1); - } -#endif - -// cJU_JPIMMED_[2..7]_[02..15] cases that grow in place or cascade: -// -// (2_01 => [ 2_02 => 2_03 => [ 2_04..07 => ]] LeafL) - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJU_JPIMMED_2_03: - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - JU_IMMSETINPLACE(2, uint16_t *, cJU_JPIMMED_2_02, j__udySearchLeaf2, - JU_INSERTINPLACE); -#endif - -#undef OLDPOP1 -#if ((defined(JUDY1) && (! defined(JU_64BIT))) || (defined(JUDYL) && defined(JU_64BIT))) - case cJU_JPIMMED_2_03: -#define OLDPOP1 3 -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_07: -#define OLDPOP1 7 -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - JU_IMMSETCASCADE(2, OLDPOP1, uint16_t *, cJU_JPLEAF2, - JL_LEAF2VALUEAREA, j__udySearchLeaf2, - JU_INSERTCOPY, j__udyAllocJLL2); -#endif - -// (3_01 => [ 3_02 => [ 3_03..05 => ]] LeafL) - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJU_JPIMMED_3_02: - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - - JU_IMMSETINPLACE(3, uint8_t *, cJU_JPIMMED_3_02, j__udySearchLeaf3, - JU_INSERTINPLACE3); -#endif - -#undef OLDPOP1 -#if ((defined(JUDY1) && (! defined(JU_64BIT))) || (defined(JUDYL) && defined(JU_64BIT))) - case cJU_JPIMMED_3_02: -#define OLDPOP1 2 -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_05: -#define OLDPOP1 5 -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - JU_IMMSETCASCADE(3, OLDPOP1, uint8_t *, cJU_JPLEAF3, - JL_LEAF3VALUEAREA, j__udySearchLeaf3, - JU_INSERTCOPY3, j__udyAllocJLL3); -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - -// (4_01 => [[ 4_02..03 => ]] LeafL) - - case cJ1_JPIMMED_4_02: - - JU_IMMSETINPLACE(4, uint32_t *, cJ1_JPIMMED_4_02, j__udySearchLeaf4, - JU_INSERTINPLACE); - - case cJ1_JPIMMED_4_03: - - JU_IMMSETCASCADE(4, 3, uint32_t *, cJU_JPLEAF4, ignore, - j__udySearchLeaf4, JU_INSERTCOPY, - j__udyAllocJLL4); - -// (5_01 => [[ 5_02..03 => ]] LeafL) - - case cJ1_JPIMMED_5_02: - - JU_IMMSETINPLACE(5, uint8_t *, cJ1_JPIMMED_5_02, j__udySearchLeaf5, - JU_INSERTINPLACE5); - - case cJ1_JPIMMED_5_03: - - JU_IMMSETCASCADE(5, 3, uint8_t *, cJU_JPLEAF5, ignore, - j__udySearchLeaf5, JU_INSERTCOPY5, - j__udyAllocJLL5); - -// (6_01 => [[ 6_02 => ]] LeafL) - - case cJ1_JPIMMED_6_02: - - JU_IMMSETCASCADE(6, 2, uint8_t *, cJU_JPLEAF6, ignore, - j__udySearchLeaf6, JU_INSERTCOPY6, - j__udyAllocJLL6); - -// (7_01 => [[ 7_02 => ]] LeafL) - - case cJ1_JPIMMED_7_02: - - JU_IMMSETCASCADE(7, 2, uint8_t *, cJU_JPLEAF7, ignore, - j__udySearchLeaf7, JU_INSERTCOPY7, - j__udyAllocJLL7); - -#endif // (JUDY1 && JU_64BIT) - - -// **************************************************************************** -// INVALID JP TYPE: - - default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); return(-1); - - } // switch on JP type - - { - -#ifdef SUBEXPCOUNTS - -// This code might seem strange here. However it saves some memory read time -// during insert (~70nS) because a pipelined processor does not need to "stall" -// waiting for the memory read to complete. Hope the compiler is not too smart -// or dumb and moves the code down to where it looks like it belongs (below a -// few lines). - - Word_t SubExpCount = 0; // current subexpanse counter. - - if (PSubExp != (PWord_t) NULL) // only if BranchB/U. - SubExpCount = PSubExp[0]; -#endif - -// PROCESS JP -- RECURSIVELY: -// -// For non-Immed JP types, if successful, post-increment the population count -// at this Level. - - retcode = j__udyInsWalk(Pjp, Index, Pjpm); - -// Successful insert, increment JP and subexpanse count: - - if ((JU_JPTYPE(Pjp) < cJU_JPIMMED_1_01) && (retcode == 1)) - { - jp_t JP; - Word_t DcdP0; -#ifdef SUBEXPCOUNTS - -// Note: Pjp must be a pointer to a BranchB/U: - - if (PSubExp != (PWord_t) NULL) PSubExp[0] = SubExpCount + 1; -#endif - - JP = *Pjp; - DcdP0 = JU_JPDCDPOP0(Pjp) + 1; - JU_JPSETADT(Pjp, JP.jp_Addr, DcdP0, JU_JPTYPE(&JP)); - } - } - return(retcode); - -} // j__udyInsWalk() - - -// **************************************************************************** -// J U D Y 1 S E T -// J U D Y L I N S -// -// Main entry point. See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1Set -#else -FUNCTION PPvoid_t JudyLIns -#endif - ( - PPvoid_t PPArray, // in which to insert. - Word_t Index, // to insert. - PJError_t PJError // optional, for returning error info. - ) -{ -#ifdef JUDY1 -#define Pjv ignore // placeholders for macros. -#define Pjvnew ignore -#else - Pjv_t Pjv; // value area in old leaf. - Pjv_t Pjvnew; // value area in new leaf. -#endif - Pjpm_t Pjpm; // array-global info. - int offset; // position in which to store new Index. - Pjlw_t Pjlw; - - -// CHECK FOR NULL POINTER (error by caller): - - if (PPArray == (PPvoid_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjlw = P_JLW(*PPArray); // first word of leaf. - -// **************************************************************************** -// PROCESS TOP LEVEL "JRP" BRANCHES AND LEAVES: - -// **************************************************************************** -// JRPNULL (EMPTY ARRAY): BUILD A LEAFW WITH ONE INDEX: - -// if a valid empty array (null pointer), so create an array of population == 1: - - if (Pjlw == (Pjlw_t)NULL) - { - Pjlw_t Pjlwnew; - - Pjlwnew = j__udyAllocJLW(1); - JUDY1CODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI );) - JUDYLCODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, PPJERR);) - - Pjlwnew[0] = 1 - 1; // pop0 = 0. - Pjlwnew[1] = Index; - - *PPArray = (Pvoid_t) Pjlwnew; - DBGCODE(JudyCheckPop(*PPArray);) - - JUDY1CODE(return(1); ) - JUDYLCODE(Pjlwnew[2] = 0; ) // value area. - JUDYLCODE(return((PPvoid_t) (Pjlwnew + 2)); ) - - } // NULL JRP - -// **************************************************************************** -// LEAFW, OTHER SIZE: - - if (JU_LEAFW_POP0(*PPArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlwnew; - Word_t pop1; - - Pjlw = P_JLW(*PPArray); // first word of leaf. - pop1 = Pjlw[0] + 1; - -#ifdef JUDYL - Pjv = JL_LEAFWVALUEAREA(Pjlw, pop1); -#endif - offset = j__udySearchLeafW(Pjlw + 1, pop1, Index); - - if (offset >= 0) // index is already valid: - { - DBGCODE(JudyCheckPop(*PPArray);) - JUDY1CODE(return(0); ) - JUDYLCODE(return((PPvoid_t) (Pjv + offset)); ) - } - - offset = ~offset; - -// Insert index in cases where no new memory is needed: - - if (JU_LEAFWGROWINPLACE(pop1)) - { - ++Pjlw[0]; // increase population. - - JU_INSERTINPLACE(Pjlw + 1, pop1, offset, Index); -#ifdef JUDYL - JU_INSERTINPLACE(Pjv, pop1, offset, 0); -#endif - DBGCODE(JudyCheckPop(*PPArray);) - DBGCODE(JudyCheckSorted(Pjlw + 1, pop1 + 1, cJU_ROOTSTATE);) - - JUDY1CODE(return(1); ) - JUDYLCODE(return((PPvoid_t) (Pjv + offset)); ) - } - -// Insert index into a new, larger leaf: - - if (pop1 < cJU_LEAFW_MAXPOP1) // can grow to a larger leaf. - { - Pjlwnew = j__udyAllocJLW(pop1 + 1); - JUDY1CODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI );) - JUDYLCODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, PPJERR);) - - Pjlwnew[0] = pop1; // set pop0 in new leaf. - - JU_INSERTCOPY(Pjlwnew + 1, Pjlw + 1, pop1, offset, Index); -#ifdef JUDYL - Pjvnew = JL_LEAFWVALUEAREA(Pjlwnew, pop1 + 1); - JU_INSERTCOPY(Pjvnew, Pjv, pop1, offset, 0); -#endif - DBGCODE(JudyCheckSorted(Pjlwnew + 1, pop1 + 1, cJU_ROOTSTATE);) - - j__udyFreeJLW(Pjlw, pop1, NULL); - - *PPArray = (Pvoid_t) Pjlwnew; - DBGCODE(JudyCheckPop(*PPArray);) - - JUDY1CODE(return(1); ) - JUDYLCODE(return((PPvoid_t) (Pjvnew + offset)); ) - } - - assert(pop1 == cJU_LEAFW_MAXPOP1); - -// Leaf at max size => cannot insert new index, so cascade instead: -// -// Upon cascading from a LEAFW leaf to the first branch, must allocate and -// initialize a JPM. - - Pjpm = j__udyAllocJPM(); - JUDY1CODE(JU_CHECKALLOC(Pjpm_t, Pjpm, JERRI );) - JUDYLCODE(JU_CHECKALLOC(Pjpm_t, Pjpm, PPJERR);) - - (Pjpm->jpm_Pop0) = cJU_LEAFW_MAXPOP1 - 1; - (Pjpm->jpm_JP.jp_Addr) = (Word_t) Pjlw; - - if (j__udyCascadeL(&(Pjpm->jpm_JP), Pjpm) == -1) - { - JU_COPY_ERRNO(PJError, Pjpm); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -// Note: No need to pass Pjpm for memory decrement; LEAFW memory is never -// counted in a JPM at all: - - j__udyFreeJLW(Pjlw, cJU_LEAFW_MAXPOP1, NULL); - *PPArray = (Pvoid_t) Pjpm; - - } // JU_LEAFW - -// **************************************************************************** -// BRANCH: - - { - int retcode; // really only needed for Judy1, but free for JudyL. - - Pjpm = P_JPM(*PPArray); - retcode = j__udyInsWalk(&(Pjpm->jpm_JP), Index, Pjpm); - - if (retcode == -1) - { - JU_COPY_ERRNO(PJError, Pjpm); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - if (retcode == 1) ++(Pjpm->jpm_Pop0); // incr total array popu. - - assert(((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_L) - || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_B) - || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_U)); - DBGCODE(JudyCheckPop(*PPArray);) - -#ifdef JUDY1 - assert((retcode == 0) || (retcode == 1)); - return(retcode); // == JU_RET_*_JPM(). -#else - assert(Pjpm->jpm_PValue != (Pjv_t) NULL); - return((PPvoid_t) Pjpm->jpm_PValue); -#endif - } - /*NOTREACHED*/ - -} // Judy1Set() / JudyLIns() diff --git a/libjudy/src/Judy1/Judy1SetArray.c b/libjudy/src/Judy1/Judy1SetArray.c deleted file mode 100644 index f8e361f277..0000000000 --- a/libjudy/src/Judy1/Judy1SetArray.c +++ /dev/null @@ -1,1178 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// TBD: It would probably be faster for the caller if the JudyL version took -// PIndex as an interleaved array of indexes and values rather than just -// indexes with a separate values array (PValue), especially considering -// indexes and values are copied here with for-loops anyway and not the -// equivalent of memcpy(). All code could be revised to simply count by two -// words for JudyL? Supports "streaming" the data to/from disk better later? -// In which case get rid of JU_ERRNO_NULLPVALUE, no longer needed, and simplify -// the API to this code. -// _________________ - -// @(#) $Revision: 4.21 $ $Source: /judy/src/JudyCommon/JudyInsArray.c $ -// -// Judy1SetArray() and JudyLInsArray() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);) - - -// IMMED AND LEAF SIZE AND BRANCH TYPE ARRAYS: -// -// These support fast and easy lookup by level. - -static uint8_t immed_maxpop1[] = { - 0, - cJU_IMMED1_MAXPOP1, - cJU_IMMED2_MAXPOP1, - cJU_IMMED3_MAXPOP1, -#ifdef JU_64BIT - cJU_IMMED4_MAXPOP1, - cJU_IMMED5_MAXPOP1, - cJU_IMMED6_MAXPOP1, - cJU_IMMED7_MAXPOP1, -#endif - // note: There are no IMMEDs for whole words. -}; - -static uint8_t leaf_maxpop1[] = { - 0, -#if (defined(JUDYL) || (! defined(JU_64BIT))) - cJU_LEAF1_MAXPOP1, -#else - 0, // 64-bit Judy1 has no Leaf1. -#endif - cJU_LEAF2_MAXPOP1, - cJU_LEAF3_MAXPOP1, -#ifdef JU_64BIT - cJU_LEAF4_MAXPOP1, - cJU_LEAF5_MAXPOP1, - cJU_LEAF6_MAXPOP1, - cJU_LEAF7_MAXPOP1, -#endif - // note: Root-level leaves are handled differently. -}; - -static uint8_t branchL_JPtype[] = { - 0, - 0, - cJU_JPBRANCH_L2, - cJU_JPBRANCH_L3, -#ifdef JU_64BIT - cJU_JPBRANCH_L4, - cJU_JPBRANCH_L5, - cJU_JPBRANCH_L6, - cJU_JPBRANCH_L7, -#endif - cJU_JPBRANCH_L, -}; - -static uint8_t branchB_JPtype[] = { - 0, - 0, - cJU_JPBRANCH_B2, - cJU_JPBRANCH_B3, -#ifdef JU_64BIT - cJU_JPBRANCH_B4, - cJU_JPBRANCH_B5, - cJU_JPBRANCH_B6, - cJU_JPBRANCH_B7, -#endif - cJU_JPBRANCH_B, -}; - -static uint8_t branchU_JPtype[] = { - 0, - 0, - cJU_JPBRANCH_U2, - cJU_JPBRANCH_U3, -#ifdef JU_64BIT - cJU_JPBRANCH_U4, - cJU_JPBRANCH_U5, - cJU_JPBRANCH_U6, - cJU_JPBRANCH_U7, -#endif - cJU_JPBRANCH_U, -}; - -// Subexpanse masks are similer to JU_DCDMASK() but without the need to clear -// the first digits bits. Avoid doing variable shifts by precomputing a -// lookup array. - -static Word_t subexp_mask[] = { - 0, - ~cJU_POP0MASK(1), - ~cJU_POP0MASK(2), - ~cJU_POP0MASK(3), -#ifdef JU_64BIT - ~cJU_POP0MASK(4), - ~cJU_POP0MASK(5), - ~cJU_POP0MASK(6), - ~cJU_POP0MASK(7), -#endif -}; - - -// FUNCTION PROTOTYPES: - -static bool_t j__udyInsArray(Pjp_t PjpParent, int Level, PWord_t PPop1, - PWord_t PIndex, -#ifdef JUDYL - Pjv_t PValue, -#endif - Pjpm_t Pjpm); - - -// **************************************************************************** -// J U D Y 1 S E T A R R A Y -// J U D Y L I N S A R R A Y -// -// Main entry point. See the manual entry for external overview. -// -// TBD: Until thats written, note that the function returns 1 for success or -// JERRI for serious error, including insufficient memory to build whole array; -// use Judy*Count() to see how many were stored, the first N of the total -// Count. Also, since it takes Count == Pop1, it cannot handle a full array. -// Also, "sorted" means ascending without duplicates, otherwise you get the -// "unsorted" error. -// -// The purpose of these functions is to allow rapid construction of a large -// Judy array given a sorted list of indexes (and for JudyL, corresponding -// values). At least one customer saw this as useful, and probably it would -// also be useful as a sufficient workaround for fast(er) unload/reload to/from -// disk. -// -// This code is written recursively for simplicity, until/unless someone -// decides to make it faster and more complex. Hopefully recursion is fast -// enough simply because the function is so much faster than a series of -// Set/Ins calls. - -#ifdef JUDY1 -FUNCTION int Judy1SetArray -#else -FUNCTION int JudyLInsArray -#endif - ( - PPvoid_t PPArray, // in which to insert, initially empty. - Word_t Count, // number of indexes (and values) to insert. -const Word_t * const PIndex, // list of indexes to insert. -#ifdef JUDYL -const Word_t * const PValue, // list of corresponding values. -#endif - PJError_t PJError // optional, for returning error info. - ) -{ - Pjlw_t Pjlw; // new root-level leaf. - Pjlw_t Pjlwindex; // first index in root-level leaf. - int offset; // in PIndex. - - -// CHECK FOR NULL OR NON-NULL POINTER (error by caller): - - if (PPArray == (PPvoid_t) NULL) - { JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); return(JERRI); } - - if (*PPArray != (Pvoid_t) NULL) - { JU_SET_ERRNO(PJError, JU_ERRNO_NONNULLPARRAY); return(JERRI); } - - if (PIndex == (PWord_t) NULL) - { JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); return(JERRI); } - -#ifdef JUDYL - if (PValue == (PWord_t) NULL) - { JU_SET_ERRNO(PJError, JU_ERRNO_NULLPVALUE); return(JERRI); } -#endif - - -// HANDLE LARGE COUNT (= POP1) (typical case): -// -// Allocate and initialize a JPM, set the root pointer to point to it, and then -// build the tree underneath it. - -// Common code for unusual error handling when no JPM available: - - if (Count > cJU_LEAFW_MAXPOP1) // too big for root-level leaf. - { - Pjpm_t Pjpm; // new, to allocate. - -// Allocate JPM: - - Pjpm = j__udyAllocJPM(); - JU_CHECKALLOC(Pjpm_t, Pjpm, JERRI); - *PPArray = (Pvoid_t) Pjpm; - -// Set some JPM fields: - - (Pjpm->jpm_Pop0) = Count - 1; - // note: (Pjpm->jpm_TotalMemWords) is now initialized. - -// Build Judy tree: -// -// In case of error save the final Count, possibly modified, unless modified to -// 0, in which case free the JPM itself: - - if (! j__udyInsArray(&(Pjpm->jpm_JP), cJU_ROOTSTATE, &Count, - (PWord_t) PIndex, -#ifdef JUDYL - (Pjv_t) PValue, -#endif - Pjpm)) - { - JU_COPY_ERRNO(PJError, Pjpm); - - if (Count) // partial success, adjust pop0: - { - (Pjpm->jpm_Pop0) = Count - 1; - } - else // total failure, free JPM: - { - j__udyFreeJPM(Pjpm, (Pjpm_t) NULL); - *PPArray = (Pvoid_t) NULL; - } - - DBGCODE(JudyCheckPop(*PPArray);) - return(JERRI); - } - - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - - } // large count - - -// HANDLE SMALL COUNT (= POP1): -// -// First ensure indexes are in sorted order: - - for (offset = 1; offset < Count; ++offset) - { - if (PIndex[offset - 1] >= PIndex[offset]) - { JU_SET_ERRNO(PJError, JU_ERRNO_UNSORTED); return(JERRI); } - } - - if (Count == 0) return(1); // *PPArray remains null. - - { - Pjlw = j__udyAllocJLW(Count + 1); - JU_CHECKALLOC(Pjlw_t, Pjlw, JERRI); - *PPArray = (Pvoid_t) Pjlw; - Pjlw[0] = Count - 1; // set pop0. - Pjlwindex = Pjlw + 1; - } - -// Copy whole-word indexes (and values) to the root-level leaf: - - JU_COPYMEM(Pjlwindex, PIndex, Count); -JUDYLCODE(JU_COPYMEM(JL_LEAFWVALUEAREA(Pjlw, Count), PValue, Count)); - - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - -} // Judy1SetArray() / JudyLInsArray() - - -// **************************************************************************** -// __ J U D Y I N S A R R A Y -// -// Given: -// -// - a pointer to a JP -// -// - the JPs level in the tree, that is, the number of digits left to decode -// in the indexes under the JP (one less than the level of the JPM or branch -// in which the JP resides); cJU_ROOTSTATE on first entry (when JP is the one -// in the JPM), down to 1 for a Leaf1, LeafB1, or FullPop -// -// - a pointer to the number of indexes (and corresponding values) to store in -// this subtree, to modify in case of partial success -// -// - a list of indexes (and for JudyL, corresponding values) to store in this -// subtree -// -// - a JPM for tracking memory usage and returning errors -// -// Recursively build a subtree (immediate indexes, leaf, or branch with -// subtrees) and modify the JP accordingly. On the way down, build a BranchU -// (only) for any expanse with *PPop1 too high for a leaf; on the way out, -// convert the BranchU to a BranchL or BranchB if appropriate. Keep memory -// statistics in the JPM. -// -// Return TRUE for success, or FALSE with error information set in the JPM in -// case of error, in which case leave a partially constructed but healthy tree, -// and modify parent population counts on the way out. -// -// Note: Each call of this function makes all modifications to the PjpParent -// it receives; neither the parent nor child calls do this. - -FUNCTION static bool_t j__udyInsArray( - Pjp_t PjpParent, // parent JP in/under which to store. - int Level, // initial digits remaining to decode. - PWord_t PPop1, // number of indexes to store. - PWord_t PIndex, // list of indexes to store. -#ifdef JUDYL - Pjv_t PValue, // list of corresponding values. -#endif - Pjpm_t Pjpm) // for memory and errors. -{ - Pjp_t Pjp; // lower-level JP. - Word_t Pjbany; // any type of branch. - int levelsub; // actual, of Pjps node, <= Level. - Word_t pop1 = *PPop1; // fast local value. - Word_t pop1sub; // population of one subexpanse. - uint8_t JPtype; // current JP type. - uint8_t JPtype_null; // precomputed value for new branch. - jp_t JPnull; // precomputed for speed. - Pjbu_t PjbuRaw; // constructed BranchU. - Pjbu_t Pjbu; - int digit; // in BranchU. - Word_t digitmask; // for a digit in a BranchU. - Word_t digitshifted; // shifted to correct offset. - Word_t digitshincr; // increment for digitshifted. - int offset; // in PIndex, or a bitmap subexpanse. - int numJPs; // number non-null in a BranchU. - bool_t retval; // to return from this func. -JUDYLCODE(Pjv_t PjvRaw); // destination value area. -JUDYLCODE(Pjv_t Pjv); - - -// MACROS FOR COMMON CODE: -// -// Note: These use function and local parameters from the context. -// Note: Assume newly allocated memory is zeroed. - -// Indicate whether a sorted list of indexes in PIndex, based on the first and -// last indexes in the list using pop1, are in the same subexpanse between -// Level and L_evel: -// -// This can be confusing! Note that SAMESUBEXP(L) == TRUE means the indexes -// are the same through level L + 1, and it says nothing about level L and -// lower; they might be the same or they might differ. -// -// Note: In principle SAMESUBEXP needs a mask for the digits from Level, -// inclusive, to L_evel, exclusive. But in practice, since the indexes are all -// known to be identical above Level, it just uses a mask for the digits -// through L_evel + 1; see subexp_mask[]. - -#define SAMESUBEXP(L_evel) \ - (! ((PIndex[0] ^ PIndex[pop1 - 1]) & subexp_mask[L_evel])) - -// Set PjpParent to a null JP appropriate for the level of the node to which it -// points, which is 1 less than the level of the node in which the JP resides, -// which is by definition Level: -// -// Note: This can set the JPMs JP to an invalid jp_Type, but it doesnt -// matter because the JPM is deleted by the caller. - -#define SETJPNULL_PARENT \ - JU_JPSETADT(PjpParent, 0, 0, cJU_JPNULL1 + Level - 1); - -// Variation to set a specified JP (in a branch being built) to a precomputed -// null JP: - -#define SETJPNULL(Pjp) *(Pjp) = JPnull - -// Handle complete (as opposed to partial) memory allocation failure: Set the -// parent JP to an appropriate null type (to leave a consistent tree), zero the -// callers population count, and return FALSE: -// -// Note: At Level == cJU_ROOTSTATE this sets the JPMs JPs jp_Type to a bogus -// value, but it doesnt matter because the JPM should be deleted by the -// caller. - -#define NOMEM { SETJPNULL_PARENT; *PPop1 = 0; return(FALSE); } - -// Allocate a Leaf1-N and save the address in Pjll; in case of failure, NOMEM: - -#define ALLOCLEAF(AllocLeaf) \ - if ((PjllRaw = AllocLeaf(pop1, Pjpm)) == (Pjll_t) NULL) NOMEM; \ - Pjll = P_JLL(PjllRaw); - -// Copy indexes smaller than words (and values which are whole words) from -// given arrays to immediate indexes or a leaf: -// -// TBD: These macros overlap with some of the code in JudyCascade.c; do some -// merging? That file has functions while these are macros. - -#define COPYTOLEAF_EVEN_SUB(Pjll,LeafType) \ - { \ - LeafType * P_leaf = (LeafType *) (Pjll); \ - Word_t p_op1 = pop1; \ - PWord_t P_Index = PIndex; \ - \ - assert(pop1 > 0); \ - \ - do { *P_leaf++ = *P_Index++; /* truncates */\ - } while (--(p_op1)); \ - } - -#define COPYTOLEAF_ODD_SUB(cLevel,Pjll,Copy) \ - { \ - uint8_t * P_leaf = (uint8_t *) (Pjll); \ - Word_t p_op1 = pop1; \ - PWord_t P_Index = PIndex; \ - \ - assert(pop1 > 0); \ - \ - do { \ - Copy(P_leaf, *P_Index); \ - P_leaf += (cLevel); ++P_Index; \ - } while (--(p_op1)); \ - } - -#ifdef JUDY1 - -#define COPYTOLEAF_EVEN(Pjll,LeafType) COPYTOLEAF_EVEN_SUB(Pjll,LeafType) -#define COPYTOLEAF_ODD(cLevel,Pjll,Copy) COPYTOLEAF_ODD_SUB(cLevel,Pjll,Copy) - -#else // JUDYL adds copying of values: - -#define COPYTOLEAF_EVEN(Pjll,LeafType) \ - { \ - COPYTOLEAF_EVEN_SUB(Pjll,LeafType) \ - JU_COPYMEM(Pjv, PValue, pop1); \ - } - -#define COPYTOLEAF_ODD(cLevel,Pjll,Copy) \ - { \ - COPYTOLEAF_ODD_SUB( cLevel,Pjll,Copy) \ - JU_COPYMEM(Pjv, PValue, pop1); \ - } - -#endif - -// Set the JP type for an immediate index, where BaseJPType is JPIMMED_*_02: - -#define SETIMMTYPE(BaseJPType) (PjpParent->jp_Type) = (BaseJPType) + pop1 - 2 - -// Allocate and populate a Leaf1-N: -// -// Build MAKELEAF_EVEN() and MAKELEAF_ODD() using macros for common code. - -#define MAKELEAF_SUB1(AllocLeaf,ValueArea,LeafType) \ - ALLOCLEAF(AllocLeaf); \ - JUDYLCODE(Pjv = ValueArea(Pjll, pop1)) - - -#define MAKELEAF_SUB2(cLevel,JPType) \ -{ \ - Word_t D_cdP0; \ - assert(pop1 - 1 <= cJU_POP0MASK(cLevel)); \ - D_cdP0 = (*PIndex & cJU_DCDMASK(cLevel)) | (pop1 - 1); \ - JU_JPSETADT(PjpParent, (Word_t)PjllRaw, D_cdP0, JPType); \ -} - - -#define MAKELEAF_EVEN(cLevel,JPType,AllocLeaf,ValueArea,LeafType) \ - MAKELEAF_SUB1(AllocLeaf,ValueArea,LeafType); \ - COPYTOLEAF_EVEN(Pjll, LeafType); \ - MAKELEAF_SUB2(cLevel, JPType) - -#define MAKELEAF_ODD(cLevel,JPType,AllocLeaf,ValueArea,Copy) \ - MAKELEAF_SUB1(AllocLeaf,ValueArea,LeafType); \ - COPYTOLEAF_ODD(cLevel, Pjll, Copy); \ - MAKELEAF_SUB2(cLevel, JPType) - -// Ensure that the indexes to be stored in immediate indexes or a leaf are -// sorted: -// -// This check is pure overhead, but required in order to protect the Judy array -// against caller error, to avoid a later corruption or core dump from a -// seemingly valid Judy array. Do this check piecemeal at the leaf level while -// the indexes are already in the cache. Higher-level order-checking occurs -// while building branches. -// -// Note: Any sorting error in the expanse of a single immediate indexes JP or -// a leaf => save no indexes in that expanse. - -#define CHECKLEAFORDER \ - { \ - for (offset = 1; offset < pop1; ++offset) \ - { \ - if (PIndex[offset - 1] >= PIndex[offset]) \ - { \ - SETJPNULL_PARENT; \ - *PPop1 = 0; \ - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_UNSORTED); \ - return(FALSE); \ - } \ - } \ - } - - -// ------ START OF CODE ------ - - assert( Level >= 1); - assert( Level <= cJU_ROOTSTATE); - assert((Level < cJU_ROOTSTATE) || (pop1 > cJU_LEAFW_MAXPOP1)); - - -// CHECK FOR TOP LEVEL: -// -// Special case: If at the top level (PjpParent is in the JPM), a top-level -// branch must be created, even if its a BranchL with just one JP. (The JPM -// cannot point to a leaf because the leaf would have to be a lower-level, -// higher-capacity leaf under a narrow pointer (otherwise a root-level leaf -// would suffice), and the JPMs JP cant handle a narrow pointer because the -// jp_DcdPopO field isnt big enough.) Otherwise continue to check for a pop1 -// small enough to support immediate indexes or a leaf before giving up and -// making a lower-level branch. - - if (Level == cJU_ROOTSTATE) - { - levelsub = cJU_ROOTSTATE; - goto BuildBranch2; - } - assert(Level < cJU_ROOTSTATE); - - -// SKIP JPIMMED_*_01: -// -// Immeds with pop1 == 1 should be handled in-line during branch construction. - - assert(pop1 > 1); - - -// BUILD JPIMMED_*_02+: -// -// The starting address of the indexes depends on Judy1 or JudyL; also, JudyL -// includes a pointer to a values-only leaf. - - if (pop1 <= immed_maxpop1[Level]) // note: always < root level. - { - JUDY1CODE(uint8_t * Pjll = (uint8_t *) (PjpParent->jp_1Index);) - JUDYLCODE(uint8_t * Pjll = (uint8_t *) (PjpParent->jp_LIndex);) - - CHECKLEAFORDER; // indexes to be stored are sorted. - -#ifdef JUDYL - if ((PjvRaw = j__udyLAllocJV(pop1, Pjpm)) == (Pjv_t) NULL) - NOMEM; - (PjpParent->jp_Addr) = (Word_t) PjvRaw; - Pjv = P_JV(PjvRaw); -#endif - - switch (Level) - { - case 1: COPYTOLEAF_EVEN(Pjll, uint8_t); - SETIMMTYPE(cJU_JPIMMED_1_02); - break; -#if (defined(JUDY1) || defined(JU_64BIT)) - case 2: COPYTOLEAF_EVEN(Pjll, uint16_t); - SETIMMTYPE(cJU_JPIMMED_2_02); - break; - case 3: COPYTOLEAF_ODD(3, Pjll, JU_COPY3_LONG_TO_PINDEX); - SETIMMTYPE(cJU_JPIMMED_3_02); - break; -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case 4: COPYTOLEAF_EVEN(Pjll, uint32_t); - SETIMMTYPE(cJ1_JPIMMED_4_02); - break; - case 5: COPYTOLEAF_ODD(5, Pjll, JU_COPY5_LONG_TO_PINDEX); - SETIMMTYPE(cJ1_JPIMMED_5_02); - break; - case 6: COPYTOLEAF_ODD(6, Pjll, JU_COPY6_LONG_TO_PINDEX); - SETIMMTYPE(cJ1_JPIMMED_6_02); - break; - case 7: COPYTOLEAF_ODD(7, Pjll, JU_COPY7_LONG_TO_PINDEX); - SETIMMTYPE(cJ1_JPIMMED_7_02); - break; -#endif - default: assert(FALSE); // should be impossible. - } - - return(TRUE); // note: no children => no *PPop1 mods. - - } // JPIMMED_*_02+ - - -// BUILD JPLEAF*: -// -// This code is a little tricky. The method is: For each level starting at -// the present Level down through levelsub = 1, and then as a special case for -// LeafB1 and FullPop (which are also at levelsub = 1 but have different -// capacity, see later), check if pop1 fits in a leaf (using leaf_maxpop1[]) -// at that level. If so, except for Level == levelsub, check if all of the -// current indexes to be stored are in the same (narrow) subexpanse, that is, -// the digits from Level to levelsub + 1, inclusive, are identical between the -// first and last index in the (sorted) list (in PIndex). If this condition is -// satisfied at any level, build a leaf at that level (under a narrow pointer -// if Level > levelsub). -// -// Note: Doing the search in this order results in storing the indexes in -// "least compressed form." - - for (levelsub = Level; levelsub >= 1; --levelsub) - { - Pjll_t PjllRaw; - Pjll_t Pjll; - -// Check if pop1 is too large to fit in a leaf at levelsub; if so, try the next -// lower level: - - if (pop1 > leaf_maxpop1[levelsub]) continue; - -// If pop1 fits in a leaf at levelsub, but levelsub is lower than Level, must -// also check whether all the indexes in the expanse to store can in fact be -// placed under a narrow pointer; if not, a leaf cannot be used, at this or any -// lower level (levelsub): - - if ((levelsub < Level) && (! SAMESUBEXP(levelsub))) - goto BuildBranch; // cant use a narrow, need a branch. - -// Ensure valid pop1 and all indexes are in fact common through Level: - - assert(pop1 <= cJU_POP0MASK(Level) + 1); - assert(! ((PIndex[0] ^ PIndex[pop1 - 1]) & cJU_DCDMASK(Level))); - - CHECKLEAFORDER; // indexes to be stored are sorted. - -// Build correct type of leaf: -// -// Note: The jp_DcdPopO and jp_Type assignments in MAKELEAF_* happen correctly -// for the levelsub (not Level) of the new leaf, even if its under a narrow -// pointer. - - switch (levelsub) - { -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case 1: MAKELEAF_EVEN(1, cJU_JPLEAF1, j__udyAllocJLL1, - JL_LEAF1VALUEAREA, uint8_t); - break; -#endif - case 2: MAKELEAF_EVEN(2, cJU_JPLEAF2, j__udyAllocJLL2, - JL_LEAF2VALUEAREA, uint16_t); - break; - case 3: MAKELEAF_ODD( 3, cJU_JPLEAF3, j__udyAllocJLL3, - JL_LEAF3VALUEAREA, JU_COPY3_LONG_TO_PINDEX); - break; -#ifdef JU_64BIT - case 4: MAKELEAF_EVEN(4, cJU_JPLEAF4, j__udyAllocJLL4, - JL_LEAF4VALUEAREA, uint32_t); - break; - case 5: MAKELEAF_ODD( 5, cJU_JPLEAF5, j__udyAllocJLL5, - JL_LEAF5VALUEAREA, JU_COPY5_LONG_TO_PINDEX); - break; - case 6: MAKELEAF_ODD( 6, cJU_JPLEAF6, j__udyAllocJLL6, - JL_LEAF6VALUEAREA, JU_COPY6_LONG_TO_PINDEX); - break; - case 7: MAKELEAF_ODD( 7, cJU_JPLEAF7, j__udyAllocJLL7, - JL_LEAF7VALUEAREA, JU_COPY7_LONG_TO_PINDEX); - break; -#endif - default: assert(FALSE); // should be impossible. - } - - return(TRUE); // note: no children => no *PPop1 mods. - - } // JPLEAF* - - -// BUILD JPLEAF_B1 OR JPFULLPOPU1: -// -// See above about JPLEAF*. If pop1 doesnt fit in any level of linear leaf, -// it might still fit in a LeafB1 or FullPop, perhaps under a narrow pointer. - - if ((Level == 1) || SAMESUBEXP(1)) // same until last digit. - { - Pjlb_t PjlbRaw; // for bitmap leaf. - Pjlb_t Pjlb; - - assert(pop1 <= cJU_JPFULLPOPU1_POP0 + 1); - CHECKLEAFORDER; // indexes to be stored are sorted. - -#ifdef JUDY1 - -// JPFULLPOPU1: - - if (pop1 == cJU_JPFULLPOPU1_POP0 + 1) - { - Word_t Addr = PjpParent->jp_Addr; - Word_t DcdP0 = (*PIndex & cJU_DCDMASK(1)) - | cJU_JPFULLPOPU1_POP0; - JU_JPSETADT(PjpParent, Addr, DcdP0, cJ1_JPFULLPOPU1); - - return(TRUE); - } -#endif - -// JPLEAF_B1: - - if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL) - NOMEM; - Pjlb = P_JLB(PjlbRaw); - - for (offset = 0; offset < pop1; ++offset) - JU_BITMAPSETL(Pjlb, PIndex[offset]); - - retval = TRUE; // default. - -#ifdef JUDYL - -// Build subexpanse values-only leaves (LeafVs) under LeafB1: - - for (offset = 0; offset < cJU_NUMSUBEXPL; ++offset) - { - if (! (pop1sub = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, offset)))) - continue; // skip empty subexpanse. - -// Allocate one LeafV = JP subarray; if out of memory, clear bitmaps for higher -// subexpanses and adjust *PPop1: - - if ((PjvRaw = j__udyLAllocJV(pop1sub, Pjpm)) - == (Pjv_t) NULL) - { - for (/* null */; offset < cJU_NUMSUBEXPL; ++offset) - { - *PPop1 -= j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, offset)); - JU_JLB_BITMAP(Pjlb, offset) = 0; - } - - retval = FALSE; - break; - } - -// Populate values-only leaf and save the pointer to it: - - Pjv = P_JV(PjvRaw); - JU_COPYMEM(Pjv, PValue, pop1sub); - JL_JLB_PVALUE(Pjlb, offset) = PjvRaw; // first-tier pointer. - PValue += pop1sub; - - } // for each subexpanse - -#endif // JUDYL - -// Attach new LeafB1 to parent JP; note use of *PPop1 possibly < pop1: - - JU_JPSETADT(PjpParent, (Word_t) PjlbRaw, - (*PIndex & cJU_DCDMASK(1)) | (*PPop1 - 1), cJU_JPLEAF_B1); - - return(retval); - - } // JPLEAF_B1 or JPFULLPOPU1 - - -// BUILD JPBRANCH_U*: -// -// Arriving at BuildBranch means Level < top level but the pop1 is too large -// for immediate indexes or a leaf, even under a narrow pointer, including a -// LeafB1 or FullPop at level 1. This implies SAMESUBEXP(1) == FALSE, that is, -// the indexes to be stored "branch" at level 2 or higher. - -BuildBranch: // come here directly if a leaf wont work. - - assert(Level >= 2); - assert(Level < cJU_ROOTSTATE); - assert(! SAMESUBEXP(1)); // sanity check, see above. - -// Determine the appropriate level for a new branch node; see if a narrow -// pointer can be used: -// -// This can be confusing. The branch is required at the lowest level L where -// the indexes to store are not in the same subexpanse at level L-1. Work down -// from Level to tree level 3, which is 1 above the lowest tree level = 2 at -// which a branch can be used. Theres no need to check SAMESUBEXP at level 2 -// because its known to be false at level 2-1 = 1. -// -// Note: Unlike for a leaf node, a narrow pointer is always used for a branch -// if possible, that is, maximum compression is always used, except at the top -// level of the tree, where a JPM cannot support a narrow pointer, meaning a -// top BranchL can have a single JP (fanout = 1); but that case jumps directly -// to BuildBranch2. -// -// Note: For 32-bit systems the only usable values for a narrow pointer are -// Level = 3 and levelsub = 2; 64-bit systems have many more choices; but -// hopefully this for-loop is fast enough even on a 32-bit system. -// -// TBD: If not fast enough, #ifdef JU_64BIT and handle the 32-bit case faster. - - for (levelsub = Level; levelsub >= 3; --levelsub) // see above. - if (! SAMESUBEXP(levelsub - 1)) // at limit of narrow pointer. - break; // put branch at levelsub. - -BuildBranch2: // come here directly for Level = levelsub = cJU_ROOTSTATE. - - assert(levelsub >= 2); - assert(levelsub <= Level); - -// Initially build a BranchU: -// -// Always start with a BranchU because the number of populated subexpanses is -// not yet known. Use digitmask, digitshifted, and digitshincr to avoid -// expensive variable shifts within JU_DIGITATSTATE within the loop. -// -// TBD: The use of digitmask, etc. results in more increment operations per -// loop, is there an even faster way? -// -// TBD: Would it pay to pre-count the populated JPs (subexpanses) and -// pre-compress the branch, that is, build a BranchL or BranchB immediately, -// also taking account of opportunistic uncompression rules? Probably not -// because at high levels of the tree there might be huge numbers of indexes -// (hence cache lines) to scan in the PIndex array to determine the fanout -// (number of JPs) needed. - - if ((PjbuRaw = j__udyAllocJBU(Pjpm)) == (Pjbu_t) NULL) NOMEM; - Pjbu = P_JBU(PjbuRaw); - - JPtype_null = cJU_JPNULL1 + levelsub - 2; // in new BranchU. - JU_JPSETADT(&JPnull, 0, 0, JPtype_null); - - Pjp = Pjbu->jbu_jp; // for convenience in loop. - numJPs = 0; // non-null in the BranchU. - digitmask = cJU_MASKATSTATE(levelsub); // see above. - digitshincr = 1UL << (cJU_BITSPERBYTE * (levelsub - 1)); - retval = TRUE; - -// Scan and populate JPs (subexpanses): -// -// Look for all indexes matching each digit in the BranchU (at the correct -// levelsub), and meanwhile notice any sorting error. Increment PIndex (and -// PValue) and reduce pop1 for each subexpanse handled successfully. - - for (digit = digitshifted = 0; - digit < cJU_BRANCHUNUMJPS; - ++digit, digitshifted += digitshincr, ++Pjp) - { - DBGCODE(Word_t pop1subprev;) - assert(pop1 != 0); // end of indexes is handled elsewhere. - -// Count indexes in digits subexpanse: - - for (pop1sub = 0; pop1sub < pop1; ++pop1sub) - if (digitshifted != (PIndex[pop1sub] & digitmask)) break; - -// Empty subexpanse (typical, performance path) or sorting error (rare): - - if (pop1sub == 0) - { - if (digitshifted < (PIndex[0] & digitmask)) - { SETJPNULL(Pjp); continue; } // empty subexpanse. - - assert(pop1 < *PPop1); // did save >= 1 index and decr pop1. - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_UNSORTED); - goto AbandonBranch; - } - -// Non-empty subexpanse: -// -// First shortcut by handling pop1sub == 1 (JPIMMED_*_01) inline locally. - - if (pop1sub == 1) // note: can be at root level. - { - Word_t Addr = 0; - JUDYLCODE(Addr = (Word_t) (*PValue++);) - JU_JPSETADT(Pjp, Addr, *PIndex, cJU_JPIMMED_1_01 + levelsub -2); - - ++numJPs; - - if (--pop1) { ++PIndex; continue; } // more indexes to store. - - ++digit; ++Pjp; // skip JP just saved. - goto ClearBranch; // save time. - } - -// Recurse to populate one digits (subexpanses) JP; if successful, skip -// indexes (and values) just stored (performance path), except when expanse is -// completely stored: - - DBGCODE(pop1subprev = pop1sub;) - - if (j__udyInsArray(Pjp, levelsub - 1, &pop1sub, (PWord_t) PIndex, -#ifdef JUDYL - (Pjv_t) PValue, -#endif - Pjpm)) - { // complete success. - ++numJPs; - assert(pop1subprev == pop1sub); - assert(pop1 >= pop1sub); - - if ((pop1 -= pop1sub) != 0) // more indexes to store: - { - PIndex += pop1sub; // skip indexes just stored. - JUDYLCODE(PValue += pop1sub;) - continue; - } - // else leave PIndex in BranchUs expanse. - -// No more indexes to store in BranchUs expanse: - - ++digit; ++Pjp; // skip JP just saved. - goto ClearBranch; // save time. - } - -// Handle any error at a lower level of recursion: -// -// In case of partial success, pop1sub != 0, but it was reduced from the value -// passed to j__udyInsArray(); skip this JP later during ClearBranch. - - assert(pop1subprev > pop1sub); // check j__udyInsArray(). - assert(pop1 > pop1sub); // check j__udyInsArray(). - - if (pop1sub) // partial success. - { ++digit; ++Pjp; ++numJPs; } // skip JP just saved. - - pop1 -= pop1sub; // deduct saved indexes if any. - -// Same-level sorting error, or any lower-level error; abandon the rest of the -// branch: -// -// Arrive here with pop1 = remaining unsaved indexes (always non-zero). Adjust -// the *PPop1 value to record and return, modify retval, and use ClearBranch to -// finish up. - -AbandonBranch: - assert(pop1 != 0); // more to store, see above. - assert(pop1 <= *PPop1); // sanity check. - - *PPop1 -= pop1; // deduct unsaved indexes. - pop1 = 0; // to avoid error later. - retval = FALSE; - -// Error (rare), or end of indexes while traversing new BranchU (performance -// path); either way, mark the remaining JPs, if any, in the BranchU as nulls -// and exit the loop: -// -// Arrive here with digit and Pjp set to the first JP to set to null. - -ClearBranch: - for (/* null */; digit < cJU_BRANCHUNUMJPS; ++digit, ++Pjp) - SETJPNULL(Pjp); - break; // saves one more compare. - - } // for each digit - - -// FINISH JPBRANCH_U*: -// -// Arrive here with a BranchU built under Pjbu, numJPs set, and either: retval -// == TRUE and *PPop1 unmodified, or else retval == FALSE, *PPop1 set to the -// actual number of indexes saved (possibly 0 for complete failure at a lower -// level upon the first call of j__udyInsArray()), and the Judy error set in -// Pjpm. Either way, PIndex points to an index within the expanse just -// handled. - - Pjbany = (Word_t) PjbuRaw; // default = use this BranchU. - JPtype = branchU_JPtype[levelsub]; - -// Check for complete failure above: - - assert((! retval) || *PPop1); // sanity check. - - if ((! retval) && (*PPop1 == 0)) // nothing stored, full failure. - { - j__udyFreeJBU(PjbuRaw, Pjpm); - SETJPNULL_PARENT; - return(FALSE); - } - -// Complete or partial success so far; watch for sorting error after the -// maximum digit (255) in the BranchU, which is indicated by having more -// indexes to store in the BranchUs expanse: -// -// For example, if an index to store has a digit of 255 at levelsub, followed -// by an index with a digit of 254, the for-loop above runs out of digits -// without reducing pop1 to 0. - - if (pop1 != 0) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_UNSORTED); - *PPop1 -= pop1; // deduct unsaved indexes. - retval = FALSE; - } - assert(*PPop1 != 0); // branch (still) cannot be empty. - - -// OPTIONALLY COMPRESS JPBRANCH_U*: -// -// See if the BranchU should be compressed to a BranchL or BranchB; if so, do -// that and free the BranchU; otherwise just use the existing BranchU. Follow -// the same rules as in JudyIns.c (version 4.95): Only check local population -// (cJU_OPP_UNCOMP_POP0) for BranchL, and only check global memory efficiency -// (JU_OPP_UNCOMPRESS) for BranchB. TBD: Have the rules changed? -// -// Note: Because of differing order of operations, the latter compression -// might not result in the same set of branch nodes as a series of sequential -// insertions. -// -// Note: Allocating a BranchU only to sometimes convert it to a BranchL or -// BranchB is unfortunate, but attempting to work with a temporary BranchU on -// the stack and then allocate and keep it as a BranchU in many cases is worse -// in terms of error handling. - - -// COMPRESS JPBRANCH_U* TO JPBRANCH_L*: - - if (numJPs <= cJU_BRANCHLMAXJPS) // JPs fit in a BranchL. - { - Pjbl_t PjblRaw = (Pjbl_t) NULL; // new BranchL; init for cc. - Pjbl_t Pjbl; - - if ((*PPop1 > JU_BRANCHL_MAX_POP) // pop too high. - || ((PjblRaw = j__udyAllocJBL(Pjpm)) == (Pjbl_t) NULL)) - { // cant alloc BranchL. - goto SetParent; // just keep BranchU. - } - - Pjbl = P_JBL(PjblRaw); - -// Copy BranchU JPs to BranchL: - - (Pjbl->jbl_NumJPs) = numJPs; - offset = 0; - - for (digit = 0; digit < cJU_BRANCHUNUMJPS; ++digit) - { - if ((((Pjbu->jbu_jp) + digit)->jp_Type) == JPtype_null) - continue; - - (Pjbl->jbl_Expanse[offset ]) = digit; - (Pjbl->jbl_jp [offset++]) = Pjbu->jbu_jp[digit]; - } - assert(offset == numJPs); // found same number. - -// Free the BranchU and prepare to use the new BranchL instead: - - j__udyFreeJBU(PjbuRaw, Pjpm); - - Pjbany = (Word_t) PjblRaw; - JPtype = branchL_JPtype[levelsub]; - - } // compress to BranchL - - -// COMPRESS JPBRANCH_U* TO JPBRANCH_B*: -// -// If unable to allocate the BranchB or any JP subarray, free all related -// memory and just keep the BranchU. -// -// Note: This use of JU_OPP_UNCOMPRESS is a bit conservative because the -// BranchU is already allocated while the (presumably smaller) BranchB is not, -// the opposite of how its used in single-insert code. - - else - { - Pjbb_t PjbbRaw = (Pjbb_t) NULL; // new BranchB; init for cc. - Pjbb_t Pjbb; - Pjp_t Pjp2; // in BranchU. - - if ((*PPop1 > JU_BRANCHB_MAX_POP) // pop too high. - || ((PjbbRaw = j__udyAllocJBB(Pjpm)) == (Pjbb_t) NULL)) - { // cant alloc BranchB. - goto SetParent; // just keep BranchU. - } - - Pjbb = P_JBB(PjbbRaw); - -// Set bits in bitmap for populated subexpanses: - - Pjp2 = Pjbu->jbu_jp; - - for (digit = 0; digit < cJU_BRANCHUNUMJPS; ++digit) - if ((((Pjbu->jbu_jp) + digit)->jp_Type) != JPtype_null) - JU_BITMAPSETB(Pjbb, digit); - -// Copy non-null JPs to BranchB JP subarrays: - - for (offset = 0; offset < cJU_NUMSUBEXPB; ++offset) - { - Pjp_t PjparrayRaw; - Pjp_t Pjparray; - - if (! (numJPs = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, offset)))) - continue; // skip empty subexpanse. - -// If unable to allocate a JP subarray, free all BranchB memory so far and -// continue to use the BranchU: - - if ((PjparrayRaw = j__udyAllocJBBJP(numJPs, Pjpm)) - == (Pjp_t) NULL) - { - while (offset-- > 0) - { - if (JU_JBB_PJP(Pjbb, offset) == (Pjp_t) NULL) continue; - - j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, offset), - j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, offset)), - Pjpm); - } - j__udyFreeJBB(PjbbRaw, Pjpm); - goto SetParent; // keep BranchU. - } - -// Set one JP subarray pointer and copy the subexpanses JPs to the subarray: -// -// Scan the BranchU for non-null JPs until numJPs JPs are copied. - - JU_JBB_PJP(Pjbb, offset) = PjparrayRaw; - Pjparray = P_JP(PjparrayRaw); - - while (numJPs-- > 0) - { - while ((Pjp2->jp_Type) == JPtype_null) - { - ++Pjp2; - assert(Pjp2 < (Pjbu->jbu_jp) + cJU_BRANCHUNUMJPS); - } - *Pjparray++ = *Pjp2++; - } - } // for each subexpanse - -// Free the BranchU and prepare to use the new BranchB instead: - - j__udyFreeJBU(PjbuRaw, Pjpm); - - Pjbany = (Word_t) PjbbRaw; - JPtype = branchB_JPtype[levelsub]; - - } // compress to BranchB - - -// COMPLETE OR PARTIAL SUCCESS: -// -// Attach new branch (under Pjp, with JPtype) to parent JP; note use of *PPop1, -// possibly reduced due to partial failure. - -SetParent: - (PjpParent->jp_Addr) = Pjbany; - (PjpParent->jp_Type) = JPtype; - - if (Level < cJU_ROOTSTATE) // PjpParent not in JPM: - { - Word_t DcdP0 = (*PIndex & cJU_DCDMASK(levelsub)) | (*PPop1 - 1); - - JU_JPSETADT(PjpParent ,Pjbany, DcdP0, JPtype); - } - - return(retval); - -} // j__udyInsArray() diff --git a/libjudy/src/Judy1/Judy1TablesGen.c b/libjudy/src/Judy1/Judy1TablesGen.c deleted file mode 100644 index 5b6009f0b7..0000000000 --- a/libjudy/src/Judy1/Judy1TablesGen.c +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.37 $ $Source: /judy/src/JudyCommon/JudyTables.c $ - -#ifndef JU_WIN -#include // unavailable on win_*. -#endif - -#include -#include - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#define TERMINATOR 999 // terminator for Alloc tables - -#define BPW sizeof(Word_t) // define bytes per word - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -FILE *fd; - -// Definitions come from header files Judy1.h and JudyL.h: - -int AllocSizes[] = ALLOCSIZES; - -#define ROUNDUP(BYTES,BPW,OFFSETW) \ - ((((BYTES) + (BPW) - 1) / (BPW)) + (OFFSETW)) - - -// **************************************************************************** -// G E N T A B L E -// -// Note: "const" is required for newer compilers. - -FUNCTION void GenTable( - const char * TableName, // name of table string - const char * TableSize, // dimentioned size string - int IndexBytes, // bytes per Index - int LeafSize, // number elements in object - int ValueBytes, // bytes per Value - int OffsetWords) // 1 for LEAFW -{ - int * PAllocSizes = AllocSizes; - int OWord; - int CurWord; - int IWord; - int ii; - int BytesOfIndex; - int BytesOfObject; - int Index; - int LastWords; - int Words [1000] = { 0 }; - int Offset[1000] = { 0 }; - int MaxWords; - - MaxWords = ROUNDUP((IndexBytes + ValueBytes) * LeafSize, BPW, OffsetWords); - Words[0] = 0; - Offset[0] = 0; - CurWord = TERMINATOR; - -// Walk through all number of Indexes in table: - - for (Index = 1; /* null */; ++Index) - { - -// Calculate byte required for next size: - - BytesOfIndex = IndexBytes * Index; - BytesOfObject = (IndexBytes + ValueBytes) * Index; - -// Round up and calculate words required for next size: - - OWord = ROUNDUP(BytesOfObject, BPW, OffsetWords); - IWord = ROUNDUP(BytesOfIndex, BPW, OffsetWords); - -// Root-level leaves of population of 1 and 2 do not have the 1 word offset: - -// Save minimum value of offset: - - Offset[Index] = IWord; - -// Round up to next available size of words: - - while (OWord > *PAllocSizes) PAllocSizes++; - - if (Index == LeafSize) - { - CurWord = Words[Index] = OWord; - break; - } -// end of available sizes ? - - if (*PAllocSizes == TERMINATOR) - { - fprintf(stderr, "BUG, in %sPopToWords, sizes not big enough for object\n", TableName); - exit(1); - } - -// Save words required and last word: - - if (*PAllocSizes < MaxWords) { CurWord = Words[Index] = *PAllocSizes; } - else { CurWord = Words[Index] = MaxWords; } - - } // for each index - - LastWords = TERMINATOR; - -// Round up to largest size in each group of malloc sizes: - - for (ii = LeafSize; ii > 0; ii--) - { - if (LastWords > (Words[ii] - ii)) LastWords = Offset[ii]; - else Offset[ii] = LastWords; - } - -// Print the PopToWords[] table: - - fprintf(fd,"\n//\tobject uses %d words\n", CurWord); - fprintf(fd,"//\t%s = %d\n", TableSize, LeafSize); - - fprintf(fd,"const uint8_t\n"); - fprintf(fd,"%sPopToWords[%s + 1] =\n", TableName, TableSize); - fprintf(fd,"{\n\t 0,"); - - for (ii = 1; ii <= LeafSize; ii++) - { - -// 8 columns per line, starting with 1: - - if ((ii % 8) == 1) fprintf(fd,"\n\t"); - - fprintf(fd,"%2d", Words[ii]); - -// If not last number place comma: - - if (ii != LeafSize) fprintf(fd,", "); - } - fprintf(fd,"\n};\n"); - -// Print the Offset table if needed: - - if (! ValueBytes) return; - - fprintf(fd,"const uint8_t\n"); - fprintf(fd,"%sOffset[%s + 1] =\n", TableName, TableSize); - fprintf(fd,"{\n"); - fprintf(fd,"\t 0,"); - - for (ii = 1; ii <= LeafSize; ii++) - { - if ((ii % 8) == 1) fprintf(fd,"\n\t"); - - fprintf(fd,"%2d", Offset[ii]); - - if (ii != LeafSize) fprintf(fd,", "); - } - fprintf(fd,"\n};\n"); - -} // GenTable() - - -// **************************************************************************** -// M A I N - -FUNCTION int main() -{ - int ii; - -#ifdef JUDY1 - char *fname = "Judy1Tables.c"; -#else - char *fname = "JudyLTables.c"; -#endif - - if ((fd = fopen(fname, "w")) == NULL){ - perror("FATAL ERROR: could not write to Judy[1L]Tables.c file\n"); - return (-1); - } - - - fprintf(fd,"// @(#) From generation tool: $Revision: 4.37 $ $Source: /judy/src/JudyCommon/JudyTables.c $\n"); - fprintf(fd,"//\n\n"); - - -// ================================ Judy1 ================================= -#ifdef JUDY1 - - fprintf(fd,"#include \"Judy1.h\"\n"); - - fprintf(fd,"// Leave the malloc() sizes readable in the binary (via " - "strings(1)):\n"); - fprintf(fd,"const char * Judy1MallocSizes = \"Judy1MallocSizes ="); - - for (ii = 0; AllocSizes[ii] != TERMINATOR; ii++) - fprintf(fd," %d,", AllocSizes[ii]); - -#ifndef JU_64BIT - fprintf(fd," Leaf1 = %d\";\n\n", cJ1_LEAF1_MAXPOP1); -#else - fprintf(fd,"\";\n\n"); // no Leaf1 in this case. -#endif - -// ================================ 32 bit ================================ -#ifndef JU_64BIT - - GenTable("j__1_BranchBJP","cJU_BITSPERSUBEXPB", 8, cJU_BITSPERSUBEXPB,0,0); - - GenTable("j__1_Leaf1", "cJ1_LEAF1_MAXPOP1", 1, cJ1_LEAF1_MAXPOP1, 0, 0); - GenTable("j__1_Leaf2", "cJ1_LEAF2_MAXPOP1", 2, cJ1_LEAF2_MAXPOP1, 0, 0); - GenTable("j__1_Leaf3", "cJ1_LEAF3_MAXPOP1", 3, cJ1_LEAF3_MAXPOP1, 0, 0); - GenTable("j__1_LeafW", "cJ1_LEAFW_MAXPOP1", 4, cJ1_LEAFW_MAXPOP1, 0, 1); - -#endif - -// ================================ 64 bit ================================ -#ifdef JU_64BIT - GenTable("j__1_BranchBJP","cJU_BITSPERSUBEXPB",16, cJU_BITSPERSUBEXPB,0,0); - - GenTable("j__1_Leaf2", "cJ1_LEAF2_MAXPOP1", 2, cJ1_LEAF2_MAXPOP1, 0, 0); - GenTable("j__1_Leaf3", "cJ1_LEAF3_MAXPOP1", 3, cJ1_LEAF3_MAXPOP1, 0, 0); - GenTable("j__1_Leaf4", "cJ1_LEAF4_MAXPOP1", 4, cJ1_LEAF4_MAXPOP1, 0, 0); - GenTable("j__1_Leaf5", "cJ1_LEAF5_MAXPOP1", 5, cJ1_LEAF5_MAXPOP1, 0, 0); - GenTable("j__1_Leaf6", "cJ1_LEAF6_MAXPOP1", 6, cJ1_LEAF6_MAXPOP1, 0, 0); - GenTable("j__1_Leaf7", "cJ1_LEAF7_MAXPOP1", 7, cJ1_LEAF7_MAXPOP1, 0, 0); - GenTable("j__1_LeafW", "cJ1_LEAFW_MAXPOP1", 8, cJ1_LEAFW_MAXPOP1, 0, 1); -#endif -#endif // JUDY1 - - -// ================================ JudyL ================================= -#ifdef JUDYL - - fprintf(fd,"#include \"JudyL.h\"\n"); - - fprintf(fd,"// Leave the malloc() sizes readable in the binary (via " - "strings(1)):\n"); - fprintf(fd,"const char * JudyLMallocSizes = \"JudyLMallocSizes ="); - - for (ii = 0; AllocSizes[ii] != TERMINATOR; ii++) - fprintf(fd," %d,", AllocSizes[ii]); - - fprintf(fd," Leaf1 = %ld\";\n\n", (Word_t)cJL_LEAF1_MAXPOP1); - -#ifndef JU_64BIT -// ================================ 32 bit ================================ - GenTable("j__L_BranchBJP","cJU_BITSPERSUBEXPB", 8, cJU_BITSPERSUBEXPB, 0,0); - - GenTable("j__L_Leaf1", "cJL_LEAF1_MAXPOP1", 1, cJL_LEAF1_MAXPOP1, BPW,0); - GenTable("j__L_Leaf2", "cJL_LEAF2_MAXPOP1", 2, cJL_LEAF2_MAXPOP1, BPW,0); - GenTable("j__L_Leaf3", "cJL_LEAF3_MAXPOP1", 3, cJL_LEAF3_MAXPOP1, BPW,0); - GenTable("j__L_LeafW", "cJL_LEAFW_MAXPOP1", 4, cJL_LEAFW_MAXPOP1, BPW,1); - GenTable("j__L_LeafV", "cJU_BITSPERSUBEXPL", 4, cJU_BITSPERSUBEXPL, 0,0); -#endif // 32 BIT - -#ifdef JU_64BIT -// ================================ 64 bit ================================ - GenTable("j__L_BranchBJP","cJU_BITSPERSUBEXPB",16, cJU_BITSPERSUBEXPB, 0,0); - - GenTable("j__L_Leaf1", "cJL_LEAF1_MAXPOP1", 1, cJL_LEAF1_MAXPOP1, BPW,0); - GenTable("j__L_Leaf2", "cJL_LEAF2_MAXPOP1", 2, cJL_LEAF2_MAXPOP1, BPW,0); - GenTable("j__L_Leaf3", "cJL_LEAF3_MAXPOP1", 3, cJL_LEAF3_MAXPOP1, BPW,0); - GenTable("j__L_Leaf4", "cJL_LEAF4_MAXPOP1", 4, cJL_LEAF4_MAXPOP1, BPW,0); - GenTable("j__L_Leaf5", "cJL_LEAF5_MAXPOP1", 5, cJL_LEAF5_MAXPOP1, BPW,0); - GenTable("j__L_Leaf6", "cJL_LEAF6_MAXPOP1", 6, cJL_LEAF6_MAXPOP1, BPW,0); - GenTable("j__L_Leaf7", "cJL_LEAF7_MAXPOP1", 7, cJL_LEAF7_MAXPOP1, BPW,0); - GenTable("j__L_LeafW", "cJL_LEAFW_MAXPOP1", 8, cJL_LEAFW_MAXPOP1, BPW,1); - GenTable("j__L_LeafV", "cJU_BITSPERSUBEXPL", 8, cJU_BITSPERSUBEXPL, 0,0); -#endif // 64 BIT - -#endif // JUDYL - fclose(fd); - - return(0); - -} // main() diff --git a/libjudy/src/Judy1/Judy1Test.c b/libjudy/src/Judy1/Judy1Test.c deleted file mode 100644 index 0bb9971cc8..0000000000 --- a/libjudy/src/Judy1/Judy1Test.c +++ /dev/null @@ -1,1094 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.43 $ $Source: /judy/src/JudyCommon/JudyGet.c $ -// -// Judy1Test() and JudyLGet() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -#ifdef TRACEJPR // different macro name, for "retrieval" only. -#include "JudyPrintJP.c" -#endif - - -// **************************************************************************** -// J U D Y 1 T E S T -// J U D Y L G E T -// -// See the manual entry for details. Note support for "shortcut" entries to -// trees known to start with a JPM. - -#ifdef JUDY1 - -#ifdef JUDYGETINLINE -FUNCTION int j__udy1Test -#else -FUNCTION int Judy1Test -#endif - -#else // JUDYL - -#ifdef JUDYGETINLINE -FUNCTION PPvoid_t j__udyLGet -#else -FUNCTION PPvoid_t JudyLGet -#endif - -#endif // JUDYL - ( -#ifdef JUDYGETINLINE - Pvoid_t PArray, // from which to retrieve. - Word_t Index // to retrieve. -#else - Pcvoid_t PArray, // from which to retrieve. - Word_t Index, // to retrieve. - PJError_t PJError // optional, for returning error info. -#endif - ) -{ - Pjp_t Pjp; // current JP while walking the tree. - Pjpm_t Pjpm; // for global accounting. - uint8_t Digit; // byte just decoded from Index. - Word_t Pop1; // leaf population (number of indexes). - Pjll_t Pjll; // pointer to LeafL. - DBGCODE(uint8_t ParentJPType;) - -#ifndef JUDYGETINLINE - - if (PArray == (Pcvoid_t) NULL) // empty array. - { - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - } - -// **************************************************************************** -// PROCESS TOP LEVEL BRANCHES AND LEAF: - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - int posidx; // signed offset in leaf. - - Pop1 = Pjlw[0] + 1; - posidx = j__udySearchLeafW(Pjlw + 1, Pop1, Index); - - if (posidx >= 0) - { - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAFWVALUEAREA(Pjlw, Pop1) + posidx));) - } - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - } - -#endif // ! JUDYGETINLINE - - Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); // top branch is below JPM. - -// **************************************************************************** -// WALK THE JUDY TREE USING A STATE MACHINE: - -ContinueWalk: // for going down one level; come here with Pjp set. - -#ifdef TRACEJPR - JudyPrintJP(Pjp, "g", __LINE__); -#endif - switch (JU_JPTYPE(Pjp)) - { - -// Ensure the switch table starts at 0 for speed; otherwise more code is -// executed: - - case 0: goto ReturnCorrupt; // save a little code. - - -// **************************************************************************** -// JPNULL*: -// -// Note: These are legitimate in a BranchU (only) and do not constitute a -// fault. - - case cJU_JPNULL1: - case cJU_JPNULL2: - case cJU_JPNULL3: -#ifdef JU_64BIT - case cJU_JPNULL4: - case cJU_JPNULL5: - case cJU_JPNULL6: - case cJU_JPNULL7: -#endif - assert(ParentJPType >= cJU_JPBRANCH_U2); - assert(ParentJPType <= cJU_JPBRANCH_U); - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - - -// **************************************************************************** -// JPBRANCH_L*: -// -// Note: The use of JU_DCDNOTMATCHINDEX() in branches is not strictly -// required,since this can be done at leaf level, but it costs nothing to do it -// sooner, and it aborts an unnecessary traversal sooner. - - case cJU_JPBRANCH_L2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - Digit = JU_DIGITATSTATE(Index, 2); - goto JudyBranchL; - - case cJU_JPBRANCH_L3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - Digit = JU_DIGITATSTATE(Index, 3); - goto JudyBranchL; - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - Digit = JU_DIGITATSTATE(Index, 4); - goto JudyBranchL; - - case cJU_JPBRANCH_L5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - Digit = JU_DIGITATSTATE(Index, 5); - goto JudyBranchL; - - case cJU_JPBRANCH_L6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - Digit = JU_DIGITATSTATE(Index, 6); - goto JudyBranchL; - - case cJU_JPBRANCH_L7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Digit = JU_DIGITATSTATE(Index, 7); - goto JudyBranchL; - -#endif // JU_64BIT - - case cJU_JPBRANCH_L: - { - Pjbl_t Pjbl; - int posidx; - - Digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - -// Common code for all BranchLs; come here with Digit set: - -JudyBranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - - posidx = 0; - - do { - if (Pjbl->jbl_Expanse[posidx] == Digit) - { // found Digit; continue traversal: - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = Pjbl->jbl_jp + posidx; - goto ContinueWalk; - } - } while (++posidx != Pjbl->jbl_NumJPs); - - break; - } - - -// **************************************************************************** -// JPBRANCH_B*: - - case cJU_JPBRANCH_B2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - Digit = JU_DIGITATSTATE(Index, 2); - goto JudyBranchB; - - case cJU_JPBRANCH_B3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - Digit = JU_DIGITATSTATE(Index, 3); - goto JudyBranchB; - - -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - Digit = JU_DIGITATSTATE(Index, 4); - goto JudyBranchB; - - case cJU_JPBRANCH_B5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - Digit = JU_DIGITATSTATE(Index, 5); - goto JudyBranchB; - - case cJU_JPBRANCH_B6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - Digit = JU_DIGITATSTATE(Index, 6); - goto JudyBranchB; - - case cJU_JPBRANCH_B7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Digit = JU_DIGITATSTATE(Index, 7); - goto JudyBranchB; - -#endif // JU_64BIT - - case cJU_JPBRANCH_B: - { - Pjbb_t Pjbb; - Word_t subexp; // in bitmap, 0..7. - BITMAPB_t BitMap; // for one subexpanse. - BITMAPB_t BitMask; // bit in BitMap for Indexs Digit. - - Digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - -// Common code for all BranchBs; come here with Digit set: - -JudyBranchB: - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjbb = P_JBB(Pjp->jp_Addr); - subexp = Digit / cJU_BITSPERSUBEXPB; - - BitMap = JU_JBB_BITMAP(Pjbb, subexp); - Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp)); - - BitMask = JU_BITPOSMASKB(Digit); - -// No JP in subexpanse for Index => Index not found: - - if (! (BitMap & BitMask)) break; - -// Count JPs in the subexpanse below the one for Index: - - Pjp += j__udyCountBitsB(BitMap & (BitMask - 1)); - - goto ContinueWalk; - - } // case cJU_JPBRANCH_B* - - -// **************************************************************************** -// JPBRANCH_U*: -// -// Notice the reverse order of the cases, and falling through to the next case, -// for performance. - - case cJU_JPBRANCH_U: - - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, cJU_ROOTSTATE); - -// If not a BranchU, traverse; otherwise fall into the next case, which makes -// this very fast code for a large Judy array (mainly BranchUs), especially -// when branches are already in the cache, such as for prev/next: - -#ifndef JU_64BIT - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U3) goto ContinueWalk; -#else - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U7) goto ContinueWalk; -#endif - -#ifdef JU_64BIT - case cJU_JPBRANCH_U7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 7); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U6) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 6); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U5) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 5); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U4) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 4); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U3) goto ContinueWalk; - // and fall through. - -#endif // JU_64BIT - - case cJU_JPBRANCH_U3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 3); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U2) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 2); - -// Note: BranchU2 is a special case that must continue traversal to a leaf, -// immed, full, or null type: - - goto ContinueWalk; - - -// **************************************************************************** -// JPLEAF*: -// -// Note: Here the calls of JU_DCDNOTMATCHINDEX() are necessary and check -// whether Index is out of the expanse of a narrow pointer. - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - - case cJU_JPLEAF1: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf1(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF1VALUEAREA(Pjll, Pop1) + posidx));) - } - -#endif // (JUDYL || (! JU_64BIT)) - - case cJU_JPLEAF2: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf2(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF2VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF3: - { - int posidx; // signed offset in leaf. - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf3(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF3VALUEAREA(Pjll, Pop1) + posidx));) - } -#ifdef JU_64BIT - case cJU_JPLEAF4: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf4(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF4VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF5: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf5(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF5VALUEAREA(Pjll, Pop1) + posidx));) - } - - case cJU_JPLEAF6: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf6(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF6VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF7: - { - int posidx; // signed offset in leaf. - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf7(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF7VALUEAREA(Pjll, Pop1) + posidx));) - } -#endif // JU_64BIT - - -// **************************************************************************** -// JPLEAF_B1: - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; -#ifdef JUDYL - int posidx; - Word_t subexp; // in bitmap, 0..7. - BITMAPL_t BitMap; // for one subexpanse. - BITMAPL_t BitMask; // bit in BitMap for Indexs Digit. - Pjv_t Pjv; -#endif - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - Pjlb = P_JLB(Pjp->jp_Addr); - -#ifdef JUDY1 - -// Simply check if Indexs bit is set in the bitmap: - - if (JU_BITMAPTESTL(Pjlb, Index)) return(1); - break; - -#else // JUDYL - -// JudyL is much more complicated because of value area subarrays: - - Digit = JU_DIGITATSTATE(Index, 1); - subexp = Digit / cJU_BITSPERSUBEXPL; - BitMap = JU_JLB_BITMAP(Pjlb, subexp); - BitMask = JU_BITPOSMASKL(Digit); - -// No value in subexpanse for Index => Index not found: - - if (! (BitMap & BitMask)) break; - -// Count value areas in the subexpanse below the one for Index: - - Pjv = P_JV(JL_JLB_PVALUE(Pjlb, subexp)); - assert(Pjv != (Pjv_t) NULL); - posidx = j__udyCountBitsL(BitMap & (BitMask - 1)); - - return((PPvoid_t) (Pjv + posidx)); - -#endif // JUDYL - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 - -// **************************************************************************** -// JPFULLPOPU1: -// -// If the Index is in the expanse, it is necessarily valid (found). - - case cJ1_JPFULLPOPU1: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - return(1); - -#ifdef notdef // for future enhancements -#ifdef JU_64BIT - -// Note: Need ? if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - case cJ1_JPFULLPOPU1m15: - if (Pjp->jp_1Index[14] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m14: - if (Pjp->jp_1Index[13] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m13: - if (Pjp->jp_1Index[12] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m12: - if (Pjp->jp_1Index[11] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m11: - if (Pjp->jp_1Index[10] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m10: - if (Pjp->jp_1Index[9] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m9: - if (Pjp->jp_1Index[8] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m8: - if (Pjp->jp_1Index[7] == (uint8_t)Index) break; -#endif - case cJ1_JPFULLPOPU1m7: - if (Pjp->jp_1Index[6] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m6: - if (Pjp->jp_1Index[5] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m5: - if (Pjp->jp_1Index[4] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m4: - if (Pjp->jp_1Index[3] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m3: - if (Pjp->jp_1Index[2] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m2: - if (Pjp->jp_1Index[1] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m1: - if (Pjp->jp_1Index[0] == (uint8_t)Index) break; - - return(1); // found, not in exclusion list - -#endif // JUDY1 -#endif // notdef - -// **************************************************************************** -// JPIMMED*: -// -// Note that the contents of jp_DcdPopO are different for cJU_JPIMMED_*_01: - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - if (JU_JPDCDPOP0(Pjp) != JU_TRIMTODCDSIZE(Index)) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) &(Pjp->jp_Addr));) // immediate value area. - - -// Macros to make code more readable and avoid dup errors - -#ifdef JUDY1 - -#define CHECKINDEXNATIVE(LEAF_T, PJP, IDX, INDEX) \ -if (((LEAF_T *)((PJP)->jp_1Index))[(IDX) - 1] == (LEAF_T)(INDEX)) \ - return(1) - -#define CHECKLEAFNONNAT(LFBTS, PJP, INDEX, IDX, COPY) \ -{ \ - Word_t i_ndex; \ - uint8_t *a_ddr; \ - a_ddr = (PJP)->jp_1Index + (((IDX) - 1) * (LFBTS)); \ - COPY(i_ndex, a_ddr); \ - if (i_ndex == JU_LEASTBYTES((INDEX), (LFBTS))) \ - return(1); \ -} -#endif - -#ifdef JUDYL - -#define CHECKINDEXNATIVE(LEAF_T, PJP, IDX, INDEX) \ -if (((LEAF_T *)((PJP)->jp_LIndex))[(IDX) - 1] == (LEAF_T)(INDEX)) \ - return((PPvoid_t)(P_JV((PJP)->jp_Addr) + (IDX) - 1)) - -#define CHECKLEAFNONNAT(LFBTS, PJP, INDEX, IDX, COPY) \ -{ \ - Word_t i_ndex; \ - uint8_t *a_ddr; \ - a_ddr = (PJP)->jp_LIndex + (((IDX) - 1) * (LFBTS)); \ - COPY(i_ndex, a_ddr); \ - if (i_ndex == JU_LEASTBYTES((INDEX), (LFBTS))) \ - return((PPvoid_t)(P_JV((PJP)->jp_Addr) + (IDX) - 1)); \ -} -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_15: CHECKINDEXNATIVE(uint8_t, Pjp, 15, Index); - case cJ1_JPIMMED_1_14: CHECKINDEXNATIVE(uint8_t, Pjp, 14, Index); - case cJ1_JPIMMED_1_13: CHECKINDEXNATIVE(uint8_t, Pjp, 13, Index); - case cJ1_JPIMMED_1_12: CHECKINDEXNATIVE(uint8_t, Pjp, 12, Index); - case cJ1_JPIMMED_1_11: CHECKINDEXNATIVE(uint8_t, Pjp, 11, Index); - case cJ1_JPIMMED_1_10: CHECKINDEXNATIVE(uint8_t, Pjp, 10, Index); - case cJ1_JPIMMED_1_09: CHECKINDEXNATIVE(uint8_t, Pjp, 9, Index); - case cJ1_JPIMMED_1_08: CHECKINDEXNATIVE(uint8_t, Pjp, 8, Index); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_07: CHECKINDEXNATIVE(uint8_t, Pjp, 7, Index); - case cJU_JPIMMED_1_06: CHECKINDEXNATIVE(uint8_t, Pjp, 6, Index); - case cJU_JPIMMED_1_05: CHECKINDEXNATIVE(uint8_t, Pjp, 5, Index); - case cJU_JPIMMED_1_04: CHECKINDEXNATIVE(uint8_t, Pjp, 4, Index); -#endif - case cJU_JPIMMED_1_03: CHECKINDEXNATIVE(uint8_t, Pjp, 3, Index); - case cJU_JPIMMED_1_02: CHECKINDEXNATIVE(uint8_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint8_t, Pjp, 1, Index); - break; - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_07: CHECKINDEXNATIVE(uint16_t, Pjp, 7, Index); - case cJ1_JPIMMED_2_06: CHECKINDEXNATIVE(uint16_t, Pjp, 6, Index); - case cJ1_JPIMMED_2_05: CHECKINDEXNATIVE(uint16_t, Pjp, 5, Index); - case cJ1_JPIMMED_2_04: CHECKINDEXNATIVE(uint16_t, Pjp, 4, Index); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_03: CHECKINDEXNATIVE(uint16_t, Pjp, 3, Index); - case cJU_JPIMMED_2_02: CHECKINDEXNATIVE(uint16_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint16_t, Pjp, 1, Index); - break; -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_05: - CHECKLEAFNONNAT(3, Pjp, Index, 5, JU_COPY3_PINDEX_TO_LONG); - case cJ1_JPIMMED_3_04: - CHECKLEAFNONNAT(3, Pjp, Index, 4, JU_COPY3_PINDEX_TO_LONG); - case cJ1_JPIMMED_3_03: - CHECKLEAFNONNAT(3, Pjp, Index, 3, JU_COPY3_PINDEX_TO_LONG); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: - CHECKLEAFNONNAT(3, Pjp, Index, 2, JU_COPY3_PINDEX_TO_LONG); - CHECKLEAFNONNAT(3, Pjp, Index, 1, JU_COPY3_PINDEX_TO_LONG); - break; -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - - case cJ1_JPIMMED_4_03: CHECKINDEXNATIVE(uint32_t, Pjp, 3, Index); - case cJ1_JPIMMED_4_02: CHECKINDEXNATIVE(uint32_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint32_t, Pjp, 1, Index); - break; - - case cJ1_JPIMMED_5_03: - CHECKLEAFNONNAT(5, Pjp, Index, 3, JU_COPY5_PINDEX_TO_LONG); - case cJ1_JPIMMED_5_02: - CHECKLEAFNONNAT(5, Pjp, Index, 2, JU_COPY5_PINDEX_TO_LONG); - CHECKLEAFNONNAT(5, Pjp, Index, 1, JU_COPY5_PINDEX_TO_LONG); - break; - - case cJ1_JPIMMED_6_02: - CHECKLEAFNONNAT(6, Pjp, Index, 2, JU_COPY6_PINDEX_TO_LONG); - CHECKLEAFNONNAT(6, Pjp, Index, 1, JU_COPY6_PINDEX_TO_LONG); - break; - - case cJ1_JPIMMED_7_02: - CHECKLEAFNONNAT(7, Pjp, Index, 2, JU_COPY7_PINDEX_TO_LONG); - CHECKLEAFNONNAT(7, Pjp, Index, 1, JU_COPY7_PINDEX_TO_LONG); - break; - -#endif // (JUDY1 && JU_64BIT) - - -// **************************************************************************** -// INVALID JP TYPE: - - default: - -ReturnCorrupt: - -#ifdef JUDYGETINLINE // Pjpm is known to be non-null: - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); -#else - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); -#endif - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // switch on JP type - -JUDY1CODE(return(0);) -JUDYLCODE(return((PPvoid_t) NULL);) - -} // Judy1Test() / JudyLGet() - - -#ifndef JUDYGETINLINE // only compile the following function once: -#ifdef DEBUG - -// **************************************************************************** -// J U D Y C H E C K P O P -// -// Given a pointer to a Judy array, traverse the entire array to ensure -// population counts add up correctly. This can catch various coding errors. -// -// Since walking the entire tree is probably time-consuming, enable this -// function by setting env parameter $CHECKPOP to first call at which to start -// checking. Note: This function is called both from insert and delete code. -// -// Note: Even though this function does nothing useful for LEAFW leaves, its -// good practice to call it anyway, and cheap too. -// -// TBD: This is a debug-only check function similar to JudyCheckSorted(), but -// since it walks the tree it is Judy1/JudyL-specific and must live in a source -// file that is built both ways. -// -// TBD: As feared, enabling this code for every insert/delete makes Judy -// deathly slow, even for a small tree (10K indexes). Its not so bad if -// present but disabled (<1% slowdown measured). Still, should it be ifdefd -// other than DEBUG and/or called less often? -// -// TBD: Should this "population checker" be expanded to a comprehensive tree -// checker? It currently detects invalid LEAFW/JP types as well as inconsistent -// pop1s. Other possible checks, all based on essentially redundant data in -// the Judy tree, include: -// -// - Zero LS bits in jp_Addr field. -// -// - Correct Dcd bits. -// -// - Consistent JP types (always descending down the tree). -// -// - Sorted linear lists in BranchLs and leaves (using JudyCheckSorted(), but -// ideally that function is already called wherever appropriate after any -// linear list is modified). -// -// - Any others possible? - -#include // for getenv() and atol(). - -static Word_t JudyCheckPopSM(Pjp_t Pjp, Word_t RootPop1); - -FUNCTION void JudyCheckPop( - Pvoid_t PArray) -{ -static bool_t checked = FALSE; // already checked env parameter. -static bool_t enabled = FALSE; // env parameter set. -static bool_t active = FALSE; // calls >= callsmin. -static Word_t callsmin; // start point from $CHECKPOP. -static Word_t calls = 0; // times called so far. - - -// CHECK FOR EXTERNAL ENABLING: - - if (! checked) // only check once. - { - char * value; // for getenv(). - - checked = TRUE; - - if ((value = getenv("CHECKPOP")) == (char *) NULL) - { -#ifdef notdef -// Take this out because nightly tests want to be flavor-independent; its not -// OK to emit special non-error output from the debug flavor: - - (void) puts("JudyCheckPop() present but not enabled by " - "$CHECKPOP env parameter; set it to the number of " - "calls at which to begin checking"); -#endif - return; - } - - callsmin = atol(value); // note: non-number evaluates to 0. - enabled = TRUE; - - (void) printf("JudyCheckPop() present and enabled; callsmin = " - "%lu\n", callsmin); - } - else if (! enabled) return; - -// Previously or just now enabled; check if non-active or newly active: - - if (! active) - { - if (++calls < callsmin) return; - - (void) printf("JudyCheckPop() activated at call %lu\n", calls); - active = TRUE; - } - -// IGNORE LEAFW AT TOP OF TREE: - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - return; - -// Check JPM pop0 against tree, recursively: -// -// Note: The traversal code in JudyCheckPopSM() is simplest when the case -// statement for each JP type compares the pop1 for that JP to its subtree (if -// any) after traversing the subtree (thats the hard part) and adding up -// actual pop1s. A top branchs JP in the JPM does not have room for a -// full-word pop1, so pass it in as a special case. - - { - Pjpm_t Pjpm = P_JPM(PArray); - (void) JudyCheckPopSM(&(Pjpm->jpm_JP), Pjpm->jpm_Pop0 + 1); - return; - } - -} // JudyCheckPop() - - -// **************************************************************************** -// J U D Y C H E C K P O P S M -// -// Recursive state machine (subroutine) for JudyCheckPop(): Given a Pjp (other -// than JPNULL*; caller should shortcut) and the root population for top-level -// branches, check the subtrees actual pop1 against its nominal value, and -// return the total pop1 for the subtree. -// -// Note: Expect RootPop1 to be ignored at lower levels, so pass down 0, which -// should pop an assertion if this expectation is violated. - -FUNCTION static Word_t JudyCheckPopSM( - Pjp_t Pjp, // top of subtree. - Word_t RootPop1) // whole array, for top-level branches only. -{ - Word_t pop1_jp; // nominal population from the JP. - Word_t pop1 = 0; // actual population at this level. - Word_t offset; // in a branch. - -#define PREPBRANCH(cPopBytes,Next) \ - pop1_jp = JU_JPBRANCH_POP0(Pjp, cPopBytes) + 1; goto Next - -assert((((Word_t) (Pjp->jp_Addr)) & 7) == 3); - switch (JU_JPTYPE(Pjp)) - { - - case cJU_JPBRANCH_L2: PREPBRANCH(2, BranchL); - case cJU_JPBRANCH_L3: PREPBRANCH(3, BranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: PREPBRANCH(4, BranchL); - case cJU_JPBRANCH_L5: PREPBRANCH(5, BranchL); - case cJU_JPBRANCH_L6: PREPBRANCH(6, BranchL); - case cJU_JPBRANCH_L7: PREPBRANCH(7, BranchL); -#endif - case cJU_JPBRANCH_L: pop1_jp = RootPop1; - { - Pjbl_t Pjbl; -BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - - for (offset = 0; offset < (Pjbl->jbl_NumJPs); ++offset) - pop1 += JudyCheckPopSM((Pjbl->jbl_jp) + offset, 0); - - assert(pop1_jp == pop1); - return(pop1); - } - - case cJU_JPBRANCH_B2: PREPBRANCH(2, BranchB); - case cJU_JPBRANCH_B3: PREPBRANCH(3, BranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: PREPBRANCH(4, BranchB); - case cJU_JPBRANCH_B5: PREPBRANCH(5, BranchB); - case cJU_JPBRANCH_B6: PREPBRANCH(6, BranchB); - case cJU_JPBRANCH_B7: PREPBRANCH(7, BranchB); -#endif - case cJU_JPBRANCH_B: pop1_jp = RootPop1; - { - Word_t subexp; - Word_t jpcount; - Pjbb_t Pjbb; -BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - - for (offset = 0; offset < jpcount; ++offset) - { - pop1 += JudyCheckPopSM(P_JP(JU_JBB_PJP(Pjbb, subexp)) - + offset, 0); - } - } - - assert(pop1_jp == pop1); - return(pop1); - } - - case cJU_JPBRANCH_U2: PREPBRANCH(2, BranchU); - case cJU_JPBRANCH_U3: PREPBRANCH(3, BranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: PREPBRANCH(4, BranchU); - case cJU_JPBRANCH_U5: PREPBRANCH(5, BranchU); - case cJU_JPBRANCH_U6: PREPBRANCH(6, BranchU); - case cJU_JPBRANCH_U7: PREPBRANCH(7, BranchU); -#endif - case cJU_JPBRANCH_U: pop1_jp = RootPop1; - { - Pjbu_t Pjbu; -BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - - for (offset = 0; offset < cJU_BRANCHUNUMJPS; ++offset) - { - if (((Pjbu->jbu_jp[offset].jp_Type) >= cJU_JPNULL1) - && ((Pjbu->jbu_jp[offset].jp_Type) <= cJU_JPNULLMAX)) - { - continue; // skip null JP to save time. - } - - pop1 += JudyCheckPopSM((Pjbu->jbu_jp) + offset, 0); - } - - assert(pop1_jp == pop1); - return(pop1); - } - - -// -- Cases below here terminate and do not recurse. -- -// -// For all of these cases except JPLEAF_B1, there is no way to check the JPs -// pop1 against the object itself; just return the pop1; but for linear leaves, -// a bounds check is possible. - -#define CHECKLEAF(MaxPop1) \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - assert(pop1 >= 1); \ - assert(pop1 <= (MaxPop1)); \ - return(pop1) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKLEAF(cJU_LEAF1_MAXPOP1); -#endif - case cJU_JPLEAF2: CHECKLEAF(cJU_LEAF2_MAXPOP1); - case cJU_JPLEAF3: CHECKLEAF(cJU_LEAF3_MAXPOP1); -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKLEAF(cJU_LEAF4_MAXPOP1); - case cJU_JPLEAF5: CHECKLEAF(cJU_LEAF5_MAXPOP1); - case cJU_JPLEAF6: CHECKLEAF(cJU_LEAF6_MAXPOP1); - case cJU_JPLEAF7: CHECKLEAF(cJU_LEAF7_MAXPOP1); -#endif - - case cJU_JPLEAF_B1: - { - Word_t subexp; - Pjlb_t Pjlb; - - pop1_jp = JU_JPLEAF_POP0(Pjp) + 1; - - Pjlb = P_JLB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - pop1 += j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - - assert(pop1_jp == pop1); - return(pop1); - } - - JUDY1CODE(case cJ1_JPFULLPOPU1: return(cJU_JPFULLPOPU1_POP0);) - - case cJU_JPIMMED_1_01: return(1); - case cJU_JPIMMED_2_01: return(1); - case cJU_JPIMMED_3_01: return(1); -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: return(1); - case cJU_JPIMMED_5_01: return(1); - case cJU_JPIMMED_6_01: return(1); - case cJU_JPIMMED_7_01: return(1); -#endif - - case cJU_JPIMMED_1_02: return(2); - case cJU_JPIMMED_1_03: return(3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: return(4); - case cJU_JPIMMED_1_05: return(5); - case cJU_JPIMMED_1_06: return(6); - case cJU_JPIMMED_1_07: return(7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: return(8); - case cJ1_JPIMMED_1_09: return(9); - case cJ1_JPIMMED_1_10: return(10); - case cJ1_JPIMMED_1_11: return(11); - case cJ1_JPIMMED_1_12: return(12); - case cJ1_JPIMMED_1_13: return(13); - case cJ1_JPIMMED_1_14: return(14); - case cJ1_JPIMMED_1_15: return(15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: return(2); - case cJU_JPIMMED_2_03: return(3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: return(4); - case cJ1_JPIMMED_2_05: return(5); - case cJ1_JPIMMED_2_06: return(6); - case cJ1_JPIMMED_2_07: return(7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: return(2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: return(3); - case cJ1_JPIMMED_3_04: return(4); - case cJ1_JPIMMED_3_05: return(5); - - case cJ1_JPIMMED_4_02: return(2); - case cJ1_JPIMMED_4_03: return(3); - case cJ1_JPIMMED_5_02: return(2); - case cJ1_JPIMMED_5_03: return(3); - case cJ1_JPIMMED_6_02: return(2); - case cJ1_JPIMMED_7_02: return(2); -#endif - - } // switch (JU_JPTYPE(Pjp)) - - assert(FALSE); // unrecognized JP type => corruption. - return(0); // to make some compilers happy. - -} // JudyCheckPopSM() - -#endif // DEBUG -#endif // ! JUDYGETINLINE diff --git a/libjudy/src/Judy1/Judy1Unset.c b/libjudy/src/Judy1/Judy1Unset.c deleted file mode 100644 index ced4b5fb30..0000000000 --- a/libjudy/src/Judy1/Judy1Unset.c +++ /dev/null @@ -1,2146 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.68 $ $Source: /judy/src/JudyCommon/JudyDel.c $ -// -// Judy1Unset() and JudyLDel() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// About HYSTERESIS: In the Judy code, hysteresis means leaving around a -// nominally suboptimal (not maximally compressed) data structure after a -// deletion. As a result, the shape of the tree for two identical index sets -// can differ depending on the insert/delete path taken to arrive at the index -// sets. The purpose is to minimize worst-case behavior (thrashing) that could -// result from a series of intermixed insertions and deletions. It also makes -// for MUCH simpler code, because instead of performing, "delete and then -// compress," it can say, "compress and then delete," where due to hysteresis, -// compression is not even attempted until the object IS compressible. -// -// In some cases the code has no choice and it must "ungrow" a data structure -// across a "phase transition" boundary without hysteresis. In other cases the -// amount (such as "hysteresis = 1") is indicated by the number of JP deletions -// (in branches) or index deletions (in leaves) that can occur in succession -// before compressing the data structure. (It appears that hysteresis <= 1 in -// all cases.) -// -// In general no hysteresis occurs when the data structure type remains the -// same but the allocated memory chunk for the node must shrink, because the -// relationship is hardwired and theres no way to know how much memory is -// allocated to a given data structure. Hysteresis = 0 in all these cases. -// -// TBD: Could this code be faster if memory chunk hysteresis were supported -// somehow along with data structure type hysteresis? -// -// TBD: Should some of the assertions here be converted to product code that -// returns JU_ERRNO_CORRUPT? -// -// TBD: Dougs code had an odd mix of function-wide and limited-scope -// variables. Should some of the function-wide variables appear only in -// limited scopes, or more likely, vice-versa? - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);) -DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);) - -#ifdef TRACEJP -#include "JudyPrintJP.c" -#endif - -// These are defined to generic values in JudyCommon/JudyPrivateTypes.h: -// -// TBD: These should be exported from a header file, but perhaps not, as they -// are only used here, and exported from JudyDecascade.c, which is a separate -// file for profiling reasons (to prevent inlining), but which potentially -// could be merged with this file, either in SoftCM or at compile-time: - -#ifdef JUDY1 - -extern int j__udy1BranchBToBranchL(Pjp_t Pjp, Pvoid_t Pjpm); -#ifndef JU_64BIT -extern int j__udy1LeafB1ToLeaf1(Pjp_t, Pvoid_t); -#endif -extern Word_t j__udy1Leaf1ToLeaf2(uint16_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf2ToLeaf3(uint8_t *, Pjp_t, Word_t, Pvoid_t); -#ifndef JU_64BIT -extern Word_t j__udy1Leaf3ToLeafW(Pjlw_t, Pjp_t, Word_t, Pvoid_t); -#else -extern Word_t j__udy1Leaf3ToLeaf4(uint32_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf4ToLeaf5(uint8_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf5ToLeaf6(uint8_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf6ToLeaf7(uint8_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf7ToLeafW(Pjlw_t, Pjp_t, Word_t, Pvoid_t); -#endif - -#else // JUDYL - -extern int j__udyLBranchBToBranchL(Pjp_t Pjp, Pvoid_t Pjpm); -extern int j__udyLLeafB1ToLeaf1(Pjp_t, Pvoid_t); -extern Word_t j__udyLLeaf1ToLeaf2(uint16_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf2ToLeaf3(uint8_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -#ifndef JU_64BIT -extern Word_t j__udyLLeaf3ToLeafW(Pjlw_t, Pjv_t, Pjp_t, Word_t, Pvoid_t); -#else -extern Word_t j__udyLLeaf3ToLeaf4(uint32_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf4ToLeaf5(uint8_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf5ToLeaf6(uint8_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf6ToLeaf7(uint8_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf7ToLeafW(Pjlw_t, Pjv_t, Pjp_t, Word_t, Pvoid_t); -#endif - -#endif // JUDYL - -// For convenience in the calling code; "M1" means "minus one": - -#ifndef JU_64BIT -#define j__udyLeafM1ToLeafW j__udyLeaf3ToLeafW -#else -#define j__udyLeafM1ToLeafW j__udyLeaf7ToLeafW -#endif - - -// **************************************************************************** -// __ J U D Y D E L W A L K -// -// Given a pointer to a JP, an Index known to be valid, the number of bytes -// left to decode (== level in the tree), and a pointer to a global JPM, walk a -// Judy (sub)tree to do an unset/delete of that index, and possibly modify the -// JPM. This function is only called internally, and recursively. Unlike -// Judy1Test() and JudyLGet(), the extra time required for recursion should be -// negligible compared with the total. -// -// Return values: -// -// -1 error; details in JPM -// -// 0 Index already deleted (should never happen, Index is known to be valid) -// -// 1 previously valid Index deleted -// -// 2 same as 1, but in addition the JP now points to a BranchL containing a -// single JP, which should be compressed into the parent branch (if there -// is one, which is not the case for a top-level branch under a JPM) - -DBGCODE(uint8_t parentJPtype;) // parent branch JP type. - -FUNCTION static int j__udyDelWalk( - Pjp_t Pjp, // current JP under which to delete. - Word_t Index, // to delete. - Word_t ParentLevel, // of parent branch. - Pjpm_t Pjpm) // for returning info to top level. -{ - Word_t pop1; // of a leaf. - Word_t level; // of a leaf. - uint8_t digit; // from Index, in current branch. - Pjll_t PjllnewRaw; // address of newly allocated leaf. - Pjll_t Pjllnew; - int offset; // within a branch. - int retcode; // return code: -1, 0, 1, 2. -JUDYLCODE(Pjv_t PjvRaw;) // value area. -JUDYLCODE(Pjv_t Pjv;) - - DBGCODE(level = 0;) - -ContinueDelWalk: // for modifying state without recursing. - -#ifdef TRACEJP - JudyPrintJP(Pjp, "d", __LINE__); -#endif - - switch (JU_JPTYPE(Pjp)) // entry: Pjp, Index. - { - - -// **************************************************************************** -// LINEAR BRANCH: -// -// MACROS FOR COMMON CODE: -// -// Check for population too high to compress a branch to a leaf, meaning just -// descend through the branch, with a purposeful off-by-one error that -// constitutes hysteresis = 1. In other words, do not compress until the -// branchs CURRENT population fits in the leaf, even BEFORE deleting one -// index. -// -// Next is a label for branch-type-specific common code. Variables pop1, -// level, digit, and Index are in the context. - -#define JU_BRANCH_KEEP(cLevel,MaxPop1,Next) \ - if (pop1 > (MaxPop1)) /* hysteresis = 1 */ \ - { \ - assert((cLevel) >= 2); \ - level = (cLevel); \ - digit = JU_DIGITATSTATE(Index, cLevel); \ - goto Next; \ - } - -// Support for generic calling of JudyLeaf*ToLeaf*() functions: -// -// Note: Cannot use JUDYLCODE() because this contains a comma. - -#ifdef JUDY1 -#define JU_PVALUEPASS // null. -#else -#define JU_PVALUEPASS Pjv, -#endif - -// During compression to a leaf, check if a JP contains nothing but a -// cJU_JPIMMED_*_01, in which case shortcut calling j__udyLeaf*ToLeaf*(): -// -// Copy the index bytes from the jp_DcdPopO field (with possible truncation), -// and continue the branch-JP-walk loop. Variables Pjp and Pleaf are in the -// context. - -#define JU_BRANCH_COPY_IMMED_EVEN(cLevel,Pjp,ignore) \ - if (JU_JPTYPE(Pjp) == cJU_JPIMMED_1_01 + (cLevel) - 2) \ - { \ - *Pleaf++ = JU_JPDCDPOP0(Pjp); \ - JUDYLCODE(*Pjv++ = (Pjp)->jp_Addr;) \ - continue; /* for-loop */ \ - } - -#define JU_BRANCH_COPY_IMMED_ODD(cLevel,Pjp,CopyIndex) \ - if (JU_JPTYPE(Pjp) == cJU_JPIMMED_1_01 + (cLevel) - 2) \ - { \ - CopyIndex(Pleaf, (Word_t) (JU_JPDCDPOP0(Pjp))); \ - Pleaf += (cLevel); /* index size = level */ \ - JUDYLCODE(*Pjv++ = (Pjp)->jp_Addr;) \ - continue; /* for-loop */ \ - } - -// Compress a BranchL into a leaf one index size larger: -// -// Allocate a new leaf, walk the JPs in the old BranchL and pack their contents -// into the new leaf (of type NewJPType), free the old BranchL, and finally -// restart the switch to delete Index from the new leaf. (Note that all -// BranchLs are the same size.) Variables Pjp, Pjpm, Pleaf, digit, and pop1 -// are in the context. - -#define JU_BRANCHL_COMPRESS(cLevel,LeafType,MaxPop1,NewJPType, \ - LeafToLeaf,Alloc,ValueArea, \ - CopyImmed,CopyIndex) \ - { \ - LeafType Pleaf; \ - Pjbl_t PjblRaw; \ - Pjbl_t Pjbl; \ - Word_t numJPs; \ - \ - if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - Pleaf = (LeafType) Pjllnew; \ - JUDYLCODE(Pjv = ValueArea(Pleaf, MaxPop1);) \ - \ - PjblRaw = (Pjbl_t) (Pjp->jp_Addr); \ - Pjbl = P_JBL(PjblRaw); \ - numJPs = Pjbl->jbl_NumJPs; \ - \ - for (offset = 0; offset < numJPs; ++offset) \ - { \ - CopyImmed(cLevel, (Pjbl->jbl_jp) + offset, CopyIndex); \ - \ - pop1 = LeafToLeaf(Pleaf, JU_PVALUEPASS \ - (Pjbl->jbl_jp) + offset, \ - JU_DIGITTOSTATE(Pjbl->jbl_Expanse[offset], \ - cLevel), (Pvoid_t) Pjpm); \ - Pleaf = (LeafType) (((Word_t) Pleaf) + ((cLevel) * pop1)); \ - JUDYLCODE(Pjv += pop1;) \ - } \ - assert(((((Word_t) Pleaf) - ((Word_t) Pjllnew)) / (cLevel)) == (MaxPop1)); \ - JUDYLCODE(assert((Pjv - ValueArea(Pjllnew, MaxPop1)) == (MaxPop1));) \ - DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cLevel);) \ - \ - j__udyFreeJBL(PjblRaw, Pjpm); \ - \ - Pjp->jp_Type = (NewJPType); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - goto ContinueDelWalk; /* delete from new leaf */ \ - } - -// Overall common code for initial BranchL deletion handling: -// -// Assert that Index is in the branch, then see if the BranchL should be kept -// or else compressed to a leaf. Variables Index, Pjp, and pop1 are in the -// context. - -#define JU_BRANCHL(cLevel,MaxPop1,LeafType,NewJPType, \ - LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex) \ - \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel)); \ - assert(ParentLevel > (cLevel)); \ - \ - pop1 = JU_JPBRANCH_POP0(Pjp, cLevel) + 1; \ - JU_BRANCH_KEEP(cLevel, MaxPop1, BranchLKeep); \ - assert(pop1 == (MaxPop1)); \ - \ - JU_BRANCHL_COMPRESS(cLevel, LeafType, MaxPop1, NewJPType, \ - LeafToLeaf, Alloc, ValueArea, CopyImmed, CopyIndex) - - -// END OF MACROS, START OF CASES: - - case cJU_JPBRANCH_L2: - - JU_BRANCHL(2, cJU_LEAF2_MAXPOP1, uint16_t *, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_L3: - - JU_BRANCHL(3, cJU_LEAF3_MAXPOP1, uint8_t *, cJU_JPLEAF3, - j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY3_LONG_TO_PINDEX); - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - - JU_BRANCHL(4, cJU_LEAF4_MAXPOP1, uint32_t *, cJU_JPLEAF4, - j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_L5: - - JU_BRANCHL(5, cJU_LEAF5_MAXPOP1, uint8_t *, cJU_JPLEAF5, - j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY5_LONG_TO_PINDEX); - - case cJU_JPBRANCH_L6: - - JU_BRANCHL(6, cJU_LEAF6_MAXPOP1, uint8_t *, cJU_JPLEAF6, - j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY6_LONG_TO_PINDEX); - - case cJU_JPBRANCH_L7: - - JU_BRANCHL(7, cJU_LEAF7_MAXPOP1, uint8_t *, cJU_JPLEAF7, - j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY7_LONG_TO_PINDEX); -#endif // JU_64BIT - -// A top-level BranchL is different and cannot use JU_BRANCHL(): Dont try to -// compress to a (LEAFW) leaf yet, but leave this for a later deletion -// (hysteresis > 0); and the next JP type depends on the system word size; so -// dont use JU_BRANCH_KEEP(): - - case cJU_JPBRANCH_L: - { - Pjbl_t Pjbl; - Word_t numJPs; - - level = cJU_ROOTSTATE; - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - - // fall through: - - -// COMMON CODE FOR KEEPING AND DESCENDING THROUGH A BRANCHL: -// -// Come here with level and digit set. - -BranchLKeep: - Pjbl = P_JBL(Pjp->jp_Addr); - numJPs = Pjbl->jbl_NumJPs; - assert(numJPs > 0); - DBGCODE(parentJPtype = JU_JPTYPE(Pjp);) - -// Search for a match to the digit (valid Index => must find digit): - - for (offset = 0; (Pjbl->jbl_Expanse[offset]) != digit; ++offset) - assert(offset < numJPs - 1); - - Pjp = (Pjbl->jbl_jp) + offset; - -// If not at a (deletable) JPIMMED_*_01, continue the walk (to descend through -// the BranchL): - - assert(level >= 2); - if ((JU_JPTYPE(Pjp)) != cJU_JPIMMED_1_01 + level - 2) break; - -// At JPIMMED_*_01: Ensure the index is in the right expanse, then delete the -// Immed from the BranchL: -// -// Note: A BranchL has a fixed size and format regardless of numJPs. - - assert(JU_JPDCDPOP0(Pjp) == JU_TRIMTODCDSIZE(Index)); - - JU_DELETEINPLACE(Pjbl->jbl_Expanse, numJPs, offset, ignore); - JU_DELETEINPLACE(Pjbl->jbl_jp, numJPs, offset, ignore); - - DBGCODE(JudyCheckSorted((Pjll_t) (Pjbl->jbl_Expanse), - numJPs - 1, 1);) - -// If only one index left in the BranchL, indicate this to the caller: - - return ((--(Pjbl->jbl_NumJPs) <= 1) ? 2 : 1); - - } // case cJU_JPBRANCH_L. - - -// **************************************************************************** -// BITMAP BRANCH: -// -// MACROS FOR COMMON CODE: -// -// Note the reuse of common macros here, defined earlier: JU_BRANCH_KEEP(), -// JU_PVALUE*. -// -// Compress a BranchB into a leaf one index size larger: -// -// Allocate a new leaf, walk the JPs in the old BranchB (one bitmap subexpanse -// at a time) and pack their contents into the new leaf (of type NewJPType), -// free the old BranchB, and finally restart the switch to delete Index from -// the new leaf. Variables Pjp, Pjpm, Pleaf, digit, and pop1 are in the -// context. -// -// Note: Its no accident that the interface to JU_BRANCHB_COMPRESS() is -// identical to JU_BRANCHL_COMPRESS(). Only the details differ in how to -// traverse the branchs JPs. - -#define JU_BRANCHB_COMPRESS(cLevel,LeafType,MaxPop1,NewJPType, \ - LeafToLeaf,Alloc,ValueArea, \ - CopyImmed,CopyIndex) \ - { \ - LeafType Pleaf; \ - Pjbb_t PjbbRaw; /* BranchB to compress */ \ - Pjbb_t Pjbb; \ - Word_t subexp; /* current subexpanse number */ \ - BITMAPB_t bitmap; /* portion for this subexpanse */ \ - Pjp_t Pjp2Raw; /* one subexpanses subarray */ \ - Pjp_t Pjp2; \ - \ - if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - Pleaf = (LeafType) Pjllnew; \ - JUDYLCODE(Pjv = ValueArea(Pleaf, MaxPop1);) \ - \ - PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); \ - Pjbb = P_JBB(PjbbRaw); \ - \ - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) \ - { \ - if ((bitmap = JU_JBB_BITMAP(Pjbb, subexp)) == 0) \ - continue; /* empty subexpanse */ \ - \ - digit = subexp * cJU_BITSPERSUBEXPB; \ - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); \ - Pjp2 = P_JP(Pjp2Raw); \ - assert(Pjp2 != (Pjp_t) NULL); \ - \ - for (offset = 0; bitmap != 0; bitmap >>= 1, ++digit) \ - { \ - if (! (bitmap & 1)) \ - continue; /* empty sub-subexpanse */ \ - \ - ++offset; /* before any continue */ \ - \ - CopyImmed(cLevel, Pjp2 + offset - 1, CopyIndex); \ - \ - pop1 = LeafToLeaf(Pleaf, JU_PVALUEPASS \ - Pjp2 + offset - 1, \ - JU_DIGITTOSTATE(digit, cLevel), \ - (Pvoid_t) Pjpm); \ - Pleaf = (LeafType) (((Word_t) Pleaf) + ((cLevel) * pop1)); \ - JUDYLCODE(Pjv += pop1;) \ - } \ - j__udyFreeJBBJP(Pjp2Raw, /* pop1 = */ offset, Pjpm); \ - } \ - assert(((((Word_t) Pleaf) - ((Word_t) Pjllnew)) / (cLevel)) == (MaxPop1)); \ - JUDYLCODE(assert((Pjv - ValueArea(Pjllnew, MaxPop1)) == (MaxPop1));) \ - DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cLevel);) \ - \ - j__udyFreeJBB(PjbbRaw, Pjpm); \ - \ - Pjp->jp_Type = (NewJPType); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - goto ContinueDelWalk; /* delete from new leaf */ \ - } - -// Overall common code for initial BranchB deletion handling: -// -// Assert that Index is in the branch, then see if the BranchB should be kept -// or else compressed to a leaf. Variables Index, Pjp, and pop1 are in the -// context. - -#define JU_BRANCHB(cLevel,MaxPop1,LeafType,NewJPType, \ - LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex) \ - \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel)); \ - assert(ParentLevel > (cLevel)); \ - \ - pop1 = JU_JPBRANCH_POP0(Pjp, cLevel) + 1; \ - JU_BRANCH_KEEP(cLevel, MaxPop1, BranchBKeep); \ - assert(pop1 == (MaxPop1)); \ - \ - JU_BRANCHB_COMPRESS(cLevel, LeafType, MaxPop1, NewJPType, \ - LeafToLeaf, Alloc, ValueArea, CopyImmed, CopyIndex) - - -// END OF MACROS, START OF CASES: -// -// Note: Its no accident that the macro calls for these cases is nearly -// identical to the code for BranchLs. - - case cJU_JPBRANCH_B2: - - JU_BRANCHB(2, cJU_LEAF2_MAXPOP1, uint16_t *, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_B3: - - JU_BRANCHB(3, cJU_LEAF3_MAXPOP1, uint8_t *, cJU_JPLEAF3, - j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY3_LONG_TO_PINDEX); - -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - - JU_BRANCHB(4, cJU_LEAF4_MAXPOP1, uint32_t *, cJU_JPLEAF4, - j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_B5: - - JU_BRANCHB(5, cJU_LEAF5_MAXPOP1, uint8_t *, cJU_JPLEAF5, - j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY5_LONG_TO_PINDEX); - - case cJU_JPBRANCH_B6: - - JU_BRANCHB(6, cJU_LEAF6_MAXPOP1, uint8_t *, cJU_JPLEAF6, - j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY6_LONG_TO_PINDEX); - - case cJU_JPBRANCH_B7: - - JU_BRANCHB(7, cJU_LEAF7_MAXPOP1, uint8_t *, cJU_JPLEAF7, - j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY7_LONG_TO_PINDEX); -#endif // JU_64BIT - -// A top-level BranchB is different and cannot use JU_BRANCHB(): Dont try to -// compress to a (LEAFW) leaf yet, but leave this for a later deletion -// (hysteresis > 0); and the next JP type depends on the system word size; so -// dont use JU_BRANCH_KEEP(): - - case cJU_JPBRANCH_B: - { - Pjbb_t Pjbb; // BranchB to modify. - Word_t subexp; // current subexpanse number. - Word_t subexp2; // in second-level loop. - BITMAPB_t bitmap; // portion for this subexpanse. - BITMAPB_t bitmask; // with digits bit set. - Pjp_t Pjp2Raw; // one subexpanses subarray. - Pjp_t Pjp2; - Word_t numJPs; // in one subexpanse. - - level = cJU_ROOTSTATE; - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - - // fall through: - - -// COMMON CODE FOR KEEPING AND DESCENDING THROUGH A BRANCHB: -// -// Come here with level and digit set. - -BranchBKeep: - Pjbb = P_JBB(Pjp->jp_Addr); - subexp = digit / cJU_BITSPERSUBEXPB; - bitmap = JU_JBB_BITMAP(Pjbb, subexp); - bitmask = JU_BITPOSMASKB(digit); - assert(bitmap & bitmask); // Index valid => digits bit is set. - DBGCODE(parentJPtype = JU_JPTYPE(Pjp);) - -// Compute digits offset into the bitmap, with a fast method if all bits are -// set: - - offset = ((bitmap == (cJU_FULLBITMAPB)) ? - digit % cJU_BITSPERSUBEXPB : - j__udyCountBitsB(bitmap & JU_MASKLOWEREXC(bitmask))); - - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); - Pjp2 = P_JP(Pjp2Raw); - assert(Pjp2 != (Pjp_t) NULL); // valid subexpanse pointer. - -// If not at a (deletable) JPIMMED_*_01, continue the walk (to descend through -// the BranchB): - - if (JU_JPTYPE(Pjp2 + offset) != cJU_JPIMMED_1_01 + level - 2) - { - Pjp = Pjp2 + offset; - break; - } - -// At JPIMMED_*_01: Ensure the index is in the right expanse, then delete the -// Immed from the BranchB: - - assert(JU_JPDCDPOP0(Pjp2 + offset) - == JU_TRIMTODCDSIZE(Index)); - -// If only one index is left in the subexpanse, free the JP array: - - if ((numJPs = j__udyCountBitsB(bitmap)) == 1) - { - j__udyFreeJBBJP(Pjp2Raw, /* pop1 = */ 1, Pjpm); - JU_JBB_PJP(Pjbb, subexp) = (Pjp_t) NULL; - } - -// Shrink JP array in-place: - - else if (JU_BRANCHBJPGROWINPLACE(numJPs - 1)) - { - assert(numJPs > 0); - JU_DELETEINPLACE(Pjp2, numJPs, offset, ignore); - } - -// JP array would end up too large; compress it to a smaller one: - - else - { - Pjp_t PjpnewRaw; - Pjp_t Pjpnew; - - if ((PjpnewRaw = j__udyAllocJBBJP(numJPs - 1, Pjpm)) - == (Pjp_t) NULL) return(-1); - Pjpnew = P_JP(PjpnewRaw); - - JU_DELETECOPY(Pjpnew, Pjp2, numJPs, offset, ignore); - j__udyFreeJBBJP(Pjp2Raw, numJPs, Pjpm); // old. - - JU_JBB_PJP(Pjbb, subexp) = PjpnewRaw; - } - -// Clear digits bit in the bitmap: - - JU_JBB_BITMAP(Pjbb, subexp) ^= bitmask; - -// If the current subexpanse alone is still too large for a BranchL (with -// hysteresis = 1), the delete is all done: - - if (numJPs > cJU_BRANCHLMAXJPS) return(1); - -// Consider shrinking the current BranchB to a BranchL: -// -// Check the numbers of JPs in other subexpanses in the BranchL. Upon reaching -// the critical number of numJPs (which could be right at the start; again, -// with hysteresis = 1), its faster to just watch for any non-empty subexpanse -// than to count bits in each subexpanse. Upon finding too many JPs, give up -// on shrinking the BranchB. - - for (subexp2 = 0; subexp2 < cJU_NUMSUBEXPB; ++subexp2) - { - if (subexp2 == subexp) continue; // skip current subexpanse. - - if ((numJPs == cJU_BRANCHLMAXJPS) ? - JU_JBB_BITMAP(Pjbb, subexp2) : - ((numJPs += j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp2))) - > cJU_BRANCHLMAXJPS)) - { - return(1); // too many JPs, cannot shrink. - } - } - -// Shrink current BranchB to a BranchL: -// -// Note: In this rare case, ignore the return value, do not pass it to the -// caller, because the deletion is already successfully completed and the -// caller(s) must decrement population counts. The only errors expected from -// this call are JU_ERRNO_NOMEM and JU_ERRNO_OVERRUN, neither of which is worth -// forwarding from this point. See also 4.1, 4.8, and 4.15 of this file. - - (void) j__udyBranchBToBranchL(Pjp, Pjpm); - return(1); - - } // case. - - -// **************************************************************************** -// UNCOMPRESSED BRANCH: -// -// MACROS FOR COMMON CODE: -// -// Note the reuse of common macros here, defined earlier: JU_PVALUE*. -// -// Compress a BranchU into a leaf one index size larger: -// -// Allocate a new leaf, walk the JPs in the old BranchU and pack their contents -// into the new leaf (of type NewJPType), free the old BranchU, and finally -// restart the switch to delete Index from the new leaf. Variables Pjp, Pjpm, -// digit, and pop1 are in the context. -// -// Note: Its no accident that the interface to JU_BRANCHU_COMPRESS() is -// nearly identical to JU_BRANCHL_COMPRESS(); just NullJPType is added. The -// details differ in how to traverse the branchs JPs -- -// -// -- and also, what to do upon encountering a cJU_JPIMMED_*_01 JP. In -// BranchLs and BranchBs the JP must be deleted, but in a BranchU its merely -// converted to a null JP, and this is done by other switch cases, so the "keep -// branch" situation is simpler here and JU_BRANCH_KEEP() is not used. Also, -// theres no code to convert a BranchU to a BranchB since counting the JPs in -// a BranchU is (at least presently) expensive, and besides, keeping around a -// BranchU is form of hysteresis. - -#define JU_BRANCHU_COMPRESS(cLevel,LeafType,MaxPop1,NullJPType,NewJPType, \ - LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex) \ - { \ - LeafType Pleaf; \ - Pjbu_t PjbuRaw = (Pjbu_t) (Pjp->jp_Addr); \ - Pjp_t Pjp2 = JU_JBU_PJP0(Pjp); \ - Word_t ldigit; /* larger than uint8_t */ \ - \ - if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - Pleaf = (LeafType) Pjllnew; \ - JUDYLCODE(Pjv = ValueArea(Pleaf, MaxPop1);) \ - \ - for (ldigit = 0; ldigit < cJU_BRANCHUNUMJPS; ++ldigit, ++Pjp2) \ - { \ - /* fast-process common types: */ \ - if (JU_JPTYPE(Pjp2) == (NullJPType)) continue; \ - CopyImmed(cLevel, Pjp2, CopyIndex); \ - \ - pop1 = LeafToLeaf(Pleaf, JU_PVALUEPASS Pjp2, \ - JU_DIGITTOSTATE(ldigit, cLevel), \ - (Pvoid_t) Pjpm); \ - Pleaf = (LeafType) (((Word_t) Pleaf) + ((cLevel) * pop1)); \ - JUDYLCODE(Pjv += pop1;) \ - } \ - assert(((((Word_t) Pleaf) - ((Word_t) Pjllnew)) / (cLevel)) == (MaxPop1)); \ - JUDYLCODE(assert((Pjv - ValueArea(Pjllnew, MaxPop1)) == (MaxPop1));) \ - DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cLevel);) \ - \ - j__udyFreeJBU(PjbuRaw, Pjpm); \ - \ - Pjp->jp_Type = (NewJPType); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - goto ContinueDelWalk; /* delete from new leaf */ \ - } - -// Overall common code for initial BranchU deletion handling: -// -// Assert that Index is in the branch, then see if a BranchU should be kept or -// else compressed to a leaf. Variables level, Index, Pjp, and pop1 are in the -// context. -// -// Note: BranchU handling differs from BranchL and BranchB as described above. - -#define JU_BRANCHU(cLevel,MaxPop1,LeafType,NullJPType,NewJPType, \ - LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex) \ - \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel)); \ - assert(ParentLevel > (cLevel)); \ - DBGCODE(parentJPtype = JU_JPTYPE(Pjp);) \ - \ - pop1 = JU_JPBRANCH_POP0(Pjp, cLevel) + 1; \ - \ - if (pop1 > (MaxPop1)) /* hysteresis = 1 */ \ - { \ - level = (cLevel); \ - Pjp = P_JP(Pjp->jp_Addr) + JU_DIGITATSTATE(Index, cLevel);\ - break; /* descend to next level */ \ - } \ - assert(pop1 == (MaxPop1)); \ - \ - JU_BRANCHU_COMPRESS(cLevel, LeafType, MaxPop1, NullJPType, NewJPType, \ - LeafToLeaf, Alloc, ValueArea, CopyImmed, CopyIndex) - - -// END OF MACROS, START OF CASES: -// -// Note: Its no accident that the macro calls for these cases is nearly -// identical to the code for BranchLs, with the addition of cJU_JPNULL* -// parameters only needed for BranchUs. - - case cJU_JPBRANCH_U2: - - JU_BRANCHU(2, cJU_LEAF2_MAXPOP1, uint16_t *, - cJU_JPNULL1, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_U3: - - JU_BRANCHU(3, cJU_LEAF3_MAXPOP1, uint8_t *, - cJU_JPNULL2, cJU_JPLEAF3, - j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY3_LONG_TO_PINDEX); - -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: - - JU_BRANCHU(4, cJU_LEAF4_MAXPOP1, uint32_t *, - cJU_JPNULL3, cJU_JPLEAF4, - j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_U5: - - JU_BRANCHU(5, cJU_LEAF5_MAXPOP1, uint8_t *, - cJU_JPNULL4, cJU_JPLEAF5, - j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY5_LONG_TO_PINDEX); - - case cJU_JPBRANCH_U6: - - JU_BRANCHU(6, cJU_LEAF6_MAXPOP1, uint8_t *, - cJU_JPNULL5, cJU_JPLEAF6, - j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY6_LONG_TO_PINDEX); - - case cJU_JPBRANCH_U7: - - JU_BRANCHU(7, cJU_LEAF7_MAXPOP1, uint8_t *, - cJU_JPNULL6, cJU_JPLEAF7, - j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY7_LONG_TO_PINDEX); -#endif // JU_64BIT - -// A top-level BranchU is different and cannot use JU_BRANCHU(): Dont try to -// compress to a (LEAFW) leaf yet, but leave this for a later deletion -// (hysteresis > 0); just descend through the BranchU: - - case cJU_JPBRANCH_U: - - DBGCODE(parentJPtype = JU_JPTYPE(Pjp);) - - level = cJU_ROOTSTATE; - Pjp = P_JP(Pjp->jp_Addr) + JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - break; - - -// **************************************************************************** -// LINEAR LEAF: -// -// State transitions while deleting an Index, the inverse of the similar table -// that appears in JudyIns.c: -// -// Note: In JudyIns.c this table is not needed and does not appear until the -// Immed handling code; because once a Leaf is reached upon growing the tree, -// the situation remains simpler, but for deleting indexes, the complexity -// arises when leaves must compress to Immeds. -// -// Note: There are other transitions possible too, not shown here, such as to -// a leaf one level higher. -// -// (Yes, this is very terse... Study it and it will make sense.) -// (Note, parts of this diagram are repeated below for quick reference.) -// -// reformat JP here for Judy1 only, from word-1 to word-2 -// | -// JUDY1 && JU_64BIT JUDY1 || JU_64BIT | -// V -// (*) Leaf1 [[ => 1_15..08 ] => 1_07 => ... => 1_04 ] => 1_03 => 1_02 => 1_01 -// Leaf2 [[ => 2_07..04 ] => 2_03 => 2_02 ] => 2_01 -// Leaf3 [[ => 3_05..03 ] => 3_02 ] => 3_01 -// JU_64BIT only: -// Leaf4 [[ => 4_03..02 ]] => 4_01 -// Leaf5 [[ => 5_03..02 ]] => 5_01 -// Leaf6 [[ => 6_02 ]] => 6_01 -// Leaf7 [[ => 7_02 ]] => 7_01 -// -// (*) For Judy1 & 64-bit, go directly from a LeafB1 to cJU_JPIMMED_1_15; skip -// Leaf1, as described in Judy1.h regarding cJ1_JPLEAF1. -// -// MACROS FOR COMMON CODE: -// -// (De)compress a LeafX into a LeafY one index size (cIS) larger (X+1 = Y): -// -// This is only possible when the current leaf is under a narrow pointer -// ((ParentLevel - 1) > cIS) and its population fits in a higher-level leaf. -// Variables ParentLevel, pop1, PjllnewRaw, Pjllnew, Pjpm, and Index are in the -// context. -// -// Note: Doing an "uplevel" doesnt occur until the old leaf can be compressed -// up one level BEFORE deleting an index; that is, hysteresis = 1. -// -// Note: LeafType, MaxPop1, NewJPType, and Alloc refer to the up-level leaf, -// not the current leaf. -// -// Note: 010327: Fixed bug where the jp_DcdPopO next-uplevel digit (byte) -// above the current Pop0 value was not being cleared. When upleveling, one -// digit in jp_DcdPopO "moves" from being part of the Dcd subfield to the Pop0 -// subfield, but since a leaf maxpop1 is known to be <= 1 byte in size, the new -// Pop0 byte should always be zero. This is easy to overlook because -// JU_JPLEAF_POP0() "knows" to only use the LSB of Pop0 (for efficiency) and -// ignore the other bytes... Until someone uses cJU_POP0MASK() instead of -// JU_JPLEAF_POP0(), such as in JudyInsertBranch.c. -// -// TBD: Should JudyInsertBranch.c use JU_JPLEAF_POP0() rather than -// cJU_POP0MASK(), for efficiency? Does it know for sure its a narrow pointer -// under the leaf? Not necessarily. - -#define JU_LEAF_UPLEVEL(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) \ - \ - assert(((ParentLevel - 1) == (cIS)) || (pop1 >= (MaxPop1))); \ - \ - if (((ParentLevel - 1) > (cIS)) /* under narrow pointer */ \ - && (pop1 == (MaxPop1))) /* hysteresis = 1 */ \ - { \ - Word_t D_cdP0; \ - if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - JUDYLCODE(Pjv = ValueArea((LeafType) Pjllnew, MaxPop1);) \ - \ - (void) LeafToLeaf((LeafType) Pjllnew, JU_PVALUEPASS Pjp, \ - Index & cJU_DCDMASK(cIS), /* TBD, Doug says */ \ - (Pvoid_t) Pjpm); \ - DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cIS + 1);) \ - \ - D_cdP0 = (~cJU_MASKATSTATE((cIS) + 1)) & JU_JPDCDPOP0(Pjp); \ - JU_JPSETADT(Pjp, (Word_t)PjllnewRaw, D_cdP0, NewJPType); \ - goto ContinueDelWalk; /* delete from new leaf */ \ - } - - -// For Leaf3, only support JU_LEAF_UPLEVEL on a 64-bit system, and for Leaf7, -// there is no JU_LEAF_UPLEVEL: -// -// Note: Theres no way here to go from Leaf3 [Leaf7] to LEAFW on a 32-bit -// [64-bit] system. Thats handled in the main code, because its different in -// that a JPM is involved. - -#ifndef JU_64BIT // 32-bit. -#define JU_LEAF_UPLEVEL64(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) // null. -#else -#define JU_LEAF_UPLEVEL64(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) \ - JU_LEAF_UPLEVEL (cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) -#define JU_LEAF_UPLEVEL_NONE(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) // null. -#endif - -// Compress a Leaf* with pop1 = 2, or a JPIMMED_*_02, into a JPIMMED_*_01: -// -// Copy whichever Index is NOT being deleted (and assert that the other one is -// found; Index must be valid). This requires special handling of the Index -// bytes (and value area). Variables Pjp, Index, offset, and Pleaf are in the -// context, offset is modified to the undeleted Index, and Pjp is modified -// including jp_Addr. - - -#define JU_TOIMMED_01_EVEN(cIS,ignore1,ignore2) \ -{ \ - Word_t D_cdP0; \ - Word_t A_ddr = 0; \ - uint8_t T_ype = JU_JPTYPE(Pjp); \ - offset = (Pleaf[0] == JU_LEASTBYTES(Index, cIS)); /* undeleted Ind */ \ - assert(Pleaf[offset ? 0 : 1] == JU_LEASTBYTES(Index, cIS)); \ - D_cdP0 = (Index & cJU_DCDMASK(cIS)) | Pleaf[offset]; \ -JUDYLCODE(A_ddr = Pjv[offset];) \ - JU_JPSETADT(Pjp, A_ddr, D_cdP0, T_ype); \ -} - -#define JU_TOIMMED_01_ODD(cIS,SearchLeaf,CopyPIndex) \ - { \ - Word_t D_cdP0; \ - Word_t A_ddr = 0; \ - uint8_t T_ype = JU_JPTYPE(Pjp); \ - \ - offset = SearchLeaf(Pleaf, 2, Index); \ - assert(offset >= 0); /* Index must be valid */ \ - CopyPIndex(D_cdP0, & (Pleaf[offset ? 0 : cIS])); \ - D_cdP0 |= Index & cJU_DCDMASK(cIS); \ - JUDYLCODE(A_ddr = Pjv[offset ? 0 : 1];) \ - JU_JPSETADT(Pjp, A_ddr, D_cdP0, T_ype); \ - } - - -// Compress a Leaf* into a JPIMMED_*_0[2+]: -// -// This occurs as soon as its possible, with hysteresis = 0. Variables pop1, -// Pleaf, offset, and Pjpm are in the context. -// -// TBD: Explain why hysteresis = 0 here, rather than > 0. Probably because -// the insert code assumes if the population is small enough, an Immed is used, -// not a leaf. -// -// The differences between Judy1 and JudyL with respect to value area handling -// are just too large for completely common code between them... Oh well, some -// big ifdefs follow. - -#ifdef JUDY1 - -#define JU_LEAF_TOIMMED(cIS,LeafType,MaxPop1,BaseJPType,ignore1,\ - ignore2,ignore3,ignore4, \ - DeleteCopy,FreeLeaf) \ - \ - assert(pop1 > (MaxPop1)); \ - \ - if ((pop1 - 1) == (MaxPop1)) /* hysteresis = 0 */ \ - { \ - Pjll_t PjllRaw = (Pjll_t) (Pjp->jp_Addr); \ - DeleteCopy((LeafType) (Pjp->jp_1Index), Pleaf, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted((Pjll_t) (Pjp->jp_1Index), pop1-1, cIS);) \ - Pjp->jp_Type = (BaseJPType) - 1 + (MaxPop1) - 1; \ - FreeLeaf(PjllRaw, pop1, Pjpm); \ - return(1); \ - } - -#else // JUDYL - -// Pjv is also in the context. - -#define JU_LEAF_TOIMMED(cIS,LeafType,MaxPop1,BaseJPType,ignore1,\ - ignore2,ignore3,ignore4, \ - DeleteCopy,FreeLeaf) \ - \ - assert(pop1 > (MaxPop1)); \ - \ - if ((pop1 - 1) == (MaxPop1)) /* hysteresis = 0 */ \ - { \ - Pjll_t PjllRaw = (Pjll_t) (Pjp->jp_Addr); \ - Pjv_t PjvnewRaw; \ - Pjv_t Pjvnew; \ - \ - if ((PjvnewRaw = j__udyLAllocJV(pop1 - 1, Pjpm)) \ - == (Pjv_t) NULL) return(-1); \ - JUDYLCODE(Pjvnew = P_JV(PjvnewRaw);) \ - \ - DeleteCopy((LeafType) (Pjp->jp_LIndex), Pleaf, pop1, offset, cIS); \ - JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted((Pjll_t) (Pjp->jp_LIndex), pop1-1, cIS);) \ - FreeLeaf(PjllRaw, pop1, Pjpm); \ - Pjp->jp_Addr = (Word_t) PjvnewRaw; \ - Pjp->jp_Type = (BaseJPType) - 2 + (MaxPop1); \ - return(1); \ - } - -// A complicating factor for JudyL & 32-bit is that Leaf2..3, and for JudyL & -// 64-bit Leaf 4..7, go directly to an Immed*_01, where the value is stored in -// jp_Addr and not in a separate LeafV. For efficiency, use the following -// macro in cases where it can apply; it is rigged to do the right thing. -// Unfortunately, this requires the calling code to "know" the transition table -// and call the right macro. -// -// This variant compresses a Leaf* with pop1 = 2 into a JPIMMED_*_01: - -#define JU_LEAF_TOIMMED_01(cIS,LeafType,MaxPop1,ignore,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - \ - assert(pop1 > (MaxPop1)); \ - \ - if ((pop1 - 1) == (MaxPop1)) /* hysteresis = 0 */ \ - { \ - Pjll_t PjllRaw = (Pjll_t) (Pjp->jp_Addr); \ - ToImmed(cIS, SearchLeaf, CopyPIndex); \ - FreeLeaf(PjllRaw, pop1, Pjpm); \ - Pjp->jp_Type = (Immed01JPType); \ - return(1); \ - } -#endif // JUDYL - -// See comments above about these: -// -// Note: Here "23" means index size 2 or 3, and "47" means 4..7. - -#if (defined(JUDY1) || defined(JU_64BIT)) -#define JU_LEAF_TOIMMED_23(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - JU_LEAF_TOIMMED( cIS,LeafType,MaxPop1,BaseJPType,ignore1, \ - ignore2,ignore3,ignore4, \ - DeleteCopy,FreeLeaf) -#else // JUDYL && 32-bit -#define JU_LEAF_TOIMMED_23(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - JU_LEAF_TOIMMED_01(cIS,LeafType,MaxPop1,ignore,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) -#endif - -#ifdef JU_64BIT -#ifdef JUDY1 -#define JU_LEAF_TOIMMED_47(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - JU_LEAF_TOIMMED( cIS,LeafType,MaxPop1,BaseJPType,ignore1, \ - ignore2,ignore3,ignore4, \ - DeleteCopy,FreeLeaf) -#else // JUDYL && 64-bit -#define JU_LEAF_TOIMMED_47(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - JU_LEAF_TOIMMED_01(cIS,LeafType,MaxPop1,ignore,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) -#endif // JUDYL -#endif // JU_64BIT - -// Compress a Leaf* in place: -// -// Here hysteresis = 0 (no memory is wasted). Variables pop1, Pleaf, and -// offset, and for JudyL, Pjv, are in the context. - -#ifdef JUDY1 -#define JU_LEAF_INPLACE(cIS,GrowInPlace,DeleteInPlace) \ - if (GrowInPlace(pop1 - 1)) /* hysteresis = 0 */ \ - { \ - DeleteInPlace(Pleaf, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) \ - return(1); \ - } -#else -#define JU_LEAF_INPLACE(cIS,GrowInPlace,DeleteInPlace) \ - if (GrowInPlace(pop1 - 1)) /* hysteresis = 0 */ \ - { \ - DeleteInPlace(Pleaf, pop1, offset, cIS); \ -/**/ JU_DELETEINPLACE(Pjv, pop1, offset, ignore); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) \ - return(1); \ - } -#endif - -// Compress a Leaf* into a smaller memory object of the same JP type: -// -// Variables PjllnewRaw, Pjllnew, Pleafpop1, Pjpm, PleafRaw, Pleaf, and offset -// are in the context. - -#ifdef JUDY1 - -#define JU_LEAF_SHRINK(cIS,LeafType,DeleteCopy,Alloc,FreeLeaf,ValueArea) \ - if ((PjllnewRaw = Alloc(pop1 - 1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - DeleteCopy((LeafType) Pjllnew, Pleaf, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted(Pjllnew, pop1 - 1, cIS);) \ - FreeLeaf(PleafRaw, pop1, Pjpm); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - return(1) - -#else // JUDYL - -#define JU_LEAF_SHRINK(cIS,LeafType,DeleteCopy,Alloc,FreeLeaf,ValueArea) \ - { \ -/**/ Pjv_t Pjvnew; \ - \ - if ((PjllnewRaw = Alloc(pop1 - 1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ -/**/ Pjvnew = ValueArea(Pjllnew, pop1 - 1); \ - DeleteCopy((LeafType) Pjllnew, Pleaf, pop1, offset, cIS); \ -/**/ JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted(Pjllnew, pop1 - 1, cIS);) \ - FreeLeaf(PleafRaw, pop1, Pjpm); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - return(1); \ - } -#endif // JUDYL - -// Overall common code for Leaf* deletion handling: -// -// See if the leaf can be: -// - (de)compressed to one a level higher (JU_LEAF_UPLEVEL()), or if not, -// - compressed to an Immediate JP (JU_LEAF_TOIMMED()), or if not, -// - shrunk in place (JU_LEAF_INPLACE()), or if none of those, then -// - shrink the leaf to a smaller chunk of memory (JU_LEAF_SHRINK()). -// -// Variables Pjp, pop1, Index, and offset are in the context. -// The *Up parameters refer to a leaf one level up, if there is any. - -#define JU_LEAF(cIS, \ - UpLevel, \ - LeafTypeUp,MaxPop1Up,LeafJPTypeUp,LeafToLeaf, \ - AllocUp,ValueAreaUp, \ - LeafToImmed,ToImmed,CopyPIndex, \ - LeafType,ImmedMaxPop1,ImmedBaseJPType,Immed01JPType, \ - SearchLeaf,GrowInPlace,DeleteInPlace,DeleteCopy, \ - Alloc,FreeLeaf,ValueArea) \ - { \ - Pjll_t PleafRaw; \ - LeafType Pleaf; \ - \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cIS)); \ - assert(ParentLevel > (cIS)); \ - \ - PleafRaw = (Pjll_t) (Pjp->jp_Addr); \ - Pleaf = (LeafType) P_JLL(PleafRaw); \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - \ - UpLevel(cIS, LeafTypeUp, MaxPop1Up, LeafJPTypeUp, \ - LeafToLeaf, AllocUp, ValueAreaUp); \ - \ - offset = SearchLeaf(Pleaf, pop1, Index); \ - assert(offset >= 0); /* Index must be valid */ \ - JUDYLCODE(Pjv = ValueArea(Pleaf, pop1);) \ - \ - LeafToImmed(cIS, LeafType, ImmedMaxPop1, \ - ImmedBaseJPType, Immed01JPType, \ - ToImmed, SearchLeaf, CopyPIndex, \ - DeleteCopy, FreeLeaf); \ - \ - JU_LEAF_INPLACE(cIS, GrowInPlace, DeleteInPlace); \ - \ - JU_LEAF_SHRINK(cIS, LeafType, DeleteCopy, Alloc, FreeLeaf, \ - ValueArea); \ - } - -// END OF MACROS, START OF CASES: -// -// (*) Leaf1 [[ => 1_15..08 ] => 1_07 => ... => 1_04 ] => 1_03 => 1_02 => 1_01 - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - JU_LEAF(1, - JU_LEAF_UPLEVEL, uint16_t *, cJU_LEAF2_MAXPOP1, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA, - JU_LEAF_TOIMMED, ignore, ignore, - uint8_t *, cJU_IMMED1_MAXPOP1, - cJU_JPIMMED_1_02, cJU_JPIMMED_1_01, j__udySearchLeaf1, - JU_LEAF1GROWINPLACE, JU_DELETEINPLACE, JU_DELETECOPY, - j__udyAllocJLL1, j__udyFreeJLL1, JL_LEAF1VALUEAREA); -#endif - -// A complicating factor is that for JudyL & 32-bit, a Leaf2 must go directly -// to an Immed 2_01 and a Leaf3 must go directly to an Immed 3_01: -// -// Leaf2 [[ => 2_07..04 ] => 2_03 => 2_02 ] => 2_01 -// Leaf3 [[ => 3_05..03 ] => 3_02 ] => 3_01 -// -// Hence use JU_LEAF_TOIMMED_23 instead of JU_LEAF_TOIMMED in the cases below, -// and also the parameters ToImmed and, for odd index sizes, CopyPIndex, are -// required. - - case cJU_JPLEAF2: - - JU_LEAF(2, - JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF3_MAXPOP1, cJU_JPLEAF3, - j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA, - JU_LEAF_TOIMMED_23, JU_TOIMMED_01_EVEN, ignore, - uint16_t *, cJU_IMMED2_MAXPOP1, - cJU_JPIMMED_2_02, cJU_JPIMMED_2_01, j__udySearchLeaf2, - JU_LEAF2GROWINPLACE, JU_DELETEINPLACE, JU_DELETECOPY, - j__udyAllocJLL2, j__udyFreeJLL2, JL_LEAF2VALUEAREA); - -// On 32-bit there is no transition to "uplevel" for a Leaf3, so use -// JU_LEAF_UPLEVEL64 instead of JU_LEAF_UPLEVEL: - - case cJU_JPLEAF3: - - JU_LEAF(3, - JU_LEAF_UPLEVEL64, uint32_t *, cJU_LEAF4_MAXPOP1, - cJU_JPLEAF4, - j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA, - JU_LEAF_TOIMMED_23, - JU_TOIMMED_01_ODD, JU_COPY3_PINDEX_TO_LONG, - uint8_t *, cJU_IMMED3_MAXPOP1, - cJU_JPIMMED_3_02, cJU_JPIMMED_3_01, j__udySearchLeaf3, - JU_LEAF3GROWINPLACE, JU_DELETEINPLACE_ODD, - JU_DELETECOPY_ODD, - j__udyAllocJLL3, j__udyFreeJLL3, JL_LEAF3VALUEAREA); - -#ifdef JU_64BIT - -// A complicating factor is that for JudyL & 64-bit, a Leaf[4-7] must go -// directly to an Immed [4-7]_01: -// -// Leaf4 [[ => 4_03..02 ]] => 4_01 -// Leaf5 [[ => 5_03..02 ]] => 5_01 -// Leaf6 [[ => 6_02 ]] => 6_01 -// Leaf7 [[ => 7_02 ]] => 7_01 -// -// Hence use JU_LEAF_TOIMMED_47 instead of JU_LEAF_TOIMMED in the cases below. - - case cJU_JPLEAF4: - - JU_LEAF(4, - JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF5_MAXPOP1, cJU_JPLEAF5, - j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA, - JU_LEAF_TOIMMED_47, JU_TOIMMED_01_EVEN, ignore, - uint32_t *, cJU_IMMED4_MAXPOP1, - cJ1_JPIMMED_4_02, cJU_JPIMMED_4_01, j__udySearchLeaf4, - JU_LEAF4GROWINPLACE, JU_DELETEINPLACE, JU_DELETECOPY, - j__udyAllocJLL4, j__udyFreeJLL4, JL_LEAF4VALUEAREA); - - case cJU_JPLEAF5: - - JU_LEAF(5, - JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF6_MAXPOP1, cJU_JPLEAF6, - j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA, - JU_LEAF_TOIMMED_47, - JU_TOIMMED_01_ODD, JU_COPY5_PINDEX_TO_LONG, - uint8_t *, cJU_IMMED5_MAXPOP1, - cJ1_JPIMMED_5_02, cJU_JPIMMED_5_01, j__udySearchLeaf5, - JU_LEAF5GROWINPLACE, JU_DELETEINPLACE_ODD, - JU_DELETECOPY_ODD, - j__udyAllocJLL5, j__udyFreeJLL5, JL_LEAF5VALUEAREA); - - case cJU_JPLEAF6: - - JU_LEAF(6, - JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF7_MAXPOP1, cJU_JPLEAF7, - j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA, - JU_LEAF_TOIMMED_47, - JU_TOIMMED_01_ODD, JU_COPY6_PINDEX_TO_LONG, - uint8_t *, cJU_IMMED6_MAXPOP1, - cJ1_JPIMMED_6_02, cJU_JPIMMED_6_01, j__udySearchLeaf6, - JU_LEAF6GROWINPLACE, JU_DELETEINPLACE_ODD, - JU_DELETECOPY_ODD, - j__udyAllocJLL6, j__udyFreeJLL6, JL_LEAF6VALUEAREA); - -// There is no transition to "uplevel" for a Leaf7, so use JU_LEAF_UPLEVEL_NONE -// instead of JU_LEAF_UPLEVEL, and ignore all of the parameters to that macro: - - case cJU_JPLEAF7: - - JU_LEAF(7, - JU_LEAF_UPLEVEL_NONE, ignore1, ignore2, ignore3, ignore4, - ignore5, ignore6, - JU_LEAF_TOIMMED_47, - JU_TOIMMED_01_ODD, JU_COPY7_PINDEX_TO_LONG, - uint8_t *, cJU_IMMED7_MAXPOP1, - cJ1_JPIMMED_7_02, cJU_JPIMMED_7_01, j__udySearchLeaf7, - JU_LEAF7GROWINPLACE, JU_DELETEINPLACE_ODD, - JU_DELETECOPY_ODD, - j__udyAllocJLL7, j__udyFreeJLL7, JL_LEAF7VALUEAREA); -#endif // JU_64BIT - - -// **************************************************************************** -// BITMAP LEAF: - - case cJU_JPLEAF_B1: - { -#ifdef JUDYL - Pjv_t PjvnewRaw; // new value area. - Pjv_t Pjvnew; - Word_t subexp; // 1 of 8 subexpanses in bitmap. - Pjlb_t Pjlb; // pointer to bitmap part of the leaf. - BITMAPL_t bitmap; // for one subexpanse. - BITMAPL_t bitmask; // bit set for Indexs digit. -#endif - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, 1)); - assert(ParentLevel > 1); - // valid Index: - assert(JU_BITMAPTESTL(P_JLB(Pjp->jp_Addr), Index)); - - pop1 = JU_JPLEAF_POP0(Pjp) + 1; - -// Like a Leaf1, see if its under a narrow pointer and can become a Leaf2 -// (hysteresis = 1): - - JU_LEAF_UPLEVEL(1, uint16_t *, cJU_LEAF2_MAXPOP1, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, - JL_LEAF2VALUEAREA); - -#if (defined(JUDY1) && defined(JU_64BIT)) - -// Handle the unusual special case, on Judy1 64-bit only, where a LeafB1 goes -// directly to a JPIMMED_1_15; as described in comments in Judy1.h and -// JudyIns.c. Copy 1-byte indexes from old LeafB1 to the Immed: - - if ((pop1 - 1) == cJU_IMMED1_MAXPOP1) // hysteresis = 0. - { - Pjlb_t PjlbRaw; // bitmap in old leaf. - Pjlb_t Pjlb; - uint8_t * Pleafnew; // JPIMMED as a pointer. - Word_t ldigit; // larger than uint8_t. - - PjlbRaw = (Pjlb_t) (Pjp->jp_Addr); - Pjlb = P_JLB(PjlbRaw); - Pleafnew = Pjp->jp_1Index; - - JU_BITMAPCLEARL(Pjlb, Index); // unset Indexs bit. - -// TBD: This is very slow, there must be a better way: - - for (ldigit = 0; ldigit < cJU_BRANCHUNUMJPS; ++ldigit) - { - if (JU_BITMAPTESTL(Pjlb, ldigit)) - { - *Pleafnew++ = ldigit; - assert(Pleafnew - (Pjp->jp_1Index) - <= cJU_IMMED1_MAXPOP1); - } - } - - DBGCODE(JudyCheckSorted((Pjll_t) (Pjp->jp_1Index), - cJU_IMMED1_MAXPOP1, 1);) - j__udyFreeJLB1(PjlbRaw, Pjpm); - - Pjp->jp_Type = cJ1_JPIMMED_1_15; - return(1); - } - -#else // (JUDYL || (! JU_64BIT)) - -// Compress LeafB1 to a Leaf1: -// -// Note: 4.37 of this file contained alternate code for Judy1 only that simply -// cleared the bit and allowed the LeafB1 to go below cJU_LEAF1_MAXPOP1. This -// was the ONLY case where a malloc failure was not fatal; however, it violated -// the critical assumption that the tree is always kept in least-compressed -// form. - - if (pop1 == cJU_LEAF1_MAXPOP1) // hysteresis = 1. - { - if (j__udyLeafB1ToLeaf1(Pjp, Pjpm) == -1) return(-1); - goto ContinueDelWalk; // delete Index in new Leaf1. - } -#endif // (JUDYL || (! JU_64BIT)) - -#ifdef JUDY1 - // unset Indexs bit: - - JU_BITMAPCLEARL(P_JLB(Pjp->jp_Addr), Index); -#else // JUDYL - -// This is very different from Judy1 because of the need to manage the value -// area: -// -// Get last byte to decode from Index, and pointer to bitmap leaf: - - digit = JU_DIGITATSTATE(Index, 1); - Pjlb = P_JLB(Pjp->jp_Addr); - -// Prepare additional values: - - subexp = digit / cJU_BITSPERSUBEXPL; // which subexpanse. - bitmap = JU_JLB_BITMAP(Pjlb, subexp); // subexps 32-bit map. - PjvRaw = JL_JLB_PVALUE(Pjlb, subexp); // corresponding values. - Pjv = P_JV(PjvRaw); - bitmask = JU_BITPOSMASKL(digit); // mask for Index. - - assert(bitmap & bitmask); // Index must be valid. - - if (bitmap == cJU_FULLBITMAPL) // full bitmap, take shortcut: - { - pop1 = cJU_BITSPERSUBEXPL; - offset = digit % cJU_BITSPERSUBEXPL; - } - else // compute subexpanse pop1 and value area offset: - { - pop1 = j__udyCountBitsL(bitmap); - offset = j__udyCountBitsL(bitmap & (bitmask - 1)); - } - -// Handle solitary Index remaining in subexpanse: - - if (pop1 == 1) - { - j__udyLFreeJV(PjvRaw, 1, Pjpm); - - JL_JLB_PVALUE(Pjlb, subexp) = (Pjv_t) NULL; - JU_JLB_BITMAP(Pjlb, subexp) = 0; - - return(1); - } - -// Shrink value area in place or move to a smaller value area: - - if (JL_LEAFVGROWINPLACE(pop1 - 1)) // hysteresis = 0. - { - JU_DELETEINPLACE(Pjv, pop1, offset, ignore); - } - else - { - if ((PjvnewRaw = j__udyLAllocJV(pop1 - 1, Pjpm)) - == (Pjv_t) NULL) return(-1); - Pjvnew = P_JV(PjvnewRaw); - - JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, ignore); - j__udyLFreeJV(PjvRaw, pop1, Pjpm); - JL_JLB_PVALUE(Pjlb, subexp) = (Pjv_t) PjvnewRaw; - } - - JU_JLB_BITMAP(Pjlb, subexp) ^= bitmask; // clear Indexs bit. - -#endif // JUDYL - - return(1); - - } // case. - - -#ifdef JUDY1 - -// **************************************************************************** -// FULL POPULATION LEAF: -// -// Convert to a LeafB1 and delete the index. Hysteresis = 0; none is possible. -// -// Note: Earlier the second assertion below said, "== 2", but in fact the -// parent could be at a higher level if a fullpop is under a narrow pointer. - - case cJ1_JPFULLPOPU1: - { - Pjlb_t PjlbRaw; - Pjlb_t Pjlb; - Word_t subexp; - - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, 2)); - assert(ParentLevel > 1); // see above. - - if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL) - return(-1); - Pjlb = P_JLB(PjlbRaw); - -// Fully populate the leaf, then unset Indexs bit: - - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - JU_JLB_BITMAP(Pjlb, subexp) = cJU_FULLBITMAPL; - - JU_BITMAPCLEARL(Pjlb, Index); - - Pjp->jp_Addr = (Word_t) PjlbRaw; - Pjp->jp_Type = cJU_JPLEAF_B1; - - return(1); - } -#endif // JUDY1 - - -// **************************************************************************** -// IMMEDIATE JP: -// -// If theres just the one Index in the Immed, convert the JP to a JPNULL* -// (should only happen in a BranchU); otherwise delete the Index from the -// Immed. See the state transitions table elsewhere in this file for a summary -// of which Immed types must be handled. Hysteresis = 0; none is possible with -// Immeds. -// -// MACROS FOR COMMON CODE: -// -// Single Index remains in cJU_JPIMMED_*_01; convert JP to null: -// -// Variables Pjp and parentJPtype are in the context. -// -// Note: cJU_JPIMMED_*_01 should only be encountered in BranchUs, not in -// BranchLs or BranchBs (where its improper to merely modify the JP to be a -// null JP); that is, BranchL and BranchB code should have already handled -// any cJU_JPIMMED_*_01 by different means. - -#define JU_IMMED_01(NewJPType,ParentJPType) \ - \ - assert(parentJPtype == (ParentJPType)); \ - assert(JU_JPDCDPOP0(Pjp) == JU_TRIMTODCDSIZE(Index)); \ - JU_JPSETADT(Pjp, 0, 0, NewJPType); \ - return(1) - -// Convert cJ*_JPIMMED_*_02 to cJU_JPIMMED_*_01: -// -// Move the undeleted Index, whichever does not match the least bytes of Index, -// from undecoded-bytes-only (in jp_1Index or jp_LIndex as appropriate) to -// jp_DcdPopO (full-field). Pjp, Index, and offset are in the context. - -#define JU_IMMED_02(cIS,LeafType,NewJPType) \ - { \ - LeafType Pleaf; \ - \ - assert((ParentLevel - 1) == (cIS)); \ - JUDY1CODE(Pleaf = (LeafType) (Pjp->jp_1Index);) \ - JUDYLCODE(Pleaf = (LeafType) (Pjp->jp_LIndex);) \ - JUDYLCODE(PjvRaw = (Pjv_t) (Pjp->jp_Addr);) \ - JUDYLCODE(Pjv = P_JV(PjvRaw);) \ - JU_TOIMMED_01_EVEN(cIS, ignore, ignore); \ - JUDYLCODE(j__udyLFreeJV(PjvRaw, 2, Pjpm);) \ - Pjp->jp_Type = (NewJPType); \ - return(1); \ - } - -#if (defined(JUDY1) || defined(JU_64BIT)) - -// Variation for "odd" cJ*_JPIMMED_*_02 JP types, which are very different from -// "even" types because they use leaf search code and odd-copy macros: -// -// Note: JudyL 32-bit has no "odd" JPIMMED_*_02 types. - -#define JU_IMMED_02_ODD(cIS,NewJPType,SearchLeaf,CopyPIndex) \ - { \ - uint8_t * Pleaf; \ - \ - assert((ParentLevel - 1) == (cIS)); \ - JUDY1CODE(Pleaf = (uint8_t *) (Pjp->jp_1Index);) \ - JUDYLCODE(Pleaf = (uint8_t *) (Pjp->jp_LIndex);) \ - JUDYLCODE(PjvRaw = (Pjv_t) (Pjp->jp_Addr);) \ - JUDYLCODE(Pjv = P_JV(PjvRaw);) \ - JU_TOIMMED_01_ODD(cIS, SearchLeaf, CopyPIndex); \ - JUDYLCODE(j__udyLFreeJV(PjvRaw, 2, Pjpm);) \ - Pjp->jp_Type = (NewJPType); \ - return(1); \ - } -#endif // (JUDY1 || JU_64BIT) - -// Core code for deleting one Index (and for JudyL, its value area) from a -// larger Immed: -// -// Variables Pleaf, pop1, and offset are in the context. - -#ifdef JUDY1 -#define JU_IMMED_DEL(cIS,DeleteInPlace) \ - DeleteInPlace(Pleaf, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) - -#else // JUDYL - -// For JudyL the value area might need to be shrunk: - -#define JU_IMMED_DEL(cIS,DeleteInPlace) \ - \ - if (JL_LEAFVGROWINPLACE(pop1 - 1)) /* hysteresis = 0 */ \ - { \ - DeleteInPlace( Pleaf, pop1, offset, cIS); \ - JU_DELETEINPLACE(Pjv, pop1, offset, ignore); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) \ - } \ - else \ - { \ - Pjv_t PjvnewRaw; \ - Pjv_t Pjvnew; \ - \ - if ((PjvnewRaw = j__udyLAllocJV(pop1 - 1, Pjpm)) \ - == (Pjv_t) NULL) return(-1); \ - Pjvnew = P_JV(PjvnewRaw); \ - \ - DeleteInPlace(Pleaf, pop1, offset, cIS); \ - JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, ignore); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) \ - j__udyLFreeJV(PjvRaw, pop1, Pjpm); \ - \ - (Pjp->jp_Addr) = (Word_t) PjvnewRaw; \ - } -#endif // JUDYL - -// Delete one Index from a larger Immed where no restructuring is required: -// -// Variables pop1, Pjp, offset, and Index are in the context. - -#define JU_IMMED(cIS,LeafType,BaseJPType,SearchLeaf,DeleteInPlace) \ - { \ - LeafType Pleaf; \ - \ - assert((ParentLevel - 1) == (cIS)); \ - JUDY1CODE(Pleaf = (LeafType) (Pjp->jp_1Index);) \ - JUDYLCODE(Pleaf = (LeafType) (Pjp->jp_LIndex);) \ - JUDYLCODE(PjvRaw = (Pjv_t) (Pjp->jp_Addr);) \ - JUDYLCODE(Pjv = P_JV(PjvRaw);) \ - pop1 = (JU_JPTYPE(Pjp)) - (BaseJPType) + 2; \ - offset = SearchLeaf(Pleaf, pop1, Index); \ - assert(offset >= 0); /* Index must be valid */ \ - \ - JU_IMMED_DEL(cIS, DeleteInPlace); \ - --(Pjp->jp_Type); \ - return(1); \ - } - - -// END OF MACROS, START OF CASES: - -// Single Index remains in Immed; convert JP to null: - - case cJU_JPIMMED_1_01: JU_IMMED_01(cJU_JPNULL1, cJU_JPBRANCH_U2); - case cJU_JPIMMED_2_01: JU_IMMED_01(cJU_JPNULL2, cJU_JPBRANCH_U3); -#ifndef JU_64BIT - case cJU_JPIMMED_3_01: JU_IMMED_01(cJU_JPNULL3, cJU_JPBRANCH_U); -#else - case cJU_JPIMMED_3_01: JU_IMMED_01(cJU_JPNULL3, cJU_JPBRANCH_U4); - case cJU_JPIMMED_4_01: JU_IMMED_01(cJU_JPNULL4, cJU_JPBRANCH_U5); - case cJU_JPIMMED_5_01: JU_IMMED_01(cJU_JPNULL5, cJU_JPBRANCH_U6); - case cJU_JPIMMED_6_01: JU_IMMED_01(cJU_JPNULL6, cJU_JPBRANCH_U7); - case cJU_JPIMMED_7_01: JU_IMMED_01(cJU_JPNULL7, cJU_JPBRANCH_U); -#endif - -// Multiple Indexes remain in the Immed JP; delete the specified Index: - - case cJU_JPIMMED_1_02: - - JU_IMMED_02(1, uint8_t *, cJU_JPIMMED_1_01); - - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - JU_IMMED(1, uint8_t *, cJU_JPIMMED_1_02, - j__udySearchLeaf1, JU_DELETEINPLACE); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - - JU_IMMED_02(2, uint16_t *, cJU_JPIMMED_2_01); - - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - JU_IMMED(2, uint16_t *, cJU_JPIMMED_2_02, - j__udySearchLeaf2, JU_DELETEINPLACE); - - case cJU_JPIMMED_3_02: - - JU_IMMED_02_ODD(3, cJU_JPIMMED_3_01, - j__udySearchLeaf3, JU_COPY3_PINDEX_TO_LONG); - -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: - - JU_IMMED(3, uint8_t *, cJU_JPIMMED_3_02, - j__udySearchLeaf3, JU_DELETEINPLACE_ODD); - - case cJ1_JPIMMED_4_02: - - JU_IMMED_02(4, uint32_t *, cJU_JPIMMED_4_01); - - case cJ1_JPIMMED_4_03: - - JU_IMMED(4, uint32_t *, cJ1_JPIMMED_4_02, - j__udySearchLeaf4, JU_DELETEINPLACE); - - case cJ1_JPIMMED_5_02: - - JU_IMMED_02_ODD(5, cJU_JPIMMED_5_01, - j__udySearchLeaf5, JU_COPY5_PINDEX_TO_LONG); - - case cJ1_JPIMMED_5_03: - - JU_IMMED(5, uint8_t *, cJ1_JPIMMED_5_02, - j__udySearchLeaf5, JU_DELETEINPLACE_ODD); - - case cJ1_JPIMMED_6_02: - - JU_IMMED_02_ODD(6, cJU_JPIMMED_6_01, - j__udySearchLeaf6, JU_COPY6_PINDEX_TO_LONG); - - case cJ1_JPIMMED_7_02: - - JU_IMMED_02_ODD(7, cJU_JPIMMED_7_01, - j__udySearchLeaf7, JU_COPY7_PINDEX_TO_LONG); - -#endif // (JUDY1 && JU_64BIT) - - -// **************************************************************************** -// INVALID JP TYPE: - - default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); return(-1); - - } // switch - - -// PROCESS JP -- RECURSIVELY: -// -// For non-Immed JP types, if successful, post-decrement the population count -// at this level, or collapse a BranchL if necessary by copying the remaining -// JP in the BranchL to the parent (hysteresis = 0), which implicitly creates a -// narrow pointer if there was not already one in the hierarchy. - - assert(level); - retcode = j__udyDelWalk(Pjp, Index, level, Pjpm); - assert(retcode != 0); // should never happen. - - if ((JU_JPTYPE(Pjp)) < cJU_JPIMMED_1_01) // not an Immed. - { - switch (retcode) - { - case 1: - { - jp_t JP = *Pjp; - Word_t DcdP0; - - DcdP0 = JU_JPDCDPOP0(Pjp) - 1; // decrement count. - JU_JPSETADT(Pjp, JP.jp_Addr, DcdP0, JU_JPTYPE(&JP)); - break; - } - case 2: // collapse BranchL to single JP; see above: - { - Pjbl_t PjblRaw = (Pjbl_t) (Pjp->jp_Addr); - Pjbl_t Pjbl = P_JBL(PjblRaw); - - *Pjp = Pjbl->jbl_jp[0]; - j__udyFreeJBL(PjblRaw, Pjpm); - retcode = 1; - } - } - } - - return(retcode); - -} // j__udyDelWalk() - - -// **************************************************************************** -// J U D Y 1 U N S E T -// J U D Y L D E L -// -// Main entry point. See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1Unset -#else -FUNCTION int JudyLDel -#endif - ( - PPvoid_t PPArray, // in which to delete. - Word_t Index, // to delete. - PJError_t PJError // optional, for returning error info. - ) -{ - Word_t pop1; // population of leaf. - int offset; // at which to delete Index. - JUDY1CODE(int retcode;) // return code from Judy1Test(). -JUDYLCODE(PPvoid_t PPvalue;) // pointer from JudyLGet(). - - -// CHECK FOR NULL ARRAY POINTER (error by caller): - - if (PPArray == (PPvoid_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); - return(JERRI); - } - - -// CHECK IF INDEX IS INVALID: -// -// If so, theres nothing to do. This saves a lot of time. Pass through -// PJError, if any, from the "get" function. - -#ifdef JUDY1 - if ((retcode = Judy1Test(*PPArray, Index, PJError)) == JERRI) - return (JERRI); - - if (retcode == 0) return(0); -#else - if ((PPvalue = JudyLGet(*PPArray, Index, PJError)) == PPJERR) - return (JERRI); - - if (PPvalue == (PPvoid_t) NULL) return(0); -#endif - - -// **************************************************************************** -// PROCESS TOP LEVEL (LEAFW) BRANCHES AND LEAVES: - -// **************************************************************************** -// LEAFW LEAF, OTHER SIZE: -// -// Shrink or convert the leaf as necessary. Hysteresis = 0; none is possible. - - if (JU_LEAFW_POP0(*PPArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - JUDYLCODE(Pjv_t Pjv;) // current value area. - JUDYLCODE(Pjv_t Pjvnew;) // value area in new leaf. - Pjlw_t Pjlw = P_JLW(*PPArray); // first word of leaf. - Pjlw_t Pjlwnew; // replacement leaf. - pop1 = Pjlw[0] + 1; // first word of leaf is pop0. - -// Delete single (last) Index from array: - - if (pop1 == 1) - { - j__udyFreeJLW(Pjlw, /* pop1 = */ 1, (Pjpm_t) NULL); - *PPArray = (Pvoid_t) NULL; - return(1); - } - -// Locate Index in compressible leaf: - - offset = j__udySearchLeafW(Pjlw + 1, pop1, Index); - assert(offset >= 0); // Index must be valid. - - JUDYLCODE(Pjv = JL_LEAFWVALUEAREA(Pjlw, pop1);) - -// Delete Index in-place: -// -// Note: "Grow in place from pop1 - 1" is the logical inverse of, "shrink in -// place from pop1." Also, Pjlw points to the count word, so skip that for -// doing the deletion. - - if (JU_LEAFWGROWINPLACE(pop1 - 1)) - { - JU_DELETEINPLACE(Pjlw + 1, pop1, offset, ignore); -#ifdef JUDYL // also delete from value area: - JU_DELETEINPLACE(Pjv, pop1, offset, ignore); -#endif - DBGCODE(JudyCheckSorted((Pjll_t) (Pjlw + 1), pop1 - 1, - cJU_ROOTSTATE);) - --(Pjlw[0]); // decrement population. - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - } - -// Allocate new leaf for use in either case below: - - Pjlwnew = j__udyAllocJLW(pop1 - 1); - JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI); - -// Shrink to smaller LEAFW: -// -// Note: Skip the first word = pop0 in each leaf. - - Pjlwnew[0] = (pop1 - 1) - 1; - JU_DELETECOPY(Pjlwnew + 1, Pjlw + 1, pop1, offset, ignore); - -#ifdef JUDYL // also delete from value area: - Pjvnew = JL_LEAFWVALUEAREA(Pjlwnew, pop1 - 1); - JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, ignore); -#endif - DBGCODE(JudyCheckSorted(Pjlwnew + 1, pop1 - 1, cJU_ROOTSTATE);) - - j__udyFreeJLW(Pjlw, pop1, (Pjpm_t) NULL); - -//// *PPArray = (Pvoid_t) Pjlwnew | cJU_LEAFW); - *PPArray = (Pvoid_t) Pjlwnew; - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - - } - else - - -// **************************************************************************** -// JRP BRANCH: -// -// Traverse through the JPM to do the deletion unless the population is small -// enough to convert immediately to a LEAFW. - - { - Pjpm_t Pjpm; - Pjp_t Pjp; // top-level JP to process. - Word_t digit; // in a branch. - JUDYLCODE(Pjv_t Pjv;) // to value area. - Pjlw_t Pjlwnew; // replacement leaf. - DBGCODE(Pjlw_t Pjlwnew_orig;) - - Pjpm = P_JPM(*PPArray); // top object in array (tree). - Pjp = &(Pjpm->jpm_JP); // next object (first branch or leaf). - - assert(((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_L) - || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_B) - || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_U)); - -// WALK THE TREE -// -// Note: Recursive code in j__udyDelWalk() knows how to collapse a lower-level -// BranchL containing a single JP into the parent JP as a narrow pointer, but -// the code here cant do that for a top-level BranchL. The result can be -// PArray -> JPM -> BranchL containing a single JP. This situation is -// unavoidable because a JPM cannot contain a narrow pointer; the BranchL is -// required in order to hold the top digit decoded, and it does not collapse to -// a LEAFW until the population is low enough. -// -// TBD: Should we add a topdigit field to JPMs so they can hold narrow -// pointers? - - if (j__udyDelWalk(Pjp, Index, cJU_ROOTSTATE, Pjpm) == -1) - { - JU_COPY_ERRNO(PJError, Pjpm); - return(JERRI); - } - - --(Pjpm->jpm_Pop0); // success; decrement total population. - - if ((Pjpm->jpm_Pop0 + 1) != cJU_LEAFW_MAXPOP1) - { - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - } - -// COMPRESS A BRANCH[LBU] TO A LEAFW: -// - Pjlwnew = j__udyAllocJLW(cJU_LEAFW_MAXPOP1); - JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI); - -// Plug leaf into root pointer and set population count: - -//// *PPArray = (Pvoid_t) ((Word_t) Pjlwnew | cJU_LEAFW); - *PPArray = (Pvoid_t) Pjlwnew; -#ifdef JUDYL // prepare value area: - Pjv = JL_LEAFWVALUEAREA(Pjlwnew, cJU_LEAFW_MAXPOP1); -#endif - *Pjlwnew++ = cJU_LEAFW_MAXPOP1 - 1; // set pop0. - DBGCODE(Pjlwnew_orig = Pjlwnew;) - - switch (JU_JPTYPE(Pjp)) - { - -// JPBRANCH_L: Copy each JPs indexes to the new LEAFW and free the old -// branch: - - case cJU_JPBRANCH_L: - { - Pjbl_t PjblRaw = (Pjbl_t) (Pjp->jp_Addr); - Pjbl_t Pjbl = P_JBL(PjblRaw); - - for (offset = 0; offset < Pjbl->jbl_NumJPs; ++offset) - { - pop1 = j__udyLeafM1ToLeafW(Pjlwnew, JU_PVALUEPASS - (Pjbl->jbl_jp) + offset, - JU_DIGITTOSTATE(Pjbl->jbl_Expanse[offset], - cJU_BYTESPERWORD), - (Pvoid_t) Pjpm); - Pjlwnew += pop1; // advance through indexes. - JUDYLCODE(Pjv += pop1;) // advance through values. - } - j__udyFreeJBL(PjblRaw, Pjpm); - - assert(Pjlwnew == Pjlwnew_orig + cJU_LEAFW_MAXPOP1); - break; // delete Index from new LEAFW. - } - -// JPBRANCH_B: Copy each JPs indexes to the new LEAFW and free the old -// branch, including each JP subarray: - - case cJU_JPBRANCH_B: - { - Pjbb_t PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); - Pjbb_t Pjbb = P_JBB(PjbbRaw); - Word_t subexp; // current subexpanse number. - BITMAPB_t bitmap; // portion for this subexpanse. - Pjp_t Pjp2Raw; // one subexpanses subarray. - Pjp_t Pjp2; - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - if ((bitmap = JU_JBB_BITMAP(Pjbb, subexp)) == 0) - continue; // skip empty subexpanse. - - digit = subexp * cJU_BITSPERSUBEXPB; - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); - Pjp2 = P_JP(Pjp2Raw); - assert(Pjp2 != (Pjp_t) NULL); - -// Walk through bits for all possible sub-subexpanses (digits); increment -// offset for each populated subexpanse; until no more set bits: - - for (offset = 0; bitmap != 0; bitmap >>= 1, ++digit) - { - if (! (bitmap & 1)) // skip empty sub-subexpanse. - continue; - - pop1 = j__udyLeafM1ToLeafW(Pjlwnew, JU_PVALUEPASS - Pjp2 + offset, - JU_DIGITTOSTATE(digit, cJU_BYTESPERWORD), - (Pvoid_t) Pjpm); - Pjlwnew += pop1; // advance through indexes. - JUDYLCODE(Pjv += pop1;) // advance through values. - ++offset; - } - j__udyFreeJBBJP(Pjp2Raw, /* pop1 = */ offset, Pjpm); - } - j__udyFreeJBB(PjbbRaw, Pjpm); - - assert(Pjlwnew == Pjlwnew_orig + cJU_LEAFW_MAXPOP1); - break; // delete Index from new LEAFW. - - } // case cJU_JPBRANCH_B. - - -// JPBRANCH_U: Copy each JPs indexes to the new LEAFW and free the old -// branch: - - case cJU_JPBRANCH_U: - { - Pjbu_t PjbuRaw = (Pjbu_t) (Pjp->jp_Addr); - Pjbu_t Pjbu = P_JBU(PjbuRaw); - Word_t ldigit; // larger than uint8_t. - - for (Pjp = Pjbu->jbu_jp, ldigit = 0; - ldigit < cJU_BRANCHUNUMJPS; - ++Pjp, ++ldigit) - { - -// Shortcuts, to save a little time for possibly big branches: - - if ((JU_JPTYPE(Pjp)) == cJU_JPNULLMAX) // skip null JP. - continue; - -// TBD: Should the following shortcut also be used in BranchL and BranchB -// code? - -#ifndef JU_64BIT - if ((JU_JPTYPE(Pjp)) == cJU_JPIMMED_3_01) -#else - if ((JU_JPTYPE(Pjp)) == cJU_JPIMMED_7_01) -#endif - { // single Immed: - *Pjlwnew++ = JU_DIGITTOSTATE(ldigit, cJU_BYTESPERWORD) - | JU_JPDCDPOP0(Pjp); // rebuild Index. -#ifdef JUDYL - *Pjv++ = Pjp->jp_Addr; // copy value area. -#endif - continue; - } - - pop1 = j__udyLeafM1ToLeafW(Pjlwnew, JU_PVALUEPASS - Pjp, JU_DIGITTOSTATE(ldigit, cJU_BYTESPERWORD), - (Pvoid_t) Pjpm); - Pjlwnew += pop1; // advance through indexes. - JUDYLCODE(Pjv += pop1;) // advance through values. - } - j__udyFreeJBU(PjbuRaw, Pjpm); - - assert(Pjlwnew == Pjlwnew_orig + cJU_LEAFW_MAXPOP1); - break; // delete Index from new LEAFW. - - } // case cJU_JPBRANCH_U. - - -// INVALID JP TYPE in jpm_t struct - - default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(JERRI); - - } // end switch on sub-JP type. - - DBGCODE(JudyCheckSorted((Pjll_t) Pjlwnew_orig, cJU_LEAFW_MAXPOP1, - cJU_ROOTSTATE);) - -// FREE JPM (no longer needed): - - j__udyFreeJPM(Pjpm, (Pjpm_t) NULL); - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - - } - /*NOTREACHED*/ - -} // Judy1Unset() / JudyLDel() diff --git a/libjudy/src/Judy1/Makefile.in b/libjudy/src/Judy1/Makefile.in deleted file mode 100644 index 1c2e1be812..0000000000 --- a/libjudy/src/Judy1/Makefile.in +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (C) 2006 Imperial College London and others. -# -# Please see the AUTHORS file in the main source directory for a full list -# of copyright holders. -# -# Prof. C Pain -# Applied Modelling and Computation Group -# Department of Earth Science and Engineering -# Imperial College London -# -# amcgsoftware@imperial.ac.uk -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation, -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA - -SHELL = @SHELL@ - -PACKAGE_NAME = @PACKAGE_NAME@ -FLUIDITY = $(PACKAGE_NAME) - -MPIF90 = @MPIF90@ - -CC = @CC@ -CFLAGS = @CPPFLAGS@ @CFLAGS@ @JUDY_CFLAGS@ -I../include -I/usr/local/include -I.. -I../JudyCommon -DJUDY1 - -MAKE = @MAKE@ - -LIBS = -L../lib -l$(FLUIDITY) @LIBS@ @BLAS_LIBS@ - -OBJS = Judy1Tables.o Judy1Test.o j__udy1Test.o Judy1Set.o Judy1SetArray.o Judy1Unset.o Judy1First.o Judy1Next.o \ - Judy1Prev.o Judy1NextEmpty.o Judy1PrevEmpty.o Judy1Count.o Judy1ByCount.o Judy1FreeArray.o Judy1MemUsed.o \ - Judy1MemActive.o Judy1Cascade.o Judy1Decascade.o Judy1CreateBranch.o Judy1InsertBranch.o Judy1MallocIF.o - -.SUFFIXES: .f90 .F90 .cpp .c .o .a - -# cancel implicit rule that tries to make .o from .mod with m2c: -%.o: %.mod - -default: $(OBJS) - cp *.o ../obj/ - -.c.o: - @echo " CC $<" - $(CC) $(CFLAGS) -c $< - -j__udy1Test.o: j__udy1Test.c - @echo " CC $<" - $(CC) $(CFLAGS) -DJUDYGETINLINE -c $< - -Judy1Next.o: Judy1Next.c - @echo " CC $<" - $(CC) $(CFLAGS) -DJUDYNEXT -c $< - -Judy1NextEmpty.o: Judy1NextEmpty.c - @echo " CC $<" - $(CC) $(CFLAGS) -DJUDYNEXT -c $< - -Judy1Prev.o: Judy1Prev.c - @echo " CC $<" - $(CC) $(CFLAGS) -DJUDYPREV -c $< - -Judy1PrevEmpty.o: Judy1PrevEmpty.c - @echo " CC $<" - $(CC) $(CFLAGS) -DJUDYPREV -c $< - -Judy1ByCount.o: Judy1ByCount.c - @echo " CC $<" - $(CC) $(CFLAGS) -DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB -c $< - -Judy1Tables.o: Judy1Tables.c - @echo " CC $<" - $(CC) $(CFLAGS) -c $< - -Judy1Tables.c: - $(CC) $(CFLAGS) -DJUDY1 Judy1TablesGen.c -o Judy1TablesGen - ./Judy1TablesGen - -clean: - rm -f *.o - rm -f Judy1Tables.c - diff --git a/libjudy/src/Judy1/README b/libjudy/src/Judy1/README deleted file mode 100644 index 69c3d4be07..0000000000 --- a/libjudy/src/Judy1/README +++ /dev/null @@ -1,11 +0,0 @@ -# @(#) $Revision: 4.22 $ $Source: /judy/src/Judy1/README $ - -# This tree contains sources for the Judy1*() functions. -# -# Note: At one time, all of the Judy sources were split between Judy1/ and -# JudyL/ variants, but now most of them are merged in JudyCommon/ and this -# directory is vestigal. - -Judy1.h header for following functions - -lint.waivers see usage in makefile diff --git a/libjudy/src/Judy1/j__udy1Test.c b/libjudy/src/Judy1/j__udy1Test.c deleted file mode 100644 index 0bb9971cc8..0000000000 --- a/libjudy/src/Judy1/j__udy1Test.c +++ /dev/null @@ -1,1094 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.43 $ $Source: /judy/src/JudyCommon/JudyGet.c $ -// -// Judy1Test() and JudyLGet() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -#ifdef TRACEJPR // different macro name, for "retrieval" only. -#include "JudyPrintJP.c" -#endif - - -// **************************************************************************** -// J U D Y 1 T E S T -// J U D Y L G E T -// -// See the manual entry for details. Note support for "shortcut" entries to -// trees known to start with a JPM. - -#ifdef JUDY1 - -#ifdef JUDYGETINLINE -FUNCTION int j__udy1Test -#else -FUNCTION int Judy1Test -#endif - -#else // JUDYL - -#ifdef JUDYGETINLINE -FUNCTION PPvoid_t j__udyLGet -#else -FUNCTION PPvoid_t JudyLGet -#endif - -#endif // JUDYL - ( -#ifdef JUDYGETINLINE - Pvoid_t PArray, // from which to retrieve. - Word_t Index // to retrieve. -#else - Pcvoid_t PArray, // from which to retrieve. - Word_t Index, // to retrieve. - PJError_t PJError // optional, for returning error info. -#endif - ) -{ - Pjp_t Pjp; // current JP while walking the tree. - Pjpm_t Pjpm; // for global accounting. - uint8_t Digit; // byte just decoded from Index. - Word_t Pop1; // leaf population (number of indexes). - Pjll_t Pjll; // pointer to LeafL. - DBGCODE(uint8_t ParentJPType;) - -#ifndef JUDYGETINLINE - - if (PArray == (Pcvoid_t) NULL) // empty array. - { - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - } - -// **************************************************************************** -// PROCESS TOP LEVEL BRANCHES AND LEAF: - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - int posidx; // signed offset in leaf. - - Pop1 = Pjlw[0] + 1; - posidx = j__udySearchLeafW(Pjlw + 1, Pop1, Index); - - if (posidx >= 0) - { - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAFWVALUEAREA(Pjlw, Pop1) + posidx));) - } - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - } - -#endif // ! JUDYGETINLINE - - Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); // top branch is below JPM. - -// **************************************************************************** -// WALK THE JUDY TREE USING A STATE MACHINE: - -ContinueWalk: // for going down one level; come here with Pjp set. - -#ifdef TRACEJPR - JudyPrintJP(Pjp, "g", __LINE__); -#endif - switch (JU_JPTYPE(Pjp)) - { - -// Ensure the switch table starts at 0 for speed; otherwise more code is -// executed: - - case 0: goto ReturnCorrupt; // save a little code. - - -// **************************************************************************** -// JPNULL*: -// -// Note: These are legitimate in a BranchU (only) and do not constitute a -// fault. - - case cJU_JPNULL1: - case cJU_JPNULL2: - case cJU_JPNULL3: -#ifdef JU_64BIT - case cJU_JPNULL4: - case cJU_JPNULL5: - case cJU_JPNULL6: - case cJU_JPNULL7: -#endif - assert(ParentJPType >= cJU_JPBRANCH_U2); - assert(ParentJPType <= cJU_JPBRANCH_U); - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - - -// **************************************************************************** -// JPBRANCH_L*: -// -// Note: The use of JU_DCDNOTMATCHINDEX() in branches is not strictly -// required,since this can be done at leaf level, but it costs nothing to do it -// sooner, and it aborts an unnecessary traversal sooner. - - case cJU_JPBRANCH_L2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - Digit = JU_DIGITATSTATE(Index, 2); - goto JudyBranchL; - - case cJU_JPBRANCH_L3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - Digit = JU_DIGITATSTATE(Index, 3); - goto JudyBranchL; - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - Digit = JU_DIGITATSTATE(Index, 4); - goto JudyBranchL; - - case cJU_JPBRANCH_L5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - Digit = JU_DIGITATSTATE(Index, 5); - goto JudyBranchL; - - case cJU_JPBRANCH_L6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - Digit = JU_DIGITATSTATE(Index, 6); - goto JudyBranchL; - - case cJU_JPBRANCH_L7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Digit = JU_DIGITATSTATE(Index, 7); - goto JudyBranchL; - -#endif // JU_64BIT - - case cJU_JPBRANCH_L: - { - Pjbl_t Pjbl; - int posidx; - - Digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - -// Common code for all BranchLs; come here with Digit set: - -JudyBranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - - posidx = 0; - - do { - if (Pjbl->jbl_Expanse[posidx] == Digit) - { // found Digit; continue traversal: - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = Pjbl->jbl_jp + posidx; - goto ContinueWalk; - } - } while (++posidx != Pjbl->jbl_NumJPs); - - break; - } - - -// **************************************************************************** -// JPBRANCH_B*: - - case cJU_JPBRANCH_B2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - Digit = JU_DIGITATSTATE(Index, 2); - goto JudyBranchB; - - case cJU_JPBRANCH_B3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - Digit = JU_DIGITATSTATE(Index, 3); - goto JudyBranchB; - - -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - Digit = JU_DIGITATSTATE(Index, 4); - goto JudyBranchB; - - case cJU_JPBRANCH_B5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - Digit = JU_DIGITATSTATE(Index, 5); - goto JudyBranchB; - - case cJU_JPBRANCH_B6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - Digit = JU_DIGITATSTATE(Index, 6); - goto JudyBranchB; - - case cJU_JPBRANCH_B7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Digit = JU_DIGITATSTATE(Index, 7); - goto JudyBranchB; - -#endif // JU_64BIT - - case cJU_JPBRANCH_B: - { - Pjbb_t Pjbb; - Word_t subexp; // in bitmap, 0..7. - BITMAPB_t BitMap; // for one subexpanse. - BITMAPB_t BitMask; // bit in BitMap for Indexs Digit. - - Digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - -// Common code for all BranchBs; come here with Digit set: - -JudyBranchB: - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjbb = P_JBB(Pjp->jp_Addr); - subexp = Digit / cJU_BITSPERSUBEXPB; - - BitMap = JU_JBB_BITMAP(Pjbb, subexp); - Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp)); - - BitMask = JU_BITPOSMASKB(Digit); - -// No JP in subexpanse for Index => Index not found: - - if (! (BitMap & BitMask)) break; - -// Count JPs in the subexpanse below the one for Index: - - Pjp += j__udyCountBitsB(BitMap & (BitMask - 1)); - - goto ContinueWalk; - - } // case cJU_JPBRANCH_B* - - -// **************************************************************************** -// JPBRANCH_U*: -// -// Notice the reverse order of the cases, and falling through to the next case, -// for performance. - - case cJU_JPBRANCH_U: - - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, cJU_ROOTSTATE); - -// If not a BranchU, traverse; otherwise fall into the next case, which makes -// this very fast code for a large Judy array (mainly BranchUs), especially -// when branches are already in the cache, such as for prev/next: - -#ifndef JU_64BIT - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U3) goto ContinueWalk; -#else - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U7) goto ContinueWalk; -#endif - -#ifdef JU_64BIT - case cJU_JPBRANCH_U7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 7); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U6) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 6); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U5) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 5); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U4) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 4); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U3) goto ContinueWalk; - // and fall through. - -#endif // JU_64BIT - - case cJU_JPBRANCH_U3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 3); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U2) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 2); - -// Note: BranchU2 is a special case that must continue traversal to a leaf, -// immed, full, or null type: - - goto ContinueWalk; - - -// **************************************************************************** -// JPLEAF*: -// -// Note: Here the calls of JU_DCDNOTMATCHINDEX() are necessary and check -// whether Index is out of the expanse of a narrow pointer. - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - - case cJU_JPLEAF1: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf1(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF1VALUEAREA(Pjll, Pop1) + posidx));) - } - -#endif // (JUDYL || (! JU_64BIT)) - - case cJU_JPLEAF2: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf2(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF2VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF3: - { - int posidx; // signed offset in leaf. - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf3(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF3VALUEAREA(Pjll, Pop1) + posidx));) - } -#ifdef JU_64BIT - case cJU_JPLEAF4: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf4(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF4VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF5: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf5(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF5VALUEAREA(Pjll, Pop1) + posidx));) - } - - case cJU_JPLEAF6: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf6(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF6VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF7: - { - int posidx; // signed offset in leaf. - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf7(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF7VALUEAREA(Pjll, Pop1) + posidx));) - } -#endif // JU_64BIT - - -// **************************************************************************** -// JPLEAF_B1: - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; -#ifdef JUDYL - int posidx; - Word_t subexp; // in bitmap, 0..7. - BITMAPL_t BitMap; // for one subexpanse. - BITMAPL_t BitMask; // bit in BitMap for Indexs Digit. - Pjv_t Pjv; -#endif - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - Pjlb = P_JLB(Pjp->jp_Addr); - -#ifdef JUDY1 - -// Simply check if Indexs bit is set in the bitmap: - - if (JU_BITMAPTESTL(Pjlb, Index)) return(1); - break; - -#else // JUDYL - -// JudyL is much more complicated because of value area subarrays: - - Digit = JU_DIGITATSTATE(Index, 1); - subexp = Digit / cJU_BITSPERSUBEXPL; - BitMap = JU_JLB_BITMAP(Pjlb, subexp); - BitMask = JU_BITPOSMASKL(Digit); - -// No value in subexpanse for Index => Index not found: - - if (! (BitMap & BitMask)) break; - -// Count value areas in the subexpanse below the one for Index: - - Pjv = P_JV(JL_JLB_PVALUE(Pjlb, subexp)); - assert(Pjv != (Pjv_t) NULL); - posidx = j__udyCountBitsL(BitMap & (BitMask - 1)); - - return((PPvoid_t) (Pjv + posidx)); - -#endif // JUDYL - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 - -// **************************************************************************** -// JPFULLPOPU1: -// -// If the Index is in the expanse, it is necessarily valid (found). - - case cJ1_JPFULLPOPU1: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - return(1); - -#ifdef notdef // for future enhancements -#ifdef JU_64BIT - -// Note: Need ? if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - case cJ1_JPFULLPOPU1m15: - if (Pjp->jp_1Index[14] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m14: - if (Pjp->jp_1Index[13] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m13: - if (Pjp->jp_1Index[12] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m12: - if (Pjp->jp_1Index[11] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m11: - if (Pjp->jp_1Index[10] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m10: - if (Pjp->jp_1Index[9] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m9: - if (Pjp->jp_1Index[8] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m8: - if (Pjp->jp_1Index[7] == (uint8_t)Index) break; -#endif - case cJ1_JPFULLPOPU1m7: - if (Pjp->jp_1Index[6] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m6: - if (Pjp->jp_1Index[5] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m5: - if (Pjp->jp_1Index[4] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m4: - if (Pjp->jp_1Index[3] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m3: - if (Pjp->jp_1Index[2] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m2: - if (Pjp->jp_1Index[1] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m1: - if (Pjp->jp_1Index[0] == (uint8_t)Index) break; - - return(1); // found, not in exclusion list - -#endif // JUDY1 -#endif // notdef - -// **************************************************************************** -// JPIMMED*: -// -// Note that the contents of jp_DcdPopO are different for cJU_JPIMMED_*_01: - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - if (JU_JPDCDPOP0(Pjp) != JU_TRIMTODCDSIZE(Index)) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) &(Pjp->jp_Addr));) // immediate value area. - - -// Macros to make code more readable and avoid dup errors - -#ifdef JUDY1 - -#define CHECKINDEXNATIVE(LEAF_T, PJP, IDX, INDEX) \ -if (((LEAF_T *)((PJP)->jp_1Index))[(IDX) - 1] == (LEAF_T)(INDEX)) \ - return(1) - -#define CHECKLEAFNONNAT(LFBTS, PJP, INDEX, IDX, COPY) \ -{ \ - Word_t i_ndex; \ - uint8_t *a_ddr; \ - a_ddr = (PJP)->jp_1Index + (((IDX) - 1) * (LFBTS)); \ - COPY(i_ndex, a_ddr); \ - if (i_ndex == JU_LEASTBYTES((INDEX), (LFBTS))) \ - return(1); \ -} -#endif - -#ifdef JUDYL - -#define CHECKINDEXNATIVE(LEAF_T, PJP, IDX, INDEX) \ -if (((LEAF_T *)((PJP)->jp_LIndex))[(IDX) - 1] == (LEAF_T)(INDEX)) \ - return((PPvoid_t)(P_JV((PJP)->jp_Addr) + (IDX) - 1)) - -#define CHECKLEAFNONNAT(LFBTS, PJP, INDEX, IDX, COPY) \ -{ \ - Word_t i_ndex; \ - uint8_t *a_ddr; \ - a_ddr = (PJP)->jp_LIndex + (((IDX) - 1) * (LFBTS)); \ - COPY(i_ndex, a_ddr); \ - if (i_ndex == JU_LEASTBYTES((INDEX), (LFBTS))) \ - return((PPvoid_t)(P_JV((PJP)->jp_Addr) + (IDX) - 1)); \ -} -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_15: CHECKINDEXNATIVE(uint8_t, Pjp, 15, Index); - case cJ1_JPIMMED_1_14: CHECKINDEXNATIVE(uint8_t, Pjp, 14, Index); - case cJ1_JPIMMED_1_13: CHECKINDEXNATIVE(uint8_t, Pjp, 13, Index); - case cJ1_JPIMMED_1_12: CHECKINDEXNATIVE(uint8_t, Pjp, 12, Index); - case cJ1_JPIMMED_1_11: CHECKINDEXNATIVE(uint8_t, Pjp, 11, Index); - case cJ1_JPIMMED_1_10: CHECKINDEXNATIVE(uint8_t, Pjp, 10, Index); - case cJ1_JPIMMED_1_09: CHECKINDEXNATIVE(uint8_t, Pjp, 9, Index); - case cJ1_JPIMMED_1_08: CHECKINDEXNATIVE(uint8_t, Pjp, 8, Index); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_07: CHECKINDEXNATIVE(uint8_t, Pjp, 7, Index); - case cJU_JPIMMED_1_06: CHECKINDEXNATIVE(uint8_t, Pjp, 6, Index); - case cJU_JPIMMED_1_05: CHECKINDEXNATIVE(uint8_t, Pjp, 5, Index); - case cJU_JPIMMED_1_04: CHECKINDEXNATIVE(uint8_t, Pjp, 4, Index); -#endif - case cJU_JPIMMED_1_03: CHECKINDEXNATIVE(uint8_t, Pjp, 3, Index); - case cJU_JPIMMED_1_02: CHECKINDEXNATIVE(uint8_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint8_t, Pjp, 1, Index); - break; - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_07: CHECKINDEXNATIVE(uint16_t, Pjp, 7, Index); - case cJ1_JPIMMED_2_06: CHECKINDEXNATIVE(uint16_t, Pjp, 6, Index); - case cJ1_JPIMMED_2_05: CHECKINDEXNATIVE(uint16_t, Pjp, 5, Index); - case cJ1_JPIMMED_2_04: CHECKINDEXNATIVE(uint16_t, Pjp, 4, Index); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_03: CHECKINDEXNATIVE(uint16_t, Pjp, 3, Index); - case cJU_JPIMMED_2_02: CHECKINDEXNATIVE(uint16_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint16_t, Pjp, 1, Index); - break; -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_05: - CHECKLEAFNONNAT(3, Pjp, Index, 5, JU_COPY3_PINDEX_TO_LONG); - case cJ1_JPIMMED_3_04: - CHECKLEAFNONNAT(3, Pjp, Index, 4, JU_COPY3_PINDEX_TO_LONG); - case cJ1_JPIMMED_3_03: - CHECKLEAFNONNAT(3, Pjp, Index, 3, JU_COPY3_PINDEX_TO_LONG); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: - CHECKLEAFNONNAT(3, Pjp, Index, 2, JU_COPY3_PINDEX_TO_LONG); - CHECKLEAFNONNAT(3, Pjp, Index, 1, JU_COPY3_PINDEX_TO_LONG); - break; -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - - case cJ1_JPIMMED_4_03: CHECKINDEXNATIVE(uint32_t, Pjp, 3, Index); - case cJ1_JPIMMED_4_02: CHECKINDEXNATIVE(uint32_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint32_t, Pjp, 1, Index); - break; - - case cJ1_JPIMMED_5_03: - CHECKLEAFNONNAT(5, Pjp, Index, 3, JU_COPY5_PINDEX_TO_LONG); - case cJ1_JPIMMED_5_02: - CHECKLEAFNONNAT(5, Pjp, Index, 2, JU_COPY5_PINDEX_TO_LONG); - CHECKLEAFNONNAT(5, Pjp, Index, 1, JU_COPY5_PINDEX_TO_LONG); - break; - - case cJ1_JPIMMED_6_02: - CHECKLEAFNONNAT(6, Pjp, Index, 2, JU_COPY6_PINDEX_TO_LONG); - CHECKLEAFNONNAT(6, Pjp, Index, 1, JU_COPY6_PINDEX_TO_LONG); - break; - - case cJ1_JPIMMED_7_02: - CHECKLEAFNONNAT(7, Pjp, Index, 2, JU_COPY7_PINDEX_TO_LONG); - CHECKLEAFNONNAT(7, Pjp, Index, 1, JU_COPY7_PINDEX_TO_LONG); - break; - -#endif // (JUDY1 && JU_64BIT) - - -// **************************************************************************** -// INVALID JP TYPE: - - default: - -ReturnCorrupt: - -#ifdef JUDYGETINLINE // Pjpm is known to be non-null: - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); -#else - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); -#endif - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // switch on JP type - -JUDY1CODE(return(0);) -JUDYLCODE(return((PPvoid_t) NULL);) - -} // Judy1Test() / JudyLGet() - - -#ifndef JUDYGETINLINE // only compile the following function once: -#ifdef DEBUG - -// **************************************************************************** -// J U D Y C H E C K P O P -// -// Given a pointer to a Judy array, traverse the entire array to ensure -// population counts add up correctly. This can catch various coding errors. -// -// Since walking the entire tree is probably time-consuming, enable this -// function by setting env parameter $CHECKPOP to first call at which to start -// checking. Note: This function is called both from insert and delete code. -// -// Note: Even though this function does nothing useful for LEAFW leaves, its -// good practice to call it anyway, and cheap too. -// -// TBD: This is a debug-only check function similar to JudyCheckSorted(), but -// since it walks the tree it is Judy1/JudyL-specific and must live in a source -// file that is built both ways. -// -// TBD: As feared, enabling this code for every insert/delete makes Judy -// deathly slow, even for a small tree (10K indexes). Its not so bad if -// present but disabled (<1% slowdown measured). Still, should it be ifdefd -// other than DEBUG and/or called less often? -// -// TBD: Should this "population checker" be expanded to a comprehensive tree -// checker? It currently detects invalid LEAFW/JP types as well as inconsistent -// pop1s. Other possible checks, all based on essentially redundant data in -// the Judy tree, include: -// -// - Zero LS bits in jp_Addr field. -// -// - Correct Dcd bits. -// -// - Consistent JP types (always descending down the tree). -// -// - Sorted linear lists in BranchLs and leaves (using JudyCheckSorted(), but -// ideally that function is already called wherever appropriate after any -// linear list is modified). -// -// - Any others possible? - -#include // for getenv() and atol(). - -static Word_t JudyCheckPopSM(Pjp_t Pjp, Word_t RootPop1); - -FUNCTION void JudyCheckPop( - Pvoid_t PArray) -{ -static bool_t checked = FALSE; // already checked env parameter. -static bool_t enabled = FALSE; // env parameter set. -static bool_t active = FALSE; // calls >= callsmin. -static Word_t callsmin; // start point from $CHECKPOP. -static Word_t calls = 0; // times called so far. - - -// CHECK FOR EXTERNAL ENABLING: - - if (! checked) // only check once. - { - char * value; // for getenv(). - - checked = TRUE; - - if ((value = getenv("CHECKPOP")) == (char *) NULL) - { -#ifdef notdef -// Take this out because nightly tests want to be flavor-independent; its not -// OK to emit special non-error output from the debug flavor: - - (void) puts("JudyCheckPop() present but not enabled by " - "$CHECKPOP env parameter; set it to the number of " - "calls at which to begin checking"); -#endif - return; - } - - callsmin = atol(value); // note: non-number evaluates to 0. - enabled = TRUE; - - (void) printf("JudyCheckPop() present and enabled; callsmin = " - "%lu\n", callsmin); - } - else if (! enabled) return; - -// Previously or just now enabled; check if non-active or newly active: - - if (! active) - { - if (++calls < callsmin) return; - - (void) printf("JudyCheckPop() activated at call %lu\n", calls); - active = TRUE; - } - -// IGNORE LEAFW AT TOP OF TREE: - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - return; - -// Check JPM pop0 against tree, recursively: -// -// Note: The traversal code in JudyCheckPopSM() is simplest when the case -// statement for each JP type compares the pop1 for that JP to its subtree (if -// any) after traversing the subtree (thats the hard part) and adding up -// actual pop1s. A top branchs JP in the JPM does not have room for a -// full-word pop1, so pass it in as a special case. - - { - Pjpm_t Pjpm = P_JPM(PArray); - (void) JudyCheckPopSM(&(Pjpm->jpm_JP), Pjpm->jpm_Pop0 + 1); - return; - } - -} // JudyCheckPop() - - -// **************************************************************************** -// J U D Y C H E C K P O P S M -// -// Recursive state machine (subroutine) for JudyCheckPop(): Given a Pjp (other -// than JPNULL*; caller should shortcut) and the root population for top-level -// branches, check the subtrees actual pop1 against its nominal value, and -// return the total pop1 for the subtree. -// -// Note: Expect RootPop1 to be ignored at lower levels, so pass down 0, which -// should pop an assertion if this expectation is violated. - -FUNCTION static Word_t JudyCheckPopSM( - Pjp_t Pjp, // top of subtree. - Word_t RootPop1) // whole array, for top-level branches only. -{ - Word_t pop1_jp; // nominal population from the JP. - Word_t pop1 = 0; // actual population at this level. - Word_t offset; // in a branch. - -#define PREPBRANCH(cPopBytes,Next) \ - pop1_jp = JU_JPBRANCH_POP0(Pjp, cPopBytes) + 1; goto Next - -assert((((Word_t) (Pjp->jp_Addr)) & 7) == 3); - switch (JU_JPTYPE(Pjp)) - { - - case cJU_JPBRANCH_L2: PREPBRANCH(2, BranchL); - case cJU_JPBRANCH_L3: PREPBRANCH(3, BranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: PREPBRANCH(4, BranchL); - case cJU_JPBRANCH_L5: PREPBRANCH(5, BranchL); - case cJU_JPBRANCH_L6: PREPBRANCH(6, BranchL); - case cJU_JPBRANCH_L7: PREPBRANCH(7, BranchL); -#endif - case cJU_JPBRANCH_L: pop1_jp = RootPop1; - { - Pjbl_t Pjbl; -BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - - for (offset = 0; offset < (Pjbl->jbl_NumJPs); ++offset) - pop1 += JudyCheckPopSM((Pjbl->jbl_jp) + offset, 0); - - assert(pop1_jp == pop1); - return(pop1); - } - - case cJU_JPBRANCH_B2: PREPBRANCH(2, BranchB); - case cJU_JPBRANCH_B3: PREPBRANCH(3, BranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: PREPBRANCH(4, BranchB); - case cJU_JPBRANCH_B5: PREPBRANCH(5, BranchB); - case cJU_JPBRANCH_B6: PREPBRANCH(6, BranchB); - case cJU_JPBRANCH_B7: PREPBRANCH(7, BranchB); -#endif - case cJU_JPBRANCH_B: pop1_jp = RootPop1; - { - Word_t subexp; - Word_t jpcount; - Pjbb_t Pjbb; -BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - - for (offset = 0; offset < jpcount; ++offset) - { - pop1 += JudyCheckPopSM(P_JP(JU_JBB_PJP(Pjbb, subexp)) - + offset, 0); - } - } - - assert(pop1_jp == pop1); - return(pop1); - } - - case cJU_JPBRANCH_U2: PREPBRANCH(2, BranchU); - case cJU_JPBRANCH_U3: PREPBRANCH(3, BranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: PREPBRANCH(4, BranchU); - case cJU_JPBRANCH_U5: PREPBRANCH(5, BranchU); - case cJU_JPBRANCH_U6: PREPBRANCH(6, BranchU); - case cJU_JPBRANCH_U7: PREPBRANCH(7, BranchU); -#endif - case cJU_JPBRANCH_U: pop1_jp = RootPop1; - { - Pjbu_t Pjbu; -BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - - for (offset = 0; offset < cJU_BRANCHUNUMJPS; ++offset) - { - if (((Pjbu->jbu_jp[offset].jp_Type) >= cJU_JPNULL1) - && ((Pjbu->jbu_jp[offset].jp_Type) <= cJU_JPNULLMAX)) - { - continue; // skip null JP to save time. - } - - pop1 += JudyCheckPopSM((Pjbu->jbu_jp) + offset, 0); - } - - assert(pop1_jp == pop1); - return(pop1); - } - - -// -- Cases below here terminate and do not recurse. -- -// -// For all of these cases except JPLEAF_B1, there is no way to check the JPs -// pop1 against the object itself; just return the pop1; but for linear leaves, -// a bounds check is possible. - -#define CHECKLEAF(MaxPop1) \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - assert(pop1 >= 1); \ - assert(pop1 <= (MaxPop1)); \ - return(pop1) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKLEAF(cJU_LEAF1_MAXPOP1); -#endif - case cJU_JPLEAF2: CHECKLEAF(cJU_LEAF2_MAXPOP1); - case cJU_JPLEAF3: CHECKLEAF(cJU_LEAF3_MAXPOP1); -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKLEAF(cJU_LEAF4_MAXPOP1); - case cJU_JPLEAF5: CHECKLEAF(cJU_LEAF5_MAXPOP1); - case cJU_JPLEAF6: CHECKLEAF(cJU_LEAF6_MAXPOP1); - case cJU_JPLEAF7: CHECKLEAF(cJU_LEAF7_MAXPOP1); -#endif - - case cJU_JPLEAF_B1: - { - Word_t subexp; - Pjlb_t Pjlb; - - pop1_jp = JU_JPLEAF_POP0(Pjp) + 1; - - Pjlb = P_JLB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - pop1 += j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - - assert(pop1_jp == pop1); - return(pop1); - } - - JUDY1CODE(case cJ1_JPFULLPOPU1: return(cJU_JPFULLPOPU1_POP0);) - - case cJU_JPIMMED_1_01: return(1); - case cJU_JPIMMED_2_01: return(1); - case cJU_JPIMMED_3_01: return(1); -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: return(1); - case cJU_JPIMMED_5_01: return(1); - case cJU_JPIMMED_6_01: return(1); - case cJU_JPIMMED_7_01: return(1); -#endif - - case cJU_JPIMMED_1_02: return(2); - case cJU_JPIMMED_1_03: return(3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: return(4); - case cJU_JPIMMED_1_05: return(5); - case cJU_JPIMMED_1_06: return(6); - case cJU_JPIMMED_1_07: return(7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: return(8); - case cJ1_JPIMMED_1_09: return(9); - case cJ1_JPIMMED_1_10: return(10); - case cJ1_JPIMMED_1_11: return(11); - case cJ1_JPIMMED_1_12: return(12); - case cJ1_JPIMMED_1_13: return(13); - case cJ1_JPIMMED_1_14: return(14); - case cJ1_JPIMMED_1_15: return(15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: return(2); - case cJU_JPIMMED_2_03: return(3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: return(4); - case cJ1_JPIMMED_2_05: return(5); - case cJ1_JPIMMED_2_06: return(6); - case cJ1_JPIMMED_2_07: return(7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: return(2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: return(3); - case cJ1_JPIMMED_3_04: return(4); - case cJ1_JPIMMED_3_05: return(5); - - case cJ1_JPIMMED_4_02: return(2); - case cJ1_JPIMMED_4_03: return(3); - case cJ1_JPIMMED_5_02: return(2); - case cJ1_JPIMMED_5_03: return(3); - case cJ1_JPIMMED_6_02: return(2); - case cJ1_JPIMMED_7_02: return(2); -#endif - - } // switch (JU_JPTYPE(Pjp)) - - assert(FALSE); // unrecognized JP type => corruption. - return(0); // to make some compilers happy. - -} // JudyCheckPopSM() - -#endif // DEBUG -#endif // ! JUDYGETINLINE diff --git a/libjudy/src/JudyCommon/JudyByCount.c b/libjudy/src/JudyCommon/JudyByCount.c deleted file mode 100644 index 40caf89b74..0000000000 --- a/libjudy/src/JudyCommon/JudyByCount.c +++ /dev/null @@ -1,954 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.28 $ $Source: /judy/src/JudyCommon/JudyByCount.c $ -// -// Judy*ByCount() function for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DNOSMARTJBB, -DNOSMARTJBU, and/or -DNOSMARTJLB to build a -// version with cache line optimizations deleted, for testing. -// -// Judy*ByCount() is a conceptual although not literal inverse of Judy*Count(). -// Judy*Count() takes a pair of Indexes, and allows finding the ordinal of a -// given Index (that is, its position in the list of valid indexes from the -// beginning) as a degenerate case, because in general the count between two -// Indexes, inclusive, is not always just the difference in their ordinals. -// However, it suffices for Judy*ByCount() to simply be an ordinal-to-Index -// mapper. -// -// Note: Like Judy*Count(), this code must "count sideways" in branches, which -// can result in a lot of cache line fills. However, unlike Judy*Count(), this -// code does not receive a specific Index, hence digit, where to start in each -// branch, so it cant accurately calculate cache line fills required in each -// direction. The best it can do is an approximation based on the total -// population of the expanse (pop1 from Pjp) and the ordinal of the target -// Index (see SETOFFSET()) within the expanse. -// -// Compile with -DSMARTMETRICS to obtain global variables containing smart -// cache line metrics. Note: Dont turn this on simultaneously for this file -// and JudyCount.c because they export the same globals. -// **************************************************************************** - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -// These are imported from JudyCount.c: -// -// TBD: Should this be in common code? Exported from a header file? - -#ifdef JUDY1 -extern Word_t j__udy1JPPop1(const Pjp_t Pjp); -#define j__udyJPPop1 j__udy1JPPop1 -#else -extern Word_t j__udyLJPPop1(const Pjp_t Pjp); -#define j__udyJPPop1 j__udyLJPPop1 -#endif - -// Avoid duplicate symbols since this file is multi-compiled: - -#ifdef SMARTMETRICS -#ifdef JUDY1 -Word_t jbb_upward = 0; // counts of directions taken: -Word_t jbb_downward = 0; -Word_t jbu_upward = 0; -Word_t jbu_downward = 0; -Word_t jlb_upward = 0; -Word_t jlb_downward = 0; -#else -extern Word_t jbb_upward; -extern Word_t jbb_downward; -extern Word_t jbu_upward; -extern Word_t jbu_downward; -extern Word_t jlb_upward; -extern Word_t jlb_downward; -#endif -#endif - - -// **************************************************************************** -// J U D Y 1 B Y C O U N T -// J U D Y L B Y C O U N T -// -// See the manual entry. - -#ifdef JUDY1 -FUNCTION int Judy1ByCount -#else -FUNCTION PPvoid_t JudyLByCount -#endif - ( - Pcvoid_t PArray, // root pointer to first branch/leaf in SM. - Word_t Count, // ordinal of Index to find, 1..MAX. - Word_t * PIndex, // to return found Index. - PJError_t PJError // optional, for returning error info. - ) -{ - Word_t Count0; // Count, base-0, to match pop0. - Word_t state; // current state in SM. - Word_t pop1; // of current branch or leaf, or of expanse. - Word_t pop1lower; // pop1 of expanses (JPs) below that for Count. - Word_t digit; // current word in branch. - Word_t jpcount; // JPs in a BranchB subexpanse. - long jpnum; // JP number in a branch (base 0). - long subexp; // for stepping through layer 1 (subexpanses). - int offset; // index ordinal within a leaf, base 0. - - Pjp_t Pjp; // current JP in branch. - Pjll_t Pjll; // current Judy linear leaf. - - -// CHECK FOR EMPTY ARRAY OR NULL PINDEX: - - if (PArray == (Pvoid_t) NULL) JU_RET_NOTFOUND; - - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -// Convert Count to Count0; assume special case of Count = 0 maps to ~0, as -// desired, to represent the last index in a full array: -// -// Note: Think of Count0 as a reliable "number of Indexes below the target." - - Count0 = Count - 1; - assert((Count || Count0 == ~0)); // ensure CPU is sane about 0 - 1. - pop1lower = 0; - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - - if (Count0 > Pjlw[0]) JU_RET_NOTFOUND; // too high. - - *PIndex = Pjlw[Count]; // Index, base 1. - - JU_RET_FOUND_LEAFW(Pjlw, Pjlw[0] + 1, Count0); - } - else - { - Pjpm_t Pjpm = P_JPM(PArray); - - if (Count0 > (Pjpm->jpm_Pop0)) JU_RET_NOTFOUND; // too high. - - Pjp = &(Pjpm->jpm_JP); - pop1 = (Pjpm->jpm_Pop0) + 1; - -// goto SMByCount; - } - -// COMMON CODE: -// -// Prepare to handle a root-level or lower-level branch: Save the current -// state, obtain the total population for the branch in a state-dependent way, -// and then branch to common code for multiple cases. -// -// For root-level branches, the state is always cJU_ROOTSTATE, and the array -// population must already be set in pop1; it is not available in jp_DcdPopO. -// -// Note: The total population is only needed in cases where the common code -// "counts down" instead of up to minimize cache line fills. However, its -// available cheaply, and its better to do it with a constant shift (constant -// state value) instead of a variable shift later "when needed". - -#define PREPB_ROOT(Next) \ - state = cJU_ROOTSTATE; \ - goto Next - -// Use PREPB_DCD() to first copy the Dcd bytes to *PIndex if there are any -// (only if state < cJU_ROOTSTATE - 1): - -#define PREPB_DCD(Pjp,cState,Next) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - PREPB((Pjp), cState, Next) - -#define PREPB(Pjp,cState,Next) \ - state = (cState); \ - pop1 = JU_JPBRANCH_POP0(Pjp, (cState)) + 1; \ - goto Next - -// Calculate whether the ordinal of an Index within a given expanse falls in -// the lower or upper half of the expanses population, taking care with -// unsigned math and boundary conditions: -// -// Note: Assume the ordinal falls within the expanses population, that is, -// 0 < (Count - Pop1lower) <= Pop1exp (assuming infinite math). -// -// Note: If the ordinal is the middle element, it doesnt matter whether -// LOWERHALF() is TRUE or FALSE. - -#define LOWERHALF(Count0,Pop1lower,Pop1exp) \ - (((Count0) - (Pop1lower)) < ((Pop1exp) / 2)) - -// Calculate the (signed) offset within a leaf to the desired ordinal (Count - -// Pop1lower; offset is one less), and optionally ensure its in range: - -#define SETOFFSET(Offset,Count0,Pop1lower,Pjp) \ - (Offset) = (Count0) - (Pop1lower); \ - assert((Offset) >= 0); \ - assert((Offset) <= JU_JPLEAF_POP0(Pjp)) - -// Variations for immediate indexes, with and without pop1-specific assertions: - -#define SETOFFSET_IMM_CK(Offset,Count0,Pop1lower,cPop1) \ - (Offset) = (Count0) - (Pop1lower); \ - assert((Offset) >= 0); \ - assert((Offset) < (cPop1)) - -#define SETOFFSET_IMM(Offset,Count0,Pop1lower) \ - (Offset) = (Count0) - (Pop1lower) - - -// STATE MACHINE -- TRAVERSE TREE: -// -// In branches, look for the expanse (digit), if any, where the total pop1 -// below or at that expanse would meet or exceed Count, meaning the Index must -// be in this expanse. - -SMByCount: // return here for next branch/leaf. - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH; count populations in JPs in the JBL upwards until finding the -// expanse (digit) containing Count, and "recurse". -// -// Note: There are no null JPs in a JBL; watch out for pop1 == 0. -// -// Note: A JBL should always fit in one cache line => no need to count up -// versus down to save cache line fills. -// -// TBD: The previous is no longer true. Consider enhancing this code to count -// up/down, but it can wait for a later tuning phase. In the meantime, PREPB() -// sets pop1 for the whole array, but that value is not used here. 001215: -// Maybe its true again? - - case cJU_JPBRANCH_L2: PREPB_DCD(Pjp, 2, BranchL); -#ifndef JU_64BIT - case cJU_JPBRANCH_L3: PREPB( Pjp, 3, BranchL); -#else - case cJU_JPBRANCH_L3: PREPB_DCD(Pjp, 3, BranchL); - case cJU_JPBRANCH_L4: PREPB_DCD(Pjp, 4, BranchL); - case cJU_JPBRANCH_L5: PREPB_DCD(Pjp, 5, BranchL); - case cJU_JPBRANCH_L6: PREPB_DCD(Pjp, 6, BranchL); - case cJU_JPBRANCH_L7: PREPB( Pjp, 7, BranchL); -#endif - case cJU_JPBRANCH_L: PREPB_ROOT( BranchL); - { - Pjbl_t Pjbl; - -// Common code (state-independent) for all cases of linear branches: - -BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - - for (jpnum = 0; jpnum < (Pjbl->jbl_NumJPs); ++jpnum) - { - if ((pop1 = j__udyJPPop1((Pjbl->jbl_jp) + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, so do not subtract 1 and compare -// >=, but instead use the following expression: - - if (pop1lower + pop1 > Count0) // Index is in this expanse. - { - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[jpnum], state); - Pjp = (Pjbl->jbl_jp) + jpnum; - goto SMByCount; // look under this expanse. - } - - pop1lower += pop1; // add this JPs pop1. - } - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // should never get here. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // case cJU_JPBRANCH_L - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH; count populations in JPs in the JBB upwards or downwards -// until finding the expanse (digit) containing Count, and "recurse". -// -// Note: There are no null JPs in a JBB; watch out for pop1 == 0. - - case cJU_JPBRANCH_B2: PREPB_DCD(Pjp, 2, BranchB); -#ifndef JU_64BIT - case cJU_JPBRANCH_B3: PREPB( Pjp, 3, BranchB); -#else - case cJU_JPBRANCH_B3: PREPB_DCD(Pjp, 3, BranchB); - case cJU_JPBRANCH_B4: PREPB_DCD(Pjp, 4, BranchB); - case cJU_JPBRANCH_B5: PREPB_DCD(Pjp, 5, BranchB); - case cJU_JPBRANCH_B6: PREPB_DCD(Pjp, 6, BranchB); - case cJU_JPBRANCH_B7: PREPB( Pjp, 7, BranchB); -#endif - case cJU_JPBRANCH_B: PREPB_ROOT( BranchB); - { - Pjbb_t Pjbb; - -// Common code (state-independent) for all cases of bitmap branches: - -BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - -// Shorthand for one subexpanse in a bitmap and for one JP in a bitmap branch: -// -// Note: BMPJP0 exists separately to support assertions. - -#define BMPJP0(Subexp) (P_JP(JU_JBB_PJP(Pjbb, Subexp))) -#define BMPJP(Subexp,JPnum) (BMPJP0(Subexp) + (JPnum)) - - -// Common code for descending through a JP: -// -// Determine the digit for the expanse and save it in *PIndex; then "recurse". - -#define JBB_FOUNDEXPANSE \ - { \ - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb,subexp), jpnum); \ - JU_SETDIGIT(*PIndex, digit, state); \ - Pjp = BMPJP(subexp, jpnum); \ - goto SMByCount; \ - } - - -#ifndef NOSMARTJBB // enable to turn off smart code for comparison purposes. - -// FIGURE OUT WHICH DIRECTION CAUSES FEWER CACHE LINE FILLS; adding the pop1s -// in JPs upwards, or subtracting the pop1s in JPs downwards: -// -// See header comments about limitations of this for Judy*ByCount(). - -#endif - -// COUNT UPWARD, adding each "below" JPs pop1: - -#ifndef NOSMARTJBB // enable to turn off smart code for comparison purposes. - - if (LOWERHALF(Count0, pop1lower, pop1)) - { -#endif -#ifdef SMARTMETRICS - ++jbb_upward; -#endif - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - if ((jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb,subexp))) - && (BMPJP0(subexp) == (Pjp_t) NULL)) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // null ptr. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -// Note: An empty subexpanse (jpcount == 0) is handled "for free": - - for (jpnum = 0; jpnum < jpcount; ++jpnum) - { - if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum))) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - if (pop1lower + pop1 > Count0) - JBB_FOUNDEXPANSE; // Index is in this expanse. - - pop1lower += pop1; // add this JPs pop1. - } - } -#ifndef NOSMARTJBB // enable to turn off smart code for comparison purposes. - } - - -// COUNT DOWNWARD, subtracting each "above" JPs pop1 from the whole expanses -// pop1: - - else - { -#ifdef SMARTMETRICS - ++jbb_downward; -#endif - pop1lower += pop1; // add whole branch to start. - - for (subexp = cJU_NUMSUBEXPB - 1; subexp >= 0; --subexp) - { - if ((jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp))) - && (BMPJP0(subexp) == (Pjp_t) NULL)) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // null ptr. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -// Note: An empty subexpanse (jpcount == 0) is handled "for free": - - for (jpnum = jpcount - 1; jpnum >= 0; --jpnum) - { - if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum))) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - pop1lower -= pop1; - -// Beware unsigned math problems: - - if ((pop1lower == 0) || (pop1lower - 1 < Count0)) - JBB_FOUNDEXPANSE; // Index is in this expanse. - } - } - } -#endif // NOSMARTJBB - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // should never get here. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // case cJU_JPBRANCH_B - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH; count populations in JPs in the JBU upwards or -// downwards until finding the expanse (digit) containing Count, and "recurse". - - case cJU_JPBRANCH_U2: PREPB_DCD(Pjp, 2, BranchU); -#ifndef JU_64BIT - case cJU_JPBRANCH_U3: PREPB( Pjp, 3, BranchU); -#else - case cJU_JPBRANCH_U3: PREPB_DCD(Pjp, 3, BranchU); - case cJU_JPBRANCH_U4: PREPB_DCD(Pjp, 4, BranchU); - case cJU_JPBRANCH_U5: PREPB_DCD(Pjp, 5, BranchU); - case cJU_JPBRANCH_U6: PREPB_DCD(Pjp, 6, BranchU); - case cJU_JPBRANCH_U7: PREPB( Pjp, 7, BranchU); -#endif - case cJU_JPBRANCH_U: PREPB_ROOT( BranchU); - { - Pjbu_t Pjbu; - -// Common code (state-independent) for all cases of uncompressed branches: - -BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - -// Common code for descending through a JP: -// -// Save the digit for the expanse in *PIndex, then "recurse". - -#define JBU_FOUNDEXPANSE \ - { \ - JU_SETDIGIT(*PIndex, jpnum, state); \ - Pjp = (Pjbu->jbu_jp) + jpnum; \ - goto SMByCount; \ - } - - -#ifndef NOSMARTJBU // enable to turn off smart code for comparison purposes. - -// FIGURE OUT WHICH DIRECTION CAUSES FEWER CACHE LINE FILLS; adding the pop1s -// in JPs upwards, or subtracting the pop1s in JPs downwards: -// -// See header comments about limitations of this for Judy*ByCount(). - -#endif - -// COUNT UPWARD, simply adding the pop1 of each JP: - -#ifndef NOSMARTJBU // enable to turn off smart code for comparison purposes. - - if (LOWERHALF(Count0, pop1lower, pop1)) - { -#endif -#ifdef SMARTMETRICS - ++jbu_upward; -#endif - - for (jpnum = 0; jpnum < cJU_BRANCHUNUMJPS; ++jpnum) - { - // shortcut, save a function call: - - if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX) - continue; - - if ((pop1 = j__udyJPPop1((Pjbu->jbu_jp) + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - if (pop1lower + pop1 > Count0) - JBU_FOUNDEXPANSE; // Index is in this expanse. - - pop1lower += pop1; // add this JPs pop1. - } -#ifndef NOSMARTJBU // enable to turn off smart code for comparison purposes. - } - - -// COUNT DOWNWARD, subtracting the pop1 of each JP above from the whole -// expanses pop1: - - else - { -#ifdef SMARTMETRICS - ++jbu_downward; -#endif - pop1lower += pop1; // add whole branch to start. - - for (jpnum = cJU_BRANCHUNUMJPS - 1; jpnum >= 0; --jpnum) - { - // shortcut, save a function call: - - if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX) - continue; - - if ((pop1 = j__udyJPPop1(Pjbu->jbu_jp + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - pop1lower -= pop1; - -// Beware unsigned math problems: - - if ((pop1lower == 0) || (pop1lower - 1 < Count0)) - JBU_FOUNDEXPANSE; // Index is in this expanse. - } - } -#endif // NOSMARTJBU - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // should never get here. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // case cJU_JPBRANCH_U - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Return the Index at the proper ordinal (see SETOFFSET()) in the leaf. First -// copy Dcd bytes, if there are any (only if state < cJU_ROOTSTATE - 1), to -// *PIndex. -// -// Note: The preceding branch traversal code MIGHT set pop1 for this expanse -// (linear leaf) as a side-effect, but dont depend on that (for JUDYL, which -// is the only cases that need it anyway). - -#define PREPL_DCD(cState) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - PREPL - -#ifdef JUDY1 -#define PREPL_SETPOP1 // not needed in any cases. -#else -#define PREPL_SETPOP1 pop1 = JU_JPLEAF_POP0(Pjp) + 1 -#endif - -#define PREPL \ - Pjll = P_JLL(Pjp->jp_Addr); \ - PREPL_SETPOP1; \ - SETOFFSET(offset, Count0, pop1lower, Pjp) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - PREPL_DCD(1); - JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]); - JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - - case cJU_JPLEAF2: - - PREPL_DCD(2); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - -#ifndef JU_64BIT - case cJU_JPLEAF3: - { - Word_t lsb; - PREPL; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - -#else - case cJU_JPLEAF3: - { - Word_t lsb; - PREPL_DCD(3); - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - - case cJU_JPLEAF4: - - PREPL_DCD(4); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - - case cJU_JPLEAF5: - { - Word_t lsb; - PREPL_DCD(5); - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - } - - case cJU_JPLEAF6: - { - Word_t lsb; - PREPL_DCD(6); - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - } - - case cJU_JPLEAF7: - { - Word_t lsb; - PREPL; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_LEAF7(Pjll, pop1, offset); - } -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Return the Index at the proper ordinal (see SETOFFSET()) in the leaf by -// counting bits. First copy Dcd bytes (always present since state 1 < -// cJU_ROOTSTATE) to *PIndex. -// -// Note: The preceding branch traversal code MIGHT set pop1 for this expanse -// (bitmap leaf) as a side-effect, but dont depend on that. - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; - - JU_SETDCD(*PIndex, Pjp, 1); - Pjlb = P_JLB(Pjp->jp_Addr); - pop1 = JU_JPLEAF_POP0(Pjp) + 1; - -// COUNT UPWARD, adding the pop1 of each subexpanse: -// -// The entire bitmap should fit in one cache line, but still try to save some -// CPU time by counting the fewest possible number of subexpanses from the -// bitmap. -// -// See header comments about limitations of this for Judy*ByCount(). - -#ifndef NOSMARTJLB // enable to turn off smart code for comparison purposes. - - if (LOWERHALF(Count0, pop1lower, pop1)) - { -#endif -#ifdef SMARTMETRICS - ++jlb_upward; -#endif - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - { - pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - if (pop1lower + pop1 > Count0) - goto LeafB1; // Index is in this subexpanse. - - pop1lower += pop1; // add this subexpanses pop1. - } -#ifndef NOSMARTJLB // enable to turn off smart code for comparison purposes. - } - - -// COUNT DOWNWARD, subtracting each "above" subexpanses pop1 from the whole -// expanses pop1: - - else - { -#ifdef SMARTMETRICS - ++jlb_downward; -#endif - pop1lower += pop1; // add whole leaf to start. - - for (subexp = cJU_NUMSUBEXPL - 1; subexp >= 0; --subexp) - { - pop1lower -= j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - -// Beware unsigned math problems: - - if ((pop1lower == 0) || (pop1lower - 1 < Count0)) - goto LeafB1; // Index is in this subexpanse. - } - } -#endif // NOSMARTJLB - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // should never get here. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - -// RETURN INDEX FOUND: -// -// Come here with subexp set to the correct subexpanse, and pop1lower set to -// the sum for all lower expanses and subexpanses in the Judy tree. Calculate -// and save in *PIndex the digit corresponding to the ordinal in this -// subexpanse. - -LeafB1: - SETOFFSET(offset, Count0, pop1lower, Pjp); - JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset); - JU_SETDIGIT1(*PIndex, digit); - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + offset)) - - } // case cJU_JPLEAF_B1 - - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// Copy Dcd bytes (always present since state 1 < cJU_ROOTSTATE) to *PIndex, -// then set the appropriate digit for the ordinal (see SETOFFSET()) in the leaf -// as the LSB in *PIndex. - - case cJ1_JPFULLPOPU1: - - JU_SETDCD(*PIndex, Pjp, 1); - SETOFFSET(offset, Count0, pop1lower, Pjp); - assert(offset >= 0); - assert(offset <= cJU_JPFULLPOPU1_POP0); - JU_SETDIGIT1(*PIndex, offset); - JU_RET_FOUND_FULLPOPU1; -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: -// -// Locate the Index with the proper ordinal (see SETOFFSET()) in the Immediate, -// depending on leaf Index Size and pop1. Note: There are no Dcd bytes in an -// Immediate JP, but in a cJU_JPIMMED_*_01 JP, the field holds the least bytes -// of the immediate Index. - -#define SET_01(cState) JU_SETDIGITS(*PIndex, JU_JPDCDPOP0(Pjp), cState) - - case cJU_JPIMMED_1_01: SET_01(1); goto Imm_01; - case cJU_JPIMMED_2_01: SET_01(2); goto Imm_01; - case cJU_JPIMMED_3_01: SET_01(3); goto Imm_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: SET_01(4); goto Imm_01; - case cJU_JPIMMED_5_01: SET_01(5); goto Imm_01; - case cJU_JPIMMED_6_01: SET_01(6); goto Imm_01; - case cJU_JPIMMED_7_01: SET_01(7); goto Imm_01; -#endif - -Imm_01: - - DBGCODE(SETOFFSET_IMM_CK(offset, Count0, pop1lower, 1);) - JU_RET_FOUND_IMM_01(Pjp); - -// Shorthand for where to find start of Index bytes array: - -#ifdef JUDY1 -#define PJI (Pjp->jp_1Index) -#else -#define PJI (Pjp->jp_LIndex) -#endif - -// Optional code to check the remaining ordinal (see SETOFFSET_IMM()) against -// the Index Size of the Immediate: - -#ifndef DEBUG // simple placeholder: -#define IMM(cPop1,Next) \ - goto Next -#else // extra pop1-specific checking: -#define IMM(cPop1,Next) \ - SETOFFSET_IMM_CK(offset, Count0, pop1lower, cPop1); \ - goto Next -#endif - - case cJU_JPIMMED_1_02: IMM( 2, Imm1); - case cJU_JPIMMED_1_03: IMM( 3, Imm1); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: IMM( 4, Imm1); - case cJU_JPIMMED_1_05: IMM( 5, Imm1); - case cJU_JPIMMED_1_06: IMM( 6, Imm1); - case cJU_JPIMMED_1_07: IMM( 7, Imm1); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: IMM( 8, Imm1); - case cJ1_JPIMMED_1_09: IMM( 9, Imm1); - case cJ1_JPIMMED_1_10: IMM(10, Imm1); - case cJ1_JPIMMED_1_11: IMM(11, Imm1); - case cJ1_JPIMMED_1_12: IMM(12, Imm1); - case cJ1_JPIMMED_1_13: IMM(13, Imm1); - case cJ1_JPIMMED_1_14: IMM(14, Imm1); - case cJ1_JPIMMED_1_15: IMM(15, Imm1); -#endif - -Imm1: SETOFFSET_IMM(offset, Count0, pop1lower); - JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]); - JU_RET_FOUND_IMM(Pjp, offset); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: IMM(2, Imm2); - case cJU_JPIMMED_2_03: IMM(3, Imm2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: IMM(4, Imm2); - case cJ1_JPIMMED_2_05: IMM(5, Imm2); - case cJ1_JPIMMED_2_06: IMM(6, Imm2); - case cJ1_JPIMMED_2_07: IMM(7, Imm2); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -Imm2: SETOFFSET_IMM(offset, Count0, pop1lower); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: IMM(2, Imm3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: IMM(3, Imm3); - case cJ1_JPIMMED_3_04: IMM(4, Imm3); - case cJ1_JPIMMED_3_05: IMM(5, Imm3); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -Imm3: - { - Word_t lsb; - SETOFFSET_IMM(offset, Count0, pop1lower); - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: IMM(2, Imm4); - case cJ1_JPIMMED_4_03: IMM(3, Imm4); - -Imm4: SETOFFSET_IMM(offset, Count0, pop1lower); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); - - case cJ1_JPIMMED_5_02: IMM(2, Imm5); - case cJ1_JPIMMED_5_03: IMM(3, Imm5); - -Imm5: - { - Word_t lsb; - SETOFFSET_IMM(offset, Count0, pop1lower); - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_6_02: IMM(2, Imm6); - -Imm6: - { - Word_t lsb; - SETOFFSET_IMM(offset, Count0, pop1lower); - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_7_02: IMM(2, Imm7); - -Imm7: - { - Word_t lsb; - SETOFFSET_IMM(offset, Count0, pop1lower); - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif // (JUDY1 && JU_64BIT) - - -// ---------------------------------------------------------------------------- -// UNEXPECTED JP TYPES: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SMByCount switch. - - /*NOTREACHED*/ - -} // Judy1ByCount() / JudyLByCount() diff --git a/libjudy/src/JudyCommon/JudyCascade.c b/libjudy/src/JudyCommon/JudyCascade.c deleted file mode 100644 index 998a9d727f..0000000000 --- a/libjudy/src/JudyCommon/JudyCascade.c +++ /dev/null @@ -1,1942 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.38 $ $Source: /judy/src/JudyCommon/JudyCascade.c $ - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -extern int j__udyCreateBranchL(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); -extern int j__udyCreateBranchB(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); - -DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);) - -static const jbb_t StageJBBZero; // zeroed versions of namesake struct. - -// TBD: There are multiple copies of (some of) these CopyWto3, Copy3toW, -// CopyWto7 and Copy7toW functions in Judy1Cascade.c, JudyLCascade.c, and -// JudyDecascade.c. These static functions should probably be moved to a -// common place, made macros, or something to avoid having four copies. - - -// **************************************************************************** -// __ J U D Y C O P Y X T O W - - -FUNCTION static void j__udyCopy3toW( - PWord_t PDest, - uint8_t * PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY3_PINDEX_TO_LONG(*PDest, PSrc); - PSrc += 3; - PDest += 1; - - } while(--LeafIndexes); - -} //j__udyCopy3toW() - - -#ifdef JU_64BIT - -FUNCTION static void j__udyCopy4toW( - PWord_t PDest, - uint32_t * PSrc, - Word_t LeafIndexes) -{ - do { *PDest++ = *PSrc++; - } while(--LeafIndexes); - -} // j__udyCopy4toW() - - -FUNCTION static void j__udyCopy5toW( - PWord_t PDest, - uint8_t * PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY5_PINDEX_TO_LONG(*PDest, PSrc); - PSrc += 5; - PDest += 1; - - } while(--LeafIndexes); - -} // j__udyCopy5toW() - - -FUNCTION static void j__udyCopy6toW( - PWord_t PDest, - uint8_t * PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY6_PINDEX_TO_LONG(*PDest, PSrc); - PSrc += 6; - PDest += 1; - - } while(--LeafIndexes); - -} // j__udyCopy6toW() - - -FUNCTION static void j__udyCopy7toW( - PWord_t PDest, - uint8_t * PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY7_PINDEX_TO_LONG(*PDest, PSrc); - PSrc += 7; - PDest += 1; - - } while(--LeafIndexes); - -} // j__udyCopy7toW() - -#endif // JU_64BIT - - -// **************************************************************************** -// __ J U D Y C O P Y W T O X - - -FUNCTION static void j__udyCopyWto3( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY3_LONG_TO_PINDEX(PDest, *PSrc); - PSrc += 1; - PDest += 3; - - } while(--LeafIndexes); - -} // j__udyCopyWto3() - - -#ifdef JU_64BIT - -FUNCTION static void j__udyCopyWto4( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - uint32_t *PDest32 = (uint32_t *)PDest; - - do - { - *PDest32 = *PSrc; - PSrc += 1; - PDest32 += 1; - } while(--LeafIndexes); - -} // j__udyCopyWto4() - - -FUNCTION static void j__udyCopyWto5( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY5_LONG_TO_PINDEX(PDest, *PSrc); - PSrc += 1; - PDest += 5; - - } while(--LeafIndexes); - -} // j__udyCopyWto5() - - -FUNCTION static void j__udyCopyWto6( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY6_LONG_TO_PINDEX(PDest, *PSrc); - PSrc += 1; - PDest += 6; - - } while(--LeafIndexes); - -} // j__udyCopyWto6() - - -FUNCTION static void j__udyCopyWto7( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY7_LONG_TO_PINDEX(PDest, *PSrc); - PSrc += 1; - PDest += 7; - - } while(--LeafIndexes); - -} // j__udyCopyWto7() - -#endif // JU_64BIT - - -// **************************************************************************** -// COMMON CODE (MACROS): -// -// Free objects in an array of valid JPs, StageJP[ExpCnt] == last one may -// include Immeds, which are ignored. - -#define FREEALLEXIT(ExpCnt,StageJP,Pjpm) \ - { \ - Word_t _expct = (ExpCnt); \ - while (_expct--) j__udyFreeSM(&((StageJP)[_expct]), Pjpm); \ - return(-1); \ - } - -// Clear the array that keeps track of the number of JPs in a subexpanse: - -#define ZEROJP(SubJPCount) \ - { \ - int ii; \ - for (ii = 0; ii < cJU_NUMSUBEXPB; ii++) (SubJPCount[ii]) = 0; \ - } - -// **************************************************************************** -// __ J U D Y S T A G E J B B T O J B B -// -// Create a mallocd BranchB (jbb_t) from a staged BranchB while "splaying" a -// single old leaf. Return -1 if out of memory, otherwise 1. - -static int j__udyStageJBBtoJBB( - Pjp_t PjpLeaf, // JP of leaf being splayed. - Pjbb_t PStageJBB, // temp jbb_t on stack. - Pjp_t PjpArray, // array of JPs to splayed new leaves. - uint8_t * PSubCount, // count of JPs for each subexpanse. - Pjpm_t Pjpm) // the jpm_t for JudyAlloc*(). -{ - Pjbb_t PjbbRaw; // pointer to new bitmap branch. - Pjbb_t Pjbb; - Word_t subexp; - -// Get memory for new BranchB: - - if ((PjbbRaw = j__udyAllocJBB(Pjpm)) == (Pjbb_t) NULL) return(-1); - Pjbb = P_JBB(PjbbRaw); - -// Copy staged BranchB into just-allocated BranchB: - - *Pjbb = *PStageJBB; - -// Allocate the JP subarrays (BJP) for the new BranchB: - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; subexp++) - { - Pjp_t PjpRaw; - Pjp_t Pjp; - Word_t NumJP; // number of JPs in each subexpanse. - - if ((NumJP = PSubCount[subexp]) == 0) continue; // empty. - -// Out of memory, back out previous allocations: - - if ((PjpRaw = j__udyAllocJBBJP(NumJP, Pjpm)) == (Pjp_t) NULL) - { - while(subexp--) - { - if ((NumJP = PSubCount[subexp]) == 0) continue; - - PjpRaw = JU_JBB_PJP(Pjbb, subexp); - j__udyFreeJBBJP(PjpRaw, NumJP, Pjpm); - } - j__udyFreeJBB(PjbbRaw, Pjpm); - return(-1); // out of memory. - } - Pjp = P_JP(PjpRaw); - -// Place the JP subarray pointer in the new BranchB, copy subarray JPs, and -// advance to the next subexpanse: - - JU_JBB_PJP(Pjbb, subexp) = PjpRaw; - JU_COPYMEM(Pjp, PjpArray, NumJP); - PjpArray += NumJP; - - } // for each subexpanse. - -// Change the PjpLeaf from Leaf to BranchB: - - PjpLeaf->jp_Addr = (Word_t) PjbbRaw; - PjpLeaf->jp_Type += cJU_JPBRANCH_B2 - cJU_JPLEAF2; // Leaf to BranchB. - - return(1); - -} // j__udyStageJBBtoJBB() - - -// **************************************************************************** -// __ J U D Y J L L 2 T O J L B 1 -// -// Create a LeafB1 (jlb_t = JLB1) from a Leaf2 (2-byte Indexes and for JudyL, -// Word_t Values). Return NULL if out of memory, else a pointer to the new -// LeafB1. -// -// NOTE: Caller must release the Leaf2 that was passed in. - -FUNCTION static Pjlb_t j__udyJLL2toJLB1( - uint16_t * Pjll, // array of 16-bit indexes. -#ifdef JUDYL - Pjv_t Pjv, // array of associated values. -#endif - Word_t LeafPop1, // number of indexes/values. - Pvoid_t Pjpm) // jpm_t for JudyAlloc*()/JudyFree*(). -{ - Pjlb_t PjlbRaw; - Pjlb_t Pjlb; - int offset; -JUDYLCODE(int subexp;) - -// Allocate the LeafB1: - - if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL) - return((Pjlb_t) NULL); - Pjlb = P_JLB(PjlbRaw); - -// Copy Leaf2 indexes to LeafB1: - - for (offset = 0; offset < LeafPop1; ++offset) - JU_BITMAPSETL(Pjlb, Pjll[offset]); - -#ifdef JUDYL - -// Build LeafVs from bitmap: - - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - { - struct _POINTER_VALUES - { - Word_t pv_Pop1; // size of value area. - Pjv_t pv_Pjv; // raw pointer to value area. - } pv[cJU_NUMSUBEXPL]; - -// Get the population of the subexpanse, and if any, allocate a LeafV: - - pv[subexp].pv_Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - - if (pv[subexp].pv_Pop1) - { - Pjv_t Pjvnew; - -// TBD: There is an opportunity to put pop == 1 value in pointer: - - pv[subexp].pv_Pjv = j__udyLAllocJV(pv[subexp].pv_Pop1, Pjpm); - -// Upon out of memory, free all previously allocated: - - if (pv[subexp].pv_Pjv == (Pjv_t) NULL) - { - while(subexp--) - { - if (pv[subexp].pv_Pop1) - { - j__udyLFreeJV(pv[subexp].pv_Pjv, pv[subexp].pv_Pop1, - Pjpm); - } - } - j__udyFreeJLB1(PjlbRaw, Pjpm); - return((Pjlb_t) NULL); - } - - Pjvnew = P_JV(pv[subexp].pv_Pjv); - JU_COPYMEM(Pjvnew, Pjv, pv[subexp].pv_Pop1); - Pjv += pv[subexp].pv_Pop1; // advance value pointer. - -// Place raw pointer to value array in bitmap subexpanse: - - JL_JLB_PVALUE(Pjlb, subexp) = pv[subexp].pv_Pjv; - - } // populated subexpanse. - } // each subexpanse. - -#endif // JUDYL - - return(PjlbRaw); // pointer to LeafB1. - -} // j__udyJLL2toJLB1() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 1 -// -// Create bitmap leaf from 1-byte Indexes and Word_t Values. -// -// TBD: There must be a better way. -// -// Only for JudyL 32 bit: (note, unifdef disallows comment on next line) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -FUNCTION int j__udyCascade1( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - Word_t DcdP0; - uint8_t * PLeaf; - Pjlb_t PjlbRaw; - Pjlb_t Pjlb; - Word_t Pop1; - Word_t ii; // temp for loop counter -JUDYLCODE(Pjv_t Pjv;) - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF1); - assert((JU_JPDCDPOP0(Pjp) & 0xFF) == (cJU_LEAF1_MAXPOP1-1)); - - PjlbRaw = j__udyAllocJLB1(Pjpm); - if (PjlbRaw == (Pjlb_t) NULL) return(-1); - - Pjlb = P_JLB(PjlbRaw); - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - - JUDYLCODE(Pjv = JL_LEAF1VALUEAREA(PLeaf, Pop1);) - -// Copy 1 byte index Leaf to bitmap Leaf - for (ii = 0; ii < Pop1; ii++) JU_BITMAPSETL(Pjlb, PLeaf[ii]); - -#ifdef JUDYL -// Build 8 subexpanse Value leaves from bitmap - for (ii = 0; ii < cJU_NUMSUBEXPL; ii++) - { -// Get number of Indexes in subexpanse - if ((Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, ii)))) - { - Pjv_t PjvnewRaw; // value area of new leaf. - Pjv_t Pjvnew; - - PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm); - if (PjvnewRaw == (Pjv_t) NULL) // out of memory. - { -// Free prevously allocated LeafVs: - while(ii--) - { - if ((Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, ii)))) - { - PjvnewRaw = JL_JLB_PVALUE(Pjlb, ii); - j__udyLFreeJV(PjvnewRaw, Pop1, Pjpm); - } - } -// Free the bitmap leaf - j__udyLFreeJLB1(PjlbRaw,Pjpm); - return(-1); - } - Pjvnew = P_JV(PjvnewRaw); - JU_COPYMEM(Pjvnew, Pjv, Pop1); - - Pjv += Pop1; - JL_JLB_PVALUE(Pjlb, ii) = PjvnewRaw; - } - } -#endif // JUDYL - - DcdP0 = JU_JPDCDPOP0(Pjp) | (PLeaf[0] & cJU_DCDMASK(1)); - JU_JPSETADT(Pjp, (Word_t)PjlbRaw, DcdP0, cJU_JPLEAF_B1); - - return(1); // return success - -} // j__udyCascade1() - -#endif // (!(JUDY1 && JU_64BIT)) - - -// **************************************************************************** -// __ J U D Y C A S C A D E 2 -// -// Entry PLeaf of size LeafPop1 is either compressed or splayed with pointer -// returned in Pjp. Entry Levels sizeof(Word_t) down to level 2. -// -// Splay or compress the 2-byte Index Leaf that Pjp point to. Return *Pjp as a -// (compressed) cJU_LEAFB1 or a cJU_BRANCH_*2 - -FUNCTION int j__udyCascade2( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint16_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF2_MAXPOP1]; // JPs of new leaves - uint8_t StageExp [cJU_LEAF2_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF2); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFF) == (cJU_LEAF2_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint16_t *) P_JLL(Pjp->jp_Addr); - -// And its Value area - JUDYLCODE(Pjv = JL_LEAF2VALUEAREA(PLeaf, cJU_LEAF2_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it to a Bitmap Leaf - - CIndex = PLeaf[0]; - if (!JU_DIGITATSTATE(CIndex ^ PLeaf[cJU_LEAF2_MAXPOP1-1], 2)) - { -// cJU_JPLEAF_B1 - Word_t DcdP0; - Pjlb_t PjlbRaw; - PjlbRaw = j__udyJLL2toJLB1(PLeaf, -#ifdef JUDYL - Pjv, -#endif - cJU_LEAF2_MAXPOP1, Pjpm); - if (PjlbRaw == (Pjlb_t)NULL) return(-1); // out of memory - -// Merge in another Dcd byte because compressing - DcdP0 = (CIndex & cJU_DCDMASK(1)) | JU_JPDCDPOP0(Pjp); - JU_JPSETADT(Pjp, (Word_t)PjlbRaw, DcdP0, cJU_JPLEAF_B1); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 2 byte index Leaf to 1 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF2_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ PLeaf[End], 2)) - ) - { -// Build a leaf below the previous expanse -// - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 2); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 2); - - if (Pop1 == 1) // cJU_JPIMMED_1_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(1)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_1_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_1_01); -#endif // JUDYL - } - else if (Pop1 <= cJU_IMMED1_MAXPOP1) // bigger - { -// cJL_JPIMMED_1_02..3: JudyL 32 -// cJ1_JPIMMED_1_02..7: Judy1 32 -// cJL_JPIMMED_1_02..7: JudyL 64 -// cJ1_JPIMMED_1_02..15: Judy1 64 -#ifdef JUDYL - Pjv_t PjvnewRaw; // value area of leaf. - Pjv_t Pjvnew; - -// Allocate Value area for Immediate Leaf - PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm); - if (PjvnewRaw == (Pjv_t) NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjvnew = P_JV(PjvnewRaw); - -// Copy to Values to Value Leaf - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); - PjpJP->jp_Addr = (Word_t) PjvnewRaw; - -// Copy to JP as an immediate Leaf - JU_COPYMEM(PjpJP->jp_LIndex, PLeaf + Start, - Pop1); -#else - JU_COPYMEM(PjpJP->jp_1Index, PLeaf + Start, - Pop1); -#endif -// Set Type, Population and Index size - PjpJP->jp_Type = cJU_JPIMMED_1_02 + Pop1 - 2; - } - -// 64Bit Judy1 does not have Leaf1: (note, unifdef disallows comment on next -// line) - -#if (! (defined(JUDY1) && defined(JU_64BIT))) - else if (Pop1 <= cJU_LEAF1_MAXPOP1) // still bigger - { -// cJU_JPLEAF1 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get a new Leaf - PjllRaw = j__udyAllocJLL1(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF1VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif -// Copy Indexes to new Leaf - JU_COPYMEM((uint8_t *)Pjll, PLeaf+Start, Pop1); - - DBGCODE(JudyCheckSorted(Pjll, Pop1, 1);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(2)) - | - (CIndex & cJU_DCDMASK(2-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF1); - } -#endif // (!(JUDY1 && JU_64BIT)) // Not 64Bit Judy1 - - else // biggest - { -// cJU_JPLEAF_B1 - Word_t DcdP0; - Pjlb_t PjlbRaw; - PjlbRaw = j__udyJLL2toJLB1( - PLeaf + Start, -#ifdef JUDYL - Pjv + Start, -#endif - Pop1, Pjpm); - if (PjlbRaw == (Pjlb_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(2)) - | - (CIndex & cJU_DCDMASK(2-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjlbRaw, DcdP0, - cJU_JPLEAF_B1); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF2_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = PLeaf[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L2; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade2() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 3 -// -// Return *Pjp as a (compressed) cJU_LEAF2, cJU_BRANCH_L3, cJU_BRANCH_B3. - -FUNCTION int j__udyCascade3( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint8_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF3_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF3_MAXPOP1]; - uint8_t StageExp [cJU_LEAF3_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF3); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFF) == (cJU_LEAF3_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - -// Extract leaf to Word_t and insert-sort Index into it - j__udyCopy3toW(StageA, PLeaf, cJU_LEAF3_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF3VALUEAREA(PLeaf, cJU_LEAF3_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF3_MAXPOP1-1], 3)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Alloc a 2 byte Index Leaf - PjllRaw = j__udyAllocJLL2(cJU_LEAF3_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy just 2 bytes Indexes to new Leaf -// j__udyCopyWto2((uint16_t *) Pjll, StageA, cJU_LEAF3_MAXPOP1); - JU_COPYMEM ((uint16_t *) Pjll, StageA, cJU_LEAF3_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF2VALUEAREA(Pjll, cJU_LEAF3_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF3_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF3_MAXPOP1, 2);) - -// Form new JP, Pop0 field is unchanged -// Add in another Dcd byte because compressing - DcdP0 = (CIndex & cJU_DCDMASK(2)) | JU_JPDCDPOP0(Pjp); - - JU_JPSETADT(Pjp, (Word_t) PjllRaw, DcdP0, cJU_JPLEAF2); - - return(1); // Success - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 3 byte index Leaf to 2 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF3_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 3)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 3); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 3); - - if (Pop1 == 1) // cJU_JPIMMED_2_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(2)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_2_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_2_01); -#endif // JUDYL - } -#if (defined(JUDY1) || defined(JU_64BIT)) - else if (Pop1 <= cJU_IMMED2_MAXPOP1) - { -// cJ1_JPIMMED_2_02..3: Judy1 32 -// cJL_JPIMMED_2_02..3: JudyL 64 -// cJ1_JPIMMED_2_02..7: Judy1 64 -#ifdef JUDYL -// Alloc is 1st in case of malloc fail - Pjv_t PjvnewRaw; // value area of new leaf. - Pjv_t Pjvnew; - -// Allocate Value area for Immediate Leaf - PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm); - if (PjvnewRaw == (Pjv_t) NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjvnew = P_JV(PjvnewRaw); - -// Copy to Values to Value Leaf - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); - - PjpJP->jp_Addr = (Word_t) PjvnewRaw; - -// Copy to Index to JP as an immediate Leaf - JU_COPYMEM((uint16_t *) (PjpJP->jp_LIndex), - StageA + Start, Pop1); -#else // JUDY1 - JU_COPYMEM((uint16_t *) (PjpJP->jp_1Index), - StageA + Start, Pop1); -#endif // JUDY1 -// Set Type, Population and Index size - PjpJP->jp_Type = cJU_JPIMMED_2_02 + Pop1 - 2; - } -#endif // (JUDY1 || JU_64BIT) - - else // Make a linear leaf2 - { -// cJU_JPLEAF2 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - - PjllRaw = j__udyAllocJLL2(Pop1, Pjpm); - if (PjllRaw == (Pjll_t) NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF2VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif -// Copy least 2 bytes per Index of Leaf to new Leaf - JU_COPYMEM((uint16_t *) Pjll, StageA+Start, - Pop1); - - DBGCODE(JudyCheckSorted(Pjll, Pop1, 2);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(3)) - | - (CIndex & cJU_DCDMASK(3-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF2); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF3_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L3; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade3() - - -#ifdef JU_64BIT // JudyCascade[4567] - -// **************************************************************************** -// __ J U D Y C A S C A D E 4 -// -// Cascade from a cJU_JPLEAF4 to one of the following: -// 1. if leaf is in 1 expanse: -// compress it into a JPLEAF3 -// 2. if leaf contains multiple expanses: -// create linear or bitmap branch containing -// each new expanse is either a: -// JPIMMED_3_01 branch -// JPIMMED_3_02 branch -// JPLEAF3 - -FUNCTION int j__udyCascade4( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint32_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF4_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF4_MAXPOP1]; - uint8_t StageExp [cJU_LEAF4_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF4); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFFFF) == (cJU_LEAF4_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint32_t *) P_JLL(Pjp->jp_Addr); - -// Extract 4 byte index Leaf to Word_t - j__udyCopy4toW(StageA, PLeaf, cJU_LEAF4_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF4VALUEAREA(PLeaf, cJU_LEAF4_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF4_MAXPOP1-1], 4)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new Leaf. - -// Alloc a 3 byte Index Leaf - PjllRaw = j__udyAllocJLL3(cJU_LEAF4_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy Index area into new Leaf - j__udyCopyWto3((uint8_t *) Pjll, StageA, cJU_LEAF4_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF3VALUEAREA(Pjll, cJU_LEAF4_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF4_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF4_MAXPOP1, 3);) - - DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(3)); - JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF3); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 4 byte index Leaf to 3 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF4_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 4)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 4); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 4); - - if (Pop1 == 1) // cJU_JPIMMED_3_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(3)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_3_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_3_01); -#endif // JUDYL - } - else if (Pop1 <= cJU_IMMED3_MAXPOP1) - { -// cJ1_JPIMMED_3_02 : Judy1 32 -// cJL_JPIMMED_3_02 : JudyL 64 -// cJ1_JPIMMED_3_02..5: Judy1 64 - -#ifdef JUDYL -// Alloc is 1st in case of malloc fail - Pjv_t PjvnewRaw; // value area of new leaf. - Pjv_t Pjvnew; - -// Allocate Value area for Immediate Leaf - PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm); - if (PjvnewRaw == (Pjv_t) NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjvnew = P_JV(PjvnewRaw); - -// Copy to Values to Value Leaf - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); - PjpJP->jp_Addr = (Word_t) PjvnewRaw; - -// Copy to Index to JP as an immediate Leaf - j__udyCopyWto3(PjpJP->jp_LIndex, - StageA + Start, Pop1); -#else - j__udyCopyWto3(PjpJP->jp_1Index, - StageA + Start, Pop1); -#endif -// Set type, population and Index size - PjpJP->jp_Type = cJU_JPIMMED_3_02 + Pop1 - 2; - } - else - { -// cJU_JPLEAF3 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - - PjllRaw = j__udyAllocJLL3(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); - -// Copy Indexes to new Leaf - j__udyCopyWto3((uint8_t *) Pjll, StageA + Start, - Pop1); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF3VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif - DBGCODE(JudyCheckSorted(Pjll, Pop1, 3);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(4)) - | - (CIndex & cJU_DCDMASK(4-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF3); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF4_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L4; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade4() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 5 -// -// Cascade from a cJU_JPLEAF5 to one of the following: -// 1. if leaf is in 1 expanse: -// compress it into a JPLEAF4 -// 2. if leaf contains multiple expanses: -// create linear or bitmap branch containing -// each new expanse is either a: -// JPIMMED_4_01 branch -// JPLEAF4 - -FUNCTION int j__udyCascade5( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint8_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF5_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF5_MAXPOP1]; - uint8_t StageExp [cJU_LEAF5_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF5); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFFFFFF) == (cJU_LEAF5_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - -// Extract 5 byte index Leaf to Word_t - j__udyCopy5toW(StageA, PLeaf, cJU_LEAF5_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF5VALUEAREA(PLeaf, cJU_LEAF5_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF5_MAXPOP1-1], 5)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Alloc a 4 byte Index Leaf - PjllRaw = j__udyAllocJLL4(cJU_LEAF5_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy Index area into new Leaf - j__udyCopyWto4((uint8_t *) Pjll, StageA, cJU_LEAF5_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF4VALUEAREA(Pjll, cJU_LEAF5_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF5_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF5_MAXPOP1, 4);) - - DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(4)); - JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF4); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 5 byte index Leaf to 4 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF5_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 5)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 5); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 5); - - if (Pop1 == 1) // cJU_JPIMMED_4_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(4)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_4_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_4_01); -#endif // JUDYL - } -#ifdef JUDY1 - else if (Pop1 <= cJ1_IMMED4_MAXPOP1) - { -// cJ1_JPIMMED_4_02..3: Judy1 64 - -// Copy to Index to JP as an immediate Leaf - j__udyCopyWto4(PjpJP->jp_1Index, - StageA + Start, Pop1); - -// Set pointer, type, population and Index size - PjpJP->jp_Type = cJ1_JPIMMED_4_02 + Pop1 - 2; - } -#endif - else - { -// cJU_JPLEAF4 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get a new Leaf - PjllRaw = j__udyAllocJLL4(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); - -// Copy Indexes to new Leaf - j__udyCopyWto4((uint8_t *) Pjll, StageA + Start, - Pop1); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF4VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif - DBGCODE(JudyCheckSorted(Pjll, Pop1, 4);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(5)) - | - (CIndex & cJU_DCDMASK(5-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF4); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF5_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L5; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade5() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 6 -// -// Cascade from a cJU_JPLEAF6 to one of the following: -// 1. if leaf is in 1 expanse: -// compress it into a JPLEAF5 -// 2. if leaf contains multiple expanses: -// create linear or bitmap branch containing -// each new expanse is either a: -// JPIMMED_5_01 ... JPIMMED_5_03 branch -// JPIMMED_5_01 branch -// JPLEAF5 - -FUNCTION int j__udyCascade6( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint8_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF6_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF6_MAXPOP1]; - uint8_t StageExp [cJU_LEAF6_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF6); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFFFFFFFF) == (cJU_LEAF6_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - -// Extract 6 byte index Leaf to Word_t - j__udyCopy6toW(StageA, PLeaf, cJU_LEAF6_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF6VALUEAREA(PLeaf, cJU_LEAF6_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF6_MAXPOP1-1], 6)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Alloc a 5 byte Index Leaf - PjllRaw = j__udyAllocJLL5(cJU_LEAF6_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy Index area into new Leaf - j__udyCopyWto5((uint8_t *) Pjll, StageA, cJU_LEAF6_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF5VALUEAREA(Pjll, cJU_LEAF6_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF6_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF6_MAXPOP1, 5);) - - DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(5)); - JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF5); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 6 byte index Leaf to 5 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF6_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 6)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 6); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 6); - - if (Pop1 == 1) // cJU_JPIMMED_5_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(5)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_5_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_5_01); -#endif // JUDYL - } -#ifdef JUDY1 - else if (Pop1 <= cJ1_IMMED5_MAXPOP1) - { -// cJ1_JPIMMED_5_02..3: Judy1 64 - -// Copy to Index to JP as an immediate Leaf - j__udyCopyWto5(PjpJP->jp_1Index, - StageA + Start, Pop1); - -// Set pointer, type, population and Index size - PjpJP->jp_Type = cJ1_JPIMMED_5_02 + Pop1 - 2; - } -#endif - else - { -// cJU_JPLEAF5 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get a new Leaf - PjllRaw = j__udyAllocJLL5(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); - -// Copy Indexes to new Leaf - j__udyCopyWto5((uint8_t *) Pjll, StageA + Start, - Pop1); - -// Copy to Values to new Leaf -#ifdef JUDYL - Pjvnew = JL_LEAF5VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif - DBGCODE(JudyCheckSorted(Pjll, Pop1, 5);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(6)) - | - (CIndex & cJU_DCDMASK(6-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF5); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF6_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L6; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade6() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 7 -// -// Cascade from a cJU_JPLEAF7 to one of the following: -// 1. if leaf is in 1 expanse: -// compress it into a JPLEAF6 -// 2. if leaf contains multiple expanses: -// create linear or bitmap branch containing -// each new expanse is either a: -// JPIMMED_6_01 ... JPIMMED_6_02 branch -// JPIMMED_6_01 branch -// JPLEAF6 - -FUNCTION int j__udyCascade7( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint8_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF7_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF7_MAXPOP1]; - uint8_t StageExp [cJU_LEAF7_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF7); - assert(JU_JPDCDPOP0(Pjp) == (cJU_LEAF7_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - -// Extract 7 byte index Leaf to Word_t - j__udyCopy7toW(StageA, PLeaf, cJU_LEAF7_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF7VALUEAREA(PLeaf, cJU_LEAF7_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF7_MAXPOP1-1], 7)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Alloc a 6 byte Index Leaf - PjllRaw = j__udyAllocJLL6(cJU_LEAF7_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy Index area into new Leaf - j__udyCopyWto6((uint8_t *) Pjll, StageA, cJU_LEAF7_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF6VALUEAREA(Pjll, cJU_LEAF7_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF7_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF7_MAXPOP1, 6);) - - DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(6)); - JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF6); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 7 byte index Leaf to 6 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF7_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 7)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 7); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 7); - - if (Pop1 == 1) // cJU_JPIMMED_6_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(6)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_6_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_6_01); -#endif // JUDYL - } -#ifdef JUDY1 - else if (Pop1 == cJ1_IMMED6_MAXPOP1) - { -// cJ1_JPIMMED_6_02: Judy1 64 - -// Copy to Index to JP as an immediate Leaf - j__udyCopyWto6(PjpJP->jp_1Index, - StageA + Start, 2); - -// Set pointer, type, population and Index size - PjpJP->jp_Type = cJ1_JPIMMED_6_02; - } -#endif - else - { -// cJU_JPLEAF6 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get a new Leaf - PjllRaw = j__udyAllocJLL6(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - Pjll = P_JLL(PjllRaw); - -// Copy Indexes to new Leaf - j__udyCopyWto6((uint8_t *) Pjll, StageA + Start, - Pop1); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF6VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif - DBGCODE(JudyCheckSorted(Pjll, Pop1, 6);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(7)) - | - (CIndex & cJU_DCDMASK(7-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF6); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF7_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L7; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade7() - -#endif // JU_64BIT - - -// **************************************************************************** -// __ J U D Y C A S C A D E L -// -// (Compressed) cJU_LEAF3[7], cJ1_JPBRANCH_L. -// -// Cascade from a LEAFW (under Pjp) to one of the following: -// 1. if LEAFW is in 1 expanse: -// create linear branch with a JPLEAF3[7] under it -// 2. LEAFW contains multiple expanses: -// create linear or bitmap branch containing new expanses -// each new expanse is either a: 32 64 -// JPIMMED_3_01 branch Y N -// JPIMMED_7_01 branch N Y -// JPLEAF3 Y N -// JPLEAF7 N Y - -FUNCTION int j__udyCascadeL( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - Pjlw_t Pjlw; // leaf to work on. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAFW_MAXPOP1]; - uint8_t StageExp[cJU_LEAFW_MAXPOP1]; - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - -// Get the address of the Leaf - Pjlw = P_JLW(Pjp->jp_Addr); - - assert(Pjlw[0] == (cJU_LEAFW_MAXPOP1 - 1)); - -// Get pointer to Value area of old Leaf - JUDYLCODE(Pjv = JL_LEAFWVALUEAREA(Pjlw, cJU_LEAFW_MAXPOP1);) - - Pjlw++; // Now point to Index area - -// If Leaf is in 1 expanse -- first compress it (compare 1st, last & Index): - - CIndex = Pjlw[0]; // also used far below - if (!JU_DIGITATSTATE(CIndex ^ Pjlw[cJU_LEAFW_MAXPOP1 - 1], - cJU_ROOTSTATE)) - { - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get the common expanse to all elements in Leaf - StageExp[0] = JU_DIGITATSTATE(CIndex, cJU_ROOTSTATE); - -// Alloc a 3[7] byte Index Leaf -#ifdef JU_64BIT - PjllRaw = j__udyAllocJLL7(cJU_LEAFW_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy LEAFW to a cJU_JPLEAF7 - j__udyCopyWto7((uint8_t *) Pjll, Pjlw, cJU_LEAFW_MAXPOP1); -#ifdef JUDYL -// Get the Value area of new Leaf - Pjvnew = JL_LEAF7VALUEAREA(Pjll, cJU_LEAFW_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAFW_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAFW_MAXPOP1, 7);) -#else // 32 Bit - PjllRaw = j__udyAllocJLL3(cJU_LEAFW_MAXPOP1, Pjpm); - if (PjllRaw == (Pjll_t) NULL) return(-1); - - Pjll = P_JLL(PjllRaw); - -// Copy LEAFW to a cJU_JPLEAF3 - j__udyCopyWto3((uint8_t *) Pjll, Pjlw, cJU_LEAFW_MAXPOP1); -#ifdef JUDYL -// Get the Value area of new Leaf - Pjvnew = JL_LEAF3VALUEAREA(Pjll, cJU_LEAFW_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAFW_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAFW_MAXPOP1, 3);) -#endif // 32 Bit - -// Following not needed because cJU_DCDMASK(3[7]) is == 0 -////// StageJP[0].jp_DcdPopO |= (CIndex & cJU_DCDMASK(3[7])); -#ifdef JU_64BIT - JU_JPSETADT(&(StageJP[0]), (Word_t)PjllRaw, cJU_LEAFW_MAXPOP1-1, - cJU_JPLEAF7); -#else // 32BIT - JU_JPSETADT(&(StageJP[0]), (Word_t)PjllRaw, cJU_LEAFW_MAXPOP1-1, - cJU_JPLEAF3); -#endif // 32BIT -// Create a 1 element Linear branch - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, 1, Pjpm) == -1) - return(-1); - -// Change the type of callers JP - Pjp->jp_Type = cJU_JPBRANCH_L; - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 4[8] byte Index Leaf to 3[7] byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAFW_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ Pjlw[End], cJU_ROOTSTATE)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, cJU_ROOTSTATE); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, - cJU_ROOTSTATE); - - if (Pop1 == 1) // cJU_JPIMMED_3[7]_01 - { -#ifdef JU_64BIT -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, CIndex, cJ1_JPIMMED_7_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], CIndex, - cJL_JPIMMED_7_01); -#endif // JUDYL - -#else // JU_32BIT -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, CIndex, cJ1_JPIMMED_3_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], CIndex, - cJL_JPIMMED_3_01); -#endif // JUDYL -#endif // JU_32BIT - } -#ifdef JUDY1 -#ifdef JU_64BIT - else if (Pop1 <= cJ1_IMMED7_MAXPOP1) -#else - else if (Pop1 <= cJ1_IMMED3_MAXPOP1) -#endif - { -// cJ1_JPIMMED_3_02 : Judy1 32 -// cJ1_JPIMMED_7_02 : Judy1 64 -// Copy to JP as an immediate Leaf -#ifdef JU_64BIT - j__udyCopyWto7(PjpJP->jp_1Index, Pjlw+Start, 2); - PjpJP->jp_Type = cJ1_JPIMMED_7_02; -#else - j__udyCopyWto3(PjpJP->jp_1Index, Pjlw+Start, 2); - PjpJP->jp_Type = cJ1_JPIMMED_3_02; -#endif // 32 Bit - } -#endif // JUDY1 - else // Linear Leaf JPLEAF3[7] - { -// cJU_JPLEAF3[7] - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. -#ifdef JU_64BIT - PjllRaw = j__udyAllocJLL7(Pop1, Pjpm); - if (PjllRaw == (Pjll_t) NULL) return(-1); - Pjll = P_JLL(PjllRaw); - - j__udyCopyWto7((uint8_t *) Pjll, Pjlw + Start, - Pop1); -#ifdef JUDYL - Pjvnew = JL_LEAF7VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif // JUDYL - DBGCODE(JudyCheckSorted(Pjll, Pop1, 7);) -#else // JU_64BIT - 32 Bit - PjllRaw = j__udyAllocJLL3(Pop1, Pjpm); - if (PjllRaw == (Pjll_t) NULL) return(-1); - Pjll = P_JLL(PjllRaw); - - j__udyCopyWto3((uint8_t *) Pjll, Pjlw + Start, - Pop1); -#ifdef JUDYL - Pjvnew = JL_LEAF3VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif // JUDYL - DBGCODE(JudyCheckSorted(Pjll, Pop1, 3);) -#endif // 32 Bit - -#ifdef JU_64BIT - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, Pop1 - 1, - cJU_JPLEAF7); -#else // JU_64BIT - 32 Bit - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, Pop1 - 1, - cJU_JPLEAF3); -#endif // 32 Bit - } - ExpCnt++; -// Done? - if (End == cJU_LEAFW_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = Pjlw[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_B; // cJU_LEAFW is out of sequence - } - return(1); - -} // j__udyCascadeL() diff --git a/libjudy/src/JudyCommon/JudyCount.c b/libjudy/src/JudyCommon/JudyCount.c deleted file mode 100644 index 220e1def48..0000000000 --- a/libjudy/src/JudyCommon/JudyCount.c +++ /dev/null @@ -1,1195 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.78 $ $Source: /judy/src/JudyCommon/JudyCount.c $ -// -// Judy*Count() function for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DNOSMARTJBB, -DNOSMARTJBU, and/or -DNOSMARTJLB to build a -// version with cache line optimizations deleted, for testing. -// -// Compile with -DSMARTMETRICS to obtain global variables containing smart -// cache line metrics. Note: Dont turn this on simultaneously for this file -// and JudyByCount.c because they export the same globals. -// -// Judy*Count() returns the "count of Indexes" (inclusive) between the two -// specified limits (Indexes). This code is remarkably fast. It traverses the -// "Judy array" data structure. -// -// This count code is the GENERIC untuned version (minimum code size). It -// might be possible to tuned to a specific architecture to be faster. -// However, in real applications, with a modern machine, it is expected that -// the instruction times will be swamped by cache line fills. -// **************************************************************************** - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - - -// define a phoney that is for sure - -#define cJU_LEAFW cJU_JPIMMED_CAP - -// Avoid duplicate symbols since this file is multi-compiled: - -#ifdef SMARTMETRICS -#ifdef JUDY1 -Word_t jbb_upward = 0; // counts of directions taken: -Word_t jbb_downward = 0; -Word_t jbu_upward = 0; -Word_t jbu_downward = 0; -Word_t jlb_upward = 0; -Word_t jlb_downward = 0; -#else -extern Word_t jbb_upward; -extern Word_t jbb_downward; -extern Word_t jbu_upward; -extern Word_t jbu_downward; -extern Word_t jlb_upward; -extern Word_t jlb_downward; -#endif -#endif - - -// FORWARD DECLARATIONS (prototypes): - -static Word_t j__udy1LCountSM(const Pjp_t Pjp, const Word_t Index, - const Pjpm_t Pjpm); - -// Each of Judy1 and JudyL get their own private (static) version of this -// function: - -static int j__udyCountLeafB1(const Pjll_t Pjll, const Word_t Pop1, - const Word_t Index); - -// These functions are not static because they are exported to Judy*ByCount(): -// -// TBD: Should be made static for performance reasons? And thus duplicated? -// -// Note: There really are two different functions, but for convenience they -// are referred to here with a generic name. - -#ifdef JUDY1 -#define j__udyJPPop1 j__udy1JPPop1 -#else -#define j__udyJPPop1 j__udyLJPPop1 -#endif - -Word_t j__udyJPPop1(const Pjp_t Pjp); - - -// LOCAL ERROR HANDLING: -// -// The Judy*Count() functions are unusual because they return 0 instead of JERR -// for an error. In this source file, define C_JERR for clarity. - -#define C_JERR 0 - - -// **************************************************************************** -// J U D Y 1 C O U N T -// J U D Y L C O U N T -// -// See the manual entry for details. -// -// This code is written recursively, at least at first, because thats much -// simpler; hope its fast enough. - -#ifdef JUDY1 -FUNCTION Word_t Judy1Count -#else -FUNCTION Word_t JudyLCount -#endif - ( - Pcvoid_t PArray, // JRP to first branch/leaf in SM. - Word_t Index1, // starting Index. - Word_t Index2, // ending Index. - PJError_t PJError // optional, for returning error info. - ) -{ - jpm_t fakejpm; // local temporary for small arrays. - Pjpm_t Pjpm; // top JPM or local temporary for error info. - jp_t fakejp; // constructed for calling j__udy1LCountSM(). - Pjp_t Pjp; // JP to pass to j__udy1LCountSM(). - Word_t pop1; // total for the array. - Word_t pop1above1; // indexes at or above Index1, inclusive. - Word_t pop1above2; // indexes at or above Index2, exclusive. - int retcode; // from Judy*First() calls. -JUDYLCODE(PPvoid_t PPvalue); // from JudyLFirst() calls. - - -// CHECK FOR SHORTCUTS: -// -// As documented, return C_JERR if the Judy array is empty or Index1 > Index2. - - if ((PArray == (Pvoid_t) NULL) || (Index1 > Index2)) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } - -// If Index1 == Index2, simply check if the specified Index is set; pass -// through the return value from Judy1Test() or JudyLGet() with appropriate -// translations. - - if (Index1 == Index2) - { -#ifdef JUDY1 - retcode = Judy1Test(PArray, Index1, PJError); - - if (retcode == JERRI) return(C_JERR); // pass through error. - - if (retcode == 0) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } -#else - PPvalue = JudyLGet(PArray, Index1, PJError); - - if (PPvalue == PPJERR) return(C_JERR); // pass through error. - - if (PPvalue == (PPvoid_t) NULL) // Index is not set. - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } -#endif - return(1); // single index is set. - } - - -// CHECK JRP TYPE: -// -// Use an if/then for speed rather than a switch, and put the most common cases -// first. -// -// Note: Since even cJU_LEAFW types require counting between two Indexes, -// prepare them here for common code below that calls j__udy1LCountSM(), rather -// than handling them even more specially here. - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - Pjpm = & fakejpm; - Pjp = & fakejp; - Pjp->jp_Addr = (Word_t) Pjlw; - Pjp->jp_Type = cJU_LEAFW; - Pjpm->jpm_Pop0 = Pjlw[0]; // from first word of leaf. - pop1 = Pjpm->jpm_Pop0 + 1; - } - else - { - Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); - pop1 = (Pjpm->jpm_Pop0) + 1; // note: can roll over to 0. - -#if (defined(JUDY1) && (! defined(JU_64BIT))) - if (pop1 == 0) // rare special case of full array: - { - Word_t count = Index2 - Index1 + 1; // can roll over again. - - if (count == 0) - { - JU_SET_ERRNO(PJError, JU_ERRNO_FULL); - return(C_JERR); - } - return(count); - } -#else - assert(pop1); // JudyL or 64-bit cannot create a full array! -#endif - } - - -// COUNT POP1 ABOVE INDEX1, INCLUSIVE: - - assert(pop1); // just to be safe. - - if (Index1 == 0) // shortcut, pop1above1 is entire population: - { - pop1above1 = pop1; - } - else // find first valid Index above Index1, if any: - { -#ifdef JUDY1 - if ((retcode = Judy1First(PArray, & Index1, PJError)) == JERRI) - return(C_JERR); // pass through error. -#else - if ((PPvalue = JudyLFirst(PArray, & Index1, PJError)) == PPJERR) - return(C_JERR); // pass through error. - - retcode = (PPvalue != (PPvoid_t) NULL); // found a next Index. -#endif - -// If theres no Index at or above Index1, just return C_JERR (early exit): - - if (retcode == 0) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } - -// If a first/next Index was found, call the counting motor starting with that -// known valid Index, meaning the return should be positive, not C_JERR except -// in case of a real error: - - if ((pop1above1 = j__udy1LCountSM(Pjp, Index1, Pjpm)) == C_JERR) - { - JU_COPY_ERRNO(PJError, Pjpm); // pass through error. - return(C_JERR); - } - } - - -// COUNT POP1 ABOVE INDEX2, EXCLUSIVE, AND RETURN THE DIFFERENCE: -// -// In principle, calculate the ordinal of each Index and take the difference, -// with caution about off-by-one errors due to the specified Indexes being set -// or unset. In practice: -// -// - The ordinals computed here are inverse ordinals, that is, the populations -// ABOVE the specified Indexes (Index1 inclusive, Index2 exclusive), so -// subtract pop1above2 from pop1above1, rather than vice-versa. -// -// - Index1s result already includes a count for Index1 and/or Index2 if -// either is set, so calculate pop1above2 exclusive of Index2. -// -// TBD: If Index1 and Index2 fall in the same expanse in the top-state -// branch(es), would it be faster to walk the SM only once, to their divergence -// point, before calling j__udy1LCountSM() or equivalent? Possibly a non-issue -// if a top-state pop1 becomes stored with each Judy1 array. Also, consider -// whether the first call of j__udy1LCountSM() fills the cache, for common tree -// branches, for the second call. -// -// As for pop1above1, look for shortcuts for special cases when pop1above2 is -// zero. Otherwise call the counting "motor". - - assert(pop1above1); // just to be safe. - - if (Index2++ == cJU_ALLONES) return(pop1above1); // Index2 at limit. - -#ifdef JUDY1 - if ((retcode = Judy1First(PArray, & Index2, PJError)) == JERRI) - return(C_JERR); -#else - if ((PPvalue = JudyLFirst(PArray, & Index2, PJError)) == PPJERR) - return(C_JERR); - - retcode = (PPvalue != (PPvoid_t) NULL); // found a next Index. -#endif - if (retcode == 0) return(pop1above1); // no Index above Index2. - -// Just as for Index1, j__udy1LCountSM() cannot return 0 (locally == C_JERR) -// except in case of a real error: - - if ((pop1above2 = j__udy1LCountSM(Pjp, Index2, Pjpm)) == C_JERR) - { - JU_COPY_ERRNO(PJError, Pjpm); // pass through error. - return(C_JERR); - } - - if (pop1above1 == pop1above2) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } - - return(pop1above1 - pop1above2); - -} // Judy1Count() / JudyLCount() - - -// **************************************************************************** -// __ J U D Y 1 L C O U N T S M -// -// Given a pointer to a JP (with invalid jp_DcdPopO at cJU_ROOTSTATE), a known -// valid Index, and a Pjpm for returning error info, recursively visit a Judy -// array state machine (SM) and return the count of Indexes, including Index, -// through the end of the Judy array at this state or below. In case of error -// or a count of 0 (should never happen), return C_JERR with appropriate -// JU_ERRNO in the Pjpm. -// -// Note: This function is not told the current state because its encoded in -// the JP Type. -// -// Method: To minimize cache line fills, while studying each branch, if Index -// resides above the midpoint of the branch (which often consists of multiple -// cache lines), ADD the populations at or above Index; otherwise, SUBTRACT -// from the population of the WHOLE branch (available from the JP) the -// populations at or above Index. This is especially tricky for bitmap -// branches. -// -// Note: Unlike, say, the Ins and Del walk routines, this function returns the -// same type of returns as Judy*Count(), so it can use *_SET_ERRNO*() macros -// the same way. - -FUNCTION static Word_t j__udy1LCountSM( -const Pjp_t Pjp, // top of Judy (sub)SM. -const Word_t Index, // count at or above this Index. -const Pjpm_t Pjpm) // for returning error info. -{ - Pjbl_t Pjbl; // Pjp->jp_Addr masked and cast to types: - Pjbb_t Pjbb; - Pjbu_t Pjbu; - Pjll_t Pjll; // a Judy lower-level linear leaf. - - Word_t digit; // next digit to decode from Index. - long jpnum; // JP number in a branch (base 0). - int offset; // index ordinal within a leaf, base 0. - Word_t pop1; // total population of an expanse. - Word_t pop1above; // to return. - -// Common code to check Decode bits in a JP against the equivalent portion of -// Index; XOR together, then mask bits of interest; must be all 0: -// -// Note: Why does this code only assert() compliance rather than actively -// checking for outliers? Its because Index is supposed to be valid, hence -// always match any Dcd bits traversed. -// -// Note: This assertion turns out to be always true for cState = 3 on 32-bit -// and 7 on 64-bit, but its harmless, probably removed by the compiler. - -#define CHECKDCD(Pjp,cState) \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cState)) - -// Common code to prepare to handle a root-level or lower-level branch: -// Extract a state-dependent digit from Index in a "constant" way, obtain the -// total population for the branch in a state-dependent way, and then branch to -// common code for multiple cases: -// -// For root-level branches, the state is always cJU_ROOTSTATE, and the -// population is received in Pjpm->jpm_Pop0. -// -// Note: The total population is only needed in cases where the common code -// "counts up" instead of down to minimize cache line fills. However, its -// available cheaply, and its better to do it with a constant shift (constant -// state value) instead of a variable shift later "when needed". - -#define PREPB_ROOT(Pjp,Next) \ - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); \ - pop1 = (Pjpm->jpm_Pop0) + 1; \ - goto Next - -#define PREPB(Pjp,cState,Next) \ - digit = JU_DIGITATSTATE(Index, cState); \ - pop1 = JU_JPBRANCH_POP0(Pjp, (cState)) + 1; \ - goto Next - - -// SWITCH ON JP TYPE: -// -// WARNING: For run-time efficiency the following cases replicate code with -// varying constants, rather than using common code with variable values! - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// ROOT-STATE LEAF that starts with a Pop0 word; just count within the leaf: - - case cJU_LEAFW: - { - Pjlw_t Pjlw = P_JLW(Pjp->jp_Addr); // first word of leaf. - - assert((Pjpm->jpm_Pop0) + 1 == Pjlw[0] + 1); // sent correctly. - offset = j__udySearchLeafW(Pjlw + 1, Pjpm->jpm_Pop0 + 1, Index); - assert(offset >= 0); // Index must exist. - assert(offset < (Pjpm->jpm_Pop0) + 1); // Index be in range. - return((Pjpm->jpm_Pop0) + 1 - offset); // INCLUSIVE of Index. - } - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH; count populations in JPs in the JBL ABOVE the next digit in -// Index, and recurse for the next digit in Index: -// -// Note: There are no null JPs in a JBL; watch out for pop1 == 0. -// -// Note: A JBL should always fit in one cache line => no need to count up -// versus down to save cache line fills. (PREPB() sets pop1 for no reason.) - - case cJU_JPBRANCH_L2: CHECKDCD(Pjp, 2); PREPB(Pjp, 2, BranchL); - case cJU_JPBRANCH_L3: CHECKDCD(Pjp, 3); PREPB(Pjp, 3, BranchL); - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: CHECKDCD(Pjp, 4); PREPB(Pjp, 4, BranchL); - case cJU_JPBRANCH_L5: CHECKDCD(Pjp, 5); PREPB(Pjp, 5, BranchL); - case cJU_JPBRANCH_L6: CHECKDCD(Pjp, 6); PREPB(Pjp, 6, BranchL); - case cJU_JPBRANCH_L7: CHECKDCD(Pjp, 7); PREPB(Pjp, 7, BranchL); -#endif - case cJU_JPBRANCH_L: PREPB_ROOT(Pjp, BranchL); - -// Common code (state-independent) for all cases of linear branches: - -BranchL: - - Pjbl = P_JBL(Pjp->jp_Addr); - jpnum = Pjbl->jbl_NumJPs; // above last JP. - pop1above = 0; - - while (digit < (Pjbl->jbl_Expanse[--jpnum])) // still ABOVE digit. - { - if ((pop1 = j__udyJPPop1((Pjbl->jbl_jp) + jpnum)) == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above += pop1; - assert(jpnum > 0); // should find digit. - } - - assert(digit == (Pjbl->jbl_Expanse[jpnum])); // should find digit. - - pop1 = j__udy1LCountSM((Pjbl->jbl_jp) + jpnum, Index, Pjpm); - if (pop1 == C_JERR) return(C_JERR); // pass error up. - - assert(pop1above + pop1); - return(pop1above + pop1); - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH; count populations in JPs in the JBB ABOVE the next digit in -// Index, and recurse for the next digit in Index: -// -// Note: There are no null JPs in a JBB; watch out for pop1 == 0. - - case cJU_JPBRANCH_B2: CHECKDCD(Pjp, 2); PREPB(Pjp, 2, BranchB); - case cJU_JPBRANCH_B3: CHECKDCD(Pjp, 3); PREPB(Pjp, 3, BranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: CHECKDCD(Pjp, 4); PREPB(Pjp, 4, BranchB); - case cJU_JPBRANCH_B5: CHECKDCD(Pjp, 5); PREPB(Pjp, 5, BranchB); - case cJU_JPBRANCH_B6: CHECKDCD(Pjp, 6); PREPB(Pjp, 6, BranchB); - case cJU_JPBRANCH_B7: CHECKDCD(Pjp, 7); PREPB(Pjp, 7, BranchB); -#endif - case cJU_JPBRANCH_B: PREPB_ROOT(Pjp, BranchB); - -// Common code (state-independent) for all cases of bitmap branches: - -BranchB: - { - long subexp; // for stepping through layer 1 (subexpanses). - long findsub; // subexpanse containing Index (digit). - Word_t findbit; // bit representing Index (digit). - Word_t lowermask; // bits for indexes at or below Index. - Word_t jpcount; // JPs in a subexpanse. - Word_t clbelow; // cache lines below digits cache line. - Word_t clabove; // cache lines above digits cache line. - - Pjbb = P_JBB(Pjp->jp_Addr); - findsub = digit / cJU_BITSPERSUBEXPB; - findbit = digit % cJU_BITSPERSUBEXPB; - lowermask = JU_MASKLOWERINC(JU_BITPOSMASKB(findbit)); - clbelow = clabove = 0; // initial/default => always downward. - - assert(JU_BITMAPTESTB(Pjbb, digit)); // digit must have a JP. - assert(findsub < cJU_NUMSUBEXPB); // falls in expected range. - -// Shorthand for one subexpanse in a bitmap and for one JP in a bitmap branch: -// -// Note: BMPJP0 exists separately to support assertions. - -#define BMPJP0(Subexp) (P_JP(JU_JBB_PJP(Pjbb, Subexp))) -#define BMPJP(Subexp,JPnum) (BMPJP0(Subexp) + (JPnum)) - -#ifndef NOSMARTJBB // enable to turn off smart code for comparison purposes. - -// FIGURE OUT WHICH DIRECTION CAUSES FEWER CACHE LINE FILLS; adding the pop1s -// in JPs above Indexs JP, or subtracting the pop1s in JPs below Indexs JP. -// -// This is tricky because, while each set bit in the bitmap represents a JP, -// the JPs are scattered over cJU_NUMSUBEXPB subexpanses, each of which can -// contain JPs packed into multiple cache lines, and this code must visit every -// JP either BELOW or ABOVE the JP for Index. -// -// Number of cache lines required to hold a linear list of the given number of -// JPs, assuming the first JP is at the start of a cache line or the JPs in -// jpcount fit wholly within a single cache line, which is ensured by -// JudyMalloc(): - -#define CLPERJPS(jpcount) \ - ((((jpcount) * cJU_WORDSPERJP) + cJU_WORDSPERCL - 1) / cJU_WORDSPERCL) - -// Count cache lines below/above for each subexpanse: - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - -// When at the subexpanse containing Index (digit), add cache lines -// below/above appropriately, excluding the cache line containing the JP for -// Index itself: - - if (subexp < findsub) clbelow += CLPERJPS(jpcount); - else if (subexp > findsub) clabove += CLPERJPS(jpcount); - else // (subexp == findsub) - { - Word_t clfind; // cache line containing Index (digit). - - clfind = CLPERJPS(j__udyCountBitsB( - JU_JBB_BITMAP(Pjbb, subexp) & lowermask)); - - assert(clfind > 0); // digit itself should have 1 CL. - clbelow += clfind - 1; - clabove += CLPERJPS(jpcount) - clfind; - } - } -#endif // ! NOSMARTJBB - -// Note: Its impossible to get through the following "if" without setting -// jpnum -- see some of the assertions below -- but gcc -Wall doesnt know -// this, so preset jpnum to make it happy: - - jpnum = 0; - - -// COUNT POPULATION FOR A BITMAP BRANCH, in whichever direction should result -// in fewer cache line fills: -// -// Note: If the remainder of Index is zero, pop1above is the pop1 of the -// entire expanse and theres no point in recursing to lower levels; but this -// should be so rare that its not worth checking for; -// Judy1Count()/JudyLCount() never even calls the motor for Index == 0 (all -// bytes). - - -// COUNT UPWARD, subtracting each "below or at" JPs pop1 from the whole -// expanses pop1: -// -// Note: If this causes clbelow + 1 cache line fills including JPs cache -// line, thats OK; at worst this is the same as clabove. - - if (clbelow < clabove) - { -#ifdef SMARTMETRICS - ++jbb_upward; -#endif - pop1above = pop1; // subtract JPs at/below Index. - -// Count JPs for which to accrue pop1s in this subexpanse: -// -// TBD: If JU_JBB_BITMAP is cJU_FULLBITMAPB, dont bother counting. - - for (subexp = 0; subexp <= findsub; ++subexp) - { - jpcount = j__udyCountBitsB((subexp < findsub) ? - JU_JBB_BITMAP(Pjbb, subexp) : - JU_JBB_BITMAP(Pjbb, subexp) & lowermask); - - // should always find findbit: - assert((subexp < findsub) || jpcount); - -// Subtract pop1s from JPs BELOW OR AT Index (digit): -// -// Note: The pop1 for Indexs JP itself is partially added back later at a -// lower state. -// -// Note: An empty subexpanse (jpcount == 0) is handled "for free". -// -// Note: Must be null JP subexp pointer in empty subexpanse and non-empty in -// non-empty subexpanse: - - assert( jpcount || (BMPJP0(subexp) == (Pjp_t) NULL)); - assert((! jpcount) || (BMPJP0(subexp) != (Pjp_t) NULL)); - - for (jpnum = 0; jpnum < jpcount; ++jpnum) - { - if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum))) - == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above -= pop1; - } - - jpnum = jpcount - 1; // make correct for digit. - } - } - -// COUNT DOWNWARD, adding each "above" JPs pop1: - - else - { - long jpcountbf; // below findbit, inclusive. -#ifdef SMARTMETRICS - ++jbb_downward; -#endif - pop1above = 0; // add JPs above Index. - jpcountbf = 0; // until subexp == findsub. - -// Count JPs for which to accrue pop1s in this subexpanse: -// -// This is more complicated than counting upward because the scan of digits -// subexpanse must count ALL JPs, to know where to START counting down, and -// ALSO note the offset of digits JP to know where to STOP counting down. - - for (subexp = cJU_NUMSUBEXPB - 1; subexp >= findsub; --subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - - // should always find findbit: - assert((subexp > findsub) || jpcount); - - if (! jpcount) continue; // empty subexpanse, save time. - -// Count JPs below digit, inclusive: - - if (subexp == findsub) - { - jpcountbf = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp) - & lowermask); - } - - // should always find findbit: - assert((subexp > findsub) || jpcountbf); - assert(jpcount >= jpcountbf); // proper relationship. - -// Add pop1s from JPs ABOVE Index (digit): - - // no null JP subexp pointers: - assert(BMPJP0(subexp) != (Pjp_t) NULL); - - for (jpnum = jpcount - 1; jpnum >= jpcountbf; --jpnum) - { - if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum))) - == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above += pop1; - } - // jpnum is now correct for digit. - } - } // else. - -// Return the net population ABOVE the digits JP at this state (in this JBB) -// plus the population AT OR ABOVE Index in the SM under the digits JP: - - pop1 = j__udy1LCountSM(BMPJP(findsub, jpnum), Index, Pjpm); - if (pop1 == C_JERR) return(C_JERR); // pass error up. - - assert(pop1above + pop1); - return(pop1above + pop1); - - } // case. - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH; count populations in JPs in the JBU ABOVE the next -// digit in Index, and recurse for the next digit in Index: -// -// Note: If the remainder of Index is zero, pop1above is the pop1 of the -// entire expanse and theres no point in recursing to lower levels; but this -// should be so rare that its not worth checking for; -// Judy1Count()/JudyLCount() never even calls the motor for Index == 0 (all -// bytes). - - case cJU_JPBRANCH_U2: CHECKDCD(Pjp, 2); PREPB(Pjp, 2, BranchU); - case cJU_JPBRANCH_U3: CHECKDCD(Pjp, 3); PREPB(Pjp, 3, BranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: CHECKDCD(Pjp, 4); PREPB(Pjp, 4, BranchU); - case cJU_JPBRANCH_U5: CHECKDCD(Pjp, 5); PREPB(Pjp, 5, BranchU); - case cJU_JPBRANCH_U6: CHECKDCD(Pjp, 6); PREPB(Pjp, 6, BranchU); - case cJU_JPBRANCH_U7: CHECKDCD(Pjp, 7); PREPB(Pjp, 7, BranchU); -#endif - case cJU_JPBRANCH_U: PREPB_ROOT(Pjp, BranchU); - -// Common code (state-independent) for all cases of uncompressed branches: - -BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - -#ifndef NOSMARTJBU // enable to turn off smart code for comparison purposes. - -// FIGURE OUT WHICH WAY CAUSES FEWER CACHE LINE FILLS; adding the JPs above -// Indexs JP, or subtracting the JPs below Indexs JP. -// -// COUNT UPWARD, subtracting the pop1 of each JP BELOW OR AT Index, from the -// whole expanses pop1: - - if (digit < (cJU_BRANCHUNUMJPS / 2)) - { - pop1above = pop1; // subtract JPs below Index. -#ifdef SMARTMETRICS - ++jbu_upward; -#endif - for (jpnum = 0; jpnum <= digit; ++jpnum) - { - if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX) - continue; // shortcut, save a function call. - - if ((pop1 = j__udyJPPop1(Pjbu->jbu_jp + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above -= pop1; - } - } - -// COUNT DOWNWARD, simply adding the pop1 of each JP ABOVE Index: - - else -#endif // NOSMARTJBU - { - assert(digit < cJU_BRANCHUNUMJPS); -#ifdef SMARTMETRICS - ++jbu_downward; -#endif - pop1above = 0; // add JPs above Index. - - for (jpnum = cJU_BRANCHUNUMJPS - 1; jpnum > digit; --jpnum) - { - if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX) - continue; // shortcut, save a function call. - - if ((pop1 = j__udyJPPop1(Pjbu->jbu_jp + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above += pop1; - } - } - - if ((pop1 = j__udy1LCountSM(Pjbu->jbu_jp + digit, Index, Pjpm)) - == C_JERR) return(C_JERR); // pass error up. - - assert(pop1above + pop1); - return(pop1above + pop1); - - -// ---------------------------------------------------------------------------- -// LEAF COUNT MACROS: -// -// LEAF*ABOVE() are common code for different JP types (linear leaves, bitmap -// leaves, and immediates) and different leaf Index Sizes, which result in -// calling different leaf search functions. Linear leaves get the leaf address -// from jp_Addr and the Population from jp_DcdPopO, while immediates use Pjp -// itself as the leaf address and get Population from jp_Type. - -#define LEAFLABOVE(Func) \ - Pjll = P_JLL(Pjp->jp_Addr); \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - LEAFABOVE(Func, Pjll, pop1) - -#define LEAFB1ABOVE(Func) LEAFLABOVE(Func) // different Func, otherwise same. - -#ifdef JUDY1 -#define IMMABOVE(Func,Pop1) \ - Pjll = (Pjll_t) Pjp; \ - LEAFABOVE(Func, Pjll, Pop1) -#else -// Note: For JudyL immediates with >= 2 Indexes, the index bytes are in a -// different place than for Judy1: - -#define IMMABOVE(Func,Pop1) \ - LEAFABOVE(Func, (Pjll_t) (Pjp->jp_LIndex), Pop1) -#endif - -// For all leaf types, the population AT OR ABOVE is the total pop1 less the -// offset of Index; and Index should always be found: - -#define LEAFABOVE(Func,Pjll,Pop1) \ - offset = Func(Pjll, Pop1, Index); \ - assert(offset >= 0); \ - assert(offset < (Pop1)); \ - return((Pop1) - offset) - -// IMMABOVE_01 handles the special case of an immediate JP with 1 index, which -// the search functions arent used for anyway: -// -// The target Index should be the one in this Immediate, in which case the -// count above (inclusive) is always 1. - -#define IMMABOVE_01 \ - assert((JU_JPDCDPOP0(Pjp)) == JU_TRIMTODCDSIZE(Index)); \ - return(1) - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF; search the leaf for Index; size is computed from jp_Type: - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: LEAFLABOVE(j__udySearchLeaf1); -#endif - case cJU_JPLEAF2: LEAFLABOVE(j__udySearchLeaf2); - case cJU_JPLEAF3: LEAFLABOVE(j__udySearchLeaf3); - -#ifdef JU_64BIT - case cJU_JPLEAF4: LEAFLABOVE(j__udySearchLeaf4); - case cJU_JPLEAF5: LEAFLABOVE(j__udySearchLeaf5); - case cJU_JPLEAF6: LEAFLABOVE(j__udySearchLeaf6); - case cJU_JPLEAF7: LEAFLABOVE(j__udySearchLeaf7); -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF; search the leaf for Index: -// -// Since the bitmap describes Indexes digitally rather than linearly, this is -// not really a search, but just a count. - - case cJU_JPLEAF_B1: LEAFB1ABOVE(j__udyCountLeafB1); - - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// Return the count of Indexes AT OR ABOVE Index, which is the total population -// of the expanse (a constant) less the value of the undecoded digit remaining -// in Index (its base-0 offset in the expanse), which yields an inclusive count -// above. -// -// TBD: This only supports a 1-byte full expanse. Should this extract a -// stored value for pop0 and possibly more LSBs of Index, to handle larger full -// expanses? - - case cJ1_JPFULLPOPU1: - return(cJU_JPFULLPOPU1_POP0 + 1 - JU_DIGITATSTATE(Index, 1)); -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: - - case cJU_JPIMMED_1_01: IMMABOVE_01; - case cJU_JPIMMED_2_01: IMMABOVE_01; - case cJU_JPIMMED_3_01: IMMABOVE_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: IMMABOVE_01; - case cJU_JPIMMED_5_01: IMMABOVE_01; - case cJU_JPIMMED_6_01: IMMABOVE_01; - case cJU_JPIMMED_7_01: IMMABOVE_01; -#endif - - case cJU_JPIMMED_1_02: IMMABOVE(j__udySearchLeaf1, 2); - case cJU_JPIMMED_1_03: IMMABOVE(j__udySearchLeaf1, 3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: IMMABOVE(j__udySearchLeaf1, 4); - case cJU_JPIMMED_1_05: IMMABOVE(j__udySearchLeaf1, 5); - case cJU_JPIMMED_1_06: IMMABOVE(j__udySearchLeaf1, 6); - case cJU_JPIMMED_1_07: IMMABOVE(j__udySearchLeaf1, 7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: IMMABOVE(j__udySearchLeaf1, 8); - case cJ1_JPIMMED_1_09: IMMABOVE(j__udySearchLeaf1, 9); - case cJ1_JPIMMED_1_10: IMMABOVE(j__udySearchLeaf1, 10); - case cJ1_JPIMMED_1_11: IMMABOVE(j__udySearchLeaf1, 11); - case cJ1_JPIMMED_1_12: IMMABOVE(j__udySearchLeaf1, 12); - case cJ1_JPIMMED_1_13: IMMABOVE(j__udySearchLeaf1, 13); - case cJ1_JPIMMED_1_14: IMMABOVE(j__udySearchLeaf1, 14); - case cJ1_JPIMMED_1_15: IMMABOVE(j__udySearchLeaf1, 15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: IMMABOVE(j__udySearchLeaf2, 2); - case cJU_JPIMMED_2_03: IMMABOVE(j__udySearchLeaf2, 3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: IMMABOVE(j__udySearchLeaf2, 4); - case cJ1_JPIMMED_2_05: IMMABOVE(j__udySearchLeaf2, 5); - case cJ1_JPIMMED_2_06: IMMABOVE(j__udySearchLeaf2, 6); - case cJ1_JPIMMED_2_07: IMMABOVE(j__udySearchLeaf2, 7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: IMMABOVE(j__udySearchLeaf3, 2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: IMMABOVE(j__udySearchLeaf3, 3); - case cJ1_JPIMMED_3_04: IMMABOVE(j__udySearchLeaf3, 4); - case cJ1_JPIMMED_3_05: IMMABOVE(j__udySearchLeaf3, 5); - - case cJ1_JPIMMED_4_02: IMMABOVE(j__udySearchLeaf4, 2); - case cJ1_JPIMMED_4_03: IMMABOVE(j__udySearchLeaf4, 3); - - case cJ1_JPIMMED_5_02: IMMABOVE(j__udySearchLeaf5, 2); - case cJ1_JPIMMED_5_03: IMMABOVE(j__udySearchLeaf5, 3); - - case cJ1_JPIMMED_6_02: IMMABOVE(j__udySearchLeaf6, 2); - - case cJ1_JPIMMED_7_02: IMMABOVE(j__udySearchLeaf7, 2); -#endif - - -// ---------------------------------------------------------------------------- -// OTHER CASES: - - default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); return(C_JERR); - - } // switch on JP type - - /*NOTREACHED*/ - -} // j__udy1LCountSM() - - -// **************************************************************************** -// J U D Y C O U N T L E A F B 1 -// -// This is a private analog of the j__udySearchLeaf*() functions for counting -// in bitmap 1-byte leaves. Since a bitmap leaf describes Indexes digitally -// rather than linearly, this is not really a search, but just a count of the -// valid Indexes == set bits below or including Index, which should be valid. -// Return the "offset" (really the ordinal), 0 .. Pop1 - 1, of Index in Pjll; -// if Indexs bit is not set (which should never happen, so this is DEBUG-mode -// only), return the 1s-complement equivalent (== negative offset minus 1). -// -// Note: The source code for this function looks identical for both Judy1 and -// JudyL, but the JU_JLB_BITMAP macro varies. -// -// Note: For simpler calling, the first arg is of type Pjll_t but then cast to -// Pjlb_t. - -FUNCTION static int j__udyCountLeafB1( -const Pjll_t Pjll, // bitmap leaf, as Pjll_t for consistency. -const Word_t Pop1, // Population of whole leaf. -const Word_t Index) // to which to count. -{ - Pjlb_t Pjlb = (Pjlb_t) Pjll; // to proper type. - Word_t digit = Index & cJU_MASKATSTATE(1); - Word_t findsub = digit / cJU_BITSPERSUBEXPL; - Word_t findbit = digit % cJU_BITSPERSUBEXPL; - int count; // in leaf through Index. - long subexp; // for stepping through subexpanses. - - -// COUNT UPWARD: -// -// The entire bitmap should fit in one cache line, but still try to save some -// CPU time by counting the fewest possible number of subexpanses from the -// bitmap. - -#ifndef NOSMARTJLB // enable to turn off smart code for comparison purposes. - - if (findsub < (cJU_NUMSUBEXPL / 2)) - { -#ifdef SMARTMETRICS - ++jlb_upward; -#endif - count = 0; - - for (subexp = 0; subexp < findsub; ++subexp) - { - count += ((JU_JLB_BITMAP(Pjlb, subexp) == cJU_FULLBITMAPL) ? - cJU_BITSPERSUBEXPL : - j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp))); - } - -// This count includes findbit, which should be set, resulting in a base-1 -// offset: - - count += j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, findsub) - & JU_MASKLOWERINC(JU_BITPOSMASKL(findbit))); - - DBGCODE(if (! JU_BITMAPTESTL(Pjlb, digit)) return(~count);) - assert(count >= 1); - return(count - 1); // convert to base-0 offset. - } -#endif // NOSMARTJLB - - -// COUNT DOWNWARD: -// -// Count the valid Indexes above or at Index, and subtract from Pop1. - -#ifdef SMARTMETRICS - ++jlb_downward; -#endif - count = Pop1; // base-1 for now. - - for (subexp = cJU_NUMSUBEXPL - 1; subexp > findsub; --subexp) - { - count -= ((JU_JLB_BITMAP(Pjlb, subexp) == cJU_FULLBITMAPL) ? - cJU_BITSPERSUBEXPL : - j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp))); - } - -// This count includes findbit, which should be set, resulting in a base-0 -// offset: - - count -= j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, findsub) - & JU_MASKHIGHERINC(JU_BITPOSMASKL(findbit))); - - DBGCODE(if (! JU_BITMAPTESTL(Pjlb, digit)) return(~count);) - assert(count >= 0); // should find Index itself. - return(count); // is already a base-0 offset. - -} // j__udyCountLeafB1() - - -// **************************************************************************** -// J U D Y J P P O P 1 -// -// This function takes any type of JP other than a root-level JP (cJU_LEAFW* or -// cJU_JPBRANCH* with no number suffix) and extracts the Pop1 from it. In some -// sense this is a wrapper around the JU_JP*_POP0 macros. Why write it as a -// function instead of a complex macro containing a trinary? (See version -// Judy1.h version 4.17.) We think its cheaper to call a function containing -// a switch statement with "constant" cases than to do the variable -// calculations in a trinary. -// -// For invalid JP Types return cJU_ALLONES. Note that this is an impossibly -// high Pop1 for any JP below a top level branch. - -FUNCTION Word_t j__udyJPPop1( -const Pjp_t Pjp) // JP to count. -{ - switch (JU_JPTYPE(Pjp)) - { -#ifdef notdef // caller should shortcut and not even call with these: - - case cJU_JPNULL1: - case cJU_JPNULL2: - case cJU_JPNULL3: return(0); -#ifdef JU_64BIT - case cJU_JPNULL4: - case cJU_JPNULL5: - case cJU_JPNULL6: - case cJU_JPNULL7: return(0); -#endif -#endif // notdef - - case cJU_JPBRANCH_L2: - case cJU_JPBRANCH_B2: - case cJU_JPBRANCH_U2: return(JU_JPBRANCH_POP0(Pjp,2) + 1); - - case cJU_JPBRANCH_L3: - case cJU_JPBRANCH_B3: - case cJU_JPBRANCH_U3: return(JU_JPBRANCH_POP0(Pjp,3) + 1); - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - case cJU_JPBRANCH_B4: - case cJU_JPBRANCH_U4: return(JU_JPBRANCH_POP0(Pjp,4) + 1); - - case cJU_JPBRANCH_L5: - case cJU_JPBRANCH_B5: - case cJU_JPBRANCH_U5: return(JU_JPBRANCH_POP0(Pjp,5) + 1); - - case cJU_JPBRANCH_L6: - case cJU_JPBRANCH_B6: - case cJU_JPBRANCH_U6: return(JU_JPBRANCH_POP0(Pjp,6) + 1); - - case cJU_JPBRANCH_L7: - case cJU_JPBRANCH_B7: - case cJU_JPBRANCH_U7: return(JU_JPBRANCH_POP0(Pjp,7) + 1); -#endif - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: -#endif - case cJU_JPLEAF2: - case cJU_JPLEAF3: -#ifdef JU_64BIT - case cJU_JPLEAF4: - case cJU_JPLEAF5: - case cJU_JPLEAF6: - case cJU_JPLEAF7: -#endif - case cJU_JPLEAF_B1: return(JU_JPLEAF_POP0(Pjp) + 1); - -#ifdef JUDY1 - case cJ1_JPFULLPOPU1: return(cJU_JPFULLPOPU1_POP0 + 1); -#endif - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: return(1); -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: return(1); -#endif - - case cJU_JPIMMED_1_02: return(2); - case cJU_JPIMMED_1_03: return(3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: return(4); - case cJU_JPIMMED_1_05: return(5); - case cJU_JPIMMED_1_06: return(6); - case cJU_JPIMMED_1_07: return(7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: return(8); - case cJ1_JPIMMED_1_09: return(9); - case cJ1_JPIMMED_1_10: return(10); - case cJ1_JPIMMED_1_11: return(11); - case cJ1_JPIMMED_1_12: return(12); - case cJ1_JPIMMED_1_13: return(13); - case cJ1_JPIMMED_1_14: return(14); - case cJ1_JPIMMED_1_15: return(15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: return(2); - case cJU_JPIMMED_2_03: return(3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: return(4); - case cJ1_JPIMMED_2_05: return(5); - case cJ1_JPIMMED_2_06: return(6); - case cJ1_JPIMMED_2_07: return(7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: return(2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: return(3); - case cJ1_JPIMMED_3_04: return(4); - case cJ1_JPIMMED_3_05: return(5); - - case cJ1_JPIMMED_4_02: return(2); - case cJ1_JPIMMED_4_03: return(3); - - case cJ1_JPIMMED_5_02: return(2); - case cJ1_JPIMMED_5_03: return(3); - - case cJ1_JPIMMED_6_02: return(2); - - case cJ1_JPIMMED_7_02: return(2); -#endif - - default: return(cJU_ALLONES); - } - - /*NOTREACHED*/ - -} // j__udyJPPop1() diff --git a/libjudy/src/JudyCommon/JudyCreateBranch.c b/libjudy/src/JudyCommon/JudyCreateBranch.c deleted file mode 100644 index e0f7428025..0000000000 --- a/libjudy/src/JudyCommon/JudyCreateBranch.c +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.26 $ $Source: /judy/src/JudyCommon/JudyCreateBranch.c $ - -// Branch creation functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - - -// **************************************************************************** -// J U D Y C R E A T E B R A N C H L -// -// Build a BranchL from an array of JPs and associated 1 byte digits -// (expanses). Return with Pjp pointing to the BranchL. Caller must -// deallocate passed arrays, if necessary. -// -// We have no idea what kind of BranchL it is, so caller must set the jp_Type. -// -// Return -1 if error (details in Pjpm), otherwise return 1. - -FUNCTION int j__udyCreateBranchL( - Pjp_t Pjp, // Build JPs from this place - Pjp_t PJPs, // Array of JPs to put into Bitmap branch - uint8_t Exp[], // Array of expanses to put into bitmap - Word_t ExpCnt, // Number of above JPs and Expanses - Pvoid_t Pjpm) -{ - Pjbl_t PjblRaw; // pointer to linear branch. - Pjbl_t Pjbl; - - assert(ExpCnt <= cJU_BRANCHLMAXJPS); - - PjblRaw = j__udyAllocJBL(Pjpm); - if (PjblRaw == (Pjbl_t) NULL) return(-1); - Pjbl = P_JBL(PjblRaw); - -// Build a Linear Branch - Pjbl->jbl_NumJPs = ExpCnt; - -// Copy from the Linear branch from splayed leaves - JU_COPYMEM(Pjbl->jbl_Expanse, Exp, ExpCnt); - JU_COPYMEM(Pjbl->jbl_jp, PJPs, ExpCnt); - -// Pass back new pointer to the Linear branch in JP - Pjp->jp_Addr = (Word_t) PjblRaw; - - return(1); - -} // j__udyCreateBranchL() - - -// **************************************************************************** -// J U D Y C R E A T E B R A N C H B -// -// Build a BranchB from an array of JPs and associated 1 byte digits -// (expanses). Return with Pjp pointing to the BranchB. Caller must -// deallocate passed arrays, if necessary. -// -// We have no idea what kind of BranchB it is, so caller must set the jp_Type. -// -// Return -1 if error (details in Pjpm), otherwise return 1. - -FUNCTION int j__udyCreateBranchB( - Pjp_t Pjp, // Build JPs from this place - Pjp_t PJPs, // Array of JPs to put into Bitmap branch - uint8_t Exp[], // Array of expanses to put into bitmap - Word_t ExpCnt, // Number of above JPs and Expanses - Pvoid_t Pjpm) -{ - Pjbb_t PjbbRaw; // pointer to bitmap branch. - Pjbb_t Pjbb; - Word_t ii, jj; // Temps - uint8_t CurrSubExp; // Current sub expanse for BM - -// This assertion says the number of populated subexpanses is not too large. -// This function is only called when a BranchL overflows to a BranchB or when a -// cascade occurs, meaning a leaf overflows. Either way ExpCnt cant be very -// large, in fact a lot smaller than cJU_BRANCHBMAXJPS. (Otherwise a BranchU -// would be used.) Popping this assertion means something (unspecified) has -// gone very wrong, or else Judys design criteria have changed, although in -// fact there should be no HARM in creating a BranchB with higher actual -// fanout. - - assert(ExpCnt <= cJU_BRANCHBMAXJPS); - -// Get memory for a Bitmap branch - PjbbRaw = j__udyAllocJBB(Pjpm); - if (PjbbRaw == (Pjbb_t) NULL) return(-1); - Pjbb = P_JBB(PjbbRaw); - -// Get 1st "sub" expanse (0..7) of bitmap branch - CurrSubExp = Exp[0] / cJU_BITSPERSUBEXPB; - -// Index thru all 1 byte sized expanses: - - for (jj = ii = 0; ii <= ExpCnt; ii++) - { - Word_t SubExp; // Cannot be a uint8_t - -// Make sure we cover the last one - if (ii == ExpCnt) - { - SubExp = cJU_ALLONES; // Force last one - } - else - { -// Calculate the "sub" expanse of the byte expanse - SubExp = Exp[ii] / cJU_BITSPERSUBEXPB; // Bits 5..7. - -// Set the bit that represents the expanse in Exp[] - JU_JBB_BITMAP(Pjbb, SubExp) |= JU_BITPOSMASKB(Exp[ii]); - } -// Check if a new "sub" expanse range needed - if (SubExp != CurrSubExp) - { -// Get number of JPs in this sub expanse - Word_t NumJP = ii - jj; - Pjp_t PjpRaw; - Pjp_t Pjp; - - PjpRaw = j__udyAllocJBBJP(NumJP, Pjpm); - Pjp = P_JP(PjpRaw); - - if (PjpRaw == (Pjp_t) NULL) // out of memory. - { - -// Free any previous allocations: - - while(CurrSubExp--) - { - NumJP = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, - CurrSubExp)); - if (NumJP) - { - j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, - CurrSubExp), NumJP, Pjpm); - } - } - j__udyFreeJBB(PjbbRaw, Pjpm); - return(-1); - } - -// Place the array of JPs in bitmap branch: - - JU_JBB_PJP(Pjbb, CurrSubExp) = PjpRaw; - -// Copy the JPs to new leaf: - - JU_COPYMEM(Pjp, PJPs + jj, NumJP); - -// On to the next bitmap branch "sub" expanse: - - jj = ii; - CurrSubExp = SubExp; - } - } // for each 1-byte expanse - -// Pass back some of the JP to the new Bitmap branch: - - Pjp->jp_Addr = (Word_t) PjbbRaw; - - return(1); - -} // j__udyCreateBranchB() - - -// **************************************************************************** -// J U D Y C R E A T E B R A N C H U -// -// Build a BranchU from a BranchB. Return with Pjp pointing to the BranchU. -// Free the BranchB and its JP subarrays. -// -// Return -1 if error (details in Pjpm), otherwise return 1. - -FUNCTION int j__udyCreateBranchU( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - jp_t JPNull; - Pjbu_t PjbuRaw; - Pjbu_t Pjbu; - Pjbb_t PjbbRaw; - Pjbb_t Pjbb; - Word_t ii, jj; - BITMAPB_t BitMap; - Pjp_t PDstJP; -#ifdef JU_STAGED_EXP - jbu_t BranchU; // Staged uncompressed branch -#else - -// Allocate memory for a BranchU: - - PjbuRaw = j__udyAllocJBU(Pjpm); - if (PjbuRaw == (Pjbu_t) NULL) return(-1); - Pjbu = P_JBU(PjbuRaw); -#endif - JU_JPSETADT(&JPNull, 0, 0, JU_JPTYPE(Pjp) - cJU_JPBRANCH_B2 + cJU_JPNULL1); - -// Get the pointer to the BranchB: - - PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); - Pjbb = P_JBB(PjbbRaw); - -// Set the pointer to the Uncompressed branch -#ifdef JU_STAGED_EXP - PDstJP = BranchU.jbu_jp; -#else - PDstJP = Pjbu->jbu_jp; -#endif - for (ii = 0; ii < cJU_NUMSUBEXPB; ii++) - { - Pjp_t PjpA; - Pjp_t PjpB; - - PjpB = PjpA = P_JP(JU_JBB_PJP(Pjbb, ii)); - -// Get the bitmap for this subexpanse - BitMap = JU_JBB_BITMAP(Pjbb, ii); - -// NULL empty subexpanses - if (BitMap == 0) - { -// But, fill with NULLs - for (jj = 0; jj < cJU_BITSPERSUBEXPB; jj++) - { - PDstJP[jj] = JPNull; - } - PDstJP += cJU_BITSPERSUBEXPB; - continue; - } -// Check if Uncompressed subexpanse - if (BitMap == cJU_FULLBITMAPB) - { -// Copy subexpanse to the Uncompressed branch intact - JU_COPYMEM(PDstJP, PjpA, cJU_BITSPERSUBEXPB); - -// Bump to next subexpanse - PDstJP += cJU_BITSPERSUBEXPB; - -// Set length of subexpanse - jj = cJU_BITSPERSUBEXPB; - } - else - { - for (jj = 0; jj < cJU_BITSPERSUBEXPB; jj++) - { -// Copy JP or NULLJP depending on bit - if (BitMap & 1) { *PDstJP = *PjpA++; } - else { *PDstJP = JPNull; } - - PDstJP++; // advance to next JP - BitMap >>= 1; - } - jj = PjpA - PjpB; - } - -// Free the subexpanse: - - j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, ii), jj, Pjpm); - - } // for each JP in BranchU - -#ifdef JU_STAGED_EXP - -// Allocate memory for a BranchU: - - PjbuRaw = j__udyAllocJBU(Pjpm); - if (PjbuRaw == (Pjbu_t) NULL) return(-1); - Pjbu = P_JBU(PjbuRaw); - -// Copy staged branch to newly allocated branch: -// -// TBD: I think this code is broken. - - *Pjbu = BranchU; - -#endif // JU_STAGED_EXP - -// Finally free the BranchB and put the BranchU in its place: - - j__udyFreeJBB(PjbbRaw, Pjpm); - - Pjp->jp_Addr = (Word_t) PjbuRaw; - Pjp->jp_Type += cJU_JPBRANCH_U - cJU_JPBRANCH_B; - - return(1); - -} // j__udyCreateBranchU() diff --git a/libjudy/src/JudyCommon/JudyDecascade.c b/libjudy/src/JudyCommon/JudyDecascade.c deleted file mode 100644 index 4f50da1854..0000000000 --- a/libjudy/src/JudyCommon/JudyDecascade.c +++ /dev/null @@ -1,1206 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.25 $ $Source: /judy/src/JudyCommon/JudyDecascade.c $ -// -// "Decascade" support functions for JudyDel.c: These functions convert -// smaller-index-size leaves to larger-index-size leaves, and also, bitmap -// leaves (LeafB1s) to Leaf1s, and some types of branches to smaller branches -// at the same index size. Some "decascading" occurs explicitly in JudyDel.c, -// but rare or large subroutines appear as functions here, and the overhead to -// call them is negligible. -// -// Compile with one of -DJUDY1 or -DJUDYL. Note: Function names are converted -// to Judy1 or JudyL specific values by external #defines. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#endif -#ifdef JUDYL -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);) - - -// **************************************************************************** -// __ J U D Y C O P Y 2 T O 3 -// -// Copy one or more 2-byte Indexes to a series of 3-byte Indexes. - -FUNCTION static void j__udyCopy2to3( - uint8_t * PDest, // to where to copy 3-byte Indexes. - uint16_t * PSrc, // from where to copy 2-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 3-byte Index. - - assert(Pop1); - - do { - Temp = MSByte | *PSrc++; - JU_COPY3_LONG_TO_PINDEX(PDest, Temp); - PDest += 3; - } while (--Pop1); - -} // j__udyCopy2to3() - - -#ifdef JU_64BIT - -// **************************************************************************** -// __ J U D Y C O P Y 3 T O 4 -// -// Copy one or more 3-byte Indexes to a series of 4-byte Indexes. - -FUNCTION static void j__udyCopy3to4( - uint32_t * PDest, // to where to copy 4-byte Indexes. - uint8_t * PSrc, // from where to copy 3-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 4-byte Index. - - assert(Pop1); - - do { - JU_COPY3_PINDEX_TO_LONG(Temp, PSrc); - Temp |= MSByte; - PSrc += 3; - *PDest++ = Temp; // truncates to uint32_t. - } while (--Pop1); - -} // j__udyCopy3to4() - - -// **************************************************************************** -// __ J U D Y C O P Y 4 T O 5 -// -// Copy one or more 4-byte Indexes to a series of 5-byte Indexes. - -FUNCTION static void j__udyCopy4to5( - uint8_t * PDest, // to where to copy 4-byte Indexes. - uint32_t * PSrc, // from where to copy 4-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 5-byte Index. - - assert(Pop1); - - do { - Temp = MSByte | *PSrc++; - JU_COPY5_LONG_TO_PINDEX(PDest, Temp); - PDest += 5; - } while (--Pop1); - -} // j__udyCopy4to5() - - -// **************************************************************************** -// __ J U D Y C O P Y 5 T O 6 -// -// Copy one or more 5-byte Indexes to a series of 6-byte Indexes. - -FUNCTION static void j__udyCopy5to6( - uint8_t * PDest, // to where to copy 6-byte Indexes. - uint8_t * PSrc, // from where to copy 5-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 6-byte Index. - - assert(Pop1); - - do { - JU_COPY5_PINDEX_TO_LONG(Temp, PSrc); - Temp |= MSByte; - JU_COPY6_LONG_TO_PINDEX(PDest, Temp); - PSrc += 5; - PDest += 6; - } while (--Pop1); - -} // j__udyCopy5to6() - - -// **************************************************************************** -// __ J U D Y C O P Y 6 T O 7 -// -// Copy one or more 6-byte Indexes to a series of 7-byte Indexes. - -FUNCTION static void j__udyCopy6to7( - uint8_t * PDest, // to where to copy 6-byte Indexes. - uint8_t * PSrc, // from where to copy 5-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 6-byte Index. - - assert(Pop1); - - do { - JU_COPY6_PINDEX_TO_LONG(Temp, PSrc); - Temp |= MSByte; - JU_COPY7_LONG_TO_PINDEX(PDest, Temp); - PSrc += 6; - PDest += 7; - } while (--Pop1); - -} // j__udyCopy6to7() - -#endif // JU_64BIT - - -#ifndef JU_64BIT // 32-bit - -// **************************************************************************** -// __ J U D Y C O P Y 3 T O W -// -// Copy one or more 3-byte Indexes to a series of longs (words, always 4-byte). - -FUNCTION static void j__udyCopy3toW( - PWord_t PDest, // to where to copy full-word Indexes. - uint8_t * PSrc, // from where to copy 3-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - assert(Pop1); - - do { - JU_COPY3_PINDEX_TO_LONG(*PDest, PSrc); - *PDest++ |= MSByte; - PSrc += 3; - } while (--Pop1); - -} // j__udyCopy3toW() - - -#else // JU_64BIT - -// **************************************************************************** -// __ J U D Y C O P Y 7 T O W -// -// Copy one or more 7-byte Indexes to a series of longs (words, always 8-byte). - -FUNCTION static void j__udyCopy7toW( - PWord_t PDest, // to where to copy full-word Indexes. - uint8_t * PSrc, // from where to copy 7-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - assert(Pop1); - - do { - JU_COPY7_PINDEX_TO_LONG(*PDest, PSrc); - *PDest++ |= MSByte; - PSrc += 7; - } while (--Pop1); - -} // j__udyCopy7toW() - -#endif // JU_64BIT - - -// **************************************************************************** -// __ J U D Y B R A N C H B T O B R A N C H L -// -// When a BranchB shrinks to have few enough JPs, call this function to convert -// it to a BranchL. Return 1 for success, or -1 for failure (with details in -// Pjpm). - -FUNCTION int j__udyBranchBToBranchL( - Pjp_t Pjp, // points to BranchB to shrink. - Pvoid_t Pjpm) // for global accounting. -{ - Pjbb_t PjbbRaw; // old BranchB to shrink. - Pjbb_t Pjbb; - Pjbl_t PjblRaw; // new BranchL to create. - Pjbl_t Pjbl; - Word_t Digit; // in BranchB. - Word_t NumJPs; // non-null JPs in BranchB. - uint8_t Expanse[cJU_BRANCHLMAXJPS]; // for building jbl_Expanse[]. - Pjp_t Pjpjbl; // current JP in BranchL. - Word_t SubExp; // in BranchB. - - assert(JU_JPTYPE(Pjp) >= cJU_JPBRANCH_B2); - assert(JU_JPTYPE(Pjp) <= cJU_JPBRANCH_B); - - PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); - Pjbb = P_JBB(PjbbRaw); - -// Copy 1-byte subexpanse digits from BranchB to temporary buffer for BranchL, -// for each bit set in the BranchB: -// -// TBD: The following supports variable-sized linear branches, but they are no -// longer variable; this could be simplified to save the copying. -// -// TBD: Since cJU_BRANCHLMAXJP == 7 now, and cJU_BRANCHUNUMJPS == 256, the -// following might be inefficient; is there a faster way to do it? At least -// skip wholly empty subexpanses? - - for (NumJPs = Digit = 0; Digit < cJU_BRANCHUNUMJPS; ++Digit) - { - if (JU_BITMAPTESTB(Pjbb, Digit)) - { - Expanse[NumJPs++] = Digit; - assert(NumJPs <= cJU_BRANCHLMAXJPS); // required of caller. - } - } - -// Allocate and populate the BranchL: - - if ((PjblRaw = j__udyAllocJBL(Pjpm)) == (Pjbl_t) NULL) return(-1); - Pjbl = P_JBL(PjblRaw); - - JU_COPYMEM(Pjbl->jbl_Expanse, Expanse, NumJPs); - - Pjbl->jbl_NumJPs = NumJPs; - DBGCODE(JudyCheckSorted((Pjll_t) (Pjbl->jbl_Expanse), NumJPs, 1);) - -// Copy JPs from each BranchB subexpanse subarray: - - Pjpjbl = P_JP(Pjbl->jbl_jp); // start at first JP in array. - - for (SubExp = 0; SubExp < cJU_NUMSUBEXPB; ++SubExp) - { - Pjp_t PjpRaw = JU_JBB_PJP(Pjbb, SubExp); // current Pjp. - Pjp_t Pjp; - - if (PjpRaw == (Pjp_t) NULL) continue; // skip empty subexpanse. - Pjp = P_JP(PjpRaw); - - NumJPs = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, SubExp)); - assert(NumJPs); - JU_COPYMEM(Pjpjbl, Pjp, NumJPs); // one subarray at a time. - - Pjpjbl += NumJPs; - j__udyFreeJBBJP(PjpRaw, NumJPs, Pjpm); // subarray. - } - j__udyFreeJBB(PjbbRaw, Pjpm); // BranchB itself. - -// Finish up: Calculate new JP type (same index size = level in new class), -// and tie new BranchB into parent JP: - - Pjp->jp_Type += cJU_JPBRANCH_L - cJU_JPBRANCH_B; - Pjp->jp_Addr = (Word_t) PjblRaw; - - return(1); - -} // j__udyBranchBToBranchL() - - -#ifdef notdef - -// **************************************************************************** -// __ J U D Y B R A N C H U T O B R A N C H B -// -// When a BranchU shrinks to need little enough memory, call this function to -// convert it to a BranchB to save memory (at the cost of some speed). Return -// 1 for success, or -1 for failure (with details in Pjpm). -// -// TBD: Fill out if/when needed. Not currently used in JudyDel.c for reasons -// explained there. - -FUNCTION int j__udyBranchUToBranchB( - Pjp_t Pjp, // points to BranchU to shrink. - Pvoid_t Pjpm) // for global accounting. -{ - assert(FALSE); - return(1); -} -#endif // notdef - - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -// **************************************************************************** -// __ J U D Y L E A F B 1 T O L E A F 1 -// -// Shrink a bitmap leaf (cJU_LEAFB1) to linear leaf (cJU_JPLEAF1). -// Return 1 for success, or -1 for failure (with details in Pjpm). -// -// Note: This function is different than the other JudyLeaf*ToLeaf*() -// functions because it receives a Pjp, not just a leaf, and handles its own -// allocation and free, in order to allow the caller to continue with a LeafB1 -// if allocation fails. - -FUNCTION int j__udyLeafB1ToLeaf1( - Pjp_t Pjp, // points to LeafB1 to shrink. - Pvoid_t Pjpm) // for global accounting. -{ - Pjlb_t PjlbRaw; // bitmap in old leaf. - Pjlb_t Pjlb; - Pjll_t PjllRaw; // new Leaf1. - uint8_t * Pleaf1; // Leaf1 pointer type. - Word_t Digit; // in LeafB1 bitmap. -#ifdef JUDYL - Pjv_t PjvNew; // value area in new Leaf1. - Word_t Pop1; - Word_t SubExp; -#endif - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF_B1); - assert(((JU_JPDCDPOP0(Pjp) & 0xFF) + 1) == cJU_LEAF1_MAXPOP1); - -// Allocate JPLEAF1 and prepare pointers: - - if ((PjllRaw = j__udyAllocJLL1(cJU_LEAF1_MAXPOP1, Pjpm)) == 0) - return(-1); - - Pleaf1 = (uint8_t *) P_JLL(PjllRaw); - PjlbRaw = (Pjlb_t) (Pjp->jp_Addr); - Pjlb = P_JLB(PjlbRaw); - JUDYLCODE(PjvNew = JL_LEAF1VALUEAREA(Pleaf1, cJL_LEAF1_MAXPOP1);) - -// Copy 1-byte indexes from old LeafB1 to new Leaf1: - - for (Digit = 0; Digit < cJU_BRANCHUNUMJPS; ++Digit) - if (JU_BITMAPTESTL(Pjlb, Digit)) - *Pleaf1++ = Digit; - -#ifdef JUDYL - -// Copy all old-LeafB1 value areas from value subarrays to new Leaf1: - - for (SubExp = 0; SubExp < cJU_NUMSUBEXPL; ++SubExp) - { - Pjv_t PjvRaw = JL_JLB_PVALUE(Pjlb, SubExp); - Pjv_t Pjv = P_JV(PjvRaw); - - if (Pjv == (Pjv_t) NULL) continue; // skip empty subarray. - - Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, SubExp)); // subarray. - assert(Pop1); - - JU_COPYMEM(PjvNew, Pjv, Pop1); // copy value areas. - j__udyLFreeJV(PjvRaw, Pop1, Pjpm); - PjvNew += Pop1; // advance through new. - } - - assert((((Word_t) Pleaf1) - (Word_t) P_JLL(PjllRaw)) - == (PjvNew - JL_LEAF1VALUEAREA(P_JLL(PjllRaw), cJL_LEAF1_MAXPOP1))); -#endif // JUDYL - - DBGCODE(JudyCheckSorted((Pjll_t) P_JLL(PjllRaw), - (((Word_t) Pleaf1) - (Word_t) P_JLL(PjllRaw)), 1);) - -// Finish up: Free the old LeafB1 and plug the new Leaf1 into the JP: -// -// Note: jp_DcdPopO does not change here. - - j__udyFreeJLB1(PjlbRaw, Pjpm); - - Pjp->jp_Addr = (Word_t) PjllRaw; - Pjp->jp_Type = cJU_JPLEAF1; - - return(1); - -} // j__udyLeafB1ToLeaf1() - -#endif // (JUDYL || (! JU_64BIT)) - - -// **************************************************************************** -// __ J U D Y L E A F 1 T O L E A F 2 -// -// Copy 1-byte Indexes from a LeafB1 or Leaf1 to 2-byte Indexes in a Leaf2. -// Pjp MUST be one of: cJU_JPLEAF_B1, cJU_JPLEAF1, or cJU_JPIMMED_1_*. -// Return number of Indexes copied. -// -// TBD: In this and all following functions, the caller should already be able -// to compute the Pop1 return value, so why return it? - -FUNCTION Word_t j__udyLeaf1ToLeaf2( - uint16_t * PLeaf2, // destination uint16_t * Index portion of leaf. -#ifdef JUDYL - Pjv_t Pjv2, // destination value part of leaf. -#endif - Pjp_t Pjp, // 1-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. - Word_t Offset; // in linear leaf list. -JUDYLCODE(Pjv_t Pjv1Raw;) // source object value area. -JUDYLCODE(Pjv_t Pjv1;) - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF_B1: - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb = P_JLB(Pjp->jp_Addr); - Word_t Digit; // in LeafB1 bitmap. - JUDYLCODE(Word_t SubExp;) // in LeafB1. - - Pop1 = JU_JPBRANCH_POP0(Pjp, 1) + 1; assert(Pop1); - -// Copy 1-byte indexes from old LeafB1 to new Leaf2, including splicing in -// the missing MSByte needed in the Leaf2: - - for (Digit = 0; Digit < cJU_BRANCHUNUMJPS; ++Digit) - if (JU_BITMAPTESTL(Pjlb, Digit)) - *PLeaf2++ = MSByte | Digit; - -#ifdef JUDYL - -// Copy all old-LeafB1 value areas from value subarrays to new Leaf2: - - for (SubExp = 0; SubExp < cJU_NUMSUBEXPL; ++SubExp) - { - Word_t SubExpPop1; - - Pjv1Raw = JL_JLB_PVALUE(Pjlb, SubExp); - if (Pjv1Raw == (Pjv_t) NULL) continue; // skip empty. - Pjv1 = P_JV(Pjv1Raw); - - SubExpPop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, SubExp)); - assert(SubExpPop1); - - JU_COPYMEM(Pjv2, Pjv1, SubExpPop1); // copy value areas. - j__udyLFreeJV(Pjv1Raw, SubExpPop1, Pjpm); - Pjv2 += SubExpPop1; // advance through new. - } -#endif // JUDYL - - j__udyFreeJLB1((Pjlb_t) (Pjp->jp_Addr), Pjpm); // LeafB1 itself. - return(Pop1); - - } // case cJU_JPLEAF_B1 - - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -// JPLEAF1: - - case cJU_JPLEAF1: - { - uint8_t * PLeaf1 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPBRANCH_POP0(Pjp, 1) + 1; assert(Pop1); - JUDYLCODE(Pjv1 = JL_LEAF1VALUEAREA(PLeaf1, Pop1);) - -// Copy all Index bytes including splicing in missing MSByte needed in Leaf2 -// (plus, for JudyL, value areas): - - for (Offset = 0; Offset < Pop1; ++Offset) - { - PLeaf2[Offset] = MSByte | PLeaf1[Offset]; - JUDYLCODE(Pjv2[Offset] = Pjv1[Offset];) - } - j__udyFreeJLL1((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } -#endif // (JUDYL || (! JU_64BIT)) - - -// JPIMMED_1_01: -// -// Note: jp_DcdPopO has 3 [7] bytes of Index (all but most significant byte), -// so the assignment to PLeaf2[] truncates and MSByte is not needed. - - case cJU_JPIMMED_1_01: - { - PLeaf2[0] = JU_JPDCDPOP0(Pjp); // see above. - JUDYLCODE(Pjv2[0] = Pjp->jp_Addr;) - return(1); - } - - -// JPIMMED_1_0[2+]: - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - { - Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_1_02 + 2; assert(Pop1); - JUDYLCODE(Pjv1Raw = (Pjv_t) (Pjp->jp_Addr);) - JUDYLCODE(Pjv1 = P_JV(Pjv1Raw);) - - for (Offset = 0; Offset < Pop1; ++Offset) - { -#ifdef JUDY1 - PLeaf2[Offset] = MSByte | Pjp->jp_1Index[Offset]; -#else - PLeaf2[Offset] = MSByte | Pjp->jp_LIndex[Offset]; - Pjv2 [Offset] = Pjv1[Offset]; -#endif - } - JUDYLCODE(j__udyLFreeJV(Pjv1Raw, Pop1, Pjpm);) - return(Pop1); - } - - -// UNEXPECTED CASES, including JPNULL1, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf1ToLeaf2() - - -// ***************************************************************************** -// __ J U D Y L E A F 2 T O L E A F 3 -// -// Copy 2-byte Indexes from a Leaf2 to 3-byte Indexes in a Leaf3. -// Pjp MUST be one of: cJU_JPLEAF2 or cJU_JPIMMED_2_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-3 branch to a -// Leaf3, the branch has no narrow pointers under it, meaning only level-2 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf2ToLeaf3( - uint8_t * PLeaf3, // destination "uint24_t *" Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv3, // destination value part of leaf. -#endif - Pjp_t Pjp, // 2-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -#if (defined(JUDYL) && defined(JU_64BIT)) - Pjv_t Pjv2Raw; // source object value area. -#endif -JUDYLCODE(Pjv_t Pjv2;) - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF2: - - case cJU_JPLEAF2: - { - uint16_t * PLeaf2 = (uint16_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1); - j__udyCopy2to3(PLeaf3, PLeaf2, Pop1, MSByte); -#ifdef JUDYL - Pjv2 = JL_LEAF2VALUEAREA(PLeaf2, Pop1); - JU_COPYMEM(Pjv3, Pjv2, Pop1); -#endif - j__udyFreeJLL2((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_2_01: -// -// Note: jp_DcdPopO has 3 [7] bytes of Index (all but most significant byte), -// so the "assignment" to PLeaf3[] is exact [truncates] and MSByte is not -// needed. - - case cJU_JPIMMED_2_01: - { - JU_COPY3_LONG_TO_PINDEX(PLeaf3, JU_JPDCDPOP0(Pjp)); // see above. - JUDYLCODE(Pjv3[0] = Pjp->jp_Addr;) - return(1); - } - - -// JPIMMED_2_0[2+]: - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - { - JUDY1CODE(uint16_t * PLeaf2 = (uint16_t *) (Pjp->jp_1Index);) - JUDYLCODE(uint16_t * PLeaf2 = (uint16_t *) (Pjp->jp_LIndex);) - - Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_2_02 + 2; assert(Pop1); - j__udyCopy2to3(PLeaf3, PLeaf2, Pop1, MSByte); -#ifdef JUDYL - Pjv2Raw = (Pjv_t) (Pjp->jp_Addr); - Pjv2 = P_JV(Pjv2Raw); - JU_COPYMEM(Pjv3, Pjv2, Pop1); - j__udyLFreeJV(Pjv2Raw, Pop1, Pjpm); -#endif - return(Pop1); - } -#endif // (JUDY1 || JU_64BIT) - - -// UNEXPECTED CASES, including JPNULL2, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf2ToLeaf3() - - -#ifdef JU_64BIT - -// **************************************************************************** -// __ J U D Y L E A F 3 T O L E A F 4 -// -// Copy 3-byte Indexes from a Leaf3 to 4-byte Indexes in a Leaf4. -// Pjp MUST be one of: cJU_JPLEAF3 or cJU_JPIMMED_3_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-4 branch to a -// Leaf4, the branch has no narrow pointers under it, meaning only level-3 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf3ToLeaf4( - uint32_t * PLeaf4, // destination uint32_t * Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv4, // destination value part of leaf. -#endif - Pjp_t Pjp, // 3-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv3Raw;) // source object value area. -JUDYLCODE(Pjv_t Pjv3;) - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF3: - - case cJU_JPLEAF3: - { - uint8_t * PLeaf3 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1); - j__udyCopy3to4(PLeaf4, (uint8_t *) PLeaf3, Pop1, MSByte); -#ifdef JUDYL - Pjv3 = JL_LEAF3VALUEAREA(PLeaf3, Pop1); - JU_COPYMEM(Pjv4, Pjv3, Pop1); -#endif - j__udyFreeJLL3((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_3_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), so -// the assignment to PLeaf4[] truncates and MSByte is not needed. - - case cJU_JPIMMED_3_01: - { - PLeaf4[0] = JU_JPDCDPOP0(Pjp); // see above. - JUDYLCODE(Pjv4[0] = Pjp->jp_Addr;) - return(1); - } - - -// JPIMMED_3_0[2+]: - - case cJU_JPIMMED_3_02: -#ifdef JUDY1 - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: -#endif - { - JUDY1CODE(uint8_t * PLeaf3 = (uint8_t *) (Pjp->jp_1Index);) - JUDYLCODE(uint8_t * PLeaf3 = (uint8_t *) (Pjp->jp_LIndex);) - - JUDY1CODE(Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_3_02 + 2;) - JUDYLCODE(Pop1 = 2;) - - j__udyCopy3to4(PLeaf4, PLeaf3, Pop1, MSByte); -#ifdef JUDYL - Pjv3Raw = (Pjv_t) (Pjp->jp_Addr); - Pjv3 = P_JV(Pjv3Raw); - JU_COPYMEM(Pjv4, Pjv3, Pop1); - j__udyLFreeJV(Pjv3Raw, Pop1, Pjpm); -#endif - return(Pop1); - } - - -// UNEXPECTED CASES, including JPNULL3, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf3ToLeaf4() - - -// Note: In all following j__udyLeaf*ToLeaf*() functions, JPIMMED_*_0[2+] -// cases exist for Judy1 (&& 64-bit) only. JudyL has no equivalent Immeds. - - -// ***************************************************************************** -// __ J U D Y L E A F 4 T O L E A F 5 -// -// Copy 4-byte Indexes from a Leaf4 to 5-byte Indexes in a Leaf5. -// Pjp MUST be one of: cJU_JPLEAF4 or cJU_JPIMMED_4_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-5 branch to a -// Leaf5, the branch has no narrow pointers under it, meaning only level-4 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf4ToLeaf5( - uint8_t * PLeaf5, // destination "uint40_t *" Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv5, // destination value part of leaf. -#endif - Pjp_t Pjp, // 4-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv4;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF4: - - case cJU_JPLEAF4: - { - uint32_t * PLeaf4 = (uint32_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1); - j__udyCopy4to5(PLeaf5, PLeaf4, Pop1, MSByte); -#ifdef JUDYL - Pjv4 = JL_LEAF4VALUEAREA(PLeaf4, Pop1); - JU_COPYMEM(Pjv5, Pjv4, Pop1); -#endif - j__udyFreeJLL4((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_4_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), so -// the assignment to PLeaf5[] truncates and MSByte is not needed. - - case cJU_JPIMMED_4_01: - { - JU_COPY5_LONG_TO_PINDEX(PLeaf5, JU_JPDCDPOP0(Pjp)); // see above. - JUDYLCODE(Pjv5[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_4_0[4+]: - - case cJ1_JPIMMED_4_02: - case cJ1_JPIMMED_4_03: - { - uint32_t * PLeaf4 = (uint32_t *) (Pjp->jp_1Index); - - Pop1 = JU_JPTYPE(Pjp) - cJ1_JPIMMED_4_02 + 2; - j__udyCopy4to5(PLeaf5, PLeaf4, Pop1, MSByte); - return(Pop1); - } -#endif // JUDY1 - - -// UNEXPECTED CASES, including JPNULL4, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf4ToLeaf5() - - -// **************************************************************************** -// __ J U D Y L E A F 5 T O L E A F 6 -// -// Copy 5-byte Indexes from a Leaf5 to 6-byte Indexes in a Leaf6. -// Pjp MUST be one of: cJU_JPLEAF5 or cJU_JPIMMED_5_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-6 branch to a -// Leaf6, the branch has no narrow pointers under it, meaning only level-5 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf5ToLeaf6( - uint8_t * PLeaf6, // destination uint8_t * Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv6, // destination value part of leaf. -#endif - Pjp_t Pjp, // 5-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv5;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF5: - - case cJU_JPLEAF5: - { - uint8_t * PLeaf5 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1); - j__udyCopy5to6(PLeaf6, PLeaf5, Pop1, MSByte); -#ifdef JUDYL - Pjv5 = JL_LEAF5VALUEAREA(PLeaf5, Pop1); - JU_COPYMEM(Pjv6, Pjv5, Pop1); -#endif - j__udyFreeJLL5((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_5_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), so -// the assignment to PLeaf6[] truncates and MSByte is not needed. - - case cJU_JPIMMED_5_01: - { - JU_COPY6_LONG_TO_PINDEX(PLeaf6, JU_JPDCDPOP0(Pjp)); // see above. - JUDYLCODE(Pjv6[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_5_0[2+]: - - case cJ1_JPIMMED_5_02: - case cJ1_JPIMMED_5_03: - { - uint8_t * PLeaf5 = (uint8_t *) (Pjp->jp_1Index); - - Pop1 = JU_JPTYPE(Pjp) - cJ1_JPIMMED_5_02 + 2; - j__udyCopy5to6(PLeaf6, PLeaf5, Pop1, MSByte); - return(Pop1); - } -#endif // JUDY1 - - -// UNEXPECTED CASES, including JPNULL5, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf5ToLeaf6() - - -// ***************************************************************************** -// __ J U D Y L E A F 6 T O L E A F 7 -// -// Copy 6-byte Indexes from a Leaf2 to 7-byte Indexes in a Leaf7. -// Pjp MUST be one of: cJU_JPLEAF6 or cJU_JPIMMED_6_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-7 branch to a -// Leaf7, the branch has no narrow pointers under it, meaning only level-6 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf6ToLeaf7( - uint8_t * PLeaf7, // destination "uint24_t *" Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv7, // destination value part of leaf. -#endif - Pjp_t Pjp, // 6-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv6;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF6: - - case cJU_JPLEAF6: - { - uint8_t * PLeaf6 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyCopy6to7(PLeaf7, PLeaf6, Pop1, MSByte); -#ifdef JUDYL - Pjv6 = JL_LEAF6VALUEAREA(PLeaf6, Pop1); - JU_COPYMEM(Pjv7, Pjv6, Pop1); -#endif - j__udyFreeJLL6((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_6_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), so -// the "assignment" to PLeaf7[] is exact and MSByte is not needed. - - case cJU_JPIMMED_6_01: - { - JU_COPY7_LONG_TO_PINDEX(PLeaf7, JU_JPDCDPOP0(Pjp)); // see above. - JUDYLCODE(Pjv7[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_6_02: - - case cJ1_JPIMMED_6_02: - { - uint8_t * PLeaf6 = (uint8_t *) (Pjp->jp_1Index); - - j__udyCopy6to7(PLeaf7, PLeaf6, /* Pop1 = */ 2, MSByte); - return(2); - } -#endif // JUDY1 - - -// UNEXPECTED CASES, including JPNULL6, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf6ToLeaf7() - -#endif // JU_64BIT - - -#ifndef JU_64BIT // 32-bit version first - -// **************************************************************************** -// __ J U D Y L E A F 3 T O L E A F W -// -// Copy 3-byte Indexes from a Leaf3 to 4-byte Indexes in a LeafW. Pjp MUST be -// one of: cJU_JPLEAF3 or cJU_JPIMMED_3_*. Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-L branch to a -// LeafW, the branch has no narrow pointers under it, meaning only level-3 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf3ToLeafW( - Pjlw_t Pjlw, // destination Index part of leaf. -#ifdef JUDYL - Pjv_t PjvW, // destination value part of leaf. -#endif - Pjp_t Pjp, // 3-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv3;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF3: - - case cJU_JPLEAF3: - { - uint8_t * PLeaf3 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyCopy3toW((PWord_t) Pjlw, PLeaf3, Pop1, MSByte); -#ifdef JUDYL - Pjv3 = JL_LEAF3VALUEAREA(PLeaf3, Pop1); - JU_COPYMEM(PjvW, Pjv3, Pop1); -#endif - j__udyFreeJLL3((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_3_01: -// -// Note: jp_DcdPopO has 3 bytes of Index (all but most significant byte), and -// MSByte must be ord in. - - case cJU_JPIMMED_3_01: - { - Pjlw[0] = MSByte | JU_JPDCDPOP0(Pjp); // see above. - JUDYLCODE(PjvW[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_3_02: - - case cJU_JPIMMED_3_02: - { - uint8_t * PLeaf3 = (uint8_t *) (Pjp->jp_1Index); - - j__udyCopy3toW((PWord_t) Pjlw, PLeaf3, /* Pop1 = */ 2, MSByte); - return(2); - } -#endif // JUDY1 - - -// UNEXPECTED CASES, including JPNULL3, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf3ToLeafW() - - -#else // JU_64BIT - - -// **************************************************************************** -// __ J U D Y L E A F 7 T O L E A F W -// -// Copy 7-byte Indexes from a Leaf7 to 8-byte Indexes in a LeafW. -// Pjp MUST be one of: cJU_JPLEAF7 or cJU_JPIMMED_7_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-L branch to a -// LeafW, the branch has no narrow pointers under it, meaning only level-7 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf7ToLeafW( - Pjlw_t Pjlw, // destination Index part of leaf. -#ifdef JUDYL - Pjv_t PjvW, // destination value part of leaf. -#endif - Pjp_t Pjp, // 7-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv7;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF7: - - case cJU_JPLEAF7: - { - uint8_t * PLeaf7 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyCopy7toW((PWord_t) Pjlw, PLeaf7, Pop1, MSByte); -#ifdef JUDYL - Pjv7 = JL_LEAF7VALUEAREA(PLeaf7, Pop1); - JU_COPYMEM(PjvW, Pjv7, Pop1); -#endif - j__udyFreeJLL7((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_7_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), and -// MSByte must be ord in. - - case cJU_JPIMMED_7_01: - { - Pjlw[0] = MSByte | JU_JPDCDPOP0(Pjp); // see above. - JUDYLCODE(PjvW[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_7_02: - - case cJ1_JPIMMED_7_02: - { - uint8_t * PLeaf7 = (uint8_t *) (Pjp->jp_1Index); - - j__udyCopy7toW((PWord_t) Pjlw, PLeaf7, /* Pop1 = */ 2, MSByte); - return(2); - } -#endif - - -// UNEXPECTED CASES, including JPNULL7, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf7ToLeafW() - -#endif // JU_64BIT diff --git a/libjudy/src/JudyCommon/JudyDel.c b/libjudy/src/JudyCommon/JudyDel.c deleted file mode 100644 index ced4b5fb30..0000000000 --- a/libjudy/src/JudyCommon/JudyDel.c +++ /dev/null @@ -1,2146 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.68 $ $Source: /judy/src/JudyCommon/JudyDel.c $ -// -// Judy1Unset() and JudyLDel() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// About HYSTERESIS: In the Judy code, hysteresis means leaving around a -// nominally suboptimal (not maximally compressed) data structure after a -// deletion. As a result, the shape of the tree for two identical index sets -// can differ depending on the insert/delete path taken to arrive at the index -// sets. The purpose is to minimize worst-case behavior (thrashing) that could -// result from a series of intermixed insertions and deletions. It also makes -// for MUCH simpler code, because instead of performing, "delete and then -// compress," it can say, "compress and then delete," where due to hysteresis, -// compression is not even attempted until the object IS compressible. -// -// In some cases the code has no choice and it must "ungrow" a data structure -// across a "phase transition" boundary without hysteresis. In other cases the -// amount (such as "hysteresis = 1") is indicated by the number of JP deletions -// (in branches) or index deletions (in leaves) that can occur in succession -// before compressing the data structure. (It appears that hysteresis <= 1 in -// all cases.) -// -// In general no hysteresis occurs when the data structure type remains the -// same but the allocated memory chunk for the node must shrink, because the -// relationship is hardwired and theres no way to know how much memory is -// allocated to a given data structure. Hysteresis = 0 in all these cases. -// -// TBD: Could this code be faster if memory chunk hysteresis were supported -// somehow along with data structure type hysteresis? -// -// TBD: Should some of the assertions here be converted to product code that -// returns JU_ERRNO_CORRUPT? -// -// TBD: Dougs code had an odd mix of function-wide and limited-scope -// variables. Should some of the function-wide variables appear only in -// limited scopes, or more likely, vice-versa? - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);) -DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);) - -#ifdef TRACEJP -#include "JudyPrintJP.c" -#endif - -// These are defined to generic values in JudyCommon/JudyPrivateTypes.h: -// -// TBD: These should be exported from a header file, but perhaps not, as they -// are only used here, and exported from JudyDecascade.c, which is a separate -// file for profiling reasons (to prevent inlining), but which potentially -// could be merged with this file, either in SoftCM or at compile-time: - -#ifdef JUDY1 - -extern int j__udy1BranchBToBranchL(Pjp_t Pjp, Pvoid_t Pjpm); -#ifndef JU_64BIT -extern int j__udy1LeafB1ToLeaf1(Pjp_t, Pvoid_t); -#endif -extern Word_t j__udy1Leaf1ToLeaf2(uint16_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf2ToLeaf3(uint8_t *, Pjp_t, Word_t, Pvoid_t); -#ifndef JU_64BIT -extern Word_t j__udy1Leaf3ToLeafW(Pjlw_t, Pjp_t, Word_t, Pvoid_t); -#else -extern Word_t j__udy1Leaf3ToLeaf4(uint32_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf4ToLeaf5(uint8_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf5ToLeaf6(uint8_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf6ToLeaf7(uint8_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf7ToLeafW(Pjlw_t, Pjp_t, Word_t, Pvoid_t); -#endif - -#else // JUDYL - -extern int j__udyLBranchBToBranchL(Pjp_t Pjp, Pvoid_t Pjpm); -extern int j__udyLLeafB1ToLeaf1(Pjp_t, Pvoid_t); -extern Word_t j__udyLLeaf1ToLeaf2(uint16_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf2ToLeaf3(uint8_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -#ifndef JU_64BIT -extern Word_t j__udyLLeaf3ToLeafW(Pjlw_t, Pjv_t, Pjp_t, Word_t, Pvoid_t); -#else -extern Word_t j__udyLLeaf3ToLeaf4(uint32_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf4ToLeaf5(uint8_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf5ToLeaf6(uint8_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf6ToLeaf7(uint8_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf7ToLeafW(Pjlw_t, Pjv_t, Pjp_t, Word_t, Pvoid_t); -#endif - -#endif // JUDYL - -// For convenience in the calling code; "M1" means "minus one": - -#ifndef JU_64BIT -#define j__udyLeafM1ToLeafW j__udyLeaf3ToLeafW -#else -#define j__udyLeafM1ToLeafW j__udyLeaf7ToLeafW -#endif - - -// **************************************************************************** -// __ J U D Y D E L W A L K -// -// Given a pointer to a JP, an Index known to be valid, the number of bytes -// left to decode (== level in the tree), and a pointer to a global JPM, walk a -// Judy (sub)tree to do an unset/delete of that index, and possibly modify the -// JPM. This function is only called internally, and recursively. Unlike -// Judy1Test() and JudyLGet(), the extra time required for recursion should be -// negligible compared with the total. -// -// Return values: -// -// -1 error; details in JPM -// -// 0 Index already deleted (should never happen, Index is known to be valid) -// -// 1 previously valid Index deleted -// -// 2 same as 1, but in addition the JP now points to a BranchL containing a -// single JP, which should be compressed into the parent branch (if there -// is one, which is not the case for a top-level branch under a JPM) - -DBGCODE(uint8_t parentJPtype;) // parent branch JP type. - -FUNCTION static int j__udyDelWalk( - Pjp_t Pjp, // current JP under which to delete. - Word_t Index, // to delete. - Word_t ParentLevel, // of parent branch. - Pjpm_t Pjpm) // for returning info to top level. -{ - Word_t pop1; // of a leaf. - Word_t level; // of a leaf. - uint8_t digit; // from Index, in current branch. - Pjll_t PjllnewRaw; // address of newly allocated leaf. - Pjll_t Pjllnew; - int offset; // within a branch. - int retcode; // return code: -1, 0, 1, 2. -JUDYLCODE(Pjv_t PjvRaw;) // value area. -JUDYLCODE(Pjv_t Pjv;) - - DBGCODE(level = 0;) - -ContinueDelWalk: // for modifying state without recursing. - -#ifdef TRACEJP - JudyPrintJP(Pjp, "d", __LINE__); -#endif - - switch (JU_JPTYPE(Pjp)) // entry: Pjp, Index. - { - - -// **************************************************************************** -// LINEAR BRANCH: -// -// MACROS FOR COMMON CODE: -// -// Check for population too high to compress a branch to a leaf, meaning just -// descend through the branch, with a purposeful off-by-one error that -// constitutes hysteresis = 1. In other words, do not compress until the -// branchs CURRENT population fits in the leaf, even BEFORE deleting one -// index. -// -// Next is a label for branch-type-specific common code. Variables pop1, -// level, digit, and Index are in the context. - -#define JU_BRANCH_KEEP(cLevel,MaxPop1,Next) \ - if (pop1 > (MaxPop1)) /* hysteresis = 1 */ \ - { \ - assert((cLevel) >= 2); \ - level = (cLevel); \ - digit = JU_DIGITATSTATE(Index, cLevel); \ - goto Next; \ - } - -// Support for generic calling of JudyLeaf*ToLeaf*() functions: -// -// Note: Cannot use JUDYLCODE() because this contains a comma. - -#ifdef JUDY1 -#define JU_PVALUEPASS // null. -#else -#define JU_PVALUEPASS Pjv, -#endif - -// During compression to a leaf, check if a JP contains nothing but a -// cJU_JPIMMED_*_01, in which case shortcut calling j__udyLeaf*ToLeaf*(): -// -// Copy the index bytes from the jp_DcdPopO field (with possible truncation), -// and continue the branch-JP-walk loop. Variables Pjp and Pleaf are in the -// context. - -#define JU_BRANCH_COPY_IMMED_EVEN(cLevel,Pjp,ignore) \ - if (JU_JPTYPE(Pjp) == cJU_JPIMMED_1_01 + (cLevel) - 2) \ - { \ - *Pleaf++ = JU_JPDCDPOP0(Pjp); \ - JUDYLCODE(*Pjv++ = (Pjp)->jp_Addr;) \ - continue; /* for-loop */ \ - } - -#define JU_BRANCH_COPY_IMMED_ODD(cLevel,Pjp,CopyIndex) \ - if (JU_JPTYPE(Pjp) == cJU_JPIMMED_1_01 + (cLevel) - 2) \ - { \ - CopyIndex(Pleaf, (Word_t) (JU_JPDCDPOP0(Pjp))); \ - Pleaf += (cLevel); /* index size = level */ \ - JUDYLCODE(*Pjv++ = (Pjp)->jp_Addr;) \ - continue; /* for-loop */ \ - } - -// Compress a BranchL into a leaf one index size larger: -// -// Allocate a new leaf, walk the JPs in the old BranchL and pack their contents -// into the new leaf (of type NewJPType), free the old BranchL, and finally -// restart the switch to delete Index from the new leaf. (Note that all -// BranchLs are the same size.) Variables Pjp, Pjpm, Pleaf, digit, and pop1 -// are in the context. - -#define JU_BRANCHL_COMPRESS(cLevel,LeafType,MaxPop1,NewJPType, \ - LeafToLeaf,Alloc,ValueArea, \ - CopyImmed,CopyIndex) \ - { \ - LeafType Pleaf; \ - Pjbl_t PjblRaw; \ - Pjbl_t Pjbl; \ - Word_t numJPs; \ - \ - if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - Pleaf = (LeafType) Pjllnew; \ - JUDYLCODE(Pjv = ValueArea(Pleaf, MaxPop1);) \ - \ - PjblRaw = (Pjbl_t) (Pjp->jp_Addr); \ - Pjbl = P_JBL(PjblRaw); \ - numJPs = Pjbl->jbl_NumJPs; \ - \ - for (offset = 0; offset < numJPs; ++offset) \ - { \ - CopyImmed(cLevel, (Pjbl->jbl_jp) + offset, CopyIndex); \ - \ - pop1 = LeafToLeaf(Pleaf, JU_PVALUEPASS \ - (Pjbl->jbl_jp) + offset, \ - JU_DIGITTOSTATE(Pjbl->jbl_Expanse[offset], \ - cLevel), (Pvoid_t) Pjpm); \ - Pleaf = (LeafType) (((Word_t) Pleaf) + ((cLevel) * pop1)); \ - JUDYLCODE(Pjv += pop1;) \ - } \ - assert(((((Word_t) Pleaf) - ((Word_t) Pjllnew)) / (cLevel)) == (MaxPop1)); \ - JUDYLCODE(assert((Pjv - ValueArea(Pjllnew, MaxPop1)) == (MaxPop1));) \ - DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cLevel);) \ - \ - j__udyFreeJBL(PjblRaw, Pjpm); \ - \ - Pjp->jp_Type = (NewJPType); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - goto ContinueDelWalk; /* delete from new leaf */ \ - } - -// Overall common code for initial BranchL deletion handling: -// -// Assert that Index is in the branch, then see if the BranchL should be kept -// or else compressed to a leaf. Variables Index, Pjp, and pop1 are in the -// context. - -#define JU_BRANCHL(cLevel,MaxPop1,LeafType,NewJPType, \ - LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex) \ - \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel)); \ - assert(ParentLevel > (cLevel)); \ - \ - pop1 = JU_JPBRANCH_POP0(Pjp, cLevel) + 1; \ - JU_BRANCH_KEEP(cLevel, MaxPop1, BranchLKeep); \ - assert(pop1 == (MaxPop1)); \ - \ - JU_BRANCHL_COMPRESS(cLevel, LeafType, MaxPop1, NewJPType, \ - LeafToLeaf, Alloc, ValueArea, CopyImmed, CopyIndex) - - -// END OF MACROS, START OF CASES: - - case cJU_JPBRANCH_L2: - - JU_BRANCHL(2, cJU_LEAF2_MAXPOP1, uint16_t *, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_L3: - - JU_BRANCHL(3, cJU_LEAF3_MAXPOP1, uint8_t *, cJU_JPLEAF3, - j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY3_LONG_TO_PINDEX); - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - - JU_BRANCHL(4, cJU_LEAF4_MAXPOP1, uint32_t *, cJU_JPLEAF4, - j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_L5: - - JU_BRANCHL(5, cJU_LEAF5_MAXPOP1, uint8_t *, cJU_JPLEAF5, - j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY5_LONG_TO_PINDEX); - - case cJU_JPBRANCH_L6: - - JU_BRANCHL(6, cJU_LEAF6_MAXPOP1, uint8_t *, cJU_JPLEAF6, - j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY6_LONG_TO_PINDEX); - - case cJU_JPBRANCH_L7: - - JU_BRANCHL(7, cJU_LEAF7_MAXPOP1, uint8_t *, cJU_JPLEAF7, - j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY7_LONG_TO_PINDEX); -#endif // JU_64BIT - -// A top-level BranchL is different and cannot use JU_BRANCHL(): Dont try to -// compress to a (LEAFW) leaf yet, but leave this for a later deletion -// (hysteresis > 0); and the next JP type depends on the system word size; so -// dont use JU_BRANCH_KEEP(): - - case cJU_JPBRANCH_L: - { - Pjbl_t Pjbl; - Word_t numJPs; - - level = cJU_ROOTSTATE; - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - - // fall through: - - -// COMMON CODE FOR KEEPING AND DESCENDING THROUGH A BRANCHL: -// -// Come here with level and digit set. - -BranchLKeep: - Pjbl = P_JBL(Pjp->jp_Addr); - numJPs = Pjbl->jbl_NumJPs; - assert(numJPs > 0); - DBGCODE(parentJPtype = JU_JPTYPE(Pjp);) - -// Search for a match to the digit (valid Index => must find digit): - - for (offset = 0; (Pjbl->jbl_Expanse[offset]) != digit; ++offset) - assert(offset < numJPs - 1); - - Pjp = (Pjbl->jbl_jp) + offset; - -// If not at a (deletable) JPIMMED_*_01, continue the walk (to descend through -// the BranchL): - - assert(level >= 2); - if ((JU_JPTYPE(Pjp)) != cJU_JPIMMED_1_01 + level - 2) break; - -// At JPIMMED_*_01: Ensure the index is in the right expanse, then delete the -// Immed from the BranchL: -// -// Note: A BranchL has a fixed size and format regardless of numJPs. - - assert(JU_JPDCDPOP0(Pjp) == JU_TRIMTODCDSIZE(Index)); - - JU_DELETEINPLACE(Pjbl->jbl_Expanse, numJPs, offset, ignore); - JU_DELETEINPLACE(Pjbl->jbl_jp, numJPs, offset, ignore); - - DBGCODE(JudyCheckSorted((Pjll_t) (Pjbl->jbl_Expanse), - numJPs - 1, 1);) - -// If only one index left in the BranchL, indicate this to the caller: - - return ((--(Pjbl->jbl_NumJPs) <= 1) ? 2 : 1); - - } // case cJU_JPBRANCH_L. - - -// **************************************************************************** -// BITMAP BRANCH: -// -// MACROS FOR COMMON CODE: -// -// Note the reuse of common macros here, defined earlier: JU_BRANCH_KEEP(), -// JU_PVALUE*. -// -// Compress a BranchB into a leaf one index size larger: -// -// Allocate a new leaf, walk the JPs in the old BranchB (one bitmap subexpanse -// at a time) and pack their contents into the new leaf (of type NewJPType), -// free the old BranchB, and finally restart the switch to delete Index from -// the new leaf. Variables Pjp, Pjpm, Pleaf, digit, and pop1 are in the -// context. -// -// Note: Its no accident that the interface to JU_BRANCHB_COMPRESS() is -// identical to JU_BRANCHL_COMPRESS(). Only the details differ in how to -// traverse the branchs JPs. - -#define JU_BRANCHB_COMPRESS(cLevel,LeafType,MaxPop1,NewJPType, \ - LeafToLeaf,Alloc,ValueArea, \ - CopyImmed,CopyIndex) \ - { \ - LeafType Pleaf; \ - Pjbb_t PjbbRaw; /* BranchB to compress */ \ - Pjbb_t Pjbb; \ - Word_t subexp; /* current subexpanse number */ \ - BITMAPB_t bitmap; /* portion for this subexpanse */ \ - Pjp_t Pjp2Raw; /* one subexpanses subarray */ \ - Pjp_t Pjp2; \ - \ - if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - Pleaf = (LeafType) Pjllnew; \ - JUDYLCODE(Pjv = ValueArea(Pleaf, MaxPop1);) \ - \ - PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); \ - Pjbb = P_JBB(PjbbRaw); \ - \ - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) \ - { \ - if ((bitmap = JU_JBB_BITMAP(Pjbb, subexp)) == 0) \ - continue; /* empty subexpanse */ \ - \ - digit = subexp * cJU_BITSPERSUBEXPB; \ - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); \ - Pjp2 = P_JP(Pjp2Raw); \ - assert(Pjp2 != (Pjp_t) NULL); \ - \ - for (offset = 0; bitmap != 0; bitmap >>= 1, ++digit) \ - { \ - if (! (bitmap & 1)) \ - continue; /* empty sub-subexpanse */ \ - \ - ++offset; /* before any continue */ \ - \ - CopyImmed(cLevel, Pjp2 + offset - 1, CopyIndex); \ - \ - pop1 = LeafToLeaf(Pleaf, JU_PVALUEPASS \ - Pjp2 + offset - 1, \ - JU_DIGITTOSTATE(digit, cLevel), \ - (Pvoid_t) Pjpm); \ - Pleaf = (LeafType) (((Word_t) Pleaf) + ((cLevel) * pop1)); \ - JUDYLCODE(Pjv += pop1;) \ - } \ - j__udyFreeJBBJP(Pjp2Raw, /* pop1 = */ offset, Pjpm); \ - } \ - assert(((((Word_t) Pleaf) - ((Word_t) Pjllnew)) / (cLevel)) == (MaxPop1)); \ - JUDYLCODE(assert((Pjv - ValueArea(Pjllnew, MaxPop1)) == (MaxPop1));) \ - DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cLevel);) \ - \ - j__udyFreeJBB(PjbbRaw, Pjpm); \ - \ - Pjp->jp_Type = (NewJPType); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - goto ContinueDelWalk; /* delete from new leaf */ \ - } - -// Overall common code for initial BranchB deletion handling: -// -// Assert that Index is in the branch, then see if the BranchB should be kept -// or else compressed to a leaf. Variables Index, Pjp, and pop1 are in the -// context. - -#define JU_BRANCHB(cLevel,MaxPop1,LeafType,NewJPType, \ - LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex) \ - \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel)); \ - assert(ParentLevel > (cLevel)); \ - \ - pop1 = JU_JPBRANCH_POP0(Pjp, cLevel) + 1; \ - JU_BRANCH_KEEP(cLevel, MaxPop1, BranchBKeep); \ - assert(pop1 == (MaxPop1)); \ - \ - JU_BRANCHB_COMPRESS(cLevel, LeafType, MaxPop1, NewJPType, \ - LeafToLeaf, Alloc, ValueArea, CopyImmed, CopyIndex) - - -// END OF MACROS, START OF CASES: -// -// Note: Its no accident that the macro calls for these cases is nearly -// identical to the code for BranchLs. - - case cJU_JPBRANCH_B2: - - JU_BRANCHB(2, cJU_LEAF2_MAXPOP1, uint16_t *, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_B3: - - JU_BRANCHB(3, cJU_LEAF3_MAXPOP1, uint8_t *, cJU_JPLEAF3, - j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY3_LONG_TO_PINDEX); - -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - - JU_BRANCHB(4, cJU_LEAF4_MAXPOP1, uint32_t *, cJU_JPLEAF4, - j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_B5: - - JU_BRANCHB(5, cJU_LEAF5_MAXPOP1, uint8_t *, cJU_JPLEAF5, - j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY5_LONG_TO_PINDEX); - - case cJU_JPBRANCH_B6: - - JU_BRANCHB(6, cJU_LEAF6_MAXPOP1, uint8_t *, cJU_JPLEAF6, - j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY6_LONG_TO_PINDEX); - - case cJU_JPBRANCH_B7: - - JU_BRANCHB(7, cJU_LEAF7_MAXPOP1, uint8_t *, cJU_JPLEAF7, - j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY7_LONG_TO_PINDEX); -#endif // JU_64BIT - -// A top-level BranchB is different and cannot use JU_BRANCHB(): Dont try to -// compress to a (LEAFW) leaf yet, but leave this for a later deletion -// (hysteresis > 0); and the next JP type depends on the system word size; so -// dont use JU_BRANCH_KEEP(): - - case cJU_JPBRANCH_B: - { - Pjbb_t Pjbb; // BranchB to modify. - Word_t subexp; // current subexpanse number. - Word_t subexp2; // in second-level loop. - BITMAPB_t bitmap; // portion for this subexpanse. - BITMAPB_t bitmask; // with digits bit set. - Pjp_t Pjp2Raw; // one subexpanses subarray. - Pjp_t Pjp2; - Word_t numJPs; // in one subexpanse. - - level = cJU_ROOTSTATE; - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - - // fall through: - - -// COMMON CODE FOR KEEPING AND DESCENDING THROUGH A BRANCHB: -// -// Come here with level and digit set. - -BranchBKeep: - Pjbb = P_JBB(Pjp->jp_Addr); - subexp = digit / cJU_BITSPERSUBEXPB; - bitmap = JU_JBB_BITMAP(Pjbb, subexp); - bitmask = JU_BITPOSMASKB(digit); - assert(bitmap & bitmask); // Index valid => digits bit is set. - DBGCODE(parentJPtype = JU_JPTYPE(Pjp);) - -// Compute digits offset into the bitmap, with a fast method if all bits are -// set: - - offset = ((bitmap == (cJU_FULLBITMAPB)) ? - digit % cJU_BITSPERSUBEXPB : - j__udyCountBitsB(bitmap & JU_MASKLOWEREXC(bitmask))); - - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); - Pjp2 = P_JP(Pjp2Raw); - assert(Pjp2 != (Pjp_t) NULL); // valid subexpanse pointer. - -// If not at a (deletable) JPIMMED_*_01, continue the walk (to descend through -// the BranchB): - - if (JU_JPTYPE(Pjp2 + offset) != cJU_JPIMMED_1_01 + level - 2) - { - Pjp = Pjp2 + offset; - break; - } - -// At JPIMMED_*_01: Ensure the index is in the right expanse, then delete the -// Immed from the BranchB: - - assert(JU_JPDCDPOP0(Pjp2 + offset) - == JU_TRIMTODCDSIZE(Index)); - -// If only one index is left in the subexpanse, free the JP array: - - if ((numJPs = j__udyCountBitsB(bitmap)) == 1) - { - j__udyFreeJBBJP(Pjp2Raw, /* pop1 = */ 1, Pjpm); - JU_JBB_PJP(Pjbb, subexp) = (Pjp_t) NULL; - } - -// Shrink JP array in-place: - - else if (JU_BRANCHBJPGROWINPLACE(numJPs - 1)) - { - assert(numJPs > 0); - JU_DELETEINPLACE(Pjp2, numJPs, offset, ignore); - } - -// JP array would end up too large; compress it to a smaller one: - - else - { - Pjp_t PjpnewRaw; - Pjp_t Pjpnew; - - if ((PjpnewRaw = j__udyAllocJBBJP(numJPs - 1, Pjpm)) - == (Pjp_t) NULL) return(-1); - Pjpnew = P_JP(PjpnewRaw); - - JU_DELETECOPY(Pjpnew, Pjp2, numJPs, offset, ignore); - j__udyFreeJBBJP(Pjp2Raw, numJPs, Pjpm); // old. - - JU_JBB_PJP(Pjbb, subexp) = PjpnewRaw; - } - -// Clear digits bit in the bitmap: - - JU_JBB_BITMAP(Pjbb, subexp) ^= bitmask; - -// If the current subexpanse alone is still too large for a BranchL (with -// hysteresis = 1), the delete is all done: - - if (numJPs > cJU_BRANCHLMAXJPS) return(1); - -// Consider shrinking the current BranchB to a BranchL: -// -// Check the numbers of JPs in other subexpanses in the BranchL. Upon reaching -// the critical number of numJPs (which could be right at the start; again, -// with hysteresis = 1), its faster to just watch for any non-empty subexpanse -// than to count bits in each subexpanse. Upon finding too many JPs, give up -// on shrinking the BranchB. - - for (subexp2 = 0; subexp2 < cJU_NUMSUBEXPB; ++subexp2) - { - if (subexp2 == subexp) continue; // skip current subexpanse. - - if ((numJPs == cJU_BRANCHLMAXJPS) ? - JU_JBB_BITMAP(Pjbb, subexp2) : - ((numJPs += j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp2))) - > cJU_BRANCHLMAXJPS)) - { - return(1); // too many JPs, cannot shrink. - } - } - -// Shrink current BranchB to a BranchL: -// -// Note: In this rare case, ignore the return value, do not pass it to the -// caller, because the deletion is already successfully completed and the -// caller(s) must decrement population counts. The only errors expected from -// this call are JU_ERRNO_NOMEM and JU_ERRNO_OVERRUN, neither of which is worth -// forwarding from this point. See also 4.1, 4.8, and 4.15 of this file. - - (void) j__udyBranchBToBranchL(Pjp, Pjpm); - return(1); - - } // case. - - -// **************************************************************************** -// UNCOMPRESSED BRANCH: -// -// MACROS FOR COMMON CODE: -// -// Note the reuse of common macros here, defined earlier: JU_PVALUE*. -// -// Compress a BranchU into a leaf one index size larger: -// -// Allocate a new leaf, walk the JPs in the old BranchU and pack their contents -// into the new leaf (of type NewJPType), free the old BranchU, and finally -// restart the switch to delete Index from the new leaf. Variables Pjp, Pjpm, -// digit, and pop1 are in the context. -// -// Note: Its no accident that the interface to JU_BRANCHU_COMPRESS() is -// nearly identical to JU_BRANCHL_COMPRESS(); just NullJPType is added. The -// details differ in how to traverse the branchs JPs -- -// -// -- and also, what to do upon encountering a cJU_JPIMMED_*_01 JP. In -// BranchLs and BranchBs the JP must be deleted, but in a BranchU its merely -// converted to a null JP, and this is done by other switch cases, so the "keep -// branch" situation is simpler here and JU_BRANCH_KEEP() is not used. Also, -// theres no code to convert a BranchU to a BranchB since counting the JPs in -// a BranchU is (at least presently) expensive, and besides, keeping around a -// BranchU is form of hysteresis. - -#define JU_BRANCHU_COMPRESS(cLevel,LeafType,MaxPop1,NullJPType,NewJPType, \ - LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex) \ - { \ - LeafType Pleaf; \ - Pjbu_t PjbuRaw = (Pjbu_t) (Pjp->jp_Addr); \ - Pjp_t Pjp2 = JU_JBU_PJP0(Pjp); \ - Word_t ldigit; /* larger than uint8_t */ \ - \ - if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - Pleaf = (LeafType) Pjllnew; \ - JUDYLCODE(Pjv = ValueArea(Pleaf, MaxPop1);) \ - \ - for (ldigit = 0; ldigit < cJU_BRANCHUNUMJPS; ++ldigit, ++Pjp2) \ - { \ - /* fast-process common types: */ \ - if (JU_JPTYPE(Pjp2) == (NullJPType)) continue; \ - CopyImmed(cLevel, Pjp2, CopyIndex); \ - \ - pop1 = LeafToLeaf(Pleaf, JU_PVALUEPASS Pjp2, \ - JU_DIGITTOSTATE(ldigit, cLevel), \ - (Pvoid_t) Pjpm); \ - Pleaf = (LeafType) (((Word_t) Pleaf) + ((cLevel) * pop1)); \ - JUDYLCODE(Pjv += pop1;) \ - } \ - assert(((((Word_t) Pleaf) - ((Word_t) Pjllnew)) / (cLevel)) == (MaxPop1)); \ - JUDYLCODE(assert((Pjv - ValueArea(Pjllnew, MaxPop1)) == (MaxPop1));) \ - DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cLevel);) \ - \ - j__udyFreeJBU(PjbuRaw, Pjpm); \ - \ - Pjp->jp_Type = (NewJPType); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - goto ContinueDelWalk; /* delete from new leaf */ \ - } - -// Overall common code for initial BranchU deletion handling: -// -// Assert that Index is in the branch, then see if a BranchU should be kept or -// else compressed to a leaf. Variables level, Index, Pjp, and pop1 are in the -// context. -// -// Note: BranchU handling differs from BranchL and BranchB as described above. - -#define JU_BRANCHU(cLevel,MaxPop1,LeafType,NullJPType,NewJPType, \ - LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex) \ - \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel)); \ - assert(ParentLevel > (cLevel)); \ - DBGCODE(parentJPtype = JU_JPTYPE(Pjp);) \ - \ - pop1 = JU_JPBRANCH_POP0(Pjp, cLevel) + 1; \ - \ - if (pop1 > (MaxPop1)) /* hysteresis = 1 */ \ - { \ - level = (cLevel); \ - Pjp = P_JP(Pjp->jp_Addr) + JU_DIGITATSTATE(Index, cLevel);\ - break; /* descend to next level */ \ - } \ - assert(pop1 == (MaxPop1)); \ - \ - JU_BRANCHU_COMPRESS(cLevel, LeafType, MaxPop1, NullJPType, NewJPType, \ - LeafToLeaf, Alloc, ValueArea, CopyImmed, CopyIndex) - - -// END OF MACROS, START OF CASES: -// -// Note: Its no accident that the macro calls for these cases is nearly -// identical to the code for BranchLs, with the addition of cJU_JPNULL* -// parameters only needed for BranchUs. - - case cJU_JPBRANCH_U2: - - JU_BRANCHU(2, cJU_LEAF2_MAXPOP1, uint16_t *, - cJU_JPNULL1, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_U3: - - JU_BRANCHU(3, cJU_LEAF3_MAXPOP1, uint8_t *, - cJU_JPNULL2, cJU_JPLEAF3, - j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY3_LONG_TO_PINDEX); - -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: - - JU_BRANCHU(4, cJU_LEAF4_MAXPOP1, uint32_t *, - cJU_JPNULL3, cJU_JPLEAF4, - j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_U5: - - JU_BRANCHU(5, cJU_LEAF5_MAXPOP1, uint8_t *, - cJU_JPNULL4, cJU_JPLEAF5, - j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY5_LONG_TO_PINDEX); - - case cJU_JPBRANCH_U6: - - JU_BRANCHU(6, cJU_LEAF6_MAXPOP1, uint8_t *, - cJU_JPNULL5, cJU_JPLEAF6, - j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY6_LONG_TO_PINDEX); - - case cJU_JPBRANCH_U7: - - JU_BRANCHU(7, cJU_LEAF7_MAXPOP1, uint8_t *, - cJU_JPNULL6, cJU_JPLEAF7, - j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY7_LONG_TO_PINDEX); -#endif // JU_64BIT - -// A top-level BranchU is different and cannot use JU_BRANCHU(): Dont try to -// compress to a (LEAFW) leaf yet, but leave this for a later deletion -// (hysteresis > 0); just descend through the BranchU: - - case cJU_JPBRANCH_U: - - DBGCODE(parentJPtype = JU_JPTYPE(Pjp);) - - level = cJU_ROOTSTATE; - Pjp = P_JP(Pjp->jp_Addr) + JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - break; - - -// **************************************************************************** -// LINEAR LEAF: -// -// State transitions while deleting an Index, the inverse of the similar table -// that appears in JudyIns.c: -// -// Note: In JudyIns.c this table is not needed and does not appear until the -// Immed handling code; because once a Leaf is reached upon growing the tree, -// the situation remains simpler, but for deleting indexes, the complexity -// arises when leaves must compress to Immeds. -// -// Note: There are other transitions possible too, not shown here, such as to -// a leaf one level higher. -// -// (Yes, this is very terse... Study it and it will make sense.) -// (Note, parts of this diagram are repeated below for quick reference.) -// -// reformat JP here for Judy1 only, from word-1 to word-2 -// | -// JUDY1 && JU_64BIT JUDY1 || JU_64BIT | -// V -// (*) Leaf1 [[ => 1_15..08 ] => 1_07 => ... => 1_04 ] => 1_03 => 1_02 => 1_01 -// Leaf2 [[ => 2_07..04 ] => 2_03 => 2_02 ] => 2_01 -// Leaf3 [[ => 3_05..03 ] => 3_02 ] => 3_01 -// JU_64BIT only: -// Leaf4 [[ => 4_03..02 ]] => 4_01 -// Leaf5 [[ => 5_03..02 ]] => 5_01 -// Leaf6 [[ => 6_02 ]] => 6_01 -// Leaf7 [[ => 7_02 ]] => 7_01 -// -// (*) For Judy1 & 64-bit, go directly from a LeafB1 to cJU_JPIMMED_1_15; skip -// Leaf1, as described in Judy1.h regarding cJ1_JPLEAF1. -// -// MACROS FOR COMMON CODE: -// -// (De)compress a LeafX into a LeafY one index size (cIS) larger (X+1 = Y): -// -// This is only possible when the current leaf is under a narrow pointer -// ((ParentLevel - 1) > cIS) and its population fits in a higher-level leaf. -// Variables ParentLevel, pop1, PjllnewRaw, Pjllnew, Pjpm, and Index are in the -// context. -// -// Note: Doing an "uplevel" doesnt occur until the old leaf can be compressed -// up one level BEFORE deleting an index; that is, hysteresis = 1. -// -// Note: LeafType, MaxPop1, NewJPType, and Alloc refer to the up-level leaf, -// not the current leaf. -// -// Note: 010327: Fixed bug where the jp_DcdPopO next-uplevel digit (byte) -// above the current Pop0 value was not being cleared. When upleveling, one -// digit in jp_DcdPopO "moves" from being part of the Dcd subfield to the Pop0 -// subfield, but since a leaf maxpop1 is known to be <= 1 byte in size, the new -// Pop0 byte should always be zero. This is easy to overlook because -// JU_JPLEAF_POP0() "knows" to only use the LSB of Pop0 (for efficiency) and -// ignore the other bytes... Until someone uses cJU_POP0MASK() instead of -// JU_JPLEAF_POP0(), such as in JudyInsertBranch.c. -// -// TBD: Should JudyInsertBranch.c use JU_JPLEAF_POP0() rather than -// cJU_POP0MASK(), for efficiency? Does it know for sure its a narrow pointer -// under the leaf? Not necessarily. - -#define JU_LEAF_UPLEVEL(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) \ - \ - assert(((ParentLevel - 1) == (cIS)) || (pop1 >= (MaxPop1))); \ - \ - if (((ParentLevel - 1) > (cIS)) /* under narrow pointer */ \ - && (pop1 == (MaxPop1))) /* hysteresis = 1 */ \ - { \ - Word_t D_cdP0; \ - if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - JUDYLCODE(Pjv = ValueArea((LeafType) Pjllnew, MaxPop1);) \ - \ - (void) LeafToLeaf((LeafType) Pjllnew, JU_PVALUEPASS Pjp, \ - Index & cJU_DCDMASK(cIS), /* TBD, Doug says */ \ - (Pvoid_t) Pjpm); \ - DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cIS + 1);) \ - \ - D_cdP0 = (~cJU_MASKATSTATE((cIS) + 1)) & JU_JPDCDPOP0(Pjp); \ - JU_JPSETADT(Pjp, (Word_t)PjllnewRaw, D_cdP0, NewJPType); \ - goto ContinueDelWalk; /* delete from new leaf */ \ - } - - -// For Leaf3, only support JU_LEAF_UPLEVEL on a 64-bit system, and for Leaf7, -// there is no JU_LEAF_UPLEVEL: -// -// Note: Theres no way here to go from Leaf3 [Leaf7] to LEAFW on a 32-bit -// [64-bit] system. Thats handled in the main code, because its different in -// that a JPM is involved. - -#ifndef JU_64BIT // 32-bit. -#define JU_LEAF_UPLEVEL64(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) // null. -#else -#define JU_LEAF_UPLEVEL64(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) \ - JU_LEAF_UPLEVEL (cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) -#define JU_LEAF_UPLEVEL_NONE(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) // null. -#endif - -// Compress a Leaf* with pop1 = 2, or a JPIMMED_*_02, into a JPIMMED_*_01: -// -// Copy whichever Index is NOT being deleted (and assert that the other one is -// found; Index must be valid). This requires special handling of the Index -// bytes (and value area). Variables Pjp, Index, offset, and Pleaf are in the -// context, offset is modified to the undeleted Index, and Pjp is modified -// including jp_Addr. - - -#define JU_TOIMMED_01_EVEN(cIS,ignore1,ignore2) \ -{ \ - Word_t D_cdP0; \ - Word_t A_ddr = 0; \ - uint8_t T_ype = JU_JPTYPE(Pjp); \ - offset = (Pleaf[0] == JU_LEASTBYTES(Index, cIS)); /* undeleted Ind */ \ - assert(Pleaf[offset ? 0 : 1] == JU_LEASTBYTES(Index, cIS)); \ - D_cdP0 = (Index & cJU_DCDMASK(cIS)) | Pleaf[offset]; \ -JUDYLCODE(A_ddr = Pjv[offset];) \ - JU_JPSETADT(Pjp, A_ddr, D_cdP0, T_ype); \ -} - -#define JU_TOIMMED_01_ODD(cIS,SearchLeaf,CopyPIndex) \ - { \ - Word_t D_cdP0; \ - Word_t A_ddr = 0; \ - uint8_t T_ype = JU_JPTYPE(Pjp); \ - \ - offset = SearchLeaf(Pleaf, 2, Index); \ - assert(offset >= 0); /* Index must be valid */ \ - CopyPIndex(D_cdP0, & (Pleaf[offset ? 0 : cIS])); \ - D_cdP0 |= Index & cJU_DCDMASK(cIS); \ - JUDYLCODE(A_ddr = Pjv[offset ? 0 : 1];) \ - JU_JPSETADT(Pjp, A_ddr, D_cdP0, T_ype); \ - } - - -// Compress a Leaf* into a JPIMMED_*_0[2+]: -// -// This occurs as soon as its possible, with hysteresis = 0. Variables pop1, -// Pleaf, offset, and Pjpm are in the context. -// -// TBD: Explain why hysteresis = 0 here, rather than > 0. Probably because -// the insert code assumes if the population is small enough, an Immed is used, -// not a leaf. -// -// The differences between Judy1 and JudyL with respect to value area handling -// are just too large for completely common code between them... Oh well, some -// big ifdefs follow. - -#ifdef JUDY1 - -#define JU_LEAF_TOIMMED(cIS,LeafType,MaxPop1,BaseJPType,ignore1,\ - ignore2,ignore3,ignore4, \ - DeleteCopy,FreeLeaf) \ - \ - assert(pop1 > (MaxPop1)); \ - \ - if ((pop1 - 1) == (MaxPop1)) /* hysteresis = 0 */ \ - { \ - Pjll_t PjllRaw = (Pjll_t) (Pjp->jp_Addr); \ - DeleteCopy((LeafType) (Pjp->jp_1Index), Pleaf, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted((Pjll_t) (Pjp->jp_1Index), pop1-1, cIS);) \ - Pjp->jp_Type = (BaseJPType) - 1 + (MaxPop1) - 1; \ - FreeLeaf(PjllRaw, pop1, Pjpm); \ - return(1); \ - } - -#else // JUDYL - -// Pjv is also in the context. - -#define JU_LEAF_TOIMMED(cIS,LeafType,MaxPop1,BaseJPType,ignore1,\ - ignore2,ignore3,ignore4, \ - DeleteCopy,FreeLeaf) \ - \ - assert(pop1 > (MaxPop1)); \ - \ - if ((pop1 - 1) == (MaxPop1)) /* hysteresis = 0 */ \ - { \ - Pjll_t PjllRaw = (Pjll_t) (Pjp->jp_Addr); \ - Pjv_t PjvnewRaw; \ - Pjv_t Pjvnew; \ - \ - if ((PjvnewRaw = j__udyLAllocJV(pop1 - 1, Pjpm)) \ - == (Pjv_t) NULL) return(-1); \ - JUDYLCODE(Pjvnew = P_JV(PjvnewRaw);) \ - \ - DeleteCopy((LeafType) (Pjp->jp_LIndex), Pleaf, pop1, offset, cIS); \ - JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted((Pjll_t) (Pjp->jp_LIndex), pop1-1, cIS);) \ - FreeLeaf(PjllRaw, pop1, Pjpm); \ - Pjp->jp_Addr = (Word_t) PjvnewRaw; \ - Pjp->jp_Type = (BaseJPType) - 2 + (MaxPop1); \ - return(1); \ - } - -// A complicating factor for JudyL & 32-bit is that Leaf2..3, and for JudyL & -// 64-bit Leaf 4..7, go directly to an Immed*_01, where the value is stored in -// jp_Addr and not in a separate LeafV. For efficiency, use the following -// macro in cases where it can apply; it is rigged to do the right thing. -// Unfortunately, this requires the calling code to "know" the transition table -// and call the right macro. -// -// This variant compresses a Leaf* with pop1 = 2 into a JPIMMED_*_01: - -#define JU_LEAF_TOIMMED_01(cIS,LeafType,MaxPop1,ignore,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - \ - assert(pop1 > (MaxPop1)); \ - \ - if ((pop1 - 1) == (MaxPop1)) /* hysteresis = 0 */ \ - { \ - Pjll_t PjllRaw = (Pjll_t) (Pjp->jp_Addr); \ - ToImmed(cIS, SearchLeaf, CopyPIndex); \ - FreeLeaf(PjllRaw, pop1, Pjpm); \ - Pjp->jp_Type = (Immed01JPType); \ - return(1); \ - } -#endif // JUDYL - -// See comments above about these: -// -// Note: Here "23" means index size 2 or 3, and "47" means 4..7. - -#if (defined(JUDY1) || defined(JU_64BIT)) -#define JU_LEAF_TOIMMED_23(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - JU_LEAF_TOIMMED( cIS,LeafType,MaxPop1,BaseJPType,ignore1, \ - ignore2,ignore3,ignore4, \ - DeleteCopy,FreeLeaf) -#else // JUDYL && 32-bit -#define JU_LEAF_TOIMMED_23(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - JU_LEAF_TOIMMED_01(cIS,LeafType,MaxPop1,ignore,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) -#endif - -#ifdef JU_64BIT -#ifdef JUDY1 -#define JU_LEAF_TOIMMED_47(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - JU_LEAF_TOIMMED( cIS,LeafType,MaxPop1,BaseJPType,ignore1, \ - ignore2,ignore3,ignore4, \ - DeleteCopy,FreeLeaf) -#else // JUDYL && 64-bit -#define JU_LEAF_TOIMMED_47(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - JU_LEAF_TOIMMED_01(cIS,LeafType,MaxPop1,ignore,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) -#endif // JUDYL -#endif // JU_64BIT - -// Compress a Leaf* in place: -// -// Here hysteresis = 0 (no memory is wasted). Variables pop1, Pleaf, and -// offset, and for JudyL, Pjv, are in the context. - -#ifdef JUDY1 -#define JU_LEAF_INPLACE(cIS,GrowInPlace,DeleteInPlace) \ - if (GrowInPlace(pop1 - 1)) /* hysteresis = 0 */ \ - { \ - DeleteInPlace(Pleaf, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) \ - return(1); \ - } -#else -#define JU_LEAF_INPLACE(cIS,GrowInPlace,DeleteInPlace) \ - if (GrowInPlace(pop1 - 1)) /* hysteresis = 0 */ \ - { \ - DeleteInPlace(Pleaf, pop1, offset, cIS); \ -/**/ JU_DELETEINPLACE(Pjv, pop1, offset, ignore); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) \ - return(1); \ - } -#endif - -// Compress a Leaf* into a smaller memory object of the same JP type: -// -// Variables PjllnewRaw, Pjllnew, Pleafpop1, Pjpm, PleafRaw, Pleaf, and offset -// are in the context. - -#ifdef JUDY1 - -#define JU_LEAF_SHRINK(cIS,LeafType,DeleteCopy,Alloc,FreeLeaf,ValueArea) \ - if ((PjllnewRaw = Alloc(pop1 - 1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - DeleteCopy((LeafType) Pjllnew, Pleaf, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted(Pjllnew, pop1 - 1, cIS);) \ - FreeLeaf(PleafRaw, pop1, Pjpm); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - return(1) - -#else // JUDYL - -#define JU_LEAF_SHRINK(cIS,LeafType,DeleteCopy,Alloc,FreeLeaf,ValueArea) \ - { \ -/**/ Pjv_t Pjvnew; \ - \ - if ((PjllnewRaw = Alloc(pop1 - 1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ -/**/ Pjvnew = ValueArea(Pjllnew, pop1 - 1); \ - DeleteCopy((LeafType) Pjllnew, Pleaf, pop1, offset, cIS); \ -/**/ JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted(Pjllnew, pop1 - 1, cIS);) \ - FreeLeaf(PleafRaw, pop1, Pjpm); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - return(1); \ - } -#endif // JUDYL - -// Overall common code for Leaf* deletion handling: -// -// See if the leaf can be: -// - (de)compressed to one a level higher (JU_LEAF_UPLEVEL()), or if not, -// - compressed to an Immediate JP (JU_LEAF_TOIMMED()), or if not, -// - shrunk in place (JU_LEAF_INPLACE()), or if none of those, then -// - shrink the leaf to a smaller chunk of memory (JU_LEAF_SHRINK()). -// -// Variables Pjp, pop1, Index, and offset are in the context. -// The *Up parameters refer to a leaf one level up, if there is any. - -#define JU_LEAF(cIS, \ - UpLevel, \ - LeafTypeUp,MaxPop1Up,LeafJPTypeUp,LeafToLeaf, \ - AllocUp,ValueAreaUp, \ - LeafToImmed,ToImmed,CopyPIndex, \ - LeafType,ImmedMaxPop1,ImmedBaseJPType,Immed01JPType, \ - SearchLeaf,GrowInPlace,DeleteInPlace,DeleteCopy, \ - Alloc,FreeLeaf,ValueArea) \ - { \ - Pjll_t PleafRaw; \ - LeafType Pleaf; \ - \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cIS)); \ - assert(ParentLevel > (cIS)); \ - \ - PleafRaw = (Pjll_t) (Pjp->jp_Addr); \ - Pleaf = (LeafType) P_JLL(PleafRaw); \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - \ - UpLevel(cIS, LeafTypeUp, MaxPop1Up, LeafJPTypeUp, \ - LeafToLeaf, AllocUp, ValueAreaUp); \ - \ - offset = SearchLeaf(Pleaf, pop1, Index); \ - assert(offset >= 0); /* Index must be valid */ \ - JUDYLCODE(Pjv = ValueArea(Pleaf, pop1);) \ - \ - LeafToImmed(cIS, LeafType, ImmedMaxPop1, \ - ImmedBaseJPType, Immed01JPType, \ - ToImmed, SearchLeaf, CopyPIndex, \ - DeleteCopy, FreeLeaf); \ - \ - JU_LEAF_INPLACE(cIS, GrowInPlace, DeleteInPlace); \ - \ - JU_LEAF_SHRINK(cIS, LeafType, DeleteCopy, Alloc, FreeLeaf, \ - ValueArea); \ - } - -// END OF MACROS, START OF CASES: -// -// (*) Leaf1 [[ => 1_15..08 ] => 1_07 => ... => 1_04 ] => 1_03 => 1_02 => 1_01 - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - JU_LEAF(1, - JU_LEAF_UPLEVEL, uint16_t *, cJU_LEAF2_MAXPOP1, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA, - JU_LEAF_TOIMMED, ignore, ignore, - uint8_t *, cJU_IMMED1_MAXPOP1, - cJU_JPIMMED_1_02, cJU_JPIMMED_1_01, j__udySearchLeaf1, - JU_LEAF1GROWINPLACE, JU_DELETEINPLACE, JU_DELETECOPY, - j__udyAllocJLL1, j__udyFreeJLL1, JL_LEAF1VALUEAREA); -#endif - -// A complicating factor is that for JudyL & 32-bit, a Leaf2 must go directly -// to an Immed 2_01 and a Leaf3 must go directly to an Immed 3_01: -// -// Leaf2 [[ => 2_07..04 ] => 2_03 => 2_02 ] => 2_01 -// Leaf3 [[ => 3_05..03 ] => 3_02 ] => 3_01 -// -// Hence use JU_LEAF_TOIMMED_23 instead of JU_LEAF_TOIMMED in the cases below, -// and also the parameters ToImmed and, for odd index sizes, CopyPIndex, are -// required. - - case cJU_JPLEAF2: - - JU_LEAF(2, - JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF3_MAXPOP1, cJU_JPLEAF3, - j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA, - JU_LEAF_TOIMMED_23, JU_TOIMMED_01_EVEN, ignore, - uint16_t *, cJU_IMMED2_MAXPOP1, - cJU_JPIMMED_2_02, cJU_JPIMMED_2_01, j__udySearchLeaf2, - JU_LEAF2GROWINPLACE, JU_DELETEINPLACE, JU_DELETECOPY, - j__udyAllocJLL2, j__udyFreeJLL2, JL_LEAF2VALUEAREA); - -// On 32-bit there is no transition to "uplevel" for a Leaf3, so use -// JU_LEAF_UPLEVEL64 instead of JU_LEAF_UPLEVEL: - - case cJU_JPLEAF3: - - JU_LEAF(3, - JU_LEAF_UPLEVEL64, uint32_t *, cJU_LEAF4_MAXPOP1, - cJU_JPLEAF4, - j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA, - JU_LEAF_TOIMMED_23, - JU_TOIMMED_01_ODD, JU_COPY3_PINDEX_TO_LONG, - uint8_t *, cJU_IMMED3_MAXPOP1, - cJU_JPIMMED_3_02, cJU_JPIMMED_3_01, j__udySearchLeaf3, - JU_LEAF3GROWINPLACE, JU_DELETEINPLACE_ODD, - JU_DELETECOPY_ODD, - j__udyAllocJLL3, j__udyFreeJLL3, JL_LEAF3VALUEAREA); - -#ifdef JU_64BIT - -// A complicating factor is that for JudyL & 64-bit, a Leaf[4-7] must go -// directly to an Immed [4-7]_01: -// -// Leaf4 [[ => 4_03..02 ]] => 4_01 -// Leaf5 [[ => 5_03..02 ]] => 5_01 -// Leaf6 [[ => 6_02 ]] => 6_01 -// Leaf7 [[ => 7_02 ]] => 7_01 -// -// Hence use JU_LEAF_TOIMMED_47 instead of JU_LEAF_TOIMMED in the cases below. - - case cJU_JPLEAF4: - - JU_LEAF(4, - JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF5_MAXPOP1, cJU_JPLEAF5, - j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA, - JU_LEAF_TOIMMED_47, JU_TOIMMED_01_EVEN, ignore, - uint32_t *, cJU_IMMED4_MAXPOP1, - cJ1_JPIMMED_4_02, cJU_JPIMMED_4_01, j__udySearchLeaf4, - JU_LEAF4GROWINPLACE, JU_DELETEINPLACE, JU_DELETECOPY, - j__udyAllocJLL4, j__udyFreeJLL4, JL_LEAF4VALUEAREA); - - case cJU_JPLEAF5: - - JU_LEAF(5, - JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF6_MAXPOP1, cJU_JPLEAF6, - j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA, - JU_LEAF_TOIMMED_47, - JU_TOIMMED_01_ODD, JU_COPY5_PINDEX_TO_LONG, - uint8_t *, cJU_IMMED5_MAXPOP1, - cJ1_JPIMMED_5_02, cJU_JPIMMED_5_01, j__udySearchLeaf5, - JU_LEAF5GROWINPLACE, JU_DELETEINPLACE_ODD, - JU_DELETECOPY_ODD, - j__udyAllocJLL5, j__udyFreeJLL5, JL_LEAF5VALUEAREA); - - case cJU_JPLEAF6: - - JU_LEAF(6, - JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF7_MAXPOP1, cJU_JPLEAF7, - j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA, - JU_LEAF_TOIMMED_47, - JU_TOIMMED_01_ODD, JU_COPY6_PINDEX_TO_LONG, - uint8_t *, cJU_IMMED6_MAXPOP1, - cJ1_JPIMMED_6_02, cJU_JPIMMED_6_01, j__udySearchLeaf6, - JU_LEAF6GROWINPLACE, JU_DELETEINPLACE_ODD, - JU_DELETECOPY_ODD, - j__udyAllocJLL6, j__udyFreeJLL6, JL_LEAF6VALUEAREA); - -// There is no transition to "uplevel" for a Leaf7, so use JU_LEAF_UPLEVEL_NONE -// instead of JU_LEAF_UPLEVEL, and ignore all of the parameters to that macro: - - case cJU_JPLEAF7: - - JU_LEAF(7, - JU_LEAF_UPLEVEL_NONE, ignore1, ignore2, ignore3, ignore4, - ignore5, ignore6, - JU_LEAF_TOIMMED_47, - JU_TOIMMED_01_ODD, JU_COPY7_PINDEX_TO_LONG, - uint8_t *, cJU_IMMED7_MAXPOP1, - cJ1_JPIMMED_7_02, cJU_JPIMMED_7_01, j__udySearchLeaf7, - JU_LEAF7GROWINPLACE, JU_DELETEINPLACE_ODD, - JU_DELETECOPY_ODD, - j__udyAllocJLL7, j__udyFreeJLL7, JL_LEAF7VALUEAREA); -#endif // JU_64BIT - - -// **************************************************************************** -// BITMAP LEAF: - - case cJU_JPLEAF_B1: - { -#ifdef JUDYL - Pjv_t PjvnewRaw; // new value area. - Pjv_t Pjvnew; - Word_t subexp; // 1 of 8 subexpanses in bitmap. - Pjlb_t Pjlb; // pointer to bitmap part of the leaf. - BITMAPL_t bitmap; // for one subexpanse. - BITMAPL_t bitmask; // bit set for Indexs digit. -#endif - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, 1)); - assert(ParentLevel > 1); - // valid Index: - assert(JU_BITMAPTESTL(P_JLB(Pjp->jp_Addr), Index)); - - pop1 = JU_JPLEAF_POP0(Pjp) + 1; - -// Like a Leaf1, see if its under a narrow pointer and can become a Leaf2 -// (hysteresis = 1): - - JU_LEAF_UPLEVEL(1, uint16_t *, cJU_LEAF2_MAXPOP1, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, - JL_LEAF2VALUEAREA); - -#if (defined(JUDY1) && defined(JU_64BIT)) - -// Handle the unusual special case, on Judy1 64-bit only, where a LeafB1 goes -// directly to a JPIMMED_1_15; as described in comments in Judy1.h and -// JudyIns.c. Copy 1-byte indexes from old LeafB1 to the Immed: - - if ((pop1 - 1) == cJU_IMMED1_MAXPOP1) // hysteresis = 0. - { - Pjlb_t PjlbRaw; // bitmap in old leaf. - Pjlb_t Pjlb; - uint8_t * Pleafnew; // JPIMMED as a pointer. - Word_t ldigit; // larger than uint8_t. - - PjlbRaw = (Pjlb_t) (Pjp->jp_Addr); - Pjlb = P_JLB(PjlbRaw); - Pleafnew = Pjp->jp_1Index; - - JU_BITMAPCLEARL(Pjlb, Index); // unset Indexs bit. - -// TBD: This is very slow, there must be a better way: - - for (ldigit = 0; ldigit < cJU_BRANCHUNUMJPS; ++ldigit) - { - if (JU_BITMAPTESTL(Pjlb, ldigit)) - { - *Pleafnew++ = ldigit; - assert(Pleafnew - (Pjp->jp_1Index) - <= cJU_IMMED1_MAXPOP1); - } - } - - DBGCODE(JudyCheckSorted((Pjll_t) (Pjp->jp_1Index), - cJU_IMMED1_MAXPOP1, 1);) - j__udyFreeJLB1(PjlbRaw, Pjpm); - - Pjp->jp_Type = cJ1_JPIMMED_1_15; - return(1); - } - -#else // (JUDYL || (! JU_64BIT)) - -// Compress LeafB1 to a Leaf1: -// -// Note: 4.37 of this file contained alternate code for Judy1 only that simply -// cleared the bit and allowed the LeafB1 to go below cJU_LEAF1_MAXPOP1. This -// was the ONLY case where a malloc failure was not fatal; however, it violated -// the critical assumption that the tree is always kept in least-compressed -// form. - - if (pop1 == cJU_LEAF1_MAXPOP1) // hysteresis = 1. - { - if (j__udyLeafB1ToLeaf1(Pjp, Pjpm) == -1) return(-1); - goto ContinueDelWalk; // delete Index in new Leaf1. - } -#endif // (JUDYL || (! JU_64BIT)) - -#ifdef JUDY1 - // unset Indexs bit: - - JU_BITMAPCLEARL(P_JLB(Pjp->jp_Addr), Index); -#else // JUDYL - -// This is very different from Judy1 because of the need to manage the value -// area: -// -// Get last byte to decode from Index, and pointer to bitmap leaf: - - digit = JU_DIGITATSTATE(Index, 1); - Pjlb = P_JLB(Pjp->jp_Addr); - -// Prepare additional values: - - subexp = digit / cJU_BITSPERSUBEXPL; // which subexpanse. - bitmap = JU_JLB_BITMAP(Pjlb, subexp); // subexps 32-bit map. - PjvRaw = JL_JLB_PVALUE(Pjlb, subexp); // corresponding values. - Pjv = P_JV(PjvRaw); - bitmask = JU_BITPOSMASKL(digit); // mask for Index. - - assert(bitmap & bitmask); // Index must be valid. - - if (bitmap == cJU_FULLBITMAPL) // full bitmap, take shortcut: - { - pop1 = cJU_BITSPERSUBEXPL; - offset = digit % cJU_BITSPERSUBEXPL; - } - else // compute subexpanse pop1 and value area offset: - { - pop1 = j__udyCountBitsL(bitmap); - offset = j__udyCountBitsL(bitmap & (bitmask - 1)); - } - -// Handle solitary Index remaining in subexpanse: - - if (pop1 == 1) - { - j__udyLFreeJV(PjvRaw, 1, Pjpm); - - JL_JLB_PVALUE(Pjlb, subexp) = (Pjv_t) NULL; - JU_JLB_BITMAP(Pjlb, subexp) = 0; - - return(1); - } - -// Shrink value area in place or move to a smaller value area: - - if (JL_LEAFVGROWINPLACE(pop1 - 1)) // hysteresis = 0. - { - JU_DELETEINPLACE(Pjv, pop1, offset, ignore); - } - else - { - if ((PjvnewRaw = j__udyLAllocJV(pop1 - 1, Pjpm)) - == (Pjv_t) NULL) return(-1); - Pjvnew = P_JV(PjvnewRaw); - - JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, ignore); - j__udyLFreeJV(PjvRaw, pop1, Pjpm); - JL_JLB_PVALUE(Pjlb, subexp) = (Pjv_t) PjvnewRaw; - } - - JU_JLB_BITMAP(Pjlb, subexp) ^= bitmask; // clear Indexs bit. - -#endif // JUDYL - - return(1); - - } // case. - - -#ifdef JUDY1 - -// **************************************************************************** -// FULL POPULATION LEAF: -// -// Convert to a LeafB1 and delete the index. Hysteresis = 0; none is possible. -// -// Note: Earlier the second assertion below said, "== 2", but in fact the -// parent could be at a higher level if a fullpop is under a narrow pointer. - - case cJ1_JPFULLPOPU1: - { - Pjlb_t PjlbRaw; - Pjlb_t Pjlb; - Word_t subexp; - - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, 2)); - assert(ParentLevel > 1); // see above. - - if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL) - return(-1); - Pjlb = P_JLB(PjlbRaw); - -// Fully populate the leaf, then unset Indexs bit: - - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - JU_JLB_BITMAP(Pjlb, subexp) = cJU_FULLBITMAPL; - - JU_BITMAPCLEARL(Pjlb, Index); - - Pjp->jp_Addr = (Word_t) PjlbRaw; - Pjp->jp_Type = cJU_JPLEAF_B1; - - return(1); - } -#endif // JUDY1 - - -// **************************************************************************** -// IMMEDIATE JP: -// -// If theres just the one Index in the Immed, convert the JP to a JPNULL* -// (should only happen in a BranchU); otherwise delete the Index from the -// Immed. See the state transitions table elsewhere in this file for a summary -// of which Immed types must be handled. Hysteresis = 0; none is possible with -// Immeds. -// -// MACROS FOR COMMON CODE: -// -// Single Index remains in cJU_JPIMMED_*_01; convert JP to null: -// -// Variables Pjp and parentJPtype are in the context. -// -// Note: cJU_JPIMMED_*_01 should only be encountered in BranchUs, not in -// BranchLs or BranchBs (where its improper to merely modify the JP to be a -// null JP); that is, BranchL and BranchB code should have already handled -// any cJU_JPIMMED_*_01 by different means. - -#define JU_IMMED_01(NewJPType,ParentJPType) \ - \ - assert(parentJPtype == (ParentJPType)); \ - assert(JU_JPDCDPOP0(Pjp) == JU_TRIMTODCDSIZE(Index)); \ - JU_JPSETADT(Pjp, 0, 0, NewJPType); \ - return(1) - -// Convert cJ*_JPIMMED_*_02 to cJU_JPIMMED_*_01: -// -// Move the undeleted Index, whichever does not match the least bytes of Index, -// from undecoded-bytes-only (in jp_1Index or jp_LIndex as appropriate) to -// jp_DcdPopO (full-field). Pjp, Index, and offset are in the context. - -#define JU_IMMED_02(cIS,LeafType,NewJPType) \ - { \ - LeafType Pleaf; \ - \ - assert((ParentLevel - 1) == (cIS)); \ - JUDY1CODE(Pleaf = (LeafType) (Pjp->jp_1Index);) \ - JUDYLCODE(Pleaf = (LeafType) (Pjp->jp_LIndex);) \ - JUDYLCODE(PjvRaw = (Pjv_t) (Pjp->jp_Addr);) \ - JUDYLCODE(Pjv = P_JV(PjvRaw);) \ - JU_TOIMMED_01_EVEN(cIS, ignore, ignore); \ - JUDYLCODE(j__udyLFreeJV(PjvRaw, 2, Pjpm);) \ - Pjp->jp_Type = (NewJPType); \ - return(1); \ - } - -#if (defined(JUDY1) || defined(JU_64BIT)) - -// Variation for "odd" cJ*_JPIMMED_*_02 JP types, which are very different from -// "even" types because they use leaf search code and odd-copy macros: -// -// Note: JudyL 32-bit has no "odd" JPIMMED_*_02 types. - -#define JU_IMMED_02_ODD(cIS,NewJPType,SearchLeaf,CopyPIndex) \ - { \ - uint8_t * Pleaf; \ - \ - assert((ParentLevel - 1) == (cIS)); \ - JUDY1CODE(Pleaf = (uint8_t *) (Pjp->jp_1Index);) \ - JUDYLCODE(Pleaf = (uint8_t *) (Pjp->jp_LIndex);) \ - JUDYLCODE(PjvRaw = (Pjv_t) (Pjp->jp_Addr);) \ - JUDYLCODE(Pjv = P_JV(PjvRaw);) \ - JU_TOIMMED_01_ODD(cIS, SearchLeaf, CopyPIndex); \ - JUDYLCODE(j__udyLFreeJV(PjvRaw, 2, Pjpm);) \ - Pjp->jp_Type = (NewJPType); \ - return(1); \ - } -#endif // (JUDY1 || JU_64BIT) - -// Core code for deleting one Index (and for JudyL, its value area) from a -// larger Immed: -// -// Variables Pleaf, pop1, and offset are in the context. - -#ifdef JUDY1 -#define JU_IMMED_DEL(cIS,DeleteInPlace) \ - DeleteInPlace(Pleaf, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) - -#else // JUDYL - -// For JudyL the value area might need to be shrunk: - -#define JU_IMMED_DEL(cIS,DeleteInPlace) \ - \ - if (JL_LEAFVGROWINPLACE(pop1 - 1)) /* hysteresis = 0 */ \ - { \ - DeleteInPlace( Pleaf, pop1, offset, cIS); \ - JU_DELETEINPLACE(Pjv, pop1, offset, ignore); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) \ - } \ - else \ - { \ - Pjv_t PjvnewRaw; \ - Pjv_t Pjvnew; \ - \ - if ((PjvnewRaw = j__udyLAllocJV(pop1 - 1, Pjpm)) \ - == (Pjv_t) NULL) return(-1); \ - Pjvnew = P_JV(PjvnewRaw); \ - \ - DeleteInPlace(Pleaf, pop1, offset, cIS); \ - JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, ignore); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) \ - j__udyLFreeJV(PjvRaw, pop1, Pjpm); \ - \ - (Pjp->jp_Addr) = (Word_t) PjvnewRaw; \ - } -#endif // JUDYL - -// Delete one Index from a larger Immed where no restructuring is required: -// -// Variables pop1, Pjp, offset, and Index are in the context. - -#define JU_IMMED(cIS,LeafType,BaseJPType,SearchLeaf,DeleteInPlace) \ - { \ - LeafType Pleaf; \ - \ - assert((ParentLevel - 1) == (cIS)); \ - JUDY1CODE(Pleaf = (LeafType) (Pjp->jp_1Index);) \ - JUDYLCODE(Pleaf = (LeafType) (Pjp->jp_LIndex);) \ - JUDYLCODE(PjvRaw = (Pjv_t) (Pjp->jp_Addr);) \ - JUDYLCODE(Pjv = P_JV(PjvRaw);) \ - pop1 = (JU_JPTYPE(Pjp)) - (BaseJPType) + 2; \ - offset = SearchLeaf(Pleaf, pop1, Index); \ - assert(offset >= 0); /* Index must be valid */ \ - \ - JU_IMMED_DEL(cIS, DeleteInPlace); \ - --(Pjp->jp_Type); \ - return(1); \ - } - - -// END OF MACROS, START OF CASES: - -// Single Index remains in Immed; convert JP to null: - - case cJU_JPIMMED_1_01: JU_IMMED_01(cJU_JPNULL1, cJU_JPBRANCH_U2); - case cJU_JPIMMED_2_01: JU_IMMED_01(cJU_JPNULL2, cJU_JPBRANCH_U3); -#ifndef JU_64BIT - case cJU_JPIMMED_3_01: JU_IMMED_01(cJU_JPNULL3, cJU_JPBRANCH_U); -#else - case cJU_JPIMMED_3_01: JU_IMMED_01(cJU_JPNULL3, cJU_JPBRANCH_U4); - case cJU_JPIMMED_4_01: JU_IMMED_01(cJU_JPNULL4, cJU_JPBRANCH_U5); - case cJU_JPIMMED_5_01: JU_IMMED_01(cJU_JPNULL5, cJU_JPBRANCH_U6); - case cJU_JPIMMED_6_01: JU_IMMED_01(cJU_JPNULL6, cJU_JPBRANCH_U7); - case cJU_JPIMMED_7_01: JU_IMMED_01(cJU_JPNULL7, cJU_JPBRANCH_U); -#endif - -// Multiple Indexes remain in the Immed JP; delete the specified Index: - - case cJU_JPIMMED_1_02: - - JU_IMMED_02(1, uint8_t *, cJU_JPIMMED_1_01); - - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - JU_IMMED(1, uint8_t *, cJU_JPIMMED_1_02, - j__udySearchLeaf1, JU_DELETEINPLACE); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - - JU_IMMED_02(2, uint16_t *, cJU_JPIMMED_2_01); - - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - JU_IMMED(2, uint16_t *, cJU_JPIMMED_2_02, - j__udySearchLeaf2, JU_DELETEINPLACE); - - case cJU_JPIMMED_3_02: - - JU_IMMED_02_ODD(3, cJU_JPIMMED_3_01, - j__udySearchLeaf3, JU_COPY3_PINDEX_TO_LONG); - -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: - - JU_IMMED(3, uint8_t *, cJU_JPIMMED_3_02, - j__udySearchLeaf3, JU_DELETEINPLACE_ODD); - - case cJ1_JPIMMED_4_02: - - JU_IMMED_02(4, uint32_t *, cJU_JPIMMED_4_01); - - case cJ1_JPIMMED_4_03: - - JU_IMMED(4, uint32_t *, cJ1_JPIMMED_4_02, - j__udySearchLeaf4, JU_DELETEINPLACE); - - case cJ1_JPIMMED_5_02: - - JU_IMMED_02_ODD(5, cJU_JPIMMED_5_01, - j__udySearchLeaf5, JU_COPY5_PINDEX_TO_LONG); - - case cJ1_JPIMMED_5_03: - - JU_IMMED(5, uint8_t *, cJ1_JPIMMED_5_02, - j__udySearchLeaf5, JU_DELETEINPLACE_ODD); - - case cJ1_JPIMMED_6_02: - - JU_IMMED_02_ODD(6, cJU_JPIMMED_6_01, - j__udySearchLeaf6, JU_COPY6_PINDEX_TO_LONG); - - case cJ1_JPIMMED_7_02: - - JU_IMMED_02_ODD(7, cJU_JPIMMED_7_01, - j__udySearchLeaf7, JU_COPY7_PINDEX_TO_LONG); - -#endif // (JUDY1 && JU_64BIT) - - -// **************************************************************************** -// INVALID JP TYPE: - - default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); return(-1); - - } // switch - - -// PROCESS JP -- RECURSIVELY: -// -// For non-Immed JP types, if successful, post-decrement the population count -// at this level, or collapse a BranchL if necessary by copying the remaining -// JP in the BranchL to the parent (hysteresis = 0), which implicitly creates a -// narrow pointer if there was not already one in the hierarchy. - - assert(level); - retcode = j__udyDelWalk(Pjp, Index, level, Pjpm); - assert(retcode != 0); // should never happen. - - if ((JU_JPTYPE(Pjp)) < cJU_JPIMMED_1_01) // not an Immed. - { - switch (retcode) - { - case 1: - { - jp_t JP = *Pjp; - Word_t DcdP0; - - DcdP0 = JU_JPDCDPOP0(Pjp) - 1; // decrement count. - JU_JPSETADT(Pjp, JP.jp_Addr, DcdP0, JU_JPTYPE(&JP)); - break; - } - case 2: // collapse BranchL to single JP; see above: - { - Pjbl_t PjblRaw = (Pjbl_t) (Pjp->jp_Addr); - Pjbl_t Pjbl = P_JBL(PjblRaw); - - *Pjp = Pjbl->jbl_jp[0]; - j__udyFreeJBL(PjblRaw, Pjpm); - retcode = 1; - } - } - } - - return(retcode); - -} // j__udyDelWalk() - - -// **************************************************************************** -// J U D Y 1 U N S E T -// J U D Y L D E L -// -// Main entry point. See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1Unset -#else -FUNCTION int JudyLDel -#endif - ( - PPvoid_t PPArray, // in which to delete. - Word_t Index, // to delete. - PJError_t PJError // optional, for returning error info. - ) -{ - Word_t pop1; // population of leaf. - int offset; // at which to delete Index. - JUDY1CODE(int retcode;) // return code from Judy1Test(). -JUDYLCODE(PPvoid_t PPvalue;) // pointer from JudyLGet(). - - -// CHECK FOR NULL ARRAY POINTER (error by caller): - - if (PPArray == (PPvoid_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); - return(JERRI); - } - - -// CHECK IF INDEX IS INVALID: -// -// If so, theres nothing to do. This saves a lot of time. Pass through -// PJError, if any, from the "get" function. - -#ifdef JUDY1 - if ((retcode = Judy1Test(*PPArray, Index, PJError)) == JERRI) - return (JERRI); - - if (retcode == 0) return(0); -#else - if ((PPvalue = JudyLGet(*PPArray, Index, PJError)) == PPJERR) - return (JERRI); - - if (PPvalue == (PPvoid_t) NULL) return(0); -#endif - - -// **************************************************************************** -// PROCESS TOP LEVEL (LEAFW) BRANCHES AND LEAVES: - -// **************************************************************************** -// LEAFW LEAF, OTHER SIZE: -// -// Shrink or convert the leaf as necessary. Hysteresis = 0; none is possible. - - if (JU_LEAFW_POP0(*PPArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - JUDYLCODE(Pjv_t Pjv;) // current value area. - JUDYLCODE(Pjv_t Pjvnew;) // value area in new leaf. - Pjlw_t Pjlw = P_JLW(*PPArray); // first word of leaf. - Pjlw_t Pjlwnew; // replacement leaf. - pop1 = Pjlw[0] + 1; // first word of leaf is pop0. - -// Delete single (last) Index from array: - - if (pop1 == 1) - { - j__udyFreeJLW(Pjlw, /* pop1 = */ 1, (Pjpm_t) NULL); - *PPArray = (Pvoid_t) NULL; - return(1); - } - -// Locate Index in compressible leaf: - - offset = j__udySearchLeafW(Pjlw + 1, pop1, Index); - assert(offset >= 0); // Index must be valid. - - JUDYLCODE(Pjv = JL_LEAFWVALUEAREA(Pjlw, pop1);) - -// Delete Index in-place: -// -// Note: "Grow in place from pop1 - 1" is the logical inverse of, "shrink in -// place from pop1." Also, Pjlw points to the count word, so skip that for -// doing the deletion. - - if (JU_LEAFWGROWINPLACE(pop1 - 1)) - { - JU_DELETEINPLACE(Pjlw + 1, pop1, offset, ignore); -#ifdef JUDYL // also delete from value area: - JU_DELETEINPLACE(Pjv, pop1, offset, ignore); -#endif - DBGCODE(JudyCheckSorted((Pjll_t) (Pjlw + 1), pop1 - 1, - cJU_ROOTSTATE);) - --(Pjlw[0]); // decrement population. - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - } - -// Allocate new leaf for use in either case below: - - Pjlwnew = j__udyAllocJLW(pop1 - 1); - JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI); - -// Shrink to smaller LEAFW: -// -// Note: Skip the first word = pop0 in each leaf. - - Pjlwnew[0] = (pop1 - 1) - 1; - JU_DELETECOPY(Pjlwnew + 1, Pjlw + 1, pop1, offset, ignore); - -#ifdef JUDYL // also delete from value area: - Pjvnew = JL_LEAFWVALUEAREA(Pjlwnew, pop1 - 1); - JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, ignore); -#endif - DBGCODE(JudyCheckSorted(Pjlwnew + 1, pop1 - 1, cJU_ROOTSTATE);) - - j__udyFreeJLW(Pjlw, pop1, (Pjpm_t) NULL); - -//// *PPArray = (Pvoid_t) Pjlwnew | cJU_LEAFW); - *PPArray = (Pvoid_t) Pjlwnew; - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - - } - else - - -// **************************************************************************** -// JRP BRANCH: -// -// Traverse through the JPM to do the deletion unless the population is small -// enough to convert immediately to a LEAFW. - - { - Pjpm_t Pjpm; - Pjp_t Pjp; // top-level JP to process. - Word_t digit; // in a branch. - JUDYLCODE(Pjv_t Pjv;) // to value area. - Pjlw_t Pjlwnew; // replacement leaf. - DBGCODE(Pjlw_t Pjlwnew_orig;) - - Pjpm = P_JPM(*PPArray); // top object in array (tree). - Pjp = &(Pjpm->jpm_JP); // next object (first branch or leaf). - - assert(((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_L) - || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_B) - || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_U)); - -// WALK THE TREE -// -// Note: Recursive code in j__udyDelWalk() knows how to collapse a lower-level -// BranchL containing a single JP into the parent JP as a narrow pointer, but -// the code here cant do that for a top-level BranchL. The result can be -// PArray -> JPM -> BranchL containing a single JP. This situation is -// unavoidable because a JPM cannot contain a narrow pointer; the BranchL is -// required in order to hold the top digit decoded, and it does not collapse to -// a LEAFW until the population is low enough. -// -// TBD: Should we add a topdigit field to JPMs so they can hold narrow -// pointers? - - if (j__udyDelWalk(Pjp, Index, cJU_ROOTSTATE, Pjpm) == -1) - { - JU_COPY_ERRNO(PJError, Pjpm); - return(JERRI); - } - - --(Pjpm->jpm_Pop0); // success; decrement total population. - - if ((Pjpm->jpm_Pop0 + 1) != cJU_LEAFW_MAXPOP1) - { - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - } - -// COMPRESS A BRANCH[LBU] TO A LEAFW: -// - Pjlwnew = j__udyAllocJLW(cJU_LEAFW_MAXPOP1); - JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI); - -// Plug leaf into root pointer and set population count: - -//// *PPArray = (Pvoid_t) ((Word_t) Pjlwnew | cJU_LEAFW); - *PPArray = (Pvoid_t) Pjlwnew; -#ifdef JUDYL // prepare value area: - Pjv = JL_LEAFWVALUEAREA(Pjlwnew, cJU_LEAFW_MAXPOP1); -#endif - *Pjlwnew++ = cJU_LEAFW_MAXPOP1 - 1; // set pop0. - DBGCODE(Pjlwnew_orig = Pjlwnew;) - - switch (JU_JPTYPE(Pjp)) - { - -// JPBRANCH_L: Copy each JPs indexes to the new LEAFW and free the old -// branch: - - case cJU_JPBRANCH_L: - { - Pjbl_t PjblRaw = (Pjbl_t) (Pjp->jp_Addr); - Pjbl_t Pjbl = P_JBL(PjblRaw); - - for (offset = 0; offset < Pjbl->jbl_NumJPs; ++offset) - { - pop1 = j__udyLeafM1ToLeafW(Pjlwnew, JU_PVALUEPASS - (Pjbl->jbl_jp) + offset, - JU_DIGITTOSTATE(Pjbl->jbl_Expanse[offset], - cJU_BYTESPERWORD), - (Pvoid_t) Pjpm); - Pjlwnew += pop1; // advance through indexes. - JUDYLCODE(Pjv += pop1;) // advance through values. - } - j__udyFreeJBL(PjblRaw, Pjpm); - - assert(Pjlwnew == Pjlwnew_orig + cJU_LEAFW_MAXPOP1); - break; // delete Index from new LEAFW. - } - -// JPBRANCH_B: Copy each JPs indexes to the new LEAFW and free the old -// branch, including each JP subarray: - - case cJU_JPBRANCH_B: - { - Pjbb_t PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); - Pjbb_t Pjbb = P_JBB(PjbbRaw); - Word_t subexp; // current subexpanse number. - BITMAPB_t bitmap; // portion for this subexpanse. - Pjp_t Pjp2Raw; // one subexpanses subarray. - Pjp_t Pjp2; - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - if ((bitmap = JU_JBB_BITMAP(Pjbb, subexp)) == 0) - continue; // skip empty subexpanse. - - digit = subexp * cJU_BITSPERSUBEXPB; - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); - Pjp2 = P_JP(Pjp2Raw); - assert(Pjp2 != (Pjp_t) NULL); - -// Walk through bits for all possible sub-subexpanses (digits); increment -// offset for each populated subexpanse; until no more set bits: - - for (offset = 0; bitmap != 0; bitmap >>= 1, ++digit) - { - if (! (bitmap & 1)) // skip empty sub-subexpanse. - continue; - - pop1 = j__udyLeafM1ToLeafW(Pjlwnew, JU_PVALUEPASS - Pjp2 + offset, - JU_DIGITTOSTATE(digit, cJU_BYTESPERWORD), - (Pvoid_t) Pjpm); - Pjlwnew += pop1; // advance through indexes. - JUDYLCODE(Pjv += pop1;) // advance through values. - ++offset; - } - j__udyFreeJBBJP(Pjp2Raw, /* pop1 = */ offset, Pjpm); - } - j__udyFreeJBB(PjbbRaw, Pjpm); - - assert(Pjlwnew == Pjlwnew_orig + cJU_LEAFW_MAXPOP1); - break; // delete Index from new LEAFW. - - } // case cJU_JPBRANCH_B. - - -// JPBRANCH_U: Copy each JPs indexes to the new LEAFW and free the old -// branch: - - case cJU_JPBRANCH_U: - { - Pjbu_t PjbuRaw = (Pjbu_t) (Pjp->jp_Addr); - Pjbu_t Pjbu = P_JBU(PjbuRaw); - Word_t ldigit; // larger than uint8_t. - - for (Pjp = Pjbu->jbu_jp, ldigit = 0; - ldigit < cJU_BRANCHUNUMJPS; - ++Pjp, ++ldigit) - { - -// Shortcuts, to save a little time for possibly big branches: - - if ((JU_JPTYPE(Pjp)) == cJU_JPNULLMAX) // skip null JP. - continue; - -// TBD: Should the following shortcut also be used in BranchL and BranchB -// code? - -#ifndef JU_64BIT - if ((JU_JPTYPE(Pjp)) == cJU_JPIMMED_3_01) -#else - if ((JU_JPTYPE(Pjp)) == cJU_JPIMMED_7_01) -#endif - { // single Immed: - *Pjlwnew++ = JU_DIGITTOSTATE(ldigit, cJU_BYTESPERWORD) - | JU_JPDCDPOP0(Pjp); // rebuild Index. -#ifdef JUDYL - *Pjv++ = Pjp->jp_Addr; // copy value area. -#endif - continue; - } - - pop1 = j__udyLeafM1ToLeafW(Pjlwnew, JU_PVALUEPASS - Pjp, JU_DIGITTOSTATE(ldigit, cJU_BYTESPERWORD), - (Pvoid_t) Pjpm); - Pjlwnew += pop1; // advance through indexes. - JUDYLCODE(Pjv += pop1;) // advance through values. - } - j__udyFreeJBU(PjbuRaw, Pjpm); - - assert(Pjlwnew == Pjlwnew_orig + cJU_LEAFW_MAXPOP1); - break; // delete Index from new LEAFW. - - } // case cJU_JPBRANCH_U. - - -// INVALID JP TYPE in jpm_t struct - - default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(JERRI); - - } // end switch on sub-JP type. - - DBGCODE(JudyCheckSorted((Pjll_t) Pjlwnew_orig, cJU_LEAFW_MAXPOP1, - cJU_ROOTSTATE);) - -// FREE JPM (no longer needed): - - j__udyFreeJPM(Pjpm, (Pjpm_t) NULL); - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - - } - /*NOTREACHED*/ - -} // Judy1Unset() / JudyLDel() diff --git a/libjudy/src/JudyCommon/JudyFirst.c b/libjudy/src/JudyCommon/JudyFirst.c deleted file mode 100644 index 49d427adaf..0000000000 --- a/libjudy/src/JudyCommon/JudyFirst.c +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.12 $ $Source: /judy/src/JudyCommon/JudyFirst.c $ -// -// Judy*First[Empty]() and Judy*Last[Empty]() routines for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// These are inclusive versions of Judy*Next[Empty]() and Judy*Prev[Empty](). - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - - -// **************************************************************************** -// J U D Y 1 F I R S T -// J U D Y L F I R S T -// -// See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1First -#else -FUNCTION PPvoid_t JudyLFirst -#endif - ( - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError // optional, for returning error info. - ) -{ - if (PIndex == (PWord_t) NULL) // caller error: - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -#ifdef JUDY1 - switch (Judy1Test(PArray, *PIndex, PJError)) - { - case 1: return(1); // found *PIndex itself. - case 0: return(Judy1Next(PArray, PIndex, PJError)); - default: return(JERRI); - } -#else - { - PPvoid_t PValue; - - if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR) - return(PPJERR); - - if (PValue != (PPvoid_t) NULL) return(PValue); // found *PIndex. - - return(JudyLNext(PArray, PIndex, PJError)); - } -#endif - -} // Judy1First() / JudyLFirst() - - -// **************************************************************************** -// J U D Y 1 L A S T -// J U D Y L L A S T -// -// See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1Last( -#else -FUNCTION PPvoid_t JudyLLast( -#endif - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError) // optional, for returning error info. -{ - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); // caller error. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -#ifdef JUDY1 - switch (Judy1Test(PArray, *PIndex, PJError)) - { - case 1: return(1); // found *PIndex itself. - case 0: return(Judy1Prev(PArray, PIndex, PJError)); - default: return(JERRI); - } -#else - { - PPvoid_t PValue; - - if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR) - return(PPJERR); - - if (PValue != (PPvoid_t) NULL) return(PValue); // found *PIndex. - - return(JudyLPrev(PArray, PIndex, PJError)); - } -#endif - -} // Judy1Last() / JudyLLast() - - -// **************************************************************************** -// J U D Y 1 F I R S T E M P T Y -// J U D Y L F I R S T E M P T Y -// -// See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1FirstEmpty( -#else -FUNCTION int JudyLFirstEmpty( -#endif - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError) // optional, for returning error info. -{ - if (PIndex == (PWord_t) NULL) // caller error: - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return(JERRI); - } - -#ifdef JUDY1 - switch (Judy1Test(PArray, *PIndex, PJError)) - { - case 0: return(1); // found *PIndex itself. - case 1: return(Judy1NextEmpty(PArray, PIndex, PJError)); - default: return(JERRI); - } -#else - { - PPvoid_t PValue; - - if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR) - return(JERRI); - - if (PValue == (PPvoid_t) NULL) return(1); // found *PIndex. - - return(JudyLNextEmpty(PArray, PIndex, PJError)); - } -#endif - -} // Judy1FirstEmpty() / JudyLFirstEmpty() - - -// **************************************************************************** -// J U D Y 1 L A S T E M P T Y -// J U D Y L L A S T E M P T Y -// -// See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1LastEmpty( -#else -FUNCTION int JudyLLastEmpty( -#endif - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError) // optional, for returning error info. -{ - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); // caller error. - return(JERRI); - } - -#ifdef JUDY1 - switch (Judy1Test(PArray, *PIndex, PJError)) - { - case 0: return(1); // found *PIndex itself. - case 1: return(Judy1PrevEmpty(PArray, PIndex, PJError)); - default: return(JERRI); - } -#else - { - PPvoid_t PValue; - - if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR) - return(JERRI); - - if (PValue == (PPvoid_t) NULL) return(1); // found *PIndex. - - return(JudyLPrevEmpty(PArray, PIndex, PJError)); - } -#endif - -} // Judy1LastEmpty() / JudyLLastEmpty() diff --git a/libjudy/src/JudyCommon/JudyFreeArray.c b/libjudy/src/JudyCommon/JudyFreeArray.c deleted file mode 100644 index 1161d7dba2..0000000000 --- a/libjudy/src/JudyCommon/JudyFreeArray.c +++ /dev/null @@ -1,363 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.51 $ $Source: /judy/src/JudyCommon/JudyFreeArray.c $ -// -// Judy1FreeArray() and JudyLFreeArray() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// Return the number of bytes freed from the array. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);) - - -// **************************************************************************** -// J U D Y 1 F R E E A R R A Y -// J U D Y L F R E E A R R A Y -// -// See the Judy*(3C) manual entry for details. -// -// This code is written recursively, at least at first, because thats much -// simpler. Hope its fast enough. - -#ifdef JUDY1 -FUNCTION Word_t Judy1FreeArray -#else -FUNCTION Word_t JudyLFreeArray -#endif - ( - PPvoid_t PPArray, // array to free. - PJError_t PJError // optional, for returning error info. - ) -{ - jpm_t jpm; // local to accumulate free statistics. - -// CHECK FOR NULL POINTER (error by caller): - - if (PPArray == (PPvoid_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); - return(JERR); - } - - DBGCODE(JudyCheckPop(*PPArray);) - -// Zero jpm.jpm_Pop0 (meaning the array will be empty in a moment) for accurate -// logging in TRACEMI2. - - jpm.jpm_Pop0 = 0; // see above. - jpm.jpm_TotalMemWords = 0; // initialize memory freed. - -// Empty array: - - if (P_JLW(*PPArray) == (Pjlw_t) NULL) return(0); - -// PROCESS TOP LEVEL "JRP" BRANCHES AND LEAF: - - if (JU_LEAFW_POP0(*PPArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(*PPArray); // first word of leaf. - - j__udyFreeJLW(Pjlw, Pjlw[0] + 1, &jpm); - *PPArray = (Pvoid_t) NULL; // make an empty array. - return (-(jpm.jpm_TotalMemWords * cJU_BYTESPERWORD)); // see above. - } - else - -// Rootstate leaves: just free the leaf: - -// Common code for returning the amount of memory freed. -// -// Note: In a an ordinary LEAFW, pop0 = *PPArray[0]. -// -// Accumulate (negative) words freed, while freeing objects. -// Return the positive bytes freed. - - { - Pjpm_t Pjpm = P_JPM(*PPArray); - Word_t TotalMem = Pjpm->jpm_TotalMemWords; - - j__udyFreeSM(&(Pjpm->jpm_JP), &jpm); // recurse through tree. - j__udyFreeJPM(Pjpm, &jpm); - -// Verify the array was not corrupt. This means that amount of memory freed -// (which is negative) is equal to the initial amount: - - if (TotalMem + jpm.jpm_TotalMemWords) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - return(JERR); - } - - *PPArray = (Pvoid_t) NULL; // make an empty array. - return (TotalMem * cJU_BYTESPERWORD); - } - -} // Judy1FreeArray() / JudyLFreeArray() - - -// **************************************************************************** -// __ J U D Y F R E E S M -// -// Given a pointer to a JP, recursively visit and free (depth first) all nodes -// in a Judy array BELOW the JP, but not the JP itself. Accumulate in *Pjpm -// the total words freed (as a negative value). "SM" = State Machine. -// -// Note: Corruption is not detected at this level because during a FreeArray, -// if the code hasnt already core dumped, its better to remain silent, even -// if some memory has not been freed, than to bother the caller about the -// corruption. TBD: Is this true? If not, must list all legitimate JPNULL -// and JPIMMED above first, and revert to returning bool_t (see 4.34). - -FUNCTION void j__udyFreeSM( - Pjp_t Pjp, // top of Judy (top-state). - Pjpm_t Pjpm) // to return words freed. -{ - Word_t Pop1; - - switch (JU_JPTYPE(Pjp)) - { - -#ifdef JUDY1 - -// FULL EXPANSE -- nothing to free for this jp_Type. - - case cJ1_JPFULLPOPU1: - break; -#endif - -// JUDY BRANCH -- free the sub-tree depth first: - -// LINEAR BRANCH -- visit each JP in the JBLs list, then free the JBL: -// -// Note: There are no null JPs in a JBL. - - case cJU_JPBRANCH_L: - case cJU_JPBRANCH_L2: - case cJU_JPBRANCH_L3: -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - case cJU_JPBRANCH_L5: - case cJU_JPBRANCH_L6: - case cJU_JPBRANCH_L7: -#endif // JU_64BIT - { - Pjbl_t Pjbl = P_JBL(Pjp->jp_Addr); - Word_t offset; - - for (offset = 0; offset < Pjbl->jbl_NumJPs; ++offset) - j__udyFreeSM((Pjbl->jbl_jp) + offset, Pjpm); - - j__udyFreeJBL((Pjbl_t) (Pjp->jp_Addr), Pjpm); - break; - } - - -// BITMAP BRANCH -- visit each JP in the JBBs list based on the bitmap, also -// -// Note: There are no null JPs in a JBB. - - case cJU_JPBRANCH_B: - case cJU_JPBRANCH_B2: - case cJU_JPBRANCH_B3: -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - case cJU_JPBRANCH_B5: - case cJU_JPBRANCH_B6: - case cJU_JPBRANCH_B7: -#endif // JU_64BIT - { - Word_t subexp; - Word_t offset; - Word_t jpcount; - - Pjbb_t Pjbb = P_JBB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - - if (jpcount) - { - for (offset = 0; offset < jpcount; ++offset) - { - j__udyFreeSM(P_JP(JU_JBB_PJP(Pjbb, subexp)) + offset, - Pjpm); - } - j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, subexp), jpcount, Pjpm); - } - } - j__udyFreeJBB((Pjbb_t) (Pjp->jp_Addr), Pjpm); - - break; - } - - -// UNCOMPRESSED BRANCH -- visit each JP in the JBU array, then free the JBU -// itself: -// -// Note: Null JPs are handled during recursion at a lower state. - - case cJU_JPBRANCH_U: - case cJU_JPBRANCH_U2: - case cJU_JPBRANCH_U3: -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: - case cJU_JPBRANCH_U5: - case cJU_JPBRANCH_U6: - case cJU_JPBRANCH_U7: -#endif // JU_64BIT - { - Word_t offset; - Pjbu_t Pjbu = P_JBU(Pjp->jp_Addr); - - for (offset = 0; offset < cJU_BRANCHUNUMJPS; ++offset) - j__udyFreeSM((Pjbu->jbu_jp) + offset, Pjpm); - - j__udyFreeJBU((Pjbu_t) (Pjp->jp_Addr), Pjpm); - break; - } - - -// -- Cases below here terminate and do not recurse. -- - - -// LINEAR LEAF -- just free the leaf; size is computed from jp_Type: -// -// Note: cJU_JPLEAF1 is a special case, see discussion in ../Judy1/Judy1.h - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL1((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; -#endif - - case cJU_JPLEAF2: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL2((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPLEAF3: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL3((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - -#ifdef JU_64BIT - case cJU_JPLEAF4: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL4((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPLEAF5: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL5((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPLEAF6: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL6((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPLEAF7: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL7((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; -#endif // JU_64BIT - - -// BITMAP LEAF -- free sub-expanse arrays of JPs, then free the JBB. - - case cJU_JPLEAF_B1: - { -#ifdef JUDYL - Word_t subexp; - Word_t jpcount; - Pjlb_t Pjlb = P_JLB(Pjp->jp_Addr); - -// Free the value areas in the bitmap leaf: - - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - { - jpcount = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - - if (jpcount) - j__udyLFreeJV(JL_JLB_PVALUE(Pjlb, subexp), jpcount, Pjpm); - } -#endif // JUDYL - - j__udyFreeJLB1((Pjlb_t) (Pjp->jp_Addr), Pjpm); - break; - - } // case cJU_JPLEAF_B1 - -#ifdef JUDYL - - -// IMMED*: -// -// For JUDYL, all non JPIMMED_*_01s have a LeafV which must be freed: - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#ifdef JU_64BIT - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif - Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_1_02 + 2; - j__udyLFreeJV((Pjv_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - -#ifdef JU_64BIT - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: - - Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_2_02 + 2; - j__udyLFreeJV((Pjv_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPIMMED_3_02: - j__udyLFreeJV((Pjv_t) (Pjp->jp_Addr), 2, Pjpm); - break; - -#endif // JU_64BIT -#endif // JUDYL - - -// OTHER JPNULL, JPIMMED, OR UNEXPECTED TYPE -- nothing to free for this type: -// -// Note: Lump together no-op and invalid JP types; see function header -// comments. - - default: break; - - } // switch (JU_JPTYPE(Pjp)) - -} // j__udyFreeSM() diff --git a/libjudy/src/JudyCommon/JudyGet.c b/libjudy/src/JudyCommon/JudyGet.c deleted file mode 100644 index 0bb9971cc8..0000000000 --- a/libjudy/src/JudyCommon/JudyGet.c +++ /dev/null @@ -1,1094 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.43 $ $Source: /judy/src/JudyCommon/JudyGet.c $ -// -// Judy1Test() and JudyLGet() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -#ifdef TRACEJPR // different macro name, for "retrieval" only. -#include "JudyPrintJP.c" -#endif - - -// **************************************************************************** -// J U D Y 1 T E S T -// J U D Y L G E T -// -// See the manual entry for details. Note support for "shortcut" entries to -// trees known to start with a JPM. - -#ifdef JUDY1 - -#ifdef JUDYGETINLINE -FUNCTION int j__udy1Test -#else -FUNCTION int Judy1Test -#endif - -#else // JUDYL - -#ifdef JUDYGETINLINE -FUNCTION PPvoid_t j__udyLGet -#else -FUNCTION PPvoid_t JudyLGet -#endif - -#endif // JUDYL - ( -#ifdef JUDYGETINLINE - Pvoid_t PArray, // from which to retrieve. - Word_t Index // to retrieve. -#else - Pcvoid_t PArray, // from which to retrieve. - Word_t Index, // to retrieve. - PJError_t PJError // optional, for returning error info. -#endif - ) -{ - Pjp_t Pjp; // current JP while walking the tree. - Pjpm_t Pjpm; // for global accounting. - uint8_t Digit; // byte just decoded from Index. - Word_t Pop1; // leaf population (number of indexes). - Pjll_t Pjll; // pointer to LeafL. - DBGCODE(uint8_t ParentJPType;) - -#ifndef JUDYGETINLINE - - if (PArray == (Pcvoid_t) NULL) // empty array. - { - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - } - -// **************************************************************************** -// PROCESS TOP LEVEL BRANCHES AND LEAF: - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - int posidx; // signed offset in leaf. - - Pop1 = Pjlw[0] + 1; - posidx = j__udySearchLeafW(Pjlw + 1, Pop1, Index); - - if (posidx >= 0) - { - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAFWVALUEAREA(Pjlw, Pop1) + posidx));) - } - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - } - -#endif // ! JUDYGETINLINE - - Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); // top branch is below JPM. - -// **************************************************************************** -// WALK THE JUDY TREE USING A STATE MACHINE: - -ContinueWalk: // for going down one level; come here with Pjp set. - -#ifdef TRACEJPR - JudyPrintJP(Pjp, "g", __LINE__); -#endif - switch (JU_JPTYPE(Pjp)) - { - -// Ensure the switch table starts at 0 for speed; otherwise more code is -// executed: - - case 0: goto ReturnCorrupt; // save a little code. - - -// **************************************************************************** -// JPNULL*: -// -// Note: These are legitimate in a BranchU (only) and do not constitute a -// fault. - - case cJU_JPNULL1: - case cJU_JPNULL2: - case cJU_JPNULL3: -#ifdef JU_64BIT - case cJU_JPNULL4: - case cJU_JPNULL5: - case cJU_JPNULL6: - case cJU_JPNULL7: -#endif - assert(ParentJPType >= cJU_JPBRANCH_U2); - assert(ParentJPType <= cJU_JPBRANCH_U); - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - - -// **************************************************************************** -// JPBRANCH_L*: -// -// Note: The use of JU_DCDNOTMATCHINDEX() in branches is not strictly -// required,since this can be done at leaf level, but it costs nothing to do it -// sooner, and it aborts an unnecessary traversal sooner. - - case cJU_JPBRANCH_L2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - Digit = JU_DIGITATSTATE(Index, 2); - goto JudyBranchL; - - case cJU_JPBRANCH_L3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - Digit = JU_DIGITATSTATE(Index, 3); - goto JudyBranchL; - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - Digit = JU_DIGITATSTATE(Index, 4); - goto JudyBranchL; - - case cJU_JPBRANCH_L5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - Digit = JU_DIGITATSTATE(Index, 5); - goto JudyBranchL; - - case cJU_JPBRANCH_L6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - Digit = JU_DIGITATSTATE(Index, 6); - goto JudyBranchL; - - case cJU_JPBRANCH_L7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Digit = JU_DIGITATSTATE(Index, 7); - goto JudyBranchL; - -#endif // JU_64BIT - - case cJU_JPBRANCH_L: - { - Pjbl_t Pjbl; - int posidx; - - Digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - -// Common code for all BranchLs; come here with Digit set: - -JudyBranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - - posidx = 0; - - do { - if (Pjbl->jbl_Expanse[posidx] == Digit) - { // found Digit; continue traversal: - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = Pjbl->jbl_jp + posidx; - goto ContinueWalk; - } - } while (++posidx != Pjbl->jbl_NumJPs); - - break; - } - - -// **************************************************************************** -// JPBRANCH_B*: - - case cJU_JPBRANCH_B2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - Digit = JU_DIGITATSTATE(Index, 2); - goto JudyBranchB; - - case cJU_JPBRANCH_B3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - Digit = JU_DIGITATSTATE(Index, 3); - goto JudyBranchB; - - -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - Digit = JU_DIGITATSTATE(Index, 4); - goto JudyBranchB; - - case cJU_JPBRANCH_B5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - Digit = JU_DIGITATSTATE(Index, 5); - goto JudyBranchB; - - case cJU_JPBRANCH_B6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - Digit = JU_DIGITATSTATE(Index, 6); - goto JudyBranchB; - - case cJU_JPBRANCH_B7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Digit = JU_DIGITATSTATE(Index, 7); - goto JudyBranchB; - -#endif // JU_64BIT - - case cJU_JPBRANCH_B: - { - Pjbb_t Pjbb; - Word_t subexp; // in bitmap, 0..7. - BITMAPB_t BitMap; // for one subexpanse. - BITMAPB_t BitMask; // bit in BitMap for Indexs Digit. - - Digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - -// Common code for all BranchBs; come here with Digit set: - -JudyBranchB: - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjbb = P_JBB(Pjp->jp_Addr); - subexp = Digit / cJU_BITSPERSUBEXPB; - - BitMap = JU_JBB_BITMAP(Pjbb, subexp); - Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp)); - - BitMask = JU_BITPOSMASKB(Digit); - -// No JP in subexpanse for Index => Index not found: - - if (! (BitMap & BitMask)) break; - -// Count JPs in the subexpanse below the one for Index: - - Pjp += j__udyCountBitsB(BitMap & (BitMask - 1)); - - goto ContinueWalk; - - } // case cJU_JPBRANCH_B* - - -// **************************************************************************** -// JPBRANCH_U*: -// -// Notice the reverse order of the cases, and falling through to the next case, -// for performance. - - case cJU_JPBRANCH_U: - - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, cJU_ROOTSTATE); - -// If not a BranchU, traverse; otherwise fall into the next case, which makes -// this very fast code for a large Judy array (mainly BranchUs), especially -// when branches are already in the cache, such as for prev/next: - -#ifndef JU_64BIT - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U3) goto ContinueWalk; -#else - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U7) goto ContinueWalk; -#endif - -#ifdef JU_64BIT - case cJU_JPBRANCH_U7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 7); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U6) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 6); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U5) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 5); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U4) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 4); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U3) goto ContinueWalk; - // and fall through. - -#endif // JU_64BIT - - case cJU_JPBRANCH_U3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 3); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U2) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 2); - -// Note: BranchU2 is a special case that must continue traversal to a leaf, -// immed, full, or null type: - - goto ContinueWalk; - - -// **************************************************************************** -// JPLEAF*: -// -// Note: Here the calls of JU_DCDNOTMATCHINDEX() are necessary and check -// whether Index is out of the expanse of a narrow pointer. - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - - case cJU_JPLEAF1: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf1(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF1VALUEAREA(Pjll, Pop1) + posidx));) - } - -#endif // (JUDYL || (! JU_64BIT)) - - case cJU_JPLEAF2: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf2(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF2VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF3: - { - int posidx; // signed offset in leaf. - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf3(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF3VALUEAREA(Pjll, Pop1) + posidx));) - } -#ifdef JU_64BIT - case cJU_JPLEAF4: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf4(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF4VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF5: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf5(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF5VALUEAREA(Pjll, Pop1) + posidx));) - } - - case cJU_JPLEAF6: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf6(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF6VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF7: - { - int posidx; // signed offset in leaf. - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf7(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF7VALUEAREA(Pjll, Pop1) + posidx));) - } -#endif // JU_64BIT - - -// **************************************************************************** -// JPLEAF_B1: - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; -#ifdef JUDYL - int posidx; - Word_t subexp; // in bitmap, 0..7. - BITMAPL_t BitMap; // for one subexpanse. - BITMAPL_t BitMask; // bit in BitMap for Indexs Digit. - Pjv_t Pjv; -#endif - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - Pjlb = P_JLB(Pjp->jp_Addr); - -#ifdef JUDY1 - -// Simply check if Indexs bit is set in the bitmap: - - if (JU_BITMAPTESTL(Pjlb, Index)) return(1); - break; - -#else // JUDYL - -// JudyL is much more complicated because of value area subarrays: - - Digit = JU_DIGITATSTATE(Index, 1); - subexp = Digit / cJU_BITSPERSUBEXPL; - BitMap = JU_JLB_BITMAP(Pjlb, subexp); - BitMask = JU_BITPOSMASKL(Digit); - -// No value in subexpanse for Index => Index not found: - - if (! (BitMap & BitMask)) break; - -// Count value areas in the subexpanse below the one for Index: - - Pjv = P_JV(JL_JLB_PVALUE(Pjlb, subexp)); - assert(Pjv != (Pjv_t) NULL); - posidx = j__udyCountBitsL(BitMap & (BitMask - 1)); - - return((PPvoid_t) (Pjv + posidx)); - -#endif // JUDYL - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 - -// **************************************************************************** -// JPFULLPOPU1: -// -// If the Index is in the expanse, it is necessarily valid (found). - - case cJ1_JPFULLPOPU1: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - return(1); - -#ifdef notdef // for future enhancements -#ifdef JU_64BIT - -// Note: Need ? if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - case cJ1_JPFULLPOPU1m15: - if (Pjp->jp_1Index[14] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m14: - if (Pjp->jp_1Index[13] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m13: - if (Pjp->jp_1Index[12] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m12: - if (Pjp->jp_1Index[11] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m11: - if (Pjp->jp_1Index[10] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m10: - if (Pjp->jp_1Index[9] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m9: - if (Pjp->jp_1Index[8] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m8: - if (Pjp->jp_1Index[7] == (uint8_t)Index) break; -#endif - case cJ1_JPFULLPOPU1m7: - if (Pjp->jp_1Index[6] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m6: - if (Pjp->jp_1Index[5] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m5: - if (Pjp->jp_1Index[4] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m4: - if (Pjp->jp_1Index[3] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m3: - if (Pjp->jp_1Index[2] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m2: - if (Pjp->jp_1Index[1] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m1: - if (Pjp->jp_1Index[0] == (uint8_t)Index) break; - - return(1); // found, not in exclusion list - -#endif // JUDY1 -#endif // notdef - -// **************************************************************************** -// JPIMMED*: -// -// Note that the contents of jp_DcdPopO are different for cJU_JPIMMED_*_01: - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - if (JU_JPDCDPOP0(Pjp) != JU_TRIMTODCDSIZE(Index)) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) &(Pjp->jp_Addr));) // immediate value area. - - -// Macros to make code more readable and avoid dup errors - -#ifdef JUDY1 - -#define CHECKINDEXNATIVE(LEAF_T, PJP, IDX, INDEX) \ -if (((LEAF_T *)((PJP)->jp_1Index))[(IDX) - 1] == (LEAF_T)(INDEX)) \ - return(1) - -#define CHECKLEAFNONNAT(LFBTS, PJP, INDEX, IDX, COPY) \ -{ \ - Word_t i_ndex; \ - uint8_t *a_ddr; \ - a_ddr = (PJP)->jp_1Index + (((IDX) - 1) * (LFBTS)); \ - COPY(i_ndex, a_ddr); \ - if (i_ndex == JU_LEASTBYTES((INDEX), (LFBTS))) \ - return(1); \ -} -#endif - -#ifdef JUDYL - -#define CHECKINDEXNATIVE(LEAF_T, PJP, IDX, INDEX) \ -if (((LEAF_T *)((PJP)->jp_LIndex))[(IDX) - 1] == (LEAF_T)(INDEX)) \ - return((PPvoid_t)(P_JV((PJP)->jp_Addr) + (IDX) - 1)) - -#define CHECKLEAFNONNAT(LFBTS, PJP, INDEX, IDX, COPY) \ -{ \ - Word_t i_ndex; \ - uint8_t *a_ddr; \ - a_ddr = (PJP)->jp_LIndex + (((IDX) - 1) * (LFBTS)); \ - COPY(i_ndex, a_ddr); \ - if (i_ndex == JU_LEASTBYTES((INDEX), (LFBTS))) \ - return((PPvoid_t)(P_JV((PJP)->jp_Addr) + (IDX) - 1)); \ -} -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_15: CHECKINDEXNATIVE(uint8_t, Pjp, 15, Index); - case cJ1_JPIMMED_1_14: CHECKINDEXNATIVE(uint8_t, Pjp, 14, Index); - case cJ1_JPIMMED_1_13: CHECKINDEXNATIVE(uint8_t, Pjp, 13, Index); - case cJ1_JPIMMED_1_12: CHECKINDEXNATIVE(uint8_t, Pjp, 12, Index); - case cJ1_JPIMMED_1_11: CHECKINDEXNATIVE(uint8_t, Pjp, 11, Index); - case cJ1_JPIMMED_1_10: CHECKINDEXNATIVE(uint8_t, Pjp, 10, Index); - case cJ1_JPIMMED_1_09: CHECKINDEXNATIVE(uint8_t, Pjp, 9, Index); - case cJ1_JPIMMED_1_08: CHECKINDEXNATIVE(uint8_t, Pjp, 8, Index); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_07: CHECKINDEXNATIVE(uint8_t, Pjp, 7, Index); - case cJU_JPIMMED_1_06: CHECKINDEXNATIVE(uint8_t, Pjp, 6, Index); - case cJU_JPIMMED_1_05: CHECKINDEXNATIVE(uint8_t, Pjp, 5, Index); - case cJU_JPIMMED_1_04: CHECKINDEXNATIVE(uint8_t, Pjp, 4, Index); -#endif - case cJU_JPIMMED_1_03: CHECKINDEXNATIVE(uint8_t, Pjp, 3, Index); - case cJU_JPIMMED_1_02: CHECKINDEXNATIVE(uint8_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint8_t, Pjp, 1, Index); - break; - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_07: CHECKINDEXNATIVE(uint16_t, Pjp, 7, Index); - case cJ1_JPIMMED_2_06: CHECKINDEXNATIVE(uint16_t, Pjp, 6, Index); - case cJ1_JPIMMED_2_05: CHECKINDEXNATIVE(uint16_t, Pjp, 5, Index); - case cJ1_JPIMMED_2_04: CHECKINDEXNATIVE(uint16_t, Pjp, 4, Index); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_03: CHECKINDEXNATIVE(uint16_t, Pjp, 3, Index); - case cJU_JPIMMED_2_02: CHECKINDEXNATIVE(uint16_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint16_t, Pjp, 1, Index); - break; -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_05: - CHECKLEAFNONNAT(3, Pjp, Index, 5, JU_COPY3_PINDEX_TO_LONG); - case cJ1_JPIMMED_3_04: - CHECKLEAFNONNAT(3, Pjp, Index, 4, JU_COPY3_PINDEX_TO_LONG); - case cJ1_JPIMMED_3_03: - CHECKLEAFNONNAT(3, Pjp, Index, 3, JU_COPY3_PINDEX_TO_LONG); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: - CHECKLEAFNONNAT(3, Pjp, Index, 2, JU_COPY3_PINDEX_TO_LONG); - CHECKLEAFNONNAT(3, Pjp, Index, 1, JU_COPY3_PINDEX_TO_LONG); - break; -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - - case cJ1_JPIMMED_4_03: CHECKINDEXNATIVE(uint32_t, Pjp, 3, Index); - case cJ1_JPIMMED_4_02: CHECKINDEXNATIVE(uint32_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint32_t, Pjp, 1, Index); - break; - - case cJ1_JPIMMED_5_03: - CHECKLEAFNONNAT(5, Pjp, Index, 3, JU_COPY5_PINDEX_TO_LONG); - case cJ1_JPIMMED_5_02: - CHECKLEAFNONNAT(5, Pjp, Index, 2, JU_COPY5_PINDEX_TO_LONG); - CHECKLEAFNONNAT(5, Pjp, Index, 1, JU_COPY5_PINDEX_TO_LONG); - break; - - case cJ1_JPIMMED_6_02: - CHECKLEAFNONNAT(6, Pjp, Index, 2, JU_COPY6_PINDEX_TO_LONG); - CHECKLEAFNONNAT(6, Pjp, Index, 1, JU_COPY6_PINDEX_TO_LONG); - break; - - case cJ1_JPIMMED_7_02: - CHECKLEAFNONNAT(7, Pjp, Index, 2, JU_COPY7_PINDEX_TO_LONG); - CHECKLEAFNONNAT(7, Pjp, Index, 1, JU_COPY7_PINDEX_TO_LONG); - break; - -#endif // (JUDY1 && JU_64BIT) - - -// **************************************************************************** -// INVALID JP TYPE: - - default: - -ReturnCorrupt: - -#ifdef JUDYGETINLINE // Pjpm is known to be non-null: - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); -#else - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); -#endif - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // switch on JP type - -JUDY1CODE(return(0);) -JUDYLCODE(return((PPvoid_t) NULL);) - -} // Judy1Test() / JudyLGet() - - -#ifndef JUDYGETINLINE // only compile the following function once: -#ifdef DEBUG - -// **************************************************************************** -// J U D Y C H E C K P O P -// -// Given a pointer to a Judy array, traverse the entire array to ensure -// population counts add up correctly. This can catch various coding errors. -// -// Since walking the entire tree is probably time-consuming, enable this -// function by setting env parameter $CHECKPOP to first call at which to start -// checking. Note: This function is called both from insert and delete code. -// -// Note: Even though this function does nothing useful for LEAFW leaves, its -// good practice to call it anyway, and cheap too. -// -// TBD: This is a debug-only check function similar to JudyCheckSorted(), but -// since it walks the tree it is Judy1/JudyL-specific and must live in a source -// file that is built both ways. -// -// TBD: As feared, enabling this code for every insert/delete makes Judy -// deathly slow, even for a small tree (10K indexes). Its not so bad if -// present but disabled (<1% slowdown measured). Still, should it be ifdefd -// other than DEBUG and/or called less often? -// -// TBD: Should this "population checker" be expanded to a comprehensive tree -// checker? It currently detects invalid LEAFW/JP types as well as inconsistent -// pop1s. Other possible checks, all based on essentially redundant data in -// the Judy tree, include: -// -// - Zero LS bits in jp_Addr field. -// -// - Correct Dcd bits. -// -// - Consistent JP types (always descending down the tree). -// -// - Sorted linear lists in BranchLs and leaves (using JudyCheckSorted(), but -// ideally that function is already called wherever appropriate after any -// linear list is modified). -// -// - Any others possible? - -#include // for getenv() and atol(). - -static Word_t JudyCheckPopSM(Pjp_t Pjp, Word_t RootPop1); - -FUNCTION void JudyCheckPop( - Pvoid_t PArray) -{ -static bool_t checked = FALSE; // already checked env parameter. -static bool_t enabled = FALSE; // env parameter set. -static bool_t active = FALSE; // calls >= callsmin. -static Word_t callsmin; // start point from $CHECKPOP. -static Word_t calls = 0; // times called so far. - - -// CHECK FOR EXTERNAL ENABLING: - - if (! checked) // only check once. - { - char * value; // for getenv(). - - checked = TRUE; - - if ((value = getenv("CHECKPOP")) == (char *) NULL) - { -#ifdef notdef -// Take this out because nightly tests want to be flavor-independent; its not -// OK to emit special non-error output from the debug flavor: - - (void) puts("JudyCheckPop() present but not enabled by " - "$CHECKPOP env parameter; set it to the number of " - "calls at which to begin checking"); -#endif - return; - } - - callsmin = atol(value); // note: non-number evaluates to 0. - enabled = TRUE; - - (void) printf("JudyCheckPop() present and enabled; callsmin = " - "%lu\n", callsmin); - } - else if (! enabled) return; - -// Previously or just now enabled; check if non-active or newly active: - - if (! active) - { - if (++calls < callsmin) return; - - (void) printf("JudyCheckPop() activated at call %lu\n", calls); - active = TRUE; - } - -// IGNORE LEAFW AT TOP OF TREE: - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - return; - -// Check JPM pop0 against tree, recursively: -// -// Note: The traversal code in JudyCheckPopSM() is simplest when the case -// statement for each JP type compares the pop1 for that JP to its subtree (if -// any) after traversing the subtree (thats the hard part) and adding up -// actual pop1s. A top branchs JP in the JPM does not have room for a -// full-word pop1, so pass it in as a special case. - - { - Pjpm_t Pjpm = P_JPM(PArray); - (void) JudyCheckPopSM(&(Pjpm->jpm_JP), Pjpm->jpm_Pop0 + 1); - return; - } - -} // JudyCheckPop() - - -// **************************************************************************** -// J U D Y C H E C K P O P S M -// -// Recursive state machine (subroutine) for JudyCheckPop(): Given a Pjp (other -// than JPNULL*; caller should shortcut) and the root population for top-level -// branches, check the subtrees actual pop1 against its nominal value, and -// return the total pop1 for the subtree. -// -// Note: Expect RootPop1 to be ignored at lower levels, so pass down 0, which -// should pop an assertion if this expectation is violated. - -FUNCTION static Word_t JudyCheckPopSM( - Pjp_t Pjp, // top of subtree. - Word_t RootPop1) // whole array, for top-level branches only. -{ - Word_t pop1_jp; // nominal population from the JP. - Word_t pop1 = 0; // actual population at this level. - Word_t offset; // in a branch. - -#define PREPBRANCH(cPopBytes,Next) \ - pop1_jp = JU_JPBRANCH_POP0(Pjp, cPopBytes) + 1; goto Next - -assert((((Word_t) (Pjp->jp_Addr)) & 7) == 3); - switch (JU_JPTYPE(Pjp)) - { - - case cJU_JPBRANCH_L2: PREPBRANCH(2, BranchL); - case cJU_JPBRANCH_L3: PREPBRANCH(3, BranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: PREPBRANCH(4, BranchL); - case cJU_JPBRANCH_L5: PREPBRANCH(5, BranchL); - case cJU_JPBRANCH_L6: PREPBRANCH(6, BranchL); - case cJU_JPBRANCH_L7: PREPBRANCH(7, BranchL); -#endif - case cJU_JPBRANCH_L: pop1_jp = RootPop1; - { - Pjbl_t Pjbl; -BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - - for (offset = 0; offset < (Pjbl->jbl_NumJPs); ++offset) - pop1 += JudyCheckPopSM((Pjbl->jbl_jp) + offset, 0); - - assert(pop1_jp == pop1); - return(pop1); - } - - case cJU_JPBRANCH_B2: PREPBRANCH(2, BranchB); - case cJU_JPBRANCH_B3: PREPBRANCH(3, BranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: PREPBRANCH(4, BranchB); - case cJU_JPBRANCH_B5: PREPBRANCH(5, BranchB); - case cJU_JPBRANCH_B6: PREPBRANCH(6, BranchB); - case cJU_JPBRANCH_B7: PREPBRANCH(7, BranchB); -#endif - case cJU_JPBRANCH_B: pop1_jp = RootPop1; - { - Word_t subexp; - Word_t jpcount; - Pjbb_t Pjbb; -BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - - for (offset = 0; offset < jpcount; ++offset) - { - pop1 += JudyCheckPopSM(P_JP(JU_JBB_PJP(Pjbb, subexp)) - + offset, 0); - } - } - - assert(pop1_jp == pop1); - return(pop1); - } - - case cJU_JPBRANCH_U2: PREPBRANCH(2, BranchU); - case cJU_JPBRANCH_U3: PREPBRANCH(3, BranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: PREPBRANCH(4, BranchU); - case cJU_JPBRANCH_U5: PREPBRANCH(5, BranchU); - case cJU_JPBRANCH_U6: PREPBRANCH(6, BranchU); - case cJU_JPBRANCH_U7: PREPBRANCH(7, BranchU); -#endif - case cJU_JPBRANCH_U: pop1_jp = RootPop1; - { - Pjbu_t Pjbu; -BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - - for (offset = 0; offset < cJU_BRANCHUNUMJPS; ++offset) - { - if (((Pjbu->jbu_jp[offset].jp_Type) >= cJU_JPNULL1) - && ((Pjbu->jbu_jp[offset].jp_Type) <= cJU_JPNULLMAX)) - { - continue; // skip null JP to save time. - } - - pop1 += JudyCheckPopSM((Pjbu->jbu_jp) + offset, 0); - } - - assert(pop1_jp == pop1); - return(pop1); - } - - -// -- Cases below here terminate and do not recurse. -- -// -// For all of these cases except JPLEAF_B1, there is no way to check the JPs -// pop1 against the object itself; just return the pop1; but for linear leaves, -// a bounds check is possible. - -#define CHECKLEAF(MaxPop1) \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - assert(pop1 >= 1); \ - assert(pop1 <= (MaxPop1)); \ - return(pop1) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKLEAF(cJU_LEAF1_MAXPOP1); -#endif - case cJU_JPLEAF2: CHECKLEAF(cJU_LEAF2_MAXPOP1); - case cJU_JPLEAF3: CHECKLEAF(cJU_LEAF3_MAXPOP1); -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKLEAF(cJU_LEAF4_MAXPOP1); - case cJU_JPLEAF5: CHECKLEAF(cJU_LEAF5_MAXPOP1); - case cJU_JPLEAF6: CHECKLEAF(cJU_LEAF6_MAXPOP1); - case cJU_JPLEAF7: CHECKLEAF(cJU_LEAF7_MAXPOP1); -#endif - - case cJU_JPLEAF_B1: - { - Word_t subexp; - Pjlb_t Pjlb; - - pop1_jp = JU_JPLEAF_POP0(Pjp) + 1; - - Pjlb = P_JLB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - pop1 += j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - - assert(pop1_jp == pop1); - return(pop1); - } - - JUDY1CODE(case cJ1_JPFULLPOPU1: return(cJU_JPFULLPOPU1_POP0);) - - case cJU_JPIMMED_1_01: return(1); - case cJU_JPIMMED_2_01: return(1); - case cJU_JPIMMED_3_01: return(1); -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: return(1); - case cJU_JPIMMED_5_01: return(1); - case cJU_JPIMMED_6_01: return(1); - case cJU_JPIMMED_7_01: return(1); -#endif - - case cJU_JPIMMED_1_02: return(2); - case cJU_JPIMMED_1_03: return(3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: return(4); - case cJU_JPIMMED_1_05: return(5); - case cJU_JPIMMED_1_06: return(6); - case cJU_JPIMMED_1_07: return(7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: return(8); - case cJ1_JPIMMED_1_09: return(9); - case cJ1_JPIMMED_1_10: return(10); - case cJ1_JPIMMED_1_11: return(11); - case cJ1_JPIMMED_1_12: return(12); - case cJ1_JPIMMED_1_13: return(13); - case cJ1_JPIMMED_1_14: return(14); - case cJ1_JPIMMED_1_15: return(15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: return(2); - case cJU_JPIMMED_2_03: return(3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: return(4); - case cJ1_JPIMMED_2_05: return(5); - case cJ1_JPIMMED_2_06: return(6); - case cJ1_JPIMMED_2_07: return(7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: return(2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: return(3); - case cJ1_JPIMMED_3_04: return(4); - case cJ1_JPIMMED_3_05: return(5); - - case cJ1_JPIMMED_4_02: return(2); - case cJ1_JPIMMED_4_03: return(3); - case cJ1_JPIMMED_5_02: return(2); - case cJ1_JPIMMED_5_03: return(3); - case cJ1_JPIMMED_6_02: return(2); - case cJ1_JPIMMED_7_02: return(2); -#endif - - } // switch (JU_JPTYPE(Pjp)) - - assert(FALSE); // unrecognized JP type => corruption. - return(0); // to make some compilers happy. - -} // JudyCheckPopSM() - -#endif // DEBUG -#endif // ! JUDYGETINLINE diff --git a/libjudy/src/JudyCommon/JudyIns.c b/libjudy/src/JudyCommon/JudyIns.c deleted file mode 100644 index f96df4101d..0000000000 --- a/libjudy/src/JudyCommon/JudyIns.c +++ /dev/null @@ -1,1873 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.116 $ $Source: /judy/src/JudyCommon/JudyIns.c $ -// -// Judy1Set() and JudyLIns() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// TBD: Should some of the assertions here be converted to product code that -// returns JU_ERRNO_CORRUPT? - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -// Note: Call JudyCheckPop() even before "already inserted" returns, to catch -// population errors; see fix in 4.84: - -DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);) -DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);) - -#ifdef TRACEJP -#include "JudyPrintJP.c" -#endif - - -// These are defined to generic values in JudyCommon/JudyPrivateTypes.h: -// -// TBD: These should be exported from a header file, but perhaps not, as they -// are only used here, and exported from Judy*Decascade, which is a separate -// file for profiling reasons (to prevent inlining), but which potentially -// could be merged with this file, either in SoftCM or at compile-time. - -#ifdef JUDY1 -extern int j__udy1CreateBranchB(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); -extern int j__udy1CreateBranchU(Pjp_t, Pvoid_t); - -#ifndef JU_64BIT -extern int j__udy1Cascade1(Pjp_t, Pvoid_t); -#endif -extern int j__udy1Cascade2(Pjp_t, Pvoid_t); -extern int j__udy1Cascade3(Pjp_t, Pvoid_t); -#ifdef JU_64BIT -extern int j__udy1Cascade4(Pjp_t, Pvoid_t); -extern int j__udy1Cascade5(Pjp_t, Pvoid_t); -extern int j__udy1Cascade6(Pjp_t, Pvoid_t); -extern int j__udy1Cascade7(Pjp_t, Pvoid_t); -#endif -extern int j__udy1CascadeL(Pjp_t, Pvoid_t); - -extern int j__udy1InsertBranch(Pjp_t Pjp, Word_t Index, Word_t Btype, Pjpm_t); - -#else // JUDYL - -extern int j__udyLCreateBranchB(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); -extern int j__udyLCreateBranchU(Pjp_t, Pvoid_t); - -extern int j__udyLCascade1(Pjp_t, Pvoid_t); -extern int j__udyLCascade2(Pjp_t, Pvoid_t); -extern int j__udyLCascade3(Pjp_t, Pvoid_t); -#ifdef JU_64BIT -extern int j__udyLCascade4(Pjp_t, Pvoid_t); -extern int j__udyLCascade5(Pjp_t, Pvoid_t); -extern int j__udyLCascade6(Pjp_t, Pvoid_t); -extern int j__udyLCascade7(Pjp_t, Pvoid_t); -#endif -extern int j__udyLCascadeL(Pjp_t, Pvoid_t); - -extern int j__udyLInsertBranch(Pjp_t Pjp, Word_t Index, Word_t Btype, Pjpm_t); -#endif - - -// **************************************************************************** -// MACROS FOR COMMON CODE: -// -// Check if Index is an outlier to (that is, not a member of) this expanse: -// -// An outlier is an Index in-the-expanse of the slot containing the pointer, -// but not-in-the-expanse of the "narrow" pointer in that slot. (This means -// the Dcd part of the Index differs from the equivalent part of jp_DcdPopO.) -// Therefore, the remedy is to put a cJU_JPBRANCH_L* between the narrow pointer -// and the object to which it points, and add the outlier Index as an Immediate -// in the cJU_JPBRANCH_L*. The "trick" is placing the cJU_JPBRANCH_L* at a -// Level that is as low as possible. This is determined by counting the digits -// in the existing narrow pointer that are the same as the digits in the new -// Index (see j__udyInsertBranch()). -// -// Note: At some high Levels, cJU_DCDMASK() is all zeros => dead code; assume -// the compiler optimizes this out. - -#define JU_CHECK_IF_OUTLIER(Pjp, Index, cLevel, Pjpm) \ - if (JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel)) \ - return(j__udyInsertBranch(Pjp, Index, cLevel, Pjpm)) - -// Check if an Index is already in a leaf or immediate, after calling -// j__udySearchLeaf*() to set Offset: -// -// A non-negative Offset means the Index already exists, so return 0; otherwise -// complement Offset to proceed. - -#ifdef JUDY1 -#define Pjv ignore // placeholder. -#define JU_CHECK_IF_EXISTS(Offset,ignore,Pjpm) \ - { \ - if ((Offset) >= 0) return(0); \ - (Offset) = ~(Offset); \ - } -#else -// For JudyL, also set the value area pointer in the Pjpm: - -#define JU_CHECK_IF_EXISTS(Offset,Pjv,Pjpm) \ - { \ - if ((Offset) >= 0) \ - { \ - (Pjpm)->jpm_PValue = (Pjv) + (Offset); \ - return(0); \ - } \ - (Offset) = ~(Offset); \ - } -#endif - - -// **************************************************************************** -// __ J U D Y I N S W A L K -// -// Walk the Judy tree to do a set/insert. This is only called internally, and -// recursively. Unlike Judy1Test() and JudyLGet(), the extra time required for -// recursion should be negligible compared with the total. -// -// Return -1 for error (details in JPM), 0 for Index already inserted, 1 for -// new Index inserted. - -FUNCTION static int j__udyInsWalk( - Pjp_t Pjp, // current JP to descend. - Word_t Index, // to insert. - Pjpm_t Pjpm) // for returning info to top Level. -{ - uint8_t digit; // from Index, current offset into a branch. - jp_t newJP; // for creating a new Immed JP. - Word_t exppop1; // expanse (leaf) population. - int retcode; // return codes: -1, 0, 1. - -#ifdef SUBEXPCOUNTS -// Pointer to BranchB/U subexpanse counter: -// -// Note: Very important for performance reasons (avoids cache fills). - - PWord_t PSubExp = (PWord_t) NULL; -#endif - -ContinueInsWalk: // for modifying state without recursing. - -#ifdef TRACEJP - JudyPrintJP(Pjp, "i", __LINE__); -#endif - - switch (JU_JPTYPE(Pjp)) // entry: Pjp, Index. - { - - -// **************************************************************************** -// JPNULL*: -// -// Convert JP in place from current null type to cJU_JPIMMED_*_01 by -// calculating new JP type. - - case cJU_JPNULL1: - case cJU_JPNULL2: - case cJU_JPNULL3: -#ifdef JU_64BIT - case cJU_JPNULL4: - case cJU_JPNULL5: - case cJU_JPNULL6: - case cJU_JPNULL7: -#endif - assert((Pjp->jp_Addr) == 0); - JU_JPSETADT(Pjp, 0, Index, JU_JPTYPE(Pjp) + cJU_JPIMMED_1_01 - cJU_JPNULL1); -#ifdef JUDYL - // value area is first word of new Immed_01 JP: - Pjpm->jpm_PValue = (Pjv_t) (&(Pjp->jp_Addr)); -#endif - return(1); - - -// **************************************************************************** -// JPBRANCH_L*: -// -// If the new Index is not an outlier to the branchs expanse, and the branch -// should not be converted to uncompressed, extract the digit and record the -// Immediate type to create for a new Immed JP, before going to common code. -// -// Note: JU_CHECK_IF_OUTLIER() is a no-op for BranchB3[7] on 32[64]-bit. - -#define JU_BRANCH_OUTLIER(DIGIT,POP1,cLEVEL,PJP,INDEX,PJPM) \ - JU_CHECK_IF_OUTLIER(PJP, INDEX, cLEVEL, PJPM); \ - (DIGIT) = JU_DIGITATSTATE(INDEX, cLEVEL); \ - (POP1) = JU_JPBRANCH_POP0(PJP, cLEVEL) - - case cJU_JPBRANCH_L2: - JU_BRANCH_OUTLIER(digit, exppop1, 2, Pjp, Index, Pjpm); - goto JudyBranchL; - - case cJU_JPBRANCH_L3: - JU_BRANCH_OUTLIER(digit, exppop1, 3, Pjp, Index, Pjpm); - goto JudyBranchL; - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - JU_BRANCH_OUTLIER(digit, exppop1, 4, Pjp, Index, Pjpm); - goto JudyBranchL; - - case cJU_JPBRANCH_L5: - JU_BRANCH_OUTLIER(digit, exppop1, 5, Pjp, Index, Pjpm); - goto JudyBranchL; - - case cJU_JPBRANCH_L6: - JU_BRANCH_OUTLIER(digit, exppop1, 6, Pjp, Index, Pjpm); - goto JudyBranchL; - - case cJU_JPBRANCH_L7: - JU_BRANCH_OUTLIER(digit, exppop1, 7, Pjp, Index, Pjpm); - goto JudyBranchL; -#endif - -// Similar to common code above, but no outlier check is needed, and the Immed -// type depends on the word size: - - case cJU_JPBRANCH_L: - { - Pjbl_t PjblRaw; // pointer to old linear branch. - Pjbl_t Pjbl; - Pjbu_t PjbuRaw; // pointer to new uncompressed branch. - Pjbu_t Pjbu; - Word_t numJPs; // number of JPs = populated expanses. - int offset; // in branch. - - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - exppop1 = Pjpm->jpm_Pop0; - - // fall through: - -// COMMON CODE FOR LINEAR BRANCHES: -// -// Come here with digit and exppop1 already set. - -JudyBranchL: - PjblRaw = (Pjbl_t) (Pjp->jp_Addr); - Pjbl = P_JBL(PjblRaw); - -// If population under this branch greater than: - - if (exppop1 > JU_BRANCHL_MAX_POP) - goto ConvertBranchLtoU; - - numJPs = Pjbl->jbl_NumJPs; - - if ((numJPs == 0) || (numJPs > cJU_BRANCHLMAXJPS)) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(-1); - } - -// Search for a match to the digit: - - offset = j__udySearchLeaf1((Pjll_t) (Pjbl->jbl_Expanse), numJPs, - digit); - -// If Index is found, offset is into an array of 1..cJU_BRANCHLMAXJPS JPs: - - if (offset >= 0) - { - Pjp = (Pjbl->jbl_jp) + offset; // address of next JP. - break; // continue walk. - } - -// Expanse is missing (not populated) for the passed Index, so insert an Immed -// -- if theres room: - - if (numJPs < cJU_BRANCHLMAXJPS) - { - offset = ~offset; // insertion offset. - - JU_JPSETADT(&newJP, 0, Index, - JU_JPTYPE(Pjp) + cJU_JPIMMED_1_01-cJU_JPBRANCH_L2); - - JU_INSERTINPLACE(Pjbl->jbl_Expanse, numJPs, offset, digit); - JU_INSERTINPLACE(Pjbl->jbl_jp, numJPs, offset, newJP); - - DBGCODE(JudyCheckSorted((Pjll_t) (Pjbl->jbl_Expanse), - numJPs + 1, /* IndexSize = */ 1);) - ++(Pjbl->jbl_NumJPs); -#ifdef JUDYL - // value area is first word of new Immed 01 JP: - Pjpm->jpm_PValue = (Pjv_t) ((Pjbl->jbl_jp) + offset); -#endif - return(1); - } - - -// MAXED OUT LINEAR BRANCH, CONVERT TO A BITMAP BRANCH, THEN INSERT: -// -// Copy the linear branch to a bitmap branch. -// -// TBD: Consider renaming j__udyCreateBranchB() to j__udyConvertBranchLtoB(). - - assert((numJPs) <= cJU_BRANCHLMAXJPS); - - if (j__udyCreateBranchB(Pjp, Pjbl->jbl_jp, Pjbl->jbl_Expanse, - numJPs, Pjpm) == -1) - { - return(-1); - } - -// Convert jp_Type from linear branch to equivalent bitmap branch: - - Pjp->jp_Type += cJU_JPBRANCH_B - cJU_JPBRANCH_L; - - j__udyFreeJBL(PjblRaw, Pjpm); // free old BranchL. - -// Having changed branch types, now do the insert in the new branch type: - - goto ContinueInsWalk; - - -// OPPORTUNISTICALLY CONVERT FROM BRANCHL TO BRANCHU: -// -// Memory efficiency is no object because the branchs pop1 is large enough, so -// speed up array access. Come here with PjblRaw set. Note: This is goto -// code because the previous block used to fall through into it as well, but no -// longer. - -ConvertBranchLtoU: - -// Allocate memory for an uncompressed branch: - - if ((PjbuRaw = j__udyAllocJBU(Pjpm)) == (Pjbu_t) NULL) - return(-1); - Pjbu = P_JBU(PjbuRaw); - -// Set the proper NULL type for most of the uncompressed branchs JPs: - - JU_JPSETADT(&newJP, 0, 0, - JU_JPTYPE(Pjp) - cJU_JPBRANCH_L2 + cJU_JPNULL1); - -// Initialize: Pre-set uncompressed branch to mostly JPNULL*s: - - for (numJPs = 0; numJPs < cJU_BRANCHUNUMJPS; ++numJPs) - Pjbu->jbu_jp[numJPs] = newJP; - -// Copy JPs from linear branch to uncompressed branch: - - { -#ifdef SUBEXPCOUNTS - Word_t popmask = cJU_POP0MASK(JU_JPTYPE(Pjp)) - - cJU_JPBRANCH_L2 - 2; - - for (numJPs = 0; numJPs < cJU_NUMSUBEXPU; ++numJPs) - Pjbu->jbu_subPop1[numJPs] = 0; -#endif - for (numJPs = 0; numJPs < Pjbl->jbl_NumJPs; ++numJPs) - { - Pjp_t Pjp1 = &(Pjbl->jbl_jp[numJPs]); - offset = Pjbl->jbl_Expanse[numJPs]; - Pjbu->jbu_jp[offset] = *Pjp1; -#ifdef SUBEXPCOUNTS - Pjbu->jbu_subPop1[offset/cJU_NUMSUBEXPU] += - JU_JPDCDPOP0(Pjp1) & popmask + 1; -#endif - } - } - j__udyFreeJBL(PjblRaw, Pjpm); // free old BranchL. - -// Plug new values into parent JP: - - Pjp->jp_Addr = (Word_t) PjbuRaw; - Pjp->jp_Type += cJU_JPBRANCH_U - cJU_JPBRANCH_L; // to BranchU. - -// Save global population of last BranchU conversion: - - Pjpm->jpm_LastUPop0 = Pjpm->jpm_Pop0; - goto ContinueInsWalk; - - } // case cJU_JPBRANCH_L. - - -// **************************************************************************** -// JPBRANCH_B*: -// -// If the new Index is not an outlier to the branchs expanse, extract the -// digit and record the Immediate type to create for a new Immed JP, before -// going to common code. -// -// Note: JU_CHECK_IF_OUTLIER() is a no-op for BranchB3[7] on 32[64]-bit. - - case cJU_JPBRANCH_B2: - JU_BRANCH_OUTLIER(digit, exppop1, 2, Pjp, Index, Pjpm); - goto JudyBranchB; - - case cJU_JPBRANCH_B3: - JU_BRANCH_OUTLIER(digit, exppop1, 3, Pjp, Index, Pjpm); - goto JudyBranchB; - -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - JU_BRANCH_OUTLIER(digit, exppop1, 4, Pjp, Index, Pjpm); - goto JudyBranchB; - - case cJU_JPBRANCH_B5: - JU_BRANCH_OUTLIER(digit, exppop1, 5, Pjp, Index, Pjpm); - goto JudyBranchB; - - case cJU_JPBRANCH_B6: - JU_BRANCH_OUTLIER(digit, exppop1, 6, Pjp, Index, Pjpm); - goto JudyBranchB; - - case cJU_JPBRANCH_B7: - JU_BRANCH_OUTLIER(digit, exppop1, 7, Pjp, Index, Pjpm); - goto JudyBranchB; -#endif - - case cJU_JPBRANCH_B: - { - Pjbb_t Pjbb; // pointer to bitmap branch. - Pjbb_t PjbbRaw; // pointer to bitmap branch. - Pjp_t Pjp2Raw; // 1 of N arrays of JPs. - Pjp_t Pjp2; // 1 of N arrays of JPs. - Word_t subexp; // 1 of N subexpanses in bitmap. - BITMAPB_t bitmap; // for one subexpanse. - BITMAPB_t bitmask; // bit set for Indexs digit. - Word_t numJPs; // number of JPs = populated expanses. - int offset; // in bitmap branch. - -// Similar to common code above, but no outlier check is needed, and the Immed -// type depends on the word size: - - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - exppop1 = Pjpm->jpm_Pop0; - - // fall through: - - -// COMMON CODE FOR BITMAP BRANCHES: -// -// Come here with digit and exppop1 already set. - -JudyBranchB: - -// If population increment is greater than.. (300): - - if ((Pjpm->jpm_Pop0 - Pjpm->jpm_LastUPop0) > JU_BTOU_POP_INCREMENT) - { - -// If total population of array is greater than.. (750): - - if (Pjpm->jpm_Pop0 > JU_BRANCHB_MAX_POP) - { - -// If population under the branch is greater than.. (135): - - if (exppop1 > JU_BRANCHB_MIN_POP) - { - if (j__udyCreateBranchU(Pjp, Pjpm) == -1) return(-1); - -// Save global population of last BranchU conversion: - - Pjpm->jpm_LastUPop0 = Pjpm->jpm_Pop0; - - goto ContinueInsWalk; - } - } - } - -// CONTINUE TO USE BRANCHB: -// -// Get pointer to bitmap branch (JBB): - - PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); - Pjbb = P_JBB(PjbbRaw); - -// Form the Int32 offset, and Bit offset values: -// -// 8 bit Decode | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -// |SubExpanse | Bit offset | -// -// Get the 1 of 8 expanses from digit, Bits 5..7 = 1 of 8, and get the 32-bit -// word that may have a bit set: - - subexp = digit / cJU_BITSPERSUBEXPB; - bitmap = JU_JBB_BITMAP(Pjbb, subexp); - - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); - Pjp2 = P_JP(Pjp2Raw); - -// Get the bit position that represents the desired expanse, and get the offset -// into the array of JPs for the JP that matches the bit. - - bitmask = JU_BITPOSMASKB(digit); - offset = j__udyCountBitsB(bitmap & (bitmask - 1)); - -// If JP is already in this expanse, get Pjp and continue the walk: - - if (bitmap & bitmask) - { -#ifdef SUBEXPCOUNTS - PSubExp = &(Pjbb->jbb_Counts[subexp]); // ptr to subexp counts. -#endif - Pjp = Pjp2 + offset; - break; // continue walk. - } - - -// ADD NEW EXPANSE FOR NEW INDEX: -// -// The new expanse always an cJU_JPIMMED_*_01 containing just the new Index, so -// finish setting up an Immed JP. - - JU_JPSETADT(&newJP, 0, Index, - JU_JPTYPE(Pjp) + cJU_JPIMMED_1_01-cJU_JPBRANCH_B2); - -// Get 1 of the 8 JP arrays and calculate number of JPs in subexpanse array: - - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); - Pjp2 = P_JP(Pjp2Raw); - numJPs = j__udyCountBitsB(bitmap); - -// Expand branch JP subarray in-place: - - if (JU_BRANCHBJPGROWINPLACE(numJPs)) - { - assert(numJPs > 0); - JU_INSERTINPLACE(Pjp2, numJPs, offset, newJP); -#ifdef JUDYL - // value area is first word of new Immed 01 JP: - Pjpm->jpm_PValue = (Pjv_t) (Pjp2 + offset); -#endif - } - -// No room, allocate a bigger bitmap branch JP subarray: - - else - { - Pjp_t PjpnewRaw; - Pjp_t Pjpnew; - - if ((PjpnewRaw = j__udyAllocJBBJP(numJPs + 1, Pjpm)) == 0) - return(-1); - Pjpnew = P_JP(PjpnewRaw); - -// If there was an old JP array, then copy it, insert the new Immed JP, and -// free the old array: - - if (numJPs) - { - JU_INSERTCOPY(Pjpnew, Pjp2, numJPs, offset, newJP); - j__udyFreeJBBJP(Pjp2Raw, numJPs, Pjpm); -#ifdef JUDYL - // value area is first word of new Immed 01 JP: - Pjpm->jpm_PValue = (Pjv_t) (Pjpnew + offset); -#endif - } - -// New JP subarray; point to cJU_JPIMMED_*_01 and place it: - - else - { - assert(JU_JBB_PJP(Pjbb, subexp) == (Pjp_t) NULL); - Pjp = Pjpnew; - *Pjp = newJP; // copy to new memory. -#ifdef JUDYL - // value area is first word of new Immed 01 JP: - Pjpm->jpm_PValue = (Pjv_t) (&(Pjp->jp_Addr)); -#endif - } - -// Place new JP subarray in BranchB: - - JU_JBB_PJP(Pjbb, subexp) = PjpnewRaw; - - } // else - -// Set the new Indexs bit: - - JU_JBB_BITMAP(Pjbb, subexp) |= bitmask; - - return(1); - - } // case - - -// **************************************************************************** -// JPBRANCH_U*: -// -// Just drop through the JP for the correct digit. If the JP turns out to be a -// JPNULL*, thats OK, the memory is already allocated, and the next walk -// simply places an Immed in it. -// -#ifdef SUBEXPCOUNTS -#define JU_GETSUBEXP(PSubExp,Pjbu,Digit) \ - (PSubExp) = &((Pjbu)->jbu_subPop1[(Digit) / cJU_NUMSUBEXPU]) -#else -#define JU_GETSUBEXP(PSubExp,Pjbu,Digit) // null. -#endif - -#define JU_JBU_PJP_SUBEXP(Pjp,PSubExp,Index,Level) \ - { \ - uint8_t digit = JU_DIGITATSTATE(Index, Level); \ - Pjbu_t P_jbu = P_JBU((Pjp)->jp_Addr); \ - (Pjp) = &(P_jbu->jbu_jp[digit]); \ - JU_GETSUBEXP(PSubExp, P_jbu, digit); \ - } - - case cJU_JPBRANCH_U2: - JU_CHECK_IF_OUTLIER(Pjp, Index, 2, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 2); - break; - -#ifdef JU_64BIT - case cJU_JPBRANCH_U3: - JU_CHECK_IF_OUTLIER(Pjp, Index, 3, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 3); - break; - - case cJU_JPBRANCH_U4: - JU_CHECK_IF_OUTLIER(Pjp, Index, 4, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 4); - break; - - case cJU_JPBRANCH_U5: - JU_CHECK_IF_OUTLIER(Pjp, Index, 5, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 5); - break; - - case cJU_JPBRANCH_U6: - JU_CHECK_IF_OUTLIER(Pjp, Index, 6, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 6); - break; - - case cJU_JPBRANCH_U7: - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 7); -#else - case cJU_JPBRANCH_U3: - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 3); -#endif - break; - - case cJU_JPBRANCH_U: - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, cJU_ROOTSTATE); - break; - - -// **************************************************************************** -// JPLEAF*: -// -// COMMON CODE FRAGMENTS TO MINIMIZE REDUNDANCY BELOW: -// -// These are necessary to support performance by function and loop unrolling -// while avoiding huge amounts of nearly identical code. -// -// Prepare to handle a linear leaf: Check for an outlier; set pop1 and pointer -// to leaf: - -#ifdef JUDY1 -#define JU_LEAFVALUE(Pjv) // null. -#define JU_LEAFPREPVALUE(Pjv, ValueArea) // null. -#else -#define JU_LEAFVALUE(Pjv) Pjv_t Pjv -#define JU_LEAFPREPVALUE(Pjv, ValueArea) (Pjv) = ValueArea(Pleaf, exppop1) -#endif - -#define JU_LEAFPREP(cIS,Type,MaxPop1,ValueArea) \ - Pjll_t PjllRaw; \ - Type Pleaf; /* specific type */ \ - int offset; \ - JU_LEAFVALUE(Pjv); \ - \ - JU_CHECK_IF_OUTLIER(Pjp, Index, cIS, Pjpm); \ - \ - exppop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - assert(exppop1 <= (MaxPop1)); \ - PjllRaw = (Pjll_t) (Pjp->jp_Addr); \ - Pleaf = (Type) P_JLL(PjllRaw); \ - JU_LEAFPREPVALUE(Pjv, ValueArea) - -// Add to, or grow, a linear leaf: Find Index position; if the Index is -// absent, if theres room in the leaf, insert the Index [and value of 0] in -// place, otherwise grow the leaf: -// -// Note: These insertions always take place with whole words, using -// JU_INSERTINPLACE() or JU_INSERTCOPY(). - -#ifdef JUDY1 -#define JU_LEAFGROWVALUEADD(Pjv,ExpPop1,Offset) // null. -#else -#define JU_LEAFGROWVALUEADD(Pjv,ExpPop1,Offset) \ - JU_INSERTINPLACE(Pjv, ExpPop1, Offset, 0); \ - Pjpm->jpm_PValue = (Pjv) + (Offset) -#endif - -#ifdef JUDY1 -#define JU_LEAFGROWVALUENEW(ValueArea,Pjv,ExpPop1,Offset) // null. -#else -#define JU_LEAFGROWVALUENEW(ValueArea,Pjv,ExpPop1,Offset) \ - { \ - Pjv_t Pjvnew = ValueArea(Pleafnew, (ExpPop1) + 1); \ - JU_INSERTCOPY(Pjvnew, Pjv, ExpPop1, Offset, 0); \ - Pjpm->jpm_PValue = (Pjvnew) + (Offset); \ - } -#endif - -#define JU_LEAFGROW(cIS,Type,MaxPop1,Search,ValueArea,GrowInPlace, \ - InsertInPlace,InsertCopy,Alloc,Free) \ - \ - offset = Search(Pleaf, exppop1, Index); \ - JU_CHECK_IF_EXISTS(offset, Pjv, Pjpm); \ - \ - if (GrowInPlace(exppop1)) /* add to current leaf */ \ - { \ - InsertInPlace(Pleaf, exppop1, offset, Index); \ - JU_LEAFGROWVALUEADD(Pjv, exppop1, offset); \ - DBGCODE(JudyCheckSorted((Pjll_t) Pleaf, exppop1 + 1, cIS);) \ - return(1); \ - } \ - \ - if (exppop1 < (MaxPop1)) /* grow to new leaf */ \ - { \ - Pjll_t PjllnewRaw; \ - Type Pleafnew; \ - if ((PjllnewRaw = Alloc(exppop1 + 1, Pjpm)) == 0) return(-1); \ - Pleafnew = (Type) P_JLL(PjllnewRaw); \ - InsertCopy(Pleafnew, Pleaf, exppop1, offset, Index); \ - JU_LEAFGROWVALUENEW(ValueArea, Pjv, exppop1, offset); \ - DBGCODE(JudyCheckSorted((Pjll_t) Pleafnew, exppop1 + 1, cIS);) \ - Free(PjllRaw, exppop1, Pjpm); \ - (Pjp->jp_Addr) = (Word_t) PjllnewRaw; \ - return(1); \ - } \ - assert(exppop1 == (MaxPop1)) - -// Handle linear leaf overflow (cascade): Splay or compress into smaller -// leaves: - -#define JU_LEAFCASCADE(MaxPop1,Cascade,Free) \ - if (Cascade(Pjp, Pjpm) == -1) return(-1); \ - Free(PjllRaw, MaxPop1, Pjpm); \ - goto ContinueInsWalk - -// Wrapper around all of the above: - -#define JU_LEAFSET(cIS,Type,MaxPop1,Search,GrowInPlace,InsertInPlace, \ - InsertCopy,Cascade,Alloc,Free,ValueArea) \ - { \ - JU_LEAFPREP(cIS,Type,MaxPop1,ValueArea); \ - JU_LEAFGROW(cIS,Type,MaxPop1,Search,ValueArea,GrowInPlace, \ - InsertInPlace,InsertCopy,Alloc,Free); \ - JU_LEAFCASCADE(MaxPop1,Cascade,Free); \ - } - -// END OF MACROS; LEAFL CASES START HERE: -// -// 64-bit Judy1 does not have 1-byte leaves: - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - - case cJU_JPLEAF1: - - JU_LEAFSET(1, uint8_t *, cJU_LEAF1_MAXPOP1, j__udySearchLeaf1, - JU_LEAF1GROWINPLACE, JU_INSERTINPLACE, JU_INSERTCOPY, - j__udyCascade1, j__udyAllocJLL1, j__udyFreeJLL1, - JL_LEAF1VALUEAREA); - -#endif // (JUDYL || ! JU_64BIT) - - case cJU_JPLEAF2: - - JU_LEAFSET(2, uint16_t *, cJU_LEAF2_MAXPOP1, j__udySearchLeaf2, - JU_LEAF2GROWINPLACE, JU_INSERTINPLACE, JU_INSERTCOPY, - j__udyCascade2, j__udyAllocJLL2, j__udyFreeJLL2, - JL_LEAF2VALUEAREA); - - case cJU_JPLEAF3: - - JU_LEAFSET(3, uint8_t *, cJU_LEAF3_MAXPOP1, j__udySearchLeaf3, - JU_LEAF3GROWINPLACE, JU_INSERTINPLACE3, JU_INSERTCOPY3, - j__udyCascade3, j__udyAllocJLL3, j__udyFreeJLL3, - JL_LEAF3VALUEAREA); - -#ifdef JU_64BIT - case cJU_JPLEAF4: - - JU_LEAFSET(4, uint32_t *, cJU_LEAF4_MAXPOP1, j__udySearchLeaf4, - JU_LEAF4GROWINPLACE, JU_INSERTINPLACE, JU_INSERTCOPY, - j__udyCascade4, j__udyAllocJLL4, j__udyFreeJLL4, - JL_LEAF4VALUEAREA); - - case cJU_JPLEAF5: - - JU_LEAFSET(5, uint8_t *, cJU_LEAF5_MAXPOP1, j__udySearchLeaf5, - JU_LEAF5GROWINPLACE, JU_INSERTINPLACE5, JU_INSERTCOPY5, - j__udyCascade5, j__udyAllocJLL5, j__udyFreeJLL5, - JL_LEAF5VALUEAREA); - - case cJU_JPLEAF6: - - JU_LEAFSET(6, uint8_t *, cJU_LEAF6_MAXPOP1, j__udySearchLeaf6, - JU_LEAF6GROWINPLACE, JU_INSERTINPLACE6, JU_INSERTCOPY6, - j__udyCascade6, j__udyAllocJLL6, j__udyFreeJLL6, - JL_LEAF6VALUEAREA); - - case cJU_JPLEAF7: - - JU_LEAFSET(7, uint8_t *, cJU_LEAF7_MAXPOP1, j__udySearchLeaf7, - JU_LEAF7GROWINPLACE, JU_INSERTINPLACE7, JU_INSERTCOPY7, - j__udyCascade7, j__udyAllocJLL7, j__udyFreeJLL7, - JL_LEAF7VALUEAREA); -#endif // JU_64BIT - - -// **************************************************************************** -// JPLEAF_B1: -// -// 8 bit Decode | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -// |SubExpanse | Bit offset | -// -// Note: For JudyL, values are stored in 8 subexpanses, each a linear word -// array of up to 32 values each. - - case cJU_JPLEAF_B1: - { -#ifdef JUDYL - Pjv_t PjvRaw; // pointer to value part of the leaf. - Pjv_t Pjv; // pointer to value part of the leaf. - Pjv_t PjvnewRaw; // new value area. - Pjv_t Pjvnew; // new value area. - Word_t subexp; // 1 of 8 subexpanses in bitmap. - Pjlb_t Pjlb; // pointer to bitmap part of the leaf. - BITMAPL_t bitmap; // for one subexpanse. - BITMAPL_t bitmask; // bit set for Indexs digit. - int offset; // of index in value area. -#endif - - JU_CHECK_IF_OUTLIER(Pjp, Index, 1, Pjpm); - -#ifdef JUDY1 - -// If Index (bit) is already set, return now: - - if (JU_BITMAPTESTL(P_JLB(Pjp->jp_Addr), Index)) return(0); - -// If bitmap is not full, set the new Indexs bit; otherwise convert to a Full: - - if ((exppop1 = JU_JPLEAF_POP0(Pjp) + 1) - < cJU_JPFULLPOPU1_POP0) - { - JU_BITMAPSETL(P_JLB(Pjp->jp_Addr), Index); - } - else - { - j__udyFreeJLB1((Pjlb_t) (Pjp->jp_Addr), Pjpm); // free LeafB1. - Pjp->jp_Type = cJ1_JPFULLPOPU1; - Pjp->jp_Addr = 0; - } - -#else // JUDYL - -// This is very different from Judy1 because of the need to return a value area -// even for an existing Index, or manage the value area for a new Index, and -// because JudyL has no Full type: - -// Get last byte to decode from Index, and pointer to bitmap leaf: - - digit = JU_DIGITATSTATE(Index, 1); - Pjlb = P_JLB(Pjp->jp_Addr); - -// Prepare additional values: - - subexp = digit / cJU_BITSPERSUBEXPL; // which subexpanse. - bitmap = JU_JLB_BITMAP(Pjlb, subexp); // subexps 32-bit map. - PjvRaw = JL_JLB_PVALUE(Pjlb, subexp); // corresponding values. - Pjv = P_JV(PjvRaw); // corresponding values. - bitmask = JU_BITPOSMASKL(digit); // mask for Index. - offset = j__udyCountBitsL(bitmap & (bitmask - 1)); // of Index. - -// If Index already exists, get value pointer and exit: - - if (bitmap & bitmask) - { - assert(Pjv); - Pjpm->jpm_PValue = Pjv + offset; // existing value. - return(0); - } - -// Get the total bits set = expanse population of Value area: - - exppop1 = j__udyCountBitsL(bitmap); - -// If the value area can grow in place, do it: - - if (JL_LEAFVGROWINPLACE(exppop1)) - { - JU_INSERTINPLACE(Pjv, exppop1, offset, 0); - JU_JLB_BITMAP(Pjlb, subexp) |= bitmask; // set Indexs bit. - Pjpm->jpm_PValue = Pjv + offset; // new value area. - return(1); - } - -// Increase size of value area: - - if ((PjvnewRaw = j__udyLAllocJV(exppop1 + 1, Pjpm)) - == (Pjv_t) NULL) return(-1); - Pjvnew = P_JV(PjvnewRaw); - - if (exppop1) // have existing value area. - { - assert(Pjv); - JU_INSERTCOPY(Pjvnew, Pjv, exppop1, offset, 0); - Pjpm->jpm_PValue = Pjvnew + offset; - j__udyLFreeJV(PjvRaw, exppop1, Pjpm); // free old values. - } - else // first index, new value area: - { - Pjpm->jpm_PValue = Pjvnew; - *(Pjpm->jpm_PValue) = 0; - } - -// Set bit for new Index and place new leaf value area in bitmap: - - JU_JLB_BITMAP(Pjlb, subexp) |= bitmask; - JL_JLB_PVALUE(Pjlb, subexp) = PjvnewRaw; - -#endif // JUDYL - - return(1); - - } // case - - -#ifdef JUDY1 -// **************************************************************************** -// JPFULLPOPU1: -// -// If Index is not an outlier, then by definition its already set. - - case cJ1_JPFULLPOPU1: - - JU_CHECK_IF_OUTLIER(Pjp, Index, 1, Pjpm); - return(0); -#endif - - -// **************************************************************************** -// JPIMMED*: -// -// This is some of the most complex code in Judy considering Judy1 versus JudyL -// and 32-bit versus 64-bit variations. The following comments attempt to make -// this clearer. -// -// Of the 2 words in a JP, for immediate indexes Judy1 can use 2 words - 1 byte -// = 7 [15] bytes, but JudyL can only use 1 word - 1 byte = 3 [7] bytes because -// the other word is needed for a value area or a pointer to a value area. -// -// For both Judy1 and JudyL, cJU_JPIMMED_*_01 indexes are in word 2; otherwise -// for Judy1 only, a list of 2 or more indexes starts in word 1. JudyL keeps -// the list in word 2 because word 1 is a pointer (to a LeafV, that is, a leaf -// containing only values). Furthermore, cJU_JPIMMED_*_01 indexes are stored -// all-but-first-byte in jp_DcdPopO, not just the Index Sizes bytes. -// -// TBD: This can be confusing because Doug didnt use data structures for it. -// Instead he often directly accesses Pjp for the first word and jp_DcdPopO for -// the second word. It would be nice to use data structs, starting with -// jp_1Index and jp_LIndex where possible. -// -// Maximum Immed JP types for Judy1/JudyL, depending on Index Size (cIS): -// -// 32-bit 64-bit -// -// bytes: 7/ 3 15/ 7 (Judy1/JudyL) -// -// cIS -// 1_ 07/03 15/07 (as in: cJ1_JPIMMED_1_07) -// 2_ 03/01 07/03 -// 3_ 02/01 05/02 -// 4_ 03/01 -// 5_ 03/01 -// 6_ 02/01 -// 7_ 02/01 -// -// State transitions while inserting an Index, matching the above table: -// (Yes, this is very terse... Study it and it will make sense.) -// (Note, parts of this diagram are repeated below for quick reference.) -// -// +-- reformat JP here for Judy1 only, from word-2 to word-1 -// | -// | JUDY1 || JU_64BIT JUDY1 && JU_64BIT -// V -// 1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] Leaf1 (*) -// 2_01 => [ 2_02 => 2_03 => [ 2_04..07 => ]] Leaf2 -// 3_01 => [ 3_02 => [ 3_03..05 => ]] Leaf3 -// JU_64BIT only: -// 4_01 => [[ 4_02..03 => ]] Leaf4 -// 5_01 => [[ 5_02..03 => ]] Leaf5 -// 6_01 => [[ 6_02 => ]] Leaf6 -// 7_01 => [[ 7_02 => ]] Leaf7 -// -// (*) For Judy1 & 64-bit, go directly from cJU_JPIMMED_1_15 to a LeafB1; skip -// Leaf1, as described in Judy1.h regarding cJ1_JPLEAF1. - - -// COMMON CODE FRAGMENTS TO MINIMIZE REDUNDANCY BELOW: -// -// These are necessary to support performance by function and loop unrolling -// while avoiding huge amounts of nearly identical code. -// -// The differences between Judy1 and JudyL with respect to value area handling -// are just too large for completely common code between them... Oh well, some -// big ifdefs follow. However, even in the following ifdefd code, use cJU_*, -// JU_*, and Judy*() instead of cJ1_* / cJL_*, J1_* / JL_*, and -// Judy1*()/JudyL*(), for minimum diffs. -// -// Handle growth of cJU_JPIMMED_*_01 to cJU_JPIMMED_*_02, for an even or odd -// Index Size (cIS), given oldIndex, Index, and Pjll in the context: -// -// Put oldIndex and Index in their proper order. For odd indexes, must copy -// bytes. - -#ifdef JUDY1 - -#define JU_IMMSET_01_COPY_EVEN(ignore1,ignore2) \ - if (oldIndex < Index) { Pjll[0] = oldIndex; Pjll[1] = Index; } \ - else { Pjll[0] = Index; Pjll[1] = oldIndex; } - -#define JU_IMMSET_01_COPY_ODD(cIS,CopyWord) \ - if (oldIndex < Index) \ - { \ - CopyWord(Pjll + 0, oldIndex); \ - CopyWord(Pjll + (cIS), Index); \ - } \ - else \ - { \ - CopyWord(Pjll + 0, Index); \ - CopyWord(Pjll + (cIS), oldIndex); \ - } - -// The "real" *_01 Copy macro: -// -// Trim the high byte off Index, look for a match with the old Index, and if -// none, insert the new Index in the leaf in the correct place, given Pjp and -// Index in the context. -// -// Note: A single immediate index lives in the jp_DcdPopO field, but two or -// more reside starting at Pjp->jp_1Index. - -#define JU_IMMSET_01_COPY(cIS,LeafType,NewJPType,Copy,CopyWord) \ - { \ - LeafType Pjll; \ - Word_t oldIndex = JU_JPDCDPOP0(Pjp); \ - \ - Index = JU_TRIMTODCDSIZE(Index); \ - if (oldIndex == Index) return(0); \ - \ - Pjll = (LeafType) (Pjp->jp_1Index); \ - Copy(cIS,CopyWord); \ - DBGCODE(JudyCheckSorted(Pjll, 2, cIS);) \ - \ - Pjp->jp_Type = (NewJPType); \ - return(1); \ - } - -#else // JUDYL - -// Variations to also handle value areas; see comments above: -// -// For JudyL, Pjv (start of value area) and oldValue are also in the context; -// leave Pjv set to the value area for Index. - -#define JU_IMMSET_01_COPY_EVEN(cIS,CopyWord) \ - if (oldIndex < Index) \ - { \ - Pjll[0] = oldIndex; \ - Pjv [0] = oldValue; \ - Pjll[1] = Index; \ - ++Pjv; \ - } \ - else \ - { \ - Pjll[0] = Index; \ - Pjll[1] = oldIndex; \ - Pjv [1] = oldValue; \ - } - -#define JU_IMMSET_01_COPY_ODD(cIS,CopyWord) \ - if (oldIndex < Index) \ - { \ - CopyWord(Pjll + 0, oldIndex); \ - CopyWord(Pjll + (cIS), Index); \ - Pjv[0] = oldValue; \ - ++Pjv; \ - } \ - else \ - { \ - CopyWord(Pjll + 0, Index); \ - CopyWord(Pjll + (cIS), oldIndex); \ - Pjv[1] = oldValue; \ - } - -// The old value area is in the first word (*Pjp), and Pjv and Pjpm are also in -// the context. Also, unlike Judy1, indexes remain in word 2 (jp_LIndex), -// meaning insert-in-place rather than copy. -// -// Return jpm_PValue pointing to Indexs value area. If Index is new, allocate -// a 2-value-leaf and attach it to the JP. - -#define JU_IMMSET_01_COPY(cIS,LeafType,NewJPType,Copy,CopyWord) \ - { \ - LeafType Pjll; \ - Word_t oldIndex = JU_JPDCDPOP0(Pjp); \ - Word_t oldValue; \ - Pjv_t PjvRaw; \ - Pjv_t Pjv; \ - \ - Index = JU_TRIMTODCDSIZE(Index); \ - \ - if (oldIndex == Index) \ - { \ - Pjpm->jpm_PValue = (Pjv_t) Pjp; \ - return(0); \ - } \ - \ - if ((PjvRaw = j__udyLAllocJV(2, Pjpm)) == (Pjv_t) NULL) \ - return(-1); \ - Pjv = P_JV(PjvRaw); \ - \ - oldValue = Pjp->jp_Addr; \ - (Pjp->jp_Addr) = (Word_t) PjvRaw; \ - Pjll = (LeafType) (Pjp->jp_LIndex); \ - \ - Copy(cIS,CopyWord); \ - DBGCODE(JudyCheckSorted(Pjll, 2, cIS);) \ - \ - Pjp->jp_Type = (NewJPType); \ - *Pjv = 0; \ - Pjpm->jpm_PValue = Pjv; \ - return(1); \ - } - -// The following is a unique mix of JU_IMMSET_01() and JU_IMMSETCASCADE() for -// going from cJU_JPIMMED_*_01 directly to a cJU_JPLEAF* for JudyL: -// -// If Index is not already set, allocate a leaf, copy the old and new indexes -// into it, clear and return the new value area, and modify the current JP. -// Note that jp_DcdPop is set to a pop0 of 0 for now, and incremented later. - - -#define JU_IMMSET_01_CASCADE(cIS,LeafType,NewJPType,ValueArea, \ - Copy,CopyWord,Alloc) \ - { \ - Word_t D_P0; \ - LeafType PjllRaw; \ - LeafType Pjll; \ - Word_t oldIndex = JU_JPDCDPOP0(Pjp); \ - Word_t oldValue; \ - Pjv_t Pjv; \ - \ - Index = JU_TRIMTODCDSIZE(Index); \ - \ - if (oldIndex == Index) \ - { \ - Pjpm->jpm_PValue = (Pjv_t) (&(Pjp->jp_Addr)); \ - return(0); \ - } \ - \ - if ((PjllRaw = (LeafType) Alloc(2, Pjpm)) == (LeafType) NULL) \ - return(-1); \ - Pjll = (LeafType) P_JLL(PjllRaw); \ - Pjv = ValueArea(Pjll, 2); \ - \ - oldValue = Pjp->jp_Addr; \ - \ - Copy(cIS,CopyWord); \ - DBGCODE(JudyCheckSorted(Pjll, 2, cIS);) \ - \ - *Pjv = 0; \ - Pjpm->jpm_PValue = Pjv; \ - D_P0 = Index & cJU_DCDMASK(cIS); /* pop0 = 0 */ \ - JU_JPSETADT(Pjp, (Word_t)PjllRaw, D_P0, NewJPType); \ - \ - return(1); \ - } - -#endif // JUDYL - -// Handle growth of cJU_JPIMMED_*_[02..15]: - -#ifdef JUDY1 - -// Insert an Index into an immediate JP that has room for more, if the Index is -// not already present; given Pjp, Index, exppop1, Pjv, and Pjpm in the -// context: -// -// Note: Use this only when the JP format doesnt change, that is, going from -// cJU_JPIMMED_X_0Y to cJU_JPIMMED_X_0Z, where X >= 2 and Y+1 = Z. -// -// Note: Incrementing jp_Type is how to increase the Index population. - -#define JU_IMMSETINPLACE(cIS,LeafType,BaseJPType_02,Search,InsertInPlace) \ - { \ - LeafType Pjll; \ - int offset; \ - \ - exppop1 = JU_JPTYPE(Pjp) - (BaseJPType_02) + 2; \ - offset = Search((Pjll_t) (Pjp->jp_1Index), exppop1, Index); \ - \ - JU_CHECK_IF_EXISTS(offset, ignore, Pjpm); \ - \ - Pjll = (LeafType) (Pjp->jp_1Index); \ - InsertInPlace(Pjll, exppop1, offset, Index); \ - DBGCODE(JudyCheckSorted(Pjll, exppop1 + 1, cIS);) \ - ++(Pjp->jp_Type); \ - return(1); \ - } - -// Insert an Index into an immediate JP that has no room for more: -// -// If the Index is not already present, do a cascade (to a leaf); given Pjp, -// Index, Pjv, and Pjpm in the context. - - -#define JU_IMMSETCASCADE(cIS,OldPop1,LeafType,NewJPType, \ - ignore,Search,InsertCopy,Alloc) \ - { \ - Word_t D_P0; \ - Pjll_t PjllRaw; \ - Pjll_t Pjll; \ - int offset; \ - \ - offset = Search((Pjll_t) (Pjp->jp_1Index), (OldPop1), Index); \ - JU_CHECK_IF_EXISTS(offset, ignore, Pjpm); \ - \ - if ((PjllRaw = Alloc((OldPop1) + 1, Pjpm)) == 0) return(-1); \ - Pjll = P_JLL(PjllRaw); \ - \ - InsertCopy((LeafType) Pjll, (LeafType) (Pjp->jp_1Index), \ - OldPop1, offset, Index); \ - DBGCODE(JudyCheckSorted(Pjll, (OldPop1) + 1, cIS);) \ - \ - D_P0 = (Index & cJU_DCDMASK(cIS)) + (OldPop1) - 1; \ - JU_JPSETADT(Pjp, (Word_t)PjllRaw, D_P0, NewJPType); \ - return(1); \ - } - -#else // JUDYL - -// Variations to also handle value areas; see comments above: -// -// For JudyL, Pjv (start of value area) is also in the context. -// -// TBD: This code makes a true but weak assumption that a JudyL 32-bit 2-index -// value area must be copied to a new 3-index value area. AND it doesnt know -// anything about JudyL 64-bit cases (cJU_JPIMMED_1_0[3-7] only) where the -// value area can grow in place! However, this should not break it, just slow -// it down. - -#define JU_IMMSETINPLACE(cIS,LeafType,BaseJPType_02,Search,InsertInPlace) \ - { \ - LeafType Pleaf; \ - int offset; \ - Pjv_t PjvRaw; \ - Pjv_t Pjv; \ - Pjv_t PjvnewRaw; \ - Pjv_t Pjvnew; \ - \ - exppop1 = JU_JPTYPE(Pjp) - (BaseJPType_02) + 2; \ - offset = Search((Pjll_t) (Pjp->jp_LIndex), exppop1, Index); \ - PjvRaw = (Pjv_t) (Pjp->jp_Addr); \ - Pjv = P_JV(PjvRaw); \ - \ - JU_CHECK_IF_EXISTS(offset, Pjv, Pjpm); \ - \ - if ((PjvnewRaw = j__udyLAllocJV(exppop1 + 1, Pjpm)) \ - == (Pjv_t) NULL) return(-1); \ - Pjvnew = P_JV(PjvnewRaw); \ - \ - Pleaf = (LeafType) (Pjp->jp_LIndex); \ - \ - InsertInPlace(Pleaf, exppop1, offset, Index); \ - /* see TBD above about this: */ \ - JU_INSERTCOPY(Pjvnew, Pjv, exppop1, offset, 0); \ - DBGCODE(JudyCheckSorted(Pleaf, exppop1 + 1, cIS);) \ - j__udyLFreeJV(PjvRaw, exppop1, Pjpm); \ - Pjp->jp_Addr = (Word_t) PjvnewRaw; \ - Pjpm->jpm_PValue = Pjvnew + offset; \ - \ - ++(Pjp->jp_Type); \ - return(1); \ - } - -#define JU_IMMSETCASCADE(cIS,OldPop1,LeafType,NewJPType, \ - ValueArea,Search,InsertCopy,Alloc) \ - { \ - Word_t D_P0; \ - Pjll_t PjllRaw; \ - Pjll_t Pjll; \ - int offset; \ - Pjv_t PjvRaw; \ - Pjv_t Pjv; \ - Pjv_t Pjvnew; \ - \ - PjvRaw = (Pjv_t) (Pjp->jp_Addr); \ - Pjv = P_JV(PjvRaw); \ - offset = Search((Pjll_t) (Pjp->jp_LIndex), (OldPop1), Index); \ - JU_CHECK_IF_EXISTS(offset, Pjv, Pjpm); \ - \ - if ((PjllRaw = Alloc((OldPop1) + 1, Pjpm)) == 0) \ - return(-1); \ - Pjll = P_JLL(PjllRaw); \ - InsertCopy((LeafType) Pjll, (LeafType) (Pjp->jp_LIndex), \ - OldPop1, offset, Index); \ - DBGCODE(JudyCheckSorted(Pjll, (OldPop1) + 1, cIS);) \ - \ - Pjvnew = ValueArea(Pjll, (OldPop1) + 1); \ - JU_INSERTCOPY(Pjvnew, Pjv, OldPop1, offset, 0); \ - j__udyLFreeJV(PjvRaw, (OldPop1), Pjpm); \ - Pjpm->jpm_PValue = Pjvnew + offset; \ - \ - D_P0 = (Index & cJU_DCDMASK(cIS)) + (OldPop1) - 1; \ - JU_JPSETADT(Pjp, (Word_t)PjllRaw, D_P0, NewJPType); \ - return(1); \ - } - -#endif // JUDYL - -// Common convenience/shorthand wrappers around JU_IMMSET_01_COPY() for -// even/odd index sizes: - -#define JU_IMMSET_01( cIS, LeafType, NewJPType) \ - JU_IMMSET_01_COPY(cIS, LeafType, NewJPType, JU_IMMSET_01_COPY_EVEN, \ - ignore) - -#define JU_IMMSET_01_ODD( cIS, NewJPType, CopyWord) \ - JU_IMMSET_01_COPY(cIS, uint8_t *, NewJPType, JU_IMMSET_01_COPY_ODD, \ - CopyWord) - - -// END OF MACROS; IMMED CASES START HERE: - -// cJU_JPIMMED_*_01 cases: -// -// 1_01 always leads to 1_02: -// -// (1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] LeafL) - - case cJU_JPIMMED_1_01: JU_IMMSET_01(1, uint8_t *, cJU_JPIMMED_1_02); - -// 2_01 leads to 2_02, and 3_01 leads to 3_02, except for JudyL 32-bit, where -// they lead to a leaf: -// -// (2_01 => [ 2_02 => 2_03 => [ 2_04..07 => ]] LeafL) -// (3_01 => [ 3_02 => [ 3_03..05 => ]] LeafL) - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_01: JU_IMMSET_01(2, uint16_t *, cJU_JPIMMED_2_02); - case cJU_JPIMMED_3_01: JU_IMMSET_01_ODD (3, cJU_JPIMMED_3_02, - JU_COPY3_LONG_TO_PINDEX); -#else - case cJU_JPIMMED_2_01: - JU_IMMSET_01_CASCADE(2, uint16_t *, cJU_JPLEAF2, JL_LEAF2VALUEAREA, - JU_IMMSET_01_COPY_EVEN, ignore, - j__udyAllocJLL2); - case cJU_JPIMMED_3_01: - JU_IMMSET_01_CASCADE(3, uint8_t *, cJU_JPLEAF3, JL_LEAF3VALUEAREA, - JU_IMMSET_01_COPY_ODD, - JU_COPY3_LONG_TO_PINDEX, j__udyAllocJLL3); -#endif - -#ifdef JU_64BIT - -// [4-7]_01 lead to [4-7]_02 for Judy1, and to leaves for JudyL: -// -// (4_01 => [[ 4_02..03 => ]] LeafL) -// (5_01 => [[ 5_02..03 => ]] LeafL) -// (6_01 => [[ 6_02 => ]] LeafL) -// (7_01 => [[ 7_02 => ]] LeafL) - -#ifdef JUDY1 - case cJU_JPIMMED_4_01: JU_IMMSET_01(4, uint32_t *, cJ1_JPIMMED_4_02); - case cJU_JPIMMED_5_01: JU_IMMSET_01_ODD(5, cJ1_JPIMMED_5_02, - JU_COPY5_LONG_TO_PINDEX); - case cJU_JPIMMED_6_01: JU_IMMSET_01_ODD(6, cJ1_JPIMMED_6_02, - JU_COPY6_LONG_TO_PINDEX); - case cJU_JPIMMED_7_01: JU_IMMSET_01_ODD(7, cJ1_JPIMMED_7_02, - JU_COPY7_LONG_TO_PINDEX); -#else // JUDYL - case cJU_JPIMMED_4_01: - JU_IMMSET_01_CASCADE(4, uint32_t *, cJU_JPLEAF4, JL_LEAF4VALUEAREA, - JU_IMMSET_01_COPY_EVEN, ignore, - j__udyAllocJLL4); - case cJU_JPIMMED_5_01: - JU_IMMSET_01_CASCADE(5, uint8_t *, cJU_JPLEAF5, JL_LEAF5VALUEAREA, - JU_IMMSET_01_COPY_ODD, - JU_COPY5_LONG_TO_PINDEX, j__udyAllocJLL5); - case cJU_JPIMMED_6_01: - JU_IMMSET_01_CASCADE(6, uint8_t *, cJU_JPLEAF6, JL_LEAF6VALUEAREA, - JU_IMMSET_01_COPY_ODD, - JU_COPY6_LONG_TO_PINDEX, j__udyAllocJLL6); - case cJU_JPIMMED_7_01: - JU_IMMSET_01_CASCADE(7, uint8_t *, cJU_JPLEAF7, JL_LEAF7VALUEAREA, - JU_IMMSET_01_COPY_ODD, - JU_COPY7_LONG_TO_PINDEX, j__udyAllocJLL7); -#endif // JUDYL -#endif // JU_64BIT - -// cJU_JPIMMED_1_* cases that can grow in place: -// -// (1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] LeafL) - - case cJU_JPIMMED_1_02: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_03: - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJU_JPIMMED_1_07: - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: -#endif - JU_IMMSETINPLACE(1, uint8_t *, cJU_JPIMMED_1_02, j__udySearchLeaf1, - JU_INSERTINPLACE); - -// cJU_JPIMMED_1_* cases that must cascade: -// -// (1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] LeafL) - -#if (defined(JUDYL) && (! defined(JU_64BIT))) - case cJU_JPIMMED_1_03: - JU_IMMSETCASCADE(1, 3, uint8_t *, cJU_JPLEAF1, JL_LEAF1VALUEAREA, - j__udySearchLeaf1, JU_INSERTCOPY, - j__udyAllocJLL1); -#endif -#if (defined(JUDY1) && (! defined(JU_64BIT))) - case cJU_JPIMMED_1_07: - JU_IMMSETCASCADE(1, 7, uint8_t *, cJU_JPLEAF1, ignore, - j__udySearchLeaf1, JU_INSERTCOPY, - j__udyAllocJLL1); - -#endif -#if (defined(JUDYL) && defined(JU_64BIT)) - case cJU_JPIMMED_1_07: - JU_IMMSETCASCADE(1, 7, uint8_t *, cJU_JPLEAF1, JL_LEAF1VALUEAREA, - j__udySearchLeaf1, JU_INSERTCOPY, - j__udyAllocJLL1); - -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) -// Special case, as described above, go directly from Immed to LeafB1: - - case cJ1_JPIMMED_1_15: - { - Word_t DcdP0; - int offset; - Pjlb_t PjlbRaw; - Pjlb_t Pjlb; - - offset = j__udySearchLeaf1((Pjll_t) Pjp->jp_1Index, 15, Index); - - JU_CHECK_IF_EXISTS(offset, ignore, Pjpm); - -// Create a bitmap leaf (special case for Judy1 64-bit only, see usage): Set -// new Index in bitmap, copy an Immed1_15 to the bitmap, and set the parent JP -// EXCEPT jp_DcdPopO, leaving any followup to the caller: - - if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL) - return(-1); - Pjlb = P_JLB(PjlbRaw); - - JU_BITMAPSETL(Pjlb, Index); - - for (offset = 0; offset < 15; ++offset) - JU_BITMAPSETL(Pjlb, Pjp->jp_1Index[offset]); - -// Set jp_DcdPopO including the current pop0; incremented later: - DcdP0 = (Index & cJU_DCDMASK(1)) + 15 - 1; - JU_JPSETADT(Pjp, (Word_t)PjlbRaw, DcdP0, cJU_JPLEAF_B1); - - return(1); - } -#endif - -// cJU_JPIMMED_[2..7]_[02..15] cases that grow in place or cascade: -// -// (2_01 => [ 2_02 => 2_03 => [ 2_04..07 => ]] LeafL) - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJU_JPIMMED_2_03: - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - JU_IMMSETINPLACE(2, uint16_t *, cJU_JPIMMED_2_02, j__udySearchLeaf2, - JU_INSERTINPLACE); -#endif - -#undef OLDPOP1 -#if ((defined(JUDY1) && (! defined(JU_64BIT))) || (defined(JUDYL) && defined(JU_64BIT))) - case cJU_JPIMMED_2_03: -#define OLDPOP1 3 -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_07: -#define OLDPOP1 7 -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - JU_IMMSETCASCADE(2, OLDPOP1, uint16_t *, cJU_JPLEAF2, - JL_LEAF2VALUEAREA, j__udySearchLeaf2, - JU_INSERTCOPY, j__udyAllocJLL2); -#endif - -// (3_01 => [ 3_02 => [ 3_03..05 => ]] LeafL) - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJU_JPIMMED_3_02: - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - - JU_IMMSETINPLACE(3, uint8_t *, cJU_JPIMMED_3_02, j__udySearchLeaf3, - JU_INSERTINPLACE3); -#endif - -#undef OLDPOP1 -#if ((defined(JUDY1) && (! defined(JU_64BIT))) || (defined(JUDYL) && defined(JU_64BIT))) - case cJU_JPIMMED_3_02: -#define OLDPOP1 2 -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_05: -#define OLDPOP1 5 -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - JU_IMMSETCASCADE(3, OLDPOP1, uint8_t *, cJU_JPLEAF3, - JL_LEAF3VALUEAREA, j__udySearchLeaf3, - JU_INSERTCOPY3, j__udyAllocJLL3); -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - -// (4_01 => [[ 4_02..03 => ]] LeafL) - - case cJ1_JPIMMED_4_02: - - JU_IMMSETINPLACE(4, uint32_t *, cJ1_JPIMMED_4_02, j__udySearchLeaf4, - JU_INSERTINPLACE); - - case cJ1_JPIMMED_4_03: - - JU_IMMSETCASCADE(4, 3, uint32_t *, cJU_JPLEAF4, ignore, - j__udySearchLeaf4, JU_INSERTCOPY, - j__udyAllocJLL4); - -// (5_01 => [[ 5_02..03 => ]] LeafL) - - case cJ1_JPIMMED_5_02: - - JU_IMMSETINPLACE(5, uint8_t *, cJ1_JPIMMED_5_02, j__udySearchLeaf5, - JU_INSERTINPLACE5); - - case cJ1_JPIMMED_5_03: - - JU_IMMSETCASCADE(5, 3, uint8_t *, cJU_JPLEAF5, ignore, - j__udySearchLeaf5, JU_INSERTCOPY5, - j__udyAllocJLL5); - -// (6_01 => [[ 6_02 => ]] LeafL) - - case cJ1_JPIMMED_6_02: - - JU_IMMSETCASCADE(6, 2, uint8_t *, cJU_JPLEAF6, ignore, - j__udySearchLeaf6, JU_INSERTCOPY6, - j__udyAllocJLL6); - -// (7_01 => [[ 7_02 => ]] LeafL) - - case cJ1_JPIMMED_7_02: - - JU_IMMSETCASCADE(7, 2, uint8_t *, cJU_JPLEAF7, ignore, - j__udySearchLeaf7, JU_INSERTCOPY7, - j__udyAllocJLL7); - -#endif // (JUDY1 && JU_64BIT) - - -// **************************************************************************** -// INVALID JP TYPE: - - default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); return(-1); - - } // switch on JP type - - { - -#ifdef SUBEXPCOUNTS - -// This code might seem strange here. However it saves some memory read time -// during insert (~70nS) because a pipelined processor does not need to "stall" -// waiting for the memory read to complete. Hope the compiler is not too smart -// or dumb and moves the code down to where it looks like it belongs (below a -// few lines). - - Word_t SubExpCount = 0; // current subexpanse counter. - - if (PSubExp != (PWord_t) NULL) // only if BranchB/U. - SubExpCount = PSubExp[0]; -#endif - -// PROCESS JP -- RECURSIVELY: -// -// For non-Immed JP types, if successful, post-increment the population count -// at this Level. - - retcode = j__udyInsWalk(Pjp, Index, Pjpm); - -// Successful insert, increment JP and subexpanse count: - - if ((JU_JPTYPE(Pjp) < cJU_JPIMMED_1_01) && (retcode == 1)) - { - jp_t JP; - Word_t DcdP0; -#ifdef SUBEXPCOUNTS - -// Note: Pjp must be a pointer to a BranchB/U: - - if (PSubExp != (PWord_t) NULL) PSubExp[0] = SubExpCount + 1; -#endif - - JP = *Pjp; - DcdP0 = JU_JPDCDPOP0(Pjp) + 1; - JU_JPSETADT(Pjp, JP.jp_Addr, DcdP0, JU_JPTYPE(&JP)); - } - } - return(retcode); - -} // j__udyInsWalk() - - -// **************************************************************************** -// J U D Y 1 S E T -// J U D Y L I N S -// -// Main entry point. See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1Set -#else -FUNCTION PPvoid_t JudyLIns -#endif - ( - PPvoid_t PPArray, // in which to insert. - Word_t Index, // to insert. - PJError_t PJError // optional, for returning error info. - ) -{ -#ifdef JUDY1 -#define Pjv ignore // placeholders for macros. -#define Pjvnew ignore -#else - Pjv_t Pjv; // value area in old leaf. - Pjv_t Pjvnew; // value area in new leaf. -#endif - Pjpm_t Pjpm; // array-global info. - int offset; // position in which to store new Index. - Pjlw_t Pjlw; - - -// CHECK FOR NULL POINTER (error by caller): - - if (PPArray == (PPvoid_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjlw = P_JLW(*PPArray); // first word of leaf. - -// **************************************************************************** -// PROCESS TOP LEVEL "JRP" BRANCHES AND LEAVES: - -// **************************************************************************** -// JRPNULL (EMPTY ARRAY): BUILD A LEAFW WITH ONE INDEX: - -// if a valid empty array (null pointer), so create an array of population == 1: - - if (Pjlw == (Pjlw_t)NULL) - { - Pjlw_t Pjlwnew; - - Pjlwnew = j__udyAllocJLW(1); - JUDY1CODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI );) - JUDYLCODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, PPJERR);) - - Pjlwnew[0] = 1 - 1; // pop0 = 0. - Pjlwnew[1] = Index; - - *PPArray = (Pvoid_t) Pjlwnew; - DBGCODE(JudyCheckPop(*PPArray);) - - JUDY1CODE(return(1); ) - JUDYLCODE(Pjlwnew[2] = 0; ) // value area. - JUDYLCODE(return((PPvoid_t) (Pjlwnew + 2)); ) - - } // NULL JRP - -// **************************************************************************** -// LEAFW, OTHER SIZE: - - if (JU_LEAFW_POP0(*PPArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlwnew; - Word_t pop1; - - Pjlw = P_JLW(*PPArray); // first word of leaf. - pop1 = Pjlw[0] + 1; - -#ifdef JUDYL - Pjv = JL_LEAFWVALUEAREA(Pjlw, pop1); -#endif - offset = j__udySearchLeafW(Pjlw + 1, pop1, Index); - - if (offset >= 0) // index is already valid: - { - DBGCODE(JudyCheckPop(*PPArray);) - JUDY1CODE(return(0); ) - JUDYLCODE(return((PPvoid_t) (Pjv + offset)); ) - } - - offset = ~offset; - -// Insert index in cases where no new memory is needed: - - if (JU_LEAFWGROWINPLACE(pop1)) - { - ++Pjlw[0]; // increase population. - - JU_INSERTINPLACE(Pjlw + 1, pop1, offset, Index); -#ifdef JUDYL - JU_INSERTINPLACE(Pjv, pop1, offset, 0); -#endif - DBGCODE(JudyCheckPop(*PPArray);) - DBGCODE(JudyCheckSorted(Pjlw + 1, pop1 + 1, cJU_ROOTSTATE);) - - JUDY1CODE(return(1); ) - JUDYLCODE(return((PPvoid_t) (Pjv + offset)); ) - } - -// Insert index into a new, larger leaf: - - if (pop1 < cJU_LEAFW_MAXPOP1) // can grow to a larger leaf. - { - Pjlwnew = j__udyAllocJLW(pop1 + 1); - JUDY1CODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI );) - JUDYLCODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, PPJERR);) - - Pjlwnew[0] = pop1; // set pop0 in new leaf. - - JU_INSERTCOPY(Pjlwnew + 1, Pjlw + 1, pop1, offset, Index); -#ifdef JUDYL - Pjvnew = JL_LEAFWVALUEAREA(Pjlwnew, pop1 + 1); - JU_INSERTCOPY(Pjvnew, Pjv, pop1, offset, 0); -#endif - DBGCODE(JudyCheckSorted(Pjlwnew + 1, pop1 + 1, cJU_ROOTSTATE);) - - j__udyFreeJLW(Pjlw, pop1, NULL); - - *PPArray = (Pvoid_t) Pjlwnew; - DBGCODE(JudyCheckPop(*PPArray);) - - JUDY1CODE(return(1); ) - JUDYLCODE(return((PPvoid_t) (Pjvnew + offset)); ) - } - - assert(pop1 == cJU_LEAFW_MAXPOP1); - -// Leaf at max size => cannot insert new index, so cascade instead: -// -// Upon cascading from a LEAFW leaf to the first branch, must allocate and -// initialize a JPM. - - Pjpm = j__udyAllocJPM(); - JUDY1CODE(JU_CHECKALLOC(Pjpm_t, Pjpm, JERRI );) - JUDYLCODE(JU_CHECKALLOC(Pjpm_t, Pjpm, PPJERR);) - - (Pjpm->jpm_Pop0) = cJU_LEAFW_MAXPOP1 - 1; - (Pjpm->jpm_JP.jp_Addr) = (Word_t) Pjlw; - - if (j__udyCascadeL(&(Pjpm->jpm_JP), Pjpm) == -1) - { - JU_COPY_ERRNO(PJError, Pjpm); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -// Note: No need to pass Pjpm for memory decrement; LEAFW memory is never -// counted in a JPM at all: - - j__udyFreeJLW(Pjlw, cJU_LEAFW_MAXPOP1, NULL); - *PPArray = (Pvoid_t) Pjpm; - - } // JU_LEAFW - -// **************************************************************************** -// BRANCH: - - { - int retcode; // really only needed for Judy1, but free for JudyL. - - Pjpm = P_JPM(*PPArray); - retcode = j__udyInsWalk(&(Pjpm->jpm_JP), Index, Pjpm); - - if (retcode == -1) - { - JU_COPY_ERRNO(PJError, Pjpm); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - if (retcode == 1) ++(Pjpm->jpm_Pop0); // incr total array popu. - - assert(((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_L) - || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_B) - || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_U)); - DBGCODE(JudyCheckPop(*PPArray);) - -#ifdef JUDY1 - assert((retcode == 0) || (retcode == 1)); - return(retcode); // == JU_RET_*_JPM(). -#else - assert(Pjpm->jpm_PValue != (Pjv_t) NULL); - return((PPvoid_t) Pjpm->jpm_PValue); -#endif - } - /*NOTREACHED*/ - -} // Judy1Set() / JudyLIns() diff --git a/libjudy/src/JudyCommon/JudyInsArray.c b/libjudy/src/JudyCommon/JudyInsArray.c deleted file mode 100644 index f8e361f277..0000000000 --- a/libjudy/src/JudyCommon/JudyInsArray.c +++ /dev/null @@ -1,1178 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// TBD: It would probably be faster for the caller if the JudyL version took -// PIndex as an interleaved array of indexes and values rather than just -// indexes with a separate values array (PValue), especially considering -// indexes and values are copied here with for-loops anyway and not the -// equivalent of memcpy(). All code could be revised to simply count by two -// words for JudyL? Supports "streaming" the data to/from disk better later? -// In which case get rid of JU_ERRNO_NULLPVALUE, no longer needed, and simplify -// the API to this code. -// _________________ - -// @(#) $Revision: 4.21 $ $Source: /judy/src/JudyCommon/JudyInsArray.c $ -// -// Judy1SetArray() and JudyLInsArray() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);) - - -// IMMED AND LEAF SIZE AND BRANCH TYPE ARRAYS: -// -// These support fast and easy lookup by level. - -static uint8_t immed_maxpop1[] = { - 0, - cJU_IMMED1_MAXPOP1, - cJU_IMMED2_MAXPOP1, - cJU_IMMED3_MAXPOP1, -#ifdef JU_64BIT - cJU_IMMED4_MAXPOP1, - cJU_IMMED5_MAXPOP1, - cJU_IMMED6_MAXPOP1, - cJU_IMMED7_MAXPOP1, -#endif - // note: There are no IMMEDs for whole words. -}; - -static uint8_t leaf_maxpop1[] = { - 0, -#if (defined(JUDYL) || (! defined(JU_64BIT))) - cJU_LEAF1_MAXPOP1, -#else - 0, // 64-bit Judy1 has no Leaf1. -#endif - cJU_LEAF2_MAXPOP1, - cJU_LEAF3_MAXPOP1, -#ifdef JU_64BIT - cJU_LEAF4_MAXPOP1, - cJU_LEAF5_MAXPOP1, - cJU_LEAF6_MAXPOP1, - cJU_LEAF7_MAXPOP1, -#endif - // note: Root-level leaves are handled differently. -}; - -static uint8_t branchL_JPtype[] = { - 0, - 0, - cJU_JPBRANCH_L2, - cJU_JPBRANCH_L3, -#ifdef JU_64BIT - cJU_JPBRANCH_L4, - cJU_JPBRANCH_L5, - cJU_JPBRANCH_L6, - cJU_JPBRANCH_L7, -#endif - cJU_JPBRANCH_L, -}; - -static uint8_t branchB_JPtype[] = { - 0, - 0, - cJU_JPBRANCH_B2, - cJU_JPBRANCH_B3, -#ifdef JU_64BIT - cJU_JPBRANCH_B4, - cJU_JPBRANCH_B5, - cJU_JPBRANCH_B6, - cJU_JPBRANCH_B7, -#endif - cJU_JPBRANCH_B, -}; - -static uint8_t branchU_JPtype[] = { - 0, - 0, - cJU_JPBRANCH_U2, - cJU_JPBRANCH_U3, -#ifdef JU_64BIT - cJU_JPBRANCH_U4, - cJU_JPBRANCH_U5, - cJU_JPBRANCH_U6, - cJU_JPBRANCH_U7, -#endif - cJU_JPBRANCH_U, -}; - -// Subexpanse masks are similer to JU_DCDMASK() but without the need to clear -// the first digits bits. Avoid doing variable shifts by precomputing a -// lookup array. - -static Word_t subexp_mask[] = { - 0, - ~cJU_POP0MASK(1), - ~cJU_POP0MASK(2), - ~cJU_POP0MASK(3), -#ifdef JU_64BIT - ~cJU_POP0MASK(4), - ~cJU_POP0MASK(5), - ~cJU_POP0MASK(6), - ~cJU_POP0MASK(7), -#endif -}; - - -// FUNCTION PROTOTYPES: - -static bool_t j__udyInsArray(Pjp_t PjpParent, int Level, PWord_t PPop1, - PWord_t PIndex, -#ifdef JUDYL - Pjv_t PValue, -#endif - Pjpm_t Pjpm); - - -// **************************************************************************** -// J U D Y 1 S E T A R R A Y -// J U D Y L I N S A R R A Y -// -// Main entry point. See the manual entry for external overview. -// -// TBD: Until thats written, note that the function returns 1 for success or -// JERRI for serious error, including insufficient memory to build whole array; -// use Judy*Count() to see how many were stored, the first N of the total -// Count. Also, since it takes Count == Pop1, it cannot handle a full array. -// Also, "sorted" means ascending without duplicates, otherwise you get the -// "unsorted" error. -// -// The purpose of these functions is to allow rapid construction of a large -// Judy array given a sorted list of indexes (and for JudyL, corresponding -// values). At least one customer saw this as useful, and probably it would -// also be useful as a sufficient workaround for fast(er) unload/reload to/from -// disk. -// -// This code is written recursively for simplicity, until/unless someone -// decides to make it faster and more complex. Hopefully recursion is fast -// enough simply because the function is so much faster than a series of -// Set/Ins calls. - -#ifdef JUDY1 -FUNCTION int Judy1SetArray -#else -FUNCTION int JudyLInsArray -#endif - ( - PPvoid_t PPArray, // in which to insert, initially empty. - Word_t Count, // number of indexes (and values) to insert. -const Word_t * const PIndex, // list of indexes to insert. -#ifdef JUDYL -const Word_t * const PValue, // list of corresponding values. -#endif - PJError_t PJError // optional, for returning error info. - ) -{ - Pjlw_t Pjlw; // new root-level leaf. - Pjlw_t Pjlwindex; // first index in root-level leaf. - int offset; // in PIndex. - - -// CHECK FOR NULL OR NON-NULL POINTER (error by caller): - - if (PPArray == (PPvoid_t) NULL) - { JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); return(JERRI); } - - if (*PPArray != (Pvoid_t) NULL) - { JU_SET_ERRNO(PJError, JU_ERRNO_NONNULLPARRAY); return(JERRI); } - - if (PIndex == (PWord_t) NULL) - { JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); return(JERRI); } - -#ifdef JUDYL - if (PValue == (PWord_t) NULL) - { JU_SET_ERRNO(PJError, JU_ERRNO_NULLPVALUE); return(JERRI); } -#endif - - -// HANDLE LARGE COUNT (= POP1) (typical case): -// -// Allocate and initialize a JPM, set the root pointer to point to it, and then -// build the tree underneath it. - -// Common code for unusual error handling when no JPM available: - - if (Count > cJU_LEAFW_MAXPOP1) // too big for root-level leaf. - { - Pjpm_t Pjpm; // new, to allocate. - -// Allocate JPM: - - Pjpm = j__udyAllocJPM(); - JU_CHECKALLOC(Pjpm_t, Pjpm, JERRI); - *PPArray = (Pvoid_t) Pjpm; - -// Set some JPM fields: - - (Pjpm->jpm_Pop0) = Count - 1; - // note: (Pjpm->jpm_TotalMemWords) is now initialized. - -// Build Judy tree: -// -// In case of error save the final Count, possibly modified, unless modified to -// 0, in which case free the JPM itself: - - if (! j__udyInsArray(&(Pjpm->jpm_JP), cJU_ROOTSTATE, &Count, - (PWord_t) PIndex, -#ifdef JUDYL - (Pjv_t) PValue, -#endif - Pjpm)) - { - JU_COPY_ERRNO(PJError, Pjpm); - - if (Count) // partial success, adjust pop0: - { - (Pjpm->jpm_Pop0) = Count - 1; - } - else // total failure, free JPM: - { - j__udyFreeJPM(Pjpm, (Pjpm_t) NULL); - *PPArray = (Pvoid_t) NULL; - } - - DBGCODE(JudyCheckPop(*PPArray);) - return(JERRI); - } - - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - - } // large count - - -// HANDLE SMALL COUNT (= POP1): -// -// First ensure indexes are in sorted order: - - for (offset = 1; offset < Count; ++offset) - { - if (PIndex[offset - 1] >= PIndex[offset]) - { JU_SET_ERRNO(PJError, JU_ERRNO_UNSORTED); return(JERRI); } - } - - if (Count == 0) return(1); // *PPArray remains null. - - { - Pjlw = j__udyAllocJLW(Count + 1); - JU_CHECKALLOC(Pjlw_t, Pjlw, JERRI); - *PPArray = (Pvoid_t) Pjlw; - Pjlw[0] = Count - 1; // set pop0. - Pjlwindex = Pjlw + 1; - } - -// Copy whole-word indexes (and values) to the root-level leaf: - - JU_COPYMEM(Pjlwindex, PIndex, Count); -JUDYLCODE(JU_COPYMEM(JL_LEAFWVALUEAREA(Pjlw, Count), PValue, Count)); - - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - -} // Judy1SetArray() / JudyLInsArray() - - -// **************************************************************************** -// __ J U D Y I N S A R R A Y -// -// Given: -// -// - a pointer to a JP -// -// - the JPs level in the tree, that is, the number of digits left to decode -// in the indexes under the JP (one less than the level of the JPM or branch -// in which the JP resides); cJU_ROOTSTATE on first entry (when JP is the one -// in the JPM), down to 1 for a Leaf1, LeafB1, or FullPop -// -// - a pointer to the number of indexes (and corresponding values) to store in -// this subtree, to modify in case of partial success -// -// - a list of indexes (and for JudyL, corresponding values) to store in this -// subtree -// -// - a JPM for tracking memory usage and returning errors -// -// Recursively build a subtree (immediate indexes, leaf, or branch with -// subtrees) and modify the JP accordingly. On the way down, build a BranchU -// (only) for any expanse with *PPop1 too high for a leaf; on the way out, -// convert the BranchU to a BranchL or BranchB if appropriate. Keep memory -// statistics in the JPM. -// -// Return TRUE for success, or FALSE with error information set in the JPM in -// case of error, in which case leave a partially constructed but healthy tree, -// and modify parent population counts on the way out. -// -// Note: Each call of this function makes all modifications to the PjpParent -// it receives; neither the parent nor child calls do this. - -FUNCTION static bool_t j__udyInsArray( - Pjp_t PjpParent, // parent JP in/under which to store. - int Level, // initial digits remaining to decode. - PWord_t PPop1, // number of indexes to store. - PWord_t PIndex, // list of indexes to store. -#ifdef JUDYL - Pjv_t PValue, // list of corresponding values. -#endif - Pjpm_t Pjpm) // for memory and errors. -{ - Pjp_t Pjp; // lower-level JP. - Word_t Pjbany; // any type of branch. - int levelsub; // actual, of Pjps node, <= Level. - Word_t pop1 = *PPop1; // fast local value. - Word_t pop1sub; // population of one subexpanse. - uint8_t JPtype; // current JP type. - uint8_t JPtype_null; // precomputed value for new branch. - jp_t JPnull; // precomputed for speed. - Pjbu_t PjbuRaw; // constructed BranchU. - Pjbu_t Pjbu; - int digit; // in BranchU. - Word_t digitmask; // for a digit in a BranchU. - Word_t digitshifted; // shifted to correct offset. - Word_t digitshincr; // increment for digitshifted. - int offset; // in PIndex, or a bitmap subexpanse. - int numJPs; // number non-null in a BranchU. - bool_t retval; // to return from this func. -JUDYLCODE(Pjv_t PjvRaw); // destination value area. -JUDYLCODE(Pjv_t Pjv); - - -// MACROS FOR COMMON CODE: -// -// Note: These use function and local parameters from the context. -// Note: Assume newly allocated memory is zeroed. - -// Indicate whether a sorted list of indexes in PIndex, based on the first and -// last indexes in the list using pop1, are in the same subexpanse between -// Level and L_evel: -// -// This can be confusing! Note that SAMESUBEXP(L) == TRUE means the indexes -// are the same through level L + 1, and it says nothing about level L and -// lower; they might be the same or they might differ. -// -// Note: In principle SAMESUBEXP needs a mask for the digits from Level, -// inclusive, to L_evel, exclusive. But in practice, since the indexes are all -// known to be identical above Level, it just uses a mask for the digits -// through L_evel + 1; see subexp_mask[]. - -#define SAMESUBEXP(L_evel) \ - (! ((PIndex[0] ^ PIndex[pop1 - 1]) & subexp_mask[L_evel])) - -// Set PjpParent to a null JP appropriate for the level of the node to which it -// points, which is 1 less than the level of the node in which the JP resides, -// which is by definition Level: -// -// Note: This can set the JPMs JP to an invalid jp_Type, but it doesnt -// matter because the JPM is deleted by the caller. - -#define SETJPNULL_PARENT \ - JU_JPSETADT(PjpParent, 0, 0, cJU_JPNULL1 + Level - 1); - -// Variation to set a specified JP (in a branch being built) to a precomputed -// null JP: - -#define SETJPNULL(Pjp) *(Pjp) = JPnull - -// Handle complete (as opposed to partial) memory allocation failure: Set the -// parent JP to an appropriate null type (to leave a consistent tree), zero the -// callers population count, and return FALSE: -// -// Note: At Level == cJU_ROOTSTATE this sets the JPMs JPs jp_Type to a bogus -// value, but it doesnt matter because the JPM should be deleted by the -// caller. - -#define NOMEM { SETJPNULL_PARENT; *PPop1 = 0; return(FALSE); } - -// Allocate a Leaf1-N and save the address in Pjll; in case of failure, NOMEM: - -#define ALLOCLEAF(AllocLeaf) \ - if ((PjllRaw = AllocLeaf(pop1, Pjpm)) == (Pjll_t) NULL) NOMEM; \ - Pjll = P_JLL(PjllRaw); - -// Copy indexes smaller than words (and values which are whole words) from -// given arrays to immediate indexes or a leaf: -// -// TBD: These macros overlap with some of the code in JudyCascade.c; do some -// merging? That file has functions while these are macros. - -#define COPYTOLEAF_EVEN_SUB(Pjll,LeafType) \ - { \ - LeafType * P_leaf = (LeafType *) (Pjll); \ - Word_t p_op1 = pop1; \ - PWord_t P_Index = PIndex; \ - \ - assert(pop1 > 0); \ - \ - do { *P_leaf++ = *P_Index++; /* truncates */\ - } while (--(p_op1)); \ - } - -#define COPYTOLEAF_ODD_SUB(cLevel,Pjll,Copy) \ - { \ - uint8_t * P_leaf = (uint8_t *) (Pjll); \ - Word_t p_op1 = pop1; \ - PWord_t P_Index = PIndex; \ - \ - assert(pop1 > 0); \ - \ - do { \ - Copy(P_leaf, *P_Index); \ - P_leaf += (cLevel); ++P_Index; \ - } while (--(p_op1)); \ - } - -#ifdef JUDY1 - -#define COPYTOLEAF_EVEN(Pjll,LeafType) COPYTOLEAF_EVEN_SUB(Pjll,LeafType) -#define COPYTOLEAF_ODD(cLevel,Pjll,Copy) COPYTOLEAF_ODD_SUB(cLevel,Pjll,Copy) - -#else // JUDYL adds copying of values: - -#define COPYTOLEAF_EVEN(Pjll,LeafType) \ - { \ - COPYTOLEAF_EVEN_SUB(Pjll,LeafType) \ - JU_COPYMEM(Pjv, PValue, pop1); \ - } - -#define COPYTOLEAF_ODD(cLevel,Pjll,Copy) \ - { \ - COPYTOLEAF_ODD_SUB( cLevel,Pjll,Copy) \ - JU_COPYMEM(Pjv, PValue, pop1); \ - } - -#endif - -// Set the JP type for an immediate index, where BaseJPType is JPIMMED_*_02: - -#define SETIMMTYPE(BaseJPType) (PjpParent->jp_Type) = (BaseJPType) + pop1 - 2 - -// Allocate and populate a Leaf1-N: -// -// Build MAKELEAF_EVEN() and MAKELEAF_ODD() using macros for common code. - -#define MAKELEAF_SUB1(AllocLeaf,ValueArea,LeafType) \ - ALLOCLEAF(AllocLeaf); \ - JUDYLCODE(Pjv = ValueArea(Pjll, pop1)) - - -#define MAKELEAF_SUB2(cLevel,JPType) \ -{ \ - Word_t D_cdP0; \ - assert(pop1 - 1 <= cJU_POP0MASK(cLevel)); \ - D_cdP0 = (*PIndex & cJU_DCDMASK(cLevel)) | (pop1 - 1); \ - JU_JPSETADT(PjpParent, (Word_t)PjllRaw, D_cdP0, JPType); \ -} - - -#define MAKELEAF_EVEN(cLevel,JPType,AllocLeaf,ValueArea,LeafType) \ - MAKELEAF_SUB1(AllocLeaf,ValueArea,LeafType); \ - COPYTOLEAF_EVEN(Pjll, LeafType); \ - MAKELEAF_SUB2(cLevel, JPType) - -#define MAKELEAF_ODD(cLevel,JPType,AllocLeaf,ValueArea,Copy) \ - MAKELEAF_SUB1(AllocLeaf,ValueArea,LeafType); \ - COPYTOLEAF_ODD(cLevel, Pjll, Copy); \ - MAKELEAF_SUB2(cLevel, JPType) - -// Ensure that the indexes to be stored in immediate indexes or a leaf are -// sorted: -// -// This check is pure overhead, but required in order to protect the Judy array -// against caller error, to avoid a later corruption or core dump from a -// seemingly valid Judy array. Do this check piecemeal at the leaf level while -// the indexes are already in the cache. Higher-level order-checking occurs -// while building branches. -// -// Note: Any sorting error in the expanse of a single immediate indexes JP or -// a leaf => save no indexes in that expanse. - -#define CHECKLEAFORDER \ - { \ - for (offset = 1; offset < pop1; ++offset) \ - { \ - if (PIndex[offset - 1] >= PIndex[offset]) \ - { \ - SETJPNULL_PARENT; \ - *PPop1 = 0; \ - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_UNSORTED); \ - return(FALSE); \ - } \ - } \ - } - - -// ------ START OF CODE ------ - - assert( Level >= 1); - assert( Level <= cJU_ROOTSTATE); - assert((Level < cJU_ROOTSTATE) || (pop1 > cJU_LEAFW_MAXPOP1)); - - -// CHECK FOR TOP LEVEL: -// -// Special case: If at the top level (PjpParent is in the JPM), a top-level -// branch must be created, even if its a BranchL with just one JP. (The JPM -// cannot point to a leaf because the leaf would have to be a lower-level, -// higher-capacity leaf under a narrow pointer (otherwise a root-level leaf -// would suffice), and the JPMs JP cant handle a narrow pointer because the -// jp_DcdPopO field isnt big enough.) Otherwise continue to check for a pop1 -// small enough to support immediate indexes or a leaf before giving up and -// making a lower-level branch. - - if (Level == cJU_ROOTSTATE) - { - levelsub = cJU_ROOTSTATE; - goto BuildBranch2; - } - assert(Level < cJU_ROOTSTATE); - - -// SKIP JPIMMED_*_01: -// -// Immeds with pop1 == 1 should be handled in-line during branch construction. - - assert(pop1 > 1); - - -// BUILD JPIMMED_*_02+: -// -// The starting address of the indexes depends on Judy1 or JudyL; also, JudyL -// includes a pointer to a values-only leaf. - - if (pop1 <= immed_maxpop1[Level]) // note: always < root level. - { - JUDY1CODE(uint8_t * Pjll = (uint8_t *) (PjpParent->jp_1Index);) - JUDYLCODE(uint8_t * Pjll = (uint8_t *) (PjpParent->jp_LIndex);) - - CHECKLEAFORDER; // indexes to be stored are sorted. - -#ifdef JUDYL - if ((PjvRaw = j__udyLAllocJV(pop1, Pjpm)) == (Pjv_t) NULL) - NOMEM; - (PjpParent->jp_Addr) = (Word_t) PjvRaw; - Pjv = P_JV(PjvRaw); -#endif - - switch (Level) - { - case 1: COPYTOLEAF_EVEN(Pjll, uint8_t); - SETIMMTYPE(cJU_JPIMMED_1_02); - break; -#if (defined(JUDY1) || defined(JU_64BIT)) - case 2: COPYTOLEAF_EVEN(Pjll, uint16_t); - SETIMMTYPE(cJU_JPIMMED_2_02); - break; - case 3: COPYTOLEAF_ODD(3, Pjll, JU_COPY3_LONG_TO_PINDEX); - SETIMMTYPE(cJU_JPIMMED_3_02); - break; -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case 4: COPYTOLEAF_EVEN(Pjll, uint32_t); - SETIMMTYPE(cJ1_JPIMMED_4_02); - break; - case 5: COPYTOLEAF_ODD(5, Pjll, JU_COPY5_LONG_TO_PINDEX); - SETIMMTYPE(cJ1_JPIMMED_5_02); - break; - case 6: COPYTOLEAF_ODD(6, Pjll, JU_COPY6_LONG_TO_PINDEX); - SETIMMTYPE(cJ1_JPIMMED_6_02); - break; - case 7: COPYTOLEAF_ODD(7, Pjll, JU_COPY7_LONG_TO_PINDEX); - SETIMMTYPE(cJ1_JPIMMED_7_02); - break; -#endif - default: assert(FALSE); // should be impossible. - } - - return(TRUE); // note: no children => no *PPop1 mods. - - } // JPIMMED_*_02+ - - -// BUILD JPLEAF*: -// -// This code is a little tricky. The method is: For each level starting at -// the present Level down through levelsub = 1, and then as a special case for -// LeafB1 and FullPop (which are also at levelsub = 1 but have different -// capacity, see later), check if pop1 fits in a leaf (using leaf_maxpop1[]) -// at that level. If so, except for Level == levelsub, check if all of the -// current indexes to be stored are in the same (narrow) subexpanse, that is, -// the digits from Level to levelsub + 1, inclusive, are identical between the -// first and last index in the (sorted) list (in PIndex). If this condition is -// satisfied at any level, build a leaf at that level (under a narrow pointer -// if Level > levelsub). -// -// Note: Doing the search in this order results in storing the indexes in -// "least compressed form." - - for (levelsub = Level; levelsub >= 1; --levelsub) - { - Pjll_t PjllRaw; - Pjll_t Pjll; - -// Check if pop1 is too large to fit in a leaf at levelsub; if so, try the next -// lower level: - - if (pop1 > leaf_maxpop1[levelsub]) continue; - -// If pop1 fits in a leaf at levelsub, but levelsub is lower than Level, must -// also check whether all the indexes in the expanse to store can in fact be -// placed under a narrow pointer; if not, a leaf cannot be used, at this or any -// lower level (levelsub): - - if ((levelsub < Level) && (! SAMESUBEXP(levelsub))) - goto BuildBranch; // cant use a narrow, need a branch. - -// Ensure valid pop1 and all indexes are in fact common through Level: - - assert(pop1 <= cJU_POP0MASK(Level) + 1); - assert(! ((PIndex[0] ^ PIndex[pop1 - 1]) & cJU_DCDMASK(Level))); - - CHECKLEAFORDER; // indexes to be stored are sorted. - -// Build correct type of leaf: -// -// Note: The jp_DcdPopO and jp_Type assignments in MAKELEAF_* happen correctly -// for the levelsub (not Level) of the new leaf, even if its under a narrow -// pointer. - - switch (levelsub) - { -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case 1: MAKELEAF_EVEN(1, cJU_JPLEAF1, j__udyAllocJLL1, - JL_LEAF1VALUEAREA, uint8_t); - break; -#endif - case 2: MAKELEAF_EVEN(2, cJU_JPLEAF2, j__udyAllocJLL2, - JL_LEAF2VALUEAREA, uint16_t); - break; - case 3: MAKELEAF_ODD( 3, cJU_JPLEAF3, j__udyAllocJLL3, - JL_LEAF3VALUEAREA, JU_COPY3_LONG_TO_PINDEX); - break; -#ifdef JU_64BIT - case 4: MAKELEAF_EVEN(4, cJU_JPLEAF4, j__udyAllocJLL4, - JL_LEAF4VALUEAREA, uint32_t); - break; - case 5: MAKELEAF_ODD( 5, cJU_JPLEAF5, j__udyAllocJLL5, - JL_LEAF5VALUEAREA, JU_COPY5_LONG_TO_PINDEX); - break; - case 6: MAKELEAF_ODD( 6, cJU_JPLEAF6, j__udyAllocJLL6, - JL_LEAF6VALUEAREA, JU_COPY6_LONG_TO_PINDEX); - break; - case 7: MAKELEAF_ODD( 7, cJU_JPLEAF7, j__udyAllocJLL7, - JL_LEAF7VALUEAREA, JU_COPY7_LONG_TO_PINDEX); - break; -#endif - default: assert(FALSE); // should be impossible. - } - - return(TRUE); // note: no children => no *PPop1 mods. - - } // JPLEAF* - - -// BUILD JPLEAF_B1 OR JPFULLPOPU1: -// -// See above about JPLEAF*. If pop1 doesnt fit in any level of linear leaf, -// it might still fit in a LeafB1 or FullPop, perhaps under a narrow pointer. - - if ((Level == 1) || SAMESUBEXP(1)) // same until last digit. - { - Pjlb_t PjlbRaw; // for bitmap leaf. - Pjlb_t Pjlb; - - assert(pop1 <= cJU_JPFULLPOPU1_POP0 + 1); - CHECKLEAFORDER; // indexes to be stored are sorted. - -#ifdef JUDY1 - -// JPFULLPOPU1: - - if (pop1 == cJU_JPFULLPOPU1_POP0 + 1) - { - Word_t Addr = PjpParent->jp_Addr; - Word_t DcdP0 = (*PIndex & cJU_DCDMASK(1)) - | cJU_JPFULLPOPU1_POP0; - JU_JPSETADT(PjpParent, Addr, DcdP0, cJ1_JPFULLPOPU1); - - return(TRUE); - } -#endif - -// JPLEAF_B1: - - if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL) - NOMEM; - Pjlb = P_JLB(PjlbRaw); - - for (offset = 0; offset < pop1; ++offset) - JU_BITMAPSETL(Pjlb, PIndex[offset]); - - retval = TRUE; // default. - -#ifdef JUDYL - -// Build subexpanse values-only leaves (LeafVs) under LeafB1: - - for (offset = 0; offset < cJU_NUMSUBEXPL; ++offset) - { - if (! (pop1sub = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, offset)))) - continue; // skip empty subexpanse. - -// Allocate one LeafV = JP subarray; if out of memory, clear bitmaps for higher -// subexpanses and adjust *PPop1: - - if ((PjvRaw = j__udyLAllocJV(pop1sub, Pjpm)) - == (Pjv_t) NULL) - { - for (/* null */; offset < cJU_NUMSUBEXPL; ++offset) - { - *PPop1 -= j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, offset)); - JU_JLB_BITMAP(Pjlb, offset) = 0; - } - - retval = FALSE; - break; - } - -// Populate values-only leaf and save the pointer to it: - - Pjv = P_JV(PjvRaw); - JU_COPYMEM(Pjv, PValue, pop1sub); - JL_JLB_PVALUE(Pjlb, offset) = PjvRaw; // first-tier pointer. - PValue += pop1sub; - - } // for each subexpanse - -#endif // JUDYL - -// Attach new LeafB1 to parent JP; note use of *PPop1 possibly < pop1: - - JU_JPSETADT(PjpParent, (Word_t) PjlbRaw, - (*PIndex & cJU_DCDMASK(1)) | (*PPop1 - 1), cJU_JPLEAF_B1); - - return(retval); - - } // JPLEAF_B1 or JPFULLPOPU1 - - -// BUILD JPBRANCH_U*: -// -// Arriving at BuildBranch means Level < top level but the pop1 is too large -// for immediate indexes or a leaf, even under a narrow pointer, including a -// LeafB1 or FullPop at level 1. This implies SAMESUBEXP(1) == FALSE, that is, -// the indexes to be stored "branch" at level 2 or higher. - -BuildBranch: // come here directly if a leaf wont work. - - assert(Level >= 2); - assert(Level < cJU_ROOTSTATE); - assert(! SAMESUBEXP(1)); // sanity check, see above. - -// Determine the appropriate level for a new branch node; see if a narrow -// pointer can be used: -// -// This can be confusing. The branch is required at the lowest level L where -// the indexes to store are not in the same subexpanse at level L-1. Work down -// from Level to tree level 3, which is 1 above the lowest tree level = 2 at -// which a branch can be used. Theres no need to check SAMESUBEXP at level 2 -// because its known to be false at level 2-1 = 1. -// -// Note: Unlike for a leaf node, a narrow pointer is always used for a branch -// if possible, that is, maximum compression is always used, except at the top -// level of the tree, where a JPM cannot support a narrow pointer, meaning a -// top BranchL can have a single JP (fanout = 1); but that case jumps directly -// to BuildBranch2. -// -// Note: For 32-bit systems the only usable values for a narrow pointer are -// Level = 3 and levelsub = 2; 64-bit systems have many more choices; but -// hopefully this for-loop is fast enough even on a 32-bit system. -// -// TBD: If not fast enough, #ifdef JU_64BIT and handle the 32-bit case faster. - - for (levelsub = Level; levelsub >= 3; --levelsub) // see above. - if (! SAMESUBEXP(levelsub - 1)) // at limit of narrow pointer. - break; // put branch at levelsub. - -BuildBranch2: // come here directly for Level = levelsub = cJU_ROOTSTATE. - - assert(levelsub >= 2); - assert(levelsub <= Level); - -// Initially build a BranchU: -// -// Always start with a BranchU because the number of populated subexpanses is -// not yet known. Use digitmask, digitshifted, and digitshincr to avoid -// expensive variable shifts within JU_DIGITATSTATE within the loop. -// -// TBD: The use of digitmask, etc. results in more increment operations per -// loop, is there an even faster way? -// -// TBD: Would it pay to pre-count the populated JPs (subexpanses) and -// pre-compress the branch, that is, build a BranchL or BranchB immediately, -// also taking account of opportunistic uncompression rules? Probably not -// because at high levels of the tree there might be huge numbers of indexes -// (hence cache lines) to scan in the PIndex array to determine the fanout -// (number of JPs) needed. - - if ((PjbuRaw = j__udyAllocJBU(Pjpm)) == (Pjbu_t) NULL) NOMEM; - Pjbu = P_JBU(PjbuRaw); - - JPtype_null = cJU_JPNULL1 + levelsub - 2; // in new BranchU. - JU_JPSETADT(&JPnull, 0, 0, JPtype_null); - - Pjp = Pjbu->jbu_jp; // for convenience in loop. - numJPs = 0; // non-null in the BranchU. - digitmask = cJU_MASKATSTATE(levelsub); // see above. - digitshincr = 1UL << (cJU_BITSPERBYTE * (levelsub - 1)); - retval = TRUE; - -// Scan and populate JPs (subexpanses): -// -// Look for all indexes matching each digit in the BranchU (at the correct -// levelsub), and meanwhile notice any sorting error. Increment PIndex (and -// PValue) and reduce pop1 for each subexpanse handled successfully. - - for (digit = digitshifted = 0; - digit < cJU_BRANCHUNUMJPS; - ++digit, digitshifted += digitshincr, ++Pjp) - { - DBGCODE(Word_t pop1subprev;) - assert(pop1 != 0); // end of indexes is handled elsewhere. - -// Count indexes in digits subexpanse: - - for (pop1sub = 0; pop1sub < pop1; ++pop1sub) - if (digitshifted != (PIndex[pop1sub] & digitmask)) break; - -// Empty subexpanse (typical, performance path) or sorting error (rare): - - if (pop1sub == 0) - { - if (digitshifted < (PIndex[0] & digitmask)) - { SETJPNULL(Pjp); continue; } // empty subexpanse. - - assert(pop1 < *PPop1); // did save >= 1 index and decr pop1. - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_UNSORTED); - goto AbandonBranch; - } - -// Non-empty subexpanse: -// -// First shortcut by handling pop1sub == 1 (JPIMMED_*_01) inline locally. - - if (pop1sub == 1) // note: can be at root level. - { - Word_t Addr = 0; - JUDYLCODE(Addr = (Word_t) (*PValue++);) - JU_JPSETADT(Pjp, Addr, *PIndex, cJU_JPIMMED_1_01 + levelsub -2); - - ++numJPs; - - if (--pop1) { ++PIndex; continue; } // more indexes to store. - - ++digit; ++Pjp; // skip JP just saved. - goto ClearBranch; // save time. - } - -// Recurse to populate one digits (subexpanses) JP; if successful, skip -// indexes (and values) just stored (performance path), except when expanse is -// completely stored: - - DBGCODE(pop1subprev = pop1sub;) - - if (j__udyInsArray(Pjp, levelsub - 1, &pop1sub, (PWord_t) PIndex, -#ifdef JUDYL - (Pjv_t) PValue, -#endif - Pjpm)) - { // complete success. - ++numJPs; - assert(pop1subprev == pop1sub); - assert(pop1 >= pop1sub); - - if ((pop1 -= pop1sub) != 0) // more indexes to store: - { - PIndex += pop1sub; // skip indexes just stored. - JUDYLCODE(PValue += pop1sub;) - continue; - } - // else leave PIndex in BranchUs expanse. - -// No more indexes to store in BranchUs expanse: - - ++digit; ++Pjp; // skip JP just saved. - goto ClearBranch; // save time. - } - -// Handle any error at a lower level of recursion: -// -// In case of partial success, pop1sub != 0, but it was reduced from the value -// passed to j__udyInsArray(); skip this JP later during ClearBranch. - - assert(pop1subprev > pop1sub); // check j__udyInsArray(). - assert(pop1 > pop1sub); // check j__udyInsArray(). - - if (pop1sub) // partial success. - { ++digit; ++Pjp; ++numJPs; } // skip JP just saved. - - pop1 -= pop1sub; // deduct saved indexes if any. - -// Same-level sorting error, or any lower-level error; abandon the rest of the -// branch: -// -// Arrive here with pop1 = remaining unsaved indexes (always non-zero). Adjust -// the *PPop1 value to record and return, modify retval, and use ClearBranch to -// finish up. - -AbandonBranch: - assert(pop1 != 0); // more to store, see above. - assert(pop1 <= *PPop1); // sanity check. - - *PPop1 -= pop1; // deduct unsaved indexes. - pop1 = 0; // to avoid error later. - retval = FALSE; - -// Error (rare), or end of indexes while traversing new BranchU (performance -// path); either way, mark the remaining JPs, if any, in the BranchU as nulls -// and exit the loop: -// -// Arrive here with digit and Pjp set to the first JP to set to null. - -ClearBranch: - for (/* null */; digit < cJU_BRANCHUNUMJPS; ++digit, ++Pjp) - SETJPNULL(Pjp); - break; // saves one more compare. - - } // for each digit - - -// FINISH JPBRANCH_U*: -// -// Arrive here with a BranchU built under Pjbu, numJPs set, and either: retval -// == TRUE and *PPop1 unmodified, or else retval == FALSE, *PPop1 set to the -// actual number of indexes saved (possibly 0 for complete failure at a lower -// level upon the first call of j__udyInsArray()), and the Judy error set in -// Pjpm. Either way, PIndex points to an index within the expanse just -// handled. - - Pjbany = (Word_t) PjbuRaw; // default = use this BranchU. - JPtype = branchU_JPtype[levelsub]; - -// Check for complete failure above: - - assert((! retval) || *PPop1); // sanity check. - - if ((! retval) && (*PPop1 == 0)) // nothing stored, full failure. - { - j__udyFreeJBU(PjbuRaw, Pjpm); - SETJPNULL_PARENT; - return(FALSE); - } - -// Complete or partial success so far; watch for sorting error after the -// maximum digit (255) in the BranchU, which is indicated by having more -// indexes to store in the BranchUs expanse: -// -// For example, if an index to store has a digit of 255 at levelsub, followed -// by an index with a digit of 254, the for-loop above runs out of digits -// without reducing pop1 to 0. - - if (pop1 != 0) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_UNSORTED); - *PPop1 -= pop1; // deduct unsaved indexes. - retval = FALSE; - } - assert(*PPop1 != 0); // branch (still) cannot be empty. - - -// OPTIONALLY COMPRESS JPBRANCH_U*: -// -// See if the BranchU should be compressed to a BranchL or BranchB; if so, do -// that and free the BranchU; otherwise just use the existing BranchU. Follow -// the same rules as in JudyIns.c (version 4.95): Only check local population -// (cJU_OPP_UNCOMP_POP0) for BranchL, and only check global memory efficiency -// (JU_OPP_UNCOMPRESS) for BranchB. TBD: Have the rules changed? -// -// Note: Because of differing order of operations, the latter compression -// might not result in the same set of branch nodes as a series of sequential -// insertions. -// -// Note: Allocating a BranchU only to sometimes convert it to a BranchL or -// BranchB is unfortunate, but attempting to work with a temporary BranchU on -// the stack and then allocate and keep it as a BranchU in many cases is worse -// in terms of error handling. - - -// COMPRESS JPBRANCH_U* TO JPBRANCH_L*: - - if (numJPs <= cJU_BRANCHLMAXJPS) // JPs fit in a BranchL. - { - Pjbl_t PjblRaw = (Pjbl_t) NULL; // new BranchL; init for cc. - Pjbl_t Pjbl; - - if ((*PPop1 > JU_BRANCHL_MAX_POP) // pop too high. - || ((PjblRaw = j__udyAllocJBL(Pjpm)) == (Pjbl_t) NULL)) - { // cant alloc BranchL. - goto SetParent; // just keep BranchU. - } - - Pjbl = P_JBL(PjblRaw); - -// Copy BranchU JPs to BranchL: - - (Pjbl->jbl_NumJPs) = numJPs; - offset = 0; - - for (digit = 0; digit < cJU_BRANCHUNUMJPS; ++digit) - { - if ((((Pjbu->jbu_jp) + digit)->jp_Type) == JPtype_null) - continue; - - (Pjbl->jbl_Expanse[offset ]) = digit; - (Pjbl->jbl_jp [offset++]) = Pjbu->jbu_jp[digit]; - } - assert(offset == numJPs); // found same number. - -// Free the BranchU and prepare to use the new BranchL instead: - - j__udyFreeJBU(PjbuRaw, Pjpm); - - Pjbany = (Word_t) PjblRaw; - JPtype = branchL_JPtype[levelsub]; - - } // compress to BranchL - - -// COMPRESS JPBRANCH_U* TO JPBRANCH_B*: -// -// If unable to allocate the BranchB or any JP subarray, free all related -// memory and just keep the BranchU. -// -// Note: This use of JU_OPP_UNCOMPRESS is a bit conservative because the -// BranchU is already allocated while the (presumably smaller) BranchB is not, -// the opposite of how its used in single-insert code. - - else - { - Pjbb_t PjbbRaw = (Pjbb_t) NULL; // new BranchB; init for cc. - Pjbb_t Pjbb; - Pjp_t Pjp2; // in BranchU. - - if ((*PPop1 > JU_BRANCHB_MAX_POP) // pop too high. - || ((PjbbRaw = j__udyAllocJBB(Pjpm)) == (Pjbb_t) NULL)) - { // cant alloc BranchB. - goto SetParent; // just keep BranchU. - } - - Pjbb = P_JBB(PjbbRaw); - -// Set bits in bitmap for populated subexpanses: - - Pjp2 = Pjbu->jbu_jp; - - for (digit = 0; digit < cJU_BRANCHUNUMJPS; ++digit) - if ((((Pjbu->jbu_jp) + digit)->jp_Type) != JPtype_null) - JU_BITMAPSETB(Pjbb, digit); - -// Copy non-null JPs to BranchB JP subarrays: - - for (offset = 0; offset < cJU_NUMSUBEXPB; ++offset) - { - Pjp_t PjparrayRaw; - Pjp_t Pjparray; - - if (! (numJPs = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, offset)))) - continue; // skip empty subexpanse. - -// If unable to allocate a JP subarray, free all BranchB memory so far and -// continue to use the BranchU: - - if ((PjparrayRaw = j__udyAllocJBBJP(numJPs, Pjpm)) - == (Pjp_t) NULL) - { - while (offset-- > 0) - { - if (JU_JBB_PJP(Pjbb, offset) == (Pjp_t) NULL) continue; - - j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, offset), - j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, offset)), - Pjpm); - } - j__udyFreeJBB(PjbbRaw, Pjpm); - goto SetParent; // keep BranchU. - } - -// Set one JP subarray pointer and copy the subexpanses JPs to the subarray: -// -// Scan the BranchU for non-null JPs until numJPs JPs are copied. - - JU_JBB_PJP(Pjbb, offset) = PjparrayRaw; - Pjparray = P_JP(PjparrayRaw); - - while (numJPs-- > 0) - { - while ((Pjp2->jp_Type) == JPtype_null) - { - ++Pjp2; - assert(Pjp2 < (Pjbu->jbu_jp) + cJU_BRANCHUNUMJPS); - } - *Pjparray++ = *Pjp2++; - } - } // for each subexpanse - -// Free the BranchU and prepare to use the new BranchB instead: - - j__udyFreeJBU(PjbuRaw, Pjpm); - - Pjbany = (Word_t) PjbbRaw; - JPtype = branchB_JPtype[levelsub]; - - } // compress to BranchB - - -// COMPLETE OR PARTIAL SUCCESS: -// -// Attach new branch (under Pjp, with JPtype) to parent JP; note use of *PPop1, -// possibly reduced due to partial failure. - -SetParent: - (PjpParent->jp_Addr) = Pjbany; - (PjpParent->jp_Type) = JPtype; - - if (Level < cJU_ROOTSTATE) // PjpParent not in JPM: - { - Word_t DcdP0 = (*PIndex & cJU_DCDMASK(levelsub)) | (*PPop1 - 1); - - JU_JPSETADT(PjpParent ,Pjbany, DcdP0, JPtype); - } - - return(retval); - -} // j__udyInsArray() diff --git a/libjudy/src/JudyCommon/JudyInsertBranch.c b/libjudy/src/JudyCommon/JudyInsertBranch.c deleted file mode 100644 index eaf8a5c94f..0000000000 --- a/libjudy/src/JudyCommon/JudyInsertBranch.c +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.17 $ $Source: /judy/src/JudyCommon/JudyInsertBranch.c $ - -// BranchL insertion functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -extern int j__udyCreateBranchL(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); - - -// **************************************************************************** -// __ J U D Y I N S E R T B R A N C H -// -// Insert 2-element BranchL in between Pjp and Pjp->jp_Addr. -// -// Return -1 if out of memory, otherwise return 1. - -FUNCTION int j__udyInsertBranch( - Pjp_t Pjp, // JP containing narrow pointer. - Word_t Index, // outlier to Pjp. - Word_t BranchLevel, // of what JP points to, mapped from JP type. - Pjpm_t Pjpm) // for global accounting. -{ - jp_t JP2 [2]; - jp_t JP; - Pjp_t PjpNull; - Word_t XorExp; - Word_t Inew, Iold; - Word_t DCDMask; // initially for original BranchLevel. - int Ret; - uint8_t Exp2[2]; - uint8_t DecodeByteN, DecodeByteO; - -// Get the current mask for the DCD digits: - - DCDMask = cJU_DCDMASK(BranchLevel); - -// Obtain Dcd bits that differ between Index and JP, shifted so the -// digit for BranchLevel is the LSB: - - XorExp = ((Index ^ JU_JPDCDPOP0(Pjp)) & (cJU_ALLONES >> cJU_BITSPERBYTE)) - >> (BranchLevel * cJU_BITSPERBYTE); - assert(XorExp); // Index must be an outlier. - -// Count levels between object under narrow pointer and the level at which -// the outlier diverges from it, which is always at least initial -// BranchLevel + 1, to end up with the level (JP type) at which to insert -// the new intervening BranchL: - - do { ++BranchLevel; } while ((XorExp >>= cJU_BITSPERBYTE)); - assert((BranchLevel > 1) && (BranchLevel < cJU_ROOTSTATE)); - -// Get the MSB (highest digit) that differs between the old expanse and -// the new Index to insert: - - DecodeByteO = JU_DIGITATSTATE(JU_JPDCDPOP0(Pjp), BranchLevel); - DecodeByteN = JU_DIGITATSTATE(Index, BranchLevel); - - assert(DecodeByteO != DecodeByteN); - -// Determine sorted order for old expanse and new Index digits: - - if (DecodeByteN > DecodeByteO) { Iold = 0; Inew = 1; } - else { Iold = 1; Inew = 0; } - -// Copy old JP into staging area for new Branch - JP2 [Iold] = *Pjp; - Exp2[Iold] = DecodeByteO; - Exp2[Inew] = DecodeByteN; - -// Create a 2 Expanse Linear branch -// -// Note: Pjp->jp_Addr is set by j__udyCreateBranchL() - - Ret = j__udyCreateBranchL(Pjp, JP2, Exp2, 2, Pjpm); - if (Ret == -1) return(-1); - -// Get Pjp to the NULL of where to do insert - PjpNull = ((P_JBL(Pjp->jp_Addr))->jbl_jp) + Inew; - -// Convert to a cJU_JPIMMED_*_01 at the correct level: -// Build JP and set type below to: cJU_JPIMMED_X_01 - JU_JPSETADT(PjpNull, 0, Index, cJU_JPIMMED_1_01 - 2 + BranchLevel); - -// Return pointer to Value area in cJU_JPIMMED_X_01 - JUDYLCODE(Pjpm->jpm_PValue = (Pjv_t) PjpNull;) - -// The old JP now points to a BranchL that is at higher level. Therefore -// it contains excess DCD bits (in the least significant position) that -// must be removed (zeroed); that is, they become part of the Pop0 -// subfield. Note that the remaining (lower) bytes in the Pop0 field do -// not change. -// -// Take from the old DCDMask, which went "down" to a lower BranchLevel, -// and zero any high bits that are still in the mask at the new, higher -// BranchLevel; then use this mask to zero the bits in jp_DcdPopO: - -// Set old JP to a BranchL at correct level - - Pjp->jp_Type = cJU_JPBRANCH_L2 - 2 + BranchLevel; - DCDMask ^= cJU_DCDMASK(BranchLevel); - DCDMask = ~DCDMask & JU_JPDCDPOP0(Pjp); - JP = *Pjp; - JU_JPSETADT(Pjp, JP.jp_Addr, DCDMask, JP.jp_Type); - - return(1); - -} // j__udyInsertBranch() diff --git a/libjudy/src/JudyCommon/JudyMalloc.c b/libjudy/src/JudyCommon/JudyMalloc.c deleted file mode 100644 index 1f0ab20e84..0000000000 --- a/libjudy/src/JudyCommon/JudyMalloc.c +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.33 $ $Source: /judy/src/JudyCommon/JudyMalloc.c $ -// ************************************************************************ // -// JUDY - Memory Allocater // -// -by- // -// Douglas L. Baskins // -// Hewlett Packard // -// Fort Collins, Co // -// (970) 229-2027 // -// // -// ************************************************************************ // - -// JUDY INCLUDE FILES -#include "Judy.h" - -// **************************************************************************** -// J U D Y M A L L O C -// -// Allocate RAM. This is the single location in Judy code that calls -// malloc(3C). Note: JPM accounting occurs at a higher level. - -Word_t JudyMalloc( - Word_t Words) -{ - Word_t Addr; - - Addr = (Word_t) malloc(Words * sizeof(Word_t)); - return(Addr); - -} // JudyMalloc() - - -// **************************************************************************** -// J U D Y F R E E - -void JudyFree( - void * PWord, - Word_t Words) -{ - (void) Words; - free(PWord); - -} // JudyFree() - - -// **************************************************************************** -// J U D Y M A L L O C -// -// Higher-level "wrapper" for allocating objects that need not be in RAM, -// although at this time they are in fact only in RAM. Later we hope that some -// entire subtrees (at a JPM or branch) can be "virtual", so their allocations -// and frees should go through this level. - -Word_t JudyMallocVirtual( - Word_t Words) -{ - return(JudyMalloc(Words)); - -} // JudyMallocVirtual() - - -// **************************************************************************** -// J U D Y F R E E - -void JudyFreeVirtual( - void * PWord, - Word_t Words) -{ - JudyFree(PWord, Words); - -} // JudyFreeVirtual() diff --git a/libjudy/src/JudyCommon/JudyMallocIF.c b/libjudy/src/JudyCommon/JudyMallocIF.c deleted file mode 100644 index 9a7d02f210..0000000000 --- a/libjudy/src/JudyCommon/JudyMallocIF.c +++ /dev/null @@ -1,782 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.45 $ $Source: /judy/src/JudyCommon/JudyMallocIF.c $ -// -// Judy malloc/free interface functions for Judy1 and JudyL. -// -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DTRACEMI (Malloc Interface) to turn on tracing of malloc/free -// calls at the interface level. (See also TRACEMF in lower-level code.) -// Use -DTRACEMI2 for a terser format suitable for trace analysis. -// -// There can be malloc namespace bits in the LSBs of "raw" addresses from most, -// but not all, of the j__udy*Alloc*() functions; see also JudyPrivate.h. To -// test the Judy code, compile this file with -DMALLOCBITS and use debug flavor -// only (for assertions). This test ensures that (a) all callers properly mask -// the namespace bits out before dereferencing a pointer (or else a core dump -// occurs), and (b) all callers send "raw" (unmasked) addresses to -// j__udy*Free*() calls. -// -// Note: Currently -DDEBUG turns on MALLOCBITS automatically. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -// Set "hidden" global j__uMaxWords to the maximum number of words to allocate -// to any one array (large enough to have a JPM, otherwise j__uMaxWords is -// ignored), to trigger a fake malloc error when the number is exceeded. Note, -// this code is always executed, not #ifdefd, because its virtually free. -// -// Note: To keep the MALLOC macro faster and simpler, set j__uMaxWords to -// MAXINT, not zero, by default. - -Word_t j__uMaxWords = ~0UL; - -// This macro hides the faking of a malloc failure: -// -// Note: To keep this fast, just compare WordsPrev to j__uMaxWords without the -// complexity of first adding WordsNow, meaning the trigger point is not -// exactly where you might assume, but it shouldnt matter. - -#define MALLOC(MallocFunc,WordsPrev,WordsNow) \ - (((WordsPrev) > j__uMaxWords) ? 0UL : MallocFunc(WordsNow)) - -// Clear words starting at address: -// -// Note: Only use this for objects that care; in other cases, it doesnt -// matter if the objects memory is pre-zeroed. - -#define ZEROWORDS(Addr,Words) \ - { \ - Word_t Words__ = (Words); \ - PWord_t Addr__ = (PWord_t) (Addr); \ - while (Words__--) *Addr__++ = 0UL; \ - } - -#ifdef TRACEMI - -// TRACING SUPPORT: -// -// Note: For TRACEMI, use a format for address printing compatible with other -// tracing facilities; in particular, %x not %lx, to truncate the "noisy" high -// part on 64-bit systems. -// -// TBD: The trace macros need fixing for alternate address types. -// -// Note: TRACEMI2 supports trace analysis no matter the underlying malloc/free -// engine used. - -#include - -static Word_t j__udyMemSequence = 0L; // event sequence number. - -#define TRACE_ALLOC5(a,b,c,d,e) (void) printf(a, (b), c, d) -#define TRACE_FREE5( a,b,c,d,e) (void) printf(a, (b), c, d) -#define TRACE_ALLOC6(a,b,c,d,e,f) (void) printf(a, (b), c, d, e) -#define TRACE_FREE6( a,b,c,d,e,f) (void) printf(a, (b), c, d, e) - -#else - -#ifdef TRACEMI2 - -#include - -#define b_pw cJU_BYTESPERWORD - -#define TRACE_ALLOC5(a,b,c,d,e) \ - (void) printf("a %lx %lx %lx\n", (b), (d) * b_pw, e) -#define TRACE_FREE5( a,b,c,d,e) \ - (void) printf("f %lx %lx %lx\n", (b), (d) * b_pw, e) -#define TRACE_ALLOC6(a,b,c,d,e,f) \ - (void) printf("a %lx %lx %lx\n", (b), (e) * b_pw, f) -#define TRACE_FREE6( a,b,c,d,e,f) \ - (void) printf("f %lx %lx %lx\n", (b), (e) * b_pw, f) - -static Word_t j__udyMemSequence = 0L; // event sequence number. - -#else - -#define TRACE_ALLOC5(a,b,c,d,e) // null. -#define TRACE_FREE5( a,b,c,d,e) // null. -#define TRACE_ALLOC6(a,b,c,d,e,f) // null. -#define TRACE_FREE6( a,b,c,d,e,f) // null. - -#endif // ! TRACEMI2 -#endif // ! TRACEMI - - -// MALLOC NAMESPACE SUPPORT: - -#if (defined(DEBUG) && (! defined(MALLOCBITS))) // for now, DEBUG => MALLOCBITS: -#define MALLOCBITS 1 -#endif - -#ifdef MALLOCBITS -#define MALLOCBITS_VALUE 0x3 // bit pattern to use. -#define MALLOCBITS_MASK 0x7 // note: matches mask__ in JudyPrivate.h. - -#define MALLOCBITS_SET( Type,Addr) \ - ((Addr) = (Type) ((Word_t) (Addr) | MALLOCBITS_VALUE)) -#define MALLOCBITS_TEST(Type,Addr) \ - assert((((Word_t) (Addr)) & MALLOCBITS_MASK) == MALLOCBITS_VALUE); \ - ((Addr) = (Type) ((Word_t) (Addr) & ~MALLOCBITS_VALUE)) -#else -#define MALLOCBITS_SET( Type,Addr) // null. -#define MALLOCBITS_TEST(Type,Addr) // null. -#endif - - -// SAVE ERROR INFORMATION IN A Pjpm: -// -// "Small" (invalid) Addr values are used to distinguish overrun and no-mem -// errors. (TBD, non-zero invalid values are no longer returned from -// lower-level functions, that is, JU_ERRNO_OVERRUN is no longer detected.) - -#define J__UDYSETALLOCERROR(Addr) \ - { \ - JU_ERRID(Pjpm) = __LINE__; \ - if ((Word_t) (Addr) > 0) JU_ERRNO(Pjpm) = JU_ERRNO_OVERRUN; \ - else JU_ERRNO(Pjpm) = JU_ERRNO_NOMEM; \ - return(0); \ - } - - -// **************************************************************************** -// ALLOCATION FUNCTIONS: -// -// To help the compiler catch coding errors, each function returns a specific -// object type. -// -// Note: Only j__udyAllocJPM() and j__udyAllocJLW() return multiple values <= -// sizeof(Word_t) to indicate the type of memory allocation failure. Other -// allocation functions convert this failure to a JU_ERRNO. - - -// Note: Unlike other j__udyAlloc*() functions, Pjpms are returned non-raw, -// that is, without malloc namespace or root pointer type bits: - -FUNCTION Pjpm_t j__udyAllocJPM(void) -{ - Word_t Words = (sizeof(jpm_t) + cJU_BYTESPERWORD - 1) / cJU_BYTESPERWORD; - Pjpm_t Pjpm = (Pjpm_t) MALLOC(JudyMalloc, Words, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jpm_t)); - - if ((Word_t) Pjpm > sizeof(Word_t)) - { - ZEROWORDS(Pjpm, Words); - Pjpm->jpm_TotalMemWords = Words; - } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJPM(), Words = %lu\n", - Pjpm, j__udyMemSequence++, Words, cJU_LEAFW_MAXPOP1 + 1); - // MALLOCBITS_SET(Pjpm_t, Pjpm); // see above. - return(Pjpm); - -} // j__udyAllocJPM() - - -FUNCTION Pjbl_t j__udyAllocJBL(Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbl_t) / cJU_BYTESPERWORD; - Pjbl_t PjblRaw = (Pjbl_t) MALLOC(JudyMallocVirtual, - Pjpm->jpm_TotalMemWords, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jbl_t)); - - if ((Word_t) PjblRaw > sizeof(Word_t)) - { - ZEROWORDS(P_JBL(PjblRaw), Words); - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjblRaw); } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJBL(), Words = %lu\n", PjblRaw, - j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjbl_t, PjblRaw); - return(PjblRaw); - -} // j__udyAllocJBL() - - -FUNCTION Pjbb_t j__udyAllocJBB(Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbb_t) / cJU_BYTESPERWORD; - Pjbb_t PjbbRaw = (Pjbb_t) MALLOC(JudyMallocVirtual, - Pjpm->jpm_TotalMemWords, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jbb_t)); - - if ((Word_t) PjbbRaw > sizeof(Word_t)) - { - ZEROWORDS(P_JBB(PjbbRaw), Words); - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjbbRaw); } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJBB(), Words = %lu\n", PjbbRaw, - j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjbb_t, PjbbRaw); - return(PjbbRaw); - -} // j__udyAllocJBB() - - -FUNCTION Pjp_t j__udyAllocJBBJP(Word_t NumJPs, Pjpm_t Pjpm) -{ - Word_t Words = JU_BRANCHJP_NUMJPSTOWORDS(NumJPs); - Pjp_t PjpRaw; - - PjpRaw = (Pjp_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjpRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjpRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJBBJP(%lu), Words = %lu\n", PjpRaw, - j__udyMemSequence++, NumJPs, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjp_t, PjpRaw); - return(PjpRaw); - -} // j__udyAllocJBBJP() - - -FUNCTION Pjbu_t j__udyAllocJBU(Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbu_t) / cJU_BYTESPERWORD; - Pjbu_t PjbuRaw = (Pjbu_t) MALLOC(JudyMallocVirtual, - Pjpm->jpm_TotalMemWords, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jbu_t)); - - if ((Word_t) PjbuRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjbuRaw); } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJBU(), Words = %lu\n", PjbuRaw, - j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjbu_t, PjbuRaw); - return(PjbuRaw); - -} // j__udyAllocJBU() - - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -FUNCTION Pjll_t j__udyAllocJLL1(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF1POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL1(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL1() - -#endif // (JUDYL || (! JU_64BIT)) - - -FUNCTION Pjll_t j__udyAllocJLL2(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF2POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL2(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL2() - - -FUNCTION Pjll_t j__udyAllocJLL3(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF3POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL3(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL3() - - -#ifdef JU_64BIT - -FUNCTION Pjll_t j__udyAllocJLL4(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF4POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL4(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL4() - - -FUNCTION Pjll_t j__udyAllocJLL5(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF5POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL5(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL5() - - -FUNCTION Pjll_t j__udyAllocJLL6(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF6POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL6(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL6() - - -FUNCTION Pjll_t j__udyAllocJLL7(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF7POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL7(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL7() - -#endif // JU_64BIT - - -// Note: Root-level leaf addresses are always whole words (Pjlw_t), and unlike -// other j__udyAlloc*() functions, they are returned non-raw, that is, without -// malloc namespace or root pointer type bits (the latter are added later by -// the caller): - -FUNCTION Pjlw_t j__udyAllocJLW(Word_t Pop1) -{ - Word_t Words = JU_LEAFWPOPTOWORDS(Pop1); - Pjlw_t Pjlw = (Pjlw_t) MALLOC(JudyMalloc, Words, Words); - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLW(%lu), Words = %lu\n", Pjlw, - j__udyMemSequence++, Pop1, Words, Pop1); - // MALLOCBITS_SET(Pjlw_t, Pjlw); // see above. - return(Pjlw); - -} // j__udyAllocJLW() - - -FUNCTION Pjlb_t j__udyAllocJLB1(Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jlb_t) / cJU_BYTESPERWORD; - Pjlb_t PjlbRaw; - - PjlbRaw = (Pjlb_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jlb_t)); - - if ((Word_t) PjlbRaw > sizeof(Word_t)) - { - ZEROWORDS(P_JLB(PjlbRaw), Words); - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjlbRaw); } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJLB1(), Words = %lu\n", PjlbRaw, - j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjlb_t, PjlbRaw); - return(PjlbRaw); - -} // j__udyAllocJLB1() - - -#ifdef JUDYL - -FUNCTION Pjv_t j__udyLAllocJV(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JL_LEAFVPOPTOWORDS(Pop1); - Pjv_t PjvRaw; - - PjvRaw = (Pjv_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjvRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjvRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyLAllocJV(%lu), Words = %lu\n", PjvRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjv_t, PjvRaw); - return(PjvRaw); - -} // j__udyLAllocJV() - -#endif // JUDYL - - -// **************************************************************************** -// FREE FUNCTIONS: -// -// To help the compiler catch coding errors, each function takes a specific -// object type to free. - - -// Note: j__udyFreeJPM() receives a root pointer with NO root pointer type -// bits present, that is, they must be stripped by the caller using P_JPM(): - -FUNCTION void j__udyFreeJPM(Pjpm_t PjpmFree, Pjpm_t PjpmStats) -{ - Word_t Words = (sizeof(jpm_t) + cJU_BYTESPERWORD - 1) / cJU_BYTESPERWORD; - - // MALLOCBITS_TEST(Pjpm_t, PjpmFree); // see above. - JudyFree((Pvoid_t) PjpmFree, Words); - - if (PjpmStats != (Pjpm_t) NULL) PjpmStats->jpm_TotalMemWords -= Words; - -// Note: Log PjpmFree->jpm_Pop0, similar to other j__udyFree*() functions, not -// an assumed value of cJU_LEAFW_MAXPOP1, for when the caller is -// Judy*FreeArray(), jpm_Pop0 is set to 0, and the population after the free -// really will be 0, not cJU_LEAFW_MAXPOP1. - - TRACE_FREE6("0x%x %8lu = j__udyFreeJPM(%lu), Words = %lu\n", PjpmFree, - j__udyMemSequence++, Words, Words, PjpmFree->jpm_Pop0); - - -} // j__udyFreeJPM() - - -FUNCTION void j__udyFreeJBL(Pjbl_t Pjbl, Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbl_t) / cJU_BYTESPERWORD; - - MALLOCBITS_TEST(Pjbl_t, Pjbl); - JudyFreeVirtual((Pvoid_t) Pjbl, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE5("0x%x %8lu = j__udyFreeJBL(), Words = %lu\n", Pjbl, - j__udyMemSequence++, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJBL() - - -FUNCTION void j__udyFreeJBB(Pjbb_t Pjbb, Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbb_t) / cJU_BYTESPERWORD; - - MALLOCBITS_TEST(Pjbb_t, Pjbb); - JudyFreeVirtual((Pvoid_t) Pjbb, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE5("0x%x %8lu = j__udyFreeJBB(), Words = %lu\n", Pjbb, - j__udyMemSequence++, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJBB() - - -FUNCTION void j__udyFreeJBBJP(Pjp_t Pjp, Word_t NumJPs, Pjpm_t Pjpm) -{ - Word_t Words = JU_BRANCHJP_NUMJPSTOWORDS(NumJPs); - - MALLOCBITS_TEST(Pjp_t, Pjp); - JudyFree((Pvoid_t) Pjp, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJBBJP(%lu), Words = %lu\n", Pjp, - j__udyMemSequence++, NumJPs, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJBBJP() - - -FUNCTION void j__udyFreeJBU(Pjbu_t Pjbu, Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbu_t) / cJU_BYTESPERWORD; - - MALLOCBITS_TEST(Pjbu_t, Pjbu); - JudyFreeVirtual((Pvoid_t) Pjbu, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE5("0x%x %8lu = j__udyFreeJBU(), Words = %lu\n", Pjbu, - j__udyMemSequence++, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJBU() - - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -FUNCTION void j__udyFreeJLL1(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF1POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL1(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL1() - -#endif // (JUDYL || (! JU_64BIT)) - - -FUNCTION void j__udyFreeJLL2(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF2POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL2(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL2() - - -FUNCTION void j__udyFreeJLL3(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF3POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL3(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL3() - - -#ifdef JU_64BIT - -FUNCTION void j__udyFreeJLL4(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF4POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL4(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL4() - - -FUNCTION void j__udyFreeJLL5(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF5POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL5(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL5() - - -FUNCTION void j__udyFreeJLL6(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF6POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL6(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL6() - - -FUNCTION void j__udyFreeJLL7(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF7POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL7(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL7() - -#endif // JU_64BIT - - -// Note: j__udyFreeJLW() receives a root pointer with NO root pointer type -// bits present, that is, they are stripped by P_JLW(): - -FUNCTION void j__udyFreeJLW(Pjlw_t Pjlw, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAFWPOPTOWORDS(Pop1); - - // MALLOCBITS_TEST(Pjlw_t, Pjlw); // see above. - JudyFree((Pvoid_t) Pjlw, Words); - - if (Pjpm) Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLW(%lu), Words = %lu\n", Pjlw, - j__udyMemSequence++, Pop1, Words, Pop1 - 1); - - -} // j__udyFreeJLW() - - -FUNCTION void j__udyFreeJLB1(Pjlb_t Pjlb, Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jlb_t) / cJU_BYTESPERWORD; - - MALLOCBITS_TEST(Pjlb_t, Pjlb); - JudyFree((Pvoid_t) Pjlb, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE5("0x%x %8lu = j__udyFreeJLB1(), Words = %lu\n", Pjlb, - j__udyMemSequence++, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLB1() - - -#ifdef JUDYL - -FUNCTION void j__udyLFreeJV(Pjv_t Pjv, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JL_LEAFVPOPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjv_t, Pjv); - JudyFree((Pvoid_t) Pjv, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyLFreeJV(%lu), Words = %lu\n", Pjv, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyLFreeJV() - -#endif // JUDYL diff --git a/libjudy/src/JudyCommon/JudyMemActive.c b/libjudy/src/JudyCommon/JudyMemActive.c deleted file mode 100644 index 701cc34910..0000000000 --- a/libjudy/src/JudyCommon/JudyMemActive.c +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.7 $ $Source: /judy/src/JudyCommon/JudyMemActive.c $ -// -// Return number of bytes of memory used to support a Judy1/L array. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -FUNCTION static Word_t j__udyGetMemActive(Pjp_t); - - -// **************************************************************************** -// J U D Y 1 M E M A C T I V E -// J U D Y L M E M A C T I V E - -#ifdef JUDY1 -FUNCTION Word_t Judy1MemActive -#else -FUNCTION Word_t JudyLMemActive -#endif - ( - Pcvoid_t PArray // from which to retrieve. - ) -{ - if (PArray == (Pcvoid_t)NULL) return(0); - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - Word_t Words = Pjlw[0] + 1; // population. -#ifdef JUDY1 - return((Words + 1) * sizeof(Word_t)); -#else - return(((Words * 2) + 1) * sizeof(Word_t)); -#endif - } - else - { - Pjpm_t Pjpm = P_JPM(PArray); - return(j__udyGetMemActive(&Pjpm->jpm_JP) + sizeof(jpm_t)); - } - -} // JudyMemActive() - - -// **************************************************************************** -// __ J U D Y G E T M E M A C T I V E - -FUNCTION static Word_t j__udyGetMemActive( - Pjp_t Pjp) // top of subtree. -{ - Word_t offset; // in a branch. - Word_t Bytes = 0; // actual bytes used at this level. - Word_t IdxSz; // bytes per index in leaves - - switch (JU_JPTYPE(Pjp)) - { - - case cJU_JPBRANCH_L2: - case cJU_JPBRANCH_L3: -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - case cJU_JPBRANCH_L5: - case cJU_JPBRANCH_L6: - case cJU_JPBRANCH_L7: -#endif - case cJU_JPBRANCH_L: - { - Pjbl_t Pjbl = P_JBL(Pjp->jp_Addr); - - for (offset = 0; offset < (Pjbl->jbl_NumJPs); ++offset) - Bytes += j__udyGetMemActive((Pjbl->jbl_jp) + offset); - - return(Bytes + sizeof(jbl_t)); - } - - case cJU_JPBRANCH_B2: - case cJU_JPBRANCH_B3: -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - case cJU_JPBRANCH_B5: - case cJU_JPBRANCH_B6: - case cJU_JPBRANCH_B7: -#endif - case cJU_JPBRANCH_B: - { - Word_t subexp; - Word_t jpcount; - Pjbb_t Pjbb = P_JBB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - Bytes += jpcount * sizeof(jp_t); - - for (offset = 0; offset < jpcount; ++offset) - { - Bytes += j__udyGetMemActive(P_JP(JU_JBB_PJP(Pjbb, subexp)) - + offset); - } - } - - return(Bytes + sizeof(jbb_t)); - } - - case cJU_JPBRANCH_U2: - case cJU_JPBRANCH_U3: -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: - case cJU_JPBRANCH_U5: - case cJU_JPBRANCH_U6: - case cJU_JPBRANCH_U7: -#endif - case cJU_JPBRANCH_U: - { - Pjbu_t Pjbu = P_JBU(Pjp->jp_Addr); - - for (offset = 0; offset < cJU_BRANCHUNUMJPS; ++offset) - { - if (((Pjbu->jbu_jp[offset].jp_Type) >= cJU_JPNULL1) - && ((Pjbu->jbu_jp[offset].jp_Type) <= cJU_JPNULLMAX)) - { - continue; // skip null JP to save time. - } - - Bytes += j__udyGetMemActive(Pjbu->jbu_jp + offset); - } - - return(Bytes + sizeof(jbu_t)); - } - - -// -- Cases below here terminate and do not recurse. -- - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: IdxSz = 1; goto LeafWords; -#endif - case cJU_JPLEAF2: IdxSz = 2; goto LeafWords; - case cJU_JPLEAF3: IdxSz = 3; goto LeafWords; -#ifdef JU_64BIT - case cJU_JPLEAF4: IdxSz = 4; goto LeafWords; - case cJU_JPLEAF5: IdxSz = 5; goto LeafWords; - case cJU_JPLEAF6: IdxSz = 6; goto LeafWords; - case cJU_JPLEAF7: IdxSz = 7; goto LeafWords; -#endif -LeafWords: - -#ifdef JUDY1 - return(IdxSz * (JU_JPLEAF_POP0(Pjp) + 1)); -#else - return((IdxSz + sizeof(Word_t)) - * (JU_JPLEAF_POP0(Pjp) + 1)); -#endif - case cJU_JPLEAF_B1: - { -#ifdef JUDY1 - return(sizeof(jlb_t)); -#else - Bytes = (JU_JPLEAF_POP0(Pjp) + 1) * sizeof(Word_t); - - return(Bytes + sizeof(jlb_t)); -#endif - } - - JUDY1CODE(case cJ1_JPFULLPOPU1: return(0);) - -#ifdef JUDY1 -#define J__Mpy 0 -#else -#define J__Mpy sizeof(Word_t) -#endif - - case cJU_JPIMMED_1_01: return(0); - case cJU_JPIMMED_2_01: return(0); - case cJU_JPIMMED_3_01: return(0); -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: return(0); - case cJU_JPIMMED_5_01: return(0); - case cJU_JPIMMED_6_01: return(0); - case cJU_JPIMMED_7_01: return(0); -#endif - - case cJU_JPIMMED_1_02: return(J__Mpy * 2); - case cJU_JPIMMED_1_03: return(J__Mpy * 3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: return(J__Mpy * 4); - case cJU_JPIMMED_1_05: return(J__Mpy * 5); - case cJU_JPIMMED_1_06: return(J__Mpy * 6); - case cJU_JPIMMED_1_07: return(J__Mpy * 7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: return(0); - case cJ1_JPIMMED_1_09: return(0); - case cJ1_JPIMMED_1_10: return(0); - case cJ1_JPIMMED_1_11: return(0); - case cJ1_JPIMMED_1_12: return(0); - case cJ1_JPIMMED_1_13: return(0); - case cJ1_JPIMMED_1_14: return(0); - case cJ1_JPIMMED_1_15: return(0); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: return(J__Mpy * 2); - case cJU_JPIMMED_2_03: return(J__Mpy * 3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: return(0); - case cJ1_JPIMMED_2_05: return(0); - case cJ1_JPIMMED_2_06: return(0); - case cJ1_JPIMMED_2_07: return(0); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: return(J__Mpy * 2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: return(0); - case cJ1_JPIMMED_3_04: return(0); - case cJ1_JPIMMED_3_05: return(0); - - case cJ1_JPIMMED_4_02: return(0); - case cJ1_JPIMMED_4_03: return(0); - case cJ1_JPIMMED_5_02: return(0); - case cJ1_JPIMMED_5_03: return(0); - case cJ1_JPIMMED_6_02: return(0); - case cJ1_JPIMMED_7_02: return(0); -#endif - - } // switch (JU_JPTYPE(Pjp)) - - return(0); // to make some compilers happy. - -} // j__udyGetMemActive() diff --git a/libjudy/src/JudyCommon/JudyMemUsed.c b/libjudy/src/JudyCommon/JudyMemUsed.c deleted file mode 100644 index fc92d48800..0000000000 --- a/libjudy/src/JudyCommon/JudyMemUsed.c +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.5 $ $Source: /judy/src/JudyCommon/JudyMemUsed.c $ -// -// Return number of bytes of memory used to support a Judy1/L array. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -#ifdef JUDY1 -FUNCTION Word_t Judy1MemUsed -#else // JUDYL -FUNCTION Word_t JudyLMemUsed -#endif - ( - Pcvoid_t PArray // from which to retrieve. - ) -{ - Word_t Words = 0; - - if (PArray == (Pcvoid_t) NULL) return(0); - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - Words = JU_LEAFWPOPTOWORDS(Pjlw[0] + 1); // based on pop1. - } - else - { - Pjpm_t Pjpm = P_JPM(PArray); - Words = Pjpm->jpm_TotalMemWords; - } - - return(Words * sizeof(Word_t)); // convert to bytes. - -} // Judy1MemUsed() / JudyLMemUsed() diff --git a/libjudy/src/JudyCommon/JudyPrevNext.c b/libjudy/src/JudyCommon/JudyPrevNext.c deleted file mode 100644 index d15db1596c..0000000000 --- a/libjudy/src/JudyCommon/JudyPrevNext.c +++ /dev/null @@ -1,1890 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.54 $ $Source: /judy/src/JudyCommon/JudyPrevNext.c $ -// -// Judy*Prev() and Judy*Next() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DJUDYNEXT for the Judy*Next() function; otherwise defaults to -// Judy*Prev(). - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifndef JUDYNEXT -#ifndef JUDYPREV -#define JUDYPREV 1 // neither set => use default. -#endif -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - - -// **************************************************************************** -// J U D Y 1 P R E V -// J U D Y 1 N E X T -// J U D Y L P R E V -// J U D Y L N E X T -// -// See the manual entry for the API. -// -// OVERVIEW OF Judy*Prev(): -// -// Use a reentrant switch statement (state machine, SM1 = "get") to decode the -// callers *PIndex-1, starting with the (PArray), through branches, if -// any, down to an immediate or a leaf. Look for *PIndex-1 in that leaf, and -// if found, return it. -// -// A dead end is either a branch that does not contain a JP for the appropriate -// digit in *PIndex-1, or a leaf that does not contain the undecoded digits of -// *PIndex-1. Upon reaching a dead end, backtrack through the leaf/branches -// that were just traversed, using a list (history) of parent JPs that is built -// while going forward in SM1Get. Start with the current leaf or branch. In a -// backtracked leaf, look for an Index less than *PIndex-1. In each -// backtracked branch, look "sideways" for the next JP, if any, lower than the -// one for the digit (from *PIndex-1) that was previously decoded. While -// backtracking, if a leaf has no previous Index or a branch has no lower JP, -// go to its parent branch in turn. Upon reaching the JRP, return failure, "no -// previous Index". The backtrack process is sufficiently different from -// SM1Get to merit its own separate reentrant switch statement (SM2 = -// "backtrack"). -// -// While backtracking, upon finding a lower JP in a branch, there is certain to -// be a "prev" Index under that JP (unless the Judy array is corrupt). -// Traverse forward again, this time taking the last (highest, right-most) JP -// in each branch, and the last (highest) Index upon reaching an immediate or a -// leaf. This traversal is sufficiently different from SM1Get and SM2Backtrack -// to merit its own separate reentrant switch statement (SM3 = "findlimit"). -// -// "Decode" bytes in JPs complicate this process a little. In SM1Get, when a -// JP is a narrow pointer, that is, when states are skipped (so the skipped -// digits are stored in jp_DcdPopO), compare the relevant digits to the same -// digits in *PIndex-1. If they are EQUAL, proceed in SM1Get as before. If -// jp_DcdPopOs digits are GREATER, treat the JP as a dead end and proceed in -// SM2Backtrack. If jp_DcdPopOs digits are LESS, treat the JP as if it had -// just been found during a backtrack and proceed directly in SM3Findlimit. -// -// Note that Decode bytes can be ignored in SM3Findlimit; they dont matter. -// Also note that in practice the Decode bytes are routinely compared with -// *PIndex-1 because thats simpler and no slower than first testing for -// narrowness. -// -// Decode bytes also make it unnecessary to construct the Index to return (the -// revised *PIndex) during the search. This step is deferred until finding an -// Index during backtrack or findlimit, before returning it. The first digit -// of *PIndex is derived (saved) based on which JP is used in a JRP branch. -// The remaining digits are obtained from the jp_DcdPopO field in the JP (if -// any) above the immediate or leaf containing the found (prev) Index, plus the -// remaining digit(s) in the immediate or leaf itself. In the case of a LEAFW, -// the Index to return is found directly in the leaf. -// -// Note: Theoretically, as described above, upon reaching a dead end, SM1Get -// passes control to SM2Backtrack to look sideways, even in a leaf. Actually -// its a little more efficient for the SM1Get leaf cases to shortcut this and -// take care of the sideways searches themselves. Hence the history list only -// contains branch JPs, and SM2Backtrack only handles branches. In fact, even -// the branch handling cases in SM1Get do some shortcutting (sideways -// searching) to avoid pushing history and calling SM2Backtrack unnecessarily. -// -// Upon reaching an Index to return after backtracking, *PIndex must be -// modified to the found Index. In principle this could be done by building -// the Index from a saved rootdigit (in the top branch) plus the Dcd bytes from -// the parent JP plus the appropriate Index bytes from the leaf. However, -// Immediates are difficult because their parent JPs lack one (last) digit. So -// instead just build the *PIndex to return "top down" while backtracking and -// findlimiting. -// -// This function is written iteratively for speed, rather than recursively. -// -// CAVEATS: -// -// Why use a backtrack list (history stack), since it has finite size? The -// size is small for Judy on both 32-bit and 64-bit systems, and a list (really -// just an array) is fast to maintain and use. Other alternatives include -// doing a lookahead (lookaside) in each branch while traversing forward -// (decoding), and restarting from the top upon a dead end. -// -// A lookahead means noting the last branch traversed which contained a -// non-null JP lower than the one specified by a digit in *PIndex-1, and -// returning to that point for SM3Findlimit. This seems like a good idea, and -// should be pretty cheap for linear and bitmap branches, but it could result -// in up to 31 unnecessary additional cache line fills (in extreme cases) for -// every uncompressed branch traversed. We have considered means of attaching -// to or hiding within an uncompressed branch (in null JPs) a "cache line map" -// or other structure, such as an offset to the next non-null JP, that would -// speed this up, but it seems unnecessary merely to avoid having a -// finite-length list (array). (If JudySL is ever made "native", the finite -// list length will be an issue.) -// -// Restarting at the top of the Judy array after a dead end requires a careful -// modification of *PIndex-1 to decrement the digit for the parent branch and -// set the remaining lower digits to all 1s. This must be repeated each time a -// parent branch contains another dead end, so even though it should all happen -// in cache, the CPU time can be excessive. (For JudySL or an equivalent -// "infinitely deep" Judy array, consider a hybrid of a large, finite, -// "circular" list and a restart-at-top when the list is backtracked to -// exhaustion.) -// -// Why search for *PIndex-1 instead of *PIndex during SM1Get? In rare -// instances this prevents an unnecessary decode down the wrong path followed -// by a backtrack; its pretty cheap to set up initially; and it means the -// SM1Get machine can simply return if/when it finds that Index. -// -// TBD: Wed like to enhance this function to make successive searches faster. -// This would require saving some previous state, including the previous Index -// returned, and in which leaf it was found. If the next call is for the same -// Index and the array has not been modified, start at the same leaf. This -// should be much easier to implement since this is iterative rather than -// recursive code. -// -// VARIATIONS FOR Judy*Next(): -// -// The Judy*Next() code is nearly a perfect mirror of the Judy*Prev() code. -// See the Judy*Prev() overview comments, and mentally switch the following: -// -// - "*PIndex-1" => "*PIndex+1" -// - "less than" => "greater than" -// - "lower" => "higher" -// - "lowest" => "highest" -// - "next-left" => "next-right" -// - "right-most" => "left-most" -// -// Note: SM3Findlimit could be called SM3Findmax/SM3Findmin, but a common name -// for both Prev and Next means many fewer ifdefs in this code. -// -// TBD: Currently this code traverses a JP whether its expanse is partially or -// completely full (populated). For Judy1 (only), since there is no value area -// needed, consider shortcutting to a "success" return upon encountering a full -// JP in SM1Get (or even SM3Findlimit?) A full JP looks like this: -// -// (((JU_JPDCDPOP0(Pjp) ^ cJU_ALLONES) & cJU_POP0MASK(cLevel)) == 0) - -#ifdef JUDY1 -#ifdef JUDYPREV -FUNCTION int Judy1Prev -#else -FUNCTION int Judy1Next -#endif -#else -#ifdef JUDYPREV -FUNCTION PPvoid_t JudyLPrev -#else -FUNCTION PPvoid_t JudyLNext -#endif -#endif - ( - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError // optional, for returning error info. - ) -{ - Pjp_t Pjp, Pjp2; // current JPs. - Pjbl_t Pjbl; // Pjp->jp_Addr masked and cast to types: - Pjbb_t Pjbb; - Pjbu_t Pjbu; - -// Note: The following initialization is not strictly required but it makes -// gcc -Wall happy because there is an "impossible" path from Immed handling to -// SM1LeafLImm code that looks like Pjll might be used before set: - - Pjll_t Pjll = (Pjll_t) NULL; - Word_t state; // current state in SM. - Word_t digit; // next digit to decode from Index. - -// Note: The following initialization is not strictly required but it makes -// gcc -Wall happy because there is an "impossible" path from Immed handling to -// SM1LeafLImm code (for JudyL & JudyPrev only) that looks like pop1 might be -// used before set: - -#if (defined(JUDYL) && defined(JUDYPREV)) - Word_t pop1 = 0; // in a leaf. -#else - Word_t pop1; // in a leaf. -#endif - int offset; // linear branch/leaf, from j__udySearchLeaf*(). - int subexp; // subexpanse in a bitmap branch. - Word_t bitposmask; // bit in bitmap for Index. - -// History for SM2Backtrack: -// -// For a given histnum, APjphist[histnum] is a parent JP that points to a -// branch, and Aoffhist[histnum] is the offset of the NEXT JP in the branch to -// which the parent JP points. The meaning of Aoffhist[histnum] depends on the -// type of branch to which the parent JP points: -// -// Linear: Offset of the next JP in the JP list. -// -// Bitmap: Which subexpanse, plus the offset of the next JP in the -// subexpanses JP list (to avoid bit-counting again), plus for Judy*Next(), -// hidden one byte to the left, which digit, because Judy*Next() also needs -// this. -// -// Uncompressed: Digit, which is actually the offset of the JP in the branch. -// -// Note: Only branch JPs are stored in APjphist[] because, as explained -// earlier, SM1Get shortcuts sideways searches in leaves (and even in branches -// in some cases), so SM2Backtrack only handles branches. - -#define HISTNUMMAX cJU_ROOTSTATE // maximum branches traversable. - Pjp_t APjphist[HISTNUMMAX]; // list of branch JPs traversed. - int Aoffhist[HISTNUMMAX]; // list of next JP offsets; see above. - int histnum = 0; // number of JPs now in list. - - -// ---------------------------------------------------------------------------- -// M A C R O S -// -// These are intended to make the code a bit more readable and less redundant. - - -// "PUSH" AND "POP" Pjp AND offset ON HISTORY STACKS: -// -// Note: Ensure a corrupt Judy array does not overflow *hist[]. Meanwhile, -// underflowing *hist[] simply means theres no more room to backtrack => -// "no previous/next Index". - -#define HISTPUSH(Pjp,Offset) \ - APjphist[histnum] = (Pjp); \ - Aoffhist[histnum] = (Offset); \ - \ - if (++histnum >= HISTNUMMAX) \ - { \ - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT) \ - JUDY1CODE(return(JERRI );) \ - JUDYLCODE(return(PPJERR);) \ - } - -#define HISTPOP(Pjp,Offset) \ - if ((histnum--) < 1) JU_RET_NOTFOUND; \ - (Pjp) = APjphist[histnum]; \ - (Offset) = Aoffhist[histnum] - -// How to pack/unpack Aoffhist[] values for bitmap branches: - -#ifdef JUDYPREV - -#define HISTPUSHBOFF(Subexp,Offset,Digit) \ - (((Subexp) * cJU_BITSPERSUBEXPB) | (Offset)) - -#define HISTPOPBOFF(Subexp,Offset,Digit) \ - (Subexp) = (Offset) / cJU_BITSPERSUBEXPB; \ - (Offset) %= cJU_BITSPERSUBEXPB -#else - -#define HISTPUSHBOFF(Subexp,Offset,Digit) \ - (((Digit) << cJU_BITSPERBYTE) \ - | ((Subexp) * cJU_BITSPERSUBEXPB) | (Offset)) - -#define HISTPOPBOFF(Subexp,Offset,Digit) \ - (Digit) = (Offset) >> cJU_BITSPERBYTE; \ - (Subexp) = ((Offset) & JU_LEASTBYTESMASK(1)) / cJU_BITSPERSUBEXPB; \ - (Offset) %= cJU_BITSPERSUBEXPB -#endif - - -// CHECK FOR NULL JP: - -#define JPNULL(Type) (((Type) >= cJU_JPNULL1) && ((Type) <= cJU_JPNULLMAX)) - - -// SEARCH A BITMAP: -// -// This is a weak analog of j__udySearchLeaf*() for bitmaps. Return the actual -// or next-left position, base 0, of Digit in the single uint32_t bitmap, also -// given a Bitposmask for Digit. -// -// Unlike j__udySearchLeaf*(), the offset is not returned bit-complemented if -// Digits bit is unset, because the caller can check the bitmap themselves to -// determine that. Also, if Digits bit is unset, the returned offset is to -// the next-left JP (including -1), not to the "ideal" position for the Index = -// next-right JP. -// -// Shortcut and skip calling j__udyCountBits*() if the bitmap is full, in which -// case (Digit % cJU_BITSPERSUBEXP*) itself is the base-0 offset. -// -// TBD for Judy*Next(): Should this return next-right instead of next-left? -// That is, +1 from current value? Maybe not, if Digits bit IS set, +1 would -// be wrong. - -#define SEARCHBITMAPB(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPB) ? (Digit % cJU_BITSPERSUBEXPB) : \ - j__udyCountBitsB((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#define SEARCHBITMAPL(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPL) ? (Digit % cJU_BITSPERSUBEXPL) : \ - j__udyCountBitsL((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#ifdef JUDYPREV -// Equivalent to search for the highest offset in Bitmap: - -#define SEARCHBITMAPMAXB(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPB) ? cJU_BITSPERSUBEXPB - 1 : \ - j__udyCountBitsB(Bitmap) - 1) - -#define SEARCHBITMAPMAXL(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPL) ? cJU_BITSPERSUBEXPL - 1 : \ - j__udyCountBitsL(Bitmap) - 1) -#endif - - -// CHECK DECODE BYTES: -// -// Check Decode bytes in a JP against the equivalent portion of *PIndex. If -// *PIndex is lower (for Judy*Prev()) or higher (for Judy*Next()), this JP is a -// dead end (the same as if it had been absent in a linear or bitmap branch or -// null in an uncompressed branch), enter SM2Backtrack; otherwise enter -// SM3Findlimit to find the highest/lowest Index under this JP, as if the code -// had already backtracked to this JP. - -#ifdef JUDYPREV -#define CDcmp__ < -#else -#define CDcmp__ > -#endif - -#define CHECKDCD(cState) \ - if (JU_DCDNOTMATCHINDEX(*PIndex, Pjp, cState)) \ - { \ - if ((*PIndex & cJU_DCDMASK(cState)) \ - CDcmp__(JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(cState))) \ - { \ - goto SM2Backtrack; \ - } \ - goto SM3Findlimit; \ - } - - -// PREPARE TO HANDLE A LEAFW OR JRP BRANCH IN SM1: -// -// Extract a state-dependent digit from Index in a "constant" way, then jump to -// common code for multiple cases. - -#define SM1PREPB(cState,Next) \ - state = (cState); \ - digit = JU_DIGITATSTATE(*PIndex, cState); \ - goto Next - - -// PREPARE TO HANDLE A LEAFW OR JRP BRANCH IN SM3: -// -// Optionally save Dcd bytes into *PIndex, then save state and jump to common -// code for multiple cases. - -#define SM3PREPB_DCD(cState,Next) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - SM3PREPB(cState,Next) - -#define SM3PREPB(cState,Next) state = (cState); goto Next - - -// ---------------------------------------------------------------------------- -// CHECK FOR SHORTCUTS: -// -// Error out if PIndex is null. Execute JU_RET_NOTFOUND if the Judy array is -// empty or *PIndex is already the minimum/maximum Index possible. -// -// Note: As documented, in case of failure *PIndex may be modified. - - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -#ifdef JUDYPREV - if ((PArray == (Pvoid_t) NULL) || ((*PIndex)-- == 0)) -#else - if ((PArray == (Pvoid_t) NULL) || ((*PIndex)++ == cJU_ALLONES)) -#endif - JU_RET_NOTFOUND; - - -// HANDLE JRP: -// -// Before even entering SM1Get, check the JRP type. For JRP branches, traverse -// the JPM; handle LEAFW leaves directly; but look for the most common cases -// first. - -// ROOT-STATE LEAF that starts with a Pop0 word; just look within the leaf: -// -// If *PIndex is in the leaf, return it; otherwise return the Index, if any, -// below where it would belong. - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - pop1 = Pjlw[0] + 1; - - if ((offset = j__udySearchLeafW(Pjlw + 1, pop1, *PIndex)) - >= 0) // Index is present. - { - assert(offset < pop1); // in expected range. - JU_RET_FOUND_LEAFW(Pjlw, pop1, offset); // *PIndex is set. - } - -#ifdef JUDYPREV - if ((offset = ~offset) == 0) // no next-left Index. -#else - if ((offset = ~offset) >= pop1) // no next-right Index. -#endif - JU_RET_NOTFOUND; - - assert(offset <= pop1); // valid result. - -#ifdef JUDYPREV - *PIndex = Pjlw[offset--]; // next-left Index, base 1. -#else - *PIndex = Pjlw[offset + 1]; // next-right Index, base 1. -#endif - JU_RET_FOUND_LEAFW(Pjlw, pop1, offset); // base 0. - - } - else // JRP BRANCH - { - Pjpm_t Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); - -// goto SM1Get; - } - -// ============================================================================ -// STATE MACHINE 1 -- GET INDEX: -// -// Search for *PIndex (already decremented/incremented so as to be inclusive). -// If found, return it. Otherwise in theory hand off to SM2Backtrack or -// SM3Findlimit, but in practice "shortcut" by first sideways searching the -// current branch or leaf upon hitting a dead end. During sideways search, -// modify *PIndex to a new path taken. -// -// ENTRY: Pjp points to next JP to interpret, whose Decode bytes have not yet -// been checked. This JP is not yet listed in history. -// -// Note: Check Decode bytes at the start of each loop, not after looking up a -// new JP, so its easy to do constant shifts/masks, although this requires -// cautious handling of Pjp, offset, and *hist[] for correct entry to -// SM2Backtrack. -// -// EXIT: Return, or branch to SM2Backtrack or SM3Findlimit with correct -// interface, as described elsewhere. -// -// WARNING: For run-time efficiency the following cases replicate code with -// varying constants, rather than using common code with variable values! - -SM1Get: // return here for next branch/leaf. - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_L2: CHECKDCD(2); SM1PREPB(2, SM1BranchL); - case cJU_JPBRANCH_L3: CHECKDCD(3); SM1PREPB(3, SM1BranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: CHECKDCD(4); SM1PREPB(4, SM1BranchL); - case cJU_JPBRANCH_L5: CHECKDCD(5); SM1PREPB(5, SM1BranchL); - case cJU_JPBRANCH_L6: CHECKDCD(6); SM1PREPB(6, SM1BranchL); - case cJU_JPBRANCH_L7: CHECKDCD(7); SM1PREPB(7, SM1BranchL); -#endif - case cJU_JPBRANCH_L: SM1PREPB(cJU_ROOTSTATE, SM1BranchL); - -// Common code (state-independent) for all cases of linear branches: - -SM1BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -// Found JP matching current digit in *PIndex; record parent JP and the next -// JPs offset, and iterate to the next JP: - - if ((offset = j__udySearchLeaf1((Pjll_t) (Pjbl->jbl_Expanse), - Pjbl->jbl_NumJPs, digit)) >= 0) - { - HISTPUSH(Pjp, offset); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM1Get; - } - -// Dead end, no JP in BranchL for next digit in *PIndex: -// -// Get the ideal location of digits JP, and if theres no next-left/right JP -// in the BranchL, shortcut and start backtracking one level up; ignore the -// current Pjp because it points to a BranchL with no next-left/right JP. - -#ifdef JUDYPREV - if ((offset = (~offset) - 1) < 0) // no next-left JP in BranchL. -#else - if ((offset = (~offset)) >= Pjbl->jbl_NumJPs) // no next-right. -#endif - goto SM2Backtrack; - -// Theres a next-left/right JP in the current BranchL; save its digit in -// *PIndex and shortcut to SM3Findlimit: - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Check Decode bytes, if any, in the current JP, then look for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_B2: CHECKDCD(2); SM1PREPB(2, SM1BranchB); - case cJU_JPBRANCH_B3: CHECKDCD(3); SM1PREPB(3, SM1BranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: CHECKDCD(4); SM1PREPB(4, SM1BranchB); - case cJU_JPBRANCH_B5: CHECKDCD(5); SM1PREPB(5, SM1BranchB); - case cJU_JPBRANCH_B6: CHECKDCD(6); SM1PREPB(6, SM1BranchB); - case cJU_JPBRANCH_B7: CHECKDCD(7); SM1PREPB(7, SM1BranchB); -#endif - case cJU_JPBRANCH_B: SM1PREPB(cJU_ROOTSTATE, SM1BranchB); - -// Common code (state-independent) for all cases of bitmap branches: - -SM1BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - -// Locate the digits JP in the subexpanse list, if present, otherwise the -// offset of the next-left JP, if any: - - subexp = digit / cJU_BITSPERSUBEXPB; - assert(subexp < cJU_NUMSUBEXPB); // falls in expected range. - bitposmask = JU_BITPOSMASKB(digit); - offset = SEARCHBITMAPB(JU_JBB_BITMAP(Pjbb, subexp), digit, - bitposmask); - // right range: - assert((offset >= -1) && (offset < (int) cJU_BITSPERSUBEXPB)); - -// Found JP matching current digit in *PIndex: -// -// Record the parent JP and the next JPs offset; and iterate to the next JP. - -// if (JU_BITMAPTESTB(Pjbb, digit)) // slower. - if (JU_JBB_BITMAP(Pjbb, subexp) & bitposmask) // faster. - { - // not negative since at least one bit is set: - assert(offset >= 0); - - HISTPUSH(Pjp, HISTPUSHBOFF(subexp, offset, digit)); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM1Get; // iterate to next JP. - } - -// Dead end, no JP in BranchB for next digit in *PIndex: -// -// If theres a next-left/right JP in the current BranchB, shortcut to -// SM3Findlimit. Note: offset is already set to the correct value for the -// next-left/right JP. - -#ifdef JUDYPREV - if (offset >= 0) // next-left JP is in this subexpanse. - goto SM1BranchBFindlimit; - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JBB_BITMAP(Pjbb, subexp) & JU_MASKHIGHEREXC(bitposmask)) - { - ++offset; // next-left => next-right. - goto SM1BranchBFindlimit; - } - - while (++subexp < cJU_NUMSUBEXPB) // search next-right subexps. -#endif - { - if (! JU_JBB_PJP(Pjbb, subexp)) continue; // empty subexpanse. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - offset = 0; -#endif - -// Save the next-left/right JPs digit in *PIndex: - -SM1BranchBFindlimit: - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), - offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchB: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a BranchB with no next-left/right JP. - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Check Decode bytes, if any, in the current JP, then look for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_U2: CHECKDCD(2); SM1PREPB(2, SM1BranchU); - case cJU_JPBRANCH_U3: CHECKDCD(3); SM1PREPB(3, SM1BranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: CHECKDCD(4); SM1PREPB(4, SM1BranchU); - case cJU_JPBRANCH_U5: CHECKDCD(5); SM1PREPB(5, SM1BranchU); - case cJU_JPBRANCH_U6: CHECKDCD(6); SM1PREPB(6, SM1BranchU); - case cJU_JPBRANCH_U7: CHECKDCD(7); SM1PREPB(7, SM1BranchU); -#endif - case cJU_JPBRANCH_U: SM1PREPB(cJU_ROOTSTATE, SM1BranchU); - -// Common code (state-independent) for all cases of uncompressed branches: - -SM1BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - Pjp2 = (Pjbu->jbu_jp) + digit; - -// Found JP matching current digit in *PIndex: -// -// Record the parent JP and the next JPs digit, and iterate to the next JP. -// -// TBD: Instead of this, just goto SM1Get, and add cJU_JPNULL* cases to the -// SM1Get state machine? Then backtrack? However, it means you cant detect -// an inappropriate cJU_JPNULL*, when it occurs in other than a BranchU, and -// return JU_RET_CORRUPT. - - if (! JPNULL(JU_JPTYPE(Pjp2))) // digit has a JP. - { - HISTPUSH(Pjp, digit); - Pjp = Pjp2; - goto SM1Get; - } - -// Dead end, no JP in BranchU for next digit in *PIndex: -// -// Search for a next-left/right JP in the current BranchU, and if one is found, -// save its digit in *PIndex and shortcut to SM3Findlimit: - -#ifdef JUDYPREV - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - while (digit < cJU_BRANCHUNUMJPS - 1) - { - Pjp = (Pjbu->jbu_jp) + (++digit); -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchU: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a BranchU with no next-left/right JP. - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for -// *PIndex. - -#define SM1LEAFL(Func) \ - Pjll = P_JLL(Pjp->jp_Addr); \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - offset = Func(Pjll, pop1, *PIndex); \ - goto SM1LeafLImm - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKDCD(1); SM1LEAFL(j__udySearchLeaf1); -#endif - case cJU_JPLEAF2: CHECKDCD(2); SM1LEAFL(j__udySearchLeaf2); - case cJU_JPLEAF3: CHECKDCD(3); SM1LEAFL(j__udySearchLeaf3); - -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKDCD(4); SM1LEAFL(j__udySearchLeaf4); - case cJU_JPLEAF5: CHECKDCD(5); SM1LEAFL(j__udySearchLeaf5); - case cJU_JPLEAF6: CHECKDCD(6); SM1LEAFL(j__udySearchLeaf6); - case cJU_JPLEAF7: CHECKDCD(7); SM1LEAFL(j__udySearchLeaf7); -#endif - -// Common code (state-independent) for all cases of linear leaves and -// immediates: - -SM1LeafLImm: - if (offset >= 0) // *PIndex is in LeafL / Immed. -#ifdef JUDY1 - JU_RET_FOUND; -#else - { // JudyL is trickier... - switch (JU_JPTYPE(Pjp)) - { -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - case cJU_JPLEAF2: JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - case cJU_JPLEAF3: JU_RET_FOUND_LEAF3(Pjll, pop1, offset); -#ifdef JU_64BIT - case cJU_JPLEAF4: JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - case cJU_JPLEAF5: JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - case cJU_JPLEAF6: JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - case cJU_JPLEAF7: JU_RET_FOUND_LEAF7(Pjll, pop1, offset); -#endif - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - JU_RET_FOUND_IMM_01(Pjp); - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#ifdef JU_64BIT - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: - case cJU_JPIMMED_3_02: -#endif - JU_RET_FOUND_IMM(Pjp, offset); - } - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // impossible? - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // found *PIndex - -#endif // JUDYL - -// Dead end, no Index in LeafL / Immed for remaining digit(s) in *PIndex: -// -// Get the ideal location of Index, and if theres no next-left/right Index in -// the LeafL / Immed, shortcut and start backtracking one level up; ignore the -// current Pjp because it points to a LeafL / Immed with no next-left/right -// Index. - -#ifdef JUDYPREV - if ((offset = (~offset) - 1) < 0) // no next-left Index. -#else - if ((offset = (~offset)) >= pop1) // no next-right Index. -#endif - goto SM2Backtrack; - -// Theres a next-left/right Index in the current LeafL / Immed; shortcut by -// copying its digit(s) to *PIndex and returning it. -// -// Unfortunately this is pretty hairy, especially avoiding endian issues. -// -// The cJU_JPLEAF* cases are very similar to same-index-size cJU_JPIMMED* cases -// for *_02 and above, but must return differently, at least for JudyL, so -// spell them out separately here at the cost of a little redundant code for -// Judy1. - - switch (JU_JPTYPE(Pjp)) - { -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]); - JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - - case cJU_JPLEAF2: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - - case cJU_JPLEAF3: - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - -#ifdef JU_64BIT - case cJU_JPLEAF4: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - - case cJU_JPLEAF5: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - } - - case cJU_JPLEAF6: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - } - - case cJU_JPLEAF7: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_LEAF7(Pjll, pop1, offset); - } - -#endif // JU_64BIT - -#define SET_01(cState) JU_SETDIGITS(*PIndex, JU_JPDCDPOP0(Pjp), cState) - - case cJU_JPIMMED_1_01: SET_01(1); goto SM1Imm_01; - case cJU_JPIMMED_2_01: SET_01(2); goto SM1Imm_01; - case cJU_JPIMMED_3_01: SET_01(3); goto SM1Imm_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: SET_01(4); goto SM1Imm_01; - case cJU_JPIMMED_5_01: SET_01(5); goto SM1Imm_01; - case cJU_JPIMMED_6_01: SET_01(6); goto SM1Imm_01; - case cJU_JPIMMED_7_01: SET_01(7); goto SM1Imm_01; -#endif -SM1Imm_01: JU_RET_FOUND_IMM_01(Pjp); - -// Shorthand for where to find start of Index bytes array: - -#ifdef JUDY1 -#define PJI (Pjp->jp_1Index) -#else -#define PJI (Pjp->jp_LIndex) -#endif - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]); - JU_RET_FOUND_IMM(Pjp, offset); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: - case cJ1_JPIMMED_4_03: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); - - case cJ1_JPIMMED_5_02: - case cJ1_JPIMMED_5_03: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_6_02: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_7_02: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - -#endif // (JUDY1 && JU_64BIT) - - } // switch for not-found *PIndex - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // impossible? - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Check Decode bytes, if any, in the current JP, then look in the leaf for -// *PIndex. - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; - CHECKDCD(1); - - Pjlb = P_JLB(Pjp->jp_Addr); - digit = JU_DIGITATSTATE(*PIndex, 1); - subexp = JU_SUBEXPL(digit); - bitposmask = JU_BITPOSMASKL(digit); - assert(subexp < cJU_NUMSUBEXPL); // falls in expected range. - -// *PIndex exists in LeafB1: - -// if (JU_BITMAPTESTL(Pjlb, digit)) // slower. - if (JU_JLB_BITMAP(Pjlb, subexp) & bitposmask) // faster. - { -#ifdef JUDYL // needs offset at this point: - offset = SEARCHBITMAPL(JU_JLB_BITMAP(Pjlb, subexp), digit, bitposmask); -#endif - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - } - -// Dead end, no Index in LeafB1 for remaining digit in *PIndex: -// -// If theres a next-left/right Index in the current LeafB1, which for -// Judy*Next() is true if any bits are set for higher Indexes, shortcut by -// returning it. Note: For Judy*Prev(), offset is set here to the correct -// value for the next-left JP. - - offset = SEARCHBITMAPL(JU_JLB_BITMAP(Pjlb, subexp), digit, - bitposmask); - // right range: - assert((offset >= -1) && (offset < (int) cJU_BITSPERSUBEXPL)); - -#ifdef JUDYPREV - if (offset >= 0) // next-left JP is in this subexpanse. - goto SM1LeafB1Findlimit; - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JLB_BITMAP(Pjlb, subexp) & JU_MASKHIGHEREXC(bitposmask)) - { - ++offset; // next-left => next-right. - goto SM1LeafB1Findlimit; - } - - while (++subexp < cJU_NUMSUBEXPL) // search next-right subexps. -#endif - { - if (! JU_JLB_BITMAP(Pjlb, subexp)) continue; // empty subexp. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXL(JU_JLB_BITMAP(Pjlb, subexp)); - // expected range: - assert((offset >= 0) && (offset < (int) cJU_BITSPERSUBEXPL)); -#else - offset = 0; -#endif - -// Save the next-left/right Indexess digit in *PIndex: - -SM1LeafB1Findlimit: - JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset); - JU_SETDIGIT1(*PIndex, digit); - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - } - -// Theres no next-left/right Index in the LeafB1: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a LeafB1 with no next-left/right Index. - - goto SM2Backtrack; - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// If the Decode bytes match, *PIndex is found (without modification). - - case cJ1_JPFULLPOPU1: - - CHECKDCD(1); - JU_RET_FOUND_FULLPOPU1; -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: - -#ifdef JUDYPREV -#define SM1IMM_SETPOP1(cPop1) -#else -#define SM1IMM_SETPOP1(cPop1) pop1 = (cPop1) -#endif - -#define SM1IMM(Func,cPop1) \ - SM1IMM_SETPOP1(cPop1); \ - offset = Func((Pjll_t) (PJI), cPop1, *PIndex); \ - goto SM1LeafLImm - -// Special case for Pop1 = 1 Immediate JPs: -// -// If *PIndex is in the immediate, offset is 0, otherwise the binary NOT of the -// offset where it belongs, 0 or 1, same as from the search functions. - -#ifdef JUDYPREV -#define SM1IMM_01_SETPOP1 -#else -#define SM1IMM_01_SETPOP1 pop1 = 1 -#endif - -#define SM1IMM_01 \ - SM1IMM_01_SETPOP1; \ - offset = ((JU_JPDCDPOP0(Pjp) < JU_TRIMTODCDSIZE(*PIndex)) ? ~1 : \ - (JU_JPDCDPOP0(Pjp) == JU_TRIMTODCDSIZE(*PIndex)) ? 0 : \ - ~0); \ - goto SM1LeafLImm - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - SM1IMM_01; - -// TBD: Doug says it would be OK to have fewer calls and calculate arg 2, here -// and in Judy*Count() also. - - case cJU_JPIMMED_1_02: SM1IMM(j__udySearchLeaf1, 2); - case cJU_JPIMMED_1_03: SM1IMM(j__udySearchLeaf1, 3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: SM1IMM(j__udySearchLeaf1, 4); - case cJU_JPIMMED_1_05: SM1IMM(j__udySearchLeaf1, 5); - case cJU_JPIMMED_1_06: SM1IMM(j__udySearchLeaf1, 6); - case cJU_JPIMMED_1_07: SM1IMM(j__udySearchLeaf1, 7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: SM1IMM(j__udySearchLeaf1, 8); - case cJ1_JPIMMED_1_09: SM1IMM(j__udySearchLeaf1, 9); - case cJ1_JPIMMED_1_10: SM1IMM(j__udySearchLeaf1, 10); - case cJ1_JPIMMED_1_11: SM1IMM(j__udySearchLeaf1, 11); - case cJ1_JPIMMED_1_12: SM1IMM(j__udySearchLeaf1, 12); - case cJ1_JPIMMED_1_13: SM1IMM(j__udySearchLeaf1, 13); - case cJ1_JPIMMED_1_14: SM1IMM(j__udySearchLeaf1, 14); - case cJ1_JPIMMED_1_15: SM1IMM(j__udySearchLeaf1, 15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: SM1IMM(j__udySearchLeaf2, 2); - case cJU_JPIMMED_2_03: SM1IMM(j__udySearchLeaf2, 3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: SM1IMM(j__udySearchLeaf2, 4); - case cJ1_JPIMMED_2_05: SM1IMM(j__udySearchLeaf2, 5); - case cJ1_JPIMMED_2_06: SM1IMM(j__udySearchLeaf2, 6); - case cJ1_JPIMMED_2_07: SM1IMM(j__udySearchLeaf2, 7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: SM1IMM(j__udySearchLeaf3, 2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: SM1IMM(j__udySearchLeaf3, 3); - case cJ1_JPIMMED_3_04: SM1IMM(j__udySearchLeaf3, 4); - case cJ1_JPIMMED_3_05: SM1IMM(j__udySearchLeaf3, 5); - - case cJ1_JPIMMED_4_02: SM1IMM(j__udySearchLeaf4, 2); - case cJ1_JPIMMED_4_03: SM1IMM(j__udySearchLeaf4, 3); - - case cJ1_JPIMMED_5_02: SM1IMM(j__udySearchLeaf5, 2); - case cJ1_JPIMMED_5_03: SM1IMM(j__udySearchLeaf5, 3); - - case cJ1_JPIMMED_6_02: SM1IMM(j__udySearchLeaf6, 2); - - case cJ1_JPIMMED_7_02: SM1IMM(j__udySearchLeaf7, 2); -#endif - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM1Get switch. - - /*NOTREACHED*/ - - -// ============================================================================ -// STATE MACHINE 2 -- BACKTRACK BRANCH TO PREVIOUS JP: -// -// Look for the next-left/right JP in a branch, backing up the history list as -// necessary. Upon finding a next-left/right JP, modify the corresponding -// digit in *PIndex before passing control to SM3Findlimit. -// -// Note: As described earlier, only branch JPs are expected here; other types -// fall into the default case. -// -// Note: If a found JP contains needed Dcd bytes, thats OK, theyre copied to -// *PIndex in SM3Findlimit. -// -// TBD: This code has a lot in common with similar code in the shortcut cases -// in SM1Get. Can combine this code somehow? -// -// ENTRY: List, possibly empty, of JPs and offsets in APjphist[] and -// Aoffhist[]; see earlier comments. -// -// EXIT: Execute JU_RET_NOTFOUND if no previous/next JP; otherwise jump to -// SM3Findlimit to resume a new but different downward search. - -SM2Backtrack: // come or return here for first/next sideways search. - - HISTPOP(Pjp, offset); - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: - - case cJU_JPBRANCH_L2: state = 2; goto SM2BranchL; - case cJU_JPBRANCH_L3: state = 3; goto SM2BranchL; -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: state = 4; goto SM2BranchL; - case cJU_JPBRANCH_L5: state = 5; goto SM2BranchL; - case cJU_JPBRANCH_L6: state = 6; goto SM2BranchL; - case cJU_JPBRANCH_L7: state = 7; goto SM2BranchL; -#endif - case cJU_JPBRANCH_L: state = cJU_ROOTSTATE; goto SM2BranchL; - -SM2BranchL: -#ifdef JUDYPREV - if (--offset < 0) goto SM2Backtrack; // no next-left JP in BranchL. -#endif - Pjbl = P_JBL(Pjp->jp_Addr); -#ifdef JUDYNEXT - if (++offset >= (Pjbl->jbl_NumJPs)) goto SM2Backtrack; - // no next-right JP in BranchL. -#endif - -// Theres a next-left/right JP in the current BranchL; save its digit in -// *PIndex and continue with SM3Findlimit: - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: - - case cJU_JPBRANCH_B2: state = 2; goto SM2BranchB; - case cJU_JPBRANCH_B3: state = 3; goto SM2BranchB; -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: state = 4; goto SM2BranchB; - case cJU_JPBRANCH_B5: state = 5; goto SM2BranchB; - case cJU_JPBRANCH_B6: state = 6; goto SM2BranchB; - case cJU_JPBRANCH_B7: state = 7; goto SM2BranchB; -#endif - case cJU_JPBRANCH_B: state = cJU_ROOTSTATE; goto SM2BranchB; - -SM2BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - HISTPOPBOFF(subexp, offset, digit); // unpack values. - -// If theres a next-left/right JP in the current BranchB, which for -// Judy*Next() is true if any bits are set for higher Indexes, continue to -// SM3Findlimit: -// -// Note: offset is set to the JP previously traversed; go one to the -// left/right. - -#ifdef JUDYPREV - if (offset > 0) // next-left JP is in this subexpanse. - { - --offset; - goto SM2BranchBFindlimit; - } - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JBB_BITMAP(Pjbb, subexp) - & JU_MASKHIGHEREXC(JU_BITPOSMASKB(digit))) - { - ++offset; // next-left => next-right. - goto SM2BranchBFindlimit; - } - - while (++subexp < cJU_NUMSUBEXPB) // search next-right subexps. -#endif - { - if (! JU_JBB_PJP(Pjbb, subexp)) continue; // empty subexpanse. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - offset = 0; -#endif - -// Save the next-left/right JPs digit in *PIndex: - -SM2BranchBFindlimit: - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), - offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchB: - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: - - case cJU_JPBRANCH_U2: state = 2; goto SM2BranchU; - case cJU_JPBRANCH_U3: state = 3; goto SM2BranchU; -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: state = 4; goto SM2BranchU; - case cJU_JPBRANCH_U5: state = 5; goto SM2BranchU; - case cJU_JPBRANCH_U6: state = 6; goto SM2BranchU; - case cJU_JPBRANCH_U7: state = 7; goto SM2BranchU; -#endif - case cJU_JPBRANCH_U: state = cJU_ROOTSTATE; goto SM2BranchU; - -SM2BranchU: - -// Search for a next-left/right JP in the current BranchU, and if one is found, -// save its digit in *PIndex and continue to SM3Findlimit: - - Pjbu = P_JBU(Pjp->jp_Addr); - digit = offset; - -#ifdef JUDYPREV - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - while (digit < cJU_BRANCHUNUMJPS - 1) - { - Pjp = (Pjbu->jbu_jp) + (++digit); -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchU: - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM2Backtrack switch. - - /*NOTREACHED*/ - - -// ============================================================================ -// STATE MACHINE 3 -- FIND LIMIT JP/INDEX: -// -// Look for the highest/lowest (right/left-most) JP in each branch and the -// highest/lowest Index in a leaf or immediate, and return it. While -// traversing, modify appropriate digit(s) in *PIndex to reflect the path -// taken, including Dcd bytes in each JP (which could hold critical missing -// digits for skipped branches). -// -// ENTRY: Pjp set to a JP under which to find max/min JPs (if a branch JP) or -// a max/min Index and return (if a leaf or immediate JP). -// -// EXIT: Execute JU_RET_FOUND* upon reaching a leaf or immediate. Should be -// impossible to fail, unless the Judy array is corrupt. - -SM3Findlimit: // come or return here for first/next branch/leaf. - - switch (JU_JPTYPE(Pjp)) - { -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Simply use the highest/lowest (right/left-most) JP in the BranchL, but first -// copy the Dcd bytes to *PIndex if there are any (only if state < -// cJU_ROOTSTATE - 1). - - case cJU_JPBRANCH_L2: SM3PREPB_DCD(2, SM3BranchL); -#ifndef JU_64BIT - case cJU_JPBRANCH_L3: SM3PREPB( 3, SM3BranchL); -#else - case cJU_JPBRANCH_L3: SM3PREPB_DCD(3, SM3BranchL); - case cJU_JPBRANCH_L4: SM3PREPB_DCD(4, SM3BranchL); - case cJU_JPBRANCH_L5: SM3PREPB_DCD(5, SM3BranchL); - case cJU_JPBRANCH_L6: SM3PREPB_DCD(6, SM3BranchL); - case cJU_JPBRANCH_L7: SM3PREPB( 7, SM3BranchL); -#endif - case cJU_JPBRANCH_L: SM3PREPB( cJU_ROOTSTATE, SM3BranchL); - -SM3BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -#ifdef JUDYPREV - if ((offset = (Pjbl->jbl_NumJPs) - 1) < 0) -#else - offset = 0; if ((Pjbl->jbl_NumJPs) == 0) -#endif - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Look for the highest/lowest (right/left-most) non-null subexpanse, then use -// the highest/lowest JP in that subexpanse, but first copy Dcd bytes, if there -// are any (only if state < cJU_ROOTSTATE - 1), to *PIndex. - - case cJU_JPBRANCH_B2: SM3PREPB_DCD(2, SM3BranchB); -#ifndef JU_64BIT - case cJU_JPBRANCH_B3: SM3PREPB( 3, SM3BranchB); -#else - case cJU_JPBRANCH_B3: SM3PREPB_DCD(3, SM3BranchB); - case cJU_JPBRANCH_B4: SM3PREPB_DCD(4, SM3BranchB); - case cJU_JPBRANCH_B5: SM3PREPB_DCD(5, SM3BranchB); - case cJU_JPBRANCH_B6: SM3PREPB_DCD(6, SM3BranchB); - case cJU_JPBRANCH_B7: SM3PREPB( 7, SM3BranchB); -#endif - case cJU_JPBRANCH_B: SM3PREPB( cJU_ROOTSTATE, SM3BranchB); - -SM3BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); -#ifdef JUDYPREV - subexp = cJU_NUMSUBEXPB; - - while (! (JU_JBB_BITMAP(Pjbb, --subexp))) // find non-empty subexp. - { - if (subexp <= 0) // wholly empty bitmap. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - subexp = -1; - - while (! (JU_JBB_BITMAP(Pjbb, ++subexp))) // find non-empty subexp. - { - if (subexp >= cJU_NUMSUBEXPB - 1) // didnt find one. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = 0; -#endif - - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Look for the highest/lowest (right/left-most) non-null JP, and use it, but -// first copy Dcd bytes to *PIndex if there are any (only if state < -// cJU_ROOTSTATE - 1). - - case cJU_JPBRANCH_U2: SM3PREPB_DCD(2, SM3BranchU); -#ifndef JU_64BIT - case cJU_JPBRANCH_U3: SM3PREPB( 3, SM3BranchU); -#else - case cJU_JPBRANCH_U3: SM3PREPB_DCD(3, SM3BranchU); - case cJU_JPBRANCH_U4: SM3PREPB_DCD(4, SM3BranchU); - case cJU_JPBRANCH_U5: SM3PREPB_DCD(5, SM3BranchU); - case cJU_JPBRANCH_U6: SM3PREPB_DCD(6, SM3BranchU); - case cJU_JPBRANCH_U7: SM3PREPB( 7, SM3BranchU); -#endif - case cJU_JPBRANCH_U: SM3PREPB( cJU_ROOTSTATE, SM3BranchU); - -SM3BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); -#ifdef JUDYPREV - digit = cJU_BRANCHUNUMJPS; - - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - - for (digit = 0; digit < cJU_BRANCHUNUMJPS; ++digit) - { - Pjp = (Pjbu->jbu_jp) + digit; -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// No non-null JPs in BranchU: - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Simply use the highest/lowest (right/left-most) Index in the LeafL, but the -// details vary depending on leaf Index Size. First copy Dcd bytes, if there -// are any (only if state < cJU_ROOTSTATE - 1), to *PIndex. - -#define SM3LEAFLDCD(cState) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - SM3LEAFLNODCD - -#ifdef JUDY1 -#define SM3LEAFL_SETPOP1 // not needed in any cases. -#else -#define SM3LEAFL_SETPOP1 pop1 = JU_JPLEAF_POP0(Pjp) + 1 -#endif - -#ifdef JUDYPREV -#define SM3LEAFLNODCD \ - Pjll = P_JLL(Pjp->jp_Addr); \ - SM3LEAFL_SETPOP1; \ - offset = JU_JPLEAF_POP0(Pjp); assert(offset >= 0) -#else -#define SM3LEAFLNODCD \ - Pjll = P_JLL(Pjp->jp_Addr); \ - SM3LEAFL_SETPOP1; \ - offset = 0; assert(JU_JPLEAF_POP0(Pjp) >= 0); -#endif - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - SM3LEAFLDCD(1); - JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]); - JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - - case cJU_JPLEAF2: - - SM3LEAFLDCD(2); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - -#ifndef JU_64BIT - case cJU_JPLEAF3: - { - Word_t lsb; - SM3LEAFLNODCD; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - -#else - case cJU_JPLEAF3: - { - Word_t lsb; - SM3LEAFLDCD(3); - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - - case cJU_JPLEAF4: - - SM3LEAFLDCD(4); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - - case cJU_JPLEAF5: - { - Word_t lsb; - SM3LEAFLDCD(5); - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - } - - case cJU_JPLEAF6: - { - Word_t lsb; - SM3LEAFLDCD(6); - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - } - - case cJU_JPLEAF7: - { - Word_t lsb; - SM3LEAFLNODCD; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_LEAF7(Pjll, pop1, offset); - } -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Look for the highest/lowest (right/left-most) non-null subexpanse, then use -// the highest/lowest Index in that subexpanse, but first copy Dcd bytes -// (always present since state 1 < cJU_ROOTSTATE) to *PIndex. - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; - - JU_SETDCD(*PIndex, Pjp, 1); - - Pjlb = P_JLB(Pjp->jp_Addr); -#ifdef JUDYPREV - subexp = cJU_NUMSUBEXPL; - - while (! JU_JLB_BITMAP(Pjlb, --subexp)) // find non-empty subexp. - { - if (subexp <= 0) // wholly empty bitmap. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - -// TBD: Might it be faster to just use a variant of BITMAPDIGIT*() that yields -// the digit for the right-most Index with a bit set? - - offset = SEARCHBITMAPMAXL(JU_JLB_BITMAP(Pjlb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPL)); -#else - subexp = -1; - - while (! JU_JLB_BITMAP(Pjlb, ++subexp)) // find non-empty subexp. - { - if (subexp >= cJU_NUMSUBEXPL - 1) // didnt find one. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = 0; -#endif - - JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset); - JU_SETDIGIT1(*PIndex, digit); - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// Copy Dcd bytes to *PIndex (always present since state 1 < cJU_ROOTSTATE), -// then set the highest/lowest possible digit as the LSB in *PIndex. - - case cJ1_JPFULLPOPU1: - - JU_SETDCD( *PIndex, Pjp, 1); -#ifdef JUDYPREV - JU_SETDIGIT1(*PIndex, cJU_BITSPERBITMAP - 1); -#else - JU_SETDIGIT1(*PIndex, 0); -#endif - JU_RET_FOUND_FULLPOPU1; -#endif // JUDY1 - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: -// -// Simply use the highest/lowest (right/left-most) Index in the Imm, but the -// details vary depending on leaf Index Size and pop1. Note: There are no Dcd -// bytes in an Immediate JP, but in a cJU_JPIMMED_*_01 JP, the field holds the -// least bytes of the immediate Index. - - case cJU_JPIMMED_1_01: SET_01(1); goto SM3Imm_01; - case cJU_JPIMMED_2_01: SET_01(2); goto SM3Imm_01; - case cJU_JPIMMED_3_01: SET_01(3); goto SM3Imm_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: SET_01(4); goto SM3Imm_01; - case cJU_JPIMMED_5_01: SET_01(5); goto SM3Imm_01; - case cJU_JPIMMED_6_01: SET_01(6); goto SM3Imm_01; - case cJU_JPIMMED_7_01: SET_01(7); goto SM3Imm_01; -#endif -SM3Imm_01: JU_RET_FOUND_IMM_01(Pjp); - -#ifdef JUDYPREV -#define SM3IMM_OFFSET(cPop1) (cPop1) - 1 // highest. -#else -#define SM3IMM_OFFSET(cPop1) 0 // lowest. -#endif - -#define SM3IMM(cPop1,Next) \ - offset = SM3IMM_OFFSET(cPop1); \ - goto Next - - case cJU_JPIMMED_1_02: SM3IMM( 2, SM3Imm1); - case cJU_JPIMMED_1_03: SM3IMM( 3, SM3Imm1); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: SM3IMM( 4, SM3Imm1); - case cJU_JPIMMED_1_05: SM3IMM( 5, SM3Imm1); - case cJU_JPIMMED_1_06: SM3IMM( 6, SM3Imm1); - case cJU_JPIMMED_1_07: SM3IMM( 7, SM3Imm1); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: SM3IMM( 8, SM3Imm1); - case cJ1_JPIMMED_1_09: SM3IMM( 9, SM3Imm1); - case cJ1_JPIMMED_1_10: SM3IMM(10, SM3Imm1); - case cJ1_JPIMMED_1_11: SM3IMM(11, SM3Imm1); - case cJ1_JPIMMED_1_12: SM3IMM(12, SM3Imm1); - case cJ1_JPIMMED_1_13: SM3IMM(13, SM3Imm1); - case cJ1_JPIMMED_1_14: SM3IMM(14, SM3Imm1); - case cJ1_JPIMMED_1_15: SM3IMM(15, SM3Imm1); -#endif - -SM3Imm1: JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]); - JU_RET_FOUND_IMM(Pjp, offset); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: SM3IMM(2, SM3Imm2); - case cJU_JPIMMED_2_03: SM3IMM(3, SM3Imm2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: SM3IMM(4, SM3Imm2); - case cJ1_JPIMMED_2_05: SM3IMM(5, SM3Imm2); - case cJ1_JPIMMED_2_06: SM3IMM(6, SM3Imm2); - case cJ1_JPIMMED_2_07: SM3IMM(7, SM3Imm2); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -SM3Imm2: *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: SM3IMM(2, SM3Imm3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: SM3IMM(3, SM3Imm3); - case cJ1_JPIMMED_3_04: SM3IMM(4, SM3Imm3); - case cJ1_JPIMMED_3_05: SM3IMM(5, SM3Imm3); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -SM3Imm3: - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: SM3IMM(2, SM3Imm4); - case cJ1_JPIMMED_4_03: SM3IMM(3, SM3Imm4); - -SM3Imm4: *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); - - case cJ1_JPIMMED_5_02: SM3IMM(2, SM3Imm5); - case cJ1_JPIMMED_5_03: SM3IMM(3, SM3Imm5); - -SM3Imm5: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_6_02: SM3IMM(2, SM3Imm6); - -SM3Imm6: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_7_02: SM3IMM(2, SM3Imm7); - -SM3Imm7: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif // (JUDY1 && JU_64BIT) - - -// ---------------------------------------------------------------------------- -// OTHER CASES: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM3Findlimit switch. - - /*NOTREACHED*/ - -} // Judy1Prev() / Judy1Next() / JudyLPrev() / JudyLNext() diff --git a/libjudy/src/JudyCommon/JudyPrevNextEmpty.c b/libjudy/src/JudyCommon/JudyPrevNextEmpty.c deleted file mode 100644 index 96a5901e3d..0000000000 --- a/libjudy/src/JudyCommon/JudyPrevNextEmpty.c +++ /dev/null @@ -1,1390 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.32 $ $Source: /judy/src/JudyCommon/JudyPrevNextEmpty.c $ -// -// Judy*PrevEmpty() and Judy*NextEmpty() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DJUDYNEXT for the Judy*NextEmpty() function; otherwise -// defaults to Judy*PrevEmpty(). -// -// Compile with -DTRACEJPSE to trace JP traversals. -// -// This file is separate from JudyPrevNext.c because it differs too greatly for -// ifdefs. This might be a bit surprising, but there are two reasons: -// -// - First, down in the details, searching for an empty index (SearchEmpty) is -// remarkably asymmetric with searching for a valid index (SearchValid), -// mainly with respect to: No return of a value area for JudyL; partially- -// full versus totally-full JPs; and handling of narrow pointers. -// -// - Second, we chose to implement SearchEmpty without a backtrack stack or -// backtrack engine, partly as an experiment, and partly because we think -// restarting from the top of the tree is less likely for SearchEmpty than -// for SearchValid, because empty indexes are more likely than valid indexes. -// -// A word about naming: A prior version of this feature (see 4.13) was named -// Judy*Free(), but there were concerns about that being read as a verb rather -// than an adjective. After prolonged debate and based on user input, we -// changed "Free" to "Empty". - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifndef JUDYNEXT -#ifndef JUDYPREV -#define JUDYPREV 1 // neither set => use default. -#endif -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -#ifdef TRACEJPSE -#include "JudyPrintJP.c" -#endif - - -// **************************************************************************** -// J U D Y 1 P R E V E M P T Y -// J U D Y 1 N E X T E M P T Y -// J U D Y L P R E V E M P T Y -// J U D Y L N E X T E M P T Y -// -// See the manual entry for the API. -// -// OVERVIEW OF Judy*PrevEmpty() / Judy*NextEmpty(): -// -// See also for comparison the equivalent comments in JudyPrevNext.c. -// -// Take the callers *PIndex and subtract/add 1, but watch out for -// underflow/overflow, which means "no previous/next empty index found." Use a -// reentrant switch statement (state machine, see SMGetRestart and -// SMGetContinue) to decode Index, starting with the JRP (PArray), through a -// JPM and branches, if any, down to an immediate or a leaf. Look for Index in -// that immediate or leaf, and if not found (invalid index), return success -// (Index is empty). -// -// This search can result in a dead end where taking a different path is -// required. There are four kinds of dead ends: -// -// BRANCH PRIMARY dead end: Encountering a fully-populated JP for the -// appropriate digit in Index. Search sideways in the branch for the -// previous/next absent/null/non-full JP, and if one is found, set Index to the -// highest/lowest index possible in that JPs expanse. Then if the JP is an -// absent or null JP, return success; otherwise for a non-full JP, traverse -// through the partially populated JP. -// -// BRANCH SECONDARY dead end: Reaching the end of a branch during a sideways -// search after a branch primary dead end. Set Index to the lowest/highest -// index possible in the whole branchs expanse (one higher/lower than the -// previous/next branchs expanse), then restart at the top of the tree, which -// includes pre-decrementing/incrementing Index (again) and watching for -// underflow/overflow (again). -// -// LEAF PRIMARY dead end: Finding a valid (non-empty) index in an immediate or -// leaf matching Index. Search sideways in the immediate/leaf for the -// previous/next empty index; if found, set *PIndex to match and return success. -// -// LEAF SECONDARY dead end: Reaching the end of an immediate or leaf during a -// sideways search after a leaf primary dead end. Just as for a branch -// secondary dead end, restart at the top of the tree with Index set to the -// lowest/highest index possible in the whole immediate/leafs expanse. -// TBD: If leaf secondary dead end occurs, could shortcut and treat it as a -// branch primary dead end; but this would require remembering the parent -// branchs type and offset (a "one-deep stack"), and also wrestling with -// narrow pointers, at least for leaves (but not for immediates). -// -// Note some ASYMMETRIES between SearchValid and SearchEmpty: -// -// - The SearchValid code, upon descending through a narrow pointer, if Index -// is outside the expanse of the subsidiary node (effectively a secondary -// dead end), must decide whether to backtrack or findlimit. But the -// SearchEmpty code simply returns success (Index is empty). -// -// - Similarly, the SearchValid code, upon finding no previous/next index in -// the expanse of a narrow pointer (again, a secondary dead end), can simply -// start to backtrack at the parent JP. But the SearchEmpty code would have -// to first determine whether or not the parent JPs narrow expanse contains -// a previous/next empty index outside the subexpanse. Rather than keeping a -// parent state stack and backtracking this way, upon a secondary dead end, -// the SearchEmpty code simply restarts at the top of the tree, whether or -// not a narrow pointer is involved. Again, see the equivalent comments in -// JudyPrevNext.c for comparison. -// -// This function is written iteratively for speed, rather than recursively. -// -// TBD: Wed like to enhance this function to make successive searches faster. -// This would require saving some previous state, including the previous Index -// returned, and in which leaf it was found. If the next call is for the same -// Index and the array has not been modified, start at the same leaf. This -// should be much easier to implement since this is iterative rather than -// recursive code. - -#ifdef JUDY1 -#ifdef JUDYPREV -FUNCTION int Judy1PrevEmpty -#else -FUNCTION int Judy1NextEmpty -#endif -#else -#ifdef JUDYPREV -FUNCTION int JudyLPrevEmpty -#else -FUNCTION int JudyLNextEmpty -#endif -#endif - ( - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError // optional, for returning error info. - ) -{ - Word_t Index; // fast copy, in a register. - Pjp_t Pjp; // current JP. - Pjbl_t Pjbl; // Pjp->jp_Addr masked and cast to types: - Pjbb_t Pjbb; - Pjbu_t Pjbu; - Pjlb_t Pjlb; - PWord_t Pword; // alternate name for use by GET* macros. - - Word_t digit; // next digit to decode from Index. - Word_t digits; // current state in SM = digits left to decode. - Word_t pop0; // in a leaf. - Word_t pop0mask; // precalculated to avoid variable shifts. - long offset; // within a branch or leaf (can be large). - int subexp; // subexpanse in a bitmap branch. - BITMAPB_t bitposmaskB; // bit in bitmap for bitmap branch. - BITMAPL_t bitposmaskL; // bit in bitmap for bitmap leaf. - Word_t possfullJP1; // JP types for possibly full subexpanses: - Word_t possfullJP2; - Word_t possfullJP3; - - -// ---------------------------------------------------------------------------- -// M A C R O S -// -// These are intended to make the code a bit more readable and less redundant. - - -// CHECK FOR NULL JP: -// -// TBD: In principle this can be reduced (here and in other *.c files) to just -// the latter clause since no Type should ever be below cJU_JPNULL1, but in -// fact some root pointer types can be lower, so for safety do both checks. - -#define JPNULL(Type) (((Type) >= cJU_JPNULL1) && ((Type) <= cJU_JPNULLMAX)) - - -// CHECK FOR A FULL JP: -// -// Given a JP, indicate if it is fully populated. Use digits, pop0mask, and -// possfullJP1..3 in the context. -// -// This is a difficult problem because it requires checking the Pop0 bits for -// all-ones, but the number of bytes depends on the JP type, which is not -// directly related to the parent branchs type or level -- the JPs child -// could be under a narrow pointer (hence not full). The simple answer -// requires switching on or otherwise calculating the JP type, which could be -// slow. Instead, in SMPREPB* precalculate pop0mask and also record in -// possfullJP1..3 the child JP (branch) types that could possibly be full (one -// level down), and use them here. For level-2 branches (with digits == 2), -// the test for a full child depends on Judy1/JudyL. -// -// Note: This cannot be applied to the JP in a JPM because it doesnt have -// enough pop0 digits. -// -// TBD: JPFULL_BRANCH diligently checks for BranchL or BranchB, where neither -// of those can ever be full as it turns out. Could just check for a BranchU -// at the right level. Also, pop0mask might be overkill, its not used much, -// so perhaps just call cJU_POP0MASK(digits - 1) here? -// -// First, JPFULL_BRANCH checks for a full expanse for a JP whose child can be a -// branch, that is, a JP in a branch at level 3 or higher: - -#define JPFULL_BRANCH(Pjp) \ - ((((JU_JPDCDPOP0(Pjp) ^ cJU_ALLONES) & pop0mask) == 0) \ - && ((JU_JPTYPE(Pjp) == possfullJP1) \ - || (JU_JPTYPE(Pjp) == possfullJP2) \ - || (JU_JPTYPE(Pjp) == possfullJP3))) - -#ifdef JUDY1 -#define JPFULL(Pjp) \ - ((digits == 2) ? \ - (JU_JPTYPE(Pjp) == cJ1_JPFULLPOPU1) : JPFULL_BRANCH(Pjp)) -#else -#define JPFULL(Pjp) \ - ((digits == 2) ? \ - (JU_JPTYPE(Pjp) == cJU_JPLEAF_B1) \ - && (((JU_JPDCDPOP0(Pjp) & cJU_POP0MASK(1)) == cJU_POP0MASK(1))) : \ - JPFULL_BRANCH(Pjp)) -#endif - - -// RETURN SUCCESS: -// -// This hides the need to set *PIndex back to the local value of Index -- use a -// local value for faster operation. Note that the callers *PIndex is ALWAYS -// modified upon success, at least decremented/incremented. - -#define RET_SUCCESS { *PIndex = Index; return(1); } - - -// RETURN A CORRUPTION: - -#define RET_CORRUPT { JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); return(JERRI); } - - -// SEARCH A BITMAP BRANCH: -// -// This is a weak analog of j__udySearchLeaf*() for bitmap branches. Return -// the actual or next-left position, base 0, of Digit in a BITMAPB_t bitmap -// (subexpanse of a full bitmap), also given a Bitposmask for Digit. The -// position is the offset within the set bits. -// -// Unlike j__udySearchLeaf*(), the offset is not returned bit-complemented if -// Digits bit is unset, because the caller can check the bitmap themselves to -// determine that. Also, if Digits bit is unset, the returned offset is to -// the next-left JP or index (including -1), not to the "ideal" position for -// the index = next-right JP or index. -// -// Shortcut and skip calling j__udyCountBitsB() if the bitmap is full, in which -// case (Digit % cJU_BITSPERSUBEXPB) itself is the base-0 offset. - -#define SEARCHBITMAPB(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPB) ? (Digit % cJU_BITSPERSUBEXPB) : \ - j__udyCountBitsB((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#ifdef JUDYPREV -// Equivalent to search for the highest offset in Bitmap, that is, one less -// than the number of bits set: - -#define SEARCHBITMAPMAXB(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPB) ? cJU_BITSPERSUBEXPB - 1 : \ - j__udyCountBitsB(Bitmap) - 1) -#endif - - -// CHECK DECODE BYTES: -// -// Check Decode bytes in a JP against the equivalent portion of Index. If they -// dont match, Index is outside the subexpanse of a narrow pointer, hence is -// empty. - -#define CHECKDCD(cDigits) \ - if (JU_DCDNOTMATCHINDEX(Index, Pjp, cDigits)) RET_SUCCESS - - -// REVISE REMAINDER OF INDEX: -// -// Put one digit in place in Index and clear/set the lower digits, if any, so -// the resulting Index is at the start/end of an expanse, or just clear/set the -// least digits. -// -// Actually, to make simple use of JU_LEASTBYTESMASK, first clear/set all least -// digits of Index including the digit to be overridden, then set the value of -// that one digit. If Digits == 1 the first operation is redundant, but either -// very fast or even removed by the optimizer. - -#define CLEARLEASTDIGITS(Digits) Index &= ~JU_LEASTBYTESMASK(Digits) -#define SETLEASTDIGITS( Digits) Index |= JU_LEASTBYTESMASK(Digits) - -#define CLEARLEASTDIGITS_D(Digit,Digits) \ - { \ - CLEARLEASTDIGITS(Digits); \ - JU_SETDIGIT(Index, Digit, Digits); \ - } - -#define SETLEASTDIGITS_D(Digit,Digits) \ - { \ - SETLEASTDIGITS(Digits); \ - JU_SETDIGIT(Index, Digit, Digits); \ - } - - -// SET REMAINDER OF INDEX AND THEN RETURN OR CONTINUE: - -#define SET_AND_RETURN(OpLeastDigits,Digit,Digits) \ - { \ - OpLeastDigits(Digit, Digits); \ - RET_SUCCESS; \ - } - -#define SET_AND_CONTINUE(OpLeastDigits,Digit,Digits) \ - { \ - OpLeastDigits(Digit, Digits); \ - goto SMGetContinue; \ - } - - -// PREPARE TO HANDLE A LEAFW OR JP BRANCH IN THE STATE MACHINE: -// -// Extract a state-dependent digit from Index in a "constant" way, then jump to -// common code for multiple cases. -// -// TBD: Should this macro do more, such as preparing variable-shift masks for -// use in CLEARLEASTDIGITS and SETLEASTDIGITS? - -#define SMPREPB(cDigits,Next,PossFullJP1,PossFullJP2,PossFullJP3) \ - digits = (cDigits); \ - digit = JU_DIGITATSTATE(Index, cDigits); \ - pop0mask = cJU_POP0MASK((cDigits) - 1); /* for branchs JPs */ \ - possfullJP1 = (PossFullJP1); \ - possfullJP2 = (PossFullJP2); \ - possfullJP3 = (PossFullJP3); \ - goto Next - -// Variations for specific-level branches and for shorthands: -// -// Note: SMPREPB2 need not initialize possfullJP* because JPFULL does not use -// them for digits == 2, but gcc -Wall isnt quite smart enough to see this, so -// waste a bit of time and space to get rid of the warning: - -#define SMPREPB2(Next) \ - digits = 2; \ - digit = JU_DIGITATSTATE(Index, 2); \ - pop0mask = cJU_POP0MASK(1); /* for branchs JPs */ \ - possfullJP1 = possfullJP2 = possfullJP3 = 0; \ - goto Next - -#define SMPREPB3(Next) SMPREPB(3, Next, cJU_JPBRANCH_L2, \ - cJU_JPBRANCH_B2, \ - cJU_JPBRANCH_U2) -#ifndef JU_64BIT -#define SMPREPBL(Next) SMPREPB(cJU_ROOTSTATE, Next, cJU_JPBRANCH_L3, \ - cJU_JPBRANCH_B3, \ - cJU_JPBRANCH_U3) -#else -#define SMPREPB4(Next) SMPREPB(4, Next, cJU_JPBRANCH_L3, \ - cJU_JPBRANCH_B3, \ - cJU_JPBRANCH_U3) -#define SMPREPB5(Next) SMPREPB(5, Next, cJU_JPBRANCH_L4, \ - cJU_JPBRANCH_B4, \ - cJU_JPBRANCH_U4) -#define SMPREPB6(Next) SMPREPB(6, Next, cJU_JPBRANCH_L5, \ - cJU_JPBRANCH_B5, \ - cJU_JPBRANCH_U5) -#define SMPREPB7(Next) SMPREPB(7, Next, cJU_JPBRANCH_L6, \ - cJU_JPBRANCH_B6, \ - cJU_JPBRANCH_U6) -#define SMPREPBL(Next) SMPREPB(cJU_ROOTSTATE, Next, cJU_JPBRANCH_L7, \ - cJU_JPBRANCH_B7, \ - cJU_JPBRANCH_U7) -#endif - - -// RESTART AFTER SECONDARY DEAD END: -// -// Set Index to the first/last index in the branch or leaf subexpanse and start -// over at the top of the tree. - -#ifdef JUDYPREV -#define SMRESTART(Digits) { CLEARLEASTDIGITS(Digits); goto SMGetRestart; } -#else -#define SMRESTART(Digits) { SETLEASTDIGITS( Digits); goto SMGetRestart; } -#endif - - -// CHECK EDGE OF LEAFS EXPANSE: -// -// Given the LSBs of the lowest/highest valid index in a leaf (or equivalently -// in an immediate JP), the level (index size) of the leaf, and the full index -// to return (as Index in the context) already set to the full index matching -// the lowest/highest one, determine if there is an empty index in the leafs -// expanse below/above the lowest/highest index, which is true if the -// lowest/highest index is not at the "edge" of the leafs expanse based on its -// LSBs. If so, return Index decremented/incremented; otherwise restart at the -// top of the tree. -// -// Note: In many cases Index is already at the right spot and calling -// SMRESTART instead of just going directly to SMGetRestart is a bit of -// overkill. -// -// Note: Variable shift occurs if Digits is not a constant. - -#ifdef JUDYPREV -#define LEAF_EDGE(MinIndex,Digits) \ - { \ - if (MinIndex) { --Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#else -#define LEAF_EDGE(MaxIndex,Digits) \ - { \ - if ((MaxIndex) != JU_LEASTBYTES(cJU_ALLONES, Digits)) \ - { ++Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#endif - -// Same as above except Index is not already set to match the lowest/highest -// index, so do that before decrementing/incrementing it: - -#ifdef JUDYPREV -#define LEAF_EDGE_SET(MinIndex,Digits) \ - { \ - if (MinIndex) \ - { JU_SETDIGITS(Index, MinIndex, Digits); --Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#else -#define LEAF_EDGE_SET(MaxIndex,Digits) \ - { \ - if ((MaxIndex) != JU_LEASTBYTES(cJU_ALLONES, Digits)) \ - { JU_SETDIGITS(Index, MaxIndex, Digits); ++Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#endif - - -// FIND A HOLE (EMPTY INDEX) IN AN IMMEDIATE OR LEAF: -// -// Given an index location in a leaf (or equivalently an immediate JP) known to -// contain a usable hole (an empty index less/greater than Index), and the LSBs -// of a minimum/maximum index to locate, find the previous/next empty index and -// return it. -// -// Note: "Even" index sizes (1,2,4[,8] bytes) have corresponding native C -// types; "odd" index sizes dont, but they are not represented here because -// they are handled completely differently; see elsewhere. - -#ifdef JUDYPREV - -#define LEAF_HOLE_EVEN(cDigits,Pjll,IndexLSB) \ - { \ - while (*(Pjll) > (IndexLSB)) --(Pjll); /* too high */ \ - if (*(Pjll) < (IndexLSB)) RET_SUCCESS /* Index is empty */ \ - while (*(--(Pjll)) == --(IndexLSB)) /* null, find a hole */;\ - JU_SETDIGITS(Index, IndexLSB, cDigits); \ - RET_SUCCESS; \ - } -#else -#define LEAF_HOLE_EVEN(cDigits,Pjll,IndexLSB) \ - { \ - while (*(Pjll) < (IndexLSB)) ++(Pjll); /* too low */ \ - if (*(Pjll) > (IndexLSB)) RET_SUCCESS /* Index is empty */ \ - while (*(++(Pjll)) == ++(IndexLSB)) /* null, find a hole */;\ - JU_SETDIGITS(Index, IndexLSB, cDigits); \ - RET_SUCCESS; \ - } -#endif - - -// SEARCH FOR AN EMPTY INDEX IN AN IMMEDIATE OR LEAF: -// -// Given a pointer to the first index in a leaf (or equivalently an immediate -// JP), the population of the leaf, and a first empty Index to find (inclusive, -// as Index in the context), where Index is known to fall within the expanse of -// the leaf to search, efficiently find the previous/next empty index in the -// leaf, if any. For simplicity the following overview is stated in terms of -// Judy*NextEmpty() only, but the same concepts apply symmetrically for -// Judy*PrevEmpty(). Also, in each case the comparisons are for the LSBs of -// Index and leaf indexes, according to the leafs level. -// -// 1. If Index is GREATER than the last (highest) index in the leaf -// (maxindex), return success, Index is empty. (Remember, Index is known -// to be in the leafs expanse.) -// -// 2. If Index is EQUAL to maxindex: If maxindex is not at the edge of the -// leafs expanse, increment Index and return success, there is an empty -// Index one higher than any in the leaf; otherwise restart with Index -// reset to the upper edge of the leafs expanse. Note: This might cause -// an extra cache line fill, but this is OK for repeatedly-called search -// code, and it saves CPU time. -// -// 3. If Index is LESS than maxindex, check for "dense to end of leaf": -// Subtract Index from maxindex, and back up that many slots in the leaf. -// If the resulting offset is not before the start of the leaf then compare -// the index at this offset (baseindex) with Index: -// -// 3a. If GREATER, the leaf must be corrupt, since indexes are sorted and -// there are no duplicates. -// -// 3b. If EQUAL, the leaf is "dense" from Index to maxindex, meaning there is -// no reason to search it. "Slide right" to the high end of the leaf -// (modify Index to maxindex) and continue with step 2 above. -// -// 3c. If LESS, continue with step 4. -// -// 4. If the offset based on maxindex minus Index falls BEFORE the start of -// the leaf, or if, per 3c above, baseindex is LESS than Index, the leaf is -// guaranteed "not dense to the end" and a usable empty Index must exist. -// This supports a more efficient search loop. Start at the FIRST index in -// the leaf, or one BEYOND baseindex, respectively, and search the leaf as -// follows, comparing each current index (currindex) with Index: -// -// 4a. If LESS, keep going to next index. Note: This is certain to terminate -// because maxindex is known to be greater than Index, hence the loop can -// be small and fast. -// -// 4b. If EQUAL, loop and increment Index until finding currindex greater than -// Index, and return success with the modified Index. -// -// 4c. If GREATER, return success, Index (unmodified) is empty. -// -// Note: These are macros rather than functions for speed. - -#ifdef JUDYPREV - -#define JSLE_EVEN(Addr,Pop0,cDigits,LeafType) \ - { \ - LeafType * PjllLSB = (LeafType *) (Addr); \ - LeafType IndexLSB = Index; /* auto-masking */ \ - \ - /* Index before or at start of leaf: */ \ - \ - if (*PjllLSB >= IndexLSB) /* no need to search */ \ - { \ - if (*PjllLSB > IndexLSB) RET_SUCCESS; /* Index empty */ \ - LEAF_EDGE(*PjllLSB, cDigits); \ - } \ - \ - /* Index in or after leaf: */ \ - \ - offset = IndexLSB - *PjllLSB; /* tentative offset */ \ - if (offset <= (Pop0)) /* can check density */ \ - { \ - PjllLSB += offset; /* move to slot */ \ - \ - if (*PjllLSB <= IndexLSB) /* dense or corrupt */ \ - { \ - if (*PjllLSB == IndexLSB) /* dense, check edge */ \ - LEAF_EDGE_SET(PjllLSB[-offset], cDigits); \ - RET_CORRUPT; \ - } \ - --PjllLSB; /* not dense, start at previous */ \ - } \ - else PjllLSB = ((LeafType *) (Addr)) + (Pop0); /* start at max */ \ - \ - LEAF_HOLE_EVEN(cDigits, PjllLSB, IndexLSB); \ - } - -// JSLE_ODD is completely different from JSLE_EVEN because its important to -// minimize copying odd indexes to compare them (see 4.14). Furthermore, a -// very complex version (4.17, but abandoned before fully debugged) that -// avoided calling j__udySearchLeaf*() ran twice as fast as 4.14, but still -// half as fast as SearchValid. Doug suggested that to minimize complexity and -// share common code we should use j__udySearchLeaf*() for the initial search -// to establish if Index is empty, which should be common. If Index is valid -// in a leaf or immediate indexes, odds are good that an empty Index is nearby, -// so for simplicity just use a *COPY* function to linearly search the -// remainder. -// -// TBD: Pathological case? Average performance should be good, but worst-case -// might suffer. When Search says the initial Index is valid, so a linear -// copy-and-compare is begun, if the caller builds fairly large leaves with -// dense clusters AND frequently does a SearchEmpty at one end of such a -// cluster, performance wont be very good. Might a dense-check help? This -// means checking offset against the index at offset, and then against the -// first/last index in the leaf. We doubt the pathological case will appear -// much in real applications because they will probably alternate SearchValid -// and SearchEmpty calls. - -#define JSLE_ODD(cDigits,Pjll,Pop0,Search,Copy) \ - { \ - Word_t IndexLSB; /* least bytes only */ \ - Word_t IndexFound; /* in leaf */ \ - \ - if ((offset = Search(Pjll, (Pop0) + 1, Index)) < 0) \ - RET_SUCCESS; /* Index is empty */ \ - \ - IndexLSB = JU_LEASTBYTES(Index, cDigits); \ - offset *= (cDigits); \ - \ - while ((offset -= (cDigits)) >= 0) \ - { /* skip until empty or start */ \ - Copy(IndexFound, ((uint8_t *) (Pjll)) + offset); \ - if (IndexFound != (--IndexLSB)) /* found an empty */ \ - { JU_SETDIGITS(Index, IndexLSB, cDigits); RET_SUCCESS; }\ - } \ - LEAF_EDGE_SET(IndexLSB, cDigits); \ - } - -#else // JUDYNEXT - -#define JSLE_EVEN(Addr,Pop0,cDigits,LeafType) \ - { \ - LeafType * PjllLSB = ((LeafType *) (Addr)) + (Pop0); \ - LeafType IndexLSB = Index; /* auto-masking */ \ - \ - /* Index at or after end of leaf: */ \ - \ - if (*PjllLSB <= IndexLSB) /* no need to search */ \ - { \ - if (*PjllLSB < IndexLSB) RET_SUCCESS; /* Index empty */\ - LEAF_EDGE(*PjllLSB, cDigits); \ - } \ - \ - /* Index before or in leaf: */ \ - \ - offset = *PjllLSB - IndexLSB; /* tentative offset */ \ - if (offset <= (Pop0)) /* can check density */ \ - { \ - PjllLSB -= offset; /* move to slot */ \ - \ - if (*PjllLSB >= IndexLSB) /* dense or corrupt */ \ - { \ - if (*PjllLSB == IndexLSB) /* dense, check edge */ \ - LEAF_EDGE_SET(PjllLSB[offset], cDigits); \ - RET_CORRUPT; \ - } \ - ++PjllLSB; /* not dense, start at next */ \ - } \ - else PjllLSB = (LeafType *) (Addr); /* start at minimum */ \ - \ - LEAF_HOLE_EVEN(cDigits, PjllLSB, IndexLSB); \ - } - -#define JSLE_ODD(cDigits,Pjll,Pop0,Search,Copy) \ - { \ - Word_t IndexLSB; /* least bytes only */ \ - Word_t IndexFound; /* in leaf */ \ - int offsetmax; /* in bytes */ \ - \ - if ((offset = Search(Pjll, (Pop0) + 1, Index)) < 0) \ - RET_SUCCESS; /* Index is empty */ \ - \ - IndexLSB = JU_LEASTBYTES(Index, cDigits); \ - offset *= (cDigits); \ - offsetmax = (Pop0) * (cDigits); /* single multiply */ \ - \ - while ((offset += (cDigits)) <= offsetmax) \ - { /* skip until empty or end */ \ - Copy(IndexFound, ((uint8_t *) (Pjll)) + offset); \ - if (IndexFound != (++IndexLSB)) /* found an empty */ \ - { JU_SETDIGITS(Index, IndexLSB, cDigits); RET_SUCCESS; } \ - } \ - LEAF_EDGE_SET(IndexLSB, cDigits); \ - } - -#endif // JUDYNEXT - -// Note: Immediate indexes never fill a single index group, so for odd index -// sizes, save time by calling JSLE_ODD_IMM instead of JSLE_ODD. - -#define j__udySearchLeafEmpty1(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 1, uint8_t) - -#define j__udySearchLeafEmpty2(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 2, uint16_t) - -#define j__udySearchLeafEmpty3(Addr,Pop0) \ - JSLE_ODD(3, Addr, Pop0, j__udySearchLeaf3, JU_COPY3_PINDEX_TO_LONG) - -#ifndef JU_64BIT - -#define j__udySearchLeafEmptyL(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 4, Word_t) - -#else - -#define j__udySearchLeafEmpty4(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 4, uint32_t) - -#define j__udySearchLeafEmpty5(Addr,Pop0) \ - JSLE_ODD(5, Addr, Pop0, j__udySearchLeaf5, JU_COPY5_PINDEX_TO_LONG) - -#define j__udySearchLeafEmpty6(Addr,Pop0) \ - JSLE_ODD(6, Addr, Pop0, j__udySearchLeaf6, JU_COPY6_PINDEX_TO_LONG) - -#define j__udySearchLeafEmpty7(Addr,Pop0) \ - JSLE_ODD(7, Addr, Pop0, j__udySearchLeaf7, JU_COPY7_PINDEX_TO_LONG) - -#define j__udySearchLeafEmptyL(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 8, Word_t) - -#endif // JU_64BIT - - -// ---------------------------------------------------------------------------- -// START OF CODE: -// -// CHECK FOR SHORTCUTS: -// -// Error out if PIndex is null. - - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return(JERRI); - } - - Index = *PIndex; // fast local copy. - -// Set and pre-decrement/increment Index, watching for underflow/overflow: -// -// An out-of-bounds Index means failure: No previous/next empty index. - -SMGetRestart: // return here with revised Index. - -#ifdef JUDYPREV - if (Index-- == 0) return(0); -#else - if (++Index == 0) return(0); -#endif - -// An empty array with an in-bounds (not underflowed/overflowed) Index means -// success: -// -// Note: This check is redundant after restarting at SMGetRestart, but should -// take insignificant time. - - if (PArray == (Pvoid_t) NULL) RET_SUCCESS; - -// ---------------------------------------------------------------------------- -// ROOT-LEVEL LEAF that starts with a Pop0 word; just look within the leaf: -// -// If Index is not in the leaf, return success; otherwise return the first -// empty Index, if any, below/above where it would belong. - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - pop0 = Pjlw[0]; - -#ifdef JUDY1 - if (pop0 == 0) // special case. - { -#ifdef JUDYPREV - if ((Index != Pjlw[1]) || (Index-- != 0)) RET_SUCCESS; -#else - if ((Index != Pjlw[1]) || (++Index != 0)) RET_SUCCESS; -#endif - return(0); // no previous/next empty index. - } -#endif // JUDY1 - - j__udySearchLeafEmptyL(Pjlw + 1, pop0); - -// No return -- thanks ALAN - - } - else - -// ---------------------------------------------------------------------------- -// HANDLE JRP Branch: -// -// For JRP branches, traverse the JPM; handle LEAFW -// directly; but look for the most common cases first. - - { - Pjpm_t Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); - -// goto SMGetContinue; - } - - -// ============================================================================ -// STATE MACHINE -- GET INDEX: -// -// Search for Index (already decremented/incremented so as to be an inclusive -// search). If not found (empty index), return success. Otherwise do a -// previous/next search, and if successful modify Index to the empty index -// found. See function header comments. -// -// ENTRY: Pjp points to next JP to interpret, whose Decode bytes have not yet -// been checked. -// -// Note: Check Decode bytes at the start of each loop, not after looking up a -// new JP, so its easy to do constant shifts/masks. -// -// EXIT: Return, or branch to SMGetRestart with modified Index, or branch to -// SMGetContinue with a modified Pjp, as described elsewhere. -// -// WARNING: For run-time efficiency the following cases replicate code with -// varying constants, rather than using common code with variable values! - -SMGetContinue: // return here for next branch/leaf. - -#ifdef TRACEJPSE - JudyPrintJP(Pjp, "sf", __LINE__); -#endif - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_L2: CHECKDCD(2); SMPREPB2(SMBranchL); - case cJU_JPBRANCH_L3: CHECKDCD(3); SMPREPB3(SMBranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: CHECKDCD(4); SMPREPB4(SMBranchL); - case cJU_JPBRANCH_L5: CHECKDCD(5); SMPREPB5(SMBranchL); - case cJU_JPBRANCH_L6: CHECKDCD(6); SMPREPB6(SMBranchL); - case cJU_JPBRANCH_L7: CHECKDCD(7); SMPREPB7(SMBranchL); -#endif - case cJU_JPBRANCH_L: SMPREPBL(SMBranchL); - -// Common code (state-independent) for all cases of linear branches: - -SMBranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -// First, check if Indexs expanse (digit) is below/above the first/last -// populated expanse in the BranchL, in which case Index is empty; otherwise -// find the offset of the lowest/highest populated expanse at or above/below -// digit, if any: -// -// Note: The for-loop is guaranteed to exit eventually because the first/last -// expanse is known to be a terminator. -// -// Note: Cannot use j__udySearchLeaf*Empty1() here because it only applies to -// leaves and does not know about partial versus full JPs, unlike the use of -// j__udySearchLeaf1() for BranchLs in SearchValid code. Also, since linear -// leaf expanse lists are small, dont waste time calling j__udySearchLeaf1(), -// just scan the expanse list. - -#ifdef JUDYPREV - if ((Pjbl->jbl_Expanse[0]) > digit) RET_SUCCESS; - - for (offset = (Pjbl->jbl_NumJPs) - 1; /* null */; --offset) -#else - if ((Pjbl->jbl_Expanse[(Pjbl->jbl_NumJPs) - 1]) < digit) - RET_SUCCESS; - - for (offset = 0; /* null */; ++offset) -#endif - { - -// Too low/high, keep going; or too high/low, meaning the loop passed a hole -// and the initial Index is empty: - -#ifdef JUDYPREV - if ((Pjbl->jbl_Expanse[offset]) > digit) continue; - if ((Pjbl->jbl_Expanse[offset]) < digit) RET_SUCCESS; -#else - if ((Pjbl->jbl_Expanse[offset]) < digit) continue; - if ((Pjbl->jbl_Expanse[offset]) > digit) RET_SUCCESS; -#endif - -// Found expanse matching digit; if its not full, traverse through it: - - if (! JPFULL((Pjbl->jbl_jp) + offset)) - { - Pjp = (Pjbl->jbl_jp) + offset; - goto SMGetContinue; - } - -// Common code: While searching for a lower/higher hole or a non-full JP, upon -// finding a lower/higher hole, adjust Index using the revised digit and -// return; or upon finding a consecutive lower/higher expanse, if the expanses -// JP is non-full, modify Index and traverse through the JP: - -#define BRANCHL_CHECK(OpIncDec,OpLeastDigits,Digit,Digits) \ - { \ - if ((Pjbl->jbl_Expanse[offset]) != OpIncDec digit) \ - SET_AND_RETURN(OpLeastDigits, Digit, Digits); \ - \ - if (! JPFULL((Pjbl->jbl_jp) + offset)) \ - { \ - Pjp = (Pjbl->jbl_jp) + offset; \ - SET_AND_CONTINUE(OpLeastDigits, Digit, Digits); \ - } \ - } - -// BranchL primary dead end: Expanse matching Index/digit is full (rare except -// for dense/sequential indexes): -// -// Search for a lower/higher hole, a non-full JP, or the end of the expanse -// list, while decrementing/incrementing digit. - -#ifdef JUDYPREV - while (--offset >= 0) - BRANCHL_CHECK(--, SETLEASTDIGITS_D, digit, digits) -#else - while (++offset < Pjbl->jbl_NumJPs) - BRANCHL_CHECK(++, CLEARLEASTDIGITS_D, digit, digits) -#endif - -// Passed end of BranchL expanse list after finding a matching but full -// expanse: -// -// Digit now matches the lowest/highest expanse, which is a full expanse; if -// digit is at the end of BranchLs expanse (no hole before/after), break out -// of the loop; otherwise modify Index to the next lower/higher digit and -// return success: - -#ifdef JUDYPREV - if (digit == 0) break; - --digit; SET_AND_RETURN(SETLEASTDIGITS_D, digit, digits); -#else - if (digit == JU_LEASTBYTES(cJU_ALLONES, 1)) break; - ++digit; SET_AND_RETURN(CLEARLEASTDIGITS_D, digit, digits); -#endif - } // for-loop - -// BranchL secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_B2: CHECKDCD(2); SMPREPB2(SMBranchB); - case cJU_JPBRANCH_B3: CHECKDCD(3); SMPREPB3(SMBranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: CHECKDCD(4); SMPREPB4(SMBranchB); - case cJU_JPBRANCH_B5: CHECKDCD(5); SMPREPB5(SMBranchB); - case cJU_JPBRANCH_B6: CHECKDCD(6); SMPREPB6(SMBranchB); - case cJU_JPBRANCH_B7: CHECKDCD(7); SMPREPB7(SMBranchB); -#endif - case cJU_JPBRANCH_B: SMPREPBL(SMBranchB); - -// Common code (state-independent) for all cases of bitmap branches: - -SMBranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - -// Locate the digits JP in the subexpanse list, if present: - - subexp = digit / cJU_BITSPERSUBEXPB; - assert(subexp < cJU_NUMSUBEXPB); // falls in expected range. - bitposmaskB = JU_BITPOSMASKB(digit); - -// Absent JP = no JP matches current digit in Index: - -// if (! JU_BITMAPTESTB(Pjbb, digit)) // slower. - if (! (JU_JBB_BITMAP(Pjbb, subexp) & bitposmaskB)) // faster. - RET_SUCCESS; - -// Non-full JP matches current digit in Index: -// -// Iterate to the subsidiary non-full JP. - - offset = SEARCHBITMAPB(JU_JBB_BITMAP(Pjbb, subexp), digit, - bitposmaskB); - // not negative since at least one bit is set: - assert(offset >= 0); - assert(offset < (int) cJU_BITSPERSUBEXPB); - -// Watch for null JP subarray pointer with non-null bitmap (a corruption): - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) - == (Pjp_t) NULL) RET_CORRUPT; - - Pjp += offset; - if (! JPFULL(Pjp)) goto SMGetContinue; - -// BranchB primary dead end: -// -// Upon hitting a full JP in a BranchB for the next digit in Index, search -// sideways for a previous/next absent JP (unset bit) or non-full JP (set bit -// with non-full JP); first in the current bitmap subexpanse, then in -// lower/higher subexpanses. Upon entry, Pjp points to a known-unusable JP, -// ready to decrement/increment. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. -// -// TBD: For speed, shift bitposmaskB instead of using JU_BITMAPTESTB or -// JU_BITPOSMASKB, but this shift has knowledge of bit order that really should -// be encapsulated in a header file. - -#define BRANCHB_CHECKBIT(OpLeastDigits) \ - if (! (JU_JBB_BITMAP(Pjbb, subexp) & bitposmaskB)) /* absent JP */ \ - SET_AND_RETURN(OpLeastDigits, digit, digits) - -#define BRANCHB_CHECKJPFULL(OpLeastDigits) \ - if (! JPFULL(Pjp)) \ - SET_AND_CONTINUE(OpLeastDigits, digit, digits) - -#define BRANCHB_STARTSUBEXP(OpLeastDigits) \ - if (! JU_JBB_BITMAP(Pjbb, subexp)) /* empty subexpanse, shortcut */ \ - SET_AND_RETURN(OpLeastDigits, digit, digits) \ - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) RET_CORRUPT - -#ifdef JUDYPREV - - --digit; // skip initial digit. - bitposmaskB >>= 1; // see TBD above. - -BranchBNextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskB) // more bits to check in subexp. - { - BRANCHB_CHECKBIT(SETLEASTDIGITS_D); - --Pjp; // previous in subarray. - BRANCHB_CHECKJPFULL(SETLEASTDIGITS_D); - assert(digit >= 0); - --digit; - bitposmaskB >>= 1; - } - - if (subexp-- > 0) // more subexpanses. - { - BRANCHB_STARTSUBEXP(SETLEASTDIGITS_D); - Pjp += SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)) + 1; - bitposmaskB = (1U << (cJU_BITSPERSUBEXPB - 1)); - goto BranchBNextSubexp; - } - -#else // JUDYNEXT - - ++digit; // skip initial digit. - bitposmaskB <<= 1; // note: BITMAPB_t. - -BranchBNextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskB) // more bits to check in subexp. - { - BRANCHB_CHECKBIT(CLEARLEASTDIGITS_D); - ++Pjp; // previous in subarray. - BRANCHB_CHECKJPFULL(CLEARLEASTDIGITS_D); - assert(digit < cJU_SUBEXPPERSTATE); - ++digit; - bitposmaskB <<= 1; // note: BITMAPB_t. - } - - if (++subexp < cJU_NUMSUBEXPB) // more subexpanses. - { - BRANCHB_STARTSUBEXP(CLEARLEASTDIGITS_D); - --Pjp; // pre-decrement. - bitposmaskB = 1; - goto BranchBNextSubexp; - } - -#endif // JUDYNEXT - -// BranchB secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_U2: CHECKDCD(2); SMPREPB2(SMBranchU); - case cJU_JPBRANCH_U3: CHECKDCD(3); SMPREPB3(SMBranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: CHECKDCD(4); SMPREPB4(SMBranchU); - case cJU_JPBRANCH_U5: CHECKDCD(5); SMPREPB5(SMBranchU); - case cJU_JPBRANCH_U6: CHECKDCD(6); SMPREPB6(SMBranchU); - case cJU_JPBRANCH_U7: CHECKDCD(7); SMPREPB7(SMBranchU); -#endif - case cJU_JPBRANCH_U: SMPREPBL(SMBranchU); - -// Common code (state-independent) for all cases of uncompressed branches: - -SMBranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - Pjp = (Pjbu->jbu_jp) + digit; - -// Absent JP = null JP for current digit in Index: - - if (JPNULL(JU_JPTYPE(Pjp))) RET_SUCCESS; - -// Non-full JP matches current digit in Index: -// -// Iterate to the subsidiary JP. - - if (! JPFULL(Pjp)) goto SMGetContinue; - -// BranchU primary dead end: -// -// Upon hitting a full JP in a BranchU for the next digit in Index, search -// sideways for a previous/next null or non-full JP. BRANCHU_CHECKJP() is -// shorthand for common code. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. - -#define BRANCHU_CHECKJP(OpIncDec,OpLeastDigits) \ - { \ - OpIncDec Pjp; \ - \ - if (JPNULL(JU_JPTYPE(Pjp))) \ - SET_AND_RETURN(OpLeastDigits, digit, digits) \ - \ - if (! JPFULL(Pjp)) \ - SET_AND_CONTINUE(OpLeastDigits, digit, digits) \ - } - -#ifdef JUDYPREV - while (digit-- > 0) - BRANCHU_CHECKJP(--, SETLEASTDIGITS_D); -#else - while (++digit < cJU_BRANCHUNUMJPS) - BRANCHU_CHECKJP(++, CLEARLEASTDIGITS_D); -#endif - -// BranchU secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for the -// previous/next empty index starting at Index. Primary leaf dead end is -// hidden within j__udySearchLeaf*Empty*(). In case of secondary leaf dead -// end, restart at the top of the tree. -// -// Note: Pword is the name known to GET*; think of it as Pjlw. - -#define SMLEAFL(cDigits,Func) \ - Pword = (PWord_t) P_JLW(Pjp->jp_Addr); \ - pop0 = JU_JPLEAF_POP0(Pjp); \ - Func(Pword, pop0) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKDCD(1); SMLEAFL(1, j__udySearchLeafEmpty1); -#endif - case cJU_JPLEAF2: CHECKDCD(2); SMLEAFL(2, j__udySearchLeafEmpty2); - case cJU_JPLEAF3: CHECKDCD(3); SMLEAFL(3, j__udySearchLeafEmpty3); - -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKDCD(4); SMLEAFL(4, j__udySearchLeafEmpty4); - case cJU_JPLEAF5: CHECKDCD(5); SMLEAFL(5, j__udySearchLeafEmpty5); - case cJU_JPLEAF6: CHECKDCD(6); SMLEAFL(6, j__udySearchLeafEmpty6); - case cJU_JPLEAF7: CHECKDCD(7); SMLEAFL(7, j__udySearchLeafEmpty7); -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for the -// previous/next empty index starting at Index. - - case cJU_JPLEAF_B1: - - CHECKDCD(1); - - Pjlb = P_JLB(Pjp->jp_Addr); - digit = JU_DIGITATSTATE(Index, 1); - subexp = digit / cJU_BITSPERSUBEXPL; - bitposmaskL = JU_BITPOSMASKL(digit); - assert(subexp < cJU_NUMSUBEXPL); // falls in expected range. - -// Absent index = no index matches current digit in Index: - -// if (! JU_BITMAPTESTL(Pjlb, digit)) // slower. - if (! (JU_JLB_BITMAP(Pjlb, subexp) & bitposmaskL)) // faster. - RET_SUCCESS; - -// LeafB1 primary dead end: -// -// Upon hitting a valid (non-empty) index in a LeafB1 for the last digit in -// Index, search sideways for a previous/next absent index, first in the -// current bitmap subexpanse, then in lower/higher subexpanses. -// LEAFB1_CHECKBIT() is shorthand for common code to handle one bit in one -// bitmap subexpanse. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. -// -// TBD: For speed, shift bitposmaskL instead of using JU_BITMAPTESTL or -// JU_BITPOSMASKL, but this shift has knowledge of bit order that really should -// be encapsulated in a header file. - -#define LEAFB1_CHECKBIT(OpLeastDigits) \ - if (! (JU_JLB_BITMAP(Pjlb, subexp) & bitposmaskL)) \ - SET_AND_RETURN(OpLeastDigits, digit, 1) - -#define LEAFB1_STARTSUBEXP(OpLeastDigits) \ - if (! JU_JLB_BITMAP(Pjlb, subexp)) /* empty subexp */ \ - SET_AND_RETURN(OpLeastDigits, digit, 1) - -#ifdef JUDYPREV - - --digit; // skip initial digit. - bitposmaskL >>= 1; // see TBD above. - -LeafB1NextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskL) // more bits to check in subexp. - { - LEAFB1_CHECKBIT(SETLEASTDIGITS_D); - assert(digit >= 0); - --digit; - bitposmaskL >>= 1; - } - - if (subexp-- > 0) // more subexpanses. - { - LEAFB1_STARTSUBEXP(SETLEASTDIGITS_D); - bitposmaskL = (1UL << (cJU_BITSPERSUBEXPL - 1)); - goto LeafB1NextSubexp; - } - -#else // JUDYNEXT - - ++digit; // skip initial digit. - bitposmaskL <<= 1; // note: BITMAPL_t. - -LeafB1NextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskL) // more bits to check in subexp. - { - LEAFB1_CHECKBIT(CLEARLEASTDIGITS_D); - assert(digit < cJU_SUBEXPPERSTATE); - ++digit; - bitposmaskL <<= 1; // note: BITMAPL_t. - } - - if (++subexp < cJU_NUMSUBEXPL) // more subexpanses. - { - LEAFB1_STARTSUBEXP(CLEARLEASTDIGITS_D); - bitposmaskL = 1; - goto LeafB1NextSubexp; - } - -#endif // JUDYNEXT - -// LeafB1 secondary dead end, no empty index: - - SMRESTART(1); - - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// If the Decode bytes do not match, Index is empty (without modification); -// otherwise restart. - - case cJ1_JPFULLPOPU1: - - CHECKDCD(1); - SMRESTART(1); -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: -// -// Pop1 = 1 Immediate JPs: -// -// If Index is not in the immediate JP, return success; otherwise check if -// there is an empty index below/above the immediate JPs index, and if so, -// return success with modified Index, else restart. -// -// Note: Doug says its fast enough to calculate the index size (digits) in -// the following; no need to set it separately for each case. - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - if (JU_JPDCDPOP0(Pjp) != JU_TRIMTODCDSIZE(Index)) RET_SUCCESS; - digits = JU_JPTYPE(Pjp) - cJU_JPIMMED_1_01 + 1; - LEAF_EDGE(JU_LEASTBYTES(JU_JPDCDPOP0(Pjp), digits), digits); - -// Immediate JPs with Pop1 > 1: - -#define IMM_MULTI(Func,BaseJPType) \ - JUDY1CODE(Pword = (PWord_t) (Pjp->jp_1Index);) \ - JUDYLCODE(Pword = (PWord_t) (Pjp->jp_LIndex);) \ - Func(Pword, JU_JPTYPE(Pjp) - (BaseJPType) + 1) - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - IMM_MULTI(j__udySearchLeafEmpty1, cJU_JPIMMED_1_02); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - IMM_MULTI(j__udySearchLeafEmpty2, cJU_JPIMMED_2_02); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - IMM_MULTI(j__udySearchLeafEmpty3, cJU_JPIMMED_3_02); -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: - case cJ1_JPIMMED_4_03: - IMM_MULTI(j__udySearchLeafEmpty4, cJ1_JPIMMED_4_02); - - case cJ1_JPIMMED_5_02: - case cJ1_JPIMMED_5_03: - IMM_MULTI(j__udySearchLeafEmpty5, cJ1_JPIMMED_5_02); - - case cJ1_JPIMMED_6_02: - IMM_MULTI(j__udySearchLeafEmpty6, cJ1_JPIMMED_6_02); - - case cJ1_JPIMMED_7_02: - IMM_MULTI(j__udySearchLeafEmpty7, cJ1_JPIMMED_7_02); -#endif - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: RET_CORRUPT; - - } // SMGet switch. - -} // Judy1PrevEmpty() / Judy1NextEmpty() / JudyLPrevEmpty() / JudyLNextEmpty() diff --git a/libjudy/src/JudyCommon/JudyPrintJP.c b/libjudy/src/JudyCommon/JudyPrintJP.c deleted file mode 100644 index bf5dd85478..0000000000 --- a/libjudy/src/JudyCommon/JudyPrintJP.c +++ /dev/null @@ -1,401 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.13 $ $Source: /judy/src/JudyCommon/JudyPrintJP.c $ -// -// JudyPrintJP() debugging/tracing function for Judy1 or JudyL code. -// The caller should #include this file, with its static function (replicated -// in each compilation unit), in another *.c file, and compile with one of -// -DJUDY1 or -DJUDYL. -// -// The caller can set j__udyIndex and/or j__udyPopulation non-zero to have -// those values reported, and also to control trace-enabling (see below). -// -// Tracing is disabled by default unless one or both of two env parameters is -// set (regardless of value). If either value is set but null or evaluates to -// zero, tracing is immediately enabled. To disable tracing until a particular -// j__udy*Index value is seen, set STARTINDEX= in the env. To -// disable it until a particular j__udy*Population value is seen, set -// STARTPOP= in the env. Once either condition is met, -// tracing "latches on". -// -// Example: -// -// STARTPOP=0 // immediate tracing. -// STARTINDEX=f35430a8 // not until one of these is met. -// STARTPOP=1000000 -// -// Note: Trace-enabling does nothing unless the caller sets the appropriate -// global variable non-zero. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#include // for getenv() and strtoul(). - - -// GLOBALS FROM CALLER: -// -// Note: This storage is declared once in each compilation unit that includes -// this file, but the linker should merge all cases into single locations, but -// ONLY if these are uninitialized, so ASSUME they are 0 to start. - -Word_t j__udyIndex; // current Index itself, optional from caller. -Word_t j__udyPopulation; // Indexes in array, optional from caller. - -// Other globals: - -static Word_t startindex = 0; // see usage below. -static Word_t startpop = 0; -static bool_t enabled = FALSE; // by default, unless env params set. - -// Shorthand for announcing JP addresses, Desc (in context), and JP types: -// -// Note: Width is at least one blank wider than any JP type name, and the line -// is left unfinished. -// -// Note: Use a format for address printing compatible with other tracing -// facilities; in particular, %x not %lx, to truncate the "noisy" high part on -// 64-bit systems. - -#define JPTYPE(Type) printf("0x%lx %s %-17s", (Word_t) Pjp, Desc, Type) - -// Shorthands for announcing expanse populations from DcdPopO fields: - -#define POP0 printf("Pop1 = 0 ") -#define POP1 printf("Pop1 = %ld ", (Word_t) ((JU_JPDCDPOP0(Pjp) & 0xff) + 1)) -#define POP2 printf("Pop1 = %ld ", (Word_t) ((JU_JPDCDPOP0(Pjp) & 0xffff) + 1)) -#define POP3 printf("Pop1 = %ld ", (Word_t) ((JU_JPDCDPOP0(Pjp) & 0xffffff) + 1)) -#ifdef JU_64BIT -#define POP4 printf("Pop1 = %ld ", (Word_t) ((JU_JPDCDPOP0(Pjp) & 0xffffffff) + 1)) -#define POP5 printf("Pop1 = %ld ", (Word_t) ((JU_JPDCDPOP0(Pjp) & 0xffffffffff) + 1)) -#define POP6 printf("Pop1 = %ld ", (Word_t) ((JU_JPDCDPOP0(Pjp) & 0xffffffffffff) + 1)) -#define POP7 printf("Pop1 = %ld ", (Word_t) ((JU_JPDCDPOP0(Pjp) & 0xffffffffffffff) + 1)) -#endif - -// Shorthands for announcing populations of Immeds: -// -// Note: Line up the small populations that often occur together, but beyond -// that, dont worry about it because populations can get arbitrarily large. - -#define POP_1 printf("Pop1 = 1 ") -#define POP_2 printf("Pop1 = 2 ") -#define POP_3 printf("Pop1 = 3 ") -#define POP_4 printf("Pop1 = 4 ") -#define POP_5 printf("Pop1 = 5 ") -#define POP_6 printf("Pop1 = 6 ") -#define POP_7 printf("Pop1 = 7 ") -#define POP_8 printf("Pop1 = 8 ") -#define POP_9 printf("Pop1 = 8 ") -#define POP_10 printf("Pop1 = 10 ") -#define POP_11 printf("Pop1 = 11 ") -#define POP_12 printf("Pop1 = 12 ") -#define POP_13 printf("Pop1 = 13 ") -#define POP_14 printf("Pop1 = 14 ") -#define POP_15 printf("Pop1 = 15 ") - -// Shorthands for other announcements: - -#define NUMJPSL printf("NumJPs = %d ", P_JBL(Pjp->jp_Addr)->jbl_NumJPs) -#define OOPS printf("-- OOPS, invalid Type\n"); exit(1) - -// This is harder to compute: - -#define NUMJPSB \ - { \ - Pjbb_t Pjbb = P_JBB(Pjp->jp_Addr); \ - Word_t subexp; \ - int numJPs = 0; \ - \ - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) \ - numJPs += j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp));\ - \ - printf("NumJPs = %d ", numJPs); \ - } - - -// **************************************************************************** -// J U D Y P R I N T J P -// -// Dump information about a JP, at least its address, type, population, and -// number of JPs, as appropriate. Error out upon any unexpected JP type. -// -// TBD: Dump more detailed information about the JP? - -FUNCTION static void JudyPrintJP( - Pjp_t Pjp, // JP to describe. - char * Desc, // brief description of caller, such as "i". - int Line) // callers source line number. -{ -static bool_t checked = FALSE; // set upon first entry and check for params. - char * value; // for getenv(). - - -// CHECK FOR EXTERNAL ENABLING: -// -// If a parameter is set, report the value, even if it is null or otherwise -// evaluates to zero, in which case enable tracing immediately; otherwise wait -// for the value to be hit. - -#define GETENV(Name,Value,Base) \ - if ((value = getenv (Name)) != (char *) NULL) \ - { \ - (Value) = strtoul (value, (char **) NULL, Base); \ - enabled |= ((Value) == 0); /* see above */ \ - \ - (void) printf ("JudyPrintJP(\"%s\"): $%s = %lu\n", \ - Desc, Name, Value); \ - } - - if (! checked) // only check once. - { - checked = TRUE; - - GETENV ("STARTINDEX", startindex, 16); - GETENV ("STARTPOP", startpop, 10); - - (void) printf ("JudyPrintJP(\"%s\"): Tracing present %s\n", Desc, - enabled ? "and immediately enabled" : - (startindex || startpop) ? - "but disabled until start condition met" : - "but not enabled by env parameter"); - } - - if (! enabled) // check repeatedly until latched enabled: - { - if (startindex && (startindex == j__udyIndex)) - { - (void) printf ("=== TRACING ENABLED (\"%s\"), " - "startindex = 0x%lx\n", Desc, startindex); - enabled = TRUE; - } - else if (startpop && (startpop == j__udyPopulation)) - { - (void) printf ("=== TRACING ENABLED (\"%s\"), " - "startpop = %lu\n", Desc, startpop); - enabled = TRUE; - } - else - { - return; // print nothing this time. - } - } - - -// SWITCH ON JP TYPE: - - switch (JU_JPTYPE(Pjp)) - { - -// Note: The following COULD be merged more tightly between Judy1 and JudyL, -// but we decided that the output should say cJ1*/cJL*, not cJU*, to be more -// specific. - -#ifdef JUDY1 - case cJ1_JPNULL1: JPTYPE("cJ1_JPNULL1"); POP0; break; - case cJ1_JPNULL2: JPTYPE("cJ1_JPNULL2"); POP0; break; - case cJ1_JPNULL3: JPTYPE("cJ1_JPNULL3"); POP0; break; -#ifdef JU_64BIT - case cJ1_JPNULL4: JPTYPE("cJ1_JPNULL4"); POP0; break; - case cJ1_JPNULL5: JPTYPE("cJ1_JPNULL5"); POP0; break; - case cJ1_JPNULL6: JPTYPE("cJ1_JPNULL6"); POP0; break; - case cJ1_JPNULL7: JPTYPE("cJ1_JPNULL7"); POP0; break; -#endif - - case cJ1_JPBRANCH_L2: JPTYPE("cJ1_JPBRANCH_L2"); POP2;NUMJPSL;break; - case cJ1_JPBRANCH_L3: JPTYPE("cJ1_JPBRANCH_L3"); POP3;NUMJPSL;break; -#ifdef JU_64BIT - case cJ1_JPBRANCH_L4: JPTYPE("cJ1_JPBRANCH_L4"); POP4;NUMJPSL;break; - case cJ1_JPBRANCH_L5: JPTYPE("cJ1_JPBRANCH_L5"); POP5;NUMJPSL;break; - case cJ1_JPBRANCH_L6: JPTYPE("cJ1_JPBRANCH_L6"); POP6;NUMJPSL;break; - case cJ1_JPBRANCH_L7: JPTYPE("cJ1_JPBRANCH_L7"); POP7;NUMJPSL;break; -#endif - case cJ1_JPBRANCH_L: JPTYPE("cJ1_JPBRANCH_L"); NUMJPSL;break; - - case cJ1_JPBRANCH_B2: JPTYPE("cJ1_JPBRANCH_B2"); POP2;NUMJPSB;break; - case cJ1_JPBRANCH_B3: JPTYPE("cJ1_JPBRANCH_B3"); POP3;NUMJPSB;break; -#ifdef JU_64BIT - case cJ1_JPBRANCH_B4: JPTYPE("cJ1_JPBRANCH_B4"); POP4;NUMJPSB;break; - case cJ1_JPBRANCH_B5: JPTYPE("cJ1_JPBRANCH_B5"); POP5;NUMJPSB;break; - case cJ1_JPBRANCH_B6: JPTYPE("cJ1_JPBRANCH_B6"); POP6;NUMJPSB;break; - case cJ1_JPBRANCH_B7: JPTYPE("cJ1_JPBRANCH_B7"); POP7;NUMJPSB;break; -#endif - case cJ1_JPBRANCH_B: JPTYPE("cJ1_JPBRANCH_B"); NUMJPSB;break; - - case cJ1_JPBRANCH_U2: JPTYPE("cJ1_JPBRANCH_U2"); POP2; break; - case cJ1_JPBRANCH_U3: JPTYPE("cJ1_JPBRANCH_U3"); POP3; break; -#ifdef JU_64BIT - case cJ1_JPBRANCH_U4: JPTYPE("cJ1_JPBRANCH_U4"); POP4; break; - case cJ1_JPBRANCH_U5: JPTYPE("cJ1_JPBRANCH_U5"); POP5; break; - case cJ1_JPBRANCH_U6: JPTYPE("cJ1_JPBRANCH_U6"); POP6; break; - case cJ1_JPBRANCH_U7: JPTYPE("cJ1_JPBRANCH_U7"); POP7; break; -#endif - case cJ1_JPBRANCH_U: JPTYPE("cJ1_JPBRANCH_U"); break; - -#ifndef JU_64BIT - case cJ1_JPLEAF1: JPTYPE("cJ1_JPLEAF1"); POP1; break; -#endif - case cJ1_JPLEAF2: JPTYPE("cJ1_JPLEAF2"); POP2; break; - case cJ1_JPLEAF3: JPTYPE("cJ1_JPLEAF3"); POP3; break; -#ifdef JU_64BIT - case cJ1_JPLEAF4: JPTYPE("cJ1_JPLEAF4"); POP4; break; - case cJ1_JPLEAF5: JPTYPE("cJ1_JPLEAF5"); POP5; break; - case cJ1_JPLEAF6: JPTYPE("cJ1_JPLEAF6"); POP6; break; - case cJ1_JPLEAF7: JPTYPE("cJ1_JPLEAF7"); POP7; break; -#endif - - case cJ1_JPLEAF_B1: JPTYPE("cJ1_JPLEAF_B1"); POP1; break; - case cJ1_JPFULLPOPU1: JPTYPE("cJ1_JPFULLPOPU1"); POP1; break; - - case cJ1_JPIMMED_1_01: JPTYPE("cJ1_JPIMMED_1_01"); POP_1; break; - case cJ1_JPIMMED_2_01: JPTYPE("cJ1_JPIMMED_2_01"); POP_1; break; - case cJ1_JPIMMED_3_01: JPTYPE("cJ1_JPIMMED_3_01"); POP_1; break; -#ifdef JU_64BIT - case cJ1_JPIMMED_4_01: JPTYPE("cJ1_JPIMMED_4_01"); POP_1; break; - case cJ1_JPIMMED_5_01: JPTYPE("cJ1_JPIMMED_5_01"); POP_1; break; - case cJ1_JPIMMED_6_01: JPTYPE("cJ1_JPIMMED_6_01"); POP_1; break; - case cJ1_JPIMMED_7_01: JPTYPE("cJ1_JPIMMED_7_01"); POP_1; break; -#endif - - case cJ1_JPIMMED_1_02: JPTYPE("cJ1_JPIMMED_1_02"); POP_2; break; - case cJ1_JPIMMED_1_03: JPTYPE("cJ1_JPIMMED_1_03"); POP_3; break; - case cJ1_JPIMMED_1_04: JPTYPE("cJ1_JPIMMED_1_04"); POP_4; break; - case cJ1_JPIMMED_1_05: JPTYPE("cJ1_JPIMMED_1_05"); POP_5; break; - case cJ1_JPIMMED_1_06: JPTYPE("cJ1_JPIMMED_1_06"); POP_6; break; - case cJ1_JPIMMED_1_07: JPTYPE("cJ1_JPIMMED_1_07"); POP_7; break; -#ifdef JU_64BIT - case cJ1_JPIMMED_1_08: JPTYPE("cJ1_JPIMMED_1_08"); POP_8; break; - case cJ1_JPIMMED_1_09: JPTYPE("cJ1_JPIMMED_1_09"); POP_9; break; - case cJ1_JPIMMED_1_10: JPTYPE("cJ1_JPIMMED_1_10"); POP_10; break; - case cJ1_JPIMMED_1_11: JPTYPE("cJ1_JPIMMED_1_11"); POP_11; break; - case cJ1_JPIMMED_1_12: JPTYPE("cJ1_JPIMMED_1_12"); POP_12; break; - case cJ1_JPIMMED_1_13: JPTYPE("cJ1_JPIMMED_1_13"); POP_13; break; - case cJ1_JPIMMED_1_14: JPTYPE("cJ1_JPIMMED_1_14"); POP_14; break; - case cJ1_JPIMMED_1_15: JPTYPE("cJ1_JPIMMED_1_15"); POP_15; break; -#endif - case cJ1_JPIMMED_2_02: JPTYPE("cJ1_JPIMMED_2_02"); POP_2; break; - case cJ1_JPIMMED_2_03: JPTYPE("cJ1_JPIMMED_2_03"); POP_3; break; -#ifdef JU_64BIT - case cJ1_JPIMMED_2_04: JPTYPE("cJ1_JPIMMED_2_04"); POP_4; break; - case cJ1_JPIMMED_2_05: JPTYPE("cJ1_JPIMMED_2_05"); POP_5; break; - case cJ1_JPIMMED_2_06: JPTYPE("cJ1_JPIMMED_2_06"); POP_6; break; - case cJ1_JPIMMED_2_07: JPTYPE("cJ1_JPIMMED_2_07"); POP_7; break; -#endif - - case cJ1_JPIMMED_3_02: JPTYPE("cJ1_JPIMMED_3_02"); POP_2; break; -#ifdef JU_64BIT - case cJ1_JPIMMED_3_03: JPTYPE("cJ1_JPIMMED_3_03"); POP_3; break; - case cJ1_JPIMMED_3_04: JPTYPE("cJ1_JPIMMED_3_04"); POP_4; break; - case cJ1_JPIMMED_3_05: JPTYPE("cJ1_JPIMMED_3_05"); POP_5; break; - case cJ1_JPIMMED_4_02: JPTYPE("cJ1_JPIMMED_4_02"); POP_2; break; - case cJ1_JPIMMED_4_03: JPTYPE("cJ1_JPIMMED_4_03"); POP_3; break; - case cJ1_JPIMMED_5_02: JPTYPE("cJ1_JPIMMED_5_02"); POP_2; break; - case cJ1_JPIMMED_5_03: JPTYPE("cJ1_JPIMMED_5_03"); POP_3; break; - case cJ1_JPIMMED_6_02: JPTYPE("cJ1_JPIMMED_6_02"); POP_2; break; - case cJ1_JPIMMED_7_02: JPTYPE("cJ1_JPIMMED_7_02"); POP_2; break; -#endif - case cJ1_JPIMMED_CAP: JPTYPE("cJ1_JPIMMED_CAP"); OOPS; - -#else // JUDYL =============================================================== - - case cJL_JPNULL1: JPTYPE("cJL_JPNULL1"); POP0; break; - case cJL_JPNULL2: JPTYPE("cJL_JPNULL2"); POP0; break; - case cJL_JPNULL3: JPTYPE("cJL_JPNULL3"); POP0; break; -#ifdef JU_64BIT - case cJL_JPNULL4: JPTYPE("cJL_JPNULL4"); POP0; break; - case cJL_JPNULL5: JPTYPE("cJL_JPNULL5"); POP0; break; - case cJL_JPNULL6: JPTYPE("cJL_JPNULL6"); POP0; break; - case cJL_JPNULL7: JPTYPE("cJL_JPNULL7"); POP0; break; -#endif - - case cJL_JPBRANCH_L2: JPTYPE("cJL_JPBRANCH_L2"); POP2;NUMJPSL;break; - case cJL_JPBRANCH_L3: JPTYPE("cJL_JPBRANCH_L3"); POP3;NUMJPSL;break; -#ifdef JU_64BIT - case cJL_JPBRANCH_L4: JPTYPE("cJL_JPBRANCH_L4"); POP4;NUMJPSL;break; - case cJL_JPBRANCH_L5: JPTYPE("cJL_JPBRANCH_L5"); POP5;NUMJPSL;break; - case cJL_JPBRANCH_L6: JPTYPE("cJL_JPBRANCH_L6"); POP6;NUMJPSL;break; - case cJL_JPBRANCH_L7: JPTYPE("cJL_JPBRANCH_L7"); POP7;NUMJPSL;break; -#endif - case cJL_JPBRANCH_L: JPTYPE("cJL_JPBRANCH_L"); NUMJPSL;break; - - case cJL_JPBRANCH_B2: JPTYPE("cJL_JPBRANCH_B2"); POP2;NUMJPSB;break; - case cJL_JPBRANCH_B3: JPTYPE("cJL_JPBRANCH_B3"); POP3;NUMJPSB;break; -#ifdef JU_64BIT - case cJL_JPBRANCH_B4: JPTYPE("cJL_JPBRANCH_B4"); POP4;NUMJPSB;break; - case cJL_JPBRANCH_B5: JPTYPE("cJL_JPBRANCH_B5"); POP5;NUMJPSB;break; - case cJL_JPBRANCH_B6: JPTYPE("cJL_JPBRANCH_B6"); POP6;NUMJPSB;break; - case cJL_JPBRANCH_B7: JPTYPE("cJL_JPBRANCH_B7"); POP7;NUMJPSB;break; -#endif - case cJL_JPBRANCH_B: JPTYPE("cJL_JPBRANCH_B"); NUMJPSB;break; - - case cJL_JPBRANCH_U2: JPTYPE("cJL_JPBRANCH_U2"); POP2; break; - case cJL_JPBRANCH_U3: JPTYPE("cJL_JPBRANCH_U3"); POP3; break; -#ifdef JU_64BIT - case cJL_JPBRANCH_U4: JPTYPE("cJL_JPBRANCH_U4"); POP4; break; - case cJL_JPBRANCH_U5: JPTYPE("cJL_JPBRANCH_U5"); POP5; break; - case cJL_JPBRANCH_U6: JPTYPE("cJL_JPBRANCH_U6"); POP6; break; - case cJL_JPBRANCH_U7: JPTYPE("cJL_JPBRANCH_U7"); POP7; break; -#endif - case cJL_JPBRANCH_U: JPTYPE("cJL_JPBRANCH_U"); break; - - case cJL_JPLEAF1: JPTYPE("cJL_JPLEAF1"); POP1; break; - case cJL_JPLEAF2: JPTYPE("cJL_JPLEAF2"); POP2; break; - case cJL_JPLEAF3: JPTYPE("cJL_JPLEAF3"); POP3; break; -#ifdef JU_64BIT - case cJL_JPLEAF4: JPTYPE("cJL_JPLEAF4"); POP4; break; - case cJL_JPLEAF5: JPTYPE("cJL_JPLEAF5"); POP5; break; - case cJL_JPLEAF6: JPTYPE("cJL_JPLEAF6"); POP6; break; - case cJL_JPLEAF7: JPTYPE("cJL_JPLEAF7"); POP7; break; -#endif - - case cJL_JPLEAF_B1: JPTYPE("cJL_JPLEAF_B1"); POP1; break; - - case cJL_JPIMMED_1_01: JPTYPE("cJL_JPIMMED_1_01"); POP_1; break; - case cJL_JPIMMED_2_01: JPTYPE("cJL_JPIMMED_2_01"); POP_1; break; - case cJL_JPIMMED_3_01: JPTYPE("cJL_JPIMMED_3_01"); POP_1; break; -#ifdef JU_64BIT - case cJL_JPIMMED_4_01: JPTYPE("cJL_JPIMMED_4_01"); POP_1; break; - case cJL_JPIMMED_5_01: JPTYPE("cJL_JPIMMED_5_01"); POP_1; break; - case cJL_JPIMMED_6_01: JPTYPE("cJL_JPIMMED_6_01"); POP_1; break; - case cJL_JPIMMED_7_01: JPTYPE("cJL_JPIMMED_7_01"); POP_1; break; -#endif - - case cJL_JPIMMED_1_02: JPTYPE("cJL_JPIMMED_1_02"); POP_2; break; - case cJL_JPIMMED_1_03: JPTYPE("cJL_JPIMMED_1_03"); POP_3; break; -#ifdef JU_64BIT - case cJL_JPIMMED_1_04: JPTYPE("cJL_JPIMMED_1_04"); POP_4; break; - case cJL_JPIMMED_1_05: JPTYPE("cJL_JPIMMED_1_05"); POP_5; break; - case cJL_JPIMMED_1_06: JPTYPE("cJL_JPIMMED_1_06"); POP_6; break; - case cJL_JPIMMED_1_07: JPTYPE("cJL_JPIMMED_1_07"); POP_7; break; - case cJL_JPIMMED_2_02: JPTYPE("cJL_JPIMMED_2_02"); POP_2; break; - case cJL_JPIMMED_2_03: JPTYPE("cJL_JPIMMED_2_03"); POP_3; break; - case cJL_JPIMMED_3_02: JPTYPE("cJL_JPIMMED_3_02"); POP_2; break; -#endif - case cJL_JPIMMED_CAP: JPTYPE("cJL_JPIMMED_CAP"); OOPS; - -#endif // JUDYL - - default: printf("Unknown Type = %d", JU_JPTYPE(Pjp)); OOPS; - } - - if (j__udyIndex) printf("Index = 0x%lx", j__udyIndex); - if (j__udyPopulation) printf("Pop = %lu", j__udyPopulation); - - printf("line = %d\n", Line); - -} // JudyPrintJP() diff --git a/libjudy/src/JudyCommon/JudyPrivate.h b/libjudy/src/JudyCommon/JudyPrivate.h deleted file mode 100644 index 350631f01c..0000000000 --- a/libjudy/src/JudyCommon/JudyPrivate.h +++ /dev/null @@ -1,1613 +0,0 @@ -#ifndef _JUDYPRIVATE_INCLUDED -#define _JUDYPRIVATE_INCLUDED -// _________________ -// -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.77 $ $Source: /judy/src/JudyCommon/JudyPrivate.h $ -// -// Header file for all Judy sources, for global but private (non-exported) -// declarations. - -#include "Judy.h" - -// **************************************************************************** -// A VERY BRIEF EXPLANATION OF A JUDY ARRAY -// -// A Judy array is, effectively, a digital tree (or Trie) with 256 element -// branches (nodes), and with "compression tricks" applied to low-population -// branches or leaves to save a lot of memory at the cost of relatively little -// CPU time or cache fills. -// -// In the actual implementation, a Judy array is level-less, and traversing the -// "tree" actually means following the states in a state machine (SM) as -// directed by the Index. A Judy array is referred to here as an "SM", rather -// than as a "tree"; having "states", rather than "levels". -// -// Each branch or leaf in the SM decodes a portion ("digit") of the original -// Index; with 256-way branches there are 8 bits per digit. There are 3 kinds -// of branches, called: Linear, Bitmap and Uncompressed, of which the first 2 -// are compressed to contain no NULL entries. -// -// An Uncompressed branch has a 1.0 cache line fill cost to decode 8 bits of -// (digit, part of an Index), but it might contain many NULL entries, and is -// therefore inefficient with memory if lightly populated. -// -// A Linear branch has a ~1.75 cache line fill cost when at maximum population. -// A Bitmap branch has ~2.0 cache line fills. Linear and Bitmap branches are -// converted to Uncompressed branches when the additional memory can be -// amortized with larger populations. Higher-state branches have higher -// priority to be converted. -// -// Linear branches can hold 28 elements (based on detailed analysis) -- thus 28 -// expanses. A Linear branch is converted to a Bitmap branch when the 29th -// expanse is required. -// -// A Bitmap branch could hold 256 expanses, but is forced to convert to an -// Uncompressed branch when 185 expanses are required. Hopefully, it is -// converted before that because of population growth (again, based on detailed -// analysis and heuristics in the code). -// -// A path through the SM terminates to a leaf when the Index (or key) -// population in the expanse below a pointer will fit into 1 or 2 cache lines -// (~31..255 Indexes). A maximum-population Leaf has ~1.5 cache line fill -// cost. -// -// Leaves are sorted arrays of Indexes, where the Index Sizes (IS) are: 0, 1, -// 8, 16, 24, 32, [40, 48, 56, 64] bits. The IS depends on the "density" -// (population/expanse) of the values in the Leaf. Zero bits are possible if -// population == expanse in the SM (that is, a full small expanse). -// -// Elements of a branches are called Judy Pointers (JPs). Each JP object -// points to the next object in the SM, plus, a JP can decode an additional -// 2[6] bytes of an Index, but at the cost of "narrowing" the expanse -// represented by the next object in the SM. A "narrow" JP (one which has -// decode bytes/digits) is a way of skipping states in the SM. -// -// Although counterintuitive, we think a Judy SM is optimal when the Leaves are -// stored at MINIMUM compression (narrowing, or use of Decode bytes). If more -// aggressive compression was used, decompression of a leaf be required to -// insert an index. Additional compression would save a little memory but not -// help performance significantly. - - -#ifdef A_PICTURE_IS_WORTH_1000_WORDS -******************************************************************************* - -JUDY 32-BIT STATE MACHINE (SM) EXAMPLE, FOR INDEX = 0x02040103 - -The Index used in this example is purposely chosen to allow small, simple -examples below; each 1-byte "digit" from the Index has a small numeric value -that fits in one column. In the drawing below: - - JRP == Judy Root Pointer; - - C == 1 byte of a 1..3 byte Population (count of Indexes) below this - pointer. Since this is shared with the Decode field, the combined - sizes must be 3[7], that is, 1 word less 1 byte for the JP Type. - - The 1-byte field jp_Type is represented as: - - 1..3 == Number of bytes in the population (Pop0) word of the Branch or Leaf - below the pointer (note: 1..7 on 64-bit); indicates: - - number of bytes in Decode field == 3 - this number; - - number of bytes remaining to decode. - Note: The maximum is 3, not 4, because the 1st byte of the Index is - always decoded digitally in the top branch. - -B- == JP points to a Branch (there are many kinds of Branches). - -L- == JP points to a Leaf (there are many kinds of Leaves). - - (2) == Digit of Index decoded by position offset in branch (really - 0..0xff). - - 4* == Digit of Index necessary for decoding a "narrow" pointer, in a - Decode field; replaces 1 missing branch (really 0..0xff). - - 4+ == Digit of Index NOT necessary for decoding a "narrow" pointer, but - used for fast traversal of the SM by Judy1Test() and JudyLGet() - (see the code) (really 0..0xff). - - 0 == Byte in a JPs Pop0 field that is always ignored, because a leaf - can never contain more than 256 Indexes (Pop0 <= 255). - - +----- == A Branch or Leaf; drawn open-ended to remind you that it could - | have up to 256 columns. - +----- - - | - | == Pointer to next Branch or Leaf. - V - - | - O == A state is skipped by using a "narrow" pointer. - | - - < 1 > == Digit (Index) shown as an example is not necessarily in the - position shown; is sorted in order with neighbor Indexes. - (Really 0..0xff.) - -Note that this example shows every possibly topology to reach a leaf in a -32-bit Judy SM, although this is a very subtle point! - - STATE or` - LEVEL - +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ - |RJP| |RJP| |RJP| |RJP| |RJP| |RJP| |RJP| |RJP| - L---+ B---+ B---+ B---+ B---+ B---+ B---+ B---+ - | | | | | | | | - | | | | | | | | - V V (2) V (2) V (2) V (2) V (2) V (2) V (2) - +------ +------ +------ +------ +------ +------ +------ +------ -Four |< 2 > | 0 | 4* | C | 4* | 4* | C | C -byte |< 4 > | 0 | 0 | C | 1* | C | C | C 4 -Index|< 1 > | C | C | C | C | C | C | C -Leaf |< 3 > | 3 | 2 | 3 | 1 | 2 | 3 | 3 - +------ +--L--- +--L--- +--B--- +--L--- +--B--- +--B--- +--B--- - | | | | | | | - / | / | | / / - / | / | | / / - | | | | | | | - V | V (4) | | V (4) V (4) - +------ | +------ | | +------ +------ - Three |< 4 > | | 4+ | | | 4+ | 4+ - byte Index|< 1 > O | 0 O O | 1* | C 3 - Leaf |< 3 > | | C | | | C | C - +------ | | 2 | | | 1 | 2 - / +----L- | | +----L- +----B- - / | | | | | - | / | / / / - | / | / / / - | / | | / / - | / | | / / - | | | | | | - V V | V(1) | V(1) - +------ +------ | +------ | +------ - Two byte |< 1 > |< 1 > | | 4+ | | 4+ - Index Leaf |< 3 > |< 3 > O | 1+ O | 1+ 2 - +------ +------ / | C | | C - / | 1 | | 1 - | +-L---- | +-L---- - | | | | - | / | / - | | | | - V V V V - +------ +------ +------ +------ - One byte Index Leaf |< 3 > |< 3 > |< 3 > |< 3 > 1 - +------ +------ +------ +------ - - -#endif // A_PICTURE_IS_WORTH_1000_WORDS - - -// **************************************************************************** -// MISCELLANEOUS GLOBALS: -// -// PLATFORM-SPECIFIC CONVENIENCE MACROS: -// -// These are derived from context (set by cc or in system header files) or -// based on JU_ macros from make_includes/platform.*.mk. We decided -// on 011018 that any macro reliably derivable from context (cc or headers) for -// ALL platforms supported by Judy is based on that derivation, but ANY -// exception means to stop using the external macro completely and derive from -// JU_ instead. - -// Other miscellaneous stuff: - -#ifndef _BOOL_T -#define _BOOL_T -typedef int bool_t; -#endif - -#define FUNCTION // null; easy to find functions. - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifdef TRACE // turn on all other tracing in the code: -#define TRACEJP 1 // JP traversals in JudyIns.c and JudyDel.c. -#define TRACEJPR 1 // JP traversals in retrieval code, JudyGet.c. -#define TRACECF 1 // cache fills in JudyGet.c. -#define TRACEMI 1 // malloc calls in JudyMallocIF.c. -#define TRACEMF 1 // malloc calls at a lower level in JudyMalloc.c. -#endif - - -// SUPPORT FOR DEBUG-ONLY CODE: -// -// By convention, use -DDEBUG to enable both debug-only code AND assertions in -// the Judy sources. -// -// Invert the sense of assertions, so they are off unless explicitly requested, -// in a uniform way. -// -// Note: It is NOT appropriate to put this in Judy.h; it would mess up -// application code. - -#ifndef DEBUG -#define NDEBUG 1 // must be 1 for "#if". -#endif - -// Shorthand notations to avoid #ifdefs for single-line conditional statements: -// -// Warning: These cannot be used around compiler directives, such as -// "#include", nor in the case where Code contains a comma other than nested -// within parentheses or quotes. - -#ifndef DEBUG -#define DBGCODE(Code) // null. -#else -#define DBGCODE(Code) Code -#endif - -#ifdef JUDY1 -#define JUDY1CODE(Code) Code -#define JUDYLCODE(Code) // null. -#endif - -#ifdef JUDYL -#define JUDYLCODE(Code) Code -#define JUDY1CODE(Code) // null. -#endif - -#include - -// **************************************************************************** -// FUNDAMENTAL CONSTANTS FOR MACHINE -// **************************************************************************** - -// Machine (CPU) cache line size: -// -// NOTE: A leaf size of 2 cache lines maximum is the target (optimal) for -// Judy. Its hard to obtain a machines cache line size at compile time, but -// if the machine has an unexpected cache line size, its not devastating if -// the following constants end up causing leaves that are 1 cache line in size, -// or even 4 cache lines in size. The assumed 32-bit system has 16-word = -// 64-byte cache lines, and the assumed 64-bit system has 16-word = 128-byte -// cache lines. - -#ifdef JU_64BIT -#define cJU_BYTESPERCL 128 // cache line size in bytes. -#else -#define cJU_BYTESPERCL 64 // cache line size in bytes. -#endif - -// Bits Per Byte: - -#define cJU_BITSPERBYTE 0x8 - -// Bytes Per Word and Bits Per Word, latter assuming sizeof(byte) is 8 bits: -// -// Expect 32 [64] bits per word. - -#define cJU_BYTESPERWORD (sizeof(Word_t)) -#define cJU_BITSPERWORD (sizeof(Word_t) * cJU_BITSPERBYTE) - -#define JU_BYTESTOWORDS(BYTES) \ - (((BYTES) + cJU_BYTESPERWORD - 1) / cJU_BYTESPERWORD) - -// A word that is all-ones, normally equal to -1UL, but safer with ~0: - -#define cJU_ALLONES (~0UL) - -// Note, these are forward references, but thats OK: - -#define cJU_FULLBITMAPB ((BITMAPB_t) cJU_ALLONES) -#define cJU_FULLBITMAPL ((BITMAPL_t) cJU_ALLONES) - - -// **************************************************************************** -// MISCELLANEOUS JUDY-SPECIFIC DECLARATIONS -// **************************************************************************** - -// ROOT STATE: -// -// State at the start of the Judy SM, based on 1 byte decoded per state; equal -// to the number of bytes per Index to decode. - -#define cJU_ROOTSTATE (sizeof(Word_t)) - - -// SUBEXPANSES PER STATE: -// -// Number of subexpanses per state traversed, which is the number of JPs in a -// branch (actual or theoretical) and the number of bits in a bitmap. - -#define cJU_SUBEXPPERSTATE 256 - - -// LEAF AND VALUE POINTERS: -// -// Some other basic object types are in declared in JudyPrivateBranch.h -// (Pjbl_t, Pjbb_t, Pjbu_t, Pjp_t) or are Judy1/L-specific (Pjlb_t). The -// few remaining types are declared below. -// -// Note: Leaf pointers are cast to different-sized objects depending on the -// leafs level, but are at least addresses (not just numbers), so use void * -// (Pvoid_t), not PWord_t or Word_t for them, except use Pjlw_t for whole-word -// (top-level, root-level) leaves. Value areas, however, are always whole -// words. -// -// Furthermore, use Pjll_t only for generic leaf pointers (for various size -// LeafLs). Use Pjlw_t for LeafWs. Use Pleaf (with type uint8_t *, uint16_t -// *, etc) when the leaf index size is known. - -typedef PWord_t Pjlw_t; // pointer to root-level leaf (whole-word indexes). -typedef Pvoid_t Pjll_t; // pointer to lower-level linear leaf. - -#ifdef JUDYL -typedef PWord_t Pjv_t; // pointer to JudyL value area. -#endif - - -// POINTER PREPARATION MACROS: -// -// These macros are used to strip malloc-namespace-type bits from a pointer + -// malloc-type word (which references any Judy mallocd object that might be -// obtained from other than a direct call of malloc()), prior to dereferencing -// the pointer as an address. The malloc-type bits allow Judy mallocd objects -// to come from different "malloc() namespaces". -// -// (root pointer) (JRP, see above) -// jp.jp_Addr generic pointer to next-level node, except when used -// as a JudyL Immed01 value area -// JU_JBB_PJP macro hides jbbs_Pjp (pointer to JP subarray) -// JL_JLB_PVALUE macro hides jLlbs_PValue (pointer to value subarray) -// -// When setting one of these fields or passing an address to j__udyFree*(), the -// "raw" memory address is used; otherwise the memory address must be passed -// through one of the macros below before its dereferenced. -// -// Note: After much study, the typecasts below appear in the macros rather -// than at the point of use, which is both simpler and allows the compiler to -// do type-checking. - - -#define P_JLW( ADDR) ((Pjlw_t) (ADDR)) // root leaf. -#define P_JPM( ADDR) ((Pjpm_t) (ADDR)) // root JPM. -#define P_JBL( ADDR) ((Pjbl_t) (ADDR)) // BranchL. -#define P_JBB( ADDR) ((Pjbb_t) (ADDR)) // BranchB. -#define P_JBU( ADDR) ((Pjbu_t) (ADDR)) // BranchU. -#define P_JLL( ADDR) ((Pjll_t) (ADDR)) // LeafL. -#define P_JLB( ADDR) ((Pjlb_t) (ADDR)) // LeafB1. -#define P_JP( ADDR) ((Pjp_t) (ADDR)) // JP. - -#ifdef JUDYL -#define P_JV( ADDR) ((Pjv_t) (ADDR)) // &value. -#endif - - -// LEAST BYTES: -// -// Mask for least bytes of a word, and a macro to perform this mask on an -// Index. -// -// Note: This macro has been problematic in the past to get right and to make -// portable. Its not OK on all systems to shift by the full word size. This -// macro should allow shifting by 1..N bytes, where N is the word size, but -// should produce a compiler warning if the macro is called with Bytes == 0. -// -// Warning: JU_LEASTBYTESMASK() is not a constant macro unless Bytes is a -// constant; otherwise it is a variable shift, which is expensive on some -// processors. - -#define JU_LEASTBYTESMASK(BYTES) \ - ((0x100UL << (cJU_BITSPERBYTE * ((BYTES) - 1))) - 1) - -#define JU_LEASTBYTES(INDEX,BYTES) ((INDEX) & JU_LEASTBYTESMASK(BYTES)) - - -// BITS IN EACH BITMAP SUBEXPANSE FOR BITMAP BRANCH AND LEAF: -// -// The bits per bitmap subexpanse times the number of subexpanses equals a -// constant (cJU_SUBEXPPERSTATE). You can also think of this as a compile-time -// choice of "aspect ratio" for bitmap branches and leaves (which can be set -// independently for each). -// -// A default aspect ratio is hardwired here if not overridden at compile time, -// such as by "EXTCCOPTS=-DBITMAP_BRANCH16x16 make". - -#if (! (defined(BITMAP_BRANCH8x32) || defined(BITMAP_BRANCH16x16) || defined(BITMAP_BRANCH32x8))) -#define BITMAP_BRANCH32x8 1 // 32 bits per subexpanse, 8 subexpanses. -#endif - -#ifdef BITMAP_BRANCH8x32 -#define BITMAPB_t uint8_t -#endif - -#ifdef BITMAP_BRANCH16x16 -#define BITMAPB_t uint16_t -#endif - -#ifdef BITMAP_BRANCH32x8 -#define BITMAPB_t uint32_t -#endif - -// Note: For bitmap leaves, BITMAP_LEAF64x4 is only valid for 64 bit: -// -// Note: Choice of aspect ratio mostly matters for JudyL bitmap leaves. For -// Judy1 the choice doesnt matter much -- the code generated for different -// BITMAP_LEAF* values choices varies, but correctness and performance are the -// same. - -#ifndef JU_64BIT - -#if (! (defined(BITMAP_LEAF8x32) || defined(BITMAP_LEAF16x16) || defined(BITMAP_LEAF32x8))) -#define BITMAP_LEAF32x8 // 32 bits per subexpanse, 8 subexpanses. -#endif - -#else // 32BIT - -#if (! (defined(BITMAP_LEAF8x32) || defined(BITMAP_LEAF16x16) || defined(BITMAP_LEAF32x8) || defined(BITMAP_LEAF64x4))) -#define BITMAP_LEAF64x4 // 64 bits per subexpanse, 4 subexpanses. - -#endif -#endif // JU_64BIT - -#ifdef BITMAP_LEAF8x32 -#define BITMAPL_t uint8_t -#endif - -#ifdef BITMAP_LEAF16x16 -#define BITMAPL_t uint16_t -#endif - -#ifdef BITMAP_LEAF32x8 -#define BITMAPL_t uint32_t -#endif - -#ifdef BITMAP_LEAF64x4 -#define BITMAPL_t uint64_t -#endif - - -// EXPORTED DATA AND FUNCTIONS: - -#ifdef JUDY1 -extern const uint8_t j__1_BranchBJPPopToWords[]; -#endif - -#ifdef JUDYL -extern const uint8_t j__L_BranchBJPPopToWords[]; -#endif - -// Fast LeafL search routine used for inlined code: - -#if (! defined(SEARCH_BINARY)) || (! defined(SEARCH_LINEAR)) -// default a binary search leaf method -#define SEARCH_BINARY 1 -//#define SEARCH_LINEAR 1 -#endif - -#ifdef SEARCH_LINEAR - -#define SEARCHLEAFNATIVE(LEAFTYPE,ADDR,POP1,INDEX) \ - LEAFTYPE *P_leaf = (LEAFTYPE *)(ADDR); \ - LEAFTYPE I_ndex = (INDEX); /* with masking */ \ - if (I_ndex > P_leaf[(POP1) - 1]) return(~(POP1)); \ - while(I_ndex > *P_leaf) P_leaf++; \ - if (I_ndex == *P_leaf) return(P_leaf - (LEAFTYPE *)(ADDR)); \ - return(~(P_leaf - (LEAFTYPE *)(ADDR))); - - -#define SEARCHLEAFNONNAT(ADDR,POP1,INDEX,LFBTS,COPYINDEX) \ -{ \ - uint8_t *P_leaf, *P_leafEnd; \ - Word_t i_ndex; \ - Word_t I_ndex = JU_LEASTBYTES((INDEX), (LFBTS)); \ - Word_t p_op1; \ - \ - P_leaf = (uint8_t *)(ADDR); \ - P_leafEnd = P_leaf + ((POP1) * (LFBTS)); \ - \ - do { \ - JU_COPY3_PINDEX_TO_LONG(i_ndex, P_leaf); \ - if (I_ndex <= i_ndex) break; \ - P_leaf += (LFBTS); \ - } while (P_leaf < P_leafEnd); \ - \ - p_op1 = (P_leaf - (uint8_t *) (ADDR)) / (LFBTS); \ - if (I_ndex == i_ndex) return(p_op1); \ - return(~p_op1); \ -} -#endif // SEARCH_LINEAR - -#ifdef SEARCH_BINARY - -#define SEARCHLEAFNATIVE(LEAFTYPE,ADDR,POP1,INDEX) \ - LEAFTYPE *P_leaf = (LEAFTYPE *)(ADDR); \ - LEAFTYPE I_ndex = (LEAFTYPE)INDEX; /* truncate hi bits */ \ - Word_t l_ow = cJU_ALLONES; \ - Word_t m_id; \ - Word_t h_igh = POP1; \ - \ - while ((h_igh - l_ow) > 1UL) \ - { \ - m_id = (h_igh + l_ow) / 2; \ - if (P_leaf[m_id] > I_ndex) \ - h_igh = m_id; \ - else \ - l_ow = m_id; \ - } \ - if (l_ow == cJU_ALLONES || P_leaf[l_ow] != I_ndex) \ - return(~h_igh); \ - return(l_ow) - - -#define SEARCHLEAFNONNAT(ADDR,POP1,INDEX,LFBTS,COPYINDEX) \ - uint8_t *P_leaf = (uint8_t *)(ADDR); \ - Word_t l_ow = cJU_ALLONES; \ - Word_t m_id; \ - Word_t h_igh = POP1; \ - Word_t I_ndex = JU_LEASTBYTES((INDEX), (LFBTS)); \ - Word_t i_ndex; \ - \ - I_ndex = JU_LEASTBYTES((INDEX), (LFBTS)); \ - \ - while ((h_igh - l_ow) > 1UL) \ - { \ - m_id = (h_igh + l_ow) / 2; \ - COPYINDEX(i_ndex, &P_leaf[m_id * (LFBTS)]); \ - if (i_ndex > I_ndex) \ - h_igh = m_id; \ - else \ - l_ow = m_id; \ - } \ - if (l_ow == cJU_ALLONES) return(~h_igh); \ - \ - COPYINDEX(i_ndex, &P_leaf[l_ow * (LFBTS)]); \ - if (i_ndex != I_ndex) return(~h_igh); \ - return(l_ow) - -#endif // SEARCH_BINARY - -// Fast way to count bits set in 8..32[64]-bit int: -// -// For performance, j__udyCountBits*() are written to take advantage of -// platform-specific features where available. -// - -#ifdef JU_NOINLINE - -extern BITMAPB_t j__udyCountBitsB(BITMAPB_t word); -extern BITMAPL_t j__udyCountBitsL(BITMAPL_t word); - -// Compiler supports inline - -#elif defined(JU_HPUX_IPF) - -#define j__udyCountBitsB(WORD) _Asm_popcnt(WORD) -#define j__udyCountBitsL(WORD) _Asm_popcnt(WORD) - -#elif defined(JU_LINUX_IPF) - -static inline BITMAPB_t j__udyCountBitsB(BITMAPB_t word) -{ - BITMAPB_t result; - __asm__ ("popcnt %0=%1" : "=r" (result) : "r" (word)); - return(result); -} - -static inline BITMAPL_t j__udyCountBitsL(BITMAPL_t word) -{ - BITMAPL_t result; - __asm__ ("popcnt %0=%1" : "=r" (result) : "r" (word)); - return(result); -} - - -#else // No instructions available, use inline code - -// **************************************************************************** -// __ J U D Y C O U N T B I T S B -// -// Return the number of bits set in "Word", for a bitmap branch. -// -// Note: Bitmap branches have maximum bitmap size = 32 bits. - -#ifdef JU_WIN -static __inline BITMAPB_t j__udyCountBitsB(BITMAPB_t word) -#else -static inline BITMAPB_t j__udyCountBitsB(BITMAPB_t word) -#endif -{ - word = (word & 0x55555555) + ((word & 0xAAAAAAAA) >> 1); - word = (word & 0x33333333) + ((word & 0xCCCCCCCC) >> 2); - word = (word & 0x0F0F0F0F) + ((word & 0xF0F0F0F0) >> 4); // >= 8 bits. -#if defined(BITMAP_BRANCH16x16) || defined(BITMAP_BRANCH32x8) - word = (word & 0x00FF00FF) + ((word & 0xFF00FF00) >> 8); // >= 16 bits. -#endif - -#ifdef BITMAP_BRANCH32x8 - word = (word & 0x0000FFFF) + ((word & 0xFFFF0000) >> 16); // >= 32 bits. -#endif - return(word); - -} // j__udyCountBitsB() - - -// **************************************************************************** -// __ J U D Y C O U N T B I T S L -// -// Return the number of bits set in "Word", for a bitmap leaf. -// -// Note: Bitmap branches have maximum bitmap size = 32 bits. - -// Note: Need both 32-bit and 64-bit versions of j__udyCountBitsL() because -// bitmap leaves can have 64-bit bitmaps. - -#ifdef JU_WIN -static __inline BITMAPL_t j__udyCountBitsL(BITMAPL_t word) -#else -static inline BITMAPL_t j__udyCountBitsL(BITMAPL_t word) -#endif -{ -#ifndef JU_64BIT - - word = (word & 0x55555555) + ((word & 0xAAAAAAAA) >> 1); - word = (word & 0x33333333) + ((word & 0xCCCCCCCC) >> 2); - word = (word & 0x0F0F0F0F) + ((word & 0xF0F0F0F0) >> 4); // >= 8 bits. -#if defined(BITMAP_LEAF16x16) || defined(BITMAP_LEAF32x8) - word = (word & 0x00FF00FF) + ((word & 0xFF00FF00) >> 8); // >= 16 bits. -#endif -#ifdef BITMAP_LEAF32x8 - word = (word & 0x0000FFFF) + ((word & 0xFFFF0000) >> 16); // >= 32 bits. -#endif - -#else // JU_64BIT - - word = (word & 0x5555555555555555) + ((word & 0xAAAAAAAAAAAAAAAA) >> 1); - word = (word & 0x3333333333333333) + ((word & 0xCCCCCCCCCCCCCCCC) >> 2); - word = (word & 0x0F0F0F0F0F0F0F0F) + ((word & 0xF0F0F0F0F0F0F0F0) >> 4); -#if defined(BITMAP_LEAF16x16) || defined(BITMAP_LEAF32x8) || defined(BITMAP_LEAF64x4) - word = (word & 0x00FF00FF00FF00FF) + ((word & 0xFF00FF00FF00FF00) >> 8); -#endif -#if defined(BITMAP_LEAF32x8) || defined(BITMAP_LEAF64x4) - word = (word & 0x0000FFFF0000FFFF) + ((word & 0xFFFF0000FFFF0000) >>16); -#endif -#ifdef BITMAP_LEAF64x4 - word = (word & 0x00000000FFFFFFFF) + ((word & 0xFFFFFFFF00000000) >>32); -#endif -#endif // JU_64BIT - - return(word); - -} // j__udyCountBitsL() - -#endif // Compiler supports inline - -// GET POP0: -// -// Get from jp_DcdPopO the Pop0 for various JP Types. -// -// Notes: -// -// - Different macros require different parameters... -// -// - There are no simple macros for cJU_BRANCH* Types because their -// populations must be added up and dont reside in an already-calculated -// place. (TBD: This is no longer true, now its in the JPM.) -// -// - cJU_JPIMM_POP0() is not defined because it would be redundant because the -// Pop1 is already encoded in each enum name. -// -// - A linear or bitmap leaf Pop0 cannot exceed cJU_SUBEXPPERSTATE - 1 (Pop0 = -// 0..255), so use a simpler, faster macro for it than for other JP Types. -// -// - Avoid any complex calculations that would slow down the compiled code. -// Assume these macros are only called for the appropriate JP Types. -// Unfortunately theres no way to trigger an assertion here if the JP type -// is incorrect for the macro, because these are merely expressions, not -// statements. - -#define JU_LEAFW_POP0(JRP) (*P_JLW(JRP)) -#define cJU_JPFULLPOPU1_POP0 (cJU_SUBEXPPERSTATE - 1) - -// GET JP Type: -// Since bit fields greater than 32 bits are not supported in some compilers -// the jp_DcdPopO field is expanded to include the jp_Type in the high 8 bits -// of the Word_t. -// First the read macro: - -#define JU_JPTYPE(PJP) ((PJP)->jp_Type) - -#define JU_JPLEAF_POP0(PJP) ((PJP)->jp_DcdP0[sizeof(Word_t) - 2]) - -#ifdef JU_64BIT - -#define JU_JPDCDPOP0(PJP) \ - ((Word_t)(PJP)->jp_DcdP0[0] << 48 | \ - (Word_t)(PJP)->jp_DcdP0[1] << 40 | \ - (Word_t)(PJP)->jp_DcdP0[2] << 32 | \ - (Word_t)(PJP)->jp_DcdP0[3] << 24 | \ - (Word_t)(PJP)->jp_DcdP0[4] << 16 | \ - (Word_t)(PJP)->jp_DcdP0[5] << 8 | \ - (Word_t)(PJP)->jp_DcdP0[6]) - - -#define JU_JPSETADT(PJP,ADDR,DCDPOP0,TYPE) \ -{ \ - (PJP)->jp_Addr = (ADDR); \ - (PJP)->jp_DcdP0[0] = (uint8_t)((Word_t)(DCDPOP0) >> 48); \ - (PJP)->jp_DcdP0[1] = (uint8_t)((Word_t)(DCDPOP0) >> 40); \ - (PJP)->jp_DcdP0[2] = (uint8_t)((Word_t)(DCDPOP0) >> 32); \ - (PJP)->jp_DcdP0[3] = (uint8_t)((Word_t)(DCDPOP0) >> 24); \ - (PJP)->jp_DcdP0[4] = (uint8_t)((Word_t)(DCDPOP0) >> 16); \ - (PJP)->jp_DcdP0[5] = (uint8_t)((Word_t)(DCDPOP0) >> 8); \ - (PJP)->jp_DcdP0[6] = (uint8_t)((Word_t)(DCDPOP0)); \ - (PJP)->jp_Type = (TYPE); \ -} - -#else // 32 Bit - -#define JU_JPDCDPOP0(PJP) \ - ((Word_t)(PJP)->jp_DcdP0[0] << 16 | \ - (Word_t)(PJP)->jp_DcdP0[1] << 8 | \ - (Word_t)(PJP)->jp_DcdP0[2]) - - -#define JU_JPSETADT(PJP,ADDR,DCDPOP0,TYPE) \ -{ \ - (PJP)->jp_Addr = (ADDR); \ - (PJP)->jp_DcdP0[0] = (uint8_t)((Word_t)(DCDPOP0) >> 16); \ - (PJP)->jp_DcdP0[1] = (uint8_t)((Word_t)(DCDPOP0) >> 8); \ - (PJP)->jp_DcdP0[2] = (uint8_t)((Word_t)(DCDPOP0)); \ - (PJP)->jp_Type = (TYPE); \ -} - -#endif // 32 Bit - -// NUMBER OF BITS IN A BRANCH OR LEAF BITMAP AND SUBEXPANSE: -// -// Note: cJU_BITSPERBITMAP must be the same as the number of JPs in a branch. - -#define cJU_BITSPERBITMAP cJU_SUBEXPPERSTATE - -// Bitmaps are accessed in units of "subexpanses": - -#define cJU_BITSPERSUBEXPB (sizeof(BITMAPB_t) * cJU_BITSPERBYTE) -#define cJU_NUMSUBEXPB (cJU_BITSPERBITMAP / cJU_BITSPERSUBEXPB) - -#define cJU_BITSPERSUBEXPL (sizeof(BITMAPL_t) * cJU_BITSPERBYTE) -#define cJU_NUMSUBEXPL (cJU_BITSPERBITMAP / cJU_BITSPERSUBEXPL) - - -// MASK FOR A SPECIFIED BIT IN A BITMAP: -// -// Warning: If BitNum is a variable, this results in a variable shift that is -// expensive, at least on some processors. Use with caution. -// -// Warning: BitNum must be less than cJU_BITSPERWORD, that is, 0 .. -// cJU_BITSPERWORD - 1, to avoid a truncated shift on some machines. -// -// TBD: Perhaps use an array[32] of masks instead of calculating them. - -#define JU_BITPOSMASKB(BITNUM) (1L << ((BITNUM) % cJU_BITSPERSUBEXPB)) -#define JU_BITPOSMASKL(BITNUM) (1L << ((BITNUM) % cJU_BITSPERSUBEXPL)) - - -// TEST/SET/CLEAR A BIT IN A BITMAP LEAF: -// -// Test if a byte-sized Digit (portion of Index) has a corresponding bit set in -// a bitmap, or set a byte-sized Digits bit into a bitmap, by looking up the -// correct subexpanse and then checking/setting the correct bit. -// -// Note: Mask higher bits, if any, for the convenience of the user of this -// macro, in case they pass a full Index, not just a digit. If the caller has -// a true 8-bit digit, make it of type uint8_t and the compiler should skip the -// unnecessary mask step. - -#define JU_SUBEXPL(DIGIT) (((DIGIT) / cJU_BITSPERSUBEXPL) & (cJU_NUMSUBEXPL-1)) - -#define JU_BITMAPTESTL(PJLB, INDEX) \ - (JU_JLB_BITMAP(PJLB, JU_SUBEXPL(INDEX)) & JU_BITPOSMASKL(INDEX)) - -#define JU_BITMAPSETL(PJLB, INDEX) \ - (JU_JLB_BITMAP(PJLB, JU_SUBEXPL(INDEX)) |= JU_BITPOSMASKL(INDEX)) - -#define JU_BITMAPCLEARL(PJLB, INDEX) \ - (JU_JLB_BITMAP(PJLB, JU_SUBEXPL(INDEX)) ^= JU_BITPOSMASKL(INDEX)) - - -// MAP BITMAP BIT OFFSET TO DIGIT: -// -// Given a digit variable to set, a bitmap branch or leaf subexpanse (base 0), -// the bitmap (BITMAP*_t) for that subexpanse, and an offset (Nth set bit in -// the bitmap, base 0), compute the digit (also base 0) corresponding to the -// subexpanse and offset by counting all bits in the bitmap until offset+1 set -// bits are seen. Avoid expensive variable shifts. Offset should be less than -// the number of set bits in the bitmap; assert this. -// -// If theres a better way to do this, I dont know what it is. - -#define JU_BITMAPDIGITB(DIGIT,SUBEXP,BITMAP,OFFSET) \ - { \ - BITMAPB_t bitmap = (BITMAP); int remain = (OFFSET); \ - (DIGIT) = (SUBEXP) * cJU_BITSPERSUBEXPB; \ - \ - while ((remain -= (bitmap & 1)) >= 0) \ - { \ - bitmap >>= 1; ++(DIGIT); \ - assert((DIGIT) < ((SUBEXP) + 1) * cJU_BITSPERSUBEXPB); \ - } \ - } - -#define JU_BITMAPDIGITL(DIGIT,SUBEXP,BITMAP,OFFSET) \ - { \ - BITMAPL_t bitmap = (BITMAP); int remain = (OFFSET); \ - (DIGIT) = (SUBEXP) * cJU_BITSPERSUBEXPL; \ - \ - while ((remain -= (bitmap & 1)) >= 0) \ - { \ - bitmap >>= 1; ++(DIGIT); \ - assert((DIGIT) < ((SUBEXP) + 1) * cJU_BITSPERSUBEXPL); \ - } \ - } - - -// MASKS FOR PORTIONS OF 32-BIT WORDS: -// -// These are useful for bitmap subexpanses. -// -// "LOWER"/"HIGHER" means bits representing lower/higher-valued Indexes. The -// exact order of bits in the word is explicit here but is hidden from the -// caller. -// -// "EXC" means exclusive of the specified bit; "INC" means inclusive. -// -// In each case, BitPos is either "JU_BITPOSMASK*(BitNum)", or a variable saved -// from an earlier call of that macro; either way, it must be a 32-bit word -// with a single bit set. In the first case, assume the compiler is smart -// enough to optimize out common subexpressions. -// -// The expressions depend on unsigned decimal math that should be universal. - -#define JU_MASKLOWEREXC( BITPOS) ((BITPOS) - 1) -#define JU_MASKLOWERINC( BITPOS) (JU_MASKLOWEREXC(BITPOS) | (BITPOS)) -#define JU_MASKHIGHERINC(BITPOS) (-(BITPOS)) -#define JU_MASKHIGHEREXC(BITPOS) (JU_MASKHIGHERINC(BITPOS) ^ (BITPOS)) - - -// **************************************************************************** -// SUPPORT FOR NATIVE INDEX SIZES -// **************************************************************************** -// -// Copy a series of generic objects (uint8_t, uint16_t, uint32_t, Word_t) from -// one place to another. - -#define JU_COPYMEM(PDST,PSRC,POP1) \ - { \ - Word_t i_ndex = 0; \ - assert((POP1) > 0); \ - do { (PDST)[i_ndex] = (PSRC)[i_ndex]; } \ - while (++i_ndex < (POP1)); \ - } - - -// **************************************************************************** -// SUPPORT FOR NON-NATIVE INDEX SIZES -// **************************************************************************** -// -// Copy a 3-byte Index pointed by a uint8_t * to a Word_t: -// -#define JU_COPY3_PINDEX_TO_LONG(DESTLONG,PINDEX) \ - DESTLONG = (Word_t)(PINDEX)[0] << 16; \ - DESTLONG += (Word_t)(PINDEX)[1] << 8; \ - DESTLONG += (Word_t)(PINDEX)[2] - -// Copy a Word_t to a 3-byte Index pointed at by a uint8_t *: - -#define JU_COPY3_LONG_TO_PINDEX(PINDEX,SOURCELONG) \ - (PINDEX)[0] = (uint8_t)((SOURCELONG) >> 16); \ - (PINDEX)[1] = (uint8_t)((SOURCELONG) >> 8); \ - (PINDEX)[2] = (uint8_t)((SOURCELONG)) - -#ifdef JU_64BIT - -// Copy a 5-byte Index pointed by a uint8_t * to a Word_t: -// -#define JU_COPY5_PINDEX_TO_LONG(DESTLONG,PINDEX) \ - DESTLONG = (Word_t)(PINDEX)[0] << 32; \ - DESTLONG += (Word_t)(PINDEX)[1] << 24; \ - DESTLONG += (Word_t)(PINDEX)[2] << 16; \ - DESTLONG += (Word_t)(PINDEX)[3] << 8; \ - DESTLONG += (Word_t)(PINDEX)[4] - -// Copy a Word_t to a 5-byte Index pointed at by a uint8_t *: - -#define JU_COPY5_LONG_TO_PINDEX(PINDEX,SOURCELONG) \ - (PINDEX)[0] = (uint8_t)((SOURCELONG) >> 32); \ - (PINDEX)[1] = (uint8_t)((SOURCELONG) >> 24); \ - (PINDEX)[2] = (uint8_t)((SOURCELONG) >> 16); \ - (PINDEX)[3] = (uint8_t)((SOURCELONG) >> 8); \ - (PINDEX)[4] = (uint8_t)((SOURCELONG)) - -// Copy a 6-byte Index pointed by a uint8_t * to a Word_t: -// -#define JU_COPY6_PINDEX_TO_LONG(DESTLONG,PINDEX) \ - DESTLONG = (Word_t)(PINDEX)[0] << 40; \ - DESTLONG += (Word_t)(PINDEX)[1] << 32; \ - DESTLONG += (Word_t)(PINDEX)[2] << 24; \ - DESTLONG += (Word_t)(PINDEX)[3] << 16; \ - DESTLONG += (Word_t)(PINDEX)[4] << 8; \ - DESTLONG += (Word_t)(PINDEX)[5] - -// Copy a Word_t to a 6-byte Index pointed at by a uint8_t *: - -#define JU_COPY6_LONG_TO_PINDEX(PINDEX,SOURCELONG) \ - (PINDEX)[0] = (uint8_t)((SOURCELONG) >> 40); \ - (PINDEX)[1] = (uint8_t)((SOURCELONG) >> 32); \ - (PINDEX)[2] = (uint8_t)((SOURCELONG) >> 24); \ - (PINDEX)[3] = (uint8_t)((SOURCELONG) >> 16); \ - (PINDEX)[4] = (uint8_t)((SOURCELONG) >> 8); \ - (PINDEX)[5] = (uint8_t)((SOURCELONG)) - -// Copy a 7-byte Index pointed by a uint8_t * to a Word_t: -// -#define JU_COPY7_PINDEX_TO_LONG(DESTLONG,PINDEX) \ - DESTLONG = (Word_t)(PINDEX)[0] << 48; \ - DESTLONG += (Word_t)(PINDEX)[1] << 40; \ - DESTLONG += (Word_t)(PINDEX)[2] << 32; \ - DESTLONG += (Word_t)(PINDEX)[3] << 24; \ - DESTLONG += (Word_t)(PINDEX)[4] << 16; \ - DESTLONG += (Word_t)(PINDEX)[5] << 8; \ - DESTLONG += (Word_t)(PINDEX)[6] - -// Copy a Word_t to a 7-byte Index pointed at by a uint8_t *: - -#define JU_COPY7_LONG_TO_PINDEX(PINDEX,SOURCELONG) \ - (PINDEX)[0] = (uint8_t)((SOURCELONG) >> 48); \ - (PINDEX)[1] = (uint8_t)((SOURCELONG) >> 40); \ - (PINDEX)[2] = (uint8_t)((SOURCELONG) >> 32); \ - (PINDEX)[3] = (uint8_t)((SOURCELONG) >> 24); \ - (PINDEX)[4] = (uint8_t)((SOURCELONG) >> 16); \ - (PINDEX)[5] = (uint8_t)((SOURCELONG) >> 8); \ - (PINDEX)[6] = (uint8_t)((SOURCELONG)) - -#endif // JU_64BIT - -// **************************************************************************** -// COMMON CODE FRAGMENTS (MACROS) -// **************************************************************************** -// -// These code chunks are shared between various source files. - - -// SET (REPLACE) ONE DIGIT IN AN INDEX: -// -// To avoid endian issues, use masking and ORing, which operates in a -// big-endian register, rather than treating the Index as an array of bytes, -// though that would be simpler, but would operate in endian-specific memory. -// -// TBD: This contains two variable shifts, is that bad? - -#define JU_SETDIGIT(INDEX,DIGIT,STATE) \ - (INDEX) = ((INDEX) & (~cJU_MASKATSTATE(STATE))) \ - | (((Word_t) (DIGIT)) \ - << (((STATE) - 1) * cJU_BITSPERBYTE)) - -// Fast version for single LSB: - -#define JU_SETDIGIT1(INDEX,DIGIT) (INDEX) = ((INDEX) & ~0xff) | (DIGIT) - - -// SET (REPLACE) "N" LEAST DIGITS IN AN INDEX: - -#define JU_SETDIGITS(INDEX,INDEX2,cSTATE) \ - (INDEX) = ((INDEX ) & (~JU_LEASTBYTESMASK(cSTATE))) \ - | ((INDEX2) & ( JU_LEASTBYTESMASK(cSTATE))) - -// COPY DECODE BYTES FROM JP TO INDEX: -// -// Modify Index digit(s) to match the bytes in jp_DcdPopO in case one or more -// branches are skipped and the digits are significant. Its probably faster -// to just do this unconditionally than to check if its necessary. -// -// To avoid endian issues, use masking and ORing, which operates in a -// big-endian register, rather than treating the Index as an array of bytes, -// though that would be simpler, but would operate in endian-specific memory. -// -// WARNING: Must not call JU_LEASTBYTESMASK (via cJU_DCDMASK) with Bytes = -// cJU_ROOTSTATE or a bad mask is generated, but there are no Dcd bytes to copy -// in this case anyway. In fact there are no Dcd bytes unless State < -// cJU_ROOTSTATE - 1, so dont call this macro except in those cases. -// -// TBD: It would be nice to validate jp_DcdPopO against known digits to ensure -// no corruption, but this is non-trivial. - -#define JU_SETDCD(INDEX,PJP,cSTATE) \ - (INDEX) = ((INDEX) & ~cJU_DCDMASK(cSTATE)) \ - | (JU_JPDCDPOP0(PJP) & cJU_DCDMASK(cSTATE)) - -// INSERT/DELETE AN INDEX IN-PLACE IN MEMORY: -// -// Given a pointer to an array of "even" (native), same-sized objects -// (indexes), the current population of the array, an offset in the array, and -// a new Index to insert, "shift up" the array elements (Indexes) above the -// insertion point and insert the new Index. Assume there is sufficient memory -// to do this. -// -// In these macros, "i_offset" is an index offset, and "b_off" is a byte -// offset for odd Index sizes. -// -// Note: Endian issues only arise fro insertion, not deletion, and even for -// insertion, they are transparent when native (even) objects are used, and -// handled explicitly for odd (non-native) Index sizes. -// -// Note: The following macros are tricky enough that there is some test code -// for them appended to this file. - -#define JU_INSERTINPLACE(PARRAY,POP1,OFFSET,INDEX) \ - assert((long) (POP1) > 0); \ - assert((Word_t) (OFFSET) <= (Word_t) (POP1)); \ - { \ - Word_t i_offset = (POP1); \ - \ - while (i_offset-- > (OFFSET)) \ - (PARRAY)[i_offset + 1] = (PARRAY)[i_offset]; \ - \ - (PARRAY)[OFFSET] = (INDEX); \ - } - - -// Variation for non-native Indexes, where cIS = Index Size -// and PByte must point to a uint8_t (byte); shift byte-by-byte: -// - -#define JU_INSERTINPLACE3(PBYTE,POP1,OFFSET,INDEX) \ -{ \ - Word_t i_off = POP1; \ - \ - while (i_off-- > (OFFSET)) \ - { \ - Word_t i_dx = i_off * 3; \ - (PBYTE)[i_dx + 0 + 3] = (PBYTE)[i_dx + 0]; \ - (PBYTE)[i_dx + 1 + 3] = (PBYTE)[i_dx + 1]; \ - (PBYTE)[i_dx + 2 + 3] = (PBYTE)[i_dx + 2]; \ - } \ - JU_COPY3_LONG_TO_PINDEX(&((PBYTE)[(OFFSET) * 3]), INDEX); \ -} - -#ifdef JU_64BIT - -#define JU_INSERTINPLACE5(PBYTE,POP1,OFFSET,INDEX) \ -{ \ - Word_t i_off = POP1; \ - \ - while (i_off-- > (OFFSET)) \ - { \ - Word_t i_dx = i_off * 5; \ - (PBYTE)[i_dx + 0 + 5] = (PBYTE)[i_dx + 0]; \ - (PBYTE)[i_dx + 1 + 5] = (PBYTE)[i_dx + 1]; \ - (PBYTE)[i_dx + 2 + 5] = (PBYTE)[i_dx + 2]; \ - (PBYTE)[i_dx + 3 + 5] = (PBYTE)[i_dx + 3]; \ - (PBYTE)[i_dx + 4 + 5] = (PBYTE)[i_dx + 4]; \ - } \ - JU_COPY5_LONG_TO_PINDEX(&((PBYTE)[(OFFSET) * 5]), INDEX); \ -} - -#define JU_INSERTINPLACE6(PBYTE,POP1,OFFSET,INDEX) \ -{ \ - Word_t i_off = POP1; \ - \ - while (i_off-- > (OFFSET)) \ - { \ - Word_t i_dx = i_off * 6; \ - (PBYTE)[i_dx + 0 + 6] = (PBYTE)[i_dx + 0]; \ - (PBYTE)[i_dx + 1 + 6] = (PBYTE)[i_dx + 1]; \ - (PBYTE)[i_dx + 2 + 6] = (PBYTE)[i_dx + 2]; \ - (PBYTE)[i_dx + 3 + 6] = (PBYTE)[i_dx + 3]; \ - (PBYTE)[i_dx + 4 + 6] = (PBYTE)[i_dx + 4]; \ - (PBYTE)[i_dx + 5 + 6] = (PBYTE)[i_dx + 5]; \ - } \ - JU_COPY6_LONG_TO_PINDEX(&((PBYTE)[(OFFSET) * 6]), INDEX); \ -} - -#define JU_INSERTINPLACE7(PBYTE,POP1,OFFSET,INDEX) \ -{ \ - Word_t i_off = POP1; \ - \ - while (i_off-- > (OFFSET)) \ - { \ - Word_t i_dx = i_off * 7; \ - (PBYTE)[i_dx + 0 + 7] = (PBYTE)[i_dx + 0]; \ - (PBYTE)[i_dx + 1 + 7] = (PBYTE)[i_dx + 1]; \ - (PBYTE)[i_dx + 2 + 7] = (PBYTE)[i_dx + 2]; \ - (PBYTE)[i_dx + 3 + 7] = (PBYTE)[i_dx + 3]; \ - (PBYTE)[i_dx + 4 + 7] = (PBYTE)[i_dx + 4]; \ - (PBYTE)[i_dx + 5 + 7] = (PBYTE)[i_dx + 5]; \ - (PBYTE)[i_dx + 6 + 7] = (PBYTE)[i_dx + 6]; \ - } \ - JU_COPY7_LONG_TO_PINDEX(&((PBYTE)[(OFFSET) * 7]), INDEX); \ -} -#endif // JU_64BIT - -// Counterparts to the above for deleting an Index: -// -// "Shift down" the array elements starting at the Index to be deleted. - -#define JU_DELETEINPLACE(PARRAY,POP1,OFFSET,IGNORE) \ - assert((long) (POP1) > 0); \ - assert((Word_t) (OFFSET) < (Word_t) (POP1)); \ - { \ - Word_t i_offset = (OFFSET); \ - \ - while (++i_offset < (POP1)) \ - (PARRAY)[i_offset - 1] = (PARRAY)[i_offset]; \ - } - -// Variation for odd-byte-sized (non-native) Indexes, where cIS = Index Size -// and PByte must point to a uint8_t (byte); copy byte-by-byte: -// -// Note: If cIS == 1, JU_DELETEINPLACE_ODD == JU_DELETEINPLACE. -// -// Note: There are no endian issues here because bytes are just shifted as-is, -// not converted to/from an Index. - -#define JU_DELETEINPLACE_ODD(PBYTE,POP1,OFFSET,cIS) \ - assert((long) (POP1) > 0); \ - assert((Word_t) (OFFSET) < (Word_t) (POP1)); \ - { \ - Word_t b_off = (((OFFSET) + 1) * (cIS)) - 1; \ - \ - while (++b_off < ((POP1) * (cIS))) \ - (PBYTE)[b_off - (cIS)] = (PBYTE)[b_off]; \ - } - - -// INSERT/DELETE AN INDEX WHILE COPYING OTHERS: -// -// Copy PSource[] to PDest[], where PSource[] has Pop1 elements (Indexes), -// inserting Index at PDest[Offset]. Unlike JU_*INPLACE*() above, these macros -// are used when moving Indexes from one memory object to another. - -#define JU_INSERTCOPY(PDEST,PSOURCE,POP1,OFFSET,INDEX) \ - assert((long) (POP1) > 0); \ - assert((Word_t) (OFFSET) <= (Word_t) (POP1)); \ - { \ - Word_t i_offset; \ - \ - for (i_offset = 0; i_offset < (OFFSET); ++i_offset) \ - (PDEST)[i_offset] = (PSOURCE)[i_offset]; \ - \ - (PDEST)[i_offset] = (INDEX); \ - \ - for (/* null */; i_offset < (POP1); ++i_offset) \ - (PDEST)[i_offset + 1] = (PSOURCE)[i_offset]; \ - } - -#define JU_INSERTCOPY3(PDEST,PSOURCE,POP1,OFFSET,INDEX) \ -assert((long) (POP1) > 0); \ -assert((Word_t) (OFFSET) <= (Word_t) (POP1)); \ -{ \ - Word_t o_ff; \ - \ - for (o_ff = 0; o_ff < (OFFSET); o_ff++) \ - { \ - Word_t i_dx = o_ff * 3; \ - (PDEST)[i_dx + 0] = (PSOURCE)[i_dx + 0]; \ - (PDEST)[i_dx + 1] = (PSOURCE)[i_dx + 1]; \ - (PDEST)[i_dx + 2] = (PSOURCE)[i_dx + 2]; \ - } \ - JU_COPY3_LONG_TO_PINDEX(&((PDEST)[(OFFSET) * 3]), INDEX); \ - \ - for (/* null */; o_ff < (POP1); o_ff++) \ - { \ - Word_t i_dx = o_ff * 3; \ - (PDEST)[i_dx + 0 + 3] = (PSOURCE)[i_dx + 0]; \ - (PDEST)[i_dx + 1 + 3] = (PSOURCE)[i_dx + 1]; \ - (PDEST)[i_dx + 2 + 3] = (PSOURCE)[i_dx + 2]; \ - } \ -} - -#ifdef JU_64BIT - -#define JU_INSERTCOPY5(PDEST,PSOURCE,POP1,OFFSET,INDEX) \ -assert((long) (POP1) > 0); \ -assert((Word_t) (OFFSET) <= (Word_t) (POP1)); \ -{ \ - Word_t o_ff; \ - \ - for (o_ff = 0; o_ff < (OFFSET); o_ff++) \ - { \ - Word_t i_dx = o_ff * 5; \ - (PDEST)[i_dx + 0] = (PSOURCE)[i_dx + 0]; \ - (PDEST)[i_dx + 1] = (PSOURCE)[i_dx + 1]; \ - (PDEST)[i_dx + 2] = (PSOURCE)[i_dx + 2]; \ - (PDEST)[i_dx + 3] = (PSOURCE)[i_dx + 3]; \ - (PDEST)[i_dx + 4] = (PSOURCE)[i_dx + 4]; \ - } \ - JU_COPY5_LONG_TO_PINDEX(&((PDEST)[(OFFSET) * 5]), INDEX); \ - \ - for (/* null */; o_ff < (POP1); o_ff++) \ - { \ - Word_t i_dx = o_ff * 5; \ - (PDEST)[i_dx + 0 + 5] = (PSOURCE)[i_dx + 0]; \ - (PDEST)[i_dx + 1 + 5] = (PSOURCE)[i_dx + 1]; \ - (PDEST)[i_dx + 2 + 5] = (PSOURCE)[i_dx + 2]; \ - (PDEST)[i_dx + 3 + 5] = (PSOURCE)[i_dx + 3]; \ - (PDEST)[i_dx + 4 + 5] = (PSOURCE)[i_dx + 4]; \ - } \ -} - -#define JU_INSERTCOPY6(PDEST,PSOURCE,POP1,OFFSET,INDEX) \ -assert((long) (POP1) > 0); \ -assert((Word_t) (OFFSET) <= (Word_t) (POP1)); \ -{ \ - Word_t o_ff; \ - \ - for (o_ff = 0; o_ff < (OFFSET); o_ff++) \ - { \ - Word_t i_dx = o_ff * 6; \ - (PDEST)[i_dx + 0] = (PSOURCE)[i_dx + 0]; \ - (PDEST)[i_dx + 1] = (PSOURCE)[i_dx + 1]; \ - (PDEST)[i_dx + 2] = (PSOURCE)[i_dx + 2]; \ - (PDEST)[i_dx + 3] = (PSOURCE)[i_dx + 3]; \ - (PDEST)[i_dx + 4] = (PSOURCE)[i_dx + 4]; \ - (PDEST)[i_dx + 5] = (PSOURCE)[i_dx + 5]; \ - } \ - JU_COPY6_LONG_TO_PINDEX(&((PDEST)[(OFFSET) * 6]), INDEX); \ - \ - for (/* null */; o_ff < (POP1); o_ff++) \ - { \ - Word_t i_dx = o_ff * 6; \ - (PDEST)[i_dx + 0 + 6] = (PSOURCE)[i_dx + 0]; \ - (PDEST)[i_dx + 1 + 6] = (PSOURCE)[i_dx + 1]; \ - (PDEST)[i_dx + 2 + 6] = (PSOURCE)[i_dx + 2]; \ - (PDEST)[i_dx + 3 + 6] = (PSOURCE)[i_dx + 3]; \ - (PDEST)[i_dx + 4 + 6] = (PSOURCE)[i_dx + 4]; \ - (PDEST)[i_dx + 5 + 6] = (PSOURCE)[i_dx + 5]; \ - } \ -} - -#define JU_INSERTCOPY7(PDEST,PSOURCE,POP1,OFFSET,INDEX) \ -assert((long) (POP1) > 0); \ -assert((Word_t) (OFFSET) <= (Word_t) (POP1)); \ -{ \ - Word_t o_ff; \ - \ - for (o_ff = 0; o_ff < (OFFSET); o_ff++) \ - { \ - Word_t i_dx = o_ff * 7; \ - (PDEST)[i_dx + 0] = (PSOURCE)[i_dx + 0]; \ - (PDEST)[i_dx + 1] = (PSOURCE)[i_dx + 1]; \ - (PDEST)[i_dx + 2] = (PSOURCE)[i_dx + 2]; \ - (PDEST)[i_dx + 3] = (PSOURCE)[i_dx + 3]; \ - (PDEST)[i_dx + 4] = (PSOURCE)[i_dx + 4]; \ - (PDEST)[i_dx + 5] = (PSOURCE)[i_dx + 5]; \ - (PDEST)[i_dx + 6] = (PSOURCE)[i_dx + 6]; \ - } \ - JU_COPY7_LONG_TO_PINDEX(&((PDEST)[(OFFSET) * 7]), INDEX); \ - \ - for (/* null */; o_ff < (POP1); o_ff++) \ - { \ - Word_t i_dx = o_ff * 7; \ - (PDEST)[i_dx + 0 + 7] = (PSOURCE)[i_dx + 0]; \ - (PDEST)[i_dx + 1 + 7] = (PSOURCE)[i_dx + 1]; \ - (PDEST)[i_dx + 2 + 7] = (PSOURCE)[i_dx + 2]; \ - (PDEST)[i_dx + 3 + 7] = (PSOURCE)[i_dx + 3]; \ - (PDEST)[i_dx + 4 + 7] = (PSOURCE)[i_dx + 4]; \ - (PDEST)[i_dx + 5 + 7] = (PSOURCE)[i_dx + 5]; \ - (PDEST)[i_dx + 6 + 7] = (PSOURCE)[i_dx + 6]; \ - } \ -} - -#endif // JU_64BIT - -// Counterparts to the above for deleting an Index: - -#define JU_DELETECOPY(PDEST,PSOURCE,POP1,OFFSET,IGNORE) \ - assert((long) (POP1) > 0); \ - assert((Word_t) (OFFSET) < (Word_t) (POP1)); \ - { \ - Word_t i_offset; \ - \ - for (i_offset = 0; i_offset < (OFFSET); ++i_offset) \ - (PDEST)[i_offset] = (PSOURCE)[i_offset]; \ - \ - for (++i_offset; i_offset < (POP1); ++i_offset) \ - (PDEST)[i_offset - 1] = (PSOURCE)[i_offset]; \ - } - -// Variation for odd-byte-sized (non-native) Indexes, where cIS = Index Size; -// copy byte-by-byte: -// -// Note: There are no endian issues here because bytes are just shifted as-is, -// not converted to/from an Index. -// -// Note: If cIS == 1, JU_DELETECOPY_ODD == JU_DELETECOPY, at least in concept. - -#define JU_DELETECOPY_ODD(PDEST,PSOURCE,POP1,OFFSET,cIS) \ - assert((long) (POP1) > 0); \ - assert((Word_t) (OFFSET) < (Word_t) (POP1)); \ - { \ - uint8_t *_Pdest = (uint8_t *) (PDEST); \ - uint8_t *_Psource = (uint8_t *) (PSOURCE); \ - Word_t b_off; \ - \ - for (b_off = 0; b_off < ((OFFSET) * (cIS)); ++b_off) \ - *_Pdest++ = *_Psource++; \ - \ - _Psource += (cIS); \ - \ - for (b_off += (cIS); b_off < ((POP1) * (cIS)); ++b_off) \ - *_Pdest++ = *_Psource++; \ - } - - -// GENERIC RETURN CODE HANDLING FOR JUDY1 (NO VALUE AREAS) AND JUDYL (VALUE -// AREAS): -// -// This common code hides Judy1 versus JudyL details of how to return various -// conditions, including a pointer to a value area for JudyL. -// -// First, define an internal variation of JERR called JERRI (I = int) to make -// lint happy. We accidentally shipped to 11.11 OEUR with all functions that -// return int or Word_t using JERR, which is type Word_t, for errors. Lint -// complains about this for functions that return int. So, internally use -// JERRI for error returns from the int functions. Experiments show that -// callers which compare int Foo() to (Word_t) JERR (~0UL) are OK, since JERRI -// sign-extends to match JERR. - -#define JERRI ((int) ~0) // see above. - -#ifdef JUDY1 - -#define JU_RET_FOUND return(1) -#define JU_RET_NOTFOUND return(0) - -// For Judy1, these all "fall through" to simply JU_RET_FOUND, since there is no -// value area pointer to return: - -#define JU_RET_FOUND_LEAFW(PJLW,POP1,OFFSET) JU_RET_FOUND - -#define JU_RET_FOUND_JPM(Pjpm) JU_RET_FOUND -#define JU_RET_FOUND_PVALUE(Pjv,OFFSET) JU_RET_FOUND -#ifndef JU_64BIT -#define JU_RET_FOUND_LEAF1(Pjll,POP1,OFFSET) JU_RET_FOUND -#endif -#define JU_RET_FOUND_LEAF2(Pjll,POP1,OFFSET) JU_RET_FOUND -#define JU_RET_FOUND_LEAF3(Pjll,POP1,OFFSET) JU_RET_FOUND -#ifdef JU_64BIT -#define JU_RET_FOUND_LEAF4(Pjll,POP1,OFFSET) JU_RET_FOUND -#define JU_RET_FOUND_LEAF5(Pjll,POP1,OFFSET) JU_RET_FOUND -#define JU_RET_FOUND_LEAF6(Pjll,POP1,OFFSET) JU_RET_FOUND -#define JU_RET_FOUND_LEAF7(Pjll,POP1,OFFSET) JU_RET_FOUND -#endif -#define JU_RET_FOUND_IMM_01(Pjp) JU_RET_FOUND -#define JU_RET_FOUND_IMM(Pjp,OFFSET) JU_RET_FOUND - -// Note: No JudyL equivalent: - -#define JU_RET_FOUND_FULLPOPU1 JU_RET_FOUND -#define JU_RET_FOUND_LEAF_B1(PJLB,SUBEXP,OFFSET) JU_RET_FOUND - -#else // JUDYL - -// JU_RET_FOUND // see below; must NOT be defined for JudyL. -#define JU_RET_NOTFOUND return((PPvoid_t) NULL) - -// For JudyL, the location of the value area depends on the JP type and other -// factors: -// -// TBD: The value areas should be accessed via data structures, here and in -// Dougs code, not by hard-coded address calculations. -// -// This is useful in insert/delete code when the value area is returned from -// lower levels in the JPM: - -#define JU_RET_FOUND_JPM(Pjpm) return((PPvoid_t) ((Pjpm)->jpm_PValue)) - -// This is useful in insert/delete code when the value area location is already -// computed: - -#define JU_RET_FOUND_PVALUE(Pjv,OFFSET) return((PPvoid_t) ((Pjv) + OFFSET)) - -#define JU_RET_FOUND_LEAFW(PJLW,POP1,OFFSET) \ - return((PPvoid_t) (JL_LEAFWVALUEAREA(PJLW, POP1) + (OFFSET))) - -#define JU_RET_FOUND_LEAF1(Pjll,POP1,OFFSET) \ - return((PPvoid_t) (JL_LEAF1VALUEAREA(Pjll, POP1) + (OFFSET))) -#define JU_RET_FOUND_LEAF2(Pjll,POP1,OFFSET) \ - return((PPvoid_t) (JL_LEAF2VALUEAREA(Pjll, POP1) + (OFFSET))) -#define JU_RET_FOUND_LEAF3(Pjll,POP1,OFFSET) \ - return((PPvoid_t) (JL_LEAF3VALUEAREA(Pjll, POP1) + (OFFSET))) -#ifdef JU_64BIT -#define JU_RET_FOUND_LEAF4(Pjll,POP1,OFFSET) \ - return((PPvoid_t) (JL_LEAF4VALUEAREA(Pjll, POP1) + (OFFSET))) -#define JU_RET_FOUND_LEAF5(Pjll,POP1,OFFSET) \ - return((PPvoid_t) (JL_LEAF5VALUEAREA(Pjll, POP1) + (OFFSET))) -#define JU_RET_FOUND_LEAF6(Pjll,POP1,OFFSET) \ - return((PPvoid_t) (JL_LEAF6VALUEAREA(Pjll, POP1) + (OFFSET))) -#define JU_RET_FOUND_LEAF7(Pjll,POP1,OFFSET) \ - return((PPvoid_t) (JL_LEAF7VALUEAREA(Pjll, POP1) + (OFFSET))) -#endif - -// Note: Here jp_Addr is a value area itself and not an address, so P_JV() is -// not needed: - -#define JU_RET_FOUND_IMM_01(PJP) return((PPvoid_t) (&((PJP)->jp_Addr))) - -// Note: Here jp_Addr is a pointer to a separately-mallocd value area, so -// P_JV() is required; likewise for JL_JLB_PVALUE: - -#define JU_RET_FOUND_IMM(PJP,OFFSET) \ - return((PPvoid_t) (P_JV((PJP)->jp_Addr) + (OFFSET))) - -#define JU_RET_FOUND_LEAF_B1(PJLB,SUBEXP,OFFSET) \ - return((PPvoid_t) (P_JV(JL_JLB_PVALUE(PJLB, SUBEXP)) + (OFFSET))) - -#endif // JUDYL - - -// GENERIC ERROR HANDLING: -// -// This is complicated by variations in the needs of the callers of these -// macros. Only use JU_SET_ERRNO() for PJError, because it can be null; use -// JU_SET_ERRNO_NONNULL() for Pjpm, which is never null, and also in other -// cases where the pointer is known not to be null (to save dead branches). -// -// Note: Most cases of JU_ERRNO_OVERRUN or JU_ERRNO_CORRUPT should result in -// an assertion failure in debug code, so they are more likely to be caught, so -// do that here in each macro. - -#define JU_SET_ERRNO(PJError, JErrno) \ - { \ - assert((JErrno) != JU_ERRNO_OVERRUN); \ - assert((JErrno) != JU_ERRNO_CORRUPT); \ - \ - if (PJError != (PJError_t) NULL) \ - { \ - JU_ERRNO(PJError) = (JErrno); \ - JU_ERRID(PJError) = __LINE__; \ - } \ - } - -// Variation for callers who know already that PJError is non-null; and, it can -// also be Pjpm (both PJError_t and Pjpm_t have je_* fields), so only assert it -// for null, not cast to any specific pointer type: - -#define JU_SET_ERRNO_NONNULL(PJError, JErrno) \ - { \ - assert((JErrno) != JU_ERRNO_OVERRUN); \ - assert((JErrno) != JU_ERRNO_CORRUPT); \ - assert(PJError); \ - \ - JU_ERRNO(PJError) = (JErrno); \ - JU_ERRID(PJError) = __LINE__; \ - } - -// Variation to copy error info from a (required) JPM to an (optional) -// PJError_t: -// -// Note: The assertions above about JU_ERRNO_OVERRUN and JU_ERRNO_CORRUPT -// should have already popped, so they are not needed here. - -#define JU_COPY_ERRNO(PJError, Pjpm) \ - { \ - if (PJError) \ - { \ - JU_ERRNO(PJError) = (uint8_t)JU_ERRNO(Pjpm); \ - JU_ERRID(PJError) = JU_ERRID(Pjpm); \ - } \ - } - -// For JErrno parameter to previous macros upon return from Judy*Alloc*(): -// -// The memory allocator returns an address of 0 for out of memory, -// 1..sizeof(Word_t)-1 for corruption (an invalid pointer), otherwise a valid -// pointer. - -#define JU_ALLOC_ERRNO(ADDR) \ - (((void *) (ADDR) != (void *) NULL) ? JU_ERRNO_OVERRUN : JU_ERRNO_NOMEM) - -#define JU_CHECKALLOC(Type,Ptr,Retval) \ - if ((Ptr) < (Type) sizeof(Word_t)) \ - { \ - JU_SET_ERRNO(PJError, JU_ALLOC_ERRNO(Ptr)); \ - return(Retval); \ - } - -// Leaf search routines - -#ifdef JU_NOINLINE - -int j__udySearchLeaf1(Pjll_t Pjll, Word_t LeafPop1, Word_t Index); -int j__udySearchLeaf2(Pjll_t Pjll, Word_t LeafPop1, Word_t Index); -int j__udySearchLeaf3(Pjll_t Pjll, Word_t LeafPop1, Word_t Index); - -#ifdef JU_64BIT - -int j__udySearchLeaf4(Pjll_t Pjll, Word_t LeafPop1, Word_t Index); -int j__udySearchLeaf5(Pjll_t Pjll, Word_t LeafPop1, Word_t Index); -int j__udySearchLeaf6(Pjll_t Pjll, Word_t LeafPop1, Word_t Index); -int j__udySearchLeaf7(Pjll_t Pjll, Word_t LeafPop1, Word_t Index); - -#endif // JU_64BIT - -int j__udySearchLeafW(Pjlw_t Pjlw, Word_t LeafPop1, Word_t Index); - -#else // complier support for inline - -#ifdef JU_WIN -static __inline int j__udySearchLeaf1(Pjll_t Pjll, Word_t LeafPop1, Word_t Index) -#else -static inline int j__udySearchLeaf1(Pjll_t Pjll, Word_t LeafPop1, Word_t Index) -#endif -{ SEARCHLEAFNATIVE(uint8_t, Pjll, LeafPop1, Index); } - -#ifdef JU_WIN -static __inline int j__udySearchLeaf2(Pjll_t Pjll, Word_t LeafPop1, Word_t Index) -#else -static inline int j__udySearchLeaf2(Pjll_t Pjll, Word_t LeafPop1, Word_t Index) -#endif -{ SEARCHLEAFNATIVE(uint16_t, Pjll, LeafPop1, Index); } - -#ifdef JU_WIN -static __inline int j__udySearchLeaf3(Pjll_t Pjll, Word_t LeafPop1, Word_t Index) -#else -static inline int j__udySearchLeaf3(Pjll_t Pjll, Word_t LeafPop1, Word_t Index) -#endif -{ SEARCHLEAFNONNAT(Pjll, LeafPop1, Index, 3, JU_COPY3_PINDEX_TO_LONG); } - -#ifdef JU_64BIT - -#ifdef JU_WIN -static __inline int j__udySearchLeaf4(Pjll_t Pjll, Word_t LeafPop1, Word_t Index) -#else -static inline int j__udySearchLeaf4(Pjll_t Pjll, Word_t LeafPop1, Word_t Index) -#endif -{ SEARCHLEAFNATIVE(uint32_t, Pjll, LeafPop1, Index); } - -#ifdef JU_WIN -static __inline int j__udySearchLeaf5(Pjll_t Pjll, Word_t LeafPop1, Word_t Index) -#else -static inline int j__udySearchLeaf5(Pjll_t Pjll, Word_t LeafPop1, Word_t Index) -#endif -{ SEARCHLEAFNONNAT(Pjll, LeafPop1, Index, 5, JU_COPY5_PINDEX_TO_LONG); } - -#ifdef JU_WIN -static __inline int j__udySearchLeaf6(Pjll_t Pjll, Word_t LeafPop1, Word_t Index) -#else -static inline int j__udySearchLeaf6(Pjll_t Pjll, Word_t LeafPop1, Word_t Index) -#endif -{ SEARCHLEAFNONNAT(Pjll, LeafPop1, Index, 6, JU_COPY6_PINDEX_TO_LONG); } - -#ifdef JU_WIN -static __inline int j__udySearchLeaf7(Pjll_t Pjll, Word_t LeafPop1, Word_t Index) -#else -static inline int j__udySearchLeaf7(Pjll_t Pjll, Word_t LeafPop1, Word_t Index) -#endif -{ SEARCHLEAFNONNAT(Pjll, LeafPop1, Index, 7, JU_COPY7_PINDEX_TO_LONG); } - -#endif // JU_64BIT - -#ifdef JU_WIN -static __inline int j__udySearchLeafW(Pjlw_t Pjlw, Word_t LeafPop1, Word_t Index) -#else -static inline int j__udySearchLeafW(Pjlw_t Pjlw, Word_t LeafPop1, Word_t Index) -#endif -{ SEARCHLEAFNATIVE(Word_t, Pjlw, LeafPop1, Index); } - -#endif // compiler support for inline - -#endif // ! _JUDYPRIVATE_INCLUDED diff --git a/libjudy/src/JudyCommon/JudyPrivate1L.h b/libjudy/src/JudyCommon/JudyPrivate1L.h deleted file mode 100644 index 5b47048990..0000000000 --- a/libjudy/src/JudyCommon/JudyPrivate1L.h +++ /dev/null @@ -1,485 +0,0 @@ -#ifndef _JUDYPRIVATE1L_INCLUDED -#define _JUDYPRIVATE1L_INCLUDED -// _________________ -// -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.31 $ $Source: /judy/src/JudyCommon/JudyPrivate1L.h $ - -// **************************************************************************** -// Declare common cJU_* names for JP Types that occur in both Judy1 and JudyL, -// for use by code that ifdefs JUDY1 and JUDYL. Only JP Types common to both -// Judy1 and JudyL are #defined here with equivalent cJU_* names. JP Types -// unique to only Judy1 or JudyL are listed in comments, so the type lists -// match the Judy1.h and JudyL.h files. -// -// This file also defines cJU_* for other JP-related constants and functions -// that some shared JUDY1/JUDYL code finds handy. -// -// At least in principle this file should be included AFTER Judy1.h or JudyL.h. -// -// WARNING: This file must be kept consistent with the enums in Judy1.h and -// JudyL.h. -// -// TBD: You might think, why not define common cJU_* enums in, say, -// JudyPrivate.h, and then inherit them into superset enums in Judy1.h and -// JudyL.h? The problem is that the enum lists for each class (cJ1_* and -// cJL_*) must be numerically "packed" into the correct order, for two reasons: -// (1) allow the compiler to generate "tight" switch statements with no wasted -// slots (although this is not very big), and (2) allow calculations using the -// enum values, although this is also not an issue if the calculations are only -// within each cJ*_JPIMMED_*_* class and the members are packed within the -// class. - -#ifdef JUDY1 - -#define cJU_JRPNULL cJ1_JRPNULL -#define cJU_JPNULL1 cJ1_JPNULL1 -#define cJU_JPNULL2 cJ1_JPNULL2 -#define cJU_JPNULL3 cJ1_JPNULL3 -#ifdef JU_64BIT -#define cJU_JPNULL4 cJ1_JPNULL4 -#define cJU_JPNULL5 cJ1_JPNULL5 -#define cJU_JPNULL6 cJ1_JPNULL6 -#define cJU_JPNULL7 cJ1_JPNULL7 -#endif -#define cJU_JPNULLMAX cJ1_JPNULLMAX -#define cJU_JPBRANCH_L2 cJ1_JPBRANCH_L2 -#define cJU_JPBRANCH_L3 cJ1_JPBRANCH_L3 -#ifdef JU_64BIT -#define cJU_JPBRANCH_L4 cJ1_JPBRANCH_L4 -#define cJU_JPBRANCH_L5 cJ1_JPBRANCH_L5 -#define cJU_JPBRANCH_L6 cJ1_JPBRANCH_L6 -#define cJU_JPBRANCH_L7 cJ1_JPBRANCH_L7 -#endif -#define cJU_JPBRANCH_L cJ1_JPBRANCH_L -#define j__U_BranchBJPPopToWords j__1_BranchBJPPopToWords -#define cJU_JPBRANCH_B2 cJ1_JPBRANCH_B2 -#define cJU_JPBRANCH_B3 cJ1_JPBRANCH_B3 -#ifdef JU_64BIT -#define cJU_JPBRANCH_B4 cJ1_JPBRANCH_B4 -#define cJU_JPBRANCH_B5 cJ1_JPBRANCH_B5 -#define cJU_JPBRANCH_B6 cJ1_JPBRANCH_B6 -#define cJU_JPBRANCH_B7 cJ1_JPBRANCH_B7 -#endif -#define cJU_JPBRANCH_B cJ1_JPBRANCH_B -#define cJU_JPBRANCH_U2 cJ1_JPBRANCH_U2 -#define cJU_JPBRANCH_U3 cJ1_JPBRANCH_U3 -#ifdef JU_64BIT -#define cJU_JPBRANCH_U4 cJ1_JPBRANCH_U4 -#define cJU_JPBRANCH_U5 cJ1_JPBRANCH_U5 -#define cJU_JPBRANCH_U6 cJ1_JPBRANCH_U6 -#define cJU_JPBRANCH_U7 cJ1_JPBRANCH_U7 -#endif -#define cJU_JPBRANCH_U cJ1_JPBRANCH_U -#ifndef JU_64BIT -#define cJU_JPLEAF1 cJ1_JPLEAF1 -#endif -#define cJU_JPLEAF2 cJ1_JPLEAF2 -#define cJU_JPLEAF3 cJ1_JPLEAF3 -#ifdef JU_64BIT -#define cJU_JPLEAF4 cJ1_JPLEAF4 -#define cJU_JPLEAF5 cJ1_JPLEAF5 -#define cJU_JPLEAF6 cJ1_JPLEAF6 -#define cJU_JPLEAF7 cJ1_JPLEAF7 -#endif -#define cJU_JPLEAF_B1 cJ1_JPLEAF_B1 -// cJ1_JPFULLPOPU1 -#define cJU_JPIMMED_1_01 cJ1_JPIMMED_1_01 -#define cJU_JPIMMED_2_01 cJ1_JPIMMED_2_01 -#define cJU_JPIMMED_3_01 cJ1_JPIMMED_3_01 -#ifdef JU_64BIT -#define cJU_JPIMMED_4_01 cJ1_JPIMMED_4_01 -#define cJU_JPIMMED_5_01 cJ1_JPIMMED_5_01 -#define cJU_JPIMMED_6_01 cJ1_JPIMMED_6_01 -#define cJU_JPIMMED_7_01 cJ1_JPIMMED_7_01 -#endif -#define cJU_JPIMMED_1_02 cJ1_JPIMMED_1_02 -#define cJU_JPIMMED_1_03 cJ1_JPIMMED_1_03 -#define cJU_JPIMMED_1_04 cJ1_JPIMMED_1_04 -#define cJU_JPIMMED_1_05 cJ1_JPIMMED_1_05 -#define cJU_JPIMMED_1_06 cJ1_JPIMMED_1_06 -#define cJU_JPIMMED_1_07 cJ1_JPIMMED_1_07 -#ifdef JU_64BIT -// cJ1_JPIMMED_1_08 -// cJ1_JPIMMED_1_09 -// cJ1_JPIMMED_1_10 -// cJ1_JPIMMED_1_11 -// cJ1_JPIMMED_1_12 -// cJ1_JPIMMED_1_13 -// cJ1_JPIMMED_1_14 -// cJ1_JPIMMED_1_15 -#endif -#define cJU_JPIMMED_2_02 cJ1_JPIMMED_2_02 -#define cJU_JPIMMED_2_03 cJ1_JPIMMED_2_03 -#ifdef JU_64BIT -// cJ1_JPIMMED_2_04 -// cJ1_JPIMMED_2_05 -// cJ1_JPIMMED_2_06 -// cJ1_JPIMMED_2_07 -#endif -#define cJU_JPIMMED_3_02 cJ1_JPIMMED_3_02 -#ifdef JU_64BIT -// cJ1_JPIMMED_3_03 -// cJ1_JPIMMED_3_04 -// cJ1_JPIMMED_3_05 -// cJ1_JPIMMED_4_02 -// cJ1_JPIMMED_4_03 -// cJ1_JPIMMED_5_02 -// cJ1_JPIMMED_5_03 -// cJ1_JPIMMED_6_02 -// cJ1_JPIMMED_7_02 -#endif -#define cJU_JPIMMED_CAP cJ1_JPIMMED_CAP - -#else // JUDYL **************************************************************** - -#define cJU_JRPNULL cJL_JRPNULL -#define cJU_JPNULL1 cJL_JPNULL1 -#define cJU_JPNULL2 cJL_JPNULL2 -#define cJU_JPNULL3 cJL_JPNULL3 -#ifdef JU_64BIT -#define cJU_JPNULL4 cJL_JPNULL4 -#define cJU_JPNULL5 cJL_JPNULL5 -#define cJU_JPNULL6 cJL_JPNULL6 -#define cJU_JPNULL7 cJL_JPNULL7 -#endif -#define cJU_JPNULLMAX cJL_JPNULLMAX -#define cJU_JPBRANCH_L2 cJL_JPBRANCH_L2 -#define cJU_JPBRANCH_L3 cJL_JPBRANCH_L3 -#ifdef JU_64BIT -#define cJU_JPBRANCH_L4 cJL_JPBRANCH_L4 -#define cJU_JPBRANCH_L5 cJL_JPBRANCH_L5 -#define cJU_JPBRANCH_L6 cJL_JPBRANCH_L6 -#define cJU_JPBRANCH_L7 cJL_JPBRANCH_L7 -#endif -#define cJU_JPBRANCH_L cJL_JPBRANCH_L -#define j__U_BranchBJPPopToWords j__L_BranchBJPPopToWords -#define cJU_JPBRANCH_B2 cJL_JPBRANCH_B2 -#define cJU_JPBRANCH_B3 cJL_JPBRANCH_B3 -#ifdef JU_64BIT -#define cJU_JPBRANCH_B4 cJL_JPBRANCH_B4 -#define cJU_JPBRANCH_B5 cJL_JPBRANCH_B5 -#define cJU_JPBRANCH_B6 cJL_JPBRANCH_B6 -#define cJU_JPBRANCH_B7 cJL_JPBRANCH_B7 -#endif -#define cJU_JPBRANCH_B cJL_JPBRANCH_B -#define cJU_JPBRANCH_U2 cJL_JPBRANCH_U2 -#define cJU_JPBRANCH_U3 cJL_JPBRANCH_U3 -#ifdef JU_64BIT -#define cJU_JPBRANCH_U4 cJL_JPBRANCH_U4 -#define cJU_JPBRANCH_U5 cJL_JPBRANCH_U5 -#define cJU_JPBRANCH_U6 cJL_JPBRANCH_U6 -#define cJU_JPBRANCH_U7 cJL_JPBRANCH_U7 -#endif -#define cJU_JPBRANCH_U cJL_JPBRANCH_U -#define cJU_JPLEAF1 cJL_JPLEAF1 -#define cJU_JPLEAF2 cJL_JPLEAF2 -#define cJU_JPLEAF3 cJL_JPLEAF3 -#ifdef JU_64BIT -#define cJU_JPLEAF4 cJL_JPLEAF4 -#define cJU_JPLEAF5 cJL_JPLEAF5 -#define cJU_JPLEAF6 cJL_JPLEAF6 -#define cJU_JPLEAF7 cJL_JPLEAF7 -#endif -#define cJU_JPLEAF_B1 cJL_JPLEAF_B1 -#define cJU_JPIMMED_1_01 cJL_JPIMMED_1_01 -#define cJU_JPIMMED_2_01 cJL_JPIMMED_2_01 -#define cJU_JPIMMED_3_01 cJL_JPIMMED_3_01 -#ifdef JU_64BIT -#define cJU_JPIMMED_4_01 cJL_JPIMMED_4_01 -#define cJU_JPIMMED_5_01 cJL_JPIMMED_5_01 -#define cJU_JPIMMED_6_01 cJL_JPIMMED_6_01 -#define cJU_JPIMMED_7_01 cJL_JPIMMED_7_01 -#endif -#define cJU_JPIMMED_1_02 cJL_JPIMMED_1_02 -#define cJU_JPIMMED_1_03 cJL_JPIMMED_1_03 -#ifdef JU_64BIT -#define cJU_JPIMMED_1_04 cJL_JPIMMED_1_04 -#define cJU_JPIMMED_1_05 cJL_JPIMMED_1_05 -#define cJU_JPIMMED_1_06 cJL_JPIMMED_1_06 -#define cJU_JPIMMED_1_07 cJL_JPIMMED_1_07 -#define cJU_JPIMMED_2_02 cJL_JPIMMED_2_02 -#define cJU_JPIMMED_2_03 cJL_JPIMMED_2_03 -#define cJU_JPIMMED_3_02 cJL_JPIMMED_3_02 -#endif -#define cJU_JPIMMED_CAP cJL_JPIMMED_CAP - -#endif // JUDYL - - -// **************************************************************************** -// cJU*_ other than JP types: - -#ifdef JUDY1 - -#define cJU_LEAFW_MAXPOP1 cJ1_LEAFW_MAXPOP1 -#ifndef JU_64BIT -#define cJU_LEAF1_MAXPOP1 cJ1_LEAF1_MAXPOP1 -#endif -#define cJU_LEAF2_MAXPOP1 cJ1_LEAF2_MAXPOP1 -#define cJU_LEAF3_MAXPOP1 cJ1_LEAF3_MAXPOP1 -#ifdef JU_64BIT -#define cJU_LEAF4_MAXPOP1 cJ1_LEAF4_MAXPOP1 -#define cJU_LEAF5_MAXPOP1 cJ1_LEAF5_MAXPOP1 -#define cJU_LEAF6_MAXPOP1 cJ1_LEAF6_MAXPOP1 -#define cJU_LEAF7_MAXPOP1 cJ1_LEAF7_MAXPOP1 -#endif -#define cJU_IMMED1_MAXPOP1 cJ1_IMMED1_MAXPOP1 -#define cJU_IMMED2_MAXPOP1 cJ1_IMMED2_MAXPOP1 -#define cJU_IMMED3_MAXPOP1 cJ1_IMMED3_MAXPOP1 -#ifdef JU_64BIT -#define cJU_IMMED4_MAXPOP1 cJ1_IMMED4_MAXPOP1 -#define cJU_IMMED5_MAXPOP1 cJ1_IMMED5_MAXPOP1 -#define cJU_IMMED6_MAXPOP1 cJ1_IMMED6_MAXPOP1 -#define cJU_IMMED7_MAXPOP1 cJ1_IMMED7_MAXPOP1 -#endif - -#define JU_LEAF1POPTOWORDS(Pop1) J1_LEAF1POPTOWORDS(Pop1) -#define JU_LEAF2POPTOWORDS(Pop1) J1_LEAF2POPTOWORDS(Pop1) -#define JU_LEAF3POPTOWORDS(Pop1) J1_LEAF3POPTOWORDS(Pop1) -#ifdef JU_64BIT -#define JU_LEAF4POPTOWORDS(Pop1) J1_LEAF4POPTOWORDS(Pop1) -#define JU_LEAF5POPTOWORDS(Pop1) J1_LEAF5POPTOWORDS(Pop1) -#define JU_LEAF6POPTOWORDS(Pop1) J1_LEAF6POPTOWORDS(Pop1) -#define JU_LEAF7POPTOWORDS(Pop1) J1_LEAF7POPTOWORDS(Pop1) -#endif -#define JU_LEAFWPOPTOWORDS(Pop1) J1_LEAFWPOPTOWORDS(Pop1) - -#ifndef JU_64BIT -#define JU_LEAF1GROWINPLACE(Pop1) J1_LEAF1GROWINPLACE(Pop1) -#endif -#define JU_LEAF2GROWINPLACE(Pop1) J1_LEAF2GROWINPLACE(Pop1) -#define JU_LEAF3GROWINPLACE(Pop1) J1_LEAF3GROWINPLACE(Pop1) -#ifdef JU_64BIT -#define JU_LEAF4GROWINPLACE(Pop1) J1_LEAF4GROWINPLACE(Pop1) -#define JU_LEAF5GROWINPLACE(Pop1) J1_LEAF5GROWINPLACE(Pop1) -#define JU_LEAF6GROWINPLACE(Pop1) J1_LEAF6GROWINPLACE(Pop1) -#define JU_LEAF7GROWINPLACE(Pop1) J1_LEAF7GROWINPLACE(Pop1) -#endif -#define JU_LEAFWGROWINPLACE(Pop1) J1_LEAFWGROWINPLACE(Pop1) - -#define j__udyCreateBranchL j__udy1CreateBranchL -#define j__udyCreateBranchB j__udy1CreateBranchB -#define j__udyCreateBranchU j__udy1CreateBranchU -#define j__udyCascade1 j__udy1Cascade1 -#define j__udyCascade2 j__udy1Cascade2 -#define j__udyCascade3 j__udy1Cascade3 -#ifdef JU_64BIT -#define j__udyCascade4 j__udy1Cascade4 -#define j__udyCascade5 j__udy1Cascade5 -#define j__udyCascade6 j__udy1Cascade6 -#define j__udyCascade7 j__udy1Cascade7 -#endif -#define j__udyCascadeL j__udy1CascadeL -#define j__udyInsertBranch j__udy1InsertBranch - -#define j__udyBranchBToBranchL j__udy1BranchBToBranchL -#ifndef JU_64BIT -#define j__udyLeafB1ToLeaf1 j__udy1LeafB1ToLeaf1 -#endif -#define j__udyLeaf1ToLeaf2 j__udy1Leaf1ToLeaf2 -#define j__udyLeaf2ToLeaf3 j__udy1Leaf2ToLeaf3 -#ifndef JU_64BIT -#define j__udyLeaf3ToLeafW j__udy1Leaf3ToLeafW -#else -#define j__udyLeaf3ToLeaf4 j__udy1Leaf3ToLeaf4 -#define j__udyLeaf4ToLeaf5 j__udy1Leaf4ToLeaf5 -#define j__udyLeaf5ToLeaf6 j__udy1Leaf5ToLeaf6 -#define j__udyLeaf6ToLeaf7 j__udy1Leaf6ToLeaf7 -#define j__udyLeaf7ToLeafW j__udy1Leaf7ToLeafW -#endif - -#define jpm_t j1pm_t -#define Pjpm_t Pj1pm_t - -#define jlb_t j1lb_t -#define Pjlb_t Pj1lb_t - -#define JU_JLB_BITMAP J1_JLB_BITMAP - -#define j__udyAllocJPM j__udy1AllocJ1PM -#define j__udyAllocJBL j__udy1AllocJBL -#define j__udyAllocJBB j__udy1AllocJBB -#define j__udyAllocJBBJP j__udy1AllocJBBJP -#define j__udyAllocJBU j__udy1AllocJBU -#ifndef JU_64BIT -#define j__udyAllocJLL1 j__udy1AllocJLL1 -#endif -#define j__udyAllocJLL2 j__udy1AllocJLL2 -#define j__udyAllocJLL3 j__udy1AllocJLL3 -#ifdef JU_64BIT -#define j__udyAllocJLL4 j__udy1AllocJLL4 -#define j__udyAllocJLL5 j__udy1AllocJLL5 -#define j__udyAllocJLL6 j__udy1AllocJLL6 -#define j__udyAllocJLL7 j__udy1AllocJLL7 -#endif -#define j__udyAllocJLW j__udy1AllocJLW -#define j__udyAllocJLB1 j__udy1AllocJLB1 -#define j__udyFreeJPM j__udy1FreeJ1PM -#define j__udyFreeJBL j__udy1FreeJBL -#define j__udyFreeJBB j__udy1FreeJBB -#define j__udyFreeJBBJP j__udy1FreeJBBJP -#define j__udyFreeJBU j__udy1FreeJBU -#ifndef JU_64BIT -#define j__udyFreeJLL1 j__udy1FreeJLL1 -#endif -#define j__udyFreeJLL2 j__udy1FreeJLL2 -#define j__udyFreeJLL3 j__udy1FreeJLL3 -#ifdef JU_64BIT -#define j__udyFreeJLL4 j__udy1FreeJLL4 -#define j__udyFreeJLL5 j__udy1FreeJLL5 -#define j__udyFreeJLL6 j__udy1FreeJLL6 -#define j__udyFreeJLL7 j__udy1FreeJLL7 -#endif -#define j__udyFreeJLW j__udy1FreeJLW -#define j__udyFreeJLB1 j__udy1FreeJLB1 -#define j__udyFreeSM j__udy1FreeSM - -#define j__uMaxWords j__u1MaxWords - -#ifdef DEBUG -#define JudyCheckPop Judy1CheckPop -#endif - -#else // JUDYL **************************************************************** - -#define cJU_LEAFW_MAXPOP1 cJL_LEAFW_MAXPOP1 -#define cJU_LEAF1_MAXPOP1 cJL_LEAF1_MAXPOP1 -#define cJU_LEAF2_MAXPOP1 cJL_LEAF2_MAXPOP1 -#define cJU_LEAF3_MAXPOP1 cJL_LEAF3_MAXPOP1 -#ifdef JU_64BIT -#define cJU_LEAF4_MAXPOP1 cJL_LEAF4_MAXPOP1 -#define cJU_LEAF5_MAXPOP1 cJL_LEAF5_MAXPOP1 -#define cJU_LEAF6_MAXPOP1 cJL_LEAF6_MAXPOP1 -#define cJU_LEAF7_MAXPOP1 cJL_LEAF7_MAXPOP1 -#endif -#define cJU_IMMED1_MAXPOP1 cJL_IMMED1_MAXPOP1 -#define cJU_IMMED2_MAXPOP1 cJL_IMMED2_MAXPOP1 -#define cJU_IMMED3_MAXPOP1 cJL_IMMED3_MAXPOP1 -#ifdef JU_64BIT -#define cJU_IMMED4_MAXPOP1 cJL_IMMED4_MAXPOP1 -#define cJU_IMMED5_MAXPOP1 cJL_IMMED5_MAXPOP1 -#define cJU_IMMED6_MAXPOP1 cJL_IMMED6_MAXPOP1 -#define cJU_IMMED7_MAXPOP1 cJL_IMMED7_MAXPOP1 -#endif - -#define JU_LEAF1POPTOWORDS(Pop1) JL_LEAF1POPTOWORDS(Pop1) -#define JU_LEAF2POPTOWORDS(Pop1) JL_LEAF2POPTOWORDS(Pop1) -#define JU_LEAF3POPTOWORDS(Pop1) JL_LEAF3POPTOWORDS(Pop1) -#ifdef JU_64BIT -#define JU_LEAF4POPTOWORDS(Pop1) JL_LEAF4POPTOWORDS(Pop1) -#define JU_LEAF5POPTOWORDS(Pop1) JL_LEAF5POPTOWORDS(Pop1) -#define JU_LEAF6POPTOWORDS(Pop1) JL_LEAF6POPTOWORDS(Pop1) -#define JU_LEAF7POPTOWORDS(Pop1) JL_LEAF7POPTOWORDS(Pop1) -#endif -#define JU_LEAFWPOPTOWORDS(Pop1) JL_LEAFWPOPTOWORDS(Pop1) - -#define JU_LEAF1GROWINPLACE(Pop1) JL_LEAF1GROWINPLACE(Pop1) -#define JU_LEAF2GROWINPLACE(Pop1) JL_LEAF2GROWINPLACE(Pop1) -#define JU_LEAF3GROWINPLACE(Pop1) JL_LEAF3GROWINPLACE(Pop1) -#ifdef JU_64BIT -#define JU_LEAF4GROWINPLACE(Pop1) JL_LEAF4GROWINPLACE(Pop1) -#define JU_LEAF5GROWINPLACE(Pop1) JL_LEAF5GROWINPLACE(Pop1) -#define JU_LEAF6GROWINPLACE(Pop1) JL_LEAF6GROWINPLACE(Pop1) -#define JU_LEAF7GROWINPLACE(Pop1) JL_LEAF7GROWINPLACE(Pop1) -#endif -#define JU_LEAFWGROWINPLACE(Pop1) JL_LEAFWGROWINPLACE(Pop1) - -#define j__udyCreateBranchL j__udyLCreateBranchL -#define j__udyCreateBranchB j__udyLCreateBranchB -#define j__udyCreateBranchU j__udyLCreateBranchU -#define j__udyCascade1 j__udyLCascade1 -#define j__udyCascade2 j__udyLCascade2 -#define j__udyCascade3 j__udyLCascade3 -#ifdef JU_64BIT -#define j__udyCascade4 j__udyLCascade4 -#define j__udyCascade5 j__udyLCascade5 -#define j__udyCascade6 j__udyLCascade6 -#define j__udyCascade7 j__udyLCascade7 -#endif -#define j__udyCascadeL j__udyLCascadeL -#define j__udyInsertBranch j__udyLInsertBranch - -#define j__udyBranchBToBranchL j__udyLBranchBToBranchL -#define j__udyLeafB1ToLeaf1 j__udyLLeafB1ToLeaf1 -#define j__udyLeaf1ToLeaf2 j__udyLLeaf1ToLeaf2 -#define j__udyLeaf2ToLeaf3 j__udyLLeaf2ToLeaf3 -#ifndef JU_64BIT -#define j__udyLeaf3ToLeafW j__udyLLeaf3ToLeafW -#else -#define j__udyLeaf3ToLeaf4 j__udyLLeaf3ToLeaf4 -#define j__udyLeaf4ToLeaf5 j__udyLLeaf4ToLeaf5 -#define j__udyLeaf5ToLeaf6 j__udyLLeaf5ToLeaf6 -#define j__udyLeaf6ToLeaf7 j__udyLLeaf6ToLeaf7 -#define j__udyLeaf7ToLeafW j__udyLLeaf7ToLeafW -#endif - -#define jpm_t jLpm_t -#define Pjpm_t PjLpm_t - -#define jlb_t jLlb_t -#define Pjlb_t PjLlb_t - -#define JU_JLB_BITMAP JL_JLB_BITMAP - -#define j__udyAllocJPM j__udyLAllocJLPM -#define j__udyAllocJBL j__udyLAllocJBL -#define j__udyAllocJBB j__udyLAllocJBB -#define j__udyAllocJBBJP j__udyLAllocJBBJP -#define j__udyAllocJBU j__udyLAllocJBU -#define j__udyAllocJLL1 j__udyLAllocJLL1 -#define j__udyAllocJLL2 j__udyLAllocJLL2 -#define j__udyAllocJLL3 j__udyLAllocJLL3 -#ifdef JU_64BIT -#define j__udyAllocJLL4 j__udyLAllocJLL4 -#define j__udyAllocJLL5 j__udyLAllocJLL5 -#define j__udyAllocJLL6 j__udyLAllocJLL6 -#define j__udyAllocJLL7 j__udyLAllocJLL7 -#endif -#define j__udyAllocJLW j__udyLAllocJLW -#define j__udyAllocJLB1 j__udyLAllocJLB1 -// j__udyLAllocJV -#define j__udyFreeJPM j__udyLFreeJLPM -#define j__udyFreeJBL j__udyLFreeJBL -#define j__udyFreeJBB j__udyLFreeJBB -#define j__udyFreeJBBJP j__udyLFreeJBBJP -#define j__udyFreeJBU j__udyLFreeJBU -#define j__udyFreeJLL1 j__udyLFreeJLL1 -#define j__udyFreeJLL2 j__udyLFreeJLL2 -#define j__udyFreeJLL3 j__udyLFreeJLL3 -#ifdef JU_64BIT -#define j__udyFreeJLL4 j__udyLFreeJLL4 -#define j__udyFreeJLL5 j__udyLFreeJLL5 -#define j__udyFreeJLL6 j__udyLFreeJLL6 -#define j__udyFreeJLL7 j__udyLFreeJLL7 -#endif -#define j__udyFreeJLW j__udyLFreeJLW -#define j__udyFreeJLB1 j__udyLFreeJLB1 -#define j__udyFreeSM j__udyLFreeSM -// j__udyLFreeJV - -#define j__uMaxWords j__uLMaxWords - -#ifdef DEBUG -#define JudyCheckPop JudyLCheckPop -#endif - -#endif // JUDYL - -#endif // _JUDYPRIVATE1L_INCLUDED diff --git a/libjudy/src/JudyCommon/JudyPrivateBranch.h b/libjudy/src/JudyCommon/JudyPrivateBranch.h deleted file mode 100644 index 70a2d54561..0000000000 --- a/libjudy/src/JudyCommon/JudyPrivateBranch.h +++ /dev/null @@ -1,779 +0,0 @@ -#ifndef _JUDY_PRIVATE_BRANCH_INCLUDED -#define _JUDY_PRIVATE_BRANCH_INCLUDED -// _________________ -// -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.57 $ $Source: /judy/src/JudyCommon/JudyPrivateBranch.h $ -// -// Header file for all Judy sources, for global but private (non-exported) -// declarations specific to branch support. -// -// See also the "Judy Shop Manual" (try judy/doc/int/JudyShopManual.*). - - -// **************************************************************************** -// JUDY POINTER (JP) SUPPORT -// **************************************************************************** -// -// This "rich pointer" object is pivotal to Judy execution. -// -// JP CONTAINING OTHER THAN IMMEDIATE INDEXES: -// -// If the JP points to a linear or bitmap leaf, jp_DcdPopO contains the -// Population-1 in LSbs and Decode (Dcd) bytes in the MSBs. (In practice the -// Decode bits are masked off while accessing the Pop0 bits.) -// -// The Decode Size, the number of Dcd bytes available, is encoded in jpo_Type. -// It can also be thought of as the number of states "skipped" in the SM, where -// each state decodes 8 bits = 1 byte. -// -// TBD: Dont need two structures, except possibly to force jp_Type to highest -// address! -// -// Note: The jpo_u union is not required by HP-UX or Linux but Win32 because -// the cl.exe compiler otherwise refuses to pack a bitfield (DcdPopO) with -// anything else, even with the -Zp option. This is pretty ugly, but -// fortunately portable, and its all hide-able by macros (see below). - -typedef struct J_UDY_POINTER_OTHERS // JPO. - { - Word_t j_po_Addr; // first word: Pjp_t, Word_t, etc. - union { -// Word_t j_po_DcdPop0:cJU_BITSPERWORD-cJU_BITSPERBYTE; - uint8_t j_po_DcdP0[sizeof(Word_t) - 1]; - uint8_t j_po_Bytes[sizeof(Word_t)]; // last byte = jp_Type. - } jpo_u; - } jpo_t; - - -// JP CONTAINING IMMEDIATE INDEXES: -// -// j_pi_1Index[] plus j_pi_LIndex[] together hold as many N-byte (1..3-byte -// [1..7-byte]) Indexes as will fit in sizeof(jpi_t) less 1 byte for j_pi_Type -// (that is, 7..1 [15..1] Indexes). -// -// For Judy1, j_pi_1Index[] is used and j_pi_LIndex[] is not used. -// For JudyL, j_pi_LIndex[] is used and j_pi_1Index[] is not used. -// -// Note: Actually when Pop1 = 1, jpi_t is not used, and the least bytes of the -// single Index are stored in j_po_DcdPopO, for both Judy1 and JudyL, so for -// JudyL the j_po_Addr field can hold the target value. -// -// TBD: Revise this structure to not overload j_po_DcdPopO this way? The -// current arrangement works, its just confusing. - -typedef struct _JUDY_POINTER_IMMED // JPI. - { - uint8_t j_pi_1Index[sizeof(Word_t)]; // see above. - uint8_t j_pi_LIndex[sizeof(Word_t) - 1]; // see above. - uint8_t j_pi_Type; // JP type, 1 of cJ*_JPIMMED*. - } jpi_t; - - -// UNION OF JP TYPES: -// -// A branch is an array of cJU_BRANCHUNUMJPS (256) of this object, or an -// alternate data type such as: A linear branch which is a list of 2..7 JPs, -// or a bitmap branch which contains 8 lists of 0..32 JPs. JPs reside only in -// branches of a Judy SM. - -typedef union J_UDY_POINTER // JP. - { - jpo_t j_po; // other than immediate indexes. - jpi_t j_pi; // immediate indexes. - } jp_t, *Pjp_t; - -// For coding convenience: -// -// Note, jp_Type has the same bits in jpo_t and jpi_t. - -#define jp_1Index j_pi.j_pi_1Index // for storing Indexes in first word. -#define jp_LIndex j_pi.j_pi_LIndex // for storing Indexes in second word. -#define jp_Addr j_po.j_po_Addr -//#define jp_DcdPop0 j_po.jpo_u.j_po_DcdPop0 -#define jp_Type j_po.jpo_u.j_po_Bytes[sizeof(Word_t) - 1] -#define jp_DcdP0 j_po.jpo_u.j_po_DcdP0 - - -// **************************************************************************** -// JUDY POINTER (JP) -- RELATED MACROS AND CONSTANTS -// **************************************************************************** - -// EXTRACT VALUES FROM JP: -// -// Masks for the bytes in the Dcd and Pop0 parts of jp_DcdPopO: -// -// cJU_DCDMASK() consists of a mask that excludes the (LSb) Pop0 bytes and -// also, just to be safe, the top byte of the word, since jp_DcdPopO is 1 byte -// less than a full word. -// -// Note: These are constant macros (cJU) because cPopBytes should be a -// constant. Also note cPopBytes == state in the SM. - -#define cJU_POP0MASK(cPopBytes) JU_LEASTBYTESMASK(cPopBytes) - -#define cJU_DCDMASK(cPopBytes) \ - ((cJU_ALLONES >> cJU_BITSPERBYTE) & (~cJU_POP0MASK(cPopBytes))) - -// Mask off the high byte from INDEX to it can be compared to DcdPopO: - -#define JU_TRIMTODCDSIZE(INDEX) ((cJU_ALLONES >> cJU_BITSPERBYTE) & (INDEX)) - -// Get from jp_DcdPopO the Pop0 for various branch JP Types: -// -// Note: There are no simple macros for cJU_BRANCH* Types because their -// populations must be added up and dont reside in an already-calculated -// place. - -#define JU_JPBRANCH_POP0(PJP,cPopBytes) \ - (JU_JPDCDPOP0(PJP) & cJU_POP0MASK(cPopBytes)) - -// METHOD FOR DETERMINING IF OBJECTS HAVE ROOM TO GROW: -// -// J__U_GROWCK() is a generic method to determine if an object can grow in -// place, based on whether the next population size (one more) would use the -// same space. - -#define J__U_GROWCK(POP1,MAXPOP1,POPTOWORDS) \ - (((POP1) != (MAXPOP1)) && (POPTOWORDS[POP1] == POPTOWORDS[(POP1) + 1])) - -#define JU_BRANCHBJPGROWINPLACE(NumJPs) \ - J__U_GROWCK(NumJPs, cJU_BITSPERSUBEXPB, j__U_BranchBJPPopToWords) - - -// DETERMINE IF AN INDEX IS (NOT) IN A JPS EXPANSE: - -#define JU_DCDNOTMATCHINDEX(INDEX,PJP,POP0BYTES) \ - (((INDEX) ^ JU_JPDCDPOP0(PJP)) & cJU_DCDMASK(POP0BYTES)) - - -// NUMBER OF JPs IN AN UNCOMPRESSED BRANCH: -// -// An uncompressed branch is simply an array of 256 Judy Pointers (JPs). It is -// a minimum cacheline fill object. Define it here before its first needed. - -#define cJU_BRANCHUNUMJPS cJU_SUBEXPPERSTATE - - -// **************************************************************************** -// JUDY BRANCH LINEAR (JBL) SUPPORT -// **************************************************************************** -// -// A linear branch is a way of compressing empty expanses (null JPs) out of an -// uncompressed 256-way branch, when the number of populated expanses is so -// small that even a bitmap branch is excessive. -// -// The maximum number of JPs in a Judy linear branch: -// -// Note: This number results in a 1-cacheline sized structure. Previous -// versions had a larger struct so a linear branch didnt become a bitmap -// branch until the memory consumed was even, but for speed, its better to -// switch "sooner" and keep a linear branch fast. - -#define cJU_BRANCHLMAXJPS 7 - - -// LINEAR BRANCH STRUCT: -// -// 1-byte count, followed by array of byte-sized expanses, followed by JPs. - -typedef struct J__UDY_BRANCH_LINEAR - { - uint8_t jbl_NumJPs; // num of JPs (Pjp_t), 1..N. - uint8_t jbl_Expanse[cJU_BRANCHLMAXJPS]; // 1..7 MSbs of pop exps. - jp_t jbl_jp [cJU_BRANCHLMAXJPS]; // JPs for populated exps. - } jbl_t, * Pjbl_t; - - -// **************************************************************************** -// JUDY BRANCH BITMAP (JBB) SUPPORT -// **************************************************************************** -// -// A bitmap branch is a way of compressing empty expanses (null JPs) out of -// uncompressed 256-way branch. This costs 1 additional cache line fill, but -// can save a lot of memory when it matters most, near the leaves, and -// typically there will be only one at most in the path to any Index (leaf). -// -// The bitmap indicates which of the cJU_BRANCHUNUMJPS (256) JPs in the branch -// are NOT null, that is, their expanses are populated. The jbb_t also -// contains N pointers to "mini" Judy branches ("subexpanses") of up to M JPs -// each (see BITMAP_BRANCHMxN, for example, BITMAP_BRANCH32x8), where M x N = -// cJU_BRANCHUNUMJPS. These are dynamically allocated and never contain -// cJ*_JPNULL* jp_Types. An empty subexpanse is represented by no bit sets in -// the corresponding subexpanse bitmap, in which case the corresponding -// jbbs_Pjp pointers value is unused. -// -// Note that the number of valid JPs in each 1-of-N subexpanses is determined -// by POPULATION rather than by EXPANSE -- the desired outcome to save memory -// when near the leaves. Note that the memory required for 185 JPs is about as -// much as an uncompressed 256-way branch, therefore 184 is set as the maximum. -// However, it is expected that a conversion to an uncompressed 256-way branch -// will normally take place before this limit is reached for other reasons, -// such as improving performance when the "wasted" memory is well amortized by -// the population under the branch, preserving an acceptable overall -// bytes/Index in the Judy array. -// -// The number of pointers to arrays of JPs in the Judy bitmap branch: -// -// Note: The numbers below are the same in both 32 and 64 bit systems. - -#define cJU_BRANCHBMAXJPS 184 // maximum JPs for bitmap branches. - -// Convenience wrappers for referencing BranchB bitmaps or JP subarray -// pointers: -// -// Note: JU_JBB_PJP produces a "raw" memory address that must pass through -// P_JP before use, except when freeing memory: - -#define JU_JBB_BITMAP(Pjbb, SubExp) ((Pjbb)->jbb_jbbs[SubExp].jbbs_Bitmap) -#define JU_JBB_PJP( Pjbb, SubExp) ((Pjbb)->jbb_jbbs[SubExp].jbbs_Pjp) - -#define JU_SUBEXPB(Digit) (((Digit) / cJU_BITSPERSUBEXPB) & (cJU_NUMSUBEXPB-1)) - -#define JU_BITMAPTESTB(Pjbb, Index) \ - (JU_JBB_BITMAP(Pjbb, JU_SUBEXPB(Index)) & JU_BITPOSMASKB(Index)) - -#define JU_BITMAPSETB(Pjbb, Index) \ - (JU_JBB_BITMAP(Pjbb, JU_SUBEXPB(Index)) |= JU_BITPOSMASKB(Index)) - -// Note: JU_BITMAPCLEARB is not defined because the code does it a faster way. - -typedef struct J__UDY_BRANCH_BITMAP_SUBEXPANSE - { - BITMAPB_t jbbs_Bitmap; - Pjp_t jbbs_Pjp; - - } jbbs_t; - -typedef struct J__UDY_BRANCH_BITMAP - { - jbbs_t jbb_jbbs [cJU_NUMSUBEXPB]; -#ifdef SUBEXPCOUNTS - Word_t jbb_subPop1[cJU_NUMSUBEXPB]; -#endif - } jbb_t, * Pjbb_t; - -#define JU_BRANCHJP_NUMJPSTOWORDS(NumJPs) (j__U_BranchBJPPopToWords[NumJPs]) - -#ifdef SUBEXPCOUNTS -#define cJU_NUMSUBEXPU 16 // number of subexpanse counts. -#endif - - -// **************************************************************************** -// JUDY BRANCH UNCOMPRESSED (JBU) SUPPORT -// **************************************************************************** - -// Convenience wrapper for referencing BranchU JPs: -// -// Note: This produces a non-"raw" address already passed through P_JBU(). - -#define JU_JBU_PJP(Pjp,Index,Level) \ - (&((P_JBU((Pjp)->jp_Addr))->jbu_jp[JU_DIGITATSTATE(Index, Level)])) -#define JU_JBU_PJP0(Pjp) \ - (&((P_JBU((Pjp)->jp_Addr))->jbu_jp[0])) - -typedef struct J__UDY_BRANCH_UNCOMPRESSED - { - jp_t jbu_jp [cJU_BRANCHUNUMJPS]; // JPs for populated exp. -#ifdef SUBEXPCOUNTS - Word_t jbu_subPop1[cJU_NUMSUBEXPU]; -#endif - } jbu_t, * Pjbu_t; - - -// **************************************************************************** -// OTHER SUPPORT FOR JUDY STATE MACHINES (SMs) -// **************************************************************************** - -// OBJECT SIZES IN WORDS: -// -// Word_ts per various JudyL structures that have constant sizes. -// cJU_WORDSPERJP should always be 2; this is fundamental to the Judy -// structures. - -#define cJU_WORDSPERJP (sizeof(jp_t) / cJU_BYTESPERWORD) -#define cJU_WORDSPERCL (cJU_BYTESPERCL / cJU_BYTESPERWORD) - - -// OPPORTUNISTIC UNCOMPRESSION: -// -// Define populations at which a BranchL or BranchB must convert to BranchU. -// Earlier conversion is possible with good memory efficiency -- see below. - -#ifndef NO_BRANCHU - -// Max population below BranchL, then convert to BranchU: - -#define JU_BRANCHL_MAX_POP 1000 - -// Minimum global population increment before next conversion of a BranchB to a -// BranchU: -// -// This is was done to allow malloc() to coalesce memory before the next big -// (~512 words) allocation. - -#define JU_BTOU_POP_INCREMENT 300 - -// Min/max population below BranchB, then convert to BranchU: - -#define JU_BRANCHB_MIN_POP 135 -#define JU_BRANCHB_MAX_POP 750 - -#else // NO_BRANCHU - -// These are set up to have conservative conversion schedules to BranchU: - -#define JU_BRANCHL_MAX_POP (-1UL) -#define JU_BTOU_POP_INCREMENT 300 -#define JU_BRANCHB_MIN_POP 1000 -#define JU_BRANCHB_MAX_POP (-1UL) - -#endif // NO_BRANCHU - - -// MISCELLANEOUS MACROS: - -// Get N most significant bits from the shifted Index word: -// -// As Index words are decoded, they are shifted left so only relevant, -// undecoded Index bits remain. - -#define JU_BITSFROMSFTIDX(SFTIDX, N) ((SFTIDX) >> (cJU_BITSPERWORD - (N))) - -// TBD: I have my doubts about the necessity of these macros (dlb): - -// Produce 1-digit mask at specified state: - -#define cJU_MASKATSTATE(State) (0xffL << (((State) - 1) * cJU_BITSPERBYTE)) - -// Get byte (digit) from Index at the specified state, right justified: -// -// Note: State must be 1..cJU_ROOTSTATE, and Digits must be 1..(cJU_ROOTSTATE -// - 1), but theres no way to assert these within an expression. - -#define JU_DIGITATSTATE(Index,cState) \ - ((uint8_t)((Index) >> (((cState) - 1) * cJU_BITSPERBYTE))) - -// Similarly, place byte (digit) at correct position for the specified state: -// -// Note: Cast digit to a Word_t first so there are no complaints or problems -// about shifting it more than 32 bits on a 64-bit system, say, when it is a -// uint8_t from jbl_Expanse[]. (Believe it or not, the C standard says to -// promote an unsigned char to a signed int; -Ac does not do this, but -Ae -// does.) -// -// Also, to make lint happy, cast the whole result again because apparently -// shifting a Word_t does not result in a Word_t! - -#define JU_DIGITTOSTATE(Digit,cState) \ - ((Word_t) (((Word_t) (Digit)) << (((cState) - 1) * cJU_BITSPERBYTE))) - -#endif // ! _JUDY_PRIVATE_BRANCH_INCLUDED - - -#ifdef TEST_INSDEL - -// **************************************************************************** -// TEST CODE FOR INSERT/DELETE MACROS -// **************************************************************************** -// -// To use this, compile a temporary *.c file containing: -// -// #define DEBUG -// #define JUDY_ASSERT -// #define TEST_INSDEL -// #include "JudyPrivate.h" -// #include "JudyPrivateBranch.h" -// -// Use a command like this: cc -Ae +DD64 -I. -I JudyCommon -o t t.c -// For best results, include +DD64 on a 64-bit system. -// -// This test code exercises some tricky macros, but the output must be studied -// manually to verify it. Assume that for even-index testing, whole words -// (Word_t) suffices. - -#include - -#define INDEXES 3 // in each array. - - -// **************************************************************************** -// I N I T -// -// Set up variables for next test. See usage. - -FUNCTION void Init ( - int base, - PWord_t PeIndex, - PWord_t PoIndex, - PWord_t Peleaf, // always whole words. -#ifndef JU_64BIT - uint8_t * Poleaf3) -#else - uint8_t * Poleaf3, - uint8_t * Poleaf5, - uint8_t * Poleaf6, - uint8_t * Poleaf7) -#endif -{ - int offset; - - *PeIndex = 99; - - for (offset = 0; offset <= INDEXES; ++offset) - Peleaf[offset] = base + offset; - - for (offset = 0; offset < (INDEXES + 1) * 3; ++offset) - Poleaf3[offset] = base + offset; - -#ifndef JU_64BIT - *PoIndex = (91 << 24) | (92 << 16) | (93 << 8) | 94; -#else - - *PoIndex = (91L << 56) | (92L << 48) | (93L << 40) | (94L << 32) - | (95L << 24) | (96L << 16) | (97L << 8) | 98L; - - for (offset = 0; offset < (INDEXES + 1) * 5; ++offset) - Poleaf5[offset] = base + offset; - - for (offset = 0; offset < (INDEXES + 1) * 6; ++offset) - Poleaf6[offset] = base + offset; - - for (offset = 0; offset < (INDEXES + 1) * 7; ++offset) - Poleaf7[offset] = base + offset; -#endif - -} // Init() - - -// **************************************************************************** -// P R I N T L E A F -// -// Print the byte values in a leaf. - -FUNCTION void PrintLeaf ( - char * Label, // for output. - int IOffset, // insertion offset in array. - int Indsize, // index size in bytes. - uint8_t * PLeaf) // array of Index bytes. -{ - int offset; // in PLeaf. - int byte; // in one word. - - (void) printf("%s %u: ", Label, IOffset); - - for (offset = 0; offset <= INDEXES; ++offset) - { - for (byte = 0; byte < Indsize; ++byte) - (void) printf("%2d", PLeaf[(offset * Indsize) + byte]); - - (void) printf(" "); - } - - (void) printf("\n"); - -} // PrintLeaf() - - -// **************************************************************************** -// M A I N -// -// Test program. - -FUNCTION main() -{ - Word_t eIndex; // even, to insert. - Word_t oIndex; // odd, to insert. - Word_t eleaf [ INDEXES + 1]; // even leaf, index size 4. - uint8_t oleaf3[(INDEXES + 1) * 3]; // odd leaf, index size 3. -#ifdef JU_64BIT - uint8_t oleaf5[(INDEXES + 1) * 5]; // odd leaf, index size 5. - uint8_t oleaf6[(INDEXES + 1) * 6]; // odd leaf, index size 6. - uint8_t oleaf7[(INDEXES + 1) * 7]; // odd leaf, index size 7. -#endif - Word_t eleaf_2 [ INDEXES + 1]; // same, but second arrays: - uint8_t oleaf3_2[(INDEXES + 1) * 3]; -#ifdef JU_64BIT - uint8_t oleaf5_2[(INDEXES + 1) * 5]; - uint8_t oleaf6_2[(INDEXES + 1) * 6]; - uint8_t oleaf7_2[(INDEXES + 1) * 7]; -#endif - int ioffset; // index insertion offset. - -#ifndef JU_64BIT -#define INIT Init( 0, & eIndex, & oIndex, eleaf, oleaf3) -#define INIT2 INIT; Init(50, & eIndex, & oIndex, eleaf_2, oleaf3_2) -#else -#define INIT Init( 0, & eIndex, & oIndex, eleaf, oleaf3, \ - oleaf5, oleaf6, oleaf7) -#define INIT2 INIT; Init(50, & eIndex, & oIndex, eleaf_2, oleaf3_2, \ - oleaf5_2, oleaf6_2, oleaf7_2) -#endif - -#define WSIZE sizeof (Word_t) // shorthand. - -#ifdef PRINTALL // to turn on "noisy" printouts. -#define PRINTLEAF(Label,IOffset,Indsize,PLeaf) \ - PrintLeaf(Label,IOffset,Indsize,PLeaf) -#else -#define PRINTLEAF(Label,IOffset,Indsize,PLeaf) \ - if (ioffset == 0) \ - PrintLeaf(Label,IOffset,Indsize,PLeaf) -#endif - - (void) printf( -"In each case, tests operate on an initial array of %d indexes. Even-index\n" -"tests set index values to 0,1,2...; odd-index tests set byte values to\n" -"0,1,2... Inserted indexes have a value of 99 or else byte values 91,92,...\n", - INDEXES); - - (void) puts("\nJU_INSERTINPLACE():"); - - for (ioffset = 0; ioffset <= INDEXES; ++ioffset) - { - INIT; - PRINTLEAF("Before", ioffset, WSIZE, (uint8_t *) eleaf); - JU_INSERTINPLACE(eleaf, INDEXES, ioffset, eIndex); - PrintLeaf("After ", ioffset, WSIZE, (uint8_t *) eleaf); - } - - (void) puts("\nJU_INSERTINPLACE3():"); - - for (ioffset = 0; ioffset <= INDEXES; ++ioffset) - { - INIT; - PRINTLEAF("Before", ioffset, 3, oleaf3); - JU_INSERTINPLACE3(oleaf3, INDEXES, ioffset, oIndex); - PrintLeaf("After ", ioffset, 3, oleaf3); - } - -#ifdef JU_64BIT - (void) puts("\nJU_INSERTINPLACE5():"); - - for (ioffset = 0; ioffset <= INDEXES; ++ioffset) - { - INIT; - PRINTLEAF("Before", ioffset, 5, oleaf5); - JU_INSERTINPLACE5(oleaf5, INDEXES, ioffset, oIndex); - PrintLeaf("After ", ioffset, 5, oleaf5); - } - - (void) puts("\nJU_INSERTINPLACE6():"); - - for (ioffset = 0; ioffset <= INDEXES; ++ioffset) - { - INIT; - PRINTLEAF("Before", ioffset, 6, oleaf6); - JU_INSERTINPLACE6(oleaf6, INDEXES, ioffset, oIndex); - PrintLeaf("After ", ioffset, 6, oleaf6); - } - - (void) puts("\nJU_INSERTINPLACE7():"); - - for (ioffset = 0; ioffset <= INDEXES; ++ioffset) - { - INIT; - PRINTLEAF("Before", ioffset, 7, oleaf7); - JU_INSERTINPLACE7(oleaf7, INDEXES, ioffset, oIndex); - PrintLeaf("After ", ioffset, 7, oleaf7); - } -#endif // JU_64BIT - - (void) puts("\nJU_DELETEINPLACE():"); - - for (ioffset = 0; ioffset < INDEXES; ++ioffset) - { - INIT; - PRINTLEAF("Before", ioffset, WSIZE, (uint8_t *) eleaf); - JU_DELETEINPLACE(eleaf, INDEXES, ioffset); - PrintLeaf("After ", ioffset, WSIZE, (uint8_t *) eleaf); - } - - (void) puts("\nJU_DELETEINPLACE_ODD(3):"); - - for (ioffset = 0; ioffset < INDEXES; ++ioffset) - { - INIT; - PRINTLEAF("Before", ioffset, 3, oleaf3); - JU_DELETEINPLACE_ODD(oleaf3, INDEXES, ioffset, 3); - PrintLeaf("After ", ioffset, 3, oleaf3); - } - -#ifdef JU_64BIT - (void) puts("\nJU_DELETEINPLACE_ODD(5):"); - - for (ioffset = 0; ioffset < INDEXES; ++ioffset) - { - INIT; - PRINTLEAF("Before", ioffset, 5, oleaf5); - JU_DELETEINPLACE_ODD(oleaf5, INDEXES, ioffset, 5); - PrintLeaf("After ", ioffset, 5, oleaf5); - } - - (void) puts("\nJU_DELETEINPLACE_ODD(6):"); - - for (ioffset = 0; ioffset < INDEXES; ++ioffset) - { - INIT; - PRINTLEAF("Before", ioffset, 6, oleaf6); - JU_DELETEINPLACE_ODD(oleaf6, INDEXES, ioffset, 6); - PrintLeaf("After ", ioffset, 6, oleaf6); - } - - (void) puts("\nJU_DELETEINPLACE_ODD(7):"); - - for (ioffset = 0; ioffset < INDEXES; ++ioffset) - { - INIT; - PRINTLEAF("Before", ioffset, 7, oleaf7); - JU_DELETEINPLACE_ODD(oleaf7, INDEXES, ioffset, 7); - PrintLeaf("After ", ioffset, 7, oleaf7); - } -#endif // JU_64BIT - - (void) puts("\nJU_INSERTCOPY():"); - - for (ioffset = 0; ioffset <= INDEXES; ++ioffset) - { - INIT2; - PRINTLEAF("Before, src ", ioffset, WSIZE, (uint8_t *) eleaf); - PRINTLEAF("Before, dest", ioffset, WSIZE, (uint8_t *) eleaf_2); - JU_INSERTCOPY(eleaf_2, eleaf, INDEXES, ioffset, eIndex); - PRINTLEAF("After, src ", ioffset, WSIZE, (uint8_t *) eleaf); - PrintLeaf("After, dest", ioffset, WSIZE, (uint8_t *) eleaf_2); - } - - (void) puts("\nJU_INSERTCOPY3():"); - - for (ioffset = 0; ioffset <= INDEXES; ++ioffset) - { - INIT2; - PRINTLEAF("Before, src ", ioffset, 3, oleaf3); - PRINTLEAF("Before, dest", ioffset, 3, oleaf3_2); - JU_INSERTCOPY3(oleaf3_2, oleaf3, INDEXES, ioffset, oIndex); - PRINTLEAF("After, src ", ioffset, 3, oleaf3); - PrintLeaf("After, dest", ioffset, 3, oleaf3_2); - } - -#ifdef JU_64BIT - (void) puts("\nJU_INSERTCOPY5():"); - - for (ioffset = 0; ioffset <= INDEXES; ++ioffset) - { - INIT2; - PRINTLEAF("Before, src ", ioffset, 5, oleaf5); - PRINTLEAF("Before, dest", ioffset, 5, oleaf5_2); - JU_INSERTCOPY5(oleaf5_2, oleaf5, INDEXES, ioffset, oIndex); - PRINTLEAF("After, src ", ioffset, 5, oleaf5); - PrintLeaf("After, dest", ioffset, 5, oleaf5_2); - } - - (void) puts("\nJU_INSERTCOPY6():"); - - for (ioffset = 0; ioffset <= INDEXES; ++ioffset) - { - INIT2; - PRINTLEAF("Before, src ", ioffset, 6, oleaf6); - PRINTLEAF("Before, dest", ioffset, 6, oleaf6_2); - JU_INSERTCOPY6(oleaf6_2, oleaf6, INDEXES, ioffset, oIndex); - PRINTLEAF("After, src ", ioffset, 6, oleaf6); - PrintLeaf("After, dest", ioffset, 6, oleaf6_2); - } - - (void) puts("\nJU_INSERTCOPY7():"); - - for (ioffset = 0; ioffset <= INDEXES; ++ioffset) - { - INIT2; - PRINTLEAF("Before, src ", ioffset, 7, oleaf7); - PRINTLEAF("Before, dest", ioffset, 7, oleaf7_2); - JU_INSERTCOPY7(oleaf7_2, oleaf7, INDEXES, ioffset, oIndex); - PRINTLEAF("After, src ", ioffset, 7, oleaf7); - PrintLeaf("After, dest", ioffset, 7, oleaf7_2); - } -#endif // JU_64BIT - - (void) puts("\nJU_DELETECOPY():"); - - for (ioffset = 0; ioffset < INDEXES; ++ioffset) - { - INIT2; - PRINTLEAF("Before, src ", ioffset, WSIZE, (uint8_t *) eleaf); - PRINTLEAF("Before, dest", ioffset, WSIZE, (uint8_t *) eleaf_2); - JU_DELETECOPY(eleaf_2, eleaf, INDEXES, ioffset, ignore); - PRINTLEAF("After, src ", ioffset, WSIZE, (uint8_t *) eleaf); - PrintLeaf("After, dest", ioffset, WSIZE, (uint8_t *) eleaf_2); - } - - (void) puts("\nJU_DELETECOPY_ODD(3):"); - - for (ioffset = 0; ioffset < INDEXES; ++ioffset) - { - INIT2; - PRINTLEAF("Before, src ", ioffset, 3, oleaf3); - PRINTLEAF("Before, dest", ioffset, 3, oleaf3_2); - JU_DELETECOPY_ODD(oleaf3_2, oleaf3, INDEXES, ioffset, 3); - PRINTLEAF("After, src ", ioffset, 3, oleaf3); - PrintLeaf("After, dest", ioffset, 3, oleaf3_2); - } - -#ifdef JU_64BIT - (void) puts("\nJU_DELETECOPY_ODD(5):"); - - for (ioffset = 0; ioffset < INDEXES; ++ioffset) - { - INIT2; - PRINTLEAF("Before, src ", ioffset, 5, oleaf5); - PRINTLEAF("Before, dest", ioffset, 5, oleaf5_2); - JU_DELETECOPY_ODD(oleaf5_2, oleaf5, INDEXES, ioffset, 5); - PRINTLEAF("After, src ", ioffset, 5, oleaf5); - PrintLeaf("After, dest", ioffset, 5, oleaf5_2); - } - - (void) puts("\nJU_DELETECOPY_ODD(6):"); - - for (ioffset = 0; ioffset < INDEXES; ++ioffset) - { - INIT2; - PRINTLEAF("Before, src ", ioffset, 6, oleaf6); - PRINTLEAF("Before, dest", ioffset, 6, oleaf6_2); - JU_DELETECOPY_ODD(oleaf6_2, oleaf6, INDEXES, ioffset, 6); - PRINTLEAF("After, src ", ioffset, 6, oleaf6); - PrintLeaf("After, dest", ioffset, 6, oleaf6_2); - } - - (void) puts("\nJU_DELETECOPY_ODD(7):"); - - for (ioffset = 0; ioffset < INDEXES; ++ioffset) - { - INIT2; - PRINTLEAF("Before, src ", ioffset, 7, oleaf7); - PRINTLEAF("Before, dest", ioffset, 7, oleaf7_2); - JU_DELETECOPY_ODD(oleaf7_2, oleaf7, INDEXES, ioffset, 7); - PRINTLEAF("After, src ", ioffset, 7, oleaf7); - PrintLeaf("After, dest", ioffset, 7, oleaf7_2); - } -#endif // JU_64BIT - - return(0); - -} // main() - -#endif // TEST_INSDEL diff --git a/libjudy/src/JudyCommon/JudyTables.c b/libjudy/src/JudyCommon/JudyTables.c deleted file mode 100644 index 5b6009f0b7..0000000000 --- a/libjudy/src/JudyCommon/JudyTables.c +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.37 $ $Source: /judy/src/JudyCommon/JudyTables.c $ - -#ifndef JU_WIN -#include // unavailable on win_*. -#endif - -#include -#include - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#define TERMINATOR 999 // terminator for Alloc tables - -#define BPW sizeof(Word_t) // define bytes per word - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -FILE *fd; - -// Definitions come from header files Judy1.h and JudyL.h: - -int AllocSizes[] = ALLOCSIZES; - -#define ROUNDUP(BYTES,BPW,OFFSETW) \ - ((((BYTES) + (BPW) - 1) / (BPW)) + (OFFSETW)) - - -// **************************************************************************** -// G E N T A B L E -// -// Note: "const" is required for newer compilers. - -FUNCTION void GenTable( - const char * TableName, // name of table string - const char * TableSize, // dimentioned size string - int IndexBytes, // bytes per Index - int LeafSize, // number elements in object - int ValueBytes, // bytes per Value - int OffsetWords) // 1 for LEAFW -{ - int * PAllocSizes = AllocSizes; - int OWord; - int CurWord; - int IWord; - int ii; - int BytesOfIndex; - int BytesOfObject; - int Index; - int LastWords; - int Words [1000] = { 0 }; - int Offset[1000] = { 0 }; - int MaxWords; - - MaxWords = ROUNDUP((IndexBytes + ValueBytes) * LeafSize, BPW, OffsetWords); - Words[0] = 0; - Offset[0] = 0; - CurWord = TERMINATOR; - -// Walk through all number of Indexes in table: - - for (Index = 1; /* null */; ++Index) - { - -// Calculate byte required for next size: - - BytesOfIndex = IndexBytes * Index; - BytesOfObject = (IndexBytes + ValueBytes) * Index; - -// Round up and calculate words required for next size: - - OWord = ROUNDUP(BytesOfObject, BPW, OffsetWords); - IWord = ROUNDUP(BytesOfIndex, BPW, OffsetWords); - -// Root-level leaves of population of 1 and 2 do not have the 1 word offset: - -// Save minimum value of offset: - - Offset[Index] = IWord; - -// Round up to next available size of words: - - while (OWord > *PAllocSizes) PAllocSizes++; - - if (Index == LeafSize) - { - CurWord = Words[Index] = OWord; - break; - } -// end of available sizes ? - - if (*PAllocSizes == TERMINATOR) - { - fprintf(stderr, "BUG, in %sPopToWords, sizes not big enough for object\n", TableName); - exit(1); - } - -// Save words required and last word: - - if (*PAllocSizes < MaxWords) { CurWord = Words[Index] = *PAllocSizes; } - else { CurWord = Words[Index] = MaxWords; } - - } // for each index - - LastWords = TERMINATOR; - -// Round up to largest size in each group of malloc sizes: - - for (ii = LeafSize; ii > 0; ii--) - { - if (LastWords > (Words[ii] - ii)) LastWords = Offset[ii]; - else Offset[ii] = LastWords; - } - -// Print the PopToWords[] table: - - fprintf(fd,"\n//\tobject uses %d words\n", CurWord); - fprintf(fd,"//\t%s = %d\n", TableSize, LeafSize); - - fprintf(fd,"const uint8_t\n"); - fprintf(fd,"%sPopToWords[%s + 1] =\n", TableName, TableSize); - fprintf(fd,"{\n\t 0,"); - - for (ii = 1; ii <= LeafSize; ii++) - { - -// 8 columns per line, starting with 1: - - if ((ii % 8) == 1) fprintf(fd,"\n\t"); - - fprintf(fd,"%2d", Words[ii]); - -// If not last number place comma: - - if (ii != LeafSize) fprintf(fd,", "); - } - fprintf(fd,"\n};\n"); - -// Print the Offset table if needed: - - if (! ValueBytes) return; - - fprintf(fd,"const uint8_t\n"); - fprintf(fd,"%sOffset[%s + 1] =\n", TableName, TableSize); - fprintf(fd,"{\n"); - fprintf(fd,"\t 0,"); - - for (ii = 1; ii <= LeafSize; ii++) - { - if ((ii % 8) == 1) fprintf(fd,"\n\t"); - - fprintf(fd,"%2d", Offset[ii]); - - if (ii != LeafSize) fprintf(fd,", "); - } - fprintf(fd,"\n};\n"); - -} // GenTable() - - -// **************************************************************************** -// M A I N - -FUNCTION int main() -{ - int ii; - -#ifdef JUDY1 - char *fname = "Judy1Tables.c"; -#else - char *fname = "JudyLTables.c"; -#endif - - if ((fd = fopen(fname, "w")) == NULL){ - perror("FATAL ERROR: could not write to Judy[1L]Tables.c file\n"); - return (-1); - } - - - fprintf(fd,"// @(#) From generation tool: $Revision: 4.37 $ $Source: /judy/src/JudyCommon/JudyTables.c $\n"); - fprintf(fd,"//\n\n"); - - -// ================================ Judy1 ================================= -#ifdef JUDY1 - - fprintf(fd,"#include \"Judy1.h\"\n"); - - fprintf(fd,"// Leave the malloc() sizes readable in the binary (via " - "strings(1)):\n"); - fprintf(fd,"const char * Judy1MallocSizes = \"Judy1MallocSizes ="); - - for (ii = 0; AllocSizes[ii] != TERMINATOR; ii++) - fprintf(fd," %d,", AllocSizes[ii]); - -#ifndef JU_64BIT - fprintf(fd," Leaf1 = %d\";\n\n", cJ1_LEAF1_MAXPOP1); -#else - fprintf(fd,"\";\n\n"); // no Leaf1 in this case. -#endif - -// ================================ 32 bit ================================ -#ifndef JU_64BIT - - GenTable("j__1_BranchBJP","cJU_BITSPERSUBEXPB", 8, cJU_BITSPERSUBEXPB,0,0); - - GenTable("j__1_Leaf1", "cJ1_LEAF1_MAXPOP1", 1, cJ1_LEAF1_MAXPOP1, 0, 0); - GenTable("j__1_Leaf2", "cJ1_LEAF2_MAXPOP1", 2, cJ1_LEAF2_MAXPOP1, 0, 0); - GenTable("j__1_Leaf3", "cJ1_LEAF3_MAXPOP1", 3, cJ1_LEAF3_MAXPOP1, 0, 0); - GenTable("j__1_LeafW", "cJ1_LEAFW_MAXPOP1", 4, cJ1_LEAFW_MAXPOP1, 0, 1); - -#endif - -// ================================ 64 bit ================================ -#ifdef JU_64BIT - GenTable("j__1_BranchBJP","cJU_BITSPERSUBEXPB",16, cJU_BITSPERSUBEXPB,0,0); - - GenTable("j__1_Leaf2", "cJ1_LEAF2_MAXPOP1", 2, cJ1_LEAF2_MAXPOP1, 0, 0); - GenTable("j__1_Leaf3", "cJ1_LEAF3_MAXPOP1", 3, cJ1_LEAF3_MAXPOP1, 0, 0); - GenTable("j__1_Leaf4", "cJ1_LEAF4_MAXPOP1", 4, cJ1_LEAF4_MAXPOP1, 0, 0); - GenTable("j__1_Leaf5", "cJ1_LEAF5_MAXPOP1", 5, cJ1_LEAF5_MAXPOP1, 0, 0); - GenTable("j__1_Leaf6", "cJ1_LEAF6_MAXPOP1", 6, cJ1_LEAF6_MAXPOP1, 0, 0); - GenTable("j__1_Leaf7", "cJ1_LEAF7_MAXPOP1", 7, cJ1_LEAF7_MAXPOP1, 0, 0); - GenTable("j__1_LeafW", "cJ1_LEAFW_MAXPOP1", 8, cJ1_LEAFW_MAXPOP1, 0, 1); -#endif -#endif // JUDY1 - - -// ================================ JudyL ================================= -#ifdef JUDYL - - fprintf(fd,"#include \"JudyL.h\"\n"); - - fprintf(fd,"// Leave the malloc() sizes readable in the binary (via " - "strings(1)):\n"); - fprintf(fd,"const char * JudyLMallocSizes = \"JudyLMallocSizes ="); - - for (ii = 0; AllocSizes[ii] != TERMINATOR; ii++) - fprintf(fd," %d,", AllocSizes[ii]); - - fprintf(fd," Leaf1 = %ld\";\n\n", (Word_t)cJL_LEAF1_MAXPOP1); - -#ifndef JU_64BIT -// ================================ 32 bit ================================ - GenTable("j__L_BranchBJP","cJU_BITSPERSUBEXPB", 8, cJU_BITSPERSUBEXPB, 0,0); - - GenTable("j__L_Leaf1", "cJL_LEAF1_MAXPOP1", 1, cJL_LEAF1_MAXPOP1, BPW,0); - GenTable("j__L_Leaf2", "cJL_LEAF2_MAXPOP1", 2, cJL_LEAF2_MAXPOP1, BPW,0); - GenTable("j__L_Leaf3", "cJL_LEAF3_MAXPOP1", 3, cJL_LEAF3_MAXPOP1, BPW,0); - GenTable("j__L_LeafW", "cJL_LEAFW_MAXPOP1", 4, cJL_LEAFW_MAXPOP1, BPW,1); - GenTable("j__L_LeafV", "cJU_BITSPERSUBEXPL", 4, cJU_BITSPERSUBEXPL, 0,0); -#endif // 32 BIT - -#ifdef JU_64BIT -// ================================ 64 bit ================================ - GenTable("j__L_BranchBJP","cJU_BITSPERSUBEXPB",16, cJU_BITSPERSUBEXPB, 0,0); - - GenTable("j__L_Leaf1", "cJL_LEAF1_MAXPOP1", 1, cJL_LEAF1_MAXPOP1, BPW,0); - GenTable("j__L_Leaf2", "cJL_LEAF2_MAXPOP1", 2, cJL_LEAF2_MAXPOP1, BPW,0); - GenTable("j__L_Leaf3", "cJL_LEAF3_MAXPOP1", 3, cJL_LEAF3_MAXPOP1, BPW,0); - GenTable("j__L_Leaf4", "cJL_LEAF4_MAXPOP1", 4, cJL_LEAF4_MAXPOP1, BPW,0); - GenTable("j__L_Leaf5", "cJL_LEAF5_MAXPOP1", 5, cJL_LEAF5_MAXPOP1, BPW,0); - GenTable("j__L_Leaf6", "cJL_LEAF6_MAXPOP1", 6, cJL_LEAF6_MAXPOP1, BPW,0); - GenTable("j__L_Leaf7", "cJL_LEAF7_MAXPOP1", 7, cJL_LEAF7_MAXPOP1, BPW,0); - GenTable("j__L_LeafW", "cJL_LEAFW_MAXPOP1", 8, cJL_LEAFW_MAXPOP1, BPW,1); - GenTable("j__L_LeafV", "cJU_BITSPERSUBEXPL", 8, cJU_BITSPERSUBEXPL, 0,0); -#endif // 64 BIT - -#endif // JUDYL - fclose(fd); - - return(0); - -} // main() diff --git a/libjudy/src/JudyCommon/Makefile.in b/libjudy/src/JudyCommon/Makefile.in deleted file mode 100644 index 854cff2dec..0000000000 --- a/libjudy/src/JudyCommon/Makefile.in +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (C) 2006 Imperial College London and others. -# -# Please see the AUTHORS file in the main source directory for a full list -# of copyright holders. -# -# Prof. C Pain -# Applied Modelling and Computation Group -# Department of Earth Science and Engineering -# Imperial College London -# -# amcgsoftware@imperial.ac.uk -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation, -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA - -SHELL = @SHELL@ - -PACKAGE_NAME = @PACKAGE_NAME@ -FLUIDITY = $(PACKAGE_NAME) - -MPIF90 = @MPIF90@ - -CC = @CC@ -CFLAGS = @CPPFLAGS@ @CFLAGS@ @JUDY_CFLAGS@ -I../include -I/usr/local/include -I.. - -MAKE = @MAKE@ - -LIBS = -L../lib -l$(FLUIDITY) @LIBS@ @BLAS_LIBS@ - -OBJS = JudyMalloc.o - -.SUFFIXES: .f90 .F90 .cpp .c .o .a - -# cancel implicit rule that tries to make .o from .mod with m2c: -%.o: %.mod - -.c.o: - @echo " CC $<" - $(CC) $(CFLAGS) -c $< - -default: $(OBJS) - cp *.o ../obj/ - -clean: - rm -f *.o - diff --git a/libjudy/src/JudyCommon/README b/libjudy/src/JudyCommon/README deleted file mode 100644 index b1d4300d17..0000000000 --- a/libjudy/src/JudyCommon/README +++ /dev/null @@ -1,66 +0,0 @@ -# @(#) $Revision: 4.24 $ $Source: /judy/src/JudyCommon/README $ -# -# This tree contains sources for Judy common files. These include shared -# header files, ifdef'd common source files for Judy1/JudyL functions, and -# shared utility functions. - - -# SHARED HEADER FILES: - -JudyPrivate.h global private header file for all Judy internal - sources - -JudyPrivateBranch.h global private header file for all Judy internal - sources, specifically for branch-related - declarations - -JudyPrivate1L.h global private header file for Judy internal - sources that generate both Judy1 and JudyL - object files, via -DJUDY1 or -DJUDYL, using - common names for JP Types, plus some other - generic declarations too - - -# IFDEF'D COMMON SOURCE FILES FOR JUDY1/JUDYL FUNCTIONS: -# -# See Judy(3C) manual entry about these sources for exported functions. - -JudyGet.c common code for Judy1Test() and JudyLGet() -JudyIns.c common code for Judy1Set() and JudyLIns() -JudyDel.c common code for Judy1Unset() and JudyLDel() -JudyFirst.c common code for Judy1 and JudyL -JudyPrevNext.c common code for Judy1, JudyL; Judy*Prev(), Judy*Next() -JudyPrevNextEmpty.c common code for Judy1, JudyL; Judy*PrevEmpty(), - Judy*NextEmpty() -JudyCount.c common code for Judy1 and JudyL -JudyByCount.c common code for Judy1 and JudyL -JudyFreeArray.c common code for Judy1 and JudyL -JudyMemUsed.c common code for Judy1 and JudyL -JudyMemActive.c common code for Judy1 and JudyL - -JudyInsArray.c common code for Judy1 and JudyL - - -# SHARED UTILITY FUNCTIONS: - -JudyMalloc.c source file - -JudyTables.c static definitions of translation tables; a main - program is #ifdef-embedded to generate these tables - -# Common code for Judy1 and JudyL that is compiled twice with -DJUDY1 or -# -DJUDYL: - -JudyInsertBranch.c insert a linear branch between a branch and a leaf -JudyCreateBranch.c create and copy all types of branches - -JudyCascade.c handles overflow insertion of an Index, including - common Decode bytes and branch creation - -JudyDecascade.c handles underflow deletion of an Index, including - common Decode bytes and branch deletion - -JudyMallocIF.c a Judy malloc/free interface, for statistics and - debugging - -JudyPrintJP.c debug/trace code #included in other *.c files diff --git a/libjudy/src/JudyHS/JudyHS.c b/libjudy/src/JudyHS/JudyHS.c deleted file mode 100644 index 21191babc0..0000000000 --- a/libjudy/src/JudyHS/JudyHS.c +++ /dev/null @@ -1,771 +0,0 @@ -// @(#) $Revision: 4.1 $ $Source: /judy/src/JudyHS/JudyHS.c -//======================================================================= -// Author Douglas L. Baskins, Dec 2003. -// Permission to use this code is freely granted, provided that this -// statement is retained. -// email - doug@sourcejudy.com -or- dougbaskins@yahoo.com -//======================================================================= - -#include // for memcmp(), memcpy() - -#include // for JudyL* routines/macros - -/* - This routine is a very fast "string" version of an ADT that stores - (JudyHSIns()), retrieves (JudyHSGet()), deletes (JudyHSDel()) and - frees the entire ADT (JudyHSFreeArray()) strings. It uses the "Judy - arrays" JudyL() API as the main workhorse. The length of the string - is included in the calling parameters so that strings with embedded - \0s can be used. The string lengths can be from 0 bytes to whatever - malloc() can handle (~2GB). - - Compile: - - cc -O JudyHS.c -c needs to link with -lJudy (libJudy.a) - - Note: in gcc version 3.3.1, -O2 generates faster code than -O - Note: in gcc version 3.3.2, -O3 generates faster code than -O2 - - NOTES: - -1) There may be some performance issues with 64 bit machines, because I - have not characterized that it yet. - -2) It appears that a modern CPU (>2Ghz) that the instruction times are - much faster that a RAM access, so building up a word from bytes takes - no longer that a whole word access. I am taking advantage of this to - make this code endian neutral. A side effect of this is strings do - not need to be aligned, nor tested to be on to a word boundry. In - older and in slow (RISC) machines, this may be a performance issue. - I have given up trying to optimize for machines that have very slow - mpy, mod, variable shifts and call returns. - -3) JudyHS is very scalable from 1 string to billions (with enough RAM). - The memory usage is also scales with population. I have attempted to - combine the best characteristics of JudyL arrays with Hashing methods - and well designed modern processors (such as the 1.3Ghz Intel - Centrino this is being written on). - - HOW JudyHS WORKS: ( 4[8] means 4 bytes in 32 bit machine and 8 in 64) - - A) A JudyL array is used to separate strings of equal lengths into - their own structures (a different hash table is used for each length - of string). The additional time overhead is very near zero because - of the CPU cache. The space efficiency is improved because the - length need not be stored with the string (ls_t). The "JLHash" ADT - in the test program "StringCompare" is verification of both these - assumptions. - - B) A 32 bit hash value is produced from the string. Many thanks to - the Internet and the author (Bob Jenkins) for coming up with a very - good and fast universal string hash. Next the 32 bit hash number is - used as an Index to another JudyL array. Notice that one (1) JudyL - array is used as a hash table per each string length. If there are - no hash collisions (normally) then the string is copied to a - structure (ls_t) along with room for storing a Value. A flag is - added to the pointer to note it is pointing to a ls_t structure. - Since the lengths of the strings are the same, there is no need to - stored length of string in the ls_t structure. This saves about a - word per string of memory. - - C) When there is a hashing collision (very rare), a JudyL array is - used to decode the next 4[8] bytes of the string. That is, the next - 4[8] bytes of the string are used as the Index. This process is - repeated until the remaining string is unique. The remaining string - (if any) is stored in a (now smaller) ls_t structure. If the - remaining string is less or equal to 4[8] bytes, then the ls_t - structure is not needed and the Value area in the JudyL array is - used. A compile option -DDONOTUSEHASH is available to test this - structure without using hashing (only the JudyL tree is used). This - is equivalent to having all strings hashed to the same bucket. The - speed is still better than all other tree based ADTs I have tested. - An added benefit of this is a very fast "hash collision" resolving. - It could foil hackers that exploit the slow synonym (linked-list) - collision handling property used with most hashing algorithms. If - this is not a necessary property, then a simpler ADT "JLHash" that is - documented the the test program "StringCompare.c" may be used with a - little loss of memory efficiency (because it includes the string - length with the ls_t structure). JudyHS was written to be the - fastest, very scalable, memory efficient, general purpose string ADT - possible. (However, I would like to eat those words someday). (dlb) - -*/ - -#ifdef EXAMPLE_CODE -#include -#include -#include - -#include - -//#include "JudyHS.h" // for Judy.h without JudyHS*() - -// By Doug Baskins Apr 2004 - for JudyHS man page - -#define MAXLINE 1000000 /* max length of line */ -char Index[MAXLINE]; // string to check - -int // Usage: CheckDupLines < file -main() -{ - Pvoid_t PJArray = (PWord_t)NULL; // Judy array. - PWord_t PValue; // ^ Judy array element. - Word_t Bytes; // size of JudyHS array. - Word_t LineNumb = 0; // current line number - Word_t Dups = 0; // number of duplicate lines - - while (fgets(Index, MAXLINE, stdin) != (char *)NULL) - { - LineNumb++; // line number - -// store string into array - JHSI(PValue, PJArray, Index, strlen(Index)); - if (*PValue) // check if duplicate - { - Dups++; // count duplicates - printf("Duplicate lines %lu:%lu:%s", *PValue, LineNumb, Index); - } - else - { - *PValue = LineNumb; // store Line number - } - } - printf("%lu Duplicates, free JudyHS array of %lu Lines\n", - Dups, LineNumb - Dups); - JHSFA(Bytes, PJArray); // free array - printf("The JudyHS array allocated %lu bytes of memory\n", Bytes); - return (0); -} -#endif // EXAMPLE_CODE - -// Note: Use JLAP_INVALID, which is non-zero, to mark pointers to a ls_t -// This makes it compatable with previous versions of JudyL() - -#define IS_PLS(PLS) (((Word_t) (PLS)) & JLAP_INVALID) -#define CLEAR_PLS(PLS) (((Word_t) (PLS)) & (~JLAP_INVALID)) -#define SET_PLS(PLS) (((Word_t) (PLS)) | JLAP_INVALID) - -#define WORDSIZE (sizeof(Word_t)) - -// this is the struct used for "leaf" strings. Note that -// the Value is followed by a "variable" length ls_String array. -// -typedef struct L_EAFSTRING -{ - Word_t ls_Value; // Value area (cannot change size) - uint8_t ls_String[WORDSIZE]; // to fill out to a Word_t size -} ls_t , *Pls_t; - -#define LS_STRUCTOVD (sizeof(ls_t) - WORDSIZE) - -// Calculate size of ls_t including the string of length of LEN. -// -#define LS_WORDLEN(LEN) (((LEN) + LS_STRUCTOVD + WORDSIZE - 1) / WORDSIZE) - -// Copy from 0..4[8] bytes from string to a Word_t -// NOTE: the copy in in little-endian order to take advantage of improved -// memory efficiency of JudyLIns() with smaller numbers -// -#define COPYSTRING4toWORD(WORD,STR,LEN) \ -{ \ - WORD = 0; \ - switch(LEN) \ - { \ - default: /* four and greater */ \ - case 4: \ - WORD += (Word_t)(((uint8_t *)(STR))[3] << 24); \ - case 3: \ - WORD += (Word_t)(((uint8_t *)(STR))[2] << 16); \ - case 2: \ - WORD += (Word_t)(((uint8_t *)(STR))[1] << 8); \ - case 1: \ - WORD += (Word_t)(((uint8_t *)(STR))[0]); \ - case 0: break; \ - } \ -} - -#ifdef JU_64BIT - -// copy from 0..8 bytes from string to Word_t -// -#define COPYSTRING8toWORD(WORD,STR,LEN) \ -{ \ - WORD = 0UL; \ - switch(LEN) \ - { \ - default: /* eight and greater */ \ - case 8: \ - WORD += ((Word_t)((uint8_t *)(STR))[7] << 56); \ - case 7: \ - WORD += ((Word_t)((uint8_t *)(STR))[6] << 48); \ - case 6: \ - WORD += ((Word_t)((uint8_t *)(STR))[5] << 40); \ - case 5: \ - WORD += ((Word_t)((uint8_t *)(STR))[4] << 32); \ - case 4: \ - WORD += ((Word_t)((uint8_t *)(STR))[3] << 24); \ - case 3: \ - WORD += ((Word_t)((uint8_t *)(STR))[2] << 16); \ - case 2: \ - WORD += ((Word_t)((uint8_t *)(STR))[1] << 8); \ - case 1: \ - WORD += ((Word_t)((uint8_t *)(STR))[0]); \ - case 0: break; \ - } \ -} - -#define COPYSTRINGtoWORD COPYSTRING8toWORD - -#else // JU_32BIT - -#define COPYSTRINGtoWORD COPYSTRING4toWORD - -#endif // JU_32BIT - -// set JError_t locally - -#define JU_SET_ERRNO(PJERROR, JERRNO) \ -{ \ - if (PJERROR != (PJError_t) NULL) \ - { \ - if (JERRNO) \ - JU_ERRNO(PJError) = (JERRNO); \ - JU_ERRID(PJERROR) = __LINE__; \ - } \ -} - -//======================================================================= -// This routine must hash string to 24..32 bits. The "goodness" of -// the hash is not as important as its speed. -//======================================================================= - -// hash to no more than 32 bits - -// extern Word_t gHmask; for hash bits experiments - -#define JUDYHASHSTR(HVALUE,STRING,LENGTH) \ -{ \ - uint8_t *p_ = (uint8_t *)(STRING); \ - uint8_t *q_ = p_ + (LENGTH); \ - uint32_t c_ = 0; \ - for (; p_ != q_; ++p_) \ - { \ - c_ = (c_ * 31) + *p_; \ - } \ -/* c_ &= gHmask; see above */ \ - (HVALUE) = c_; \ -} - -// Find String of Len in JudyHS structure, return pointer to associated Value - -PPvoid_t -JudyHSGet(Pcvoid_t PArray, // pointer (^) to structure - void * Str, // pointer to string - Word_t Len // length of string - ) -{ - uint8_t *String = (uint8_t *)Str; - PPvoid_t PPValue; // pointer to Value - Word_t Index; // 4[8] bytes of String - - JLG(PPValue, PArray, Len); // find hash table for strings of Len - if (PPValue == (PPvoid_t) NULL) - return ((PPvoid_t) NULL); // no strings of this Len - -// check for caller error (null pointer) -// - if ((String == (void *) NULL) && (Len != 0)) - return ((PPvoid_t) NULL); // avoid null-pointer dereference - -#ifndef DONOTUSEHASH - if (Len > WORDSIZE) // Hash table not necessary with short - { - uint32_t HValue; // hash of input string - JUDYHASHSTR(HValue, String, Len); // hash to no more than 32 bits - JLG(PPValue, *PPValue, (Word_t)HValue); // get ^ to hash bucket - if (PPValue == (PPvoid_t) NULL) - return ((PPvoid_t) NULL); // no entry in Hash table - } -#endif // DONOTUSEHASH - -/* - Each JudyL array decodes 4[8] bytes of the string. Since the hash - collisions occur very infrequently, the performance is not important. - However, even if the Hash code is not used this method still is - significantly faster than common tree methods (AVL, Red-Black, Splay, - b-tree, etc..). You can compare it yourself with #define DONOTUSEHASH - 1 or putting -DDONOTUSEHASH in the cc line. Use the "StringCompare.c" - code to compare (9Dec2003 dlb). -*/ - while (Len > WORDSIZE) // traverse tree of JudyL arrays - { - if (IS_PLS(*PPValue)) // ^ to JudyL array or ls_t struct? - { - Pls_t Pls; // ls_t struct, termination of tree - Pls = (Pls_t) CLEAR_PLS(*PPValue); // remove flag from ^ - -// if remaining string matches, return ^ to Value, else NULL - - if (memcmp(String, Pls->ls_String, Len) == 0) - return ((PPvoid_t) (&(Pls->ls_Value))); - else - return ((PPvoid_t) NULL); // string does not match - } - else - { - COPYSTRINGtoWORD(Index, String, WORDSIZE); - - JLG(PPValue, *PPValue, Index); // decode next 4[8] bytes - if (PPValue == (PPvoid_t) NULL) // if NULL array, bail out - return ((PPvoid_t) NULL); // string does not match - - String += WORDSIZE; // advance - Len -= WORDSIZE; - } - } - -// Get remaining 1..4[8] bytes left in string - - COPYSTRINGtoWORD(Index, String, Len); - JLG(PPValue, *PPValue, Index); // decode last 1-4[8] bytes - return (PPValue); -} - -// Add string to a tree of JudyL arrays (all lengths must be same) - -static PPvoid_t -insStrJudyLTree(uint8_t * String, // string to add to tree of JudyL arrays - Word_t Len, // length of string - PPvoid_t PPValue, // pointer to root pointer - PJError_t PJError // for returning error info - ) -{ - Word_t Index; // next 4[8] bytes of String - - while (Len > WORDSIZE) // add to JudyL tree - { -// CASE 1, pointer is to a NULL, make a new ls_t leaf - - if (*PPValue == (Pvoid_t)NULL) - { - Pls_t Pls; // memory for a ls_t - Pls = (Pls_t) JudyMalloc(LS_WORDLEN(Len)); - if (Pls == NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NOMEM); - return (PPJERR); - } - Pls->ls_Value = 0; // clear Value word - memcpy(Pls->ls_String, String, Len); // copy to new struct - *PPValue = (Pvoid_t)SET_PLS(Pls); // mark pointer - return ((PPvoid_t) (&Pls->ls_Value)); // return ^ to Value - } // no exit here -// CASE 2: is a ls_t, free (and shorten), then decode into JudyL tree - - if (IS_PLS(*PPValue)) // pointer to a ls_t? (leaf) - { - Pls_t Pls; // ^ to ls_t - uint8_t *String0; // ^ to string in ls_t - Word_t Index0; // 4[8] bytes in string - Word_t FreeLen; // length of ls_t - PPvoid_t PPsplit; - - FreeLen = LS_WORDLEN(Len); // length of ls_t - - Pls = (Pls_t) CLEAR_PLS(*PPValue); // demangle ^ to ls_t - String0 = Pls->ls_String; - if (memcmp(String, String0, Len) == 0) // check if match? - { - return ((PPvoid_t) (&Pls->ls_Value)); // yes, duplicate - } - - *PPValue = NULL; // clear ^ to ls_t and make JudyL - -// This do loop is technically not required, saves multiple JudyFree() -// when storing already sorted strings into structure - - do // decode next 4[8] bytes of string - { // with a JudyL array -// Note: string0 is always aligned - - COPYSTRINGtoWORD(Index0, String0, WORDSIZE); - String0 += WORDSIZE; - COPYSTRINGtoWORD(Index, String, WORDSIZE); - String += WORDSIZE; - Len -= WORDSIZE; - PPsplit = PPValue; // save for split below - PPValue = JudyLIns(PPValue, Index0, PJError); - if (PPValue == PPJERR) - { - JU_SET_ERRNO(PJError, 0); - return (PPJERR); - } - - } while ((Index0 == Index) && (Len > WORDSIZE)); - -// finish storing remainder of string that was in the ls_t - - PPValue = insStrJudyLTree(String0, Len, PPValue, PJError); - if (PPValue == PPJERR) - { - return (PPJERR); - } -// copy old Value to Value in new struct - - *(PWord_t)PPValue = Pls->ls_Value; - -// free the string buffer (ls_t) - - JudyFree((Pvoid_t)Pls, FreeLen); - PPValue = JudyLIns(PPsplit, Index, PJError); - if (PPValue == PPJERR) - { - JU_SET_ERRNO(PJError, 0); - return (PPValue); - } - -// finish remainder of newly inserted string - - PPValue = insStrJudyLTree(String, Len, PPValue, PJError); - return (PPValue); - } // no exit here -// CASE 3, more JudyL arrays, decode to next tree - - COPYSTRINGtoWORD(Index, String, WORDSIZE); - Len -= WORDSIZE; - String += WORDSIZE; - - PPValue = JudyLIns(PPValue, Index, PJError); // next 4[8] bytes - if (PPValue == PPJERR) - { - JU_SET_ERRNO(PJError, 0); - return (PPValue); - } - } -// this is done outside of loop so "Len" can be an unsigned number - - COPYSTRINGtoWORD(Index, String, Len); - PPValue = JudyLIns(PPValue, Index, PJError); // remaining 4[8] bytes - - return (PPValue); -} - - -// Insert string to JudyHS structure, return pointer to associated Value - -PPvoid_t -JudyHSIns(PPvoid_t PPArray, // ^ to JudyHashArray name - void * Str, // pointer to string - Word_t Len, // length of string - PJError_t PJError // optional, for returning error info - ) -{ - uint8_t * String = (uint8_t *)Str; - PPvoid_t PPValue; - -// string can only be NULL if Len is 0. - - if ((String == (uint8_t *) NULL) && (Len != 0UL)) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return (PPJERR); - } - JLG(PPValue, *PPArray, Len); // JudyL hash table for strings of Len - if (PPValue == (PPvoid_t) NULL) // make new if missing, (very rare) - { - PPValue = JudyLIns(PPArray, Len, PJError); - if (PPValue == PPJERR) - { - JU_SET_ERRNO(PJError, 0); - return (PPJERR); - } - } -#ifndef DONOTUSEHASH - if (Len > WORDSIZE) - { - uint32_t HValue; // hash of input string - JUDYHASHSTR(HValue, String, Len); // hash to no more than 32 bits - PPValue = JudyLIns(PPValue, (Word_t)HValue, PJError); - if (PPValue == PPJERR) - { - JU_SET_ERRNO(PJError, 0); - return (PPJERR); - } - } -#endif // DONOTUSEHASH - - PPValue = insStrJudyLTree(String, Len, PPValue, PJError); // add string - return (PPValue); // ^ to Value -} - -// Delete string from tree of JudyL arrays (all Lens must be same) - -static int -delStrJudyLTree(uint8_t * String, // delete from tree of JudyL arrays - Word_t Len, // length of string - PPvoid_t PPValue, // ^ to hash bucket - PJError_t PJError // for returning error info - ) -{ - PPvoid_t PPValueN; // next pointer - Word_t Index; - int Ret; // -1=failed, 1=success, 2=quit del - - if (IS_PLS(*PPValue)) // is pointer to ls_t? - { - Pls_t Pls; - Pls = (Pls_t) CLEAR_PLS(*PPValue); // demangle pointer - JudyFree((Pvoid_t)Pls, LS_WORDLEN(Len)); // free the ls_t - - *PPValue = (Pvoid_t)NULL; // clean pointer - return (1); // successfully deleted - } - - if (Len > WORDSIZE) // delete from JudyL tree, not leaf - { - COPYSTRINGtoWORD(Index, String, WORDSIZE); // get Index - JLG(PPValueN, *PPValue, Index); // get pointer to next JudyL array - - String += WORDSIZE; // advance to next 4[8] bytes - Len -= WORDSIZE; - - Ret = delStrJudyLTree(String, Len, PPValueN, PJError); - if (Ret != 1) return(Ret); - - if (*PPValueN == (PPvoid_t) NULL) - { -// delete JudyL element from tree - - Ret = JudyLDel(PPValue, Index, PJError); - } - } - else - { - COPYSTRINGtoWORD(Index, String, Len); // get leaf element - -// delete last 1-4[8] bytes from leaf element - - Ret = JudyLDel(PPValue, Index, PJError); - } - return (Ret); -} - -// Delete string from JHS structure - -int -JudyHSDel(PPvoid_t PPArray, // ^ to JudyHashArray struct - void * Str, // pointer to string - Word_t Len, // length of string - PJError_t PJError // optional, for returning error info - ) -{ - uint8_t * String = (uint8_t *)Str; - PPvoid_t PPBucket, PPHtble; - int Ret; // return bool from Delete routine -#ifndef DONOTUSEHASH - uint32_t HValue = 0; // hash value of input string -#endif // DONOTUSEHASH - - if (PPArray == NULL) - return (0); // no pointer, return not found - -// This is a little slower than optimum method, but not much in new CPU -// Verify that string is in the structure -- simplifies future assumptions - - if (JudyHSGet(*PPArray, String, Len) == (PPvoid_t) NULL) - return (0); // string not found, return - -// string is in structure, so testing for absence is not necessary - - JLG(PPHtble, *PPArray, Len); // JudyL hash table for strings of Len - -#ifdef DONOTUSEHASH - PPBucket = PPHtble; // simulate below code -#else // USEHASH - if (Len > WORDSIZE) - { - JUDYHASHSTR(HValue, String, Len); // hash to no more than 32 bits - -// get pointer to hash bucket - - JLG(PPBucket, *PPHtble, (Word_t)HValue); - } - else - { - PPBucket = PPHtble; // no bucket to JLGet - } -#endif // USEHASH - -// delete from JudyL tree -// - Ret = delStrJudyLTree(String, Len, PPBucket, PJError); - if (Ret != 1) - { - JU_SET_ERRNO(PJError, 0); - return(-1); - } -// handle case of missing JudyL array from hash table and length table - - if (*PPBucket == (Pvoid_t)NULL) // if JudyL tree gone - { -#ifndef DONOTUSEHASH - if (Len > WORDSIZE) - { -// delete entry in Hash table - - Ret = JudyLDel(PPHtble, (Word_t)HValue, PJError); - if (Ret != 1) - { - JU_SET_ERRNO(PJError, 0); - return(-1); - } - } -#endif // USEHASH - if (*PPHtble == (PPvoid_t) NULL) // if Hash table gone - { -// delete entry from the String length table - - Ret = JudyLDel(PPArray, Len, PJError); - if (Ret != 1) - { - JU_SET_ERRNO(PJError, 0); - return(-1); - } - } - } - return (1); // success -} - -static Word_t -delJudyLTree(PPvoid_t PPValue, // ^ to JudyL root pointer - Word_t Len, // length of string - PJError_t PJError) // for returning error info -{ - Word_t bytes_freed = 0; // bytes freed at point - Word_t bytes_total = 0; // accumulated bytes freed - PPvoid_t PPValueN; - -// Pointer is to another tree of JudyL arrays or ls_t struct - - if (Len > WORDSIZE) // more depth to tree - { - Word_t NEntry; - -// Pointer is to a ls_t struct - - if (IS_PLS(*PPValue)) - { - Pls_t Pls; - Word_t freewords; - - freewords = LS_WORDLEN(Len); // calculate length - Pls = (Pls_t)CLEAR_PLS(*PPValue); // demangle pointer - -// *PPValue = (Pvoid_t)NULL; // clean pointer - JudyFree((Pvoid_t)Pls, freewords); // free the ls_t - - return(freewords * WORDSIZE); - } -// else -// Walk all the entrys in the JudyL array - - NEntry = 0; // start at beginning - for (PPValueN = JudyLFirst(*PPValue, &NEntry, PJError); - (PPValueN != (PPvoid_t) NULL) && (PPValueN != PPJERR); - PPValueN = JudyLNext(*PPValue, &NEntry, PJError)) - { -// recurse to the next level in the tree of arrays - - bytes_freed = delJudyLTree(PPValueN, Len - WORDSIZE, PJError); - if (bytes_freed == JERR) return(JERR); - bytes_total += bytes_freed; - } - if (PPValueN == PPJERR) return(JERR); - -// now free this JudyL array - - bytes_freed = JudyLFreeArray(PPValue, PJError); - if (bytes_freed == JERR) return(JERR); - bytes_total += bytes_freed; - - return(bytes_total); // return amount freed - } -// else - -// Pointer to simple JudyL array - - bytes_freed = JudyLFreeArray(PPValue, PJError); - - return(bytes_freed); -} - - -Word_t // bytes freed -JudyHSFreeArray(PPvoid_t PPArray, // ^ to JudyHashArray struct - PJError_t PJError // optional, for returning error info - ) -{ - Word_t Len; // start at beginning - Word_t bytes_freed; // bytes freed at this level. - Word_t bytes_total; // bytes total at all levels. - PPvoid_t PPHtble; - - if (PPArray == NULL) - return (0); // no pointer, return none - -// Walk the string length table for subsidary hash structs -// NOTE: This is necessary to determine the depth of the tree - - bytes_freed = 0; - bytes_total = 0; - Len = 0; // walk to length table - - for (PPHtble = JudyLFirst(*PPArray, &Len, PJError); - (PPHtble != (PPvoid_t) NULL) && (PPHtble != PPJERR); - PPHtble = JudyLNext(*PPArray, &Len, PJError)) - { - PPvoid_t PPValueH; - -#ifndef DONOTUSEHASH - if (Len > WORDSIZE) - { - Word_t HEntry = 0; // walk the hash tables - - for (PPValueH = JudyLFirst(*PPHtble, &HEntry, PJError); - (PPValueH != (PPvoid_t) NULL) && (PPValueH != PPJERR); - PPValueH = JudyLNext(*PPHtble, &HEntry, PJError)) - { - bytes_freed = delJudyLTree(PPValueH, Len, PJError); - if (bytes_freed == JERR) return(JERR); - bytes_total += bytes_freed; - } - - if (PPValueH == PPJERR) return(JERR); - -// free the Hash table for this length of string - - bytes_freed = JudyLFreeArray(PPHtble, PJError); - if (bytes_freed == JERR) return(JERR); - bytes_total += bytes_freed; - } - else -#endif // DONOTUSEHASH - { - PPValueH = PPHtble; // simulate hash table - - bytes_freed = delJudyLTree(PPValueH, Len, PJError); - if (bytes_freed == JERR) return(JERR); - bytes_total += bytes_freed; - } - } - if (PPHtble == PPJERR) return(JERR); - -// free the length table - - bytes_freed = JudyLFreeArray(PPArray, PJError); - if (bytes_freed == JERR) return(JERR); - - bytes_total += bytes_freed; - - return(bytes_total); // return bytes freed -} diff --git a/libjudy/src/JudyHS/JudyHS.h b/libjudy/src/JudyHS/JudyHS.h deleted file mode 100644 index b403501648..0000000000 --- a/libjudy/src/JudyHS/JudyHS.h +++ /dev/null @@ -1,35 +0,0 @@ -// **************************************************************************** -// Quick and dirty header file for use with old Judy.h without JudyHS defs -// May 2004 (dlb) - No copyright or license -- it is free period. - -#include - -// **************************************************************************** -// JUDYHSL MACROS: - -#define JHSI(PV, PArray, PIndex, Count) \ - J_2P(PV, (&(PArray)), PIndex, Count, JudyHSIns, "JudyHSIns") -#define JHSG(PV, PArray, PIndex, Count) \ - (PV) = (Pvoid_t) JudyHSGet(PArray, PIndex, Count) -#define JHSD(Rc, PArray, PIndex, Count) \ - J_2I(Rc, (&(PArray)), PIndex, Count, JudyHSDel, "JudyHSDel") -#define JHSFA(Rc, PArray) \ - J_0I(Rc, (&(PArray)), JudyHSFreeArray, "JudyHSFreeArray") - -// **************************************************************************** -// JUDY memory interface to malloc() FUNCTIONS: - -extern Word_t JudyMalloc(Word_t); // words reqd => words allocd. -extern Word_t JudyMallocVirtual(Word_t); // words reqd => words allocd. -extern void JudyFree(Pvoid_t, Word_t); // block to free and its size in words. -extern void JudyFreeVirtual(Pvoid_t, Word_t); // block to free and its size in words. - -// **************************************************************************** -// JUDYHS FUNCTIONS: - -extern PPvoid_t JudyHSGet( Pcvoid_t, void *, Word_t); -extern PPvoid_t JudyHSIns( PPvoid_t, void *, Word_t, P_JE); -extern int JudyHSDel( PPvoid_t, void *, Word_t, P_JE); -extern Word_t JudyHSFreeArray( PPvoid_t, P_JE); - -extern uint32_t JudyHashStr( void *, Word_t); diff --git a/libjudy/src/JudyHS/Makefile.in b/libjudy/src/JudyHS/Makefile.in deleted file mode 100644 index d63d3ce432..0000000000 --- a/libjudy/src/JudyHS/Makefile.in +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (C) 2006 Imperial College London and others. -# -# Please see the AUTHORS file in the main source directory for a full list -# of copyright holders. -# -# Prof. C Pain -# Applied Modelling and Computation Group -# Department of Earth Science and Engineering -# Imperial College London -# -# amcgsoftware@imperial.ac.uk -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation, -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA - -SHELL = @SHELL@ - -PACKAGE_NAME = @PACKAGE_NAME@ -FLUIDITY = $(PACKAGE_NAME) - -MPIF90 = @MPIF90@ - -CC = @CC@ -CFLAGS = @CPPFLAGS@ @CFLAGS@ @JUDY_CFLAGS@ -I../include -I/usr/local/include -I.. -I../JudyCommon - -MAKE = @MAKE@ - -LIBS = -L../lib -l$(FLUIDITY) @LIBS@ @BLAS_LIBS@ - -OBJS = JudyHS.o - -.SUFFIXES: .f90 .F90 .cpp .c .o .a - -# cancel implicit rule that tries to make .o from .mod with m2c: -%.o: %.mod - -.c.o: - @echo " CC $<" - $(CC) $(CFLAGS) -c $< - -default: $(OBJS) - cp *.o ../obj/ - -clean: - rm -f *.o - diff --git a/libjudy/src/JudyHS/README b/libjudy/src/JudyHS/README deleted file mode 100644 index 93d7d070cb..0000000000 --- a/libjudy/src/JudyHS/README +++ /dev/null @@ -1,10 +0,0 @@ -# @(#) $Revision: 4.22 $ $Source: /judy/src/JudyHS/README $ - -# This tree contains sources for the JudyHS*() functions. -# -# Note: At one time, all of the Judy sources were split between Judy1/ and -# JudyL/ variants, but now most of them are merged in JudyCommon/ and this -# directory is vestigal. - -JudyHS.h header for using JudyHS.c with older versions of Judy.h -JudyHS.c source of JudyHS functions diff --git a/libjudy/src/JudyL/JudyL.h b/libjudy/src/JudyL/JudyL.h deleted file mode 100644 index d901969d62..0000000000 --- a/libjudy/src/JudyL/JudyL.h +++ /dev/null @@ -1,505 +0,0 @@ -#ifndef _JUDYL_INCLUDED -#define _JUDYL_INCLUDED -// _________________ -// -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.41 $ $Source: /judy/src/JudyL/JudyL.h $ - -// **************************************************************************** -// JUDYL -- SMALL/LARGE AND/OR CLUSTERED/SPARSE ARRAYS -// -// -by- -// -// Douglas L. Baskins -// doug@sourcejudy.com -// -// Judy arrays are designed to be used instead of arrays. The performance -// suggests the reason why Judy arrays are thought of as arrays, instead of -// trees. They are remarkably memory efficient at all populations. -// Implemented as a hybrid digital tree (but really a state machine, see -// below), Judy arrays feature fast insert/retrievals, fast near neighbor -// searching, and contain a population tree for extremely fast ordinal related -// retrievals. -// -// CONVENTIONS: -// -// - The comments here refer to 32-bit [64-bit] systems. -// -// - BranchL, LeafL refer to linear branches and leaves (small populations), -// except LeafL does not actually appear as such; rather, Leaf1..3 [Leaf1..7] -// is used to represent leaf Index sizes, and LeafW refers to a Leaf with -// full (Long) word Indexes, which is also a type of linear leaf. Note that -// root-level LeafW (Leaf4 [Leaf8]) leaves are called LEAFW. -// -// - BranchB, LeafB1 refer to bitmap branches and leaves (intermediate -// populations). -// -// - BranchU refers to uncompressed branches. An uncompressed branch has 256 -// JPs, some of which could be null. Note: All leaves are compressed (and -// sorted), or else an expanse is full (FullPopu), so there is no LeafU -// equivalent to BranchU. -// -// - "Popu" is short for "Population". -// - "Pop1" refers to actual population (base 1). -// - "Pop0" refers to Pop1 - 1 (base 0), the way populations are stored in data -// structures. -// -// - Branches and Leaves are both named by the number of bytes in their Pop0 -// field. In the case of Leaves, the same number applies to the Index sizes. -// -// - The representation of many numbers as hex is a relatively safe and -// portable way to get desired bitpatterns as unsigned longs. -// -// - Some preprocessors cant handle single apostrophe characters within -// #ifndef code, so here, delete all instead. - - -#include "JudyPrivate.h" // includes Judy.h in turn. -#include "JudyPrivateBranch.h" // support for branches. - - -// **************************************************************************** -// JUDYL ROOT POINTER (JRP) AND JUDYL POINTER (JP) TYPE FIELDS -// **************************************************************************** - -typedef enum // uint8_t -- but C does not support this type of enum. -{ - -// JP NULL TYPES: -// -// There is a series of cJL_JPNULL* Types because each one pre-records a -// different Index Size for when the first Index is inserted in the previously -// null JP. They must start >= 8 (three bits). -// -// Note: These Types must be in sequential order for doing relative -// calculations between them. - - cJL_JPNULL1 = 1, - // Index Size 1[1] byte when 1 Index inserted. - cJL_JPNULL2, // Index Size 2[2] bytes when 1 Index inserted. - cJL_JPNULL3, // Index Size 3[3] bytes when 1 Index inserted. - -#ifndef JU_64BIT -#define cJL_JPNULLMAX cJL_JPNULL3 -#else - cJL_JPNULL4, // Index Size 4[4] bytes when 1 Index inserted. - cJL_JPNULL5, // Index Size 5[5] bytes when 1 Index inserted. - cJL_JPNULL6, // Index Size 6[6] bytes when 1 Index inserted. - cJL_JPNULL7, // Index Size 7[7] bytes when 1 Index inserted. -#define cJL_JPNULLMAX cJL_JPNULL7 -#endif - - -// JP BRANCH TYPES: -// -// Note: There are no state-1 branches; only leaves reside at state 1. - -// Linear branches: -// -// Note: These Types must be in sequential order for doing relative -// calculations between them. - - cJL_JPBRANCH_L2, // 2[2] bytes Pop0, 1[5] bytes Dcd. - cJL_JPBRANCH_L3, // 3[3] bytes Pop0, 0[4] bytes Dcd. - -#ifdef JU_64BIT - cJL_JPBRANCH_L4, // [4] bytes Pop0, [3] bytes Dcd. - cJL_JPBRANCH_L5, // [5] bytes Pop0, [2] bytes Dcd. - cJL_JPBRANCH_L6, // [6] bytes Pop0, [1] byte Dcd. - cJL_JPBRANCH_L7, // [7] bytes Pop0, [0] bytes Dcd. -#endif - - cJL_JPBRANCH_L, // note: DcdPopO field not used. - -// Bitmap branches: -// -// Note: These Types must be in sequential order for doing relative -// calculations between them. - - cJL_JPBRANCH_B2, // 2[2] bytes Pop0, 1[5] bytes Dcd. - cJL_JPBRANCH_B3, // 3[3] bytes Pop0, 0[4] bytes Dcd. - -#ifdef JU_64BIT - cJL_JPBRANCH_B4, // [4] bytes Pop0, [3] bytes Dcd. - cJL_JPBRANCH_B5, // [5] bytes Pop0, [2] bytes Dcd. - cJL_JPBRANCH_B6, // [6] bytes Pop0, [1] byte Dcd. - cJL_JPBRANCH_B7, // [7] bytes Pop0, [0] bytes Dcd. -#endif - - cJL_JPBRANCH_B, // note: DcdPopO field not used. - -// Uncompressed branches: -// -// Note: These Types must be in sequential order for doing relative -// calculations between them. - - cJL_JPBRANCH_U2, // 2[2] bytes Pop0, 1[5] bytes Dcd. - cJL_JPBRANCH_U3, // 3[3] bytes Pop0, 0[4] bytes Dcd. - -#ifdef JU_64BIT - cJL_JPBRANCH_U4, // [4] bytes Pop0, [3] bytes Dcd. - cJL_JPBRANCH_U5, // [5] bytes Pop0, [2] bytes Dcd. - cJL_JPBRANCH_U6, // [6] bytes Pop0, [1] byte Dcd. - cJL_JPBRANCH_U7, // [7] bytes Pop0, [0] bytes Dcd. -#endif - - cJL_JPBRANCH_U, // note: DcdPopO field not used. - - -// JP LEAF TYPES: - -// Linear leaves: -// -// Note: These Types must be in sequential order for doing relative -// calculations between them. -// -// Note: There is no full-word (4-byte [8-byte]) Index leaf under a JP because -// non-root-state leaves only occur under branches that decode at least one -// byte. Full-word, root-state leaves are under a JRP, not a JP. However, in -// the code a "fake" JP can be created temporarily above a root-state leaf. - - cJL_JPLEAF1, // 1[1] byte Pop0, 2 bytes Dcd. - cJL_JPLEAF2, // 2[2] bytes Pop0, 1[5] bytes Dcd. - cJL_JPLEAF3, // 3[3] bytes Pop0, 0[4] bytes Dcd. - -#ifdef JU_64BIT - cJL_JPLEAF4, // [4] bytes Pop0, [3] bytes Dcd. - cJL_JPLEAF5, // [5] bytes Pop0, [2] bytes Dcd. - cJL_JPLEAF6, // [6] bytes Pop0, [1] byte Dcd. - cJL_JPLEAF7, // [7] bytes Pop0, [0] bytes Dcd. -#endif - -// Bitmap leaf; Index Size == 1: -// -// Note: These are currently only supported at state 1. At other states the -// bitmap would grow from 256 to 256^2, 256^3, ... bits, which would not be -// efficient.. - - cJL_JPLEAF_B1, // 1[1] byte Pop0, 2[6] bytes Dcd. - -// Full population; Index Size == 1 virtual leaf: -// -// Note: JudyL has no cJL_JPFULLPOPU1 equivalent to cJ1_JPFULLPOPU1, because -// in the JudyL case this could result in a values-only leaf of up to 256 words -// (value areas) that would be slow to insert/delete. - - -// JP IMMEDIATES; leaves (Indexes) stored inside a JP: -// -// The second numeric suffix is the Pop1 for each type. As the Index Size -// increases, the maximum possible population decreases. -// -// Note: These Types must be in sequential order in each group (Index Size), -// and the groups in correct order too, for doing relative calculations between -// them. For example, since these Types enumerate the Pop1 values (unlike -// other JP Types where there is a Pop0 value in the JP), the maximum Pop1 for -// each Index Size is computable. -// -// All enums equal or above this point are cJL_JPIMMEDs. - - cJL_JPIMMED_1_01, // Index Size = 1, Pop1 = 1. - cJL_JPIMMED_2_01, // Index Size = 2, Pop1 = 1. - cJL_JPIMMED_3_01, // Index Size = 3, Pop1 = 1. - -#ifdef JU_64BIT - cJL_JPIMMED_4_01, // Index Size = 4, Pop1 = 1. - cJL_JPIMMED_5_01, // Index Size = 5, Pop1 = 1. - cJL_JPIMMED_6_01, // Index Size = 6, Pop1 = 1. - cJL_JPIMMED_7_01, // Index Size = 7, Pop1 = 1. -#endif - - cJL_JPIMMED_1_02, // Index Size = 1, Pop1 = 2. - cJL_JPIMMED_1_03, // Index Size = 1, Pop1 = 3. - -#ifdef JU_64BIT - cJL_JPIMMED_1_04, // Index Size = 1, Pop1 = 4. - cJL_JPIMMED_1_05, // Index Size = 1, Pop1 = 5. - cJL_JPIMMED_1_06, // Index Size = 1, Pop1 = 6. - cJL_JPIMMED_1_07, // Index Size = 1, Pop1 = 7. - - cJL_JPIMMED_2_02, // Index Size = 2, Pop1 = 2. - cJL_JPIMMED_2_03, // Index Size = 2, Pop1 = 3. - - cJL_JPIMMED_3_02, // Index Size = 3, Pop1 = 2. -#endif - -// This special Type is merely a sentinel for doing relative calculations. -// This value should not be used in switch statements (to avoid allocating code -// for it), which is also why it appears at the end of the enum list. - - cJL_JPIMMED_CAP - -} jpL_Type_t; - - -// RELATED VALUES: - -// Index Size (state) for leaf JP, and JP type based on Index Size (state): - -#define JL_LEAFINDEXSIZE(jpType) ((jpType) - cJL_JPLEAF1 + 1) -#define JL_LEAFTYPE(IndexSize) ((IndexSize) + cJL_JPLEAF1 - 1) - - -// MAXIMUM POPULATIONS OF LINEAR LEAVES: - -#ifndef JU_64BIT // 32-bit - -#define J_L_MAXB (sizeof(Word_t) * 64) -#define ALLOCSIZES { 3, 5, 7, 11, 15, 23, 32, 47, 64, TERMINATOR } // in words. -#define cJL_LEAF1_MAXWORDS (32) // max Leaf1 size in words. - -// Note: cJL_LEAF1_MAXPOP1 is chosen such that the index portion is less than -// 32 bytes -- the number of bytes the index takes in a bitmap leaf. - -#define cJL_LEAF1_MAXPOP1 \ - ((cJL_LEAF1_MAXWORDS * cJU_BYTESPERWORD)/(1 + cJU_BYTESPERWORD)) -#define cJL_LEAF2_MAXPOP1 (J_L_MAXB / (2 + cJU_BYTESPERWORD)) -#define cJL_LEAF3_MAXPOP1 (J_L_MAXB / (3 + cJU_BYTESPERWORD)) -#define cJL_LEAFW_MAXPOP1 \ - ((J_L_MAXB - cJU_BYTESPERWORD) / (2 * cJU_BYTESPERWORD)) - -#else // 64-bit - -#define J_L_MAXB (sizeof(Word_t) * 64) -#define ALLOCSIZES { 3, 5, 7, 11, 15, 23, 32, 47, 64, TERMINATOR } // in words. -#define cJL_LEAF1_MAXWORDS (15) // max Leaf1 size in words. - -#define cJL_LEAF1_MAXPOP1 \ - ((cJL_LEAF1_MAXWORDS * cJU_BYTESPERWORD)/(1 + cJU_BYTESPERWORD)) -#define cJL_LEAF2_MAXPOP1 (J_L_MAXB / (2 + cJU_BYTESPERWORD)) -#define cJL_LEAF3_MAXPOP1 (J_L_MAXB / (3 + cJU_BYTESPERWORD)) -#define cJL_LEAF4_MAXPOP1 (J_L_MAXB / (4 + cJU_BYTESPERWORD)) -#define cJL_LEAF5_MAXPOP1 (J_L_MAXB / (5 + cJU_BYTESPERWORD)) -#define cJL_LEAF6_MAXPOP1 (J_L_MAXB / (6 + cJU_BYTESPERWORD)) -#define cJL_LEAF7_MAXPOP1 (J_L_MAXB / (7 + cJU_BYTESPERWORD)) -#define cJL_LEAFW_MAXPOP1 \ - ((J_L_MAXB - cJU_BYTESPERWORD) / (2 * cJU_BYTESPERWORD)) - -#endif // 64-bit - - -// MAXIMUM POPULATIONS OF IMMEDIATE JPs: -// -// These specify the maximum Population of immediate JPs with various Index -// Sizes (== sizes of remaining undecoded Index bits). Since the JP Types enum -// already lists all the immediates in order by state and size, calculate these -// values from it to avoid redundancy. - -#define cJL_IMMED1_MAXPOP1 ((cJU_BYTESPERWORD - 1) / 1) // 3 [7]. -#define cJL_IMMED2_MAXPOP1 ((cJU_BYTESPERWORD - 1) / 2) // 1 [3]. -#define cJL_IMMED3_MAXPOP1 ((cJU_BYTESPERWORD - 1) / 3) // 1 [2]. - -#ifdef JU_64BIT -#define cJL_IMMED4_MAXPOP1 ((cJU_BYTESPERWORD - 1) / 4) // [1]. -#define cJL_IMMED5_MAXPOP1 ((cJU_BYTESPERWORD - 1) / 5) // [1]. -#define cJL_IMMED6_MAXPOP1 ((cJU_BYTESPERWORD - 1) / 6) // [1]. -#define cJL_IMMED7_MAXPOP1 ((cJU_BYTESPERWORD - 1) / 7) // [1]. -#endif - - -// **************************************************************************** -// JUDYL LEAF BITMAP (JLLB) SUPPORT -// **************************************************************************** -// -// Assemble bitmap leaves out of smaller units that put bitmap subexpanses -// close to their associated pointers. Why not just use a bitmap followed by a -// series of pointers? (See 4.27.) Turns out this wastes a cache fill on -// systems with smaller cache lines than the assumed value cJU_WORDSPERCL. - -#define JL_JLB_BITMAP(Pjlb, Subexp) ((Pjlb)->jLlb_jLlbs[Subexp].jLlbs_Bitmap) -#define JL_JLB_PVALUE(Pjlb, Subexp) ((Pjlb)->jLlb_jLlbs[Subexp].jLlbs_PValue) - -typedef struct J__UDYL_LEAF_BITMAP_SUBEXPANSE -{ - BITMAPL_t jLlbs_Bitmap; - Pjv_t jLlbs_PValue; - -} jLlbs_t; - -typedef struct J__UDYL_LEAF_BITMAP -{ - jLlbs_t jLlb_jLlbs[cJU_NUMSUBEXPL]; - -} jLlb_t, * PjLlb_t; - -// Words per bitmap leaf: - -#define cJL_WORDSPERLEAFB1 (sizeof(jLlb_t) / cJU_BYTESPERWORD) - - -// **************************************************************************** -// MEMORY ALLOCATION SUPPORT -// **************************************************************************** - -// ARRAY-GLOBAL INFORMATION: -// -// At the cost of an occasional additional cache fill, this object, which is -// pointed at by a JRP and in turn points to a JP_BRANCH*, carries array-global -// information about a JudyL array that has sufficient population to amortize -// the cost. The jpm_Pop0 field prevents having to add up the total population -// for the array in insert, delete, and count code. The jpm_JP field prevents -// having to build a fake JP for entry to a state machine; however, the -// jp_DcdPopO field in jpm_JP, being one byte too small, is not used. -// -// Note: Struct fields are ordered to keep "hot" data in the first 8 words -// (see left-margin comments) for machines with 8-word cache lines, and to keep -// sub-word fields together for efficient packing. - -typedef struct J_UDYL_POPULATION_AND_MEMORY -{ -/* 1 */ Word_t jpm_Pop0; // total population-1 in array. -/* 2 */ jp_t jpm_JP; // JP to first branch; see above. -/* 4 */ Word_t jpm_LastUPop0; // last jpm_Pop0 when convert to BranchU -/* 7 */ Pjv_t jpm_PValue; // pointer to value to return. -// Note: Field names match PJError_t for convenience in macros: -/* 8 */ char je_Errno; // one of the enums in Judy.h. -/* 8/9 */ int je_ErrID; // often an internal source line number. -/* 9/10 */ Word_t jpm_TotalMemWords; // words allocated in array. -} jLpm_t, *PjLpm_t; - - -// TABLES FOR DETERMINING IF LEAVES HAVE ROOM TO GROW: -// -// These tables indicate if a given memory chunk can support growth of a given -// object into wasted (rounded-up) memory in the chunk. Note: This violates -// the hiddenness of the JudyMalloc code. - -extern const uint8_t j__L_Leaf1PopToWords[cJL_LEAF1_MAXPOP1 + 1]; -extern const uint8_t j__L_Leaf2PopToWords[cJL_LEAF2_MAXPOP1 + 1]; -extern const uint8_t j__L_Leaf3PopToWords[cJL_LEAF3_MAXPOP1 + 1]; -#ifdef JU_64BIT -extern const uint8_t j__L_Leaf4PopToWords[cJL_LEAF4_MAXPOP1 + 1]; -extern const uint8_t j__L_Leaf5PopToWords[cJL_LEAF5_MAXPOP1 + 1]; -extern const uint8_t j__L_Leaf6PopToWords[cJL_LEAF6_MAXPOP1 + 1]; -extern const uint8_t j__L_Leaf7PopToWords[cJL_LEAF7_MAXPOP1 + 1]; -#endif -extern const uint8_t j__L_LeafWPopToWords[cJL_LEAFW_MAXPOP1 + 1]; -extern const uint8_t j__L_LeafVPopToWords[]; - -// These tables indicate where value areas start: - -extern const uint8_t j__L_Leaf1Offset [cJL_LEAF1_MAXPOP1 + 1]; -extern const uint8_t j__L_Leaf2Offset [cJL_LEAF2_MAXPOP1 + 1]; -extern const uint8_t j__L_Leaf3Offset [cJL_LEAF3_MAXPOP1 + 1]; -#ifdef JU_64BIT -extern const uint8_t j__L_Leaf4Offset [cJL_LEAF4_MAXPOP1 + 1]; -extern const uint8_t j__L_Leaf5Offset [cJL_LEAF5_MAXPOP1 + 1]; -extern const uint8_t j__L_Leaf6Offset [cJL_LEAF6_MAXPOP1 + 1]; -extern const uint8_t j__L_Leaf7Offset [cJL_LEAF7_MAXPOP1 + 1]; -#endif -extern const uint8_t j__L_LeafWOffset [cJL_LEAFW_MAXPOP1 + 1]; - -// Also define macros to hide the details in the code using these tables. - -#define JL_LEAF1GROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJL_LEAF1_MAXPOP1, j__L_Leaf1PopToWords) -#define JL_LEAF2GROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJL_LEAF2_MAXPOP1, j__L_Leaf2PopToWords) -#define JL_LEAF3GROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJL_LEAF3_MAXPOP1, j__L_Leaf3PopToWords) -#ifdef JU_64BIT -#define JL_LEAF4GROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJL_LEAF4_MAXPOP1, j__L_Leaf4PopToWords) -#define JL_LEAF5GROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJL_LEAF5_MAXPOP1, j__L_Leaf5PopToWords) -#define JL_LEAF6GROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJL_LEAF6_MAXPOP1, j__L_Leaf6PopToWords) -#define JL_LEAF7GROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJL_LEAF7_MAXPOP1, j__L_Leaf7PopToWords) -#endif -#define JL_LEAFWGROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJL_LEAFW_MAXPOP1, j__L_LeafWPopToWords) -#define JL_LEAFVGROWINPLACE(Pop1) \ - J__U_GROWCK(Pop1, cJU_BITSPERSUBEXPL, j__L_LeafVPopToWords) - -#define JL_LEAF1VALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_Leaf1Offset[Pop1]) -#define JL_LEAF2VALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_Leaf2Offset[Pop1]) -#define JL_LEAF3VALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_Leaf3Offset[Pop1]) -#ifdef JU_64BIT -#define JL_LEAF4VALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_Leaf4Offset[Pop1]) -#define JL_LEAF5VALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_Leaf5Offset[Pop1]) -#define JL_LEAF6VALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_Leaf6Offset[Pop1]) -#define JL_LEAF7VALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_Leaf7Offset[Pop1]) -#endif -#define JL_LEAFWVALUEAREA(Pjv,Pop1) (((PWord_t)(Pjv)) + j__L_LeafWOffset[Pop1]) - -#define JL_LEAF1POPTOWORDS(Pop1) (j__L_Leaf1PopToWords[Pop1]) -#define JL_LEAF2POPTOWORDS(Pop1) (j__L_Leaf2PopToWords[Pop1]) -#define JL_LEAF3POPTOWORDS(Pop1) (j__L_Leaf3PopToWords[Pop1]) -#ifdef JU_64BIT -#define JL_LEAF4POPTOWORDS(Pop1) (j__L_Leaf4PopToWords[Pop1]) -#define JL_LEAF5POPTOWORDS(Pop1) (j__L_Leaf5PopToWords[Pop1]) -#define JL_LEAF6POPTOWORDS(Pop1) (j__L_Leaf6PopToWords[Pop1]) -#define JL_LEAF7POPTOWORDS(Pop1) (j__L_Leaf7PopToWords[Pop1]) -#endif -#define JL_LEAFWPOPTOWORDS(Pop1) (j__L_LeafWPopToWords[Pop1]) -#define JL_LEAFVPOPTOWORDS(Pop1) (j__L_LeafVPopToWords[Pop1]) - - -// FUNCTIONS TO ALLOCATE OBJECTS: - -PjLpm_t j__udyLAllocJLPM(void); // constant size. - -Pjbl_t j__udyLAllocJBL( PjLpm_t); // constant size. -Pjbb_t j__udyLAllocJBB( PjLpm_t); // constant size. -Pjp_t j__udyLAllocJBBJP(Word_t, PjLpm_t); -Pjbu_t j__udyLAllocJBU( PjLpm_t); // constant size. - -Pjll_t j__udyLAllocJLL1( Word_t, PjLpm_t); -Pjll_t j__udyLAllocJLL2( Word_t, PjLpm_t); -Pjll_t j__udyLAllocJLL3( Word_t, PjLpm_t); - -#ifdef JU_64BIT -Pjll_t j__udyLAllocJLL4( Word_t, PjLpm_t); -Pjll_t j__udyLAllocJLL5( Word_t, PjLpm_t); -Pjll_t j__udyLAllocJLL6( Word_t, PjLpm_t); -Pjll_t j__udyLAllocJLL7( Word_t, PjLpm_t); -#endif - -Pjlw_t j__udyLAllocJLW( Word_t ); // no PjLpm_t needed. -PjLlb_t j__udyLAllocJLB1( PjLpm_t); // constant size. -Pjv_t j__udyLAllocJV( Word_t, PjLpm_t); - - -// FUNCTIONS TO FREE OBJECTS: - -void j__udyLFreeJLPM( PjLpm_t, PjLpm_t); // constant size. - -void j__udyLFreeJBL( Pjbl_t, PjLpm_t); // constant size. -void j__udyLFreeJBB( Pjbb_t, PjLpm_t); // constant size. -void j__udyLFreeJBBJP(Pjp_t, Word_t, PjLpm_t); -void j__udyLFreeJBU( Pjbu_t, PjLpm_t); // constant size. - -void j__udyLFreeJLL1( Pjll_t, Word_t, PjLpm_t); -void j__udyLFreeJLL2( Pjll_t, Word_t, PjLpm_t); -void j__udyLFreeJLL3( Pjll_t, Word_t, PjLpm_t); - -#ifdef JU_64BIT -void j__udyLFreeJLL4( Pjll_t, Word_t, PjLpm_t); -void j__udyLFreeJLL5( Pjll_t, Word_t, PjLpm_t); -void j__udyLFreeJLL6( Pjll_t, Word_t, PjLpm_t); -void j__udyLFreeJLL7( Pjll_t, Word_t, PjLpm_t); -#endif - -void j__udyLFreeJLW( Pjlw_t, Word_t, PjLpm_t); -void j__udyLFreeJLB1( PjLlb_t, PjLpm_t); // constant size. -void j__udyLFreeJV( Pjv_t, Word_t, PjLpm_t); -void j__udyLFreeSM( Pjp_t, PjLpm_t); // everything below Pjp. - -#endif // ! _JUDYL_INCLUDED diff --git a/libjudy/src/JudyL/JudyLByCount.c b/libjudy/src/JudyL/JudyLByCount.c deleted file mode 100644 index 40caf89b74..0000000000 --- a/libjudy/src/JudyL/JudyLByCount.c +++ /dev/null @@ -1,954 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.28 $ $Source: /judy/src/JudyCommon/JudyByCount.c $ -// -// Judy*ByCount() function for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DNOSMARTJBB, -DNOSMARTJBU, and/or -DNOSMARTJLB to build a -// version with cache line optimizations deleted, for testing. -// -// Judy*ByCount() is a conceptual although not literal inverse of Judy*Count(). -// Judy*Count() takes a pair of Indexes, and allows finding the ordinal of a -// given Index (that is, its position in the list of valid indexes from the -// beginning) as a degenerate case, because in general the count between two -// Indexes, inclusive, is not always just the difference in their ordinals. -// However, it suffices for Judy*ByCount() to simply be an ordinal-to-Index -// mapper. -// -// Note: Like Judy*Count(), this code must "count sideways" in branches, which -// can result in a lot of cache line fills. However, unlike Judy*Count(), this -// code does not receive a specific Index, hence digit, where to start in each -// branch, so it cant accurately calculate cache line fills required in each -// direction. The best it can do is an approximation based on the total -// population of the expanse (pop1 from Pjp) and the ordinal of the target -// Index (see SETOFFSET()) within the expanse. -// -// Compile with -DSMARTMETRICS to obtain global variables containing smart -// cache line metrics. Note: Dont turn this on simultaneously for this file -// and JudyCount.c because they export the same globals. -// **************************************************************************** - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -// These are imported from JudyCount.c: -// -// TBD: Should this be in common code? Exported from a header file? - -#ifdef JUDY1 -extern Word_t j__udy1JPPop1(const Pjp_t Pjp); -#define j__udyJPPop1 j__udy1JPPop1 -#else -extern Word_t j__udyLJPPop1(const Pjp_t Pjp); -#define j__udyJPPop1 j__udyLJPPop1 -#endif - -// Avoid duplicate symbols since this file is multi-compiled: - -#ifdef SMARTMETRICS -#ifdef JUDY1 -Word_t jbb_upward = 0; // counts of directions taken: -Word_t jbb_downward = 0; -Word_t jbu_upward = 0; -Word_t jbu_downward = 0; -Word_t jlb_upward = 0; -Word_t jlb_downward = 0; -#else -extern Word_t jbb_upward; -extern Word_t jbb_downward; -extern Word_t jbu_upward; -extern Word_t jbu_downward; -extern Word_t jlb_upward; -extern Word_t jlb_downward; -#endif -#endif - - -// **************************************************************************** -// J U D Y 1 B Y C O U N T -// J U D Y L B Y C O U N T -// -// See the manual entry. - -#ifdef JUDY1 -FUNCTION int Judy1ByCount -#else -FUNCTION PPvoid_t JudyLByCount -#endif - ( - Pcvoid_t PArray, // root pointer to first branch/leaf in SM. - Word_t Count, // ordinal of Index to find, 1..MAX. - Word_t * PIndex, // to return found Index. - PJError_t PJError // optional, for returning error info. - ) -{ - Word_t Count0; // Count, base-0, to match pop0. - Word_t state; // current state in SM. - Word_t pop1; // of current branch or leaf, or of expanse. - Word_t pop1lower; // pop1 of expanses (JPs) below that for Count. - Word_t digit; // current word in branch. - Word_t jpcount; // JPs in a BranchB subexpanse. - long jpnum; // JP number in a branch (base 0). - long subexp; // for stepping through layer 1 (subexpanses). - int offset; // index ordinal within a leaf, base 0. - - Pjp_t Pjp; // current JP in branch. - Pjll_t Pjll; // current Judy linear leaf. - - -// CHECK FOR EMPTY ARRAY OR NULL PINDEX: - - if (PArray == (Pvoid_t) NULL) JU_RET_NOTFOUND; - - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -// Convert Count to Count0; assume special case of Count = 0 maps to ~0, as -// desired, to represent the last index in a full array: -// -// Note: Think of Count0 as a reliable "number of Indexes below the target." - - Count0 = Count - 1; - assert((Count || Count0 == ~0)); // ensure CPU is sane about 0 - 1. - pop1lower = 0; - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - - if (Count0 > Pjlw[0]) JU_RET_NOTFOUND; // too high. - - *PIndex = Pjlw[Count]; // Index, base 1. - - JU_RET_FOUND_LEAFW(Pjlw, Pjlw[0] + 1, Count0); - } - else - { - Pjpm_t Pjpm = P_JPM(PArray); - - if (Count0 > (Pjpm->jpm_Pop0)) JU_RET_NOTFOUND; // too high. - - Pjp = &(Pjpm->jpm_JP); - pop1 = (Pjpm->jpm_Pop0) + 1; - -// goto SMByCount; - } - -// COMMON CODE: -// -// Prepare to handle a root-level or lower-level branch: Save the current -// state, obtain the total population for the branch in a state-dependent way, -// and then branch to common code for multiple cases. -// -// For root-level branches, the state is always cJU_ROOTSTATE, and the array -// population must already be set in pop1; it is not available in jp_DcdPopO. -// -// Note: The total population is only needed in cases where the common code -// "counts down" instead of up to minimize cache line fills. However, its -// available cheaply, and its better to do it with a constant shift (constant -// state value) instead of a variable shift later "when needed". - -#define PREPB_ROOT(Next) \ - state = cJU_ROOTSTATE; \ - goto Next - -// Use PREPB_DCD() to first copy the Dcd bytes to *PIndex if there are any -// (only if state < cJU_ROOTSTATE - 1): - -#define PREPB_DCD(Pjp,cState,Next) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - PREPB((Pjp), cState, Next) - -#define PREPB(Pjp,cState,Next) \ - state = (cState); \ - pop1 = JU_JPBRANCH_POP0(Pjp, (cState)) + 1; \ - goto Next - -// Calculate whether the ordinal of an Index within a given expanse falls in -// the lower or upper half of the expanses population, taking care with -// unsigned math and boundary conditions: -// -// Note: Assume the ordinal falls within the expanses population, that is, -// 0 < (Count - Pop1lower) <= Pop1exp (assuming infinite math). -// -// Note: If the ordinal is the middle element, it doesnt matter whether -// LOWERHALF() is TRUE or FALSE. - -#define LOWERHALF(Count0,Pop1lower,Pop1exp) \ - (((Count0) - (Pop1lower)) < ((Pop1exp) / 2)) - -// Calculate the (signed) offset within a leaf to the desired ordinal (Count - -// Pop1lower; offset is one less), and optionally ensure its in range: - -#define SETOFFSET(Offset,Count0,Pop1lower,Pjp) \ - (Offset) = (Count0) - (Pop1lower); \ - assert((Offset) >= 0); \ - assert((Offset) <= JU_JPLEAF_POP0(Pjp)) - -// Variations for immediate indexes, with and without pop1-specific assertions: - -#define SETOFFSET_IMM_CK(Offset,Count0,Pop1lower,cPop1) \ - (Offset) = (Count0) - (Pop1lower); \ - assert((Offset) >= 0); \ - assert((Offset) < (cPop1)) - -#define SETOFFSET_IMM(Offset,Count0,Pop1lower) \ - (Offset) = (Count0) - (Pop1lower) - - -// STATE MACHINE -- TRAVERSE TREE: -// -// In branches, look for the expanse (digit), if any, where the total pop1 -// below or at that expanse would meet or exceed Count, meaning the Index must -// be in this expanse. - -SMByCount: // return here for next branch/leaf. - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH; count populations in JPs in the JBL upwards until finding the -// expanse (digit) containing Count, and "recurse". -// -// Note: There are no null JPs in a JBL; watch out for pop1 == 0. -// -// Note: A JBL should always fit in one cache line => no need to count up -// versus down to save cache line fills. -// -// TBD: The previous is no longer true. Consider enhancing this code to count -// up/down, but it can wait for a later tuning phase. In the meantime, PREPB() -// sets pop1 for the whole array, but that value is not used here. 001215: -// Maybe its true again? - - case cJU_JPBRANCH_L2: PREPB_DCD(Pjp, 2, BranchL); -#ifndef JU_64BIT - case cJU_JPBRANCH_L3: PREPB( Pjp, 3, BranchL); -#else - case cJU_JPBRANCH_L3: PREPB_DCD(Pjp, 3, BranchL); - case cJU_JPBRANCH_L4: PREPB_DCD(Pjp, 4, BranchL); - case cJU_JPBRANCH_L5: PREPB_DCD(Pjp, 5, BranchL); - case cJU_JPBRANCH_L6: PREPB_DCD(Pjp, 6, BranchL); - case cJU_JPBRANCH_L7: PREPB( Pjp, 7, BranchL); -#endif - case cJU_JPBRANCH_L: PREPB_ROOT( BranchL); - { - Pjbl_t Pjbl; - -// Common code (state-independent) for all cases of linear branches: - -BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - - for (jpnum = 0; jpnum < (Pjbl->jbl_NumJPs); ++jpnum) - { - if ((pop1 = j__udyJPPop1((Pjbl->jbl_jp) + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, so do not subtract 1 and compare -// >=, but instead use the following expression: - - if (pop1lower + pop1 > Count0) // Index is in this expanse. - { - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[jpnum], state); - Pjp = (Pjbl->jbl_jp) + jpnum; - goto SMByCount; // look under this expanse. - } - - pop1lower += pop1; // add this JPs pop1. - } - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // should never get here. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // case cJU_JPBRANCH_L - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH; count populations in JPs in the JBB upwards or downwards -// until finding the expanse (digit) containing Count, and "recurse". -// -// Note: There are no null JPs in a JBB; watch out for pop1 == 0. - - case cJU_JPBRANCH_B2: PREPB_DCD(Pjp, 2, BranchB); -#ifndef JU_64BIT - case cJU_JPBRANCH_B3: PREPB( Pjp, 3, BranchB); -#else - case cJU_JPBRANCH_B3: PREPB_DCD(Pjp, 3, BranchB); - case cJU_JPBRANCH_B4: PREPB_DCD(Pjp, 4, BranchB); - case cJU_JPBRANCH_B5: PREPB_DCD(Pjp, 5, BranchB); - case cJU_JPBRANCH_B6: PREPB_DCD(Pjp, 6, BranchB); - case cJU_JPBRANCH_B7: PREPB( Pjp, 7, BranchB); -#endif - case cJU_JPBRANCH_B: PREPB_ROOT( BranchB); - { - Pjbb_t Pjbb; - -// Common code (state-independent) for all cases of bitmap branches: - -BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - -// Shorthand for one subexpanse in a bitmap and for one JP in a bitmap branch: -// -// Note: BMPJP0 exists separately to support assertions. - -#define BMPJP0(Subexp) (P_JP(JU_JBB_PJP(Pjbb, Subexp))) -#define BMPJP(Subexp,JPnum) (BMPJP0(Subexp) + (JPnum)) - - -// Common code for descending through a JP: -// -// Determine the digit for the expanse and save it in *PIndex; then "recurse". - -#define JBB_FOUNDEXPANSE \ - { \ - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb,subexp), jpnum); \ - JU_SETDIGIT(*PIndex, digit, state); \ - Pjp = BMPJP(subexp, jpnum); \ - goto SMByCount; \ - } - - -#ifndef NOSMARTJBB // enable to turn off smart code for comparison purposes. - -// FIGURE OUT WHICH DIRECTION CAUSES FEWER CACHE LINE FILLS; adding the pop1s -// in JPs upwards, or subtracting the pop1s in JPs downwards: -// -// See header comments about limitations of this for Judy*ByCount(). - -#endif - -// COUNT UPWARD, adding each "below" JPs pop1: - -#ifndef NOSMARTJBB // enable to turn off smart code for comparison purposes. - - if (LOWERHALF(Count0, pop1lower, pop1)) - { -#endif -#ifdef SMARTMETRICS - ++jbb_upward; -#endif - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - if ((jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb,subexp))) - && (BMPJP0(subexp) == (Pjp_t) NULL)) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // null ptr. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -// Note: An empty subexpanse (jpcount == 0) is handled "for free": - - for (jpnum = 0; jpnum < jpcount; ++jpnum) - { - if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum))) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - if (pop1lower + pop1 > Count0) - JBB_FOUNDEXPANSE; // Index is in this expanse. - - pop1lower += pop1; // add this JPs pop1. - } - } -#ifndef NOSMARTJBB // enable to turn off smart code for comparison purposes. - } - - -// COUNT DOWNWARD, subtracting each "above" JPs pop1 from the whole expanses -// pop1: - - else - { -#ifdef SMARTMETRICS - ++jbb_downward; -#endif - pop1lower += pop1; // add whole branch to start. - - for (subexp = cJU_NUMSUBEXPB - 1; subexp >= 0; --subexp) - { - if ((jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp))) - && (BMPJP0(subexp) == (Pjp_t) NULL)) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // null ptr. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -// Note: An empty subexpanse (jpcount == 0) is handled "for free": - - for (jpnum = jpcount - 1; jpnum >= 0; --jpnum) - { - if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum))) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - pop1lower -= pop1; - -// Beware unsigned math problems: - - if ((pop1lower == 0) || (pop1lower - 1 < Count0)) - JBB_FOUNDEXPANSE; // Index is in this expanse. - } - } - } -#endif // NOSMARTJBB - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // should never get here. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // case cJU_JPBRANCH_B - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH; count populations in JPs in the JBU upwards or -// downwards until finding the expanse (digit) containing Count, and "recurse". - - case cJU_JPBRANCH_U2: PREPB_DCD(Pjp, 2, BranchU); -#ifndef JU_64BIT - case cJU_JPBRANCH_U3: PREPB( Pjp, 3, BranchU); -#else - case cJU_JPBRANCH_U3: PREPB_DCD(Pjp, 3, BranchU); - case cJU_JPBRANCH_U4: PREPB_DCD(Pjp, 4, BranchU); - case cJU_JPBRANCH_U5: PREPB_DCD(Pjp, 5, BranchU); - case cJU_JPBRANCH_U6: PREPB_DCD(Pjp, 6, BranchU); - case cJU_JPBRANCH_U7: PREPB( Pjp, 7, BranchU); -#endif - case cJU_JPBRANCH_U: PREPB_ROOT( BranchU); - { - Pjbu_t Pjbu; - -// Common code (state-independent) for all cases of uncompressed branches: - -BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - -// Common code for descending through a JP: -// -// Save the digit for the expanse in *PIndex, then "recurse". - -#define JBU_FOUNDEXPANSE \ - { \ - JU_SETDIGIT(*PIndex, jpnum, state); \ - Pjp = (Pjbu->jbu_jp) + jpnum; \ - goto SMByCount; \ - } - - -#ifndef NOSMARTJBU // enable to turn off smart code for comparison purposes. - -// FIGURE OUT WHICH DIRECTION CAUSES FEWER CACHE LINE FILLS; adding the pop1s -// in JPs upwards, or subtracting the pop1s in JPs downwards: -// -// See header comments about limitations of this for Judy*ByCount(). - -#endif - -// COUNT UPWARD, simply adding the pop1 of each JP: - -#ifndef NOSMARTJBU // enable to turn off smart code for comparison purposes. - - if (LOWERHALF(Count0, pop1lower, pop1)) - { -#endif -#ifdef SMARTMETRICS - ++jbu_upward; -#endif - - for (jpnum = 0; jpnum < cJU_BRANCHUNUMJPS; ++jpnum) - { - // shortcut, save a function call: - - if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX) - continue; - - if ((pop1 = j__udyJPPop1((Pjbu->jbu_jp) + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - if (pop1lower + pop1 > Count0) - JBU_FOUNDEXPANSE; // Index is in this expanse. - - pop1lower += pop1; // add this JPs pop1. - } -#ifndef NOSMARTJBU // enable to turn off smart code for comparison purposes. - } - - -// COUNT DOWNWARD, subtracting the pop1 of each JP above from the whole -// expanses pop1: - - else - { -#ifdef SMARTMETRICS - ++jbu_downward; -#endif - pop1lower += pop1; // add whole branch to start. - - for (jpnum = cJU_BRANCHUNUMJPS - 1; jpnum >= 0; --jpnum) - { - // shortcut, save a function call: - - if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX) - continue; - - if ((pop1 = j__udyJPPop1(Pjbu->jbu_jp + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - assert(pop1 != 0); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - pop1lower -= pop1; - -// Beware unsigned math problems: - - if ((pop1lower == 0) || (pop1lower - 1 < Count0)) - JBU_FOUNDEXPANSE; // Index is in this expanse. - } - } -#endif // NOSMARTJBU - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // should never get here. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // case cJU_JPBRANCH_U - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Return the Index at the proper ordinal (see SETOFFSET()) in the leaf. First -// copy Dcd bytes, if there are any (only if state < cJU_ROOTSTATE - 1), to -// *PIndex. -// -// Note: The preceding branch traversal code MIGHT set pop1 for this expanse -// (linear leaf) as a side-effect, but dont depend on that (for JUDYL, which -// is the only cases that need it anyway). - -#define PREPL_DCD(cState) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - PREPL - -#ifdef JUDY1 -#define PREPL_SETPOP1 // not needed in any cases. -#else -#define PREPL_SETPOP1 pop1 = JU_JPLEAF_POP0(Pjp) + 1 -#endif - -#define PREPL \ - Pjll = P_JLL(Pjp->jp_Addr); \ - PREPL_SETPOP1; \ - SETOFFSET(offset, Count0, pop1lower, Pjp) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - PREPL_DCD(1); - JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]); - JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - - case cJU_JPLEAF2: - - PREPL_DCD(2); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - -#ifndef JU_64BIT - case cJU_JPLEAF3: - { - Word_t lsb; - PREPL; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - -#else - case cJU_JPLEAF3: - { - Word_t lsb; - PREPL_DCD(3); - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - - case cJU_JPLEAF4: - - PREPL_DCD(4); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - - case cJU_JPLEAF5: - { - Word_t lsb; - PREPL_DCD(5); - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - } - - case cJU_JPLEAF6: - { - Word_t lsb; - PREPL_DCD(6); - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - } - - case cJU_JPLEAF7: - { - Word_t lsb; - PREPL; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_LEAF7(Pjll, pop1, offset); - } -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Return the Index at the proper ordinal (see SETOFFSET()) in the leaf by -// counting bits. First copy Dcd bytes (always present since state 1 < -// cJU_ROOTSTATE) to *PIndex. -// -// Note: The preceding branch traversal code MIGHT set pop1 for this expanse -// (bitmap leaf) as a side-effect, but dont depend on that. - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; - - JU_SETDCD(*PIndex, Pjp, 1); - Pjlb = P_JLB(Pjp->jp_Addr); - pop1 = JU_JPLEAF_POP0(Pjp) + 1; - -// COUNT UPWARD, adding the pop1 of each subexpanse: -// -// The entire bitmap should fit in one cache line, but still try to save some -// CPU time by counting the fewest possible number of subexpanses from the -// bitmap. -// -// See header comments about limitations of this for Judy*ByCount(). - -#ifndef NOSMARTJLB // enable to turn off smart code for comparison purposes. - - if (LOWERHALF(Count0, pop1lower, pop1)) - { -#endif -#ifdef SMARTMETRICS - ++jlb_upward; -#endif - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - { - pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - -// Warning: pop1lower and pop1 are unsigned, see earlier comment: - - if (pop1lower + pop1 > Count0) - goto LeafB1; // Index is in this subexpanse. - - pop1lower += pop1; // add this subexpanses pop1. - } -#ifndef NOSMARTJLB // enable to turn off smart code for comparison purposes. - } - - -// COUNT DOWNWARD, subtracting each "above" subexpanses pop1 from the whole -// expanses pop1: - - else - { -#ifdef SMARTMETRICS - ++jlb_downward; -#endif - pop1lower += pop1; // add whole leaf to start. - - for (subexp = cJU_NUMSUBEXPL - 1; subexp >= 0; --subexp) - { - pop1lower -= j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - -// Beware unsigned math problems: - - if ((pop1lower == 0) || (pop1lower - 1 < Count0)) - goto LeafB1; // Index is in this subexpanse. - } - } -#endif // NOSMARTJLB - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // should never get here. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - -// RETURN INDEX FOUND: -// -// Come here with subexp set to the correct subexpanse, and pop1lower set to -// the sum for all lower expanses and subexpanses in the Judy tree. Calculate -// and save in *PIndex the digit corresponding to the ordinal in this -// subexpanse. - -LeafB1: - SETOFFSET(offset, Count0, pop1lower, Pjp); - JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset); - JU_SETDIGIT1(*PIndex, digit); - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + offset)) - - } // case cJU_JPLEAF_B1 - - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// Copy Dcd bytes (always present since state 1 < cJU_ROOTSTATE) to *PIndex, -// then set the appropriate digit for the ordinal (see SETOFFSET()) in the leaf -// as the LSB in *PIndex. - - case cJ1_JPFULLPOPU1: - - JU_SETDCD(*PIndex, Pjp, 1); - SETOFFSET(offset, Count0, pop1lower, Pjp); - assert(offset >= 0); - assert(offset <= cJU_JPFULLPOPU1_POP0); - JU_SETDIGIT1(*PIndex, offset); - JU_RET_FOUND_FULLPOPU1; -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: -// -// Locate the Index with the proper ordinal (see SETOFFSET()) in the Immediate, -// depending on leaf Index Size and pop1. Note: There are no Dcd bytes in an -// Immediate JP, but in a cJU_JPIMMED_*_01 JP, the field holds the least bytes -// of the immediate Index. - -#define SET_01(cState) JU_SETDIGITS(*PIndex, JU_JPDCDPOP0(Pjp), cState) - - case cJU_JPIMMED_1_01: SET_01(1); goto Imm_01; - case cJU_JPIMMED_2_01: SET_01(2); goto Imm_01; - case cJU_JPIMMED_3_01: SET_01(3); goto Imm_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: SET_01(4); goto Imm_01; - case cJU_JPIMMED_5_01: SET_01(5); goto Imm_01; - case cJU_JPIMMED_6_01: SET_01(6); goto Imm_01; - case cJU_JPIMMED_7_01: SET_01(7); goto Imm_01; -#endif - -Imm_01: - - DBGCODE(SETOFFSET_IMM_CK(offset, Count0, pop1lower, 1);) - JU_RET_FOUND_IMM_01(Pjp); - -// Shorthand for where to find start of Index bytes array: - -#ifdef JUDY1 -#define PJI (Pjp->jp_1Index) -#else -#define PJI (Pjp->jp_LIndex) -#endif - -// Optional code to check the remaining ordinal (see SETOFFSET_IMM()) against -// the Index Size of the Immediate: - -#ifndef DEBUG // simple placeholder: -#define IMM(cPop1,Next) \ - goto Next -#else // extra pop1-specific checking: -#define IMM(cPop1,Next) \ - SETOFFSET_IMM_CK(offset, Count0, pop1lower, cPop1); \ - goto Next -#endif - - case cJU_JPIMMED_1_02: IMM( 2, Imm1); - case cJU_JPIMMED_1_03: IMM( 3, Imm1); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: IMM( 4, Imm1); - case cJU_JPIMMED_1_05: IMM( 5, Imm1); - case cJU_JPIMMED_1_06: IMM( 6, Imm1); - case cJU_JPIMMED_1_07: IMM( 7, Imm1); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: IMM( 8, Imm1); - case cJ1_JPIMMED_1_09: IMM( 9, Imm1); - case cJ1_JPIMMED_1_10: IMM(10, Imm1); - case cJ1_JPIMMED_1_11: IMM(11, Imm1); - case cJ1_JPIMMED_1_12: IMM(12, Imm1); - case cJ1_JPIMMED_1_13: IMM(13, Imm1); - case cJ1_JPIMMED_1_14: IMM(14, Imm1); - case cJ1_JPIMMED_1_15: IMM(15, Imm1); -#endif - -Imm1: SETOFFSET_IMM(offset, Count0, pop1lower); - JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]); - JU_RET_FOUND_IMM(Pjp, offset); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: IMM(2, Imm2); - case cJU_JPIMMED_2_03: IMM(3, Imm2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: IMM(4, Imm2); - case cJ1_JPIMMED_2_05: IMM(5, Imm2); - case cJ1_JPIMMED_2_06: IMM(6, Imm2); - case cJ1_JPIMMED_2_07: IMM(7, Imm2); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -Imm2: SETOFFSET_IMM(offset, Count0, pop1lower); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: IMM(2, Imm3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: IMM(3, Imm3); - case cJ1_JPIMMED_3_04: IMM(4, Imm3); - case cJ1_JPIMMED_3_05: IMM(5, Imm3); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -Imm3: - { - Word_t lsb; - SETOFFSET_IMM(offset, Count0, pop1lower); - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: IMM(2, Imm4); - case cJ1_JPIMMED_4_03: IMM(3, Imm4); - -Imm4: SETOFFSET_IMM(offset, Count0, pop1lower); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); - - case cJ1_JPIMMED_5_02: IMM(2, Imm5); - case cJ1_JPIMMED_5_03: IMM(3, Imm5); - -Imm5: - { - Word_t lsb; - SETOFFSET_IMM(offset, Count0, pop1lower); - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_6_02: IMM(2, Imm6); - -Imm6: - { - Word_t lsb; - SETOFFSET_IMM(offset, Count0, pop1lower); - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_7_02: IMM(2, Imm7); - -Imm7: - { - Word_t lsb; - SETOFFSET_IMM(offset, Count0, pop1lower); - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif // (JUDY1 && JU_64BIT) - - -// ---------------------------------------------------------------------------- -// UNEXPECTED JP TYPES: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SMByCount switch. - - /*NOTREACHED*/ - -} // Judy1ByCount() / JudyLByCount() diff --git a/libjudy/src/JudyL/JudyLCascade.c b/libjudy/src/JudyL/JudyLCascade.c deleted file mode 100644 index 998a9d727f..0000000000 --- a/libjudy/src/JudyL/JudyLCascade.c +++ /dev/null @@ -1,1942 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.38 $ $Source: /judy/src/JudyCommon/JudyCascade.c $ - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -extern int j__udyCreateBranchL(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); -extern int j__udyCreateBranchB(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); - -DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);) - -static const jbb_t StageJBBZero; // zeroed versions of namesake struct. - -// TBD: There are multiple copies of (some of) these CopyWto3, Copy3toW, -// CopyWto7 and Copy7toW functions in Judy1Cascade.c, JudyLCascade.c, and -// JudyDecascade.c. These static functions should probably be moved to a -// common place, made macros, or something to avoid having four copies. - - -// **************************************************************************** -// __ J U D Y C O P Y X T O W - - -FUNCTION static void j__udyCopy3toW( - PWord_t PDest, - uint8_t * PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY3_PINDEX_TO_LONG(*PDest, PSrc); - PSrc += 3; - PDest += 1; - - } while(--LeafIndexes); - -} //j__udyCopy3toW() - - -#ifdef JU_64BIT - -FUNCTION static void j__udyCopy4toW( - PWord_t PDest, - uint32_t * PSrc, - Word_t LeafIndexes) -{ - do { *PDest++ = *PSrc++; - } while(--LeafIndexes); - -} // j__udyCopy4toW() - - -FUNCTION static void j__udyCopy5toW( - PWord_t PDest, - uint8_t * PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY5_PINDEX_TO_LONG(*PDest, PSrc); - PSrc += 5; - PDest += 1; - - } while(--LeafIndexes); - -} // j__udyCopy5toW() - - -FUNCTION static void j__udyCopy6toW( - PWord_t PDest, - uint8_t * PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY6_PINDEX_TO_LONG(*PDest, PSrc); - PSrc += 6; - PDest += 1; - - } while(--LeafIndexes); - -} // j__udyCopy6toW() - - -FUNCTION static void j__udyCopy7toW( - PWord_t PDest, - uint8_t * PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY7_PINDEX_TO_LONG(*PDest, PSrc); - PSrc += 7; - PDest += 1; - - } while(--LeafIndexes); - -} // j__udyCopy7toW() - -#endif // JU_64BIT - - -// **************************************************************************** -// __ J U D Y C O P Y W T O X - - -FUNCTION static void j__udyCopyWto3( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY3_LONG_TO_PINDEX(PDest, *PSrc); - PSrc += 1; - PDest += 3; - - } while(--LeafIndexes); - -} // j__udyCopyWto3() - - -#ifdef JU_64BIT - -FUNCTION static void j__udyCopyWto4( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - uint32_t *PDest32 = (uint32_t *)PDest; - - do - { - *PDest32 = *PSrc; - PSrc += 1; - PDest32 += 1; - } while(--LeafIndexes); - -} // j__udyCopyWto4() - - -FUNCTION static void j__udyCopyWto5( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY5_LONG_TO_PINDEX(PDest, *PSrc); - PSrc += 1; - PDest += 5; - - } while(--LeafIndexes); - -} // j__udyCopyWto5() - - -FUNCTION static void j__udyCopyWto6( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY6_LONG_TO_PINDEX(PDest, *PSrc); - PSrc += 1; - PDest += 6; - - } while(--LeafIndexes); - -} // j__udyCopyWto6() - - -FUNCTION static void j__udyCopyWto7( - uint8_t * PDest, - PWord_t PSrc, - Word_t LeafIndexes) -{ - do - { - JU_COPY7_LONG_TO_PINDEX(PDest, *PSrc); - PSrc += 1; - PDest += 7; - - } while(--LeafIndexes); - -} // j__udyCopyWto7() - -#endif // JU_64BIT - - -// **************************************************************************** -// COMMON CODE (MACROS): -// -// Free objects in an array of valid JPs, StageJP[ExpCnt] == last one may -// include Immeds, which are ignored. - -#define FREEALLEXIT(ExpCnt,StageJP,Pjpm) \ - { \ - Word_t _expct = (ExpCnt); \ - while (_expct--) j__udyFreeSM(&((StageJP)[_expct]), Pjpm); \ - return(-1); \ - } - -// Clear the array that keeps track of the number of JPs in a subexpanse: - -#define ZEROJP(SubJPCount) \ - { \ - int ii; \ - for (ii = 0; ii < cJU_NUMSUBEXPB; ii++) (SubJPCount[ii]) = 0; \ - } - -// **************************************************************************** -// __ J U D Y S T A G E J B B T O J B B -// -// Create a mallocd BranchB (jbb_t) from a staged BranchB while "splaying" a -// single old leaf. Return -1 if out of memory, otherwise 1. - -static int j__udyStageJBBtoJBB( - Pjp_t PjpLeaf, // JP of leaf being splayed. - Pjbb_t PStageJBB, // temp jbb_t on stack. - Pjp_t PjpArray, // array of JPs to splayed new leaves. - uint8_t * PSubCount, // count of JPs for each subexpanse. - Pjpm_t Pjpm) // the jpm_t for JudyAlloc*(). -{ - Pjbb_t PjbbRaw; // pointer to new bitmap branch. - Pjbb_t Pjbb; - Word_t subexp; - -// Get memory for new BranchB: - - if ((PjbbRaw = j__udyAllocJBB(Pjpm)) == (Pjbb_t) NULL) return(-1); - Pjbb = P_JBB(PjbbRaw); - -// Copy staged BranchB into just-allocated BranchB: - - *Pjbb = *PStageJBB; - -// Allocate the JP subarrays (BJP) for the new BranchB: - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; subexp++) - { - Pjp_t PjpRaw; - Pjp_t Pjp; - Word_t NumJP; // number of JPs in each subexpanse. - - if ((NumJP = PSubCount[subexp]) == 0) continue; // empty. - -// Out of memory, back out previous allocations: - - if ((PjpRaw = j__udyAllocJBBJP(NumJP, Pjpm)) == (Pjp_t) NULL) - { - while(subexp--) - { - if ((NumJP = PSubCount[subexp]) == 0) continue; - - PjpRaw = JU_JBB_PJP(Pjbb, subexp); - j__udyFreeJBBJP(PjpRaw, NumJP, Pjpm); - } - j__udyFreeJBB(PjbbRaw, Pjpm); - return(-1); // out of memory. - } - Pjp = P_JP(PjpRaw); - -// Place the JP subarray pointer in the new BranchB, copy subarray JPs, and -// advance to the next subexpanse: - - JU_JBB_PJP(Pjbb, subexp) = PjpRaw; - JU_COPYMEM(Pjp, PjpArray, NumJP); - PjpArray += NumJP; - - } // for each subexpanse. - -// Change the PjpLeaf from Leaf to BranchB: - - PjpLeaf->jp_Addr = (Word_t) PjbbRaw; - PjpLeaf->jp_Type += cJU_JPBRANCH_B2 - cJU_JPLEAF2; // Leaf to BranchB. - - return(1); - -} // j__udyStageJBBtoJBB() - - -// **************************************************************************** -// __ J U D Y J L L 2 T O J L B 1 -// -// Create a LeafB1 (jlb_t = JLB1) from a Leaf2 (2-byte Indexes and for JudyL, -// Word_t Values). Return NULL if out of memory, else a pointer to the new -// LeafB1. -// -// NOTE: Caller must release the Leaf2 that was passed in. - -FUNCTION static Pjlb_t j__udyJLL2toJLB1( - uint16_t * Pjll, // array of 16-bit indexes. -#ifdef JUDYL - Pjv_t Pjv, // array of associated values. -#endif - Word_t LeafPop1, // number of indexes/values. - Pvoid_t Pjpm) // jpm_t for JudyAlloc*()/JudyFree*(). -{ - Pjlb_t PjlbRaw; - Pjlb_t Pjlb; - int offset; -JUDYLCODE(int subexp;) - -// Allocate the LeafB1: - - if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL) - return((Pjlb_t) NULL); - Pjlb = P_JLB(PjlbRaw); - -// Copy Leaf2 indexes to LeafB1: - - for (offset = 0; offset < LeafPop1; ++offset) - JU_BITMAPSETL(Pjlb, Pjll[offset]); - -#ifdef JUDYL - -// Build LeafVs from bitmap: - - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - { - struct _POINTER_VALUES - { - Word_t pv_Pop1; // size of value area. - Pjv_t pv_Pjv; // raw pointer to value area. - } pv[cJU_NUMSUBEXPL]; - -// Get the population of the subexpanse, and if any, allocate a LeafV: - - pv[subexp].pv_Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - - if (pv[subexp].pv_Pop1) - { - Pjv_t Pjvnew; - -// TBD: There is an opportunity to put pop == 1 value in pointer: - - pv[subexp].pv_Pjv = j__udyLAllocJV(pv[subexp].pv_Pop1, Pjpm); - -// Upon out of memory, free all previously allocated: - - if (pv[subexp].pv_Pjv == (Pjv_t) NULL) - { - while(subexp--) - { - if (pv[subexp].pv_Pop1) - { - j__udyLFreeJV(pv[subexp].pv_Pjv, pv[subexp].pv_Pop1, - Pjpm); - } - } - j__udyFreeJLB1(PjlbRaw, Pjpm); - return((Pjlb_t) NULL); - } - - Pjvnew = P_JV(pv[subexp].pv_Pjv); - JU_COPYMEM(Pjvnew, Pjv, pv[subexp].pv_Pop1); - Pjv += pv[subexp].pv_Pop1; // advance value pointer. - -// Place raw pointer to value array in bitmap subexpanse: - - JL_JLB_PVALUE(Pjlb, subexp) = pv[subexp].pv_Pjv; - - } // populated subexpanse. - } // each subexpanse. - -#endif // JUDYL - - return(PjlbRaw); // pointer to LeafB1. - -} // j__udyJLL2toJLB1() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 1 -// -// Create bitmap leaf from 1-byte Indexes and Word_t Values. -// -// TBD: There must be a better way. -// -// Only for JudyL 32 bit: (note, unifdef disallows comment on next line) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -FUNCTION int j__udyCascade1( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - Word_t DcdP0; - uint8_t * PLeaf; - Pjlb_t PjlbRaw; - Pjlb_t Pjlb; - Word_t Pop1; - Word_t ii; // temp for loop counter -JUDYLCODE(Pjv_t Pjv;) - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF1); - assert((JU_JPDCDPOP0(Pjp) & 0xFF) == (cJU_LEAF1_MAXPOP1-1)); - - PjlbRaw = j__udyAllocJLB1(Pjpm); - if (PjlbRaw == (Pjlb_t) NULL) return(-1); - - Pjlb = P_JLB(PjlbRaw); - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - - JUDYLCODE(Pjv = JL_LEAF1VALUEAREA(PLeaf, Pop1);) - -// Copy 1 byte index Leaf to bitmap Leaf - for (ii = 0; ii < Pop1; ii++) JU_BITMAPSETL(Pjlb, PLeaf[ii]); - -#ifdef JUDYL -// Build 8 subexpanse Value leaves from bitmap - for (ii = 0; ii < cJU_NUMSUBEXPL; ii++) - { -// Get number of Indexes in subexpanse - if ((Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, ii)))) - { - Pjv_t PjvnewRaw; // value area of new leaf. - Pjv_t Pjvnew; - - PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm); - if (PjvnewRaw == (Pjv_t) NULL) // out of memory. - { -// Free prevously allocated LeafVs: - while(ii--) - { - if ((Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, ii)))) - { - PjvnewRaw = JL_JLB_PVALUE(Pjlb, ii); - j__udyLFreeJV(PjvnewRaw, Pop1, Pjpm); - } - } -// Free the bitmap leaf - j__udyLFreeJLB1(PjlbRaw,Pjpm); - return(-1); - } - Pjvnew = P_JV(PjvnewRaw); - JU_COPYMEM(Pjvnew, Pjv, Pop1); - - Pjv += Pop1; - JL_JLB_PVALUE(Pjlb, ii) = PjvnewRaw; - } - } -#endif // JUDYL - - DcdP0 = JU_JPDCDPOP0(Pjp) | (PLeaf[0] & cJU_DCDMASK(1)); - JU_JPSETADT(Pjp, (Word_t)PjlbRaw, DcdP0, cJU_JPLEAF_B1); - - return(1); // return success - -} // j__udyCascade1() - -#endif // (!(JUDY1 && JU_64BIT)) - - -// **************************************************************************** -// __ J U D Y C A S C A D E 2 -// -// Entry PLeaf of size LeafPop1 is either compressed or splayed with pointer -// returned in Pjp. Entry Levels sizeof(Word_t) down to level 2. -// -// Splay or compress the 2-byte Index Leaf that Pjp point to. Return *Pjp as a -// (compressed) cJU_LEAFB1 or a cJU_BRANCH_*2 - -FUNCTION int j__udyCascade2( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint16_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF2_MAXPOP1]; // JPs of new leaves - uint8_t StageExp [cJU_LEAF2_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF2); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFF) == (cJU_LEAF2_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint16_t *) P_JLL(Pjp->jp_Addr); - -// And its Value area - JUDYLCODE(Pjv = JL_LEAF2VALUEAREA(PLeaf, cJU_LEAF2_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it to a Bitmap Leaf - - CIndex = PLeaf[0]; - if (!JU_DIGITATSTATE(CIndex ^ PLeaf[cJU_LEAF2_MAXPOP1-1], 2)) - { -// cJU_JPLEAF_B1 - Word_t DcdP0; - Pjlb_t PjlbRaw; - PjlbRaw = j__udyJLL2toJLB1(PLeaf, -#ifdef JUDYL - Pjv, -#endif - cJU_LEAF2_MAXPOP1, Pjpm); - if (PjlbRaw == (Pjlb_t)NULL) return(-1); // out of memory - -// Merge in another Dcd byte because compressing - DcdP0 = (CIndex & cJU_DCDMASK(1)) | JU_JPDCDPOP0(Pjp); - JU_JPSETADT(Pjp, (Word_t)PjlbRaw, DcdP0, cJU_JPLEAF_B1); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 2 byte index Leaf to 1 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF2_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ PLeaf[End], 2)) - ) - { -// Build a leaf below the previous expanse -// - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 2); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 2); - - if (Pop1 == 1) // cJU_JPIMMED_1_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(1)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_1_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_1_01); -#endif // JUDYL - } - else if (Pop1 <= cJU_IMMED1_MAXPOP1) // bigger - { -// cJL_JPIMMED_1_02..3: JudyL 32 -// cJ1_JPIMMED_1_02..7: Judy1 32 -// cJL_JPIMMED_1_02..7: JudyL 64 -// cJ1_JPIMMED_1_02..15: Judy1 64 -#ifdef JUDYL - Pjv_t PjvnewRaw; // value area of leaf. - Pjv_t Pjvnew; - -// Allocate Value area for Immediate Leaf - PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm); - if (PjvnewRaw == (Pjv_t) NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjvnew = P_JV(PjvnewRaw); - -// Copy to Values to Value Leaf - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); - PjpJP->jp_Addr = (Word_t) PjvnewRaw; - -// Copy to JP as an immediate Leaf - JU_COPYMEM(PjpJP->jp_LIndex, PLeaf + Start, - Pop1); -#else - JU_COPYMEM(PjpJP->jp_1Index, PLeaf + Start, - Pop1); -#endif -// Set Type, Population and Index size - PjpJP->jp_Type = cJU_JPIMMED_1_02 + Pop1 - 2; - } - -// 64Bit Judy1 does not have Leaf1: (note, unifdef disallows comment on next -// line) - -#if (! (defined(JUDY1) && defined(JU_64BIT))) - else if (Pop1 <= cJU_LEAF1_MAXPOP1) // still bigger - { -// cJU_JPLEAF1 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get a new Leaf - PjllRaw = j__udyAllocJLL1(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF1VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif -// Copy Indexes to new Leaf - JU_COPYMEM((uint8_t *)Pjll, PLeaf+Start, Pop1); - - DBGCODE(JudyCheckSorted(Pjll, Pop1, 1);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(2)) - | - (CIndex & cJU_DCDMASK(2-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF1); - } -#endif // (!(JUDY1 && JU_64BIT)) // Not 64Bit Judy1 - - else // biggest - { -// cJU_JPLEAF_B1 - Word_t DcdP0; - Pjlb_t PjlbRaw; - PjlbRaw = j__udyJLL2toJLB1( - PLeaf + Start, -#ifdef JUDYL - Pjv + Start, -#endif - Pop1, Pjpm); - if (PjlbRaw == (Pjlb_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(2)) - | - (CIndex & cJU_DCDMASK(2-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjlbRaw, DcdP0, - cJU_JPLEAF_B1); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF2_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = PLeaf[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L2; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade2() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 3 -// -// Return *Pjp as a (compressed) cJU_LEAF2, cJU_BRANCH_L3, cJU_BRANCH_B3. - -FUNCTION int j__udyCascade3( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint8_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF3_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF3_MAXPOP1]; - uint8_t StageExp [cJU_LEAF3_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF3); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFF) == (cJU_LEAF3_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - -// Extract leaf to Word_t and insert-sort Index into it - j__udyCopy3toW(StageA, PLeaf, cJU_LEAF3_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF3VALUEAREA(PLeaf, cJU_LEAF3_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF3_MAXPOP1-1], 3)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Alloc a 2 byte Index Leaf - PjllRaw = j__udyAllocJLL2(cJU_LEAF3_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy just 2 bytes Indexes to new Leaf -// j__udyCopyWto2((uint16_t *) Pjll, StageA, cJU_LEAF3_MAXPOP1); - JU_COPYMEM ((uint16_t *) Pjll, StageA, cJU_LEAF3_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF2VALUEAREA(Pjll, cJU_LEAF3_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF3_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF3_MAXPOP1, 2);) - -// Form new JP, Pop0 field is unchanged -// Add in another Dcd byte because compressing - DcdP0 = (CIndex & cJU_DCDMASK(2)) | JU_JPDCDPOP0(Pjp); - - JU_JPSETADT(Pjp, (Word_t) PjllRaw, DcdP0, cJU_JPLEAF2); - - return(1); // Success - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 3 byte index Leaf to 2 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF3_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 3)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 3); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 3); - - if (Pop1 == 1) // cJU_JPIMMED_2_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(2)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_2_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_2_01); -#endif // JUDYL - } -#if (defined(JUDY1) || defined(JU_64BIT)) - else if (Pop1 <= cJU_IMMED2_MAXPOP1) - { -// cJ1_JPIMMED_2_02..3: Judy1 32 -// cJL_JPIMMED_2_02..3: JudyL 64 -// cJ1_JPIMMED_2_02..7: Judy1 64 -#ifdef JUDYL -// Alloc is 1st in case of malloc fail - Pjv_t PjvnewRaw; // value area of new leaf. - Pjv_t Pjvnew; - -// Allocate Value area for Immediate Leaf - PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm); - if (PjvnewRaw == (Pjv_t) NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjvnew = P_JV(PjvnewRaw); - -// Copy to Values to Value Leaf - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); - - PjpJP->jp_Addr = (Word_t) PjvnewRaw; - -// Copy to Index to JP as an immediate Leaf - JU_COPYMEM((uint16_t *) (PjpJP->jp_LIndex), - StageA + Start, Pop1); -#else // JUDY1 - JU_COPYMEM((uint16_t *) (PjpJP->jp_1Index), - StageA + Start, Pop1); -#endif // JUDY1 -// Set Type, Population and Index size - PjpJP->jp_Type = cJU_JPIMMED_2_02 + Pop1 - 2; - } -#endif // (JUDY1 || JU_64BIT) - - else // Make a linear leaf2 - { -// cJU_JPLEAF2 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - - PjllRaw = j__udyAllocJLL2(Pop1, Pjpm); - if (PjllRaw == (Pjll_t) NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF2VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif -// Copy least 2 bytes per Index of Leaf to new Leaf - JU_COPYMEM((uint16_t *) Pjll, StageA+Start, - Pop1); - - DBGCODE(JudyCheckSorted(Pjll, Pop1, 2);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(3)) - | - (CIndex & cJU_DCDMASK(3-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF2); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF3_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L3; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade3() - - -#ifdef JU_64BIT // JudyCascade[4567] - -// **************************************************************************** -// __ J U D Y C A S C A D E 4 -// -// Cascade from a cJU_JPLEAF4 to one of the following: -// 1. if leaf is in 1 expanse: -// compress it into a JPLEAF3 -// 2. if leaf contains multiple expanses: -// create linear or bitmap branch containing -// each new expanse is either a: -// JPIMMED_3_01 branch -// JPIMMED_3_02 branch -// JPLEAF3 - -FUNCTION int j__udyCascade4( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint32_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF4_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF4_MAXPOP1]; - uint8_t StageExp [cJU_LEAF4_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF4); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFFFF) == (cJU_LEAF4_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint32_t *) P_JLL(Pjp->jp_Addr); - -// Extract 4 byte index Leaf to Word_t - j__udyCopy4toW(StageA, PLeaf, cJU_LEAF4_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF4VALUEAREA(PLeaf, cJU_LEAF4_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF4_MAXPOP1-1], 4)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new Leaf. - -// Alloc a 3 byte Index Leaf - PjllRaw = j__udyAllocJLL3(cJU_LEAF4_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy Index area into new Leaf - j__udyCopyWto3((uint8_t *) Pjll, StageA, cJU_LEAF4_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF3VALUEAREA(Pjll, cJU_LEAF4_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF4_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF4_MAXPOP1, 3);) - - DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(3)); - JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF3); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 4 byte index Leaf to 3 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF4_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 4)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 4); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 4); - - if (Pop1 == 1) // cJU_JPIMMED_3_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(3)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_3_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_3_01); -#endif // JUDYL - } - else if (Pop1 <= cJU_IMMED3_MAXPOP1) - { -// cJ1_JPIMMED_3_02 : Judy1 32 -// cJL_JPIMMED_3_02 : JudyL 64 -// cJ1_JPIMMED_3_02..5: Judy1 64 - -#ifdef JUDYL -// Alloc is 1st in case of malloc fail - Pjv_t PjvnewRaw; // value area of new leaf. - Pjv_t Pjvnew; - -// Allocate Value area for Immediate Leaf - PjvnewRaw = j__udyLAllocJV(Pop1, Pjpm); - if (PjvnewRaw == (Pjv_t) NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjvnew = P_JV(PjvnewRaw); - -// Copy to Values to Value Leaf - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); - PjpJP->jp_Addr = (Word_t) PjvnewRaw; - -// Copy to Index to JP as an immediate Leaf - j__udyCopyWto3(PjpJP->jp_LIndex, - StageA + Start, Pop1); -#else - j__udyCopyWto3(PjpJP->jp_1Index, - StageA + Start, Pop1); -#endif -// Set type, population and Index size - PjpJP->jp_Type = cJU_JPIMMED_3_02 + Pop1 - 2; - } - else - { -// cJU_JPLEAF3 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - - PjllRaw = j__udyAllocJLL3(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); - -// Copy Indexes to new Leaf - j__udyCopyWto3((uint8_t *) Pjll, StageA + Start, - Pop1); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF3VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif - DBGCODE(JudyCheckSorted(Pjll, Pop1, 3);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(4)) - | - (CIndex & cJU_DCDMASK(4-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF3); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF4_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L4; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade4() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 5 -// -// Cascade from a cJU_JPLEAF5 to one of the following: -// 1. if leaf is in 1 expanse: -// compress it into a JPLEAF4 -// 2. if leaf contains multiple expanses: -// create linear or bitmap branch containing -// each new expanse is either a: -// JPIMMED_4_01 branch -// JPLEAF4 - -FUNCTION int j__udyCascade5( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint8_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF5_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF5_MAXPOP1]; - uint8_t StageExp [cJU_LEAF5_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF5); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFFFFFF) == (cJU_LEAF5_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - -// Extract 5 byte index Leaf to Word_t - j__udyCopy5toW(StageA, PLeaf, cJU_LEAF5_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF5VALUEAREA(PLeaf, cJU_LEAF5_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF5_MAXPOP1-1], 5)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Alloc a 4 byte Index Leaf - PjllRaw = j__udyAllocJLL4(cJU_LEAF5_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy Index area into new Leaf - j__udyCopyWto4((uint8_t *) Pjll, StageA, cJU_LEAF5_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF4VALUEAREA(Pjll, cJU_LEAF5_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF5_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF5_MAXPOP1, 4);) - - DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(4)); - JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF4); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 5 byte index Leaf to 4 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF5_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 5)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 5); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 5); - - if (Pop1 == 1) // cJU_JPIMMED_4_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(4)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_4_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_4_01); -#endif // JUDYL - } -#ifdef JUDY1 - else if (Pop1 <= cJ1_IMMED4_MAXPOP1) - { -// cJ1_JPIMMED_4_02..3: Judy1 64 - -// Copy to Index to JP as an immediate Leaf - j__udyCopyWto4(PjpJP->jp_1Index, - StageA + Start, Pop1); - -// Set pointer, type, population and Index size - PjpJP->jp_Type = cJ1_JPIMMED_4_02 + Pop1 - 2; - } -#endif - else - { -// cJU_JPLEAF4 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get a new Leaf - PjllRaw = j__udyAllocJLL4(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); - -// Copy Indexes to new Leaf - j__udyCopyWto4((uint8_t *) Pjll, StageA + Start, - Pop1); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF4VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif - DBGCODE(JudyCheckSorted(Pjll, Pop1, 4);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(5)) - | - (CIndex & cJU_DCDMASK(5-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF4); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF5_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L5; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade5() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 6 -// -// Cascade from a cJU_JPLEAF6 to one of the following: -// 1. if leaf is in 1 expanse: -// compress it into a JPLEAF5 -// 2. if leaf contains multiple expanses: -// create linear or bitmap branch containing -// each new expanse is either a: -// JPIMMED_5_01 ... JPIMMED_5_03 branch -// JPIMMED_5_01 branch -// JPLEAF5 - -FUNCTION int j__udyCascade6( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint8_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF6_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF6_MAXPOP1]; - uint8_t StageExp [cJU_LEAF6_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF6); - assert((JU_JPDCDPOP0(Pjp) & 0xFFFFFFFFFFFF) == (cJU_LEAF6_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - -// Extract 6 byte index Leaf to Word_t - j__udyCopy6toW(StageA, PLeaf, cJU_LEAF6_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF6VALUEAREA(PLeaf, cJU_LEAF6_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF6_MAXPOP1-1], 6)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Alloc a 5 byte Index Leaf - PjllRaw = j__udyAllocJLL5(cJU_LEAF6_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy Index area into new Leaf - j__udyCopyWto5((uint8_t *) Pjll, StageA, cJU_LEAF6_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF5VALUEAREA(Pjll, cJU_LEAF6_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF6_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF6_MAXPOP1, 5);) - - DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(5)); - JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF5); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 6 byte index Leaf to 5 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF6_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 6)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 6); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 6); - - if (Pop1 == 1) // cJU_JPIMMED_5_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(5)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_5_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_5_01); -#endif // JUDYL - } -#ifdef JUDY1 - else if (Pop1 <= cJ1_IMMED5_MAXPOP1) - { -// cJ1_JPIMMED_5_02..3: Judy1 64 - -// Copy to Index to JP as an immediate Leaf - j__udyCopyWto5(PjpJP->jp_1Index, - StageA + Start, Pop1); - -// Set pointer, type, population and Index size - PjpJP->jp_Type = cJ1_JPIMMED_5_02 + Pop1 - 2; - } -#endif - else - { -// cJU_JPLEAF5 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get a new Leaf - PjllRaw = j__udyAllocJLL5(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjll = P_JLL(PjllRaw); - -// Copy Indexes to new Leaf - j__udyCopyWto5((uint8_t *) Pjll, StageA + Start, - Pop1); - -// Copy to Values to new Leaf -#ifdef JUDYL - Pjvnew = JL_LEAF5VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif - DBGCODE(JudyCheckSorted(Pjll, Pop1, 5);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(6)) - | - (CIndex & cJU_DCDMASK(6-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF5); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF6_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L6; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade6() - - -// **************************************************************************** -// __ J U D Y C A S C A D E 7 -// -// Cascade from a cJU_JPLEAF7 to one of the following: -// 1. if leaf is in 1 expanse: -// compress it into a JPLEAF6 -// 2. if leaf contains multiple expanses: -// create linear or bitmap branch containing -// each new expanse is either a: -// JPIMMED_6_01 ... JPIMMED_6_02 branch -// JPIMMED_6_01 branch -// JPLEAF6 - -FUNCTION int j__udyCascade7( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - uint8_t * PLeaf; // pointer to leaf, explicit type. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAF7_MAXPOP1]; // JPs of new leaves - Word_t StageA [cJU_LEAF7_MAXPOP1]; - uint8_t StageExp [cJU_LEAF7_MAXPOP1]; // Expanses of new leaves - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF7); - assert(JU_JPDCDPOP0(Pjp) == (cJU_LEAF7_MAXPOP1-1)); - -// Get the address of the Leaf - PLeaf = (uint8_t *) P_JLL(Pjp->jp_Addr); - -// Extract 7 byte index Leaf to Word_t - j__udyCopy7toW(StageA, PLeaf, cJU_LEAF7_MAXPOP1); - -// Get the address of the Leaf and Value area - JUDYLCODE(Pjv = JL_LEAF7VALUEAREA(PLeaf, cJU_LEAF7_MAXPOP1);) - -// If Leaf is in 1 expanse -- just compress it (compare 1st, last & Index) - - CIndex = StageA[0]; - if (!JU_DIGITATSTATE(CIndex ^ StageA[cJU_LEAF7_MAXPOP1-1], 7)) - { - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Alloc a 6 byte Index Leaf - PjllRaw = j__udyAllocJLL6(cJU_LEAF7_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy Index area into new Leaf - j__udyCopyWto6((uint8_t *) Pjll, StageA, cJU_LEAF7_MAXPOP1); -#ifdef JUDYL -// Copy Value area into new Leaf - Pjvnew = JL_LEAF6VALUEAREA(Pjll, cJU_LEAF7_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAF7_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAF7_MAXPOP1, 6);) - - DcdP0 = JU_JPDCDPOP0(Pjp) | (CIndex & cJU_DCDMASK(6)); - JU_JPSETADT(Pjp, (Word_t)PjllRaw, DcdP0, cJU_JPLEAF6); - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 7 byte index Leaf to 6 byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAF7_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ StageA[End], 7)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, 7); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, 7); - - if (Pop1 == 1) // cJU_JPIMMED_6_01 - { - Word_t DcdP0; - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(6)) | - CIndex; -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, DcdP0, cJ1_JPIMMED_6_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], DcdP0, - cJL_JPIMMED_6_01); -#endif // JUDYL - } -#ifdef JUDY1 - else if (Pop1 == cJ1_IMMED6_MAXPOP1) - { -// cJ1_JPIMMED_6_02: Judy1 64 - -// Copy to Index to JP as an immediate Leaf - j__udyCopyWto6(PjpJP->jp_1Index, - StageA + Start, 2); - -// Set pointer, type, population and Index size - PjpJP->jp_Type = cJ1_JPIMMED_6_02; - } -#endif - else - { -// cJU_JPLEAF6 - Word_t DcdP0; - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get a new Leaf - PjllRaw = j__udyAllocJLL6(Pop1, Pjpm); - if (PjllRaw == (Pjll_t)NULL) - FREEALLEXIT(ExpCnt, StageJP, Pjpm); - Pjll = P_JLL(PjllRaw); - -// Copy Indexes to new Leaf - j__udyCopyWto6((uint8_t *) Pjll, StageA + Start, - Pop1); -#ifdef JUDYL -// Copy to Values to new Leaf - Pjvnew = JL_LEAF6VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif - DBGCODE(JudyCheckSorted(Pjll, Pop1, 6);) - - DcdP0 = (JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(7)) - | - (CIndex & cJU_DCDMASK(7-1)) - | - (Pop1 - 1); - - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, DcdP0, - cJU_JPLEAF6); - } - ExpCnt++; -// Done? - if (End == cJU_LEAF7_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = StageA[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L7; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - } - return(1); - -} // j__udyCascade7() - -#endif // JU_64BIT - - -// **************************************************************************** -// __ J U D Y C A S C A D E L -// -// (Compressed) cJU_LEAF3[7], cJ1_JPBRANCH_L. -// -// Cascade from a LEAFW (under Pjp) to one of the following: -// 1. if LEAFW is in 1 expanse: -// create linear branch with a JPLEAF3[7] under it -// 2. LEAFW contains multiple expanses: -// create linear or bitmap branch containing new expanses -// each new expanse is either a: 32 64 -// JPIMMED_3_01 branch Y N -// JPIMMED_7_01 branch N Y -// JPLEAF3 Y N -// JPLEAF7 N Y - -FUNCTION int j__udyCascadeL( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - Pjlw_t Pjlw; // leaf to work on. - Word_t End, Start; // temporaries. - Word_t ExpCnt; // count of expanses of splay. - Word_t CIndex; // current Index word. -JUDYLCODE(Pjv_t Pjv;) // value area of leaf. - -// Temp staging for parts(Leaves) of newly splayed leaf - jp_t StageJP [cJU_LEAFW_MAXPOP1]; - uint8_t StageExp[cJU_LEAFW_MAXPOP1]; - uint8_t SubJPCount[cJU_NUMSUBEXPB]; // JPs in each subexpanse - jbb_t StageJBB; // staged bitmap branch - -// Get the address of the Leaf - Pjlw = P_JLW(Pjp->jp_Addr); - - assert(Pjlw[0] == (cJU_LEAFW_MAXPOP1 - 1)); - -// Get pointer to Value area of old Leaf - JUDYLCODE(Pjv = JL_LEAFWVALUEAREA(Pjlw, cJU_LEAFW_MAXPOP1);) - - Pjlw++; // Now point to Index area - -// If Leaf is in 1 expanse -- first compress it (compare 1st, last & Index): - - CIndex = Pjlw[0]; // also used far below - if (!JU_DIGITATSTATE(CIndex ^ Pjlw[cJU_LEAFW_MAXPOP1 - 1], - cJU_ROOTSTATE)) - { - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. - -// Get the common expanse to all elements in Leaf - StageExp[0] = JU_DIGITATSTATE(CIndex, cJU_ROOTSTATE); - -// Alloc a 3[7] byte Index Leaf -#ifdef JU_64BIT - PjllRaw = j__udyAllocJLL7(cJU_LEAFW_MAXPOP1, Pjpm); - if (PjllRaw == (Pjlb_t)NULL) return(-1); // out of memory - - Pjll = P_JLL(PjllRaw); - -// Copy LEAFW to a cJU_JPLEAF7 - j__udyCopyWto7((uint8_t *) Pjll, Pjlw, cJU_LEAFW_MAXPOP1); -#ifdef JUDYL -// Get the Value area of new Leaf - Pjvnew = JL_LEAF7VALUEAREA(Pjll, cJU_LEAFW_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAFW_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAFW_MAXPOP1, 7);) -#else // 32 Bit - PjllRaw = j__udyAllocJLL3(cJU_LEAFW_MAXPOP1, Pjpm); - if (PjllRaw == (Pjll_t) NULL) return(-1); - - Pjll = P_JLL(PjllRaw); - -// Copy LEAFW to a cJU_JPLEAF3 - j__udyCopyWto3((uint8_t *) Pjll, Pjlw, cJU_LEAFW_MAXPOP1); -#ifdef JUDYL -// Get the Value area of new Leaf - Pjvnew = JL_LEAF3VALUEAREA(Pjll, cJU_LEAFW_MAXPOP1); - JU_COPYMEM(Pjvnew, Pjv, cJU_LEAFW_MAXPOP1); -#endif - DBGCODE(JudyCheckSorted(Pjll, cJU_LEAFW_MAXPOP1, 3);) -#endif // 32 Bit - -// Following not needed because cJU_DCDMASK(3[7]) is == 0 -////// StageJP[0].jp_DcdPopO |= (CIndex & cJU_DCDMASK(3[7])); -#ifdef JU_64BIT - JU_JPSETADT(&(StageJP[0]), (Word_t)PjllRaw, cJU_LEAFW_MAXPOP1-1, - cJU_JPLEAF7); -#else // 32BIT - JU_JPSETADT(&(StageJP[0]), (Word_t)PjllRaw, cJU_LEAFW_MAXPOP1-1, - cJU_JPLEAF3); -#endif // 32BIT -// Create a 1 element Linear branch - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, 1, Pjpm) == -1) - return(-1); - -// Change the type of callers JP - Pjp->jp_Type = cJU_JPBRANCH_L; - - return(1); - } - -// Else in 2+ expanses, splay Leaf into smaller leaves at higher compression - - StageJBB = StageJBBZero; // zero staged bitmap branch - ZEROJP(SubJPCount); - -// Splay the 4[8] byte Index Leaf to 3[7] byte Index Leaves - for (ExpCnt = Start = 0, End = 1; ; End++) - { -// Check if new expanse or last one - if ( (End == cJU_LEAFW_MAXPOP1) - || - (JU_DIGITATSTATE(CIndex ^ Pjlw[End], cJU_ROOTSTATE)) - ) - { -// Build a leaf below the previous expanse - - Pjp_t PjpJP = StageJP + ExpCnt; - Word_t Pop1 = End - Start; - Word_t expanse = JU_DIGITATSTATE(CIndex, cJU_ROOTSTATE); - Word_t subexp = expanse / cJU_BITSPERSUBEXPB; -// -// set the bit that is the current expanse - JU_JBB_BITMAP(&StageJBB, subexp) |= JU_BITPOSMASKB(expanse); -#ifdef SUBEXPCOUNTS - StageJBB.jbb_subPop1[subexp] += Pop1; // pop of subexpanse -#endif -// count number of expanses in each subexpanse - SubJPCount[subexp]++; - -// Save byte expanse of leaf - StageExp[ExpCnt] = JU_DIGITATSTATE(CIndex, - cJU_ROOTSTATE); - - if (Pop1 == 1) // cJU_JPIMMED_3[7]_01 - { -#ifdef JU_64BIT -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, CIndex, cJ1_JPIMMED_7_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], CIndex, - cJL_JPIMMED_7_01); -#endif // JUDYL - -#else // JU_32BIT -#ifdef JUDY1 - JU_JPSETADT(PjpJP, 0, CIndex, cJ1_JPIMMED_3_01); -#else // JUDYL - JU_JPSETADT(PjpJP, Pjv[Start], CIndex, - cJL_JPIMMED_3_01); -#endif // JUDYL -#endif // JU_32BIT - } -#ifdef JUDY1 -#ifdef JU_64BIT - else if (Pop1 <= cJ1_IMMED7_MAXPOP1) -#else - else if (Pop1 <= cJ1_IMMED3_MAXPOP1) -#endif - { -// cJ1_JPIMMED_3_02 : Judy1 32 -// cJ1_JPIMMED_7_02 : Judy1 64 -// Copy to JP as an immediate Leaf -#ifdef JU_64BIT - j__udyCopyWto7(PjpJP->jp_1Index, Pjlw+Start, 2); - PjpJP->jp_Type = cJ1_JPIMMED_7_02; -#else - j__udyCopyWto3(PjpJP->jp_1Index, Pjlw+Start, 2); - PjpJP->jp_Type = cJ1_JPIMMED_3_02; -#endif // 32 Bit - } -#endif // JUDY1 - else // Linear Leaf JPLEAF3[7] - { -// cJU_JPLEAF3[7] - Pjll_t PjllRaw; // pointer to new leaf. - Pjll_t Pjll; - JUDYLCODE(Pjv_t Pjvnew;) // value area of new leaf. -#ifdef JU_64BIT - PjllRaw = j__udyAllocJLL7(Pop1, Pjpm); - if (PjllRaw == (Pjll_t) NULL) return(-1); - Pjll = P_JLL(PjllRaw); - - j__udyCopyWto7((uint8_t *) Pjll, Pjlw + Start, - Pop1); -#ifdef JUDYL - Pjvnew = JL_LEAF7VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif // JUDYL - DBGCODE(JudyCheckSorted(Pjll, Pop1, 7);) -#else // JU_64BIT - 32 Bit - PjllRaw = j__udyAllocJLL3(Pop1, Pjpm); - if (PjllRaw == (Pjll_t) NULL) return(-1); - Pjll = P_JLL(PjllRaw); - - j__udyCopyWto3((uint8_t *) Pjll, Pjlw + Start, - Pop1); -#ifdef JUDYL - Pjvnew = JL_LEAF3VALUEAREA(Pjll, Pop1); - JU_COPYMEM(Pjvnew, Pjv + Start, Pop1); -#endif // JUDYL - DBGCODE(JudyCheckSorted(Pjll, Pop1, 3);) -#endif // 32 Bit - -#ifdef JU_64BIT - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, Pop1 - 1, - cJU_JPLEAF7); -#else // JU_64BIT - 32 Bit - JU_JPSETADT(PjpJP, (Word_t)PjllRaw, Pop1 - 1, - cJU_JPLEAF3); -#endif // 32 Bit - } - ExpCnt++; -// Done? - if (End == cJU_LEAFW_MAXPOP1) break; - -// New Expanse, Start and Count - CIndex = Pjlw[End]; - Start = End; - } - } - -// Now put all the Leaves below a BranchL or BranchB: - if (ExpCnt <= cJU_BRANCHLMAXJPS) // put the Leaves below a BranchL - { - if (j__udyCreateBranchL(Pjp, StageJP, StageExp, ExpCnt, - Pjpm) == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_L; - } - else - { - if (j__udyStageJBBtoJBB(Pjp, &StageJBB, StageJP, SubJPCount, Pjpm) - == -1) FREEALLEXIT(ExpCnt, StageJP, Pjpm); - - Pjp->jp_Type = cJU_JPBRANCH_B; // cJU_LEAFW is out of sequence - } - return(1); - -} // j__udyCascadeL() diff --git a/libjudy/src/JudyL/JudyLCount.c b/libjudy/src/JudyL/JudyLCount.c deleted file mode 100644 index 220e1def48..0000000000 --- a/libjudy/src/JudyL/JudyLCount.c +++ /dev/null @@ -1,1195 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.78 $ $Source: /judy/src/JudyCommon/JudyCount.c $ -// -// Judy*Count() function for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DNOSMARTJBB, -DNOSMARTJBU, and/or -DNOSMARTJLB to build a -// version with cache line optimizations deleted, for testing. -// -// Compile with -DSMARTMETRICS to obtain global variables containing smart -// cache line metrics. Note: Dont turn this on simultaneously for this file -// and JudyByCount.c because they export the same globals. -// -// Judy*Count() returns the "count of Indexes" (inclusive) between the two -// specified limits (Indexes). This code is remarkably fast. It traverses the -// "Judy array" data structure. -// -// This count code is the GENERIC untuned version (minimum code size). It -// might be possible to tuned to a specific architecture to be faster. -// However, in real applications, with a modern machine, it is expected that -// the instruction times will be swamped by cache line fills. -// **************************************************************************** - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - - -// define a phoney that is for sure - -#define cJU_LEAFW cJU_JPIMMED_CAP - -// Avoid duplicate symbols since this file is multi-compiled: - -#ifdef SMARTMETRICS -#ifdef JUDY1 -Word_t jbb_upward = 0; // counts of directions taken: -Word_t jbb_downward = 0; -Word_t jbu_upward = 0; -Word_t jbu_downward = 0; -Word_t jlb_upward = 0; -Word_t jlb_downward = 0; -#else -extern Word_t jbb_upward; -extern Word_t jbb_downward; -extern Word_t jbu_upward; -extern Word_t jbu_downward; -extern Word_t jlb_upward; -extern Word_t jlb_downward; -#endif -#endif - - -// FORWARD DECLARATIONS (prototypes): - -static Word_t j__udy1LCountSM(const Pjp_t Pjp, const Word_t Index, - const Pjpm_t Pjpm); - -// Each of Judy1 and JudyL get their own private (static) version of this -// function: - -static int j__udyCountLeafB1(const Pjll_t Pjll, const Word_t Pop1, - const Word_t Index); - -// These functions are not static because they are exported to Judy*ByCount(): -// -// TBD: Should be made static for performance reasons? And thus duplicated? -// -// Note: There really are two different functions, but for convenience they -// are referred to here with a generic name. - -#ifdef JUDY1 -#define j__udyJPPop1 j__udy1JPPop1 -#else -#define j__udyJPPop1 j__udyLJPPop1 -#endif - -Word_t j__udyJPPop1(const Pjp_t Pjp); - - -// LOCAL ERROR HANDLING: -// -// The Judy*Count() functions are unusual because they return 0 instead of JERR -// for an error. In this source file, define C_JERR for clarity. - -#define C_JERR 0 - - -// **************************************************************************** -// J U D Y 1 C O U N T -// J U D Y L C O U N T -// -// See the manual entry for details. -// -// This code is written recursively, at least at first, because thats much -// simpler; hope its fast enough. - -#ifdef JUDY1 -FUNCTION Word_t Judy1Count -#else -FUNCTION Word_t JudyLCount -#endif - ( - Pcvoid_t PArray, // JRP to first branch/leaf in SM. - Word_t Index1, // starting Index. - Word_t Index2, // ending Index. - PJError_t PJError // optional, for returning error info. - ) -{ - jpm_t fakejpm; // local temporary for small arrays. - Pjpm_t Pjpm; // top JPM or local temporary for error info. - jp_t fakejp; // constructed for calling j__udy1LCountSM(). - Pjp_t Pjp; // JP to pass to j__udy1LCountSM(). - Word_t pop1; // total for the array. - Word_t pop1above1; // indexes at or above Index1, inclusive. - Word_t pop1above2; // indexes at or above Index2, exclusive. - int retcode; // from Judy*First() calls. -JUDYLCODE(PPvoid_t PPvalue); // from JudyLFirst() calls. - - -// CHECK FOR SHORTCUTS: -// -// As documented, return C_JERR if the Judy array is empty or Index1 > Index2. - - if ((PArray == (Pvoid_t) NULL) || (Index1 > Index2)) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } - -// If Index1 == Index2, simply check if the specified Index is set; pass -// through the return value from Judy1Test() or JudyLGet() with appropriate -// translations. - - if (Index1 == Index2) - { -#ifdef JUDY1 - retcode = Judy1Test(PArray, Index1, PJError); - - if (retcode == JERRI) return(C_JERR); // pass through error. - - if (retcode == 0) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } -#else - PPvalue = JudyLGet(PArray, Index1, PJError); - - if (PPvalue == PPJERR) return(C_JERR); // pass through error. - - if (PPvalue == (PPvoid_t) NULL) // Index is not set. - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } -#endif - return(1); // single index is set. - } - - -// CHECK JRP TYPE: -// -// Use an if/then for speed rather than a switch, and put the most common cases -// first. -// -// Note: Since even cJU_LEAFW types require counting between two Indexes, -// prepare them here for common code below that calls j__udy1LCountSM(), rather -// than handling them even more specially here. - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - Pjpm = & fakejpm; - Pjp = & fakejp; - Pjp->jp_Addr = (Word_t) Pjlw; - Pjp->jp_Type = cJU_LEAFW; - Pjpm->jpm_Pop0 = Pjlw[0]; // from first word of leaf. - pop1 = Pjpm->jpm_Pop0 + 1; - } - else - { - Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); - pop1 = (Pjpm->jpm_Pop0) + 1; // note: can roll over to 0. - -#if (defined(JUDY1) && (! defined(JU_64BIT))) - if (pop1 == 0) // rare special case of full array: - { - Word_t count = Index2 - Index1 + 1; // can roll over again. - - if (count == 0) - { - JU_SET_ERRNO(PJError, JU_ERRNO_FULL); - return(C_JERR); - } - return(count); - } -#else - assert(pop1); // JudyL or 64-bit cannot create a full array! -#endif - } - - -// COUNT POP1 ABOVE INDEX1, INCLUSIVE: - - assert(pop1); // just to be safe. - - if (Index1 == 0) // shortcut, pop1above1 is entire population: - { - pop1above1 = pop1; - } - else // find first valid Index above Index1, if any: - { -#ifdef JUDY1 - if ((retcode = Judy1First(PArray, & Index1, PJError)) == JERRI) - return(C_JERR); // pass through error. -#else - if ((PPvalue = JudyLFirst(PArray, & Index1, PJError)) == PPJERR) - return(C_JERR); // pass through error. - - retcode = (PPvalue != (PPvoid_t) NULL); // found a next Index. -#endif - -// If theres no Index at or above Index1, just return C_JERR (early exit): - - if (retcode == 0) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } - -// If a first/next Index was found, call the counting motor starting with that -// known valid Index, meaning the return should be positive, not C_JERR except -// in case of a real error: - - if ((pop1above1 = j__udy1LCountSM(Pjp, Index1, Pjpm)) == C_JERR) - { - JU_COPY_ERRNO(PJError, Pjpm); // pass through error. - return(C_JERR); - } - } - - -// COUNT POP1 ABOVE INDEX2, EXCLUSIVE, AND RETURN THE DIFFERENCE: -// -// In principle, calculate the ordinal of each Index and take the difference, -// with caution about off-by-one errors due to the specified Indexes being set -// or unset. In practice: -// -// - The ordinals computed here are inverse ordinals, that is, the populations -// ABOVE the specified Indexes (Index1 inclusive, Index2 exclusive), so -// subtract pop1above2 from pop1above1, rather than vice-versa. -// -// - Index1s result already includes a count for Index1 and/or Index2 if -// either is set, so calculate pop1above2 exclusive of Index2. -// -// TBD: If Index1 and Index2 fall in the same expanse in the top-state -// branch(es), would it be faster to walk the SM only once, to their divergence -// point, before calling j__udy1LCountSM() or equivalent? Possibly a non-issue -// if a top-state pop1 becomes stored with each Judy1 array. Also, consider -// whether the first call of j__udy1LCountSM() fills the cache, for common tree -// branches, for the second call. -// -// As for pop1above1, look for shortcuts for special cases when pop1above2 is -// zero. Otherwise call the counting "motor". - - assert(pop1above1); // just to be safe. - - if (Index2++ == cJU_ALLONES) return(pop1above1); // Index2 at limit. - -#ifdef JUDY1 - if ((retcode = Judy1First(PArray, & Index2, PJError)) == JERRI) - return(C_JERR); -#else - if ((PPvalue = JudyLFirst(PArray, & Index2, PJError)) == PPJERR) - return(C_JERR); - - retcode = (PPvalue != (PPvoid_t) NULL); // found a next Index. -#endif - if (retcode == 0) return(pop1above1); // no Index above Index2. - -// Just as for Index1, j__udy1LCountSM() cannot return 0 (locally == C_JERR) -// except in case of a real error: - - if ((pop1above2 = j__udy1LCountSM(Pjp, Index2, Pjpm)) == C_JERR) - { - JU_COPY_ERRNO(PJError, Pjpm); // pass through error. - return(C_JERR); - } - - if (pop1above1 == pop1above2) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NONE); - return(C_JERR); - } - - return(pop1above1 - pop1above2); - -} // Judy1Count() / JudyLCount() - - -// **************************************************************************** -// __ J U D Y 1 L C O U N T S M -// -// Given a pointer to a JP (with invalid jp_DcdPopO at cJU_ROOTSTATE), a known -// valid Index, and a Pjpm for returning error info, recursively visit a Judy -// array state machine (SM) and return the count of Indexes, including Index, -// through the end of the Judy array at this state or below. In case of error -// or a count of 0 (should never happen), return C_JERR with appropriate -// JU_ERRNO in the Pjpm. -// -// Note: This function is not told the current state because its encoded in -// the JP Type. -// -// Method: To minimize cache line fills, while studying each branch, if Index -// resides above the midpoint of the branch (which often consists of multiple -// cache lines), ADD the populations at or above Index; otherwise, SUBTRACT -// from the population of the WHOLE branch (available from the JP) the -// populations at or above Index. This is especially tricky for bitmap -// branches. -// -// Note: Unlike, say, the Ins and Del walk routines, this function returns the -// same type of returns as Judy*Count(), so it can use *_SET_ERRNO*() macros -// the same way. - -FUNCTION static Word_t j__udy1LCountSM( -const Pjp_t Pjp, // top of Judy (sub)SM. -const Word_t Index, // count at or above this Index. -const Pjpm_t Pjpm) // for returning error info. -{ - Pjbl_t Pjbl; // Pjp->jp_Addr masked and cast to types: - Pjbb_t Pjbb; - Pjbu_t Pjbu; - Pjll_t Pjll; // a Judy lower-level linear leaf. - - Word_t digit; // next digit to decode from Index. - long jpnum; // JP number in a branch (base 0). - int offset; // index ordinal within a leaf, base 0. - Word_t pop1; // total population of an expanse. - Word_t pop1above; // to return. - -// Common code to check Decode bits in a JP against the equivalent portion of -// Index; XOR together, then mask bits of interest; must be all 0: -// -// Note: Why does this code only assert() compliance rather than actively -// checking for outliers? Its because Index is supposed to be valid, hence -// always match any Dcd bits traversed. -// -// Note: This assertion turns out to be always true for cState = 3 on 32-bit -// and 7 on 64-bit, but its harmless, probably removed by the compiler. - -#define CHECKDCD(Pjp,cState) \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cState)) - -// Common code to prepare to handle a root-level or lower-level branch: -// Extract a state-dependent digit from Index in a "constant" way, obtain the -// total population for the branch in a state-dependent way, and then branch to -// common code for multiple cases: -// -// For root-level branches, the state is always cJU_ROOTSTATE, and the -// population is received in Pjpm->jpm_Pop0. -// -// Note: The total population is only needed in cases where the common code -// "counts up" instead of down to minimize cache line fills. However, its -// available cheaply, and its better to do it with a constant shift (constant -// state value) instead of a variable shift later "when needed". - -#define PREPB_ROOT(Pjp,Next) \ - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); \ - pop1 = (Pjpm->jpm_Pop0) + 1; \ - goto Next - -#define PREPB(Pjp,cState,Next) \ - digit = JU_DIGITATSTATE(Index, cState); \ - pop1 = JU_JPBRANCH_POP0(Pjp, (cState)) + 1; \ - goto Next - - -// SWITCH ON JP TYPE: -// -// WARNING: For run-time efficiency the following cases replicate code with -// varying constants, rather than using common code with variable values! - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// ROOT-STATE LEAF that starts with a Pop0 word; just count within the leaf: - - case cJU_LEAFW: - { - Pjlw_t Pjlw = P_JLW(Pjp->jp_Addr); // first word of leaf. - - assert((Pjpm->jpm_Pop0) + 1 == Pjlw[0] + 1); // sent correctly. - offset = j__udySearchLeafW(Pjlw + 1, Pjpm->jpm_Pop0 + 1, Index); - assert(offset >= 0); // Index must exist. - assert(offset < (Pjpm->jpm_Pop0) + 1); // Index be in range. - return((Pjpm->jpm_Pop0) + 1 - offset); // INCLUSIVE of Index. - } - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH; count populations in JPs in the JBL ABOVE the next digit in -// Index, and recurse for the next digit in Index: -// -// Note: There are no null JPs in a JBL; watch out for pop1 == 0. -// -// Note: A JBL should always fit in one cache line => no need to count up -// versus down to save cache line fills. (PREPB() sets pop1 for no reason.) - - case cJU_JPBRANCH_L2: CHECKDCD(Pjp, 2); PREPB(Pjp, 2, BranchL); - case cJU_JPBRANCH_L3: CHECKDCD(Pjp, 3); PREPB(Pjp, 3, BranchL); - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: CHECKDCD(Pjp, 4); PREPB(Pjp, 4, BranchL); - case cJU_JPBRANCH_L5: CHECKDCD(Pjp, 5); PREPB(Pjp, 5, BranchL); - case cJU_JPBRANCH_L6: CHECKDCD(Pjp, 6); PREPB(Pjp, 6, BranchL); - case cJU_JPBRANCH_L7: CHECKDCD(Pjp, 7); PREPB(Pjp, 7, BranchL); -#endif - case cJU_JPBRANCH_L: PREPB_ROOT(Pjp, BranchL); - -// Common code (state-independent) for all cases of linear branches: - -BranchL: - - Pjbl = P_JBL(Pjp->jp_Addr); - jpnum = Pjbl->jbl_NumJPs; // above last JP. - pop1above = 0; - - while (digit < (Pjbl->jbl_Expanse[--jpnum])) // still ABOVE digit. - { - if ((pop1 = j__udyJPPop1((Pjbl->jbl_jp) + jpnum)) == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above += pop1; - assert(jpnum > 0); // should find digit. - } - - assert(digit == (Pjbl->jbl_Expanse[jpnum])); // should find digit. - - pop1 = j__udy1LCountSM((Pjbl->jbl_jp) + jpnum, Index, Pjpm); - if (pop1 == C_JERR) return(C_JERR); // pass error up. - - assert(pop1above + pop1); - return(pop1above + pop1); - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH; count populations in JPs in the JBB ABOVE the next digit in -// Index, and recurse for the next digit in Index: -// -// Note: There are no null JPs in a JBB; watch out for pop1 == 0. - - case cJU_JPBRANCH_B2: CHECKDCD(Pjp, 2); PREPB(Pjp, 2, BranchB); - case cJU_JPBRANCH_B3: CHECKDCD(Pjp, 3); PREPB(Pjp, 3, BranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: CHECKDCD(Pjp, 4); PREPB(Pjp, 4, BranchB); - case cJU_JPBRANCH_B5: CHECKDCD(Pjp, 5); PREPB(Pjp, 5, BranchB); - case cJU_JPBRANCH_B6: CHECKDCD(Pjp, 6); PREPB(Pjp, 6, BranchB); - case cJU_JPBRANCH_B7: CHECKDCD(Pjp, 7); PREPB(Pjp, 7, BranchB); -#endif - case cJU_JPBRANCH_B: PREPB_ROOT(Pjp, BranchB); - -// Common code (state-independent) for all cases of bitmap branches: - -BranchB: - { - long subexp; // for stepping through layer 1 (subexpanses). - long findsub; // subexpanse containing Index (digit). - Word_t findbit; // bit representing Index (digit). - Word_t lowermask; // bits for indexes at or below Index. - Word_t jpcount; // JPs in a subexpanse. - Word_t clbelow; // cache lines below digits cache line. - Word_t clabove; // cache lines above digits cache line. - - Pjbb = P_JBB(Pjp->jp_Addr); - findsub = digit / cJU_BITSPERSUBEXPB; - findbit = digit % cJU_BITSPERSUBEXPB; - lowermask = JU_MASKLOWERINC(JU_BITPOSMASKB(findbit)); - clbelow = clabove = 0; // initial/default => always downward. - - assert(JU_BITMAPTESTB(Pjbb, digit)); // digit must have a JP. - assert(findsub < cJU_NUMSUBEXPB); // falls in expected range. - -// Shorthand for one subexpanse in a bitmap and for one JP in a bitmap branch: -// -// Note: BMPJP0 exists separately to support assertions. - -#define BMPJP0(Subexp) (P_JP(JU_JBB_PJP(Pjbb, Subexp))) -#define BMPJP(Subexp,JPnum) (BMPJP0(Subexp) + (JPnum)) - -#ifndef NOSMARTJBB // enable to turn off smart code for comparison purposes. - -// FIGURE OUT WHICH DIRECTION CAUSES FEWER CACHE LINE FILLS; adding the pop1s -// in JPs above Indexs JP, or subtracting the pop1s in JPs below Indexs JP. -// -// This is tricky because, while each set bit in the bitmap represents a JP, -// the JPs are scattered over cJU_NUMSUBEXPB subexpanses, each of which can -// contain JPs packed into multiple cache lines, and this code must visit every -// JP either BELOW or ABOVE the JP for Index. -// -// Number of cache lines required to hold a linear list of the given number of -// JPs, assuming the first JP is at the start of a cache line or the JPs in -// jpcount fit wholly within a single cache line, which is ensured by -// JudyMalloc(): - -#define CLPERJPS(jpcount) \ - ((((jpcount) * cJU_WORDSPERJP) + cJU_WORDSPERCL - 1) / cJU_WORDSPERCL) - -// Count cache lines below/above for each subexpanse: - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - -// When at the subexpanse containing Index (digit), add cache lines -// below/above appropriately, excluding the cache line containing the JP for -// Index itself: - - if (subexp < findsub) clbelow += CLPERJPS(jpcount); - else if (subexp > findsub) clabove += CLPERJPS(jpcount); - else // (subexp == findsub) - { - Word_t clfind; // cache line containing Index (digit). - - clfind = CLPERJPS(j__udyCountBitsB( - JU_JBB_BITMAP(Pjbb, subexp) & lowermask)); - - assert(clfind > 0); // digit itself should have 1 CL. - clbelow += clfind - 1; - clabove += CLPERJPS(jpcount) - clfind; - } - } -#endif // ! NOSMARTJBB - -// Note: Its impossible to get through the following "if" without setting -// jpnum -- see some of the assertions below -- but gcc -Wall doesnt know -// this, so preset jpnum to make it happy: - - jpnum = 0; - - -// COUNT POPULATION FOR A BITMAP BRANCH, in whichever direction should result -// in fewer cache line fills: -// -// Note: If the remainder of Index is zero, pop1above is the pop1 of the -// entire expanse and theres no point in recursing to lower levels; but this -// should be so rare that its not worth checking for; -// Judy1Count()/JudyLCount() never even calls the motor for Index == 0 (all -// bytes). - - -// COUNT UPWARD, subtracting each "below or at" JPs pop1 from the whole -// expanses pop1: -// -// Note: If this causes clbelow + 1 cache line fills including JPs cache -// line, thats OK; at worst this is the same as clabove. - - if (clbelow < clabove) - { -#ifdef SMARTMETRICS - ++jbb_upward; -#endif - pop1above = pop1; // subtract JPs at/below Index. - -// Count JPs for which to accrue pop1s in this subexpanse: -// -// TBD: If JU_JBB_BITMAP is cJU_FULLBITMAPB, dont bother counting. - - for (subexp = 0; subexp <= findsub; ++subexp) - { - jpcount = j__udyCountBitsB((subexp < findsub) ? - JU_JBB_BITMAP(Pjbb, subexp) : - JU_JBB_BITMAP(Pjbb, subexp) & lowermask); - - // should always find findbit: - assert((subexp < findsub) || jpcount); - -// Subtract pop1s from JPs BELOW OR AT Index (digit): -// -// Note: The pop1 for Indexs JP itself is partially added back later at a -// lower state. -// -// Note: An empty subexpanse (jpcount == 0) is handled "for free". -// -// Note: Must be null JP subexp pointer in empty subexpanse and non-empty in -// non-empty subexpanse: - - assert( jpcount || (BMPJP0(subexp) == (Pjp_t) NULL)); - assert((! jpcount) || (BMPJP0(subexp) != (Pjp_t) NULL)); - - for (jpnum = 0; jpnum < jpcount; ++jpnum) - { - if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum))) - == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above -= pop1; - } - - jpnum = jpcount - 1; // make correct for digit. - } - } - -// COUNT DOWNWARD, adding each "above" JPs pop1: - - else - { - long jpcountbf; // below findbit, inclusive. -#ifdef SMARTMETRICS - ++jbb_downward; -#endif - pop1above = 0; // add JPs above Index. - jpcountbf = 0; // until subexp == findsub. - -// Count JPs for which to accrue pop1s in this subexpanse: -// -// This is more complicated than counting upward because the scan of digits -// subexpanse must count ALL JPs, to know where to START counting down, and -// ALSO note the offset of digits JP to know where to STOP counting down. - - for (subexp = cJU_NUMSUBEXPB - 1; subexp >= findsub; --subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - - // should always find findbit: - assert((subexp > findsub) || jpcount); - - if (! jpcount) continue; // empty subexpanse, save time. - -// Count JPs below digit, inclusive: - - if (subexp == findsub) - { - jpcountbf = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp) - & lowermask); - } - - // should always find findbit: - assert((subexp > findsub) || jpcountbf); - assert(jpcount >= jpcountbf); // proper relationship. - -// Add pop1s from JPs ABOVE Index (digit): - - // no null JP subexp pointers: - assert(BMPJP0(subexp) != (Pjp_t) NULL); - - for (jpnum = jpcount - 1; jpnum >= jpcountbf; --jpnum) - { - if ((pop1 = j__udyJPPop1(BMPJP(subexp, jpnum))) - == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above += pop1; - } - // jpnum is now correct for digit. - } - } // else. - -// Return the net population ABOVE the digits JP at this state (in this JBB) -// plus the population AT OR ABOVE Index in the SM under the digits JP: - - pop1 = j__udy1LCountSM(BMPJP(findsub, jpnum), Index, Pjpm); - if (pop1 == C_JERR) return(C_JERR); // pass error up. - - assert(pop1above + pop1); - return(pop1above + pop1); - - } // case. - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH; count populations in JPs in the JBU ABOVE the next -// digit in Index, and recurse for the next digit in Index: -// -// Note: If the remainder of Index is zero, pop1above is the pop1 of the -// entire expanse and theres no point in recursing to lower levels; but this -// should be so rare that its not worth checking for; -// Judy1Count()/JudyLCount() never even calls the motor for Index == 0 (all -// bytes). - - case cJU_JPBRANCH_U2: CHECKDCD(Pjp, 2); PREPB(Pjp, 2, BranchU); - case cJU_JPBRANCH_U3: CHECKDCD(Pjp, 3); PREPB(Pjp, 3, BranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: CHECKDCD(Pjp, 4); PREPB(Pjp, 4, BranchU); - case cJU_JPBRANCH_U5: CHECKDCD(Pjp, 5); PREPB(Pjp, 5, BranchU); - case cJU_JPBRANCH_U6: CHECKDCD(Pjp, 6); PREPB(Pjp, 6, BranchU); - case cJU_JPBRANCH_U7: CHECKDCD(Pjp, 7); PREPB(Pjp, 7, BranchU); -#endif - case cJU_JPBRANCH_U: PREPB_ROOT(Pjp, BranchU); - -// Common code (state-independent) for all cases of uncompressed branches: - -BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - -#ifndef NOSMARTJBU // enable to turn off smart code for comparison purposes. - -// FIGURE OUT WHICH WAY CAUSES FEWER CACHE LINE FILLS; adding the JPs above -// Indexs JP, or subtracting the JPs below Indexs JP. -// -// COUNT UPWARD, subtracting the pop1 of each JP BELOW OR AT Index, from the -// whole expanses pop1: - - if (digit < (cJU_BRANCHUNUMJPS / 2)) - { - pop1above = pop1; // subtract JPs below Index. -#ifdef SMARTMETRICS - ++jbu_upward; -#endif - for (jpnum = 0; jpnum <= digit; ++jpnum) - { - if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX) - continue; // shortcut, save a function call. - - if ((pop1 = j__udyJPPop1(Pjbu->jbu_jp + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above -= pop1; - } - } - -// COUNT DOWNWARD, simply adding the pop1 of each JP ABOVE Index: - - else -#endif // NOSMARTJBU - { - assert(digit < cJU_BRANCHUNUMJPS); -#ifdef SMARTMETRICS - ++jbu_downward; -#endif - pop1above = 0; // add JPs above Index. - - for (jpnum = cJU_BRANCHUNUMJPS - 1; jpnum > digit; --jpnum) - { - if ((Pjbu->jbu_jp[jpnum].jp_Type) <= cJU_JPNULLMAX) - continue; // shortcut, save a function call. - - if ((pop1 = j__udyJPPop1(Pjbu->jbu_jp + jpnum)) - == cJU_ALLONES) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(C_JERR); - } - - pop1above += pop1; - } - } - - if ((pop1 = j__udy1LCountSM(Pjbu->jbu_jp + digit, Index, Pjpm)) - == C_JERR) return(C_JERR); // pass error up. - - assert(pop1above + pop1); - return(pop1above + pop1); - - -// ---------------------------------------------------------------------------- -// LEAF COUNT MACROS: -// -// LEAF*ABOVE() are common code for different JP types (linear leaves, bitmap -// leaves, and immediates) and different leaf Index Sizes, which result in -// calling different leaf search functions. Linear leaves get the leaf address -// from jp_Addr and the Population from jp_DcdPopO, while immediates use Pjp -// itself as the leaf address and get Population from jp_Type. - -#define LEAFLABOVE(Func) \ - Pjll = P_JLL(Pjp->jp_Addr); \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - LEAFABOVE(Func, Pjll, pop1) - -#define LEAFB1ABOVE(Func) LEAFLABOVE(Func) // different Func, otherwise same. - -#ifdef JUDY1 -#define IMMABOVE(Func,Pop1) \ - Pjll = (Pjll_t) Pjp; \ - LEAFABOVE(Func, Pjll, Pop1) -#else -// Note: For JudyL immediates with >= 2 Indexes, the index bytes are in a -// different place than for Judy1: - -#define IMMABOVE(Func,Pop1) \ - LEAFABOVE(Func, (Pjll_t) (Pjp->jp_LIndex), Pop1) -#endif - -// For all leaf types, the population AT OR ABOVE is the total pop1 less the -// offset of Index; and Index should always be found: - -#define LEAFABOVE(Func,Pjll,Pop1) \ - offset = Func(Pjll, Pop1, Index); \ - assert(offset >= 0); \ - assert(offset < (Pop1)); \ - return((Pop1) - offset) - -// IMMABOVE_01 handles the special case of an immediate JP with 1 index, which -// the search functions arent used for anyway: -// -// The target Index should be the one in this Immediate, in which case the -// count above (inclusive) is always 1. - -#define IMMABOVE_01 \ - assert((JU_JPDCDPOP0(Pjp)) == JU_TRIMTODCDSIZE(Index)); \ - return(1) - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF; search the leaf for Index; size is computed from jp_Type: - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: LEAFLABOVE(j__udySearchLeaf1); -#endif - case cJU_JPLEAF2: LEAFLABOVE(j__udySearchLeaf2); - case cJU_JPLEAF3: LEAFLABOVE(j__udySearchLeaf3); - -#ifdef JU_64BIT - case cJU_JPLEAF4: LEAFLABOVE(j__udySearchLeaf4); - case cJU_JPLEAF5: LEAFLABOVE(j__udySearchLeaf5); - case cJU_JPLEAF6: LEAFLABOVE(j__udySearchLeaf6); - case cJU_JPLEAF7: LEAFLABOVE(j__udySearchLeaf7); -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF; search the leaf for Index: -// -// Since the bitmap describes Indexes digitally rather than linearly, this is -// not really a search, but just a count. - - case cJU_JPLEAF_B1: LEAFB1ABOVE(j__udyCountLeafB1); - - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// Return the count of Indexes AT OR ABOVE Index, which is the total population -// of the expanse (a constant) less the value of the undecoded digit remaining -// in Index (its base-0 offset in the expanse), which yields an inclusive count -// above. -// -// TBD: This only supports a 1-byte full expanse. Should this extract a -// stored value for pop0 and possibly more LSBs of Index, to handle larger full -// expanses? - - case cJ1_JPFULLPOPU1: - return(cJU_JPFULLPOPU1_POP0 + 1 - JU_DIGITATSTATE(Index, 1)); -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: - - case cJU_JPIMMED_1_01: IMMABOVE_01; - case cJU_JPIMMED_2_01: IMMABOVE_01; - case cJU_JPIMMED_3_01: IMMABOVE_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: IMMABOVE_01; - case cJU_JPIMMED_5_01: IMMABOVE_01; - case cJU_JPIMMED_6_01: IMMABOVE_01; - case cJU_JPIMMED_7_01: IMMABOVE_01; -#endif - - case cJU_JPIMMED_1_02: IMMABOVE(j__udySearchLeaf1, 2); - case cJU_JPIMMED_1_03: IMMABOVE(j__udySearchLeaf1, 3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: IMMABOVE(j__udySearchLeaf1, 4); - case cJU_JPIMMED_1_05: IMMABOVE(j__udySearchLeaf1, 5); - case cJU_JPIMMED_1_06: IMMABOVE(j__udySearchLeaf1, 6); - case cJU_JPIMMED_1_07: IMMABOVE(j__udySearchLeaf1, 7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: IMMABOVE(j__udySearchLeaf1, 8); - case cJ1_JPIMMED_1_09: IMMABOVE(j__udySearchLeaf1, 9); - case cJ1_JPIMMED_1_10: IMMABOVE(j__udySearchLeaf1, 10); - case cJ1_JPIMMED_1_11: IMMABOVE(j__udySearchLeaf1, 11); - case cJ1_JPIMMED_1_12: IMMABOVE(j__udySearchLeaf1, 12); - case cJ1_JPIMMED_1_13: IMMABOVE(j__udySearchLeaf1, 13); - case cJ1_JPIMMED_1_14: IMMABOVE(j__udySearchLeaf1, 14); - case cJ1_JPIMMED_1_15: IMMABOVE(j__udySearchLeaf1, 15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: IMMABOVE(j__udySearchLeaf2, 2); - case cJU_JPIMMED_2_03: IMMABOVE(j__udySearchLeaf2, 3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: IMMABOVE(j__udySearchLeaf2, 4); - case cJ1_JPIMMED_2_05: IMMABOVE(j__udySearchLeaf2, 5); - case cJ1_JPIMMED_2_06: IMMABOVE(j__udySearchLeaf2, 6); - case cJ1_JPIMMED_2_07: IMMABOVE(j__udySearchLeaf2, 7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: IMMABOVE(j__udySearchLeaf3, 2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: IMMABOVE(j__udySearchLeaf3, 3); - case cJ1_JPIMMED_3_04: IMMABOVE(j__udySearchLeaf3, 4); - case cJ1_JPIMMED_3_05: IMMABOVE(j__udySearchLeaf3, 5); - - case cJ1_JPIMMED_4_02: IMMABOVE(j__udySearchLeaf4, 2); - case cJ1_JPIMMED_4_03: IMMABOVE(j__udySearchLeaf4, 3); - - case cJ1_JPIMMED_5_02: IMMABOVE(j__udySearchLeaf5, 2); - case cJ1_JPIMMED_5_03: IMMABOVE(j__udySearchLeaf5, 3); - - case cJ1_JPIMMED_6_02: IMMABOVE(j__udySearchLeaf6, 2); - - case cJ1_JPIMMED_7_02: IMMABOVE(j__udySearchLeaf7, 2); -#endif - - -// ---------------------------------------------------------------------------- -// OTHER CASES: - - default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); return(C_JERR); - - } // switch on JP type - - /*NOTREACHED*/ - -} // j__udy1LCountSM() - - -// **************************************************************************** -// J U D Y C O U N T L E A F B 1 -// -// This is a private analog of the j__udySearchLeaf*() functions for counting -// in bitmap 1-byte leaves. Since a bitmap leaf describes Indexes digitally -// rather than linearly, this is not really a search, but just a count of the -// valid Indexes == set bits below or including Index, which should be valid. -// Return the "offset" (really the ordinal), 0 .. Pop1 - 1, of Index in Pjll; -// if Indexs bit is not set (which should never happen, so this is DEBUG-mode -// only), return the 1s-complement equivalent (== negative offset minus 1). -// -// Note: The source code for this function looks identical for both Judy1 and -// JudyL, but the JU_JLB_BITMAP macro varies. -// -// Note: For simpler calling, the first arg is of type Pjll_t but then cast to -// Pjlb_t. - -FUNCTION static int j__udyCountLeafB1( -const Pjll_t Pjll, // bitmap leaf, as Pjll_t for consistency. -const Word_t Pop1, // Population of whole leaf. -const Word_t Index) // to which to count. -{ - Pjlb_t Pjlb = (Pjlb_t) Pjll; // to proper type. - Word_t digit = Index & cJU_MASKATSTATE(1); - Word_t findsub = digit / cJU_BITSPERSUBEXPL; - Word_t findbit = digit % cJU_BITSPERSUBEXPL; - int count; // in leaf through Index. - long subexp; // for stepping through subexpanses. - - -// COUNT UPWARD: -// -// The entire bitmap should fit in one cache line, but still try to save some -// CPU time by counting the fewest possible number of subexpanses from the -// bitmap. - -#ifndef NOSMARTJLB // enable to turn off smart code for comparison purposes. - - if (findsub < (cJU_NUMSUBEXPL / 2)) - { -#ifdef SMARTMETRICS - ++jlb_upward; -#endif - count = 0; - - for (subexp = 0; subexp < findsub; ++subexp) - { - count += ((JU_JLB_BITMAP(Pjlb, subexp) == cJU_FULLBITMAPL) ? - cJU_BITSPERSUBEXPL : - j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp))); - } - -// This count includes findbit, which should be set, resulting in a base-1 -// offset: - - count += j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, findsub) - & JU_MASKLOWERINC(JU_BITPOSMASKL(findbit))); - - DBGCODE(if (! JU_BITMAPTESTL(Pjlb, digit)) return(~count);) - assert(count >= 1); - return(count - 1); // convert to base-0 offset. - } -#endif // NOSMARTJLB - - -// COUNT DOWNWARD: -// -// Count the valid Indexes above or at Index, and subtract from Pop1. - -#ifdef SMARTMETRICS - ++jlb_downward; -#endif - count = Pop1; // base-1 for now. - - for (subexp = cJU_NUMSUBEXPL - 1; subexp > findsub; --subexp) - { - count -= ((JU_JLB_BITMAP(Pjlb, subexp) == cJU_FULLBITMAPL) ? - cJU_BITSPERSUBEXPL : - j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp))); - } - -// This count includes findbit, which should be set, resulting in a base-0 -// offset: - - count -= j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, findsub) - & JU_MASKHIGHERINC(JU_BITPOSMASKL(findbit))); - - DBGCODE(if (! JU_BITMAPTESTL(Pjlb, digit)) return(~count);) - assert(count >= 0); // should find Index itself. - return(count); // is already a base-0 offset. - -} // j__udyCountLeafB1() - - -// **************************************************************************** -// J U D Y J P P O P 1 -// -// This function takes any type of JP other than a root-level JP (cJU_LEAFW* or -// cJU_JPBRANCH* with no number suffix) and extracts the Pop1 from it. In some -// sense this is a wrapper around the JU_JP*_POP0 macros. Why write it as a -// function instead of a complex macro containing a trinary? (See version -// Judy1.h version 4.17.) We think its cheaper to call a function containing -// a switch statement with "constant" cases than to do the variable -// calculations in a trinary. -// -// For invalid JP Types return cJU_ALLONES. Note that this is an impossibly -// high Pop1 for any JP below a top level branch. - -FUNCTION Word_t j__udyJPPop1( -const Pjp_t Pjp) // JP to count. -{ - switch (JU_JPTYPE(Pjp)) - { -#ifdef notdef // caller should shortcut and not even call with these: - - case cJU_JPNULL1: - case cJU_JPNULL2: - case cJU_JPNULL3: return(0); -#ifdef JU_64BIT - case cJU_JPNULL4: - case cJU_JPNULL5: - case cJU_JPNULL6: - case cJU_JPNULL7: return(0); -#endif -#endif // notdef - - case cJU_JPBRANCH_L2: - case cJU_JPBRANCH_B2: - case cJU_JPBRANCH_U2: return(JU_JPBRANCH_POP0(Pjp,2) + 1); - - case cJU_JPBRANCH_L3: - case cJU_JPBRANCH_B3: - case cJU_JPBRANCH_U3: return(JU_JPBRANCH_POP0(Pjp,3) + 1); - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - case cJU_JPBRANCH_B4: - case cJU_JPBRANCH_U4: return(JU_JPBRANCH_POP0(Pjp,4) + 1); - - case cJU_JPBRANCH_L5: - case cJU_JPBRANCH_B5: - case cJU_JPBRANCH_U5: return(JU_JPBRANCH_POP0(Pjp,5) + 1); - - case cJU_JPBRANCH_L6: - case cJU_JPBRANCH_B6: - case cJU_JPBRANCH_U6: return(JU_JPBRANCH_POP0(Pjp,6) + 1); - - case cJU_JPBRANCH_L7: - case cJU_JPBRANCH_B7: - case cJU_JPBRANCH_U7: return(JU_JPBRANCH_POP0(Pjp,7) + 1); -#endif - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: -#endif - case cJU_JPLEAF2: - case cJU_JPLEAF3: -#ifdef JU_64BIT - case cJU_JPLEAF4: - case cJU_JPLEAF5: - case cJU_JPLEAF6: - case cJU_JPLEAF7: -#endif - case cJU_JPLEAF_B1: return(JU_JPLEAF_POP0(Pjp) + 1); - -#ifdef JUDY1 - case cJ1_JPFULLPOPU1: return(cJU_JPFULLPOPU1_POP0 + 1); -#endif - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: return(1); -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: return(1); -#endif - - case cJU_JPIMMED_1_02: return(2); - case cJU_JPIMMED_1_03: return(3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: return(4); - case cJU_JPIMMED_1_05: return(5); - case cJU_JPIMMED_1_06: return(6); - case cJU_JPIMMED_1_07: return(7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: return(8); - case cJ1_JPIMMED_1_09: return(9); - case cJ1_JPIMMED_1_10: return(10); - case cJ1_JPIMMED_1_11: return(11); - case cJ1_JPIMMED_1_12: return(12); - case cJ1_JPIMMED_1_13: return(13); - case cJ1_JPIMMED_1_14: return(14); - case cJ1_JPIMMED_1_15: return(15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: return(2); - case cJU_JPIMMED_2_03: return(3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: return(4); - case cJ1_JPIMMED_2_05: return(5); - case cJ1_JPIMMED_2_06: return(6); - case cJ1_JPIMMED_2_07: return(7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: return(2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: return(3); - case cJ1_JPIMMED_3_04: return(4); - case cJ1_JPIMMED_3_05: return(5); - - case cJ1_JPIMMED_4_02: return(2); - case cJ1_JPIMMED_4_03: return(3); - - case cJ1_JPIMMED_5_02: return(2); - case cJ1_JPIMMED_5_03: return(3); - - case cJ1_JPIMMED_6_02: return(2); - - case cJ1_JPIMMED_7_02: return(2); -#endif - - default: return(cJU_ALLONES); - } - - /*NOTREACHED*/ - -} // j__udyJPPop1() diff --git a/libjudy/src/JudyL/JudyLCreateBranch.c b/libjudy/src/JudyL/JudyLCreateBranch.c deleted file mode 100644 index e0f7428025..0000000000 --- a/libjudy/src/JudyL/JudyLCreateBranch.c +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.26 $ $Source: /judy/src/JudyCommon/JudyCreateBranch.c $ - -// Branch creation functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - - -// **************************************************************************** -// J U D Y C R E A T E B R A N C H L -// -// Build a BranchL from an array of JPs and associated 1 byte digits -// (expanses). Return with Pjp pointing to the BranchL. Caller must -// deallocate passed arrays, if necessary. -// -// We have no idea what kind of BranchL it is, so caller must set the jp_Type. -// -// Return -1 if error (details in Pjpm), otherwise return 1. - -FUNCTION int j__udyCreateBranchL( - Pjp_t Pjp, // Build JPs from this place - Pjp_t PJPs, // Array of JPs to put into Bitmap branch - uint8_t Exp[], // Array of expanses to put into bitmap - Word_t ExpCnt, // Number of above JPs and Expanses - Pvoid_t Pjpm) -{ - Pjbl_t PjblRaw; // pointer to linear branch. - Pjbl_t Pjbl; - - assert(ExpCnt <= cJU_BRANCHLMAXJPS); - - PjblRaw = j__udyAllocJBL(Pjpm); - if (PjblRaw == (Pjbl_t) NULL) return(-1); - Pjbl = P_JBL(PjblRaw); - -// Build a Linear Branch - Pjbl->jbl_NumJPs = ExpCnt; - -// Copy from the Linear branch from splayed leaves - JU_COPYMEM(Pjbl->jbl_Expanse, Exp, ExpCnt); - JU_COPYMEM(Pjbl->jbl_jp, PJPs, ExpCnt); - -// Pass back new pointer to the Linear branch in JP - Pjp->jp_Addr = (Word_t) PjblRaw; - - return(1); - -} // j__udyCreateBranchL() - - -// **************************************************************************** -// J U D Y C R E A T E B R A N C H B -// -// Build a BranchB from an array of JPs and associated 1 byte digits -// (expanses). Return with Pjp pointing to the BranchB. Caller must -// deallocate passed arrays, if necessary. -// -// We have no idea what kind of BranchB it is, so caller must set the jp_Type. -// -// Return -1 if error (details in Pjpm), otherwise return 1. - -FUNCTION int j__udyCreateBranchB( - Pjp_t Pjp, // Build JPs from this place - Pjp_t PJPs, // Array of JPs to put into Bitmap branch - uint8_t Exp[], // Array of expanses to put into bitmap - Word_t ExpCnt, // Number of above JPs and Expanses - Pvoid_t Pjpm) -{ - Pjbb_t PjbbRaw; // pointer to bitmap branch. - Pjbb_t Pjbb; - Word_t ii, jj; // Temps - uint8_t CurrSubExp; // Current sub expanse for BM - -// This assertion says the number of populated subexpanses is not too large. -// This function is only called when a BranchL overflows to a BranchB or when a -// cascade occurs, meaning a leaf overflows. Either way ExpCnt cant be very -// large, in fact a lot smaller than cJU_BRANCHBMAXJPS. (Otherwise a BranchU -// would be used.) Popping this assertion means something (unspecified) has -// gone very wrong, or else Judys design criteria have changed, although in -// fact there should be no HARM in creating a BranchB with higher actual -// fanout. - - assert(ExpCnt <= cJU_BRANCHBMAXJPS); - -// Get memory for a Bitmap branch - PjbbRaw = j__udyAllocJBB(Pjpm); - if (PjbbRaw == (Pjbb_t) NULL) return(-1); - Pjbb = P_JBB(PjbbRaw); - -// Get 1st "sub" expanse (0..7) of bitmap branch - CurrSubExp = Exp[0] / cJU_BITSPERSUBEXPB; - -// Index thru all 1 byte sized expanses: - - for (jj = ii = 0; ii <= ExpCnt; ii++) - { - Word_t SubExp; // Cannot be a uint8_t - -// Make sure we cover the last one - if (ii == ExpCnt) - { - SubExp = cJU_ALLONES; // Force last one - } - else - { -// Calculate the "sub" expanse of the byte expanse - SubExp = Exp[ii] / cJU_BITSPERSUBEXPB; // Bits 5..7. - -// Set the bit that represents the expanse in Exp[] - JU_JBB_BITMAP(Pjbb, SubExp) |= JU_BITPOSMASKB(Exp[ii]); - } -// Check if a new "sub" expanse range needed - if (SubExp != CurrSubExp) - { -// Get number of JPs in this sub expanse - Word_t NumJP = ii - jj; - Pjp_t PjpRaw; - Pjp_t Pjp; - - PjpRaw = j__udyAllocJBBJP(NumJP, Pjpm); - Pjp = P_JP(PjpRaw); - - if (PjpRaw == (Pjp_t) NULL) // out of memory. - { - -// Free any previous allocations: - - while(CurrSubExp--) - { - NumJP = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, - CurrSubExp)); - if (NumJP) - { - j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, - CurrSubExp), NumJP, Pjpm); - } - } - j__udyFreeJBB(PjbbRaw, Pjpm); - return(-1); - } - -// Place the array of JPs in bitmap branch: - - JU_JBB_PJP(Pjbb, CurrSubExp) = PjpRaw; - -// Copy the JPs to new leaf: - - JU_COPYMEM(Pjp, PJPs + jj, NumJP); - -// On to the next bitmap branch "sub" expanse: - - jj = ii; - CurrSubExp = SubExp; - } - } // for each 1-byte expanse - -// Pass back some of the JP to the new Bitmap branch: - - Pjp->jp_Addr = (Word_t) PjbbRaw; - - return(1); - -} // j__udyCreateBranchB() - - -// **************************************************************************** -// J U D Y C R E A T E B R A N C H U -// -// Build a BranchU from a BranchB. Return with Pjp pointing to the BranchU. -// Free the BranchB and its JP subarrays. -// -// Return -1 if error (details in Pjpm), otherwise return 1. - -FUNCTION int j__udyCreateBranchU( - Pjp_t Pjp, - Pvoid_t Pjpm) -{ - jp_t JPNull; - Pjbu_t PjbuRaw; - Pjbu_t Pjbu; - Pjbb_t PjbbRaw; - Pjbb_t Pjbb; - Word_t ii, jj; - BITMAPB_t BitMap; - Pjp_t PDstJP; -#ifdef JU_STAGED_EXP - jbu_t BranchU; // Staged uncompressed branch -#else - -// Allocate memory for a BranchU: - - PjbuRaw = j__udyAllocJBU(Pjpm); - if (PjbuRaw == (Pjbu_t) NULL) return(-1); - Pjbu = P_JBU(PjbuRaw); -#endif - JU_JPSETADT(&JPNull, 0, 0, JU_JPTYPE(Pjp) - cJU_JPBRANCH_B2 + cJU_JPNULL1); - -// Get the pointer to the BranchB: - - PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); - Pjbb = P_JBB(PjbbRaw); - -// Set the pointer to the Uncompressed branch -#ifdef JU_STAGED_EXP - PDstJP = BranchU.jbu_jp; -#else - PDstJP = Pjbu->jbu_jp; -#endif - for (ii = 0; ii < cJU_NUMSUBEXPB; ii++) - { - Pjp_t PjpA; - Pjp_t PjpB; - - PjpB = PjpA = P_JP(JU_JBB_PJP(Pjbb, ii)); - -// Get the bitmap for this subexpanse - BitMap = JU_JBB_BITMAP(Pjbb, ii); - -// NULL empty subexpanses - if (BitMap == 0) - { -// But, fill with NULLs - for (jj = 0; jj < cJU_BITSPERSUBEXPB; jj++) - { - PDstJP[jj] = JPNull; - } - PDstJP += cJU_BITSPERSUBEXPB; - continue; - } -// Check if Uncompressed subexpanse - if (BitMap == cJU_FULLBITMAPB) - { -// Copy subexpanse to the Uncompressed branch intact - JU_COPYMEM(PDstJP, PjpA, cJU_BITSPERSUBEXPB); - -// Bump to next subexpanse - PDstJP += cJU_BITSPERSUBEXPB; - -// Set length of subexpanse - jj = cJU_BITSPERSUBEXPB; - } - else - { - for (jj = 0; jj < cJU_BITSPERSUBEXPB; jj++) - { -// Copy JP or NULLJP depending on bit - if (BitMap & 1) { *PDstJP = *PjpA++; } - else { *PDstJP = JPNull; } - - PDstJP++; // advance to next JP - BitMap >>= 1; - } - jj = PjpA - PjpB; - } - -// Free the subexpanse: - - j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, ii), jj, Pjpm); - - } // for each JP in BranchU - -#ifdef JU_STAGED_EXP - -// Allocate memory for a BranchU: - - PjbuRaw = j__udyAllocJBU(Pjpm); - if (PjbuRaw == (Pjbu_t) NULL) return(-1); - Pjbu = P_JBU(PjbuRaw); - -// Copy staged branch to newly allocated branch: -// -// TBD: I think this code is broken. - - *Pjbu = BranchU; - -#endif // JU_STAGED_EXP - -// Finally free the BranchB and put the BranchU in its place: - - j__udyFreeJBB(PjbbRaw, Pjpm); - - Pjp->jp_Addr = (Word_t) PjbuRaw; - Pjp->jp_Type += cJU_JPBRANCH_U - cJU_JPBRANCH_B; - - return(1); - -} // j__udyCreateBranchU() diff --git a/libjudy/src/JudyL/JudyLDecascade.c b/libjudy/src/JudyL/JudyLDecascade.c deleted file mode 100644 index 4f50da1854..0000000000 --- a/libjudy/src/JudyL/JudyLDecascade.c +++ /dev/null @@ -1,1206 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.25 $ $Source: /judy/src/JudyCommon/JudyDecascade.c $ -// -// "Decascade" support functions for JudyDel.c: These functions convert -// smaller-index-size leaves to larger-index-size leaves, and also, bitmap -// leaves (LeafB1s) to Leaf1s, and some types of branches to smaller branches -// at the same index size. Some "decascading" occurs explicitly in JudyDel.c, -// but rare or large subroutines appear as functions here, and the overhead to -// call them is negligible. -// -// Compile with one of -DJUDY1 or -DJUDYL. Note: Function names are converted -// to Judy1 or JudyL specific values by external #defines. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#endif -#ifdef JUDYL -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);) - - -// **************************************************************************** -// __ J U D Y C O P Y 2 T O 3 -// -// Copy one or more 2-byte Indexes to a series of 3-byte Indexes. - -FUNCTION static void j__udyCopy2to3( - uint8_t * PDest, // to where to copy 3-byte Indexes. - uint16_t * PSrc, // from where to copy 2-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 3-byte Index. - - assert(Pop1); - - do { - Temp = MSByte | *PSrc++; - JU_COPY3_LONG_TO_PINDEX(PDest, Temp); - PDest += 3; - } while (--Pop1); - -} // j__udyCopy2to3() - - -#ifdef JU_64BIT - -// **************************************************************************** -// __ J U D Y C O P Y 3 T O 4 -// -// Copy one or more 3-byte Indexes to a series of 4-byte Indexes. - -FUNCTION static void j__udyCopy3to4( - uint32_t * PDest, // to where to copy 4-byte Indexes. - uint8_t * PSrc, // from where to copy 3-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 4-byte Index. - - assert(Pop1); - - do { - JU_COPY3_PINDEX_TO_LONG(Temp, PSrc); - Temp |= MSByte; - PSrc += 3; - *PDest++ = Temp; // truncates to uint32_t. - } while (--Pop1); - -} // j__udyCopy3to4() - - -// **************************************************************************** -// __ J U D Y C O P Y 4 T O 5 -// -// Copy one or more 4-byte Indexes to a series of 5-byte Indexes. - -FUNCTION static void j__udyCopy4to5( - uint8_t * PDest, // to where to copy 4-byte Indexes. - uint32_t * PSrc, // from where to copy 4-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 5-byte Index. - - assert(Pop1); - - do { - Temp = MSByte | *PSrc++; - JU_COPY5_LONG_TO_PINDEX(PDest, Temp); - PDest += 5; - } while (--Pop1); - -} // j__udyCopy4to5() - - -// **************************************************************************** -// __ J U D Y C O P Y 5 T O 6 -// -// Copy one or more 5-byte Indexes to a series of 6-byte Indexes. - -FUNCTION static void j__udyCopy5to6( - uint8_t * PDest, // to where to copy 6-byte Indexes. - uint8_t * PSrc, // from where to copy 5-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 6-byte Index. - - assert(Pop1); - - do { - JU_COPY5_PINDEX_TO_LONG(Temp, PSrc); - Temp |= MSByte; - JU_COPY6_LONG_TO_PINDEX(PDest, Temp); - PSrc += 5; - PDest += 6; - } while (--Pop1); - -} // j__udyCopy5to6() - - -// **************************************************************************** -// __ J U D Y C O P Y 6 T O 7 -// -// Copy one or more 6-byte Indexes to a series of 7-byte Indexes. - -FUNCTION static void j__udyCopy6to7( - uint8_t * PDest, // to where to copy 6-byte Indexes. - uint8_t * PSrc, // from where to copy 5-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - Word_t Temp; // for building 6-byte Index. - - assert(Pop1); - - do { - JU_COPY6_PINDEX_TO_LONG(Temp, PSrc); - Temp |= MSByte; - JU_COPY7_LONG_TO_PINDEX(PDest, Temp); - PSrc += 6; - PDest += 7; - } while (--Pop1); - -} // j__udyCopy6to7() - -#endif // JU_64BIT - - -#ifndef JU_64BIT // 32-bit - -// **************************************************************************** -// __ J U D Y C O P Y 3 T O W -// -// Copy one or more 3-byte Indexes to a series of longs (words, always 4-byte). - -FUNCTION static void j__udyCopy3toW( - PWord_t PDest, // to where to copy full-word Indexes. - uint8_t * PSrc, // from where to copy 3-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - assert(Pop1); - - do { - JU_COPY3_PINDEX_TO_LONG(*PDest, PSrc); - *PDest++ |= MSByte; - PSrc += 3; - } while (--Pop1); - -} // j__udyCopy3toW() - - -#else // JU_64BIT - -// **************************************************************************** -// __ J U D Y C O P Y 7 T O W -// -// Copy one or more 7-byte Indexes to a series of longs (words, always 8-byte). - -FUNCTION static void j__udyCopy7toW( - PWord_t PDest, // to where to copy full-word Indexes. - uint8_t * PSrc, // from where to copy 7-byte indexes. - Word_t Pop1, // number of Indexes to copy. - Word_t MSByte) // most-significant byte, prefix to each Index. -{ - assert(Pop1); - - do { - JU_COPY7_PINDEX_TO_LONG(*PDest, PSrc); - *PDest++ |= MSByte; - PSrc += 7; - } while (--Pop1); - -} // j__udyCopy7toW() - -#endif // JU_64BIT - - -// **************************************************************************** -// __ J U D Y B R A N C H B T O B R A N C H L -// -// When a BranchB shrinks to have few enough JPs, call this function to convert -// it to a BranchL. Return 1 for success, or -1 for failure (with details in -// Pjpm). - -FUNCTION int j__udyBranchBToBranchL( - Pjp_t Pjp, // points to BranchB to shrink. - Pvoid_t Pjpm) // for global accounting. -{ - Pjbb_t PjbbRaw; // old BranchB to shrink. - Pjbb_t Pjbb; - Pjbl_t PjblRaw; // new BranchL to create. - Pjbl_t Pjbl; - Word_t Digit; // in BranchB. - Word_t NumJPs; // non-null JPs in BranchB. - uint8_t Expanse[cJU_BRANCHLMAXJPS]; // for building jbl_Expanse[]. - Pjp_t Pjpjbl; // current JP in BranchL. - Word_t SubExp; // in BranchB. - - assert(JU_JPTYPE(Pjp) >= cJU_JPBRANCH_B2); - assert(JU_JPTYPE(Pjp) <= cJU_JPBRANCH_B); - - PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); - Pjbb = P_JBB(PjbbRaw); - -// Copy 1-byte subexpanse digits from BranchB to temporary buffer for BranchL, -// for each bit set in the BranchB: -// -// TBD: The following supports variable-sized linear branches, but they are no -// longer variable; this could be simplified to save the copying. -// -// TBD: Since cJU_BRANCHLMAXJP == 7 now, and cJU_BRANCHUNUMJPS == 256, the -// following might be inefficient; is there a faster way to do it? At least -// skip wholly empty subexpanses? - - for (NumJPs = Digit = 0; Digit < cJU_BRANCHUNUMJPS; ++Digit) - { - if (JU_BITMAPTESTB(Pjbb, Digit)) - { - Expanse[NumJPs++] = Digit; - assert(NumJPs <= cJU_BRANCHLMAXJPS); // required of caller. - } - } - -// Allocate and populate the BranchL: - - if ((PjblRaw = j__udyAllocJBL(Pjpm)) == (Pjbl_t) NULL) return(-1); - Pjbl = P_JBL(PjblRaw); - - JU_COPYMEM(Pjbl->jbl_Expanse, Expanse, NumJPs); - - Pjbl->jbl_NumJPs = NumJPs; - DBGCODE(JudyCheckSorted((Pjll_t) (Pjbl->jbl_Expanse), NumJPs, 1);) - -// Copy JPs from each BranchB subexpanse subarray: - - Pjpjbl = P_JP(Pjbl->jbl_jp); // start at first JP in array. - - for (SubExp = 0; SubExp < cJU_NUMSUBEXPB; ++SubExp) - { - Pjp_t PjpRaw = JU_JBB_PJP(Pjbb, SubExp); // current Pjp. - Pjp_t Pjp; - - if (PjpRaw == (Pjp_t) NULL) continue; // skip empty subexpanse. - Pjp = P_JP(PjpRaw); - - NumJPs = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, SubExp)); - assert(NumJPs); - JU_COPYMEM(Pjpjbl, Pjp, NumJPs); // one subarray at a time. - - Pjpjbl += NumJPs; - j__udyFreeJBBJP(PjpRaw, NumJPs, Pjpm); // subarray. - } - j__udyFreeJBB(PjbbRaw, Pjpm); // BranchB itself. - -// Finish up: Calculate new JP type (same index size = level in new class), -// and tie new BranchB into parent JP: - - Pjp->jp_Type += cJU_JPBRANCH_L - cJU_JPBRANCH_B; - Pjp->jp_Addr = (Word_t) PjblRaw; - - return(1); - -} // j__udyBranchBToBranchL() - - -#ifdef notdef - -// **************************************************************************** -// __ J U D Y B R A N C H U T O B R A N C H B -// -// When a BranchU shrinks to need little enough memory, call this function to -// convert it to a BranchB to save memory (at the cost of some speed). Return -// 1 for success, or -1 for failure (with details in Pjpm). -// -// TBD: Fill out if/when needed. Not currently used in JudyDel.c for reasons -// explained there. - -FUNCTION int j__udyBranchUToBranchB( - Pjp_t Pjp, // points to BranchU to shrink. - Pvoid_t Pjpm) // for global accounting. -{ - assert(FALSE); - return(1); -} -#endif // notdef - - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -// **************************************************************************** -// __ J U D Y L E A F B 1 T O L E A F 1 -// -// Shrink a bitmap leaf (cJU_LEAFB1) to linear leaf (cJU_JPLEAF1). -// Return 1 for success, or -1 for failure (with details in Pjpm). -// -// Note: This function is different than the other JudyLeaf*ToLeaf*() -// functions because it receives a Pjp, not just a leaf, and handles its own -// allocation and free, in order to allow the caller to continue with a LeafB1 -// if allocation fails. - -FUNCTION int j__udyLeafB1ToLeaf1( - Pjp_t Pjp, // points to LeafB1 to shrink. - Pvoid_t Pjpm) // for global accounting. -{ - Pjlb_t PjlbRaw; // bitmap in old leaf. - Pjlb_t Pjlb; - Pjll_t PjllRaw; // new Leaf1. - uint8_t * Pleaf1; // Leaf1 pointer type. - Word_t Digit; // in LeafB1 bitmap. -#ifdef JUDYL - Pjv_t PjvNew; // value area in new Leaf1. - Word_t Pop1; - Word_t SubExp; -#endif - - assert(JU_JPTYPE(Pjp) == cJU_JPLEAF_B1); - assert(((JU_JPDCDPOP0(Pjp) & 0xFF) + 1) == cJU_LEAF1_MAXPOP1); - -// Allocate JPLEAF1 and prepare pointers: - - if ((PjllRaw = j__udyAllocJLL1(cJU_LEAF1_MAXPOP1, Pjpm)) == 0) - return(-1); - - Pleaf1 = (uint8_t *) P_JLL(PjllRaw); - PjlbRaw = (Pjlb_t) (Pjp->jp_Addr); - Pjlb = P_JLB(PjlbRaw); - JUDYLCODE(PjvNew = JL_LEAF1VALUEAREA(Pleaf1, cJL_LEAF1_MAXPOP1);) - -// Copy 1-byte indexes from old LeafB1 to new Leaf1: - - for (Digit = 0; Digit < cJU_BRANCHUNUMJPS; ++Digit) - if (JU_BITMAPTESTL(Pjlb, Digit)) - *Pleaf1++ = Digit; - -#ifdef JUDYL - -// Copy all old-LeafB1 value areas from value subarrays to new Leaf1: - - for (SubExp = 0; SubExp < cJU_NUMSUBEXPL; ++SubExp) - { - Pjv_t PjvRaw = JL_JLB_PVALUE(Pjlb, SubExp); - Pjv_t Pjv = P_JV(PjvRaw); - - if (Pjv == (Pjv_t) NULL) continue; // skip empty subarray. - - Pop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, SubExp)); // subarray. - assert(Pop1); - - JU_COPYMEM(PjvNew, Pjv, Pop1); // copy value areas. - j__udyLFreeJV(PjvRaw, Pop1, Pjpm); - PjvNew += Pop1; // advance through new. - } - - assert((((Word_t) Pleaf1) - (Word_t) P_JLL(PjllRaw)) - == (PjvNew - JL_LEAF1VALUEAREA(P_JLL(PjllRaw), cJL_LEAF1_MAXPOP1))); -#endif // JUDYL - - DBGCODE(JudyCheckSorted((Pjll_t) P_JLL(PjllRaw), - (((Word_t) Pleaf1) - (Word_t) P_JLL(PjllRaw)), 1);) - -// Finish up: Free the old LeafB1 and plug the new Leaf1 into the JP: -// -// Note: jp_DcdPopO does not change here. - - j__udyFreeJLB1(PjlbRaw, Pjpm); - - Pjp->jp_Addr = (Word_t) PjllRaw; - Pjp->jp_Type = cJU_JPLEAF1; - - return(1); - -} // j__udyLeafB1ToLeaf1() - -#endif // (JUDYL || (! JU_64BIT)) - - -// **************************************************************************** -// __ J U D Y L E A F 1 T O L E A F 2 -// -// Copy 1-byte Indexes from a LeafB1 or Leaf1 to 2-byte Indexes in a Leaf2. -// Pjp MUST be one of: cJU_JPLEAF_B1, cJU_JPLEAF1, or cJU_JPIMMED_1_*. -// Return number of Indexes copied. -// -// TBD: In this and all following functions, the caller should already be able -// to compute the Pop1 return value, so why return it? - -FUNCTION Word_t j__udyLeaf1ToLeaf2( - uint16_t * PLeaf2, // destination uint16_t * Index portion of leaf. -#ifdef JUDYL - Pjv_t Pjv2, // destination value part of leaf. -#endif - Pjp_t Pjp, // 1-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. - Word_t Offset; // in linear leaf list. -JUDYLCODE(Pjv_t Pjv1Raw;) // source object value area. -JUDYLCODE(Pjv_t Pjv1;) - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF_B1: - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb = P_JLB(Pjp->jp_Addr); - Word_t Digit; // in LeafB1 bitmap. - JUDYLCODE(Word_t SubExp;) // in LeafB1. - - Pop1 = JU_JPBRANCH_POP0(Pjp, 1) + 1; assert(Pop1); - -// Copy 1-byte indexes from old LeafB1 to new Leaf2, including splicing in -// the missing MSByte needed in the Leaf2: - - for (Digit = 0; Digit < cJU_BRANCHUNUMJPS; ++Digit) - if (JU_BITMAPTESTL(Pjlb, Digit)) - *PLeaf2++ = MSByte | Digit; - -#ifdef JUDYL - -// Copy all old-LeafB1 value areas from value subarrays to new Leaf2: - - for (SubExp = 0; SubExp < cJU_NUMSUBEXPL; ++SubExp) - { - Word_t SubExpPop1; - - Pjv1Raw = JL_JLB_PVALUE(Pjlb, SubExp); - if (Pjv1Raw == (Pjv_t) NULL) continue; // skip empty. - Pjv1 = P_JV(Pjv1Raw); - - SubExpPop1 = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, SubExp)); - assert(SubExpPop1); - - JU_COPYMEM(Pjv2, Pjv1, SubExpPop1); // copy value areas. - j__udyLFreeJV(Pjv1Raw, SubExpPop1, Pjpm); - Pjv2 += SubExpPop1; // advance through new. - } -#endif // JUDYL - - j__udyFreeJLB1((Pjlb_t) (Pjp->jp_Addr), Pjpm); // LeafB1 itself. - return(Pop1); - - } // case cJU_JPLEAF_B1 - - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -// JPLEAF1: - - case cJU_JPLEAF1: - { - uint8_t * PLeaf1 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPBRANCH_POP0(Pjp, 1) + 1; assert(Pop1); - JUDYLCODE(Pjv1 = JL_LEAF1VALUEAREA(PLeaf1, Pop1);) - -// Copy all Index bytes including splicing in missing MSByte needed in Leaf2 -// (plus, for JudyL, value areas): - - for (Offset = 0; Offset < Pop1; ++Offset) - { - PLeaf2[Offset] = MSByte | PLeaf1[Offset]; - JUDYLCODE(Pjv2[Offset] = Pjv1[Offset];) - } - j__udyFreeJLL1((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } -#endif // (JUDYL || (! JU_64BIT)) - - -// JPIMMED_1_01: -// -// Note: jp_DcdPopO has 3 [7] bytes of Index (all but most significant byte), -// so the assignment to PLeaf2[] truncates and MSByte is not needed. - - case cJU_JPIMMED_1_01: - { - PLeaf2[0] = JU_JPDCDPOP0(Pjp); // see above. - JUDYLCODE(Pjv2[0] = Pjp->jp_Addr;) - return(1); - } - - -// JPIMMED_1_0[2+]: - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - { - Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_1_02 + 2; assert(Pop1); - JUDYLCODE(Pjv1Raw = (Pjv_t) (Pjp->jp_Addr);) - JUDYLCODE(Pjv1 = P_JV(Pjv1Raw);) - - for (Offset = 0; Offset < Pop1; ++Offset) - { -#ifdef JUDY1 - PLeaf2[Offset] = MSByte | Pjp->jp_1Index[Offset]; -#else - PLeaf2[Offset] = MSByte | Pjp->jp_LIndex[Offset]; - Pjv2 [Offset] = Pjv1[Offset]; -#endif - } - JUDYLCODE(j__udyLFreeJV(Pjv1Raw, Pop1, Pjpm);) - return(Pop1); - } - - -// UNEXPECTED CASES, including JPNULL1, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf1ToLeaf2() - - -// ***************************************************************************** -// __ J U D Y L E A F 2 T O L E A F 3 -// -// Copy 2-byte Indexes from a Leaf2 to 3-byte Indexes in a Leaf3. -// Pjp MUST be one of: cJU_JPLEAF2 or cJU_JPIMMED_2_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-3 branch to a -// Leaf3, the branch has no narrow pointers under it, meaning only level-2 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf2ToLeaf3( - uint8_t * PLeaf3, // destination "uint24_t *" Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv3, // destination value part of leaf. -#endif - Pjp_t Pjp, // 2-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -#if (defined(JUDYL) && defined(JU_64BIT)) - Pjv_t Pjv2Raw; // source object value area. -#endif -JUDYLCODE(Pjv_t Pjv2;) - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF2: - - case cJU_JPLEAF2: - { - uint16_t * PLeaf2 = (uint16_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1); - j__udyCopy2to3(PLeaf3, PLeaf2, Pop1, MSByte); -#ifdef JUDYL - Pjv2 = JL_LEAF2VALUEAREA(PLeaf2, Pop1); - JU_COPYMEM(Pjv3, Pjv2, Pop1); -#endif - j__udyFreeJLL2((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_2_01: -// -// Note: jp_DcdPopO has 3 [7] bytes of Index (all but most significant byte), -// so the "assignment" to PLeaf3[] is exact [truncates] and MSByte is not -// needed. - - case cJU_JPIMMED_2_01: - { - JU_COPY3_LONG_TO_PINDEX(PLeaf3, JU_JPDCDPOP0(Pjp)); // see above. - JUDYLCODE(Pjv3[0] = Pjp->jp_Addr;) - return(1); - } - - -// JPIMMED_2_0[2+]: - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - { - JUDY1CODE(uint16_t * PLeaf2 = (uint16_t *) (Pjp->jp_1Index);) - JUDYLCODE(uint16_t * PLeaf2 = (uint16_t *) (Pjp->jp_LIndex);) - - Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_2_02 + 2; assert(Pop1); - j__udyCopy2to3(PLeaf3, PLeaf2, Pop1, MSByte); -#ifdef JUDYL - Pjv2Raw = (Pjv_t) (Pjp->jp_Addr); - Pjv2 = P_JV(Pjv2Raw); - JU_COPYMEM(Pjv3, Pjv2, Pop1); - j__udyLFreeJV(Pjv2Raw, Pop1, Pjpm); -#endif - return(Pop1); - } -#endif // (JUDY1 || JU_64BIT) - - -// UNEXPECTED CASES, including JPNULL2, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf2ToLeaf3() - - -#ifdef JU_64BIT - -// **************************************************************************** -// __ J U D Y L E A F 3 T O L E A F 4 -// -// Copy 3-byte Indexes from a Leaf3 to 4-byte Indexes in a Leaf4. -// Pjp MUST be one of: cJU_JPLEAF3 or cJU_JPIMMED_3_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-4 branch to a -// Leaf4, the branch has no narrow pointers under it, meaning only level-3 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf3ToLeaf4( - uint32_t * PLeaf4, // destination uint32_t * Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv4, // destination value part of leaf. -#endif - Pjp_t Pjp, // 3-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv3Raw;) // source object value area. -JUDYLCODE(Pjv_t Pjv3;) - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF3: - - case cJU_JPLEAF3: - { - uint8_t * PLeaf3 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1); - j__udyCopy3to4(PLeaf4, (uint8_t *) PLeaf3, Pop1, MSByte); -#ifdef JUDYL - Pjv3 = JL_LEAF3VALUEAREA(PLeaf3, Pop1); - JU_COPYMEM(Pjv4, Pjv3, Pop1); -#endif - j__udyFreeJLL3((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_3_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), so -// the assignment to PLeaf4[] truncates and MSByte is not needed. - - case cJU_JPIMMED_3_01: - { - PLeaf4[0] = JU_JPDCDPOP0(Pjp); // see above. - JUDYLCODE(Pjv4[0] = Pjp->jp_Addr;) - return(1); - } - - -// JPIMMED_3_0[2+]: - - case cJU_JPIMMED_3_02: -#ifdef JUDY1 - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: -#endif - { - JUDY1CODE(uint8_t * PLeaf3 = (uint8_t *) (Pjp->jp_1Index);) - JUDYLCODE(uint8_t * PLeaf3 = (uint8_t *) (Pjp->jp_LIndex);) - - JUDY1CODE(Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_3_02 + 2;) - JUDYLCODE(Pop1 = 2;) - - j__udyCopy3to4(PLeaf4, PLeaf3, Pop1, MSByte); -#ifdef JUDYL - Pjv3Raw = (Pjv_t) (Pjp->jp_Addr); - Pjv3 = P_JV(Pjv3Raw); - JU_COPYMEM(Pjv4, Pjv3, Pop1); - j__udyLFreeJV(Pjv3Raw, Pop1, Pjpm); -#endif - return(Pop1); - } - - -// UNEXPECTED CASES, including JPNULL3, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf3ToLeaf4() - - -// Note: In all following j__udyLeaf*ToLeaf*() functions, JPIMMED_*_0[2+] -// cases exist for Judy1 (&& 64-bit) only. JudyL has no equivalent Immeds. - - -// ***************************************************************************** -// __ J U D Y L E A F 4 T O L E A F 5 -// -// Copy 4-byte Indexes from a Leaf4 to 5-byte Indexes in a Leaf5. -// Pjp MUST be one of: cJU_JPLEAF4 or cJU_JPIMMED_4_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-5 branch to a -// Leaf5, the branch has no narrow pointers under it, meaning only level-4 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf4ToLeaf5( - uint8_t * PLeaf5, // destination "uint40_t *" Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv5, // destination value part of leaf. -#endif - Pjp_t Pjp, // 4-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv4;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF4: - - case cJU_JPLEAF4: - { - uint32_t * PLeaf4 = (uint32_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1); - j__udyCopy4to5(PLeaf5, PLeaf4, Pop1, MSByte); -#ifdef JUDYL - Pjv4 = JL_LEAF4VALUEAREA(PLeaf4, Pop1); - JU_COPYMEM(Pjv5, Pjv4, Pop1); -#endif - j__udyFreeJLL4((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_4_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), so -// the assignment to PLeaf5[] truncates and MSByte is not needed. - - case cJU_JPIMMED_4_01: - { - JU_COPY5_LONG_TO_PINDEX(PLeaf5, JU_JPDCDPOP0(Pjp)); // see above. - JUDYLCODE(Pjv5[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_4_0[4+]: - - case cJ1_JPIMMED_4_02: - case cJ1_JPIMMED_4_03: - { - uint32_t * PLeaf4 = (uint32_t *) (Pjp->jp_1Index); - - Pop1 = JU_JPTYPE(Pjp) - cJ1_JPIMMED_4_02 + 2; - j__udyCopy4to5(PLeaf5, PLeaf4, Pop1, MSByte); - return(Pop1); - } -#endif // JUDY1 - - -// UNEXPECTED CASES, including JPNULL4, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf4ToLeaf5() - - -// **************************************************************************** -// __ J U D Y L E A F 5 T O L E A F 6 -// -// Copy 5-byte Indexes from a Leaf5 to 6-byte Indexes in a Leaf6. -// Pjp MUST be one of: cJU_JPLEAF5 or cJU_JPIMMED_5_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-6 branch to a -// Leaf6, the branch has no narrow pointers under it, meaning only level-5 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf5ToLeaf6( - uint8_t * PLeaf6, // destination uint8_t * Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv6, // destination value part of leaf. -#endif - Pjp_t Pjp, // 5-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv5;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF5: - - case cJU_JPLEAF5: - { - uint8_t * PLeaf5 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; assert(Pop1); - j__udyCopy5to6(PLeaf6, PLeaf5, Pop1, MSByte); -#ifdef JUDYL - Pjv5 = JL_LEAF5VALUEAREA(PLeaf5, Pop1); - JU_COPYMEM(Pjv6, Pjv5, Pop1); -#endif - j__udyFreeJLL5((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_5_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), so -// the assignment to PLeaf6[] truncates and MSByte is not needed. - - case cJU_JPIMMED_5_01: - { - JU_COPY6_LONG_TO_PINDEX(PLeaf6, JU_JPDCDPOP0(Pjp)); // see above. - JUDYLCODE(Pjv6[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_5_0[2+]: - - case cJ1_JPIMMED_5_02: - case cJ1_JPIMMED_5_03: - { - uint8_t * PLeaf5 = (uint8_t *) (Pjp->jp_1Index); - - Pop1 = JU_JPTYPE(Pjp) - cJ1_JPIMMED_5_02 + 2; - j__udyCopy5to6(PLeaf6, PLeaf5, Pop1, MSByte); - return(Pop1); - } -#endif // JUDY1 - - -// UNEXPECTED CASES, including JPNULL5, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf5ToLeaf6() - - -// ***************************************************************************** -// __ J U D Y L E A F 6 T O L E A F 7 -// -// Copy 6-byte Indexes from a Leaf2 to 7-byte Indexes in a Leaf7. -// Pjp MUST be one of: cJU_JPLEAF6 or cJU_JPIMMED_6_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-7 branch to a -// Leaf7, the branch has no narrow pointers under it, meaning only level-6 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf6ToLeaf7( - uint8_t * PLeaf7, // destination "uint24_t *" Index part of leaf. -#ifdef JUDYL - Pjv_t Pjv7, // destination value part of leaf. -#endif - Pjp_t Pjp, // 6-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv6;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF6: - - case cJU_JPLEAF6: - { - uint8_t * PLeaf6 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyCopy6to7(PLeaf7, PLeaf6, Pop1, MSByte); -#ifdef JUDYL - Pjv6 = JL_LEAF6VALUEAREA(PLeaf6, Pop1); - JU_COPYMEM(Pjv7, Pjv6, Pop1); -#endif - j__udyFreeJLL6((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_6_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), so -// the "assignment" to PLeaf7[] is exact and MSByte is not needed. - - case cJU_JPIMMED_6_01: - { - JU_COPY7_LONG_TO_PINDEX(PLeaf7, JU_JPDCDPOP0(Pjp)); // see above. - JUDYLCODE(Pjv7[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_6_02: - - case cJ1_JPIMMED_6_02: - { - uint8_t * PLeaf6 = (uint8_t *) (Pjp->jp_1Index); - - j__udyCopy6to7(PLeaf7, PLeaf6, /* Pop1 = */ 2, MSByte); - return(2); - } -#endif // JUDY1 - - -// UNEXPECTED CASES, including JPNULL6, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf6ToLeaf7() - -#endif // JU_64BIT - - -#ifndef JU_64BIT // 32-bit version first - -// **************************************************************************** -// __ J U D Y L E A F 3 T O L E A F W -// -// Copy 3-byte Indexes from a Leaf3 to 4-byte Indexes in a LeafW. Pjp MUST be -// one of: cJU_JPLEAF3 or cJU_JPIMMED_3_*. Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-L branch to a -// LeafW, the branch has no narrow pointers under it, meaning only level-3 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf3ToLeafW( - Pjlw_t Pjlw, // destination Index part of leaf. -#ifdef JUDYL - Pjv_t PjvW, // destination value part of leaf. -#endif - Pjp_t Pjp, // 3-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv3;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF3: - - case cJU_JPLEAF3: - { - uint8_t * PLeaf3 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyCopy3toW((PWord_t) Pjlw, PLeaf3, Pop1, MSByte); -#ifdef JUDYL - Pjv3 = JL_LEAF3VALUEAREA(PLeaf3, Pop1); - JU_COPYMEM(PjvW, Pjv3, Pop1); -#endif - j__udyFreeJLL3((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_3_01: -// -// Note: jp_DcdPopO has 3 bytes of Index (all but most significant byte), and -// MSByte must be ord in. - - case cJU_JPIMMED_3_01: - { - Pjlw[0] = MSByte | JU_JPDCDPOP0(Pjp); // see above. - JUDYLCODE(PjvW[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_3_02: - - case cJU_JPIMMED_3_02: - { - uint8_t * PLeaf3 = (uint8_t *) (Pjp->jp_1Index); - - j__udyCopy3toW((PWord_t) Pjlw, PLeaf3, /* Pop1 = */ 2, MSByte); - return(2); - } -#endif // JUDY1 - - -// UNEXPECTED CASES, including JPNULL3, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf3ToLeafW() - - -#else // JU_64BIT - - -// **************************************************************************** -// __ J U D Y L E A F 7 T O L E A F W -// -// Copy 7-byte Indexes from a Leaf7 to 8-byte Indexes in a LeafW. -// Pjp MUST be one of: cJU_JPLEAF7 or cJU_JPIMMED_7_*. -// Return number of Indexes copied. -// -// Note: By the time this function is called to compress a level-L branch to a -// LeafW, the branch has no narrow pointers under it, meaning only level-7 -// objects are below it and must be handled here. - -FUNCTION Word_t j__udyLeaf7ToLeafW( - Pjlw_t Pjlw, // destination Index part of leaf. -#ifdef JUDYL - Pjv_t PjvW, // destination value part of leaf. -#endif - Pjp_t Pjp, // 7-byte-index object from which to copy. - Word_t MSByte, // most-significant byte, prefix to each Index. - Pvoid_t Pjpm) // for global accounting. -{ - Word_t Pop1; // Indexes in leaf. -JUDYLCODE(Pjv_t Pjv7;) // source object value area. - - switch (JU_JPTYPE(Pjp)) - { - - -// JPLEAF7: - - case cJU_JPLEAF7: - { - uint8_t * PLeaf7 = (uint8_t *) P_JLL(Pjp->jp_Addr); - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyCopy7toW((PWord_t) Pjlw, PLeaf7, Pop1, MSByte); -#ifdef JUDYL - Pjv7 = JL_LEAF7VALUEAREA(PLeaf7, Pop1); - JU_COPYMEM(PjvW, Pjv7, Pop1); -#endif - j__udyFreeJLL7((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - return(Pop1); - } - - -// JPIMMED_7_01: -// -// Note: jp_DcdPopO has 7 bytes of Index (all but most significant byte), and -// MSByte must be ord in. - - case cJU_JPIMMED_7_01: - { - Pjlw[0] = MSByte | JU_JPDCDPOP0(Pjp); // see above. - JUDYLCODE(PjvW[0] = Pjp->jp_Addr;) - return(1); - } - - -#ifdef JUDY1 - -// JPIMMED_7_02: - - case cJ1_JPIMMED_7_02: - { - uint8_t * PLeaf7 = (uint8_t *) (Pjp->jp_1Index); - - j__udyCopy7toW((PWord_t) Pjlw, PLeaf7, /* Pop1 = */ 2, MSByte); - return(2); - } -#endif - - -// UNEXPECTED CASES, including JPNULL7, should be handled by caller: - - default: assert(FALSE); break; - - } // switch - - return(0); - -} // j__udyLeaf7ToLeafW() - -#endif // JU_64BIT diff --git a/libjudy/src/JudyL/JudyLDel.c b/libjudy/src/JudyL/JudyLDel.c deleted file mode 100644 index ced4b5fb30..0000000000 --- a/libjudy/src/JudyL/JudyLDel.c +++ /dev/null @@ -1,2146 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.68 $ $Source: /judy/src/JudyCommon/JudyDel.c $ -// -// Judy1Unset() and JudyLDel() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// About HYSTERESIS: In the Judy code, hysteresis means leaving around a -// nominally suboptimal (not maximally compressed) data structure after a -// deletion. As a result, the shape of the tree for two identical index sets -// can differ depending on the insert/delete path taken to arrive at the index -// sets. The purpose is to minimize worst-case behavior (thrashing) that could -// result from a series of intermixed insertions and deletions. It also makes -// for MUCH simpler code, because instead of performing, "delete and then -// compress," it can say, "compress and then delete," where due to hysteresis, -// compression is not even attempted until the object IS compressible. -// -// In some cases the code has no choice and it must "ungrow" a data structure -// across a "phase transition" boundary without hysteresis. In other cases the -// amount (such as "hysteresis = 1") is indicated by the number of JP deletions -// (in branches) or index deletions (in leaves) that can occur in succession -// before compressing the data structure. (It appears that hysteresis <= 1 in -// all cases.) -// -// In general no hysteresis occurs when the data structure type remains the -// same but the allocated memory chunk for the node must shrink, because the -// relationship is hardwired and theres no way to know how much memory is -// allocated to a given data structure. Hysteresis = 0 in all these cases. -// -// TBD: Could this code be faster if memory chunk hysteresis were supported -// somehow along with data structure type hysteresis? -// -// TBD: Should some of the assertions here be converted to product code that -// returns JU_ERRNO_CORRUPT? -// -// TBD: Dougs code had an odd mix of function-wide and limited-scope -// variables. Should some of the function-wide variables appear only in -// limited scopes, or more likely, vice-versa? - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);) -DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);) - -#ifdef TRACEJP -#include "JudyPrintJP.c" -#endif - -// These are defined to generic values in JudyCommon/JudyPrivateTypes.h: -// -// TBD: These should be exported from a header file, but perhaps not, as they -// are only used here, and exported from JudyDecascade.c, which is a separate -// file for profiling reasons (to prevent inlining), but which potentially -// could be merged with this file, either in SoftCM or at compile-time: - -#ifdef JUDY1 - -extern int j__udy1BranchBToBranchL(Pjp_t Pjp, Pvoid_t Pjpm); -#ifndef JU_64BIT -extern int j__udy1LeafB1ToLeaf1(Pjp_t, Pvoid_t); -#endif -extern Word_t j__udy1Leaf1ToLeaf2(uint16_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf2ToLeaf3(uint8_t *, Pjp_t, Word_t, Pvoid_t); -#ifndef JU_64BIT -extern Word_t j__udy1Leaf3ToLeafW(Pjlw_t, Pjp_t, Word_t, Pvoid_t); -#else -extern Word_t j__udy1Leaf3ToLeaf4(uint32_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf4ToLeaf5(uint8_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf5ToLeaf6(uint8_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf6ToLeaf7(uint8_t *, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udy1Leaf7ToLeafW(Pjlw_t, Pjp_t, Word_t, Pvoid_t); -#endif - -#else // JUDYL - -extern int j__udyLBranchBToBranchL(Pjp_t Pjp, Pvoid_t Pjpm); -extern int j__udyLLeafB1ToLeaf1(Pjp_t, Pvoid_t); -extern Word_t j__udyLLeaf1ToLeaf2(uint16_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf2ToLeaf3(uint8_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -#ifndef JU_64BIT -extern Word_t j__udyLLeaf3ToLeafW(Pjlw_t, Pjv_t, Pjp_t, Word_t, Pvoid_t); -#else -extern Word_t j__udyLLeaf3ToLeaf4(uint32_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf4ToLeaf5(uint8_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf5ToLeaf6(uint8_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf6ToLeaf7(uint8_t *, Pjv_t, Pjp_t, Word_t, Pvoid_t); -extern Word_t j__udyLLeaf7ToLeafW(Pjlw_t, Pjv_t, Pjp_t, Word_t, Pvoid_t); -#endif - -#endif // JUDYL - -// For convenience in the calling code; "M1" means "minus one": - -#ifndef JU_64BIT -#define j__udyLeafM1ToLeafW j__udyLeaf3ToLeafW -#else -#define j__udyLeafM1ToLeafW j__udyLeaf7ToLeafW -#endif - - -// **************************************************************************** -// __ J U D Y D E L W A L K -// -// Given a pointer to a JP, an Index known to be valid, the number of bytes -// left to decode (== level in the tree), and a pointer to a global JPM, walk a -// Judy (sub)tree to do an unset/delete of that index, and possibly modify the -// JPM. This function is only called internally, and recursively. Unlike -// Judy1Test() and JudyLGet(), the extra time required for recursion should be -// negligible compared with the total. -// -// Return values: -// -// -1 error; details in JPM -// -// 0 Index already deleted (should never happen, Index is known to be valid) -// -// 1 previously valid Index deleted -// -// 2 same as 1, but in addition the JP now points to a BranchL containing a -// single JP, which should be compressed into the parent branch (if there -// is one, which is not the case for a top-level branch under a JPM) - -DBGCODE(uint8_t parentJPtype;) // parent branch JP type. - -FUNCTION static int j__udyDelWalk( - Pjp_t Pjp, // current JP under which to delete. - Word_t Index, // to delete. - Word_t ParentLevel, // of parent branch. - Pjpm_t Pjpm) // for returning info to top level. -{ - Word_t pop1; // of a leaf. - Word_t level; // of a leaf. - uint8_t digit; // from Index, in current branch. - Pjll_t PjllnewRaw; // address of newly allocated leaf. - Pjll_t Pjllnew; - int offset; // within a branch. - int retcode; // return code: -1, 0, 1, 2. -JUDYLCODE(Pjv_t PjvRaw;) // value area. -JUDYLCODE(Pjv_t Pjv;) - - DBGCODE(level = 0;) - -ContinueDelWalk: // for modifying state without recursing. - -#ifdef TRACEJP - JudyPrintJP(Pjp, "d", __LINE__); -#endif - - switch (JU_JPTYPE(Pjp)) // entry: Pjp, Index. - { - - -// **************************************************************************** -// LINEAR BRANCH: -// -// MACROS FOR COMMON CODE: -// -// Check for population too high to compress a branch to a leaf, meaning just -// descend through the branch, with a purposeful off-by-one error that -// constitutes hysteresis = 1. In other words, do not compress until the -// branchs CURRENT population fits in the leaf, even BEFORE deleting one -// index. -// -// Next is a label for branch-type-specific common code. Variables pop1, -// level, digit, and Index are in the context. - -#define JU_BRANCH_KEEP(cLevel,MaxPop1,Next) \ - if (pop1 > (MaxPop1)) /* hysteresis = 1 */ \ - { \ - assert((cLevel) >= 2); \ - level = (cLevel); \ - digit = JU_DIGITATSTATE(Index, cLevel); \ - goto Next; \ - } - -// Support for generic calling of JudyLeaf*ToLeaf*() functions: -// -// Note: Cannot use JUDYLCODE() because this contains a comma. - -#ifdef JUDY1 -#define JU_PVALUEPASS // null. -#else -#define JU_PVALUEPASS Pjv, -#endif - -// During compression to a leaf, check if a JP contains nothing but a -// cJU_JPIMMED_*_01, in which case shortcut calling j__udyLeaf*ToLeaf*(): -// -// Copy the index bytes from the jp_DcdPopO field (with possible truncation), -// and continue the branch-JP-walk loop. Variables Pjp and Pleaf are in the -// context. - -#define JU_BRANCH_COPY_IMMED_EVEN(cLevel,Pjp,ignore) \ - if (JU_JPTYPE(Pjp) == cJU_JPIMMED_1_01 + (cLevel) - 2) \ - { \ - *Pleaf++ = JU_JPDCDPOP0(Pjp); \ - JUDYLCODE(*Pjv++ = (Pjp)->jp_Addr;) \ - continue; /* for-loop */ \ - } - -#define JU_BRANCH_COPY_IMMED_ODD(cLevel,Pjp,CopyIndex) \ - if (JU_JPTYPE(Pjp) == cJU_JPIMMED_1_01 + (cLevel) - 2) \ - { \ - CopyIndex(Pleaf, (Word_t) (JU_JPDCDPOP0(Pjp))); \ - Pleaf += (cLevel); /* index size = level */ \ - JUDYLCODE(*Pjv++ = (Pjp)->jp_Addr;) \ - continue; /* for-loop */ \ - } - -// Compress a BranchL into a leaf one index size larger: -// -// Allocate a new leaf, walk the JPs in the old BranchL and pack their contents -// into the new leaf (of type NewJPType), free the old BranchL, and finally -// restart the switch to delete Index from the new leaf. (Note that all -// BranchLs are the same size.) Variables Pjp, Pjpm, Pleaf, digit, and pop1 -// are in the context. - -#define JU_BRANCHL_COMPRESS(cLevel,LeafType,MaxPop1,NewJPType, \ - LeafToLeaf,Alloc,ValueArea, \ - CopyImmed,CopyIndex) \ - { \ - LeafType Pleaf; \ - Pjbl_t PjblRaw; \ - Pjbl_t Pjbl; \ - Word_t numJPs; \ - \ - if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - Pleaf = (LeafType) Pjllnew; \ - JUDYLCODE(Pjv = ValueArea(Pleaf, MaxPop1);) \ - \ - PjblRaw = (Pjbl_t) (Pjp->jp_Addr); \ - Pjbl = P_JBL(PjblRaw); \ - numJPs = Pjbl->jbl_NumJPs; \ - \ - for (offset = 0; offset < numJPs; ++offset) \ - { \ - CopyImmed(cLevel, (Pjbl->jbl_jp) + offset, CopyIndex); \ - \ - pop1 = LeafToLeaf(Pleaf, JU_PVALUEPASS \ - (Pjbl->jbl_jp) + offset, \ - JU_DIGITTOSTATE(Pjbl->jbl_Expanse[offset], \ - cLevel), (Pvoid_t) Pjpm); \ - Pleaf = (LeafType) (((Word_t) Pleaf) + ((cLevel) * pop1)); \ - JUDYLCODE(Pjv += pop1;) \ - } \ - assert(((((Word_t) Pleaf) - ((Word_t) Pjllnew)) / (cLevel)) == (MaxPop1)); \ - JUDYLCODE(assert((Pjv - ValueArea(Pjllnew, MaxPop1)) == (MaxPop1));) \ - DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cLevel);) \ - \ - j__udyFreeJBL(PjblRaw, Pjpm); \ - \ - Pjp->jp_Type = (NewJPType); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - goto ContinueDelWalk; /* delete from new leaf */ \ - } - -// Overall common code for initial BranchL deletion handling: -// -// Assert that Index is in the branch, then see if the BranchL should be kept -// or else compressed to a leaf. Variables Index, Pjp, and pop1 are in the -// context. - -#define JU_BRANCHL(cLevel,MaxPop1,LeafType,NewJPType, \ - LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex) \ - \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel)); \ - assert(ParentLevel > (cLevel)); \ - \ - pop1 = JU_JPBRANCH_POP0(Pjp, cLevel) + 1; \ - JU_BRANCH_KEEP(cLevel, MaxPop1, BranchLKeep); \ - assert(pop1 == (MaxPop1)); \ - \ - JU_BRANCHL_COMPRESS(cLevel, LeafType, MaxPop1, NewJPType, \ - LeafToLeaf, Alloc, ValueArea, CopyImmed, CopyIndex) - - -// END OF MACROS, START OF CASES: - - case cJU_JPBRANCH_L2: - - JU_BRANCHL(2, cJU_LEAF2_MAXPOP1, uint16_t *, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_L3: - - JU_BRANCHL(3, cJU_LEAF3_MAXPOP1, uint8_t *, cJU_JPLEAF3, - j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY3_LONG_TO_PINDEX); - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - - JU_BRANCHL(4, cJU_LEAF4_MAXPOP1, uint32_t *, cJU_JPLEAF4, - j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_L5: - - JU_BRANCHL(5, cJU_LEAF5_MAXPOP1, uint8_t *, cJU_JPLEAF5, - j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY5_LONG_TO_PINDEX); - - case cJU_JPBRANCH_L6: - - JU_BRANCHL(6, cJU_LEAF6_MAXPOP1, uint8_t *, cJU_JPLEAF6, - j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY6_LONG_TO_PINDEX); - - case cJU_JPBRANCH_L7: - - JU_BRANCHL(7, cJU_LEAF7_MAXPOP1, uint8_t *, cJU_JPLEAF7, - j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY7_LONG_TO_PINDEX); -#endif // JU_64BIT - -// A top-level BranchL is different and cannot use JU_BRANCHL(): Dont try to -// compress to a (LEAFW) leaf yet, but leave this for a later deletion -// (hysteresis > 0); and the next JP type depends on the system word size; so -// dont use JU_BRANCH_KEEP(): - - case cJU_JPBRANCH_L: - { - Pjbl_t Pjbl; - Word_t numJPs; - - level = cJU_ROOTSTATE; - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - - // fall through: - - -// COMMON CODE FOR KEEPING AND DESCENDING THROUGH A BRANCHL: -// -// Come here with level and digit set. - -BranchLKeep: - Pjbl = P_JBL(Pjp->jp_Addr); - numJPs = Pjbl->jbl_NumJPs; - assert(numJPs > 0); - DBGCODE(parentJPtype = JU_JPTYPE(Pjp);) - -// Search for a match to the digit (valid Index => must find digit): - - for (offset = 0; (Pjbl->jbl_Expanse[offset]) != digit; ++offset) - assert(offset < numJPs - 1); - - Pjp = (Pjbl->jbl_jp) + offset; - -// If not at a (deletable) JPIMMED_*_01, continue the walk (to descend through -// the BranchL): - - assert(level >= 2); - if ((JU_JPTYPE(Pjp)) != cJU_JPIMMED_1_01 + level - 2) break; - -// At JPIMMED_*_01: Ensure the index is in the right expanse, then delete the -// Immed from the BranchL: -// -// Note: A BranchL has a fixed size and format regardless of numJPs. - - assert(JU_JPDCDPOP0(Pjp) == JU_TRIMTODCDSIZE(Index)); - - JU_DELETEINPLACE(Pjbl->jbl_Expanse, numJPs, offset, ignore); - JU_DELETEINPLACE(Pjbl->jbl_jp, numJPs, offset, ignore); - - DBGCODE(JudyCheckSorted((Pjll_t) (Pjbl->jbl_Expanse), - numJPs - 1, 1);) - -// If only one index left in the BranchL, indicate this to the caller: - - return ((--(Pjbl->jbl_NumJPs) <= 1) ? 2 : 1); - - } // case cJU_JPBRANCH_L. - - -// **************************************************************************** -// BITMAP BRANCH: -// -// MACROS FOR COMMON CODE: -// -// Note the reuse of common macros here, defined earlier: JU_BRANCH_KEEP(), -// JU_PVALUE*. -// -// Compress a BranchB into a leaf one index size larger: -// -// Allocate a new leaf, walk the JPs in the old BranchB (one bitmap subexpanse -// at a time) and pack their contents into the new leaf (of type NewJPType), -// free the old BranchB, and finally restart the switch to delete Index from -// the new leaf. Variables Pjp, Pjpm, Pleaf, digit, and pop1 are in the -// context. -// -// Note: Its no accident that the interface to JU_BRANCHB_COMPRESS() is -// identical to JU_BRANCHL_COMPRESS(). Only the details differ in how to -// traverse the branchs JPs. - -#define JU_BRANCHB_COMPRESS(cLevel,LeafType,MaxPop1,NewJPType, \ - LeafToLeaf,Alloc,ValueArea, \ - CopyImmed,CopyIndex) \ - { \ - LeafType Pleaf; \ - Pjbb_t PjbbRaw; /* BranchB to compress */ \ - Pjbb_t Pjbb; \ - Word_t subexp; /* current subexpanse number */ \ - BITMAPB_t bitmap; /* portion for this subexpanse */ \ - Pjp_t Pjp2Raw; /* one subexpanses subarray */ \ - Pjp_t Pjp2; \ - \ - if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - Pleaf = (LeafType) Pjllnew; \ - JUDYLCODE(Pjv = ValueArea(Pleaf, MaxPop1);) \ - \ - PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); \ - Pjbb = P_JBB(PjbbRaw); \ - \ - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) \ - { \ - if ((bitmap = JU_JBB_BITMAP(Pjbb, subexp)) == 0) \ - continue; /* empty subexpanse */ \ - \ - digit = subexp * cJU_BITSPERSUBEXPB; \ - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); \ - Pjp2 = P_JP(Pjp2Raw); \ - assert(Pjp2 != (Pjp_t) NULL); \ - \ - for (offset = 0; bitmap != 0; bitmap >>= 1, ++digit) \ - { \ - if (! (bitmap & 1)) \ - continue; /* empty sub-subexpanse */ \ - \ - ++offset; /* before any continue */ \ - \ - CopyImmed(cLevel, Pjp2 + offset - 1, CopyIndex); \ - \ - pop1 = LeafToLeaf(Pleaf, JU_PVALUEPASS \ - Pjp2 + offset - 1, \ - JU_DIGITTOSTATE(digit, cLevel), \ - (Pvoid_t) Pjpm); \ - Pleaf = (LeafType) (((Word_t) Pleaf) + ((cLevel) * pop1)); \ - JUDYLCODE(Pjv += pop1;) \ - } \ - j__udyFreeJBBJP(Pjp2Raw, /* pop1 = */ offset, Pjpm); \ - } \ - assert(((((Word_t) Pleaf) - ((Word_t) Pjllnew)) / (cLevel)) == (MaxPop1)); \ - JUDYLCODE(assert((Pjv - ValueArea(Pjllnew, MaxPop1)) == (MaxPop1));) \ - DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cLevel);) \ - \ - j__udyFreeJBB(PjbbRaw, Pjpm); \ - \ - Pjp->jp_Type = (NewJPType); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - goto ContinueDelWalk; /* delete from new leaf */ \ - } - -// Overall common code for initial BranchB deletion handling: -// -// Assert that Index is in the branch, then see if the BranchB should be kept -// or else compressed to a leaf. Variables Index, Pjp, and pop1 are in the -// context. - -#define JU_BRANCHB(cLevel,MaxPop1,LeafType,NewJPType, \ - LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex) \ - \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel)); \ - assert(ParentLevel > (cLevel)); \ - \ - pop1 = JU_JPBRANCH_POP0(Pjp, cLevel) + 1; \ - JU_BRANCH_KEEP(cLevel, MaxPop1, BranchBKeep); \ - assert(pop1 == (MaxPop1)); \ - \ - JU_BRANCHB_COMPRESS(cLevel, LeafType, MaxPop1, NewJPType, \ - LeafToLeaf, Alloc, ValueArea, CopyImmed, CopyIndex) - - -// END OF MACROS, START OF CASES: -// -// Note: Its no accident that the macro calls for these cases is nearly -// identical to the code for BranchLs. - - case cJU_JPBRANCH_B2: - - JU_BRANCHB(2, cJU_LEAF2_MAXPOP1, uint16_t *, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_B3: - - JU_BRANCHB(3, cJU_LEAF3_MAXPOP1, uint8_t *, cJU_JPLEAF3, - j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY3_LONG_TO_PINDEX); - -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - - JU_BRANCHB(4, cJU_LEAF4_MAXPOP1, uint32_t *, cJU_JPLEAF4, - j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_B5: - - JU_BRANCHB(5, cJU_LEAF5_MAXPOP1, uint8_t *, cJU_JPLEAF5, - j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY5_LONG_TO_PINDEX); - - case cJU_JPBRANCH_B6: - - JU_BRANCHB(6, cJU_LEAF6_MAXPOP1, uint8_t *, cJU_JPLEAF6, - j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY6_LONG_TO_PINDEX); - - case cJU_JPBRANCH_B7: - - JU_BRANCHB(7, cJU_LEAF7_MAXPOP1, uint8_t *, cJU_JPLEAF7, - j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY7_LONG_TO_PINDEX); -#endif // JU_64BIT - -// A top-level BranchB is different and cannot use JU_BRANCHB(): Dont try to -// compress to a (LEAFW) leaf yet, but leave this for a later deletion -// (hysteresis > 0); and the next JP type depends on the system word size; so -// dont use JU_BRANCH_KEEP(): - - case cJU_JPBRANCH_B: - { - Pjbb_t Pjbb; // BranchB to modify. - Word_t subexp; // current subexpanse number. - Word_t subexp2; // in second-level loop. - BITMAPB_t bitmap; // portion for this subexpanse. - BITMAPB_t bitmask; // with digits bit set. - Pjp_t Pjp2Raw; // one subexpanses subarray. - Pjp_t Pjp2; - Word_t numJPs; // in one subexpanse. - - level = cJU_ROOTSTATE; - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - - // fall through: - - -// COMMON CODE FOR KEEPING AND DESCENDING THROUGH A BRANCHB: -// -// Come here with level and digit set. - -BranchBKeep: - Pjbb = P_JBB(Pjp->jp_Addr); - subexp = digit / cJU_BITSPERSUBEXPB; - bitmap = JU_JBB_BITMAP(Pjbb, subexp); - bitmask = JU_BITPOSMASKB(digit); - assert(bitmap & bitmask); // Index valid => digits bit is set. - DBGCODE(parentJPtype = JU_JPTYPE(Pjp);) - -// Compute digits offset into the bitmap, with a fast method if all bits are -// set: - - offset = ((bitmap == (cJU_FULLBITMAPB)) ? - digit % cJU_BITSPERSUBEXPB : - j__udyCountBitsB(bitmap & JU_MASKLOWEREXC(bitmask))); - - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); - Pjp2 = P_JP(Pjp2Raw); - assert(Pjp2 != (Pjp_t) NULL); // valid subexpanse pointer. - -// If not at a (deletable) JPIMMED_*_01, continue the walk (to descend through -// the BranchB): - - if (JU_JPTYPE(Pjp2 + offset) != cJU_JPIMMED_1_01 + level - 2) - { - Pjp = Pjp2 + offset; - break; - } - -// At JPIMMED_*_01: Ensure the index is in the right expanse, then delete the -// Immed from the BranchB: - - assert(JU_JPDCDPOP0(Pjp2 + offset) - == JU_TRIMTODCDSIZE(Index)); - -// If only one index is left in the subexpanse, free the JP array: - - if ((numJPs = j__udyCountBitsB(bitmap)) == 1) - { - j__udyFreeJBBJP(Pjp2Raw, /* pop1 = */ 1, Pjpm); - JU_JBB_PJP(Pjbb, subexp) = (Pjp_t) NULL; - } - -// Shrink JP array in-place: - - else if (JU_BRANCHBJPGROWINPLACE(numJPs - 1)) - { - assert(numJPs > 0); - JU_DELETEINPLACE(Pjp2, numJPs, offset, ignore); - } - -// JP array would end up too large; compress it to a smaller one: - - else - { - Pjp_t PjpnewRaw; - Pjp_t Pjpnew; - - if ((PjpnewRaw = j__udyAllocJBBJP(numJPs - 1, Pjpm)) - == (Pjp_t) NULL) return(-1); - Pjpnew = P_JP(PjpnewRaw); - - JU_DELETECOPY(Pjpnew, Pjp2, numJPs, offset, ignore); - j__udyFreeJBBJP(Pjp2Raw, numJPs, Pjpm); // old. - - JU_JBB_PJP(Pjbb, subexp) = PjpnewRaw; - } - -// Clear digits bit in the bitmap: - - JU_JBB_BITMAP(Pjbb, subexp) ^= bitmask; - -// If the current subexpanse alone is still too large for a BranchL (with -// hysteresis = 1), the delete is all done: - - if (numJPs > cJU_BRANCHLMAXJPS) return(1); - -// Consider shrinking the current BranchB to a BranchL: -// -// Check the numbers of JPs in other subexpanses in the BranchL. Upon reaching -// the critical number of numJPs (which could be right at the start; again, -// with hysteresis = 1), its faster to just watch for any non-empty subexpanse -// than to count bits in each subexpanse. Upon finding too many JPs, give up -// on shrinking the BranchB. - - for (subexp2 = 0; subexp2 < cJU_NUMSUBEXPB; ++subexp2) - { - if (subexp2 == subexp) continue; // skip current subexpanse. - - if ((numJPs == cJU_BRANCHLMAXJPS) ? - JU_JBB_BITMAP(Pjbb, subexp2) : - ((numJPs += j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp2))) - > cJU_BRANCHLMAXJPS)) - { - return(1); // too many JPs, cannot shrink. - } - } - -// Shrink current BranchB to a BranchL: -// -// Note: In this rare case, ignore the return value, do not pass it to the -// caller, because the deletion is already successfully completed and the -// caller(s) must decrement population counts. The only errors expected from -// this call are JU_ERRNO_NOMEM and JU_ERRNO_OVERRUN, neither of which is worth -// forwarding from this point. See also 4.1, 4.8, and 4.15 of this file. - - (void) j__udyBranchBToBranchL(Pjp, Pjpm); - return(1); - - } // case. - - -// **************************************************************************** -// UNCOMPRESSED BRANCH: -// -// MACROS FOR COMMON CODE: -// -// Note the reuse of common macros here, defined earlier: JU_PVALUE*. -// -// Compress a BranchU into a leaf one index size larger: -// -// Allocate a new leaf, walk the JPs in the old BranchU and pack their contents -// into the new leaf (of type NewJPType), free the old BranchU, and finally -// restart the switch to delete Index from the new leaf. Variables Pjp, Pjpm, -// digit, and pop1 are in the context. -// -// Note: Its no accident that the interface to JU_BRANCHU_COMPRESS() is -// nearly identical to JU_BRANCHL_COMPRESS(); just NullJPType is added. The -// details differ in how to traverse the branchs JPs -- -// -// -- and also, what to do upon encountering a cJU_JPIMMED_*_01 JP. In -// BranchLs and BranchBs the JP must be deleted, but in a BranchU its merely -// converted to a null JP, and this is done by other switch cases, so the "keep -// branch" situation is simpler here and JU_BRANCH_KEEP() is not used. Also, -// theres no code to convert a BranchU to a BranchB since counting the JPs in -// a BranchU is (at least presently) expensive, and besides, keeping around a -// BranchU is form of hysteresis. - -#define JU_BRANCHU_COMPRESS(cLevel,LeafType,MaxPop1,NullJPType,NewJPType, \ - LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex) \ - { \ - LeafType Pleaf; \ - Pjbu_t PjbuRaw = (Pjbu_t) (Pjp->jp_Addr); \ - Pjp_t Pjp2 = JU_JBU_PJP0(Pjp); \ - Word_t ldigit; /* larger than uint8_t */ \ - \ - if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - Pleaf = (LeafType) Pjllnew; \ - JUDYLCODE(Pjv = ValueArea(Pleaf, MaxPop1);) \ - \ - for (ldigit = 0; ldigit < cJU_BRANCHUNUMJPS; ++ldigit, ++Pjp2) \ - { \ - /* fast-process common types: */ \ - if (JU_JPTYPE(Pjp2) == (NullJPType)) continue; \ - CopyImmed(cLevel, Pjp2, CopyIndex); \ - \ - pop1 = LeafToLeaf(Pleaf, JU_PVALUEPASS Pjp2, \ - JU_DIGITTOSTATE(ldigit, cLevel), \ - (Pvoid_t) Pjpm); \ - Pleaf = (LeafType) (((Word_t) Pleaf) + ((cLevel) * pop1)); \ - JUDYLCODE(Pjv += pop1;) \ - } \ - assert(((((Word_t) Pleaf) - ((Word_t) Pjllnew)) / (cLevel)) == (MaxPop1)); \ - JUDYLCODE(assert((Pjv - ValueArea(Pjllnew, MaxPop1)) == (MaxPop1));) \ - DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cLevel);) \ - \ - j__udyFreeJBU(PjbuRaw, Pjpm); \ - \ - Pjp->jp_Type = (NewJPType); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - goto ContinueDelWalk; /* delete from new leaf */ \ - } - -// Overall common code for initial BranchU deletion handling: -// -// Assert that Index is in the branch, then see if a BranchU should be kept or -// else compressed to a leaf. Variables level, Index, Pjp, and pop1 are in the -// context. -// -// Note: BranchU handling differs from BranchL and BranchB as described above. - -#define JU_BRANCHU(cLevel,MaxPop1,LeafType,NullJPType,NewJPType, \ - LeafToLeaf,Alloc,ValueArea,CopyImmed,CopyIndex) \ - \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel)); \ - assert(ParentLevel > (cLevel)); \ - DBGCODE(parentJPtype = JU_JPTYPE(Pjp);) \ - \ - pop1 = JU_JPBRANCH_POP0(Pjp, cLevel) + 1; \ - \ - if (pop1 > (MaxPop1)) /* hysteresis = 1 */ \ - { \ - level = (cLevel); \ - Pjp = P_JP(Pjp->jp_Addr) + JU_DIGITATSTATE(Index, cLevel);\ - break; /* descend to next level */ \ - } \ - assert(pop1 == (MaxPop1)); \ - \ - JU_BRANCHU_COMPRESS(cLevel, LeafType, MaxPop1, NullJPType, NewJPType, \ - LeafToLeaf, Alloc, ValueArea, CopyImmed, CopyIndex) - - -// END OF MACROS, START OF CASES: -// -// Note: Its no accident that the macro calls for these cases is nearly -// identical to the code for BranchLs, with the addition of cJU_JPNULL* -// parameters only needed for BranchUs. - - case cJU_JPBRANCH_U2: - - JU_BRANCHU(2, cJU_LEAF2_MAXPOP1, uint16_t *, - cJU_JPNULL1, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_U3: - - JU_BRANCHU(3, cJU_LEAF3_MAXPOP1, uint8_t *, - cJU_JPNULL2, cJU_JPLEAF3, - j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY3_LONG_TO_PINDEX); - -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: - - JU_BRANCHU(4, cJU_LEAF4_MAXPOP1, uint32_t *, - cJU_JPNULL3, cJU_JPLEAF4, - j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA, - JU_BRANCH_COPY_IMMED_EVEN, ignore); - - case cJU_JPBRANCH_U5: - - JU_BRANCHU(5, cJU_LEAF5_MAXPOP1, uint8_t *, - cJU_JPNULL4, cJU_JPLEAF5, - j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY5_LONG_TO_PINDEX); - - case cJU_JPBRANCH_U6: - - JU_BRANCHU(6, cJU_LEAF6_MAXPOP1, uint8_t *, - cJU_JPNULL5, cJU_JPLEAF6, - j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY6_LONG_TO_PINDEX); - - case cJU_JPBRANCH_U7: - - JU_BRANCHU(7, cJU_LEAF7_MAXPOP1, uint8_t *, - cJU_JPNULL6, cJU_JPLEAF7, - j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA, - JU_BRANCH_COPY_IMMED_ODD, JU_COPY7_LONG_TO_PINDEX); -#endif // JU_64BIT - -// A top-level BranchU is different and cannot use JU_BRANCHU(): Dont try to -// compress to a (LEAFW) leaf yet, but leave this for a later deletion -// (hysteresis > 0); just descend through the BranchU: - - case cJU_JPBRANCH_U: - - DBGCODE(parentJPtype = JU_JPTYPE(Pjp);) - - level = cJU_ROOTSTATE; - Pjp = P_JP(Pjp->jp_Addr) + JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - break; - - -// **************************************************************************** -// LINEAR LEAF: -// -// State transitions while deleting an Index, the inverse of the similar table -// that appears in JudyIns.c: -// -// Note: In JudyIns.c this table is not needed and does not appear until the -// Immed handling code; because once a Leaf is reached upon growing the tree, -// the situation remains simpler, but for deleting indexes, the complexity -// arises when leaves must compress to Immeds. -// -// Note: There are other transitions possible too, not shown here, such as to -// a leaf one level higher. -// -// (Yes, this is very terse... Study it and it will make sense.) -// (Note, parts of this diagram are repeated below for quick reference.) -// -// reformat JP here for Judy1 only, from word-1 to word-2 -// | -// JUDY1 && JU_64BIT JUDY1 || JU_64BIT | -// V -// (*) Leaf1 [[ => 1_15..08 ] => 1_07 => ... => 1_04 ] => 1_03 => 1_02 => 1_01 -// Leaf2 [[ => 2_07..04 ] => 2_03 => 2_02 ] => 2_01 -// Leaf3 [[ => 3_05..03 ] => 3_02 ] => 3_01 -// JU_64BIT only: -// Leaf4 [[ => 4_03..02 ]] => 4_01 -// Leaf5 [[ => 5_03..02 ]] => 5_01 -// Leaf6 [[ => 6_02 ]] => 6_01 -// Leaf7 [[ => 7_02 ]] => 7_01 -// -// (*) For Judy1 & 64-bit, go directly from a LeafB1 to cJU_JPIMMED_1_15; skip -// Leaf1, as described in Judy1.h regarding cJ1_JPLEAF1. -// -// MACROS FOR COMMON CODE: -// -// (De)compress a LeafX into a LeafY one index size (cIS) larger (X+1 = Y): -// -// This is only possible when the current leaf is under a narrow pointer -// ((ParentLevel - 1) > cIS) and its population fits in a higher-level leaf. -// Variables ParentLevel, pop1, PjllnewRaw, Pjllnew, Pjpm, and Index are in the -// context. -// -// Note: Doing an "uplevel" doesnt occur until the old leaf can be compressed -// up one level BEFORE deleting an index; that is, hysteresis = 1. -// -// Note: LeafType, MaxPop1, NewJPType, and Alloc refer to the up-level leaf, -// not the current leaf. -// -// Note: 010327: Fixed bug where the jp_DcdPopO next-uplevel digit (byte) -// above the current Pop0 value was not being cleared. When upleveling, one -// digit in jp_DcdPopO "moves" from being part of the Dcd subfield to the Pop0 -// subfield, but since a leaf maxpop1 is known to be <= 1 byte in size, the new -// Pop0 byte should always be zero. This is easy to overlook because -// JU_JPLEAF_POP0() "knows" to only use the LSB of Pop0 (for efficiency) and -// ignore the other bytes... Until someone uses cJU_POP0MASK() instead of -// JU_JPLEAF_POP0(), such as in JudyInsertBranch.c. -// -// TBD: Should JudyInsertBranch.c use JU_JPLEAF_POP0() rather than -// cJU_POP0MASK(), for efficiency? Does it know for sure its a narrow pointer -// under the leaf? Not necessarily. - -#define JU_LEAF_UPLEVEL(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) \ - \ - assert(((ParentLevel - 1) == (cIS)) || (pop1 >= (MaxPop1))); \ - \ - if (((ParentLevel - 1) > (cIS)) /* under narrow pointer */ \ - && (pop1 == (MaxPop1))) /* hysteresis = 1 */ \ - { \ - Word_t D_cdP0; \ - if ((PjllnewRaw = Alloc(MaxPop1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - JUDYLCODE(Pjv = ValueArea((LeafType) Pjllnew, MaxPop1);) \ - \ - (void) LeafToLeaf((LeafType) Pjllnew, JU_PVALUEPASS Pjp, \ - Index & cJU_DCDMASK(cIS), /* TBD, Doug says */ \ - (Pvoid_t) Pjpm); \ - DBGCODE(JudyCheckSorted(Pjllnew, MaxPop1, cIS + 1);) \ - \ - D_cdP0 = (~cJU_MASKATSTATE((cIS) + 1)) & JU_JPDCDPOP0(Pjp); \ - JU_JPSETADT(Pjp, (Word_t)PjllnewRaw, D_cdP0, NewJPType); \ - goto ContinueDelWalk; /* delete from new leaf */ \ - } - - -// For Leaf3, only support JU_LEAF_UPLEVEL on a 64-bit system, and for Leaf7, -// there is no JU_LEAF_UPLEVEL: -// -// Note: Theres no way here to go from Leaf3 [Leaf7] to LEAFW on a 32-bit -// [64-bit] system. Thats handled in the main code, because its different in -// that a JPM is involved. - -#ifndef JU_64BIT // 32-bit. -#define JU_LEAF_UPLEVEL64(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) // null. -#else -#define JU_LEAF_UPLEVEL64(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) \ - JU_LEAF_UPLEVEL (cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) -#define JU_LEAF_UPLEVEL_NONE(cIS,LeafType,MaxPop1,NewJPType,LeafToLeaf, \ - Alloc,ValueArea) // null. -#endif - -// Compress a Leaf* with pop1 = 2, or a JPIMMED_*_02, into a JPIMMED_*_01: -// -// Copy whichever Index is NOT being deleted (and assert that the other one is -// found; Index must be valid). This requires special handling of the Index -// bytes (and value area). Variables Pjp, Index, offset, and Pleaf are in the -// context, offset is modified to the undeleted Index, and Pjp is modified -// including jp_Addr. - - -#define JU_TOIMMED_01_EVEN(cIS,ignore1,ignore2) \ -{ \ - Word_t D_cdP0; \ - Word_t A_ddr = 0; \ - uint8_t T_ype = JU_JPTYPE(Pjp); \ - offset = (Pleaf[0] == JU_LEASTBYTES(Index, cIS)); /* undeleted Ind */ \ - assert(Pleaf[offset ? 0 : 1] == JU_LEASTBYTES(Index, cIS)); \ - D_cdP0 = (Index & cJU_DCDMASK(cIS)) | Pleaf[offset]; \ -JUDYLCODE(A_ddr = Pjv[offset];) \ - JU_JPSETADT(Pjp, A_ddr, D_cdP0, T_ype); \ -} - -#define JU_TOIMMED_01_ODD(cIS,SearchLeaf,CopyPIndex) \ - { \ - Word_t D_cdP0; \ - Word_t A_ddr = 0; \ - uint8_t T_ype = JU_JPTYPE(Pjp); \ - \ - offset = SearchLeaf(Pleaf, 2, Index); \ - assert(offset >= 0); /* Index must be valid */ \ - CopyPIndex(D_cdP0, & (Pleaf[offset ? 0 : cIS])); \ - D_cdP0 |= Index & cJU_DCDMASK(cIS); \ - JUDYLCODE(A_ddr = Pjv[offset ? 0 : 1];) \ - JU_JPSETADT(Pjp, A_ddr, D_cdP0, T_ype); \ - } - - -// Compress a Leaf* into a JPIMMED_*_0[2+]: -// -// This occurs as soon as its possible, with hysteresis = 0. Variables pop1, -// Pleaf, offset, and Pjpm are in the context. -// -// TBD: Explain why hysteresis = 0 here, rather than > 0. Probably because -// the insert code assumes if the population is small enough, an Immed is used, -// not a leaf. -// -// The differences between Judy1 and JudyL with respect to value area handling -// are just too large for completely common code between them... Oh well, some -// big ifdefs follow. - -#ifdef JUDY1 - -#define JU_LEAF_TOIMMED(cIS,LeafType,MaxPop1,BaseJPType,ignore1,\ - ignore2,ignore3,ignore4, \ - DeleteCopy,FreeLeaf) \ - \ - assert(pop1 > (MaxPop1)); \ - \ - if ((pop1 - 1) == (MaxPop1)) /* hysteresis = 0 */ \ - { \ - Pjll_t PjllRaw = (Pjll_t) (Pjp->jp_Addr); \ - DeleteCopy((LeafType) (Pjp->jp_1Index), Pleaf, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted((Pjll_t) (Pjp->jp_1Index), pop1-1, cIS);) \ - Pjp->jp_Type = (BaseJPType) - 1 + (MaxPop1) - 1; \ - FreeLeaf(PjllRaw, pop1, Pjpm); \ - return(1); \ - } - -#else // JUDYL - -// Pjv is also in the context. - -#define JU_LEAF_TOIMMED(cIS,LeafType,MaxPop1,BaseJPType,ignore1,\ - ignore2,ignore3,ignore4, \ - DeleteCopy,FreeLeaf) \ - \ - assert(pop1 > (MaxPop1)); \ - \ - if ((pop1 - 1) == (MaxPop1)) /* hysteresis = 0 */ \ - { \ - Pjll_t PjllRaw = (Pjll_t) (Pjp->jp_Addr); \ - Pjv_t PjvnewRaw; \ - Pjv_t Pjvnew; \ - \ - if ((PjvnewRaw = j__udyLAllocJV(pop1 - 1, Pjpm)) \ - == (Pjv_t) NULL) return(-1); \ - JUDYLCODE(Pjvnew = P_JV(PjvnewRaw);) \ - \ - DeleteCopy((LeafType) (Pjp->jp_LIndex), Pleaf, pop1, offset, cIS); \ - JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted((Pjll_t) (Pjp->jp_LIndex), pop1-1, cIS);) \ - FreeLeaf(PjllRaw, pop1, Pjpm); \ - Pjp->jp_Addr = (Word_t) PjvnewRaw; \ - Pjp->jp_Type = (BaseJPType) - 2 + (MaxPop1); \ - return(1); \ - } - -// A complicating factor for JudyL & 32-bit is that Leaf2..3, and for JudyL & -// 64-bit Leaf 4..7, go directly to an Immed*_01, where the value is stored in -// jp_Addr and not in a separate LeafV. For efficiency, use the following -// macro in cases where it can apply; it is rigged to do the right thing. -// Unfortunately, this requires the calling code to "know" the transition table -// and call the right macro. -// -// This variant compresses a Leaf* with pop1 = 2 into a JPIMMED_*_01: - -#define JU_LEAF_TOIMMED_01(cIS,LeafType,MaxPop1,ignore,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - \ - assert(pop1 > (MaxPop1)); \ - \ - if ((pop1 - 1) == (MaxPop1)) /* hysteresis = 0 */ \ - { \ - Pjll_t PjllRaw = (Pjll_t) (Pjp->jp_Addr); \ - ToImmed(cIS, SearchLeaf, CopyPIndex); \ - FreeLeaf(PjllRaw, pop1, Pjpm); \ - Pjp->jp_Type = (Immed01JPType); \ - return(1); \ - } -#endif // JUDYL - -// See comments above about these: -// -// Note: Here "23" means index size 2 or 3, and "47" means 4..7. - -#if (defined(JUDY1) || defined(JU_64BIT)) -#define JU_LEAF_TOIMMED_23(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - JU_LEAF_TOIMMED( cIS,LeafType,MaxPop1,BaseJPType,ignore1, \ - ignore2,ignore3,ignore4, \ - DeleteCopy,FreeLeaf) -#else // JUDYL && 32-bit -#define JU_LEAF_TOIMMED_23(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - JU_LEAF_TOIMMED_01(cIS,LeafType,MaxPop1,ignore,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) -#endif - -#ifdef JU_64BIT -#ifdef JUDY1 -#define JU_LEAF_TOIMMED_47(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - JU_LEAF_TOIMMED( cIS,LeafType,MaxPop1,BaseJPType,ignore1, \ - ignore2,ignore3,ignore4, \ - DeleteCopy,FreeLeaf) -#else // JUDYL && 64-bit -#define JU_LEAF_TOIMMED_47(cIS,LeafType,MaxPop1,BaseJPType,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) \ - JU_LEAF_TOIMMED_01(cIS,LeafType,MaxPop1,ignore,Immed01JPType, \ - ToImmed,SearchLeaf,CopyPIndex, \ - DeleteCopy,FreeLeaf) -#endif // JUDYL -#endif // JU_64BIT - -// Compress a Leaf* in place: -// -// Here hysteresis = 0 (no memory is wasted). Variables pop1, Pleaf, and -// offset, and for JudyL, Pjv, are in the context. - -#ifdef JUDY1 -#define JU_LEAF_INPLACE(cIS,GrowInPlace,DeleteInPlace) \ - if (GrowInPlace(pop1 - 1)) /* hysteresis = 0 */ \ - { \ - DeleteInPlace(Pleaf, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) \ - return(1); \ - } -#else -#define JU_LEAF_INPLACE(cIS,GrowInPlace,DeleteInPlace) \ - if (GrowInPlace(pop1 - 1)) /* hysteresis = 0 */ \ - { \ - DeleteInPlace(Pleaf, pop1, offset, cIS); \ -/**/ JU_DELETEINPLACE(Pjv, pop1, offset, ignore); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) \ - return(1); \ - } -#endif - -// Compress a Leaf* into a smaller memory object of the same JP type: -// -// Variables PjllnewRaw, Pjllnew, Pleafpop1, Pjpm, PleafRaw, Pleaf, and offset -// are in the context. - -#ifdef JUDY1 - -#define JU_LEAF_SHRINK(cIS,LeafType,DeleteCopy,Alloc,FreeLeaf,ValueArea) \ - if ((PjllnewRaw = Alloc(pop1 - 1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ - DeleteCopy((LeafType) Pjllnew, Pleaf, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted(Pjllnew, pop1 - 1, cIS);) \ - FreeLeaf(PleafRaw, pop1, Pjpm); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - return(1) - -#else // JUDYL - -#define JU_LEAF_SHRINK(cIS,LeafType,DeleteCopy,Alloc,FreeLeaf,ValueArea) \ - { \ -/**/ Pjv_t Pjvnew; \ - \ - if ((PjllnewRaw = Alloc(pop1 - 1, Pjpm)) == 0) return(-1); \ - Pjllnew = P_JLL(PjllnewRaw); \ -/**/ Pjvnew = ValueArea(Pjllnew, pop1 - 1); \ - DeleteCopy((LeafType) Pjllnew, Pleaf, pop1, offset, cIS); \ -/**/ JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted(Pjllnew, pop1 - 1, cIS);) \ - FreeLeaf(PleafRaw, pop1, Pjpm); \ - Pjp->jp_Addr = (Word_t) PjllnewRaw; \ - return(1); \ - } -#endif // JUDYL - -// Overall common code for Leaf* deletion handling: -// -// See if the leaf can be: -// - (de)compressed to one a level higher (JU_LEAF_UPLEVEL()), or if not, -// - compressed to an Immediate JP (JU_LEAF_TOIMMED()), or if not, -// - shrunk in place (JU_LEAF_INPLACE()), or if none of those, then -// - shrink the leaf to a smaller chunk of memory (JU_LEAF_SHRINK()). -// -// Variables Pjp, pop1, Index, and offset are in the context. -// The *Up parameters refer to a leaf one level up, if there is any. - -#define JU_LEAF(cIS, \ - UpLevel, \ - LeafTypeUp,MaxPop1Up,LeafJPTypeUp,LeafToLeaf, \ - AllocUp,ValueAreaUp, \ - LeafToImmed,ToImmed,CopyPIndex, \ - LeafType,ImmedMaxPop1,ImmedBaseJPType,Immed01JPType, \ - SearchLeaf,GrowInPlace,DeleteInPlace,DeleteCopy, \ - Alloc,FreeLeaf,ValueArea) \ - { \ - Pjll_t PleafRaw; \ - LeafType Pleaf; \ - \ - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, cIS)); \ - assert(ParentLevel > (cIS)); \ - \ - PleafRaw = (Pjll_t) (Pjp->jp_Addr); \ - Pleaf = (LeafType) P_JLL(PleafRaw); \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - \ - UpLevel(cIS, LeafTypeUp, MaxPop1Up, LeafJPTypeUp, \ - LeafToLeaf, AllocUp, ValueAreaUp); \ - \ - offset = SearchLeaf(Pleaf, pop1, Index); \ - assert(offset >= 0); /* Index must be valid */ \ - JUDYLCODE(Pjv = ValueArea(Pleaf, pop1);) \ - \ - LeafToImmed(cIS, LeafType, ImmedMaxPop1, \ - ImmedBaseJPType, Immed01JPType, \ - ToImmed, SearchLeaf, CopyPIndex, \ - DeleteCopy, FreeLeaf); \ - \ - JU_LEAF_INPLACE(cIS, GrowInPlace, DeleteInPlace); \ - \ - JU_LEAF_SHRINK(cIS, LeafType, DeleteCopy, Alloc, FreeLeaf, \ - ValueArea); \ - } - -// END OF MACROS, START OF CASES: -// -// (*) Leaf1 [[ => 1_15..08 ] => 1_07 => ... => 1_04 ] => 1_03 => 1_02 => 1_01 - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - JU_LEAF(1, - JU_LEAF_UPLEVEL, uint16_t *, cJU_LEAF2_MAXPOP1, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, JL_LEAF2VALUEAREA, - JU_LEAF_TOIMMED, ignore, ignore, - uint8_t *, cJU_IMMED1_MAXPOP1, - cJU_JPIMMED_1_02, cJU_JPIMMED_1_01, j__udySearchLeaf1, - JU_LEAF1GROWINPLACE, JU_DELETEINPLACE, JU_DELETECOPY, - j__udyAllocJLL1, j__udyFreeJLL1, JL_LEAF1VALUEAREA); -#endif - -// A complicating factor is that for JudyL & 32-bit, a Leaf2 must go directly -// to an Immed 2_01 and a Leaf3 must go directly to an Immed 3_01: -// -// Leaf2 [[ => 2_07..04 ] => 2_03 => 2_02 ] => 2_01 -// Leaf3 [[ => 3_05..03 ] => 3_02 ] => 3_01 -// -// Hence use JU_LEAF_TOIMMED_23 instead of JU_LEAF_TOIMMED in the cases below, -// and also the parameters ToImmed and, for odd index sizes, CopyPIndex, are -// required. - - case cJU_JPLEAF2: - - JU_LEAF(2, - JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF3_MAXPOP1, cJU_JPLEAF3, - j__udyLeaf2ToLeaf3, j__udyAllocJLL3, JL_LEAF3VALUEAREA, - JU_LEAF_TOIMMED_23, JU_TOIMMED_01_EVEN, ignore, - uint16_t *, cJU_IMMED2_MAXPOP1, - cJU_JPIMMED_2_02, cJU_JPIMMED_2_01, j__udySearchLeaf2, - JU_LEAF2GROWINPLACE, JU_DELETEINPLACE, JU_DELETECOPY, - j__udyAllocJLL2, j__udyFreeJLL2, JL_LEAF2VALUEAREA); - -// On 32-bit there is no transition to "uplevel" for a Leaf3, so use -// JU_LEAF_UPLEVEL64 instead of JU_LEAF_UPLEVEL: - - case cJU_JPLEAF3: - - JU_LEAF(3, - JU_LEAF_UPLEVEL64, uint32_t *, cJU_LEAF4_MAXPOP1, - cJU_JPLEAF4, - j__udyLeaf3ToLeaf4, j__udyAllocJLL4, JL_LEAF4VALUEAREA, - JU_LEAF_TOIMMED_23, - JU_TOIMMED_01_ODD, JU_COPY3_PINDEX_TO_LONG, - uint8_t *, cJU_IMMED3_MAXPOP1, - cJU_JPIMMED_3_02, cJU_JPIMMED_3_01, j__udySearchLeaf3, - JU_LEAF3GROWINPLACE, JU_DELETEINPLACE_ODD, - JU_DELETECOPY_ODD, - j__udyAllocJLL3, j__udyFreeJLL3, JL_LEAF3VALUEAREA); - -#ifdef JU_64BIT - -// A complicating factor is that for JudyL & 64-bit, a Leaf[4-7] must go -// directly to an Immed [4-7]_01: -// -// Leaf4 [[ => 4_03..02 ]] => 4_01 -// Leaf5 [[ => 5_03..02 ]] => 5_01 -// Leaf6 [[ => 6_02 ]] => 6_01 -// Leaf7 [[ => 7_02 ]] => 7_01 -// -// Hence use JU_LEAF_TOIMMED_47 instead of JU_LEAF_TOIMMED in the cases below. - - case cJU_JPLEAF4: - - JU_LEAF(4, - JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF5_MAXPOP1, cJU_JPLEAF5, - j__udyLeaf4ToLeaf5, j__udyAllocJLL5, JL_LEAF5VALUEAREA, - JU_LEAF_TOIMMED_47, JU_TOIMMED_01_EVEN, ignore, - uint32_t *, cJU_IMMED4_MAXPOP1, - cJ1_JPIMMED_4_02, cJU_JPIMMED_4_01, j__udySearchLeaf4, - JU_LEAF4GROWINPLACE, JU_DELETEINPLACE, JU_DELETECOPY, - j__udyAllocJLL4, j__udyFreeJLL4, JL_LEAF4VALUEAREA); - - case cJU_JPLEAF5: - - JU_LEAF(5, - JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF6_MAXPOP1, cJU_JPLEAF6, - j__udyLeaf5ToLeaf6, j__udyAllocJLL6, JL_LEAF6VALUEAREA, - JU_LEAF_TOIMMED_47, - JU_TOIMMED_01_ODD, JU_COPY5_PINDEX_TO_LONG, - uint8_t *, cJU_IMMED5_MAXPOP1, - cJ1_JPIMMED_5_02, cJU_JPIMMED_5_01, j__udySearchLeaf5, - JU_LEAF5GROWINPLACE, JU_DELETEINPLACE_ODD, - JU_DELETECOPY_ODD, - j__udyAllocJLL5, j__udyFreeJLL5, JL_LEAF5VALUEAREA); - - case cJU_JPLEAF6: - - JU_LEAF(6, - JU_LEAF_UPLEVEL, uint8_t *, cJU_LEAF7_MAXPOP1, cJU_JPLEAF7, - j__udyLeaf6ToLeaf7, j__udyAllocJLL7, JL_LEAF7VALUEAREA, - JU_LEAF_TOIMMED_47, - JU_TOIMMED_01_ODD, JU_COPY6_PINDEX_TO_LONG, - uint8_t *, cJU_IMMED6_MAXPOP1, - cJ1_JPIMMED_6_02, cJU_JPIMMED_6_01, j__udySearchLeaf6, - JU_LEAF6GROWINPLACE, JU_DELETEINPLACE_ODD, - JU_DELETECOPY_ODD, - j__udyAllocJLL6, j__udyFreeJLL6, JL_LEAF6VALUEAREA); - -// There is no transition to "uplevel" for a Leaf7, so use JU_LEAF_UPLEVEL_NONE -// instead of JU_LEAF_UPLEVEL, and ignore all of the parameters to that macro: - - case cJU_JPLEAF7: - - JU_LEAF(7, - JU_LEAF_UPLEVEL_NONE, ignore1, ignore2, ignore3, ignore4, - ignore5, ignore6, - JU_LEAF_TOIMMED_47, - JU_TOIMMED_01_ODD, JU_COPY7_PINDEX_TO_LONG, - uint8_t *, cJU_IMMED7_MAXPOP1, - cJ1_JPIMMED_7_02, cJU_JPIMMED_7_01, j__udySearchLeaf7, - JU_LEAF7GROWINPLACE, JU_DELETEINPLACE_ODD, - JU_DELETECOPY_ODD, - j__udyAllocJLL7, j__udyFreeJLL7, JL_LEAF7VALUEAREA); -#endif // JU_64BIT - - -// **************************************************************************** -// BITMAP LEAF: - - case cJU_JPLEAF_B1: - { -#ifdef JUDYL - Pjv_t PjvnewRaw; // new value area. - Pjv_t Pjvnew; - Word_t subexp; // 1 of 8 subexpanses in bitmap. - Pjlb_t Pjlb; // pointer to bitmap part of the leaf. - BITMAPL_t bitmap; // for one subexpanse. - BITMAPL_t bitmask; // bit set for Indexs digit. -#endif - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, 1)); - assert(ParentLevel > 1); - // valid Index: - assert(JU_BITMAPTESTL(P_JLB(Pjp->jp_Addr), Index)); - - pop1 = JU_JPLEAF_POP0(Pjp) + 1; - -// Like a Leaf1, see if its under a narrow pointer and can become a Leaf2 -// (hysteresis = 1): - - JU_LEAF_UPLEVEL(1, uint16_t *, cJU_LEAF2_MAXPOP1, cJU_JPLEAF2, - j__udyLeaf1ToLeaf2, j__udyAllocJLL2, - JL_LEAF2VALUEAREA); - -#if (defined(JUDY1) && defined(JU_64BIT)) - -// Handle the unusual special case, on Judy1 64-bit only, where a LeafB1 goes -// directly to a JPIMMED_1_15; as described in comments in Judy1.h and -// JudyIns.c. Copy 1-byte indexes from old LeafB1 to the Immed: - - if ((pop1 - 1) == cJU_IMMED1_MAXPOP1) // hysteresis = 0. - { - Pjlb_t PjlbRaw; // bitmap in old leaf. - Pjlb_t Pjlb; - uint8_t * Pleafnew; // JPIMMED as a pointer. - Word_t ldigit; // larger than uint8_t. - - PjlbRaw = (Pjlb_t) (Pjp->jp_Addr); - Pjlb = P_JLB(PjlbRaw); - Pleafnew = Pjp->jp_1Index; - - JU_BITMAPCLEARL(Pjlb, Index); // unset Indexs bit. - -// TBD: This is very slow, there must be a better way: - - for (ldigit = 0; ldigit < cJU_BRANCHUNUMJPS; ++ldigit) - { - if (JU_BITMAPTESTL(Pjlb, ldigit)) - { - *Pleafnew++ = ldigit; - assert(Pleafnew - (Pjp->jp_1Index) - <= cJU_IMMED1_MAXPOP1); - } - } - - DBGCODE(JudyCheckSorted((Pjll_t) (Pjp->jp_1Index), - cJU_IMMED1_MAXPOP1, 1);) - j__udyFreeJLB1(PjlbRaw, Pjpm); - - Pjp->jp_Type = cJ1_JPIMMED_1_15; - return(1); - } - -#else // (JUDYL || (! JU_64BIT)) - -// Compress LeafB1 to a Leaf1: -// -// Note: 4.37 of this file contained alternate code for Judy1 only that simply -// cleared the bit and allowed the LeafB1 to go below cJU_LEAF1_MAXPOP1. This -// was the ONLY case where a malloc failure was not fatal; however, it violated -// the critical assumption that the tree is always kept in least-compressed -// form. - - if (pop1 == cJU_LEAF1_MAXPOP1) // hysteresis = 1. - { - if (j__udyLeafB1ToLeaf1(Pjp, Pjpm) == -1) return(-1); - goto ContinueDelWalk; // delete Index in new Leaf1. - } -#endif // (JUDYL || (! JU_64BIT)) - -#ifdef JUDY1 - // unset Indexs bit: - - JU_BITMAPCLEARL(P_JLB(Pjp->jp_Addr), Index); -#else // JUDYL - -// This is very different from Judy1 because of the need to manage the value -// area: -// -// Get last byte to decode from Index, and pointer to bitmap leaf: - - digit = JU_DIGITATSTATE(Index, 1); - Pjlb = P_JLB(Pjp->jp_Addr); - -// Prepare additional values: - - subexp = digit / cJU_BITSPERSUBEXPL; // which subexpanse. - bitmap = JU_JLB_BITMAP(Pjlb, subexp); // subexps 32-bit map. - PjvRaw = JL_JLB_PVALUE(Pjlb, subexp); // corresponding values. - Pjv = P_JV(PjvRaw); - bitmask = JU_BITPOSMASKL(digit); // mask for Index. - - assert(bitmap & bitmask); // Index must be valid. - - if (bitmap == cJU_FULLBITMAPL) // full bitmap, take shortcut: - { - pop1 = cJU_BITSPERSUBEXPL; - offset = digit % cJU_BITSPERSUBEXPL; - } - else // compute subexpanse pop1 and value area offset: - { - pop1 = j__udyCountBitsL(bitmap); - offset = j__udyCountBitsL(bitmap & (bitmask - 1)); - } - -// Handle solitary Index remaining in subexpanse: - - if (pop1 == 1) - { - j__udyLFreeJV(PjvRaw, 1, Pjpm); - - JL_JLB_PVALUE(Pjlb, subexp) = (Pjv_t) NULL; - JU_JLB_BITMAP(Pjlb, subexp) = 0; - - return(1); - } - -// Shrink value area in place or move to a smaller value area: - - if (JL_LEAFVGROWINPLACE(pop1 - 1)) // hysteresis = 0. - { - JU_DELETEINPLACE(Pjv, pop1, offset, ignore); - } - else - { - if ((PjvnewRaw = j__udyLAllocJV(pop1 - 1, Pjpm)) - == (Pjv_t) NULL) return(-1); - Pjvnew = P_JV(PjvnewRaw); - - JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, ignore); - j__udyLFreeJV(PjvRaw, pop1, Pjpm); - JL_JLB_PVALUE(Pjlb, subexp) = (Pjv_t) PjvnewRaw; - } - - JU_JLB_BITMAP(Pjlb, subexp) ^= bitmask; // clear Indexs bit. - -#endif // JUDYL - - return(1); - - } // case. - - -#ifdef JUDY1 - -// **************************************************************************** -// FULL POPULATION LEAF: -// -// Convert to a LeafB1 and delete the index. Hysteresis = 0; none is possible. -// -// Note: Earlier the second assertion below said, "== 2", but in fact the -// parent could be at a higher level if a fullpop is under a narrow pointer. - - case cJ1_JPFULLPOPU1: - { - Pjlb_t PjlbRaw; - Pjlb_t Pjlb; - Word_t subexp; - - assert(! JU_DCDNOTMATCHINDEX(Index, Pjp, 2)); - assert(ParentLevel > 1); // see above. - - if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL) - return(-1); - Pjlb = P_JLB(PjlbRaw); - -// Fully populate the leaf, then unset Indexs bit: - - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - JU_JLB_BITMAP(Pjlb, subexp) = cJU_FULLBITMAPL; - - JU_BITMAPCLEARL(Pjlb, Index); - - Pjp->jp_Addr = (Word_t) PjlbRaw; - Pjp->jp_Type = cJU_JPLEAF_B1; - - return(1); - } -#endif // JUDY1 - - -// **************************************************************************** -// IMMEDIATE JP: -// -// If theres just the one Index in the Immed, convert the JP to a JPNULL* -// (should only happen in a BranchU); otherwise delete the Index from the -// Immed. See the state transitions table elsewhere in this file for a summary -// of which Immed types must be handled. Hysteresis = 0; none is possible with -// Immeds. -// -// MACROS FOR COMMON CODE: -// -// Single Index remains in cJU_JPIMMED_*_01; convert JP to null: -// -// Variables Pjp and parentJPtype are in the context. -// -// Note: cJU_JPIMMED_*_01 should only be encountered in BranchUs, not in -// BranchLs or BranchBs (where its improper to merely modify the JP to be a -// null JP); that is, BranchL and BranchB code should have already handled -// any cJU_JPIMMED_*_01 by different means. - -#define JU_IMMED_01(NewJPType,ParentJPType) \ - \ - assert(parentJPtype == (ParentJPType)); \ - assert(JU_JPDCDPOP0(Pjp) == JU_TRIMTODCDSIZE(Index)); \ - JU_JPSETADT(Pjp, 0, 0, NewJPType); \ - return(1) - -// Convert cJ*_JPIMMED_*_02 to cJU_JPIMMED_*_01: -// -// Move the undeleted Index, whichever does not match the least bytes of Index, -// from undecoded-bytes-only (in jp_1Index or jp_LIndex as appropriate) to -// jp_DcdPopO (full-field). Pjp, Index, and offset are in the context. - -#define JU_IMMED_02(cIS,LeafType,NewJPType) \ - { \ - LeafType Pleaf; \ - \ - assert((ParentLevel - 1) == (cIS)); \ - JUDY1CODE(Pleaf = (LeafType) (Pjp->jp_1Index);) \ - JUDYLCODE(Pleaf = (LeafType) (Pjp->jp_LIndex);) \ - JUDYLCODE(PjvRaw = (Pjv_t) (Pjp->jp_Addr);) \ - JUDYLCODE(Pjv = P_JV(PjvRaw);) \ - JU_TOIMMED_01_EVEN(cIS, ignore, ignore); \ - JUDYLCODE(j__udyLFreeJV(PjvRaw, 2, Pjpm);) \ - Pjp->jp_Type = (NewJPType); \ - return(1); \ - } - -#if (defined(JUDY1) || defined(JU_64BIT)) - -// Variation for "odd" cJ*_JPIMMED_*_02 JP types, which are very different from -// "even" types because they use leaf search code and odd-copy macros: -// -// Note: JudyL 32-bit has no "odd" JPIMMED_*_02 types. - -#define JU_IMMED_02_ODD(cIS,NewJPType,SearchLeaf,CopyPIndex) \ - { \ - uint8_t * Pleaf; \ - \ - assert((ParentLevel - 1) == (cIS)); \ - JUDY1CODE(Pleaf = (uint8_t *) (Pjp->jp_1Index);) \ - JUDYLCODE(Pleaf = (uint8_t *) (Pjp->jp_LIndex);) \ - JUDYLCODE(PjvRaw = (Pjv_t) (Pjp->jp_Addr);) \ - JUDYLCODE(Pjv = P_JV(PjvRaw);) \ - JU_TOIMMED_01_ODD(cIS, SearchLeaf, CopyPIndex); \ - JUDYLCODE(j__udyLFreeJV(PjvRaw, 2, Pjpm);) \ - Pjp->jp_Type = (NewJPType); \ - return(1); \ - } -#endif // (JUDY1 || JU_64BIT) - -// Core code for deleting one Index (and for JudyL, its value area) from a -// larger Immed: -// -// Variables Pleaf, pop1, and offset are in the context. - -#ifdef JUDY1 -#define JU_IMMED_DEL(cIS,DeleteInPlace) \ - DeleteInPlace(Pleaf, pop1, offset, cIS); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) - -#else // JUDYL - -// For JudyL the value area might need to be shrunk: - -#define JU_IMMED_DEL(cIS,DeleteInPlace) \ - \ - if (JL_LEAFVGROWINPLACE(pop1 - 1)) /* hysteresis = 0 */ \ - { \ - DeleteInPlace( Pleaf, pop1, offset, cIS); \ - JU_DELETEINPLACE(Pjv, pop1, offset, ignore); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) \ - } \ - else \ - { \ - Pjv_t PjvnewRaw; \ - Pjv_t Pjvnew; \ - \ - if ((PjvnewRaw = j__udyLAllocJV(pop1 - 1, Pjpm)) \ - == (Pjv_t) NULL) return(-1); \ - Pjvnew = P_JV(PjvnewRaw); \ - \ - DeleteInPlace(Pleaf, pop1, offset, cIS); \ - JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, ignore); \ - DBGCODE(JudyCheckSorted(Pleaf, pop1 - 1, cIS);) \ - j__udyLFreeJV(PjvRaw, pop1, Pjpm); \ - \ - (Pjp->jp_Addr) = (Word_t) PjvnewRaw; \ - } -#endif // JUDYL - -// Delete one Index from a larger Immed where no restructuring is required: -// -// Variables pop1, Pjp, offset, and Index are in the context. - -#define JU_IMMED(cIS,LeafType,BaseJPType,SearchLeaf,DeleteInPlace) \ - { \ - LeafType Pleaf; \ - \ - assert((ParentLevel - 1) == (cIS)); \ - JUDY1CODE(Pleaf = (LeafType) (Pjp->jp_1Index);) \ - JUDYLCODE(Pleaf = (LeafType) (Pjp->jp_LIndex);) \ - JUDYLCODE(PjvRaw = (Pjv_t) (Pjp->jp_Addr);) \ - JUDYLCODE(Pjv = P_JV(PjvRaw);) \ - pop1 = (JU_JPTYPE(Pjp)) - (BaseJPType) + 2; \ - offset = SearchLeaf(Pleaf, pop1, Index); \ - assert(offset >= 0); /* Index must be valid */ \ - \ - JU_IMMED_DEL(cIS, DeleteInPlace); \ - --(Pjp->jp_Type); \ - return(1); \ - } - - -// END OF MACROS, START OF CASES: - -// Single Index remains in Immed; convert JP to null: - - case cJU_JPIMMED_1_01: JU_IMMED_01(cJU_JPNULL1, cJU_JPBRANCH_U2); - case cJU_JPIMMED_2_01: JU_IMMED_01(cJU_JPNULL2, cJU_JPBRANCH_U3); -#ifndef JU_64BIT - case cJU_JPIMMED_3_01: JU_IMMED_01(cJU_JPNULL3, cJU_JPBRANCH_U); -#else - case cJU_JPIMMED_3_01: JU_IMMED_01(cJU_JPNULL3, cJU_JPBRANCH_U4); - case cJU_JPIMMED_4_01: JU_IMMED_01(cJU_JPNULL4, cJU_JPBRANCH_U5); - case cJU_JPIMMED_5_01: JU_IMMED_01(cJU_JPNULL5, cJU_JPBRANCH_U6); - case cJU_JPIMMED_6_01: JU_IMMED_01(cJU_JPNULL6, cJU_JPBRANCH_U7); - case cJU_JPIMMED_7_01: JU_IMMED_01(cJU_JPNULL7, cJU_JPBRANCH_U); -#endif - -// Multiple Indexes remain in the Immed JP; delete the specified Index: - - case cJU_JPIMMED_1_02: - - JU_IMMED_02(1, uint8_t *, cJU_JPIMMED_1_01); - - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - JU_IMMED(1, uint8_t *, cJU_JPIMMED_1_02, - j__udySearchLeaf1, JU_DELETEINPLACE); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - - JU_IMMED_02(2, uint16_t *, cJU_JPIMMED_2_01); - - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - JU_IMMED(2, uint16_t *, cJU_JPIMMED_2_02, - j__udySearchLeaf2, JU_DELETEINPLACE); - - case cJU_JPIMMED_3_02: - - JU_IMMED_02_ODD(3, cJU_JPIMMED_3_01, - j__udySearchLeaf3, JU_COPY3_PINDEX_TO_LONG); - -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: - - JU_IMMED(3, uint8_t *, cJU_JPIMMED_3_02, - j__udySearchLeaf3, JU_DELETEINPLACE_ODD); - - case cJ1_JPIMMED_4_02: - - JU_IMMED_02(4, uint32_t *, cJU_JPIMMED_4_01); - - case cJ1_JPIMMED_4_03: - - JU_IMMED(4, uint32_t *, cJ1_JPIMMED_4_02, - j__udySearchLeaf4, JU_DELETEINPLACE); - - case cJ1_JPIMMED_5_02: - - JU_IMMED_02_ODD(5, cJU_JPIMMED_5_01, - j__udySearchLeaf5, JU_COPY5_PINDEX_TO_LONG); - - case cJ1_JPIMMED_5_03: - - JU_IMMED(5, uint8_t *, cJ1_JPIMMED_5_02, - j__udySearchLeaf5, JU_DELETEINPLACE_ODD); - - case cJ1_JPIMMED_6_02: - - JU_IMMED_02_ODD(6, cJU_JPIMMED_6_01, - j__udySearchLeaf6, JU_COPY6_PINDEX_TO_LONG); - - case cJ1_JPIMMED_7_02: - - JU_IMMED_02_ODD(7, cJU_JPIMMED_7_01, - j__udySearchLeaf7, JU_COPY7_PINDEX_TO_LONG); - -#endif // (JUDY1 && JU_64BIT) - - -// **************************************************************************** -// INVALID JP TYPE: - - default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); return(-1); - - } // switch - - -// PROCESS JP -- RECURSIVELY: -// -// For non-Immed JP types, if successful, post-decrement the population count -// at this level, or collapse a BranchL if necessary by copying the remaining -// JP in the BranchL to the parent (hysteresis = 0), which implicitly creates a -// narrow pointer if there was not already one in the hierarchy. - - assert(level); - retcode = j__udyDelWalk(Pjp, Index, level, Pjpm); - assert(retcode != 0); // should never happen. - - if ((JU_JPTYPE(Pjp)) < cJU_JPIMMED_1_01) // not an Immed. - { - switch (retcode) - { - case 1: - { - jp_t JP = *Pjp; - Word_t DcdP0; - - DcdP0 = JU_JPDCDPOP0(Pjp) - 1; // decrement count. - JU_JPSETADT(Pjp, JP.jp_Addr, DcdP0, JU_JPTYPE(&JP)); - break; - } - case 2: // collapse BranchL to single JP; see above: - { - Pjbl_t PjblRaw = (Pjbl_t) (Pjp->jp_Addr); - Pjbl_t Pjbl = P_JBL(PjblRaw); - - *Pjp = Pjbl->jbl_jp[0]; - j__udyFreeJBL(PjblRaw, Pjpm); - retcode = 1; - } - } - } - - return(retcode); - -} // j__udyDelWalk() - - -// **************************************************************************** -// J U D Y 1 U N S E T -// J U D Y L D E L -// -// Main entry point. See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1Unset -#else -FUNCTION int JudyLDel -#endif - ( - PPvoid_t PPArray, // in which to delete. - Word_t Index, // to delete. - PJError_t PJError // optional, for returning error info. - ) -{ - Word_t pop1; // population of leaf. - int offset; // at which to delete Index. - JUDY1CODE(int retcode;) // return code from Judy1Test(). -JUDYLCODE(PPvoid_t PPvalue;) // pointer from JudyLGet(). - - -// CHECK FOR NULL ARRAY POINTER (error by caller): - - if (PPArray == (PPvoid_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); - return(JERRI); - } - - -// CHECK IF INDEX IS INVALID: -// -// If so, theres nothing to do. This saves a lot of time. Pass through -// PJError, if any, from the "get" function. - -#ifdef JUDY1 - if ((retcode = Judy1Test(*PPArray, Index, PJError)) == JERRI) - return (JERRI); - - if (retcode == 0) return(0); -#else - if ((PPvalue = JudyLGet(*PPArray, Index, PJError)) == PPJERR) - return (JERRI); - - if (PPvalue == (PPvoid_t) NULL) return(0); -#endif - - -// **************************************************************************** -// PROCESS TOP LEVEL (LEAFW) BRANCHES AND LEAVES: - -// **************************************************************************** -// LEAFW LEAF, OTHER SIZE: -// -// Shrink or convert the leaf as necessary. Hysteresis = 0; none is possible. - - if (JU_LEAFW_POP0(*PPArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - JUDYLCODE(Pjv_t Pjv;) // current value area. - JUDYLCODE(Pjv_t Pjvnew;) // value area in new leaf. - Pjlw_t Pjlw = P_JLW(*PPArray); // first word of leaf. - Pjlw_t Pjlwnew; // replacement leaf. - pop1 = Pjlw[0] + 1; // first word of leaf is pop0. - -// Delete single (last) Index from array: - - if (pop1 == 1) - { - j__udyFreeJLW(Pjlw, /* pop1 = */ 1, (Pjpm_t) NULL); - *PPArray = (Pvoid_t) NULL; - return(1); - } - -// Locate Index in compressible leaf: - - offset = j__udySearchLeafW(Pjlw + 1, pop1, Index); - assert(offset >= 0); // Index must be valid. - - JUDYLCODE(Pjv = JL_LEAFWVALUEAREA(Pjlw, pop1);) - -// Delete Index in-place: -// -// Note: "Grow in place from pop1 - 1" is the logical inverse of, "shrink in -// place from pop1." Also, Pjlw points to the count word, so skip that for -// doing the deletion. - - if (JU_LEAFWGROWINPLACE(pop1 - 1)) - { - JU_DELETEINPLACE(Pjlw + 1, pop1, offset, ignore); -#ifdef JUDYL // also delete from value area: - JU_DELETEINPLACE(Pjv, pop1, offset, ignore); -#endif - DBGCODE(JudyCheckSorted((Pjll_t) (Pjlw + 1), pop1 - 1, - cJU_ROOTSTATE);) - --(Pjlw[0]); // decrement population. - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - } - -// Allocate new leaf for use in either case below: - - Pjlwnew = j__udyAllocJLW(pop1 - 1); - JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI); - -// Shrink to smaller LEAFW: -// -// Note: Skip the first word = pop0 in each leaf. - - Pjlwnew[0] = (pop1 - 1) - 1; - JU_DELETECOPY(Pjlwnew + 1, Pjlw + 1, pop1, offset, ignore); - -#ifdef JUDYL // also delete from value area: - Pjvnew = JL_LEAFWVALUEAREA(Pjlwnew, pop1 - 1); - JU_DELETECOPY(Pjvnew, Pjv, pop1, offset, ignore); -#endif - DBGCODE(JudyCheckSorted(Pjlwnew + 1, pop1 - 1, cJU_ROOTSTATE);) - - j__udyFreeJLW(Pjlw, pop1, (Pjpm_t) NULL); - -//// *PPArray = (Pvoid_t) Pjlwnew | cJU_LEAFW); - *PPArray = (Pvoid_t) Pjlwnew; - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - - } - else - - -// **************************************************************************** -// JRP BRANCH: -// -// Traverse through the JPM to do the deletion unless the population is small -// enough to convert immediately to a LEAFW. - - { - Pjpm_t Pjpm; - Pjp_t Pjp; // top-level JP to process. - Word_t digit; // in a branch. - JUDYLCODE(Pjv_t Pjv;) // to value area. - Pjlw_t Pjlwnew; // replacement leaf. - DBGCODE(Pjlw_t Pjlwnew_orig;) - - Pjpm = P_JPM(*PPArray); // top object in array (tree). - Pjp = &(Pjpm->jpm_JP); // next object (first branch or leaf). - - assert(((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_L) - || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_B) - || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_U)); - -// WALK THE TREE -// -// Note: Recursive code in j__udyDelWalk() knows how to collapse a lower-level -// BranchL containing a single JP into the parent JP as a narrow pointer, but -// the code here cant do that for a top-level BranchL. The result can be -// PArray -> JPM -> BranchL containing a single JP. This situation is -// unavoidable because a JPM cannot contain a narrow pointer; the BranchL is -// required in order to hold the top digit decoded, and it does not collapse to -// a LEAFW until the population is low enough. -// -// TBD: Should we add a topdigit field to JPMs so they can hold narrow -// pointers? - - if (j__udyDelWalk(Pjp, Index, cJU_ROOTSTATE, Pjpm) == -1) - { - JU_COPY_ERRNO(PJError, Pjpm); - return(JERRI); - } - - --(Pjpm->jpm_Pop0); // success; decrement total population. - - if ((Pjpm->jpm_Pop0 + 1) != cJU_LEAFW_MAXPOP1) - { - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - } - -// COMPRESS A BRANCH[LBU] TO A LEAFW: -// - Pjlwnew = j__udyAllocJLW(cJU_LEAFW_MAXPOP1); - JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI); - -// Plug leaf into root pointer and set population count: - -//// *PPArray = (Pvoid_t) ((Word_t) Pjlwnew | cJU_LEAFW); - *PPArray = (Pvoid_t) Pjlwnew; -#ifdef JUDYL // prepare value area: - Pjv = JL_LEAFWVALUEAREA(Pjlwnew, cJU_LEAFW_MAXPOP1); -#endif - *Pjlwnew++ = cJU_LEAFW_MAXPOP1 - 1; // set pop0. - DBGCODE(Pjlwnew_orig = Pjlwnew;) - - switch (JU_JPTYPE(Pjp)) - { - -// JPBRANCH_L: Copy each JPs indexes to the new LEAFW and free the old -// branch: - - case cJU_JPBRANCH_L: - { - Pjbl_t PjblRaw = (Pjbl_t) (Pjp->jp_Addr); - Pjbl_t Pjbl = P_JBL(PjblRaw); - - for (offset = 0; offset < Pjbl->jbl_NumJPs; ++offset) - { - pop1 = j__udyLeafM1ToLeafW(Pjlwnew, JU_PVALUEPASS - (Pjbl->jbl_jp) + offset, - JU_DIGITTOSTATE(Pjbl->jbl_Expanse[offset], - cJU_BYTESPERWORD), - (Pvoid_t) Pjpm); - Pjlwnew += pop1; // advance through indexes. - JUDYLCODE(Pjv += pop1;) // advance through values. - } - j__udyFreeJBL(PjblRaw, Pjpm); - - assert(Pjlwnew == Pjlwnew_orig + cJU_LEAFW_MAXPOP1); - break; // delete Index from new LEAFW. - } - -// JPBRANCH_B: Copy each JPs indexes to the new LEAFW and free the old -// branch, including each JP subarray: - - case cJU_JPBRANCH_B: - { - Pjbb_t PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); - Pjbb_t Pjbb = P_JBB(PjbbRaw); - Word_t subexp; // current subexpanse number. - BITMAPB_t bitmap; // portion for this subexpanse. - Pjp_t Pjp2Raw; // one subexpanses subarray. - Pjp_t Pjp2; - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - if ((bitmap = JU_JBB_BITMAP(Pjbb, subexp)) == 0) - continue; // skip empty subexpanse. - - digit = subexp * cJU_BITSPERSUBEXPB; - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); - Pjp2 = P_JP(Pjp2Raw); - assert(Pjp2 != (Pjp_t) NULL); - -// Walk through bits for all possible sub-subexpanses (digits); increment -// offset for each populated subexpanse; until no more set bits: - - for (offset = 0; bitmap != 0; bitmap >>= 1, ++digit) - { - if (! (bitmap & 1)) // skip empty sub-subexpanse. - continue; - - pop1 = j__udyLeafM1ToLeafW(Pjlwnew, JU_PVALUEPASS - Pjp2 + offset, - JU_DIGITTOSTATE(digit, cJU_BYTESPERWORD), - (Pvoid_t) Pjpm); - Pjlwnew += pop1; // advance through indexes. - JUDYLCODE(Pjv += pop1;) // advance through values. - ++offset; - } - j__udyFreeJBBJP(Pjp2Raw, /* pop1 = */ offset, Pjpm); - } - j__udyFreeJBB(PjbbRaw, Pjpm); - - assert(Pjlwnew == Pjlwnew_orig + cJU_LEAFW_MAXPOP1); - break; // delete Index from new LEAFW. - - } // case cJU_JPBRANCH_B. - - -// JPBRANCH_U: Copy each JPs indexes to the new LEAFW and free the old -// branch: - - case cJU_JPBRANCH_U: - { - Pjbu_t PjbuRaw = (Pjbu_t) (Pjp->jp_Addr); - Pjbu_t Pjbu = P_JBU(PjbuRaw); - Word_t ldigit; // larger than uint8_t. - - for (Pjp = Pjbu->jbu_jp, ldigit = 0; - ldigit < cJU_BRANCHUNUMJPS; - ++Pjp, ++ldigit) - { - -// Shortcuts, to save a little time for possibly big branches: - - if ((JU_JPTYPE(Pjp)) == cJU_JPNULLMAX) // skip null JP. - continue; - -// TBD: Should the following shortcut also be used in BranchL and BranchB -// code? - -#ifndef JU_64BIT - if ((JU_JPTYPE(Pjp)) == cJU_JPIMMED_3_01) -#else - if ((JU_JPTYPE(Pjp)) == cJU_JPIMMED_7_01) -#endif - { // single Immed: - *Pjlwnew++ = JU_DIGITTOSTATE(ldigit, cJU_BYTESPERWORD) - | JU_JPDCDPOP0(Pjp); // rebuild Index. -#ifdef JUDYL - *Pjv++ = Pjp->jp_Addr; // copy value area. -#endif - continue; - } - - pop1 = j__udyLeafM1ToLeafW(Pjlwnew, JU_PVALUEPASS - Pjp, JU_DIGITTOSTATE(ldigit, cJU_BYTESPERWORD), - (Pvoid_t) Pjpm); - Pjlwnew += pop1; // advance through indexes. - JUDYLCODE(Pjv += pop1;) // advance through values. - } - j__udyFreeJBU(PjbuRaw, Pjpm); - - assert(Pjlwnew == Pjlwnew_orig + cJU_LEAFW_MAXPOP1); - break; // delete Index from new LEAFW. - - } // case cJU_JPBRANCH_U. - - -// INVALID JP TYPE in jpm_t struct - - default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(JERRI); - - } // end switch on sub-JP type. - - DBGCODE(JudyCheckSorted((Pjll_t) Pjlwnew_orig, cJU_LEAFW_MAXPOP1, - cJU_ROOTSTATE);) - -// FREE JPM (no longer needed): - - j__udyFreeJPM(Pjpm, (Pjpm_t) NULL); - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - - } - /*NOTREACHED*/ - -} // Judy1Unset() / JudyLDel() diff --git a/libjudy/src/JudyL/JudyLFirst.c b/libjudy/src/JudyL/JudyLFirst.c deleted file mode 100644 index 49d427adaf..0000000000 --- a/libjudy/src/JudyL/JudyLFirst.c +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.12 $ $Source: /judy/src/JudyCommon/JudyFirst.c $ -// -// Judy*First[Empty]() and Judy*Last[Empty]() routines for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// These are inclusive versions of Judy*Next[Empty]() and Judy*Prev[Empty](). - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - - -// **************************************************************************** -// J U D Y 1 F I R S T -// J U D Y L F I R S T -// -// See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1First -#else -FUNCTION PPvoid_t JudyLFirst -#endif - ( - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError // optional, for returning error info. - ) -{ - if (PIndex == (PWord_t) NULL) // caller error: - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -#ifdef JUDY1 - switch (Judy1Test(PArray, *PIndex, PJError)) - { - case 1: return(1); // found *PIndex itself. - case 0: return(Judy1Next(PArray, PIndex, PJError)); - default: return(JERRI); - } -#else - { - PPvoid_t PValue; - - if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR) - return(PPJERR); - - if (PValue != (PPvoid_t) NULL) return(PValue); // found *PIndex. - - return(JudyLNext(PArray, PIndex, PJError)); - } -#endif - -} // Judy1First() / JudyLFirst() - - -// **************************************************************************** -// J U D Y 1 L A S T -// J U D Y L L A S T -// -// See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1Last( -#else -FUNCTION PPvoid_t JudyLLast( -#endif - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError) // optional, for returning error info. -{ - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); // caller error. - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -#ifdef JUDY1 - switch (Judy1Test(PArray, *PIndex, PJError)) - { - case 1: return(1); // found *PIndex itself. - case 0: return(Judy1Prev(PArray, PIndex, PJError)); - default: return(JERRI); - } -#else - { - PPvoid_t PValue; - - if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR) - return(PPJERR); - - if (PValue != (PPvoid_t) NULL) return(PValue); // found *PIndex. - - return(JudyLPrev(PArray, PIndex, PJError)); - } -#endif - -} // Judy1Last() / JudyLLast() - - -// **************************************************************************** -// J U D Y 1 F I R S T E M P T Y -// J U D Y L F I R S T E M P T Y -// -// See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1FirstEmpty( -#else -FUNCTION int JudyLFirstEmpty( -#endif - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError) // optional, for returning error info. -{ - if (PIndex == (PWord_t) NULL) // caller error: - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return(JERRI); - } - -#ifdef JUDY1 - switch (Judy1Test(PArray, *PIndex, PJError)) - { - case 0: return(1); // found *PIndex itself. - case 1: return(Judy1NextEmpty(PArray, PIndex, PJError)); - default: return(JERRI); - } -#else - { - PPvoid_t PValue; - - if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR) - return(JERRI); - - if (PValue == (PPvoid_t) NULL) return(1); // found *PIndex. - - return(JudyLNextEmpty(PArray, PIndex, PJError)); - } -#endif - -} // Judy1FirstEmpty() / JudyLFirstEmpty() - - -// **************************************************************************** -// J U D Y 1 L A S T E M P T Y -// J U D Y L L A S T E M P T Y -// -// See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1LastEmpty( -#else -FUNCTION int JudyLLastEmpty( -#endif - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError) // optional, for returning error info. -{ - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); // caller error. - return(JERRI); - } - -#ifdef JUDY1 - switch (Judy1Test(PArray, *PIndex, PJError)) - { - case 0: return(1); // found *PIndex itself. - case 1: return(Judy1PrevEmpty(PArray, PIndex, PJError)); - default: return(JERRI); - } -#else - { - PPvoid_t PValue; - - if ((PValue = JudyLGet(PArray, *PIndex, PJError)) == PPJERR) - return(JERRI); - - if (PValue == (PPvoid_t) NULL) return(1); // found *PIndex. - - return(JudyLPrevEmpty(PArray, PIndex, PJError)); - } -#endif - -} // Judy1LastEmpty() / JudyLLastEmpty() diff --git a/libjudy/src/JudyL/JudyLFreeArray.c b/libjudy/src/JudyL/JudyLFreeArray.c deleted file mode 100644 index 1161d7dba2..0000000000 --- a/libjudy/src/JudyL/JudyLFreeArray.c +++ /dev/null @@ -1,363 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.51 $ $Source: /judy/src/JudyCommon/JudyFreeArray.c $ -// -// Judy1FreeArray() and JudyLFreeArray() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// Return the number of bytes freed from the array. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);) - - -// **************************************************************************** -// J U D Y 1 F R E E A R R A Y -// J U D Y L F R E E A R R A Y -// -// See the Judy*(3C) manual entry for details. -// -// This code is written recursively, at least at first, because thats much -// simpler. Hope its fast enough. - -#ifdef JUDY1 -FUNCTION Word_t Judy1FreeArray -#else -FUNCTION Word_t JudyLFreeArray -#endif - ( - PPvoid_t PPArray, // array to free. - PJError_t PJError // optional, for returning error info. - ) -{ - jpm_t jpm; // local to accumulate free statistics. - -// CHECK FOR NULL POINTER (error by caller): - - if (PPArray == (PPvoid_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); - return(JERR); - } - - DBGCODE(JudyCheckPop(*PPArray);) - -// Zero jpm.jpm_Pop0 (meaning the array will be empty in a moment) for accurate -// logging in TRACEMI2. - - jpm.jpm_Pop0 = 0; // see above. - jpm.jpm_TotalMemWords = 0; // initialize memory freed. - -// Empty array: - - if (P_JLW(*PPArray) == (Pjlw_t) NULL) return(0); - -// PROCESS TOP LEVEL "JRP" BRANCHES AND LEAF: - - if (JU_LEAFW_POP0(*PPArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(*PPArray); // first word of leaf. - - j__udyFreeJLW(Pjlw, Pjlw[0] + 1, &jpm); - *PPArray = (Pvoid_t) NULL; // make an empty array. - return (-(jpm.jpm_TotalMemWords * cJU_BYTESPERWORD)); // see above. - } - else - -// Rootstate leaves: just free the leaf: - -// Common code for returning the amount of memory freed. -// -// Note: In a an ordinary LEAFW, pop0 = *PPArray[0]. -// -// Accumulate (negative) words freed, while freeing objects. -// Return the positive bytes freed. - - { - Pjpm_t Pjpm = P_JPM(*PPArray); - Word_t TotalMem = Pjpm->jpm_TotalMemWords; - - j__udyFreeSM(&(Pjpm->jpm_JP), &jpm); // recurse through tree. - j__udyFreeJPM(Pjpm, &jpm); - -// Verify the array was not corrupt. This means that amount of memory freed -// (which is negative) is equal to the initial amount: - - if (TotalMem + jpm.jpm_TotalMemWords) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - return(JERR); - } - - *PPArray = (Pvoid_t) NULL; // make an empty array. - return (TotalMem * cJU_BYTESPERWORD); - } - -} // Judy1FreeArray() / JudyLFreeArray() - - -// **************************************************************************** -// __ J U D Y F R E E S M -// -// Given a pointer to a JP, recursively visit and free (depth first) all nodes -// in a Judy array BELOW the JP, but not the JP itself. Accumulate in *Pjpm -// the total words freed (as a negative value). "SM" = State Machine. -// -// Note: Corruption is not detected at this level because during a FreeArray, -// if the code hasnt already core dumped, its better to remain silent, even -// if some memory has not been freed, than to bother the caller about the -// corruption. TBD: Is this true? If not, must list all legitimate JPNULL -// and JPIMMED above first, and revert to returning bool_t (see 4.34). - -FUNCTION void j__udyFreeSM( - Pjp_t Pjp, // top of Judy (top-state). - Pjpm_t Pjpm) // to return words freed. -{ - Word_t Pop1; - - switch (JU_JPTYPE(Pjp)) - { - -#ifdef JUDY1 - -// FULL EXPANSE -- nothing to free for this jp_Type. - - case cJ1_JPFULLPOPU1: - break; -#endif - -// JUDY BRANCH -- free the sub-tree depth first: - -// LINEAR BRANCH -- visit each JP in the JBLs list, then free the JBL: -// -// Note: There are no null JPs in a JBL. - - case cJU_JPBRANCH_L: - case cJU_JPBRANCH_L2: - case cJU_JPBRANCH_L3: -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - case cJU_JPBRANCH_L5: - case cJU_JPBRANCH_L6: - case cJU_JPBRANCH_L7: -#endif // JU_64BIT - { - Pjbl_t Pjbl = P_JBL(Pjp->jp_Addr); - Word_t offset; - - for (offset = 0; offset < Pjbl->jbl_NumJPs; ++offset) - j__udyFreeSM((Pjbl->jbl_jp) + offset, Pjpm); - - j__udyFreeJBL((Pjbl_t) (Pjp->jp_Addr), Pjpm); - break; - } - - -// BITMAP BRANCH -- visit each JP in the JBBs list based on the bitmap, also -// -// Note: There are no null JPs in a JBB. - - case cJU_JPBRANCH_B: - case cJU_JPBRANCH_B2: - case cJU_JPBRANCH_B3: -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - case cJU_JPBRANCH_B5: - case cJU_JPBRANCH_B6: - case cJU_JPBRANCH_B7: -#endif // JU_64BIT - { - Word_t subexp; - Word_t offset; - Word_t jpcount; - - Pjbb_t Pjbb = P_JBB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - - if (jpcount) - { - for (offset = 0; offset < jpcount; ++offset) - { - j__udyFreeSM(P_JP(JU_JBB_PJP(Pjbb, subexp)) + offset, - Pjpm); - } - j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, subexp), jpcount, Pjpm); - } - } - j__udyFreeJBB((Pjbb_t) (Pjp->jp_Addr), Pjpm); - - break; - } - - -// UNCOMPRESSED BRANCH -- visit each JP in the JBU array, then free the JBU -// itself: -// -// Note: Null JPs are handled during recursion at a lower state. - - case cJU_JPBRANCH_U: - case cJU_JPBRANCH_U2: - case cJU_JPBRANCH_U3: -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: - case cJU_JPBRANCH_U5: - case cJU_JPBRANCH_U6: - case cJU_JPBRANCH_U7: -#endif // JU_64BIT - { - Word_t offset; - Pjbu_t Pjbu = P_JBU(Pjp->jp_Addr); - - for (offset = 0; offset < cJU_BRANCHUNUMJPS; ++offset) - j__udyFreeSM((Pjbu->jbu_jp) + offset, Pjpm); - - j__udyFreeJBU((Pjbu_t) (Pjp->jp_Addr), Pjpm); - break; - } - - -// -- Cases below here terminate and do not recurse. -- - - -// LINEAR LEAF -- just free the leaf; size is computed from jp_Type: -// -// Note: cJU_JPLEAF1 is a special case, see discussion in ../Judy1/Judy1.h - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL1((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; -#endif - - case cJU_JPLEAF2: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL2((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPLEAF3: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL3((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - -#ifdef JU_64BIT - case cJU_JPLEAF4: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL4((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPLEAF5: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL5((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPLEAF6: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL6((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPLEAF7: - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - j__udyFreeJLL7((Pjll_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; -#endif // JU_64BIT - - -// BITMAP LEAF -- free sub-expanse arrays of JPs, then free the JBB. - - case cJU_JPLEAF_B1: - { -#ifdef JUDYL - Word_t subexp; - Word_t jpcount; - Pjlb_t Pjlb = P_JLB(Pjp->jp_Addr); - -// Free the value areas in the bitmap leaf: - - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - { - jpcount = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - - if (jpcount) - j__udyLFreeJV(JL_JLB_PVALUE(Pjlb, subexp), jpcount, Pjpm); - } -#endif // JUDYL - - j__udyFreeJLB1((Pjlb_t) (Pjp->jp_Addr), Pjpm); - break; - - } // case cJU_JPLEAF_B1 - -#ifdef JUDYL - - -// IMMED*: -// -// For JUDYL, all non JPIMMED_*_01s have a LeafV which must be freed: - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#ifdef JU_64BIT - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif - Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_1_02 + 2; - j__udyLFreeJV((Pjv_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - -#ifdef JU_64BIT - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: - - Pop1 = JU_JPTYPE(Pjp) - cJU_JPIMMED_2_02 + 2; - j__udyLFreeJV((Pjv_t) (Pjp->jp_Addr), Pop1, Pjpm); - break; - - case cJU_JPIMMED_3_02: - j__udyLFreeJV((Pjv_t) (Pjp->jp_Addr), 2, Pjpm); - break; - -#endif // JU_64BIT -#endif // JUDYL - - -// OTHER JPNULL, JPIMMED, OR UNEXPECTED TYPE -- nothing to free for this type: -// -// Note: Lump together no-op and invalid JP types; see function header -// comments. - - default: break; - - } // switch (JU_JPTYPE(Pjp)) - -} // j__udyFreeSM() diff --git a/libjudy/src/JudyL/JudyLGet.c b/libjudy/src/JudyL/JudyLGet.c deleted file mode 100644 index 0bb9971cc8..0000000000 --- a/libjudy/src/JudyL/JudyLGet.c +++ /dev/null @@ -1,1094 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.43 $ $Source: /judy/src/JudyCommon/JudyGet.c $ -// -// Judy1Test() and JudyLGet() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -#ifdef TRACEJPR // different macro name, for "retrieval" only. -#include "JudyPrintJP.c" -#endif - - -// **************************************************************************** -// J U D Y 1 T E S T -// J U D Y L G E T -// -// See the manual entry for details. Note support for "shortcut" entries to -// trees known to start with a JPM. - -#ifdef JUDY1 - -#ifdef JUDYGETINLINE -FUNCTION int j__udy1Test -#else -FUNCTION int Judy1Test -#endif - -#else // JUDYL - -#ifdef JUDYGETINLINE -FUNCTION PPvoid_t j__udyLGet -#else -FUNCTION PPvoid_t JudyLGet -#endif - -#endif // JUDYL - ( -#ifdef JUDYGETINLINE - Pvoid_t PArray, // from which to retrieve. - Word_t Index // to retrieve. -#else - Pcvoid_t PArray, // from which to retrieve. - Word_t Index, // to retrieve. - PJError_t PJError // optional, for returning error info. -#endif - ) -{ - Pjp_t Pjp; // current JP while walking the tree. - Pjpm_t Pjpm; // for global accounting. - uint8_t Digit; // byte just decoded from Index. - Word_t Pop1; // leaf population (number of indexes). - Pjll_t Pjll; // pointer to LeafL. - DBGCODE(uint8_t ParentJPType;) - -#ifndef JUDYGETINLINE - - if (PArray == (Pcvoid_t) NULL) // empty array. - { - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - } - -// **************************************************************************** -// PROCESS TOP LEVEL BRANCHES AND LEAF: - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - int posidx; // signed offset in leaf. - - Pop1 = Pjlw[0] + 1; - posidx = j__udySearchLeafW(Pjlw + 1, Pop1, Index); - - if (posidx >= 0) - { - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAFWVALUEAREA(Pjlw, Pop1) + posidx));) - } - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - } - -#endif // ! JUDYGETINLINE - - Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); // top branch is below JPM. - -// **************************************************************************** -// WALK THE JUDY TREE USING A STATE MACHINE: - -ContinueWalk: // for going down one level; come here with Pjp set. - -#ifdef TRACEJPR - JudyPrintJP(Pjp, "g", __LINE__); -#endif - switch (JU_JPTYPE(Pjp)) - { - -// Ensure the switch table starts at 0 for speed; otherwise more code is -// executed: - - case 0: goto ReturnCorrupt; // save a little code. - - -// **************************************************************************** -// JPNULL*: -// -// Note: These are legitimate in a BranchU (only) and do not constitute a -// fault. - - case cJU_JPNULL1: - case cJU_JPNULL2: - case cJU_JPNULL3: -#ifdef JU_64BIT - case cJU_JPNULL4: - case cJU_JPNULL5: - case cJU_JPNULL6: - case cJU_JPNULL7: -#endif - assert(ParentJPType >= cJU_JPBRANCH_U2); - assert(ParentJPType <= cJU_JPBRANCH_U); - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - - -// **************************************************************************** -// JPBRANCH_L*: -// -// Note: The use of JU_DCDNOTMATCHINDEX() in branches is not strictly -// required,since this can be done at leaf level, but it costs nothing to do it -// sooner, and it aborts an unnecessary traversal sooner. - - case cJU_JPBRANCH_L2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - Digit = JU_DIGITATSTATE(Index, 2); - goto JudyBranchL; - - case cJU_JPBRANCH_L3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - Digit = JU_DIGITATSTATE(Index, 3); - goto JudyBranchL; - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - Digit = JU_DIGITATSTATE(Index, 4); - goto JudyBranchL; - - case cJU_JPBRANCH_L5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - Digit = JU_DIGITATSTATE(Index, 5); - goto JudyBranchL; - - case cJU_JPBRANCH_L6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - Digit = JU_DIGITATSTATE(Index, 6); - goto JudyBranchL; - - case cJU_JPBRANCH_L7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Digit = JU_DIGITATSTATE(Index, 7); - goto JudyBranchL; - -#endif // JU_64BIT - - case cJU_JPBRANCH_L: - { - Pjbl_t Pjbl; - int posidx; - - Digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - -// Common code for all BranchLs; come here with Digit set: - -JudyBranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - - posidx = 0; - - do { - if (Pjbl->jbl_Expanse[posidx] == Digit) - { // found Digit; continue traversal: - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = Pjbl->jbl_jp + posidx; - goto ContinueWalk; - } - } while (++posidx != Pjbl->jbl_NumJPs); - - break; - } - - -// **************************************************************************** -// JPBRANCH_B*: - - case cJU_JPBRANCH_B2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - Digit = JU_DIGITATSTATE(Index, 2); - goto JudyBranchB; - - case cJU_JPBRANCH_B3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - Digit = JU_DIGITATSTATE(Index, 3); - goto JudyBranchB; - - -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - Digit = JU_DIGITATSTATE(Index, 4); - goto JudyBranchB; - - case cJU_JPBRANCH_B5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - Digit = JU_DIGITATSTATE(Index, 5); - goto JudyBranchB; - - case cJU_JPBRANCH_B6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - Digit = JU_DIGITATSTATE(Index, 6); - goto JudyBranchB; - - case cJU_JPBRANCH_B7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Digit = JU_DIGITATSTATE(Index, 7); - goto JudyBranchB; - -#endif // JU_64BIT - - case cJU_JPBRANCH_B: - { - Pjbb_t Pjbb; - Word_t subexp; // in bitmap, 0..7. - BITMAPB_t BitMap; // for one subexpanse. - BITMAPB_t BitMask; // bit in BitMap for Indexs Digit. - - Digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - -// Common code for all BranchBs; come here with Digit set: - -JudyBranchB: - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjbb = P_JBB(Pjp->jp_Addr); - subexp = Digit / cJU_BITSPERSUBEXPB; - - BitMap = JU_JBB_BITMAP(Pjbb, subexp); - Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp)); - - BitMask = JU_BITPOSMASKB(Digit); - -// No JP in subexpanse for Index => Index not found: - - if (! (BitMap & BitMask)) break; - -// Count JPs in the subexpanse below the one for Index: - - Pjp += j__udyCountBitsB(BitMap & (BitMask - 1)); - - goto ContinueWalk; - - } // case cJU_JPBRANCH_B* - - -// **************************************************************************** -// JPBRANCH_U*: -// -// Notice the reverse order of the cases, and falling through to the next case, -// for performance. - - case cJU_JPBRANCH_U: - - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, cJU_ROOTSTATE); - -// If not a BranchU, traverse; otherwise fall into the next case, which makes -// this very fast code for a large Judy array (mainly BranchUs), especially -// when branches are already in the cache, such as for prev/next: - -#ifndef JU_64BIT - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U3) goto ContinueWalk; -#else - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U7) goto ContinueWalk; -#endif - -#ifdef JU_64BIT - case cJU_JPBRANCH_U7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 7); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U6) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 6); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U5) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 5); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U4) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 4); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U3) goto ContinueWalk; - // and fall through. - -#endif // JU_64BIT - - case cJU_JPBRANCH_U3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 3); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U2) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 2); - -// Note: BranchU2 is a special case that must continue traversal to a leaf, -// immed, full, or null type: - - goto ContinueWalk; - - -// **************************************************************************** -// JPLEAF*: -// -// Note: Here the calls of JU_DCDNOTMATCHINDEX() are necessary and check -// whether Index is out of the expanse of a narrow pointer. - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - - case cJU_JPLEAF1: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf1(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF1VALUEAREA(Pjll, Pop1) + posidx));) - } - -#endif // (JUDYL || (! JU_64BIT)) - - case cJU_JPLEAF2: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf2(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF2VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF3: - { - int posidx; // signed offset in leaf. - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf3(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF3VALUEAREA(Pjll, Pop1) + posidx));) - } -#ifdef JU_64BIT - case cJU_JPLEAF4: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf4(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF4VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF5: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf5(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF5VALUEAREA(Pjll, Pop1) + posidx));) - } - - case cJU_JPLEAF6: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf6(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF6VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF7: - { - int posidx; // signed offset in leaf. - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf7(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF7VALUEAREA(Pjll, Pop1) + posidx));) - } -#endif // JU_64BIT - - -// **************************************************************************** -// JPLEAF_B1: - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; -#ifdef JUDYL - int posidx; - Word_t subexp; // in bitmap, 0..7. - BITMAPL_t BitMap; // for one subexpanse. - BITMAPL_t BitMask; // bit in BitMap for Indexs Digit. - Pjv_t Pjv; -#endif - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - Pjlb = P_JLB(Pjp->jp_Addr); - -#ifdef JUDY1 - -// Simply check if Indexs bit is set in the bitmap: - - if (JU_BITMAPTESTL(Pjlb, Index)) return(1); - break; - -#else // JUDYL - -// JudyL is much more complicated because of value area subarrays: - - Digit = JU_DIGITATSTATE(Index, 1); - subexp = Digit / cJU_BITSPERSUBEXPL; - BitMap = JU_JLB_BITMAP(Pjlb, subexp); - BitMask = JU_BITPOSMASKL(Digit); - -// No value in subexpanse for Index => Index not found: - - if (! (BitMap & BitMask)) break; - -// Count value areas in the subexpanse below the one for Index: - - Pjv = P_JV(JL_JLB_PVALUE(Pjlb, subexp)); - assert(Pjv != (Pjv_t) NULL); - posidx = j__udyCountBitsL(BitMap & (BitMask - 1)); - - return((PPvoid_t) (Pjv + posidx)); - -#endif // JUDYL - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 - -// **************************************************************************** -// JPFULLPOPU1: -// -// If the Index is in the expanse, it is necessarily valid (found). - - case cJ1_JPFULLPOPU1: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - return(1); - -#ifdef notdef // for future enhancements -#ifdef JU_64BIT - -// Note: Need ? if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - case cJ1_JPFULLPOPU1m15: - if (Pjp->jp_1Index[14] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m14: - if (Pjp->jp_1Index[13] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m13: - if (Pjp->jp_1Index[12] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m12: - if (Pjp->jp_1Index[11] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m11: - if (Pjp->jp_1Index[10] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m10: - if (Pjp->jp_1Index[9] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m9: - if (Pjp->jp_1Index[8] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m8: - if (Pjp->jp_1Index[7] == (uint8_t)Index) break; -#endif - case cJ1_JPFULLPOPU1m7: - if (Pjp->jp_1Index[6] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m6: - if (Pjp->jp_1Index[5] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m5: - if (Pjp->jp_1Index[4] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m4: - if (Pjp->jp_1Index[3] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m3: - if (Pjp->jp_1Index[2] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m2: - if (Pjp->jp_1Index[1] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m1: - if (Pjp->jp_1Index[0] == (uint8_t)Index) break; - - return(1); // found, not in exclusion list - -#endif // JUDY1 -#endif // notdef - -// **************************************************************************** -// JPIMMED*: -// -// Note that the contents of jp_DcdPopO are different for cJU_JPIMMED_*_01: - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - if (JU_JPDCDPOP0(Pjp) != JU_TRIMTODCDSIZE(Index)) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) &(Pjp->jp_Addr));) // immediate value area. - - -// Macros to make code more readable and avoid dup errors - -#ifdef JUDY1 - -#define CHECKINDEXNATIVE(LEAF_T, PJP, IDX, INDEX) \ -if (((LEAF_T *)((PJP)->jp_1Index))[(IDX) - 1] == (LEAF_T)(INDEX)) \ - return(1) - -#define CHECKLEAFNONNAT(LFBTS, PJP, INDEX, IDX, COPY) \ -{ \ - Word_t i_ndex; \ - uint8_t *a_ddr; \ - a_ddr = (PJP)->jp_1Index + (((IDX) - 1) * (LFBTS)); \ - COPY(i_ndex, a_ddr); \ - if (i_ndex == JU_LEASTBYTES((INDEX), (LFBTS))) \ - return(1); \ -} -#endif - -#ifdef JUDYL - -#define CHECKINDEXNATIVE(LEAF_T, PJP, IDX, INDEX) \ -if (((LEAF_T *)((PJP)->jp_LIndex))[(IDX) - 1] == (LEAF_T)(INDEX)) \ - return((PPvoid_t)(P_JV((PJP)->jp_Addr) + (IDX) - 1)) - -#define CHECKLEAFNONNAT(LFBTS, PJP, INDEX, IDX, COPY) \ -{ \ - Word_t i_ndex; \ - uint8_t *a_ddr; \ - a_ddr = (PJP)->jp_LIndex + (((IDX) - 1) * (LFBTS)); \ - COPY(i_ndex, a_ddr); \ - if (i_ndex == JU_LEASTBYTES((INDEX), (LFBTS))) \ - return((PPvoid_t)(P_JV((PJP)->jp_Addr) + (IDX) - 1)); \ -} -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_15: CHECKINDEXNATIVE(uint8_t, Pjp, 15, Index); - case cJ1_JPIMMED_1_14: CHECKINDEXNATIVE(uint8_t, Pjp, 14, Index); - case cJ1_JPIMMED_1_13: CHECKINDEXNATIVE(uint8_t, Pjp, 13, Index); - case cJ1_JPIMMED_1_12: CHECKINDEXNATIVE(uint8_t, Pjp, 12, Index); - case cJ1_JPIMMED_1_11: CHECKINDEXNATIVE(uint8_t, Pjp, 11, Index); - case cJ1_JPIMMED_1_10: CHECKINDEXNATIVE(uint8_t, Pjp, 10, Index); - case cJ1_JPIMMED_1_09: CHECKINDEXNATIVE(uint8_t, Pjp, 9, Index); - case cJ1_JPIMMED_1_08: CHECKINDEXNATIVE(uint8_t, Pjp, 8, Index); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_07: CHECKINDEXNATIVE(uint8_t, Pjp, 7, Index); - case cJU_JPIMMED_1_06: CHECKINDEXNATIVE(uint8_t, Pjp, 6, Index); - case cJU_JPIMMED_1_05: CHECKINDEXNATIVE(uint8_t, Pjp, 5, Index); - case cJU_JPIMMED_1_04: CHECKINDEXNATIVE(uint8_t, Pjp, 4, Index); -#endif - case cJU_JPIMMED_1_03: CHECKINDEXNATIVE(uint8_t, Pjp, 3, Index); - case cJU_JPIMMED_1_02: CHECKINDEXNATIVE(uint8_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint8_t, Pjp, 1, Index); - break; - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_07: CHECKINDEXNATIVE(uint16_t, Pjp, 7, Index); - case cJ1_JPIMMED_2_06: CHECKINDEXNATIVE(uint16_t, Pjp, 6, Index); - case cJ1_JPIMMED_2_05: CHECKINDEXNATIVE(uint16_t, Pjp, 5, Index); - case cJ1_JPIMMED_2_04: CHECKINDEXNATIVE(uint16_t, Pjp, 4, Index); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_03: CHECKINDEXNATIVE(uint16_t, Pjp, 3, Index); - case cJU_JPIMMED_2_02: CHECKINDEXNATIVE(uint16_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint16_t, Pjp, 1, Index); - break; -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_05: - CHECKLEAFNONNAT(3, Pjp, Index, 5, JU_COPY3_PINDEX_TO_LONG); - case cJ1_JPIMMED_3_04: - CHECKLEAFNONNAT(3, Pjp, Index, 4, JU_COPY3_PINDEX_TO_LONG); - case cJ1_JPIMMED_3_03: - CHECKLEAFNONNAT(3, Pjp, Index, 3, JU_COPY3_PINDEX_TO_LONG); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: - CHECKLEAFNONNAT(3, Pjp, Index, 2, JU_COPY3_PINDEX_TO_LONG); - CHECKLEAFNONNAT(3, Pjp, Index, 1, JU_COPY3_PINDEX_TO_LONG); - break; -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - - case cJ1_JPIMMED_4_03: CHECKINDEXNATIVE(uint32_t, Pjp, 3, Index); - case cJ1_JPIMMED_4_02: CHECKINDEXNATIVE(uint32_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint32_t, Pjp, 1, Index); - break; - - case cJ1_JPIMMED_5_03: - CHECKLEAFNONNAT(5, Pjp, Index, 3, JU_COPY5_PINDEX_TO_LONG); - case cJ1_JPIMMED_5_02: - CHECKLEAFNONNAT(5, Pjp, Index, 2, JU_COPY5_PINDEX_TO_LONG); - CHECKLEAFNONNAT(5, Pjp, Index, 1, JU_COPY5_PINDEX_TO_LONG); - break; - - case cJ1_JPIMMED_6_02: - CHECKLEAFNONNAT(6, Pjp, Index, 2, JU_COPY6_PINDEX_TO_LONG); - CHECKLEAFNONNAT(6, Pjp, Index, 1, JU_COPY6_PINDEX_TO_LONG); - break; - - case cJ1_JPIMMED_7_02: - CHECKLEAFNONNAT(7, Pjp, Index, 2, JU_COPY7_PINDEX_TO_LONG); - CHECKLEAFNONNAT(7, Pjp, Index, 1, JU_COPY7_PINDEX_TO_LONG); - break; - -#endif // (JUDY1 && JU_64BIT) - - -// **************************************************************************** -// INVALID JP TYPE: - - default: - -ReturnCorrupt: - -#ifdef JUDYGETINLINE // Pjpm is known to be non-null: - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); -#else - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); -#endif - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // switch on JP type - -JUDY1CODE(return(0);) -JUDYLCODE(return((PPvoid_t) NULL);) - -} // Judy1Test() / JudyLGet() - - -#ifndef JUDYGETINLINE // only compile the following function once: -#ifdef DEBUG - -// **************************************************************************** -// J U D Y C H E C K P O P -// -// Given a pointer to a Judy array, traverse the entire array to ensure -// population counts add up correctly. This can catch various coding errors. -// -// Since walking the entire tree is probably time-consuming, enable this -// function by setting env parameter $CHECKPOP to first call at which to start -// checking. Note: This function is called both from insert and delete code. -// -// Note: Even though this function does nothing useful for LEAFW leaves, its -// good practice to call it anyway, and cheap too. -// -// TBD: This is a debug-only check function similar to JudyCheckSorted(), but -// since it walks the tree it is Judy1/JudyL-specific and must live in a source -// file that is built both ways. -// -// TBD: As feared, enabling this code for every insert/delete makes Judy -// deathly slow, even for a small tree (10K indexes). Its not so bad if -// present but disabled (<1% slowdown measured). Still, should it be ifdefd -// other than DEBUG and/or called less often? -// -// TBD: Should this "population checker" be expanded to a comprehensive tree -// checker? It currently detects invalid LEAFW/JP types as well as inconsistent -// pop1s. Other possible checks, all based on essentially redundant data in -// the Judy tree, include: -// -// - Zero LS bits in jp_Addr field. -// -// - Correct Dcd bits. -// -// - Consistent JP types (always descending down the tree). -// -// - Sorted linear lists in BranchLs and leaves (using JudyCheckSorted(), but -// ideally that function is already called wherever appropriate after any -// linear list is modified). -// -// - Any others possible? - -#include // for getenv() and atol(). - -static Word_t JudyCheckPopSM(Pjp_t Pjp, Word_t RootPop1); - -FUNCTION void JudyCheckPop( - Pvoid_t PArray) -{ -static bool_t checked = FALSE; // already checked env parameter. -static bool_t enabled = FALSE; // env parameter set. -static bool_t active = FALSE; // calls >= callsmin. -static Word_t callsmin; // start point from $CHECKPOP. -static Word_t calls = 0; // times called so far. - - -// CHECK FOR EXTERNAL ENABLING: - - if (! checked) // only check once. - { - char * value; // for getenv(). - - checked = TRUE; - - if ((value = getenv("CHECKPOP")) == (char *) NULL) - { -#ifdef notdef -// Take this out because nightly tests want to be flavor-independent; its not -// OK to emit special non-error output from the debug flavor: - - (void) puts("JudyCheckPop() present but not enabled by " - "$CHECKPOP env parameter; set it to the number of " - "calls at which to begin checking"); -#endif - return; - } - - callsmin = atol(value); // note: non-number evaluates to 0. - enabled = TRUE; - - (void) printf("JudyCheckPop() present and enabled; callsmin = " - "%lu\n", callsmin); - } - else if (! enabled) return; - -// Previously or just now enabled; check if non-active or newly active: - - if (! active) - { - if (++calls < callsmin) return; - - (void) printf("JudyCheckPop() activated at call %lu\n", calls); - active = TRUE; - } - -// IGNORE LEAFW AT TOP OF TREE: - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - return; - -// Check JPM pop0 against tree, recursively: -// -// Note: The traversal code in JudyCheckPopSM() is simplest when the case -// statement for each JP type compares the pop1 for that JP to its subtree (if -// any) after traversing the subtree (thats the hard part) and adding up -// actual pop1s. A top branchs JP in the JPM does not have room for a -// full-word pop1, so pass it in as a special case. - - { - Pjpm_t Pjpm = P_JPM(PArray); - (void) JudyCheckPopSM(&(Pjpm->jpm_JP), Pjpm->jpm_Pop0 + 1); - return; - } - -} // JudyCheckPop() - - -// **************************************************************************** -// J U D Y C H E C K P O P S M -// -// Recursive state machine (subroutine) for JudyCheckPop(): Given a Pjp (other -// than JPNULL*; caller should shortcut) and the root population for top-level -// branches, check the subtrees actual pop1 against its nominal value, and -// return the total pop1 for the subtree. -// -// Note: Expect RootPop1 to be ignored at lower levels, so pass down 0, which -// should pop an assertion if this expectation is violated. - -FUNCTION static Word_t JudyCheckPopSM( - Pjp_t Pjp, // top of subtree. - Word_t RootPop1) // whole array, for top-level branches only. -{ - Word_t pop1_jp; // nominal population from the JP. - Word_t pop1 = 0; // actual population at this level. - Word_t offset; // in a branch. - -#define PREPBRANCH(cPopBytes,Next) \ - pop1_jp = JU_JPBRANCH_POP0(Pjp, cPopBytes) + 1; goto Next - -assert((((Word_t) (Pjp->jp_Addr)) & 7) == 3); - switch (JU_JPTYPE(Pjp)) - { - - case cJU_JPBRANCH_L2: PREPBRANCH(2, BranchL); - case cJU_JPBRANCH_L3: PREPBRANCH(3, BranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: PREPBRANCH(4, BranchL); - case cJU_JPBRANCH_L5: PREPBRANCH(5, BranchL); - case cJU_JPBRANCH_L6: PREPBRANCH(6, BranchL); - case cJU_JPBRANCH_L7: PREPBRANCH(7, BranchL); -#endif - case cJU_JPBRANCH_L: pop1_jp = RootPop1; - { - Pjbl_t Pjbl; -BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - - for (offset = 0; offset < (Pjbl->jbl_NumJPs); ++offset) - pop1 += JudyCheckPopSM((Pjbl->jbl_jp) + offset, 0); - - assert(pop1_jp == pop1); - return(pop1); - } - - case cJU_JPBRANCH_B2: PREPBRANCH(2, BranchB); - case cJU_JPBRANCH_B3: PREPBRANCH(3, BranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: PREPBRANCH(4, BranchB); - case cJU_JPBRANCH_B5: PREPBRANCH(5, BranchB); - case cJU_JPBRANCH_B6: PREPBRANCH(6, BranchB); - case cJU_JPBRANCH_B7: PREPBRANCH(7, BranchB); -#endif - case cJU_JPBRANCH_B: pop1_jp = RootPop1; - { - Word_t subexp; - Word_t jpcount; - Pjbb_t Pjbb; -BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - - for (offset = 0; offset < jpcount; ++offset) - { - pop1 += JudyCheckPopSM(P_JP(JU_JBB_PJP(Pjbb, subexp)) - + offset, 0); - } - } - - assert(pop1_jp == pop1); - return(pop1); - } - - case cJU_JPBRANCH_U2: PREPBRANCH(2, BranchU); - case cJU_JPBRANCH_U3: PREPBRANCH(3, BranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: PREPBRANCH(4, BranchU); - case cJU_JPBRANCH_U5: PREPBRANCH(5, BranchU); - case cJU_JPBRANCH_U6: PREPBRANCH(6, BranchU); - case cJU_JPBRANCH_U7: PREPBRANCH(7, BranchU); -#endif - case cJU_JPBRANCH_U: pop1_jp = RootPop1; - { - Pjbu_t Pjbu; -BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - - for (offset = 0; offset < cJU_BRANCHUNUMJPS; ++offset) - { - if (((Pjbu->jbu_jp[offset].jp_Type) >= cJU_JPNULL1) - && ((Pjbu->jbu_jp[offset].jp_Type) <= cJU_JPNULLMAX)) - { - continue; // skip null JP to save time. - } - - pop1 += JudyCheckPopSM((Pjbu->jbu_jp) + offset, 0); - } - - assert(pop1_jp == pop1); - return(pop1); - } - - -// -- Cases below here terminate and do not recurse. -- -// -// For all of these cases except JPLEAF_B1, there is no way to check the JPs -// pop1 against the object itself; just return the pop1; but for linear leaves, -// a bounds check is possible. - -#define CHECKLEAF(MaxPop1) \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - assert(pop1 >= 1); \ - assert(pop1 <= (MaxPop1)); \ - return(pop1) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKLEAF(cJU_LEAF1_MAXPOP1); -#endif - case cJU_JPLEAF2: CHECKLEAF(cJU_LEAF2_MAXPOP1); - case cJU_JPLEAF3: CHECKLEAF(cJU_LEAF3_MAXPOP1); -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKLEAF(cJU_LEAF4_MAXPOP1); - case cJU_JPLEAF5: CHECKLEAF(cJU_LEAF5_MAXPOP1); - case cJU_JPLEAF6: CHECKLEAF(cJU_LEAF6_MAXPOP1); - case cJU_JPLEAF7: CHECKLEAF(cJU_LEAF7_MAXPOP1); -#endif - - case cJU_JPLEAF_B1: - { - Word_t subexp; - Pjlb_t Pjlb; - - pop1_jp = JU_JPLEAF_POP0(Pjp) + 1; - - Pjlb = P_JLB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - pop1 += j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - - assert(pop1_jp == pop1); - return(pop1); - } - - JUDY1CODE(case cJ1_JPFULLPOPU1: return(cJU_JPFULLPOPU1_POP0);) - - case cJU_JPIMMED_1_01: return(1); - case cJU_JPIMMED_2_01: return(1); - case cJU_JPIMMED_3_01: return(1); -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: return(1); - case cJU_JPIMMED_5_01: return(1); - case cJU_JPIMMED_6_01: return(1); - case cJU_JPIMMED_7_01: return(1); -#endif - - case cJU_JPIMMED_1_02: return(2); - case cJU_JPIMMED_1_03: return(3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: return(4); - case cJU_JPIMMED_1_05: return(5); - case cJU_JPIMMED_1_06: return(6); - case cJU_JPIMMED_1_07: return(7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: return(8); - case cJ1_JPIMMED_1_09: return(9); - case cJ1_JPIMMED_1_10: return(10); - case cJ1_JPIMMED_1_11: return(11); - case cJ1_JPIMMED_1_12: return(12); - case cJ1_JPIMMED_1_13: return(13); - case cJ1_JPIMMED_1_14: return(14); - case cJ1_JPIMMED_1_15: return(15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: return(2); - case cJU_JPIMMED_2_03: return(3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: return(4); - case cJ1_JPIMMED_2_05: return(5); - case cJ1_JPIMMED_2_06: return(6); - case cJ1_JPIMMED_2_07: return(7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: return(2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: return(3); - case cJ1_JPIMMED_3_04: return(4); - case cJ1_JPIMMED_3_05: return(5); - - case cJ1_JPIMMED_4_02: return(2); - case cJ1_JPIMMED_4_03: return(3); - case cJ1_JPIMMED_5_02: return(2); - case cJ1_JPIMMED_5_03: return(3); - case cJ1_JPIMMED_6_02: return(2); - case cJ1_JPIMMED_7_02: return(2); -#endif - - } // switch (JU_JPTYPE(Pjp)) - - assert(FALSE); // unrecognized JP type => corruption. - return(0); // to make some compilers happy. - -} // JudyCheckPopSM() - -#endif // DEBUG -#endif // ! JUDYGETINLINE diff --git a/libjudy/src/JudyL/JudyLIns.c b/libjudy/src/JudyL/JudyLIns.c deleted file mode 100644 index f96df4101d..0000000000 --- a/libjudy/src/JudyL/JudyLIns.c +++ /dev/null @@ -1,1873 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.116 $ $Source: /judy/src/JudyCommon/JudyIns.c $ -// -// Judy1Set() and JudyLIns() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// TBD: Should some of the assertions here be converted to product code that -// returns JU_ERRNO_CORRUPT? - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -// Note: Call JudyCheckPop() even before "already inserted" returns, to catch -// population errors; see fix in 4.84: - -DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);) -DBGCODE(extern void JudyCheckSorted(Pjll_t Pjll, Word_t Pop1, long IndexSize);) - -#ifdef TRACEJP -#include "JudyPrintJP.c" -#endif - - -// These are defined to generic values in JudyCommon/JudyPrivateTypes.h: -// -// TBD: These should be exported from a header file, but perhaps not, as they -// are only used here, and exported from Judy*Decascade, which is a separate -// file for profiling reasons (to prevent inlining), but which potentially -// could be merged with this file, either in SoftCM or at compile-time. - -#ifdef JUDY1 -extern int j__udy1CreateBranchB(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); -extern int j__udy1CreateBranchU(Pjp_t, Pvoid_t); - -#ifndef JU_64BIT -extern int j__udy1Cascade1(Pjp_t, Pvoid_t); -#endif -extern int j__udy1Cascade2(Pjp_t, Pvoid_t); -extern int j__udy1Cascade3(Pjp_t, Pvoid_t); -#ifdef JU_64BIT -extern int j__udy1Cascade4(Pjp_t, Pvoid_t); -extern int j__udy1Cascade5(Pjp_t, Pvoid_t); -extern int j__udy1Cascade6(Pjp_t, Pvoid_t); -extern int j__udy1Cascade7(Pjp_t, Pvoid_t); -#endif -extern int j__udy1CascadeL(Pjp_t, Pvoid_t); - -extern int j__udy1InsertBranch(Pjp_t Pjp, Word_t Index, Word_t Btype, Pjpm_t); - -#else // JUDYL - -extern int j__udyLCreateBranchB(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); -extern int j__udyLCreateBranchU(Pjp_t, Pvoid_t); - -extern int j__udyLCascade1(Pjp_t, Pvoid_t); -extern int j__udyLCascade2(Pjp_t, Pvoid_t); -extern int j__udyLCascade3(Pjp_t, Pvoid_t); -#ifdef JU_64BIT -extern int j__udyLCascade4(Pjp_t, Pvoid_t); -extern int j__udyLCascade5(Pjp_t, Pvoid_t); -extern int j__udyLCascade6(Pjp_t, Pvoid_t); -extern int j__udyLCascade7(Pjp_t, Pvoid_t); -#endif -extern int j__udyLCascadeL(Pjp_t, Pvoid_t); - -extern int j__udyLInsertBranch(Pjp_t Pjp, Word_t Index, Word_t Btype, Pjpm_t); -#endif - - -// **************************************************************************** -// MACROS FOR COMMON CODE: -// -// Check if Index is an outlier to (that is, not a member of) this expanse: -// -// An outlier is an Index in-the-expanse of the slot containing the pointer, -// but not-in-the-expanse of the "narrow" pointer in that slot. (This means -// the Dcd part of the Index differs from the equivalent part of jp_DcdPopO.) -// Therefore, the remedy is to put a cJU_JPBRANCH_L* between the narrow pointer -// and the object to which it points, and add the outlier Index as an Immediate -// in the cJU_JPBRANCH_L*. The "trick" is placing the cJU_JPBRANCH_L* at a -// Level that is as low as possible. This is determined by counting the digits -// in the existing narrow pointer that are the same as the digits in the new -// Index (see j__udyInsertBranch()). -// -// Note: At some high Levels, cJU_DCDMASK() is all zeros => dead code; assume -// the compiler optimizes this out. - -#define JU_CHECK_IF_OUTLIER(Pjp, Index, cLevel, Pjpm) \ - if (JU_DCDNOTMATCHINDEX(Index, Pjp, cLevel)) \ - return(j__udyInsertBranch(Pjp, Index, cLevel, Pjpm)) - -// Check if an Index is already in a leaf or immediate, after calling -// j__udySearchLeaf*() to set Offset: -// -// A non-negative Offset means the Index already exists, so return 0; otherwise -// complement Offset to proceed. - -#ifdef JUDY1 -#define Pjv ignore // placeholder. -#define JU_CHECK_IF_EXISTS(Offset,ignore,Pjpm) \ - { \ - if ((Offset) >= 0) return(0); \ - (Offset) = ~(Offset); \ - } -#else -// For JudyL, also set the value area pointer in the Pjpm: - -#define JU_CHECK_IF_EXISTS(Offset,Pjv,Pjpm) \ - { \ - if ((Offset) >= 0) \ - { \ - (Pjpm)->jpm_PValue = (Pjv) + (Offset); \ - return(0); \ - } \ - (Offset) = ~(Offset); \ - } -#endif - - -// **************************************************************************** -// __ J U D Y I N S W A L K -// -// Walk the Judy tree to do a set/insert. This is only called internally, and -// recursively. Unlike Judy1Test() and JudyLGet(), the extra time required for -// recursion should be negligible compared with the total. -// -// Return -1 for error (details in JPM), 0 for Index already inserted, 1 for -// new Index inserted. - -FUNCTION static int j__udyInsWalk( - Pjp_t Pjp, // current JP to descend. - Word_t Index, // to insert. - Pjpm_t Pjpm) // for returning info to top Level. -{ - uint8_t digit; // from Index, current offset into a branch. - jp_t newJP; // for creating a new Immed JP. - Word_t exppop1; // expanse (leaf) population. - int retcode; // return codes: -1, 0, 1. - -#ifdef SUBEXPCOUNTS -// Pointer to BranchB/U subexpanse counter: -// -// Note: Very important for performance reasons (avoids cache fills). - - PWord_t PSubExp = (PWord_t) NULL; -#endif - -ContinueInsWalk: // for modifying state without recursing. - -#ifdef TRACEJP - JudyPrintJP(Pjp, "i", __LINE__); -#endif - - switch (JU_JPTYPE(Pjp)) // entry: Pjp, Index. - { - - -// **************************************************************************** -// JPNULL*: -// -// Convert JP in place from current null type to cJU_JPIMMED_*_01 by -// calculating new JP type. - - case cJU_JPNULL1: - case cJU_JPNULL2: - case cJU_JPNULL3: -#ifdef JU_64BIT - case cJU_JPNULL4: - case cJU_JPNULL5: - case cJU_JPNULL6: - case cJU_JPNULL7: -#endif - assert((Pjp->jp_Addr) == 0); - JU_JPSETADT(Pjp, 0, Index, JU_JPTYPE(Pjp) + cJU_JPIMMED_1_01 - cJU_JPNULL1); -#ifdef JUDYL - // value area is first word of new Immed_01 JP: - Pjpm->jpm_PValue = (Pjv_t) (&(Pjp->jp_Addr)); -#endif - return(1); - - -// **************************************************************************** -// JPBRANCH_L*: -// -// If the new Index is not an outlier to the branchs expanse, and the branch -// should not be converted to uncompressed, extract the digit and record the -// Immediate type to create for a new Immed JP, before going to common code. -// -// Note: JU_CHECK_IF_OUTLIER() is a no-op for BranchB3[7] on 32[64]-bit. - -#define JU_BRANCH_OUTLIER(DIGIT,POP1,cLEVEL,PJP,INDEX,PJPM) \ - JU_CHECK_IF_OUTLIER(PJP, INDEX, cLEVEL, PJPM); \ - (DIGIT) = JU_DIGITATSTATE(INDEX, cLEVEL); \ - (POP1) = JU_JPBRANCH_POP0(PJP, cLEVEL) - - case cJU_JPBRANCH_L2: - JU_BRANCH_OUTLIER(digit, exppop1, 2, Pjp, Index, Pjpm); - goto JudyBranchL; - - case cJU_JPBRANCH_L3: - JU_BRANCH_OUTLIER(digit, exppop1, 3, Pjp, Index, Pjpm); - goto JudyBranchL; - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - JU_BRANCH_OUTLIER(digit, exppop1, 4, Pjp, Index, Pjpm); - goto JudyBranchL; - - case cJU_JPBRANCH_L5: - JU_BRANCH_OUTLIER(digit, exppop1, 5, Pjp, Index, Pjpm); - goto JudyBranchL; - - case cJU_JPBRANCH_L6: - JU_BRANCH_OUTLIER(digit, exppop1, 6, Pjp, Index, Pjpm); - goto JudyBranchL; - - case cJU_JPBRANCH_L7: - JU_BRANCH_OUTLIER(digit, exppop1, 7, Pjp, Index, Pjpm); - goto JudyBranchL; -#endif - -// Similar to common code above, but no outlier check is needed, and the Immed -// type depends on the word size: - - case cJU_JPBRANCH_L: - { - Pjbl_t PjblRaw; // pointer to old linear branch. - Pjbl_t Pjbl; - Pjbu_t PjbuRaw; // pointer to new uncompressed branch. - Pjbu_t Pjbu; - Word_t numJPs; // number of JPs = populated expanses. - int offset; // in branch. - - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - exppop1 = Pjpm->jpm_Pop0; - - // fall through: - -// COMMON CODE FOR LINEAR BRANCHES: -// -// Come here with digit and exppop1 already set. - -JudyBranchL: - PjblRaw = (Pjbl_t) (Pjp->jp_Addr); - Pjbl = P_JBL(PjblRaw); - -// If population under this branch greater than: - - if (exppop1 > JU_BRANCHL_MAX_POP) - goto ConvertBranchLtoU; - - numJPs = Pjbl->jbl_NumJPs; - - if ((numJPs == 0) || (numJPs > cJU_BRANCHLMAXJPS)) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); - return(-1); - } - -// Search for a match to the digit: - - offset = j__udySearchLeaf1((Pjll_t) (Pjbl->jbl_Expanse), numJPs, - digit); - -// If Index is found, offset is into an array of 1..cJU_BRANCHLMAXJPS JPs: - - if (offset >= 0) - { - Pjp = (Pjbl->jbl_jp) + offset; // address of next JP. - break; // continue walk. - } - -// Expanse is missing (not populated) for the passed Index, so insert an Immed -// -- if theres room: - - if (numJPs < cJU_BRANCHLMAXJPS) - { - offset = ~offset; // insertion offset. - - JU_JPSETADT(&newJP, 0, Index, - JU_JPTYPE(Pjp) + cJU_JPIMMED_1_01-cJU_JPBRANCH_L2); - - JU_INSERTINPLACE(Pjbl->jbl_Expanse, numJPs, offset, digit); - JU_INSERTINPLACE(Pjbl->jbl_jp, numJPs, offset, newJP); - - DBGCODE(JudyCheckSorted((Pjll_t) (Pjbl->jbl_Expanse), - numJPs + 1, /* IndexSize = */ 1);) - ++(Pjbl->jbl_NumJPs); -#ifdef JUDYL - // value area is first word of new Immed 01 JP: - Pjpm->jpm_PValue = (Pjv_t) ((Pjbl->jbl_jp) + offset); -#endif - return(1); - } - - -// MAXED OUT LINEAR BRANCH, CONVERT TO A BITMAP BRANCH, THEN INSERT: -// -// Copy the linear branch to a bitmap branch. -// -// TBD: Consider renaming j__udyCreateBranchB() to j__udyConvertBranchLtoB(). - - assert((numJPs) <= cJU_BRANCHLMAXJPS); - - if (j__udyCreateBranchB(Pjp, Pjbl->jbl_jp, Pjbl->jbl_Expanse, - numJPs, Pjpm) == -1) - { - return(-1); - } - -// Convert jp_Type from linear branch to equivalent bitmap branch: - - Pjp->jp_Type += cJU_JPBRANCH_B - cJU_JPBRANCH_L; - - j__udyFreeJBL(PjblRaw, Pjpm); // free old BranchL. - -// Having changed branch types, now do the insert in the new branch type: - - goto ContinueInsWalk; - - -// OPPORTUNISTICALLY CONVERT FROM BRANCHL TO BRANCHU: -// -// Memory efficiency is no object because the branchs pop1 is large enough, so -// speed up array access. Come here with PjblRaw set. Note: This is goto -// code because the previous block used to fall through into it as well, but no -// longer. - -ConvertBranchLtoU: - -// Allocate memory for an uncompressed branch: - - if ((PjbuRaw = j__udyAllocJBU(Pjpm)) == (Pjbu_t) NULL) - return(-1); - Pjbu = P_JBU(PjbuRaw); - -// Set the proper NULL type for most of the uncompressed branchs JPs: - - JU_JPSETADT(&newJP, 0, 0, - JU_JPTYPE(Pjp) - cJU_JPBRANCH_L2 + cJU_JPNULL1); - -// Initialize: Pre-set uncompressed branch to mostly JPNULL*s: - - for (numJPs = 0; numJPs < cJU_BRANCHUNUMJPS; ++numJPs) - Pjbu->jbu_jp[numJPs] = newJP; - -// Copy JPs from linear branch to uncompressed branch: - - { -#ifdef SUBEXPCOUNTS - Word_t popmask = cJU_POP0MASK(JU_JPTYPE(Pjp)) - - cJU_JPBRANCH_L2 - 2; - - for (numJPs = 0; numJPs < cJU_NUMSUBEXPU; ++numJPs) - Pjbu->jbu_subPop1[numJPs] = 0; -#endif - for (numJPs = 0; numJPs < Pjbl->jbl_NumJPs; ++numJPs) - { - Pjp_t Pjp1 = &(Pjbl->jbl_jp[numJPs]); - offset = Pjbl->jbl_Expanse[numJPs]; - Pjbu->jbu_jp[offset] = *Pjp1; -#ifdef SUBEXPCOUNTS - Pjbu->jbu_subPop1[offset/cJU_NUMSUBEXPU] += - JU_JPDCDPOP0(Pjp1) & popmask + 1; -#endif - } - } - j__udyFreeJBL(PjblRaw, Pjpm); // free old BranchL. - -// Plug new values into parent JP: - - Pjp->jp_Addr = (Word_t) PjbuRaw; - Pjp->jp_Type += cJU_JPBRANCH_U - cJU_JPBRANCH_L; // to BranchU. - -// Save global population of last BranchU conversion: - - Pjpm->jpm_LastUPop0 = Pjpm->jpm_Pop0; - goto ContinueInsWalk; - - } // case cJU_JPBRANCH_L. - - -// **************************************************************************** -// JPBRANCH_B*: -// -// If the new Index is not an outlier to the branchs expanse, extract the -// digit and record the Immediate type to create for a new Immed JP, before -// going to common code. -// -// Note: JU_CHECK_IF_OUTLIER() is a no-op for BranchB3[7] on 32[64]-bit. - - case cJU_JPBRANCH_B2: - JU_BRANCH_OUTLIER(digit, exppop1, 2, Pjp, Index, Pjpm); - goto JudyBranchB; - - case cJU_JPBRANCH_B3: - JU_BRANCH_OUTLIER(digit, exppop1, 3, Pjp, Index, Pjpm); - goto JudyBranchB; - -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - JU_BRANCH_OUTLIER(digit, exppop1, 4, Pjp, Index, Pjpm); - goto JudyBranchB; - - case cJU_JPBRANCH_B5: - JU_BRANCH_OUTLIER(digit, exppop1, 5, Pjp, Index, Pjpm); - goto JudyBranchB; - - case cJU_JPBRANCH_B6: - JU_BRANCH_OUTLIER(digit, exppop1, 6, Pjp, Index, Pjpm); - goto JudyBranchB; - - case cJU_JPBRANCH_B7: - JU_BRANCH_OUTLIER(digit, exppop1, 7, Pjp, Index, Pjpm); - goto JudyBranchB; -#endif - - case cJU_JPBRANCH_B: - { - Pjbb_t Pjbb; // pointer to bitmap branch. - Pjbb_t PjbbRaw; // pointer to bitmap branch. - Pjp_t Pjp2Raw; // 1 of N arrays of JPs. - Pjp_t Pjp2; // 1 of N arrays of JPs. - Word_t subexp; // 1 of N subexpanses in bitmap. - BITMAPB_t bitmap; // for one subexpanse. - BITMAPB_t bitmask; // bit set for Indexs digit. - Word_t numJPs; // number of JPs = populated expanses. - int offset; // in bitmap branch. - -// Similar to common code above, but no outlier check is needed, and the Immed -// type depends on the word size: - - digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - exppop1 = Pjpm->jpm_Pop0; - - // fall through: - - -// COMMON CODE FOR BITMAP BRANCHES: -// -// Come here with digit and exppop1 already set. - -JudyBranchB: - -// If population increment is greater than.. (300): - - if ((Pjpm->jpm_Pop0 - Pjpm->jpm_LastUPop0) > JU_BTOU_POP_INCREMENT) - { - -// If total population of array is greater than.. (750): - - if (Pjpm->jpm_Pop0 > JU_BRANCHB_MAX_POP) - { - -// If population under the branch is greater than.. (135): - - if (exppop1 > JU_BRANCHB_MIN_POP) - { - if (j__udyCreateBranchU(Pjp, Pjpm) == -1) return(-1); - -// Save global population of last BranchU conversion: - - Pjpm->jpm_LastUPop0 = Pjpm->jpm_Pop0; - - goto ContinueInsWalk; - } - } - } - -// CONTINUE TO USE BRANCHB: -// -// Get pointer to bitmap branch (JBB): - - PjbbRaw = (Pjbb_t) (Pjp->jp_Addr); - Pjbb = P_JBB(PjbbRaw); - -// Form the Int32 offset, and Bit offset values: -// -// 8 bit Decode | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -// |SubExpanse | Bit offset | -// -// Get the 1 of 8 expanses from digit, Bits 5..7 = 1 of 8, and get the 32-bit -// word that may have a bit set: - - subexp = digit / cJU_BITSPERSUBEXPB; - bitmap = JU_JBB_BITMAP(Pjbb, subexp); - - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); - Pjp2 = P_JP(Pjp2Raw); - -// Get the bit position that represents the desired expanse, and get the offset -// into the array of JPs for the JP that matches the bit. - - bitmask = JU_BITPOSMASKB(digit); - offset = j__udyCountBitsB(bitmap & (bitmask - 1)); - -// If JP is already in this expanse, get Pjp and continue the walk: - - if (bitmap & bitmask) - { -#ifdef SUBEXPCOUNTS - PSubExp = &(Pjbb->jbb_Counts[subexp]); // ptr to subexp counts. -#endif - Pjp = Pjp2 + offset; - break; // continue walk. - } - - -// ADD NEW EXPANSE FOR NEW INDEX: -// -// The new expanse always an cJU_JPIMMED_*_01 containing just the new Index, so -// finish setting up an Immed JP. - - JU_JPSETADT(&newJP, 0, Index, - JU_JPTYPE(Pjp) + cJU_JPIMMED_1_01-cJU_JPBRANCH_B2); - -// Get 1 of the 8 JP arrays and calculate number of JPs in subexpanse array: - - Pjp2Raw = JU_JBB_PJP(Pjbb, subexp); - Pjp2 = P_JP(Pjp2Raw); - numJPs = j__udyCountBitsB(bitmap); - -// Expand branch JP subarray in-place: - - if (JU_BRANCHBJPGROWINPLACE(numJPs)) - { - assert(numJPs > 0); - JU_INSERTINPLACE(Pjp2, numJPs, offset, newJP); -#ifdef JUDYL - // value area is first word of new Immed 01 JP: - Pjpm->jpm_PValue = (Pjv_t) (Pjp2 + offset); -#endif - } - -// No room, allocate a bigger bitmap branch JP subarray: - - else - { - Pjp_t PjpnewRaw; - Pjp_t Pjpnew; - - if ((PjpnewRaw = j__udyAllocJBBJP(numJPs + 1, Pjpm)) == 0) - return(-1); - Pjpnew = P_JP(PjpnewRaw); - -// If there was an old JP array, then copy it, insert the new Immed JP, and -// free the old array: - - if (numJPs) - { - JU_INSERTCOPY(Pjpnew, Pjp2, numJPs, offset, newJP); - j__udyFreeJBBJP(Pjp2Raw, numJPs, Pjpm); -#ifdef JUDYL - // value area is first word of new Immed 01 JP: - Pjpm->jpm_PValue = (Pjv_t) (Pjpnew + offset); -#endif - } - -// New JP subarray; point to cJU_JPIMMED_*_01 and place it: - - else - { - assert(JU_JBB_PJP(Pjbb, subexp) == (Pjp_t) NULL); - Pjp = Pjpnew; - *Pjp = newJP; // copy to new memory. -#ifdef JUDYL - // value area is first word of new Immed 01 JP: - Pjpm->jpm_PValue = (Pjv_t) (&(Pjp->jp_Addr)); -#endif - } - -// Place new JP subarray in BranchB: - - JU_JBB_PJP(Pjbb, subexp) = PjpnewRaw; - - } // else - -// Set the new Indexs bit: - - JU_JBB_BITMAP(Pjbb, subexp) |= bitmask; - - return(1); - - } // case - - -// **************************************************************************** -// JPBRANCH_U*: -// -// Just drop through the JP for the correct digit. If the JP turns out to be a -// JPNULL*, thats OK, the memory is already allocated, and the next walk -// simply places an Immed in it. -// -#ifdef SUBEXPCOUNTS -#define JU_GETSUBEXP(PSubExp,Pjbu,Digit) \ - (PSubExp) = &((Pjbu)->jbu_subPop1[(Digit) / cJU_NUMSUBEXPU]) -#else -#define JU_GETSUBEXP(PSubExp,Pjbu,Digit) // null. -#endif - -#define JU_JBU_PJP_SUBEXP(Pjp,PSubExp,Index,Level) \ - { \ - uint8_t digit = JU_DIGITATSTATE(Index, Level); \ - Pjbu_t P_jbu = P_JBU((Pjp)->jp_Addr); \ - (Pjp) = &(P_jbu->jbu_jp[digit]); \ - JU_GETSUBEXP(PSubExp, P_jbu, digit); \ - } - - case cJU_JPBRANCH_U2: - JU_CHECK_IF_OUTLIER(Pjp, Index, 2, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 2); - break; - -#ifdef JU_64BIT - case cJU_JPBRANCH_U3: - JU_CHECK_IF_OUTLIER(Pjp, Index, 3, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 3); - break; - - case cJU_JPBRANCH_U4: - JU_CHECK_IF_OUTLIER(Pjp, Index, 4, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 4); - break; - - case cJU_JPBRANCH_U5: - JU_CHECK_IF_OUTLIER(Pjp, Index, 5, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 5); - break; - - case cJU_JPBRANCH_U6: - JU_CHECK_IF_OUTLIER(Pjp, Index, 6, Pjpm); - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 6); - break; - - case cJU_JPBRANCH_U7: - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 7); -#else - case cJU_JPBRANCH_U3: - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, 3); -#endif - break; - - case cJU_JPBRANCH_U: - JU_JBU_PJP_SUBEXP(Pjp, PSubExp, Index, cJU_ROOTSTATE); - break; - - -// **************************************************************************** -// JPLEAF*: -// -// COMMON CODE FRAGMENTS TO MINIMIZE REDUNDANCY BELOW: -// -// These are necessary to support performance by function and loop unrolling -// while avoiding huge amounts of nearly identical code. -// -// Prepare to handle a linear leaf: Check for an outlier; set pop1 and pointer -// to leaf: - -#ifdef JUDY1 -#define JU_LEAFVALUE(Pjv) // null. -#define JU_LEAFPREPVALUE(Pjv, ValueArea) // null. -#else -#define JU_LEAFVALUE(Pjv) Pjv_t Pjv -#define JU_LEAFPREPVALUE(Pjv, ValueArea) (Pjv) = ValueArea(Pleaf, exppop1) -#endif - -#define JU_LEAFPREP(cIS,Type,MaxPop1,ValueArea) \ - Pjll_t PjllRaw; \ - Type Pleaf; /* specific type */ \ - int offset; \ - JU_LEAFVALUE(Pjv); \ - \ - JU_CHECK_IF_OUTLIER(Pjp, Index, cIS, Pjpm); \ - \ - exppop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - assert(exppop1 <= (MaxPop1)); \ - PjllRaw = (Pjll_t) (Pjp->jp_Addr); \ - Pleaf = (Type) P_JLL(PjllRaw); \ - JU_LEAFPREPVALUE(Pjv, ValueArea) - -// Add to, or grow, a linear leaf: Find Index position; if the Index is -// absent, if theres room in the leaf, insert the Index [and value of 0] in -// place, otherwise grow the leaf: -// -// Note: These insertions always take place with whole words, using -// JU_INSERTINPLACE() or JU_INSERTCOPY(). - -#ifdef JUDY1 -#define JU_LEAFGROWVALUEADD(Pjv,ExpPop1,Offset) // null. -#else -#define JU_LEAFGROWVALUEADD(Pjv,ExpPop1,Offset) \ - JU_INSERTINPLACE(Pjv, ExpPop1, Offset, 0); \ - Pjpm->jpm_PValue = (Pjv) + (Offset) -#endif - -#ifdef JUDY1 -#define JU_LEAFGROWVALUENEW(ValueArea,Pjv,ExpPop1,Offset) // null. -#else -#define JU_LEAFGROWVALUENEW(ValueArea,Pjv,ExpPop1,Offset) \ - { \ - Pjv_t Pjvnew = ValueArea(Pleafnew, (ExpPop1) + 1); \ - JU_INSERTCOPY(Pjvnew, Pjv, ExpPop1, Offset, 0); \ - Pjpm->jpm_PValue = (Pjvnew) + (Offset); \ - } -#endif - -#define JU_LEAFGROW(cIS,Type,MaxPop1,Search,ValueArea,GrowInPlace, \ - InsertInPlace,InsertCopy,Alloc,Free) \ - \ - offset = Search(Pleaf, exppop1, Index); \ - JU_CHECK_IF_EXISTS(offset, Pjv, Pjpm); \ - \ - if (GrowInPlace(exppop1)) /* add to current leaf */ \ - { \ - InsertInPlace(Pleaf, exppop1, offset, Index); \ - JU_LEAFGROWVALUEADD(Pjv, exppop1, offset); \ - DBGCODE(JudyCheckSorted((Pjll_t) Pleaf, exppop1 + 1, cIS);) \ - return(1); \ - } \ - \ - if (exppop1 < (MaxPop1)) /* grow to new leaf */ \ - { \ - Pjll_t PjllnewRaw; \ - Type Pleafnew; \ - if ((PjllnewRaw = Alloc(exppop1 + 1, Pjpm)) == 0) return(-1); \ - Pleafnew = (Type) P_JLL(PjllnewRaw); \ - InsertCopy(Pleafnew, Pleaf, exppop1, offset, Index); \ - JU_LEAFGROWVALUENEW(ValueArea, Pjv, exppop1, offset); \ - DBGCODE(JudyCheckSorted((Pjll_t) Pleafnew, exppop1 + 1, cIS);) \ - Free(PjllRaw, exppop1, Pjpm); \ - (Pjp->jp_Addr) = (Word_t) PjllnewRaw; \ - return(1); \ - } \ - assert(exppop1 == (MaxPop1)) - -// Handle linear leaf overflow (cascade): Splay or compress into smaller -// leaves: - -#define JU_LEAFCASCADE(MaxPop1,Cascade,Free) \ - if (Cascade(Pjp, Pjpm) == -1) return(-1); \ - Free(PjllRaw, MaxPop1, Pjpm); \ - goto ContinueInsWalk - -// Wrapper around all of the above: - -#define JU_LEAFSET(cIS,Type,MaxPop1,Search,GrowInPlace,InsertInPlace, \ - InsertCopy,Cascade,Alloc,Free,ValueArea) \ - { \ - JU_LEAFPREP(cIS,Type,MaxPop1,ValueArea); \ - JU_LEAFGROW(cIS,Type,MaxPop1,Search,ValueArea,GrowInPlace, \ - InsertInPlace,InsertCopy,Alloc,Free); \ - JU_LEAFCASCADE(MaxPop1,Cascade,Free); \ - } - -// END OF MACROS; LEAFL CASES START HERE: -// -// 64-bit Judy1 does not have 1-byte leaves: - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - - case cJU_JPLEAF1: - - JU_LEAFSET(1, uint8_t *, cJU_LEAF1_MAXPOP1, j__udySearchLeaf1, - JU_LEAF1GROWINPLACE, JU_INSERTINPLACE, JU_INSERTCOPY, - j__udyCascade1, j__udyAllocJLL1, j__udyFreeJLL1, - JL_LEAF1VALUEAREA); - -#endif // (JUDYL || ! JU_64BIT) - - case cJU_JPLEAF2: - - JU_LEAFSET(2, uint16_t *, cJU_LEAF2_MAXPOP1, j__udySearchLeaf2, - JU_LEAF2GROWINPLACE, JU_INSERTINPLACE, JU_INSERTCOPY, - j__udyCascade2, j__udyAllocJLL2, j__udyFreeJLL2, - JL_LEAF2VALUEAREA); - - case cJU_JPLEAF3: - - JU_LEAFSET(3, uint8_t *, cJU_LEAF3_MAXPOP1, j__udySearchLeaf3, - JU_LEAF3GROWINPLACE, JU_INSERTINPLACE3, JU_INSERTCOPY3, - j__udyCascade3, j__udyAllocJLL3, j__udyFreeJLL3, - JL_LEAF3VALUEAREA); - -#ifdef JU_64BIT - case cJU_JPLEAF4: - - JU_LEAFSET(4, uint32_t *, cJU_LEAF4_MAXPOP1, j__udySearchLeaf4, - JU_LEAF4GROWINPLACE, JU_INSERTINPLACE, JU_INSERTCOPY, - j__udyCascade4, j__udyAllocJLL4, j__udyFreeJLL4, - JL_LEAF4VALUEAREA); - - case cJU_JPLEAF5: - - JU_LEAFSET(5, uint8_t *, cJU_LEAF5_MAXPOP1, j__udySearchLeaf5, - JU_LEAF5GROWINPLACE, JU_INSERTINPLACE5, JU_INSERTCOPY5, - j__udyCascade5, j__udyAllocJLL5, j__udyFreeJLL5, - JL_LEAF5VALUEAREA); - - case cJU_JPLEAF6: - - JU_LEAFSET(6, uint8_t *, cJU_LEAF6_MAXPOP1, j__udySearchLeaf6, - JU_LEAF6GROWINPLACE, JU_INSERTINPLACE6, JU_INSERTCOPY6, - j__udyCascade6, j__udyAllocJLL6, j__udyFreeJLL6, - JL_LEAF6VALUEAREA); - - case cJU_JPLEAF7: - - JU_LEAFSET(7, uint8_t *, cJU_LEAF7_MAXPOP1, j__udySearchLeaf7, - JU_LEAF7GROWINPLACE, JU_INSERTINPLACE7, JU_INSERTCOPY7, - j__udyCascade7, j__udyAllocJLL7, j__udyFreeJLL7, - JL_LEAF7VALUEAREA); -#endif // JU_64BIT - - -// **************************************************************************** -// JPLEAF_B1: -// -// 8 bit Decode | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -// |SubExpanse | Bit offset | -// -// Note: For JudyL, values are stored in 8 subexpanses, each a linear word -// array of up to 32 values each. - - case cJU_JPLEAF_B1: - { -#ifdef JUDYL - Pjv_t PjvRaw; // pointer to value part of the leaf. - Pjv_t Pjv; // pointer to value part of the leaf. - Pjv_t PjvnewRaw; // new value area. - Pjv_t Pjvnew; // new value area. - Word_t subexp; // 1 of 8 subexpanses in bitmap. - Pjlb_t Pjlb; // pointer to bitmap part of the leaf. - BITMAPL_t bitmap; // for one subexpanse. - BITMAPL_t bitmask; // bit set for Indexs digit. - int offset; // of index in value area. -#endif - - JU_CHECK_IF_OUTLIER(Pjp, Index, 1, Pjpm); - -#ifdef JUDY1 - -// If Index (bit) is already set, return now: - - if (JU_BITMAPTESTL(P_JLB(Pjp->jp_Addr), Index)) return(0); - -// If bitmap is not full, set the new Indexs bit; otherwise convert to a Full: - - if ((exppop1 = JU_JPLEAF_POP0(Pjp) + 1) - < cJU_JPFULLPOPU1_POP0) - { - JU_BITMAPSETL(P_JLB(Pjp->jp_Addr), Index); - } - else - { - j__udyFreeJLB1((Pjlb_t) (Pjp->jp_Addr), Pjpm); // free LeafB1. - Pjp->jp_Type = cJ1_JPFULLPOPU1; - Pjp->jp_Addr = 0; - } - -#else // JUDYL - -// This is very different from Judy1 because of the need to return a value area -// even for an existing Index, or manage the value area for a new Index, and -// because JudyL has no Full type: - -// Get last byte to decode from Index, and pointer to bitmap leaf: - - digit = JU_DIGITATSTATE(Index, 1); - Pjlb = P_JLB(Pjp->jp_Addr); - -// Prepare additional values: - - subexp = digit / cJU_BITSPERSUBEXPL; // which subexpanse. - bitmap = JU_JLB_BITMAP(Pjlb, subexp); // subexps 32-bit map. - PjvRaw = JL_JLB_PVALUE(Pjlb, subexp); // corresponding values. - Pjv = P_JV(PjvRaw); // corresponding values. - bitmask = JU_BITPOSMASKL(digit); // mask for Index. - offset = j__udyCountBitsL(bitmap & (bitmask - 1)); // of Index. - -// If Index already exists, get value pointer and exit: - - if (bitmap & bitmask) - { - assert(Pjv); - Pjpm->jpm_PValue = Pjv + offset; // existing value. - return(0); - } - -// Get the total bits set = expanse population of Value area: - - exppop1 = j__udyCountBitsL(bitmap); - -// If the value area can grow in place, do it: - - if (JL_LEAFVGROWINPLACE(exppop1)) - { - JU_INSERTINPLACE(Pjv, exppop1, offset, 0); - JU_JLB_BITMAP(Pjlb, subexp) |= bitmask; // set Indexs bit. - Pjpm->jpm_PValue = Pjv + offset; // new value area. - return(1); - } - -// Increase size of value area: - - if ((PjvnewRaw = j__udyLAllocJV(exppop1 + 1, Pjpm)) - == (Pjv_t) NULL) return(-1); - Pjvnew = P_JV(PjvnewRaw); - - if (exppop1) // have existing value area. - { - assert(Pjv); - JU_INSERTCOPY(Pjvnew, Pjv, exppop1, offset, 0); - Pjpm->jpm_PValue = Pjvnew + offset; - j__udyLFreeJV(PjvRaw, exppop1, Pjpm); // free old values. - } - else // first index, new value area: - { - Pjpm->jpm_PValue = Pjvnew; - *(Pjpm->jpm_PValue) = 0; - } - -// Set bit for new Index and place new leaf value area in bitmap: - - JU_JLB_BITMAP(Pjlb, subexp) |= bitmask; - JL_JLB_PVALUE(Pjlb, subexp) = PjvnewRaw; - -#endif // JUDYL - - return(1); - - } // case - - -#ifdef JUDY1 -// **************************************************************************** -// JPFULLPOPU1: -// -// If Index is not an outlier, then by definition its already set. - - case cJ1_JPFULLPOPU1: - - JU_CHECK_IF_OUTLIER(Pjp, Index, 1, Pjpm); - return(0); -#endif - - -// **************************************************************************** -// JPIMMED*: -// -// This is some of the most complex code in Judy considering Judy1 versus JudyL -// and 32-bit versus 64-bit variations. The following comments attempt to make -// this clearer. -// -// Of the 2 words in a JP, for immediate indexes Judy1 can use 2 words - 1 byte -// = 7 [15] bytes, but JudyL can only use 1 word - 1 byte = 3 [7] bytes because -// the other word is needed for a value area or a pointer to a value area. -// -// For both Judy1 and JudyL, cJU_JPIMMED_*_01 indexes are in word 2; otherwise -// for Judy1 only, a list of 2 or more indexes starts in word 1. JudyL keeps -// the list in word 2 because word 1 is a pointer (to a LeafV, that is, a leaf -// containing only values). Furthermore, cJU_JPIMMED_*_01 indexes are stored -// all-but-first-byte in jp_DcdPopO, not just the Index Sizes bytes. -// -// TBD: This can be confusing because Doug didnt use data structures for it. -// Instead he often directly accesses Pjp for the first word and jp_DcdPopO for -// the second word. It would be nice to use data structs, starting with -// jp_1Index and jp_LIndex where possible. -// -// Maximum Immed JP types for Judy1/JudyL, depending on Index Size (cIS): -// -// 32-bit 64-bit -// -// bytes: 7/ 3 15/ 7 (Judy1/JudyL) -// -// cIS -// 1_ 07/03 15/07 (as in: cJ1_JPIMMED_1_07) -// 2_ 03/01 07/03 -// 3_ 02/01 05/02 -// 4_ 03/01 -// 5_ 03/01 -// 6_ 02/01 -// 7_ 02/01 -// -// State transitions while inserting an Index, matching the above table: -// (Yes, this is very terse... Study it and it will make sense.) -// (Note, parts of this diagram are repeated below for quick reference.) -// -// +-- reformat JP here for Judy1 only, from word-2 to word-1 -// | -// | JUDY1 || JU_64BIT JUDY1 && JU_64BIT -// V -// 1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] Leaf1 (*) -// 2_01 => [ 2_02 => 2_03 => [ 2_04..07 => ]] Leaf2 -// 3_01 => [ 3_02 => [ 3_03..05 => ]] Leaf3 -// JU_64BIT only: -// 4_01 => [[ 4_02..03 => ]] Leaf4 -// 5_01 => [[ 5_02..03 => ]] Leaf5 -// 6_01 => [[ 6_02 => ]] Leaf6 -// 7_01 => [[ 7_02 => ]] Leaf7 -// -// (*) For Judy1 & 64-bit, go directly from cJU_JPIMMED_1_15 to a LeafB1; skip -// Leaf1, as described in Judy1.h regarding cJ1_JPLEAF1. - - -// COMMON CODE FRAGMENTS TO MINIMIZE REDUNDANCY BELOW: -// -// These are necessary to support performance by function and loop unrolling -// while avoiding huge amounts of nearly identical code. -// -// The differences between Judy1 and JudyL with respect to value area handling -// are just too large for completely common code between them... Oh well, some -// big ifdefs follow. However, even in the following ifdefd code, use cJU_*, -// JU_*, and Judy*() instead of cJ1_* / cJL_*, J1_* / JL_*, and -// Judy1*()/JudyL*(), for minimum diffs. -// -// Handle growth of cJU_JPIMMED_*_01 to cJU_JPIMMED_*_02, for an even or odd -// Index Size (cIS), given oldIndex, Index, and Pjll in the context: -// -// Put oldIndex and Index in their proper order. For odd indexes, must copy -// bytes. - -#ifdef JUDY1 - -#define JU_IMMSET_01_COPY_EVEN(ignore1,ignore2) \ - if (oldIndex < Index) { Pjll[0] = oldIndex; Pjll[1] = Index; } \ - else { Pjll[0] = Index; Pjll[1] = oldIndex; } - -#define JU_IMMSET_01_COPY_ODD(cIS,CopyWord) \ - if (oldIndex < Index) \ - { \ - CopyWord(Pjll + 0, oldIndex); \ - CopyWord(Pjll + (cIS), Index); \ - } \ - else \ - { \ - CopyWord(Pjll + 0, Index); \ - CopyWord(Pjll + (cIS), oldIndex); \ - } - -// The "real" *_01 Copy macro: -// -// Trim the high byte off Index, look for a match with the old Index, and if -// none, insert the new Index in the leaf in the correct place, given Pjp and -// Index in the context. -// -// Note: A single immediate index lives in the jp_DcdPopO field, but two or -// more reside starting at Pjp->jp_1Index. - -#define JU_IMMSET_01_COPY(cIS,LeafType,NewJPType,Copy,CopyWord) \ - { \ - LeafType Pjll; \ - Word_t oldIndex = JU_JPDCDPOP0(Pjp); \ - \ - Index = JU_TRIMTODCDSIZE(Index); \ - if (oldIndex == Index) return(0); \ - \ - Pjll = (LeafType) (Pjp->jp_1Index); \ - Copy(cIS,CopyWord); \ - DBGCODE(JudyCheckSorted(Pjll, 2, cIS);) \ - \ - Pjp->jp_Type = (NewJPType); \ - return(1); \ - } - -#else // JUDYL - -// Variations to also handle value areas; see comments above: -// -// For JudyL, Pjv (start of value area) and oldValue are also in the context; -// leave Pjv set to the value area for Index. - -#define JU_IMMSET_01_COPY_EVEN(cIS,CopyWord) \ - if (oldIndex < Index) \ - { \ - Pjll[0] = oldIndex; \ - Pjv [0] = oldValue; \ - Pjll[1] = Index; \ - ++Pjv; \ - } \ - else \ - { \ - Pjll[0] = Index; \ - Pjll[1] = oldIndex; \ - Pjv [1] = oldValue; \ - } - -#define JU_IMMSET_01_COPY_ODD(cIS,CopyWord) \ - if (oldIndex < Index) \ - { \ - CopyWord(Pjll + 0, oldIndex); \ - CopyWord(Pjll + (cIS), Index); \ - Pjv[0] = oldValue; \ - ++Pjv; \ - } \ - else \ - { \ - CopyWord(Pjll + 0, Index); \ - CopyWord(Pjll + (cIS), oldIndex); \ - Pjv[1] = oldValue; \ - } - -// The old value area is in the first word (*Pjp), and Pjv and Pjpm are also in -// the context. Also, unlike Judy1, indexes remain in word 2 (jp_LIndex), -// meaning insert-in-place rather than copy. -// -// Return jpm_PValue pointing to Indexs value area. If Index is new, allocate -// a 2-value-leaf and attach it to the JP. - -#define JU_IMMSET_01_COPY(cIS,LeafType,NewJPType,Copy,CopyWord) \ - { \ - LeafType Pjll; \ - Word_t oldIndex = JU_JPDCDPOP0(Pjp); \ - Word_t oldValue; \ - Pjv_t PjvRaw; \ - Pjv_t Pjv; \ - \ - Index = JU_TRIMTODCDSIZE(Index); \ - \ - if (oldIndex == Index) \ - { \ - Pjpm->jpm_PValue = (Pjv_t) Pjp; \ - return(0); \ - } \ - \ - if ((PjvRaw = j__udyLAllocJV(2, Pjpm)) == (Pjv_t) NULL) \ - return(-1); \ - Pjv = P_JV(PjvRaw); \ - \ - oldValue = Pjp->jp_Addr; \ - (Pjp->jp_Addr) = (Word_t) PjvRaw; \ - Pjll = (LeafType) (Pjp->jp_LIndex); \ - \ - Copy(cIS,CopyWord); \ - DBGCODE(JudyCheckSorted(Pjll, 2, cIS);) \ - \ - Pjp->jp_Type = (NewJPType); \ - *Pjv = 0; \ - Pjpm->jpm_PValue = Pjv; \ - return(1); \ - } - -// The following is a unique mix of JU_IMMSET_01() and JU_IMMSETCASCADE() for -// going from cJU_JPIMMED_*_01 directly to a cJU_JPLEAF* for JudyL: -// -// If Index is not already set, allocate a leaf, copy the old and new indexes -// into it, clear and return the new value area, and modify the current JP. -// Note that jp_DcdPop is set to a pop0 of 0 for now, and incremented later. - - -#define JU_IMMSET_01_CASCADE(cIS,LeafType,NewJPType,ValueArea, \ - Copy,CopyWord,Alloc) \ - { \ - Word_t D_P0; \ - LeafType PjllRaw; \ - LeafType Pjll; \ - Word_t oldIndex = JU_JPDCDPOP0(Pjp); \ - Word_t oldValue; \ - Pjv_t Pjv; \ - \ - Index = JU_TRIMTODCDSIZE(Index); \ - \ - if (oldIndex == Index) \ - { \ - Pjpm->jpm_PValue = (Pjv_t) (&(Pjp->jp_Addr)); \ - return(0); \ - } \ - \ - if ((PjllRaw = (LeafType) Alloc(2, Pjpm)) == (LeafType) NULL) \ - return(-1); \ - Pjll = (LeafType) P_JLL(PjllRaw); \ - Pjv = ValueArea(Pjll, 2); \ - \ - oldValue = Pjp->jp_Addr; \ - \ - Copy(cIS,CopyWord); \ - DBGCODE(JudyCheckSorted(Pjll, 2, cIS);) \ - \ - *Pjv = 0; \ - Pjpm->jpm_PValue = Pjv; \ - D_P0 = Index & cJU_DCDMASK(cIS); /* pop0 = 0 */ \ - JU_JPSETADT(Pjp, (Word_t)PjllRaw, D_P0, NewJPType); \ - \ - return(1); \ - } - -#endif // JUDYL - -// Handle growth of cJU_JPIMMED_*_[02..15]: - -#ifdef JUDY1 - -// Insert an Index into an immediate JP that has room for more, if the Index is -// not already present; given Pjp, Index, exppop1, Pjv, and Pjpm in the -// context: -// -// Note: Use this only when the JP format doesnt change, that is, going from -// cJU_JPIMMED_X_0Y to cJU_JPIMMED_X_0Z, where X >= 2 and Y+1 = Z. -// -// Note: Incrementing jp_Type is how to increase the Index population. - -#define JU_IMMSETINPLACE(cIS,LeafType,BaseJPType_02,Search,InsertInPlace) \ - { \ - LeafType Pjll; \ - int offset; \ - \ - exppop1 = JU_JPTYPE(Pjp) - (BaseJPType_02) + 2; \ - offset = Search((Pjll_t) (Pjp->jp_1Index), exppop1, Index); \ - \ - JU_CHECK_IF_EXISTS(offset, ignore, Pjpm); \ - \ - Pjll = (LeafType) (Pjp->jp_1Index); \ - InsertInPlace(Pjll, exppop1, offset, Index); \ - DBGCODE(JudyCheckSorted(Pjll, exppop1 + 1, cIS);) \ - ++(Pjp->jp_Type); \ - return(1); \ - } - -// Insert an Index into an immediate JP that has no room for more: -// -// If the Index is not already present, do a cascade (to a leaf); given Pjp, -// Index, Pjv, and Pjpm in the context. - - -#define JU_IMMSETCASCADE(cIS,OldPop1,LeafType,NewJPType, \ - ignore,Search,InsertCopy,Alloc) \ - { \ - Word_t D_P0; \ - Pjll_t PjllRaw; \ - Pjll_t Pjll; \ - int offset; \ - \ - offset = Search((Pjll_t) (Pjp->jp_1Index), (OldPop1), Index); \ - JU_CHECK_IF_EXISTS(offset, ignore, Pjpm); \ - \ - if ((PjllRaw = Alloc((OldPop1) + 1, Pjpm)) == 0) return(-1); \ - Pjll = P_JLL(PjllRaw); \ - \ - InsertCopy((LeafType) Pjll, (LeafType) (Pjp->jp_1Index), \ - OldPop1, offset, Index); \ - DBGCODE(JudyCheckSorted(Pjll, (OldPop1) + 1, cIS);) \ - \ - D_P0 = (Index & cJU_DCDMASK(cIS)) + (OldPop1) - 1; \ - JU_JPSETADT(Pjp, (Word_t)PjllRaw, D_P0, NewJPType); \ - return(1); \ - } - -#else // JUDYL - -// Variations to also handle value areas; see comments above: -// -// For JudyL, Pjv (start of value area) is also in the context. -// -// TBD: This code makes a true but weak assumption that a JudyL 32-bit 2-index -// value area must be copied to a new 3-index value area. AND it doesnt know -// anything about JudyL 64-bit cases (cJU_JPIMMED_1_0[3-7] only) where the -// value area can grow in place! However, this should not break it, just slow -// it down. - -#define JU_IMMSETINPLACE(cIS,LeafType,BaseJPType_02,Search,InsertInPlace) \ - { \ - LeafType Pleaf; \ - int offset; \ - Pjv_t PjvRaw; \ - Pjv_t Pjv; \ - Pjv_t PjvnewRaw; \ - Pjv_t Pjvnew; \ - \ - exppop1 = JU_JPTYPE(Pjp) - (BaseJPType_02) + 2; \ - offset = Search((Pjll_t) (Pjp->jp_LIndex), exppop1, Index); \ - PjvRaw = (Pjv_t) (Pjp->jp_Addr); \ - Pjv = P_JV(PjvRaw); \ - \ - JU_CHECK_IF_EXISTS(offset, Pjv, Pjpm); \ - \ - if ((PjvnewRaw = j__udyLAllocJV(exppop1 + 1, Pjpm)) \ - == (Pjv_t) NULL) return(-1); \ - Pjvnew = P_JV(PjvnewRaw); \ - \ - Pleaf = (LeafType) (Pjp->jp_LIndex); \ - \ - InsertInPlace(Pleaf, exppop1, offset, Index); \ - /* see TBD above about this: */ \ - JU_INSERTCOPY(Pjvnew, Pjv, exppop1, offset, 0); \ - DBGCODE(JudyCheckSorted(Pleaf, exppop1 + 1, cIS);) \ - j__udyLFreeJV(PjvRaw, exppop1, Pjpm); \ - Pjp->jp_Addr = (Word_t) PjvnewRaw; \ - Pjpm->jpm_PValue = Pjvnew + offset; \ - \ - ++(Pjp->jp_Type); \ - return(1); \ - } - -#define JU_IMMSETCASCADE(cIS,OldPop1,LeafType,NewJPType, \ - ValueArea,Search,InsertCopy,Alloc) \ - { \ - Word_t D_P0; \ - Pjll_t PjllRaw; \ - Pjll_t Pjll; \ - int offset; \ - Pjv_t PjvRaw; \ - Pjv_t Pjv; \ - Pjv_t Pjvnew; \ - \ - PjvRaw = (Pjv_t) (Pjp->jp_Addr); \ - Pjv = P_JV(PjvRaw); \ - offset = Search((Pjll_t) (Pjp->jp_LIndex), (OldPop1), Index); \ - JU_CHECK_IF_EXISTS(offset, Pjv, Pjpm); \ - \ - if ((PjllRaw = Alloc((OldPop1) + 1, Pjpm)) == 0) \ - return(-1); \ - Pjll = P_JLL(PjllRaw); \ - InsertCopy((LeafType) Pjll, (LeafType) (Pjp->jp_LIndex), \ - OldPop1, offset, Index); \ - DBGCODE(JudyCheckSorted(Pjll, (OldPop1) + 1, cIS);) \ - \ - Pjvnew = ValueArea(Pjll, (OldPop1) + 1); \ - JU_INSERTCOPY(Pjvnew, Pjv, OldPop1, offset, 0); \ - j__udyLFreeJV(PjvRaw, (OldPop1), Pjpm); \ - Pjpm->jpm_PValue = Pjvnew + offset; \ - \ - D_P0 = (Index & cJU_DCDMASK(cIS)) + (OldPop1) - 1; \ - JU_JPSETADT(Pjp, (Word_t)PjllRaw, D_P0, NewJPType); \ - return(1); \ - } - -#endif // JUDYL - -// Common convenience/shorthand wrappers around JU_IMMSET_01_COPY() for -// even/odd index sizes: - -#define JU_IMMSET_01( cIS, LeafType, NewJPType) \ - JU_IMMSET_01_COPY(cIS, LeafType, NewJPType, JU_IMMSET_01_COPY_EVEN, \ - ignore) - -#define JU_IMMSET_01_ODD( cIS, NewJPType, CopyWord) \ - JU_IMMSET_01_COPY(cIS, uint8_t *, NewJPType, JU_IMMSET_01_COPY_ODD, \ - CopyWord) - - -// END OF MACROS; IMMED CASES START HERE: - -// cJU_JPIMMED_*_01 cases: -// -// 1_01 always leads to 1_02: -// -// (1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] LeafL) - - case cJU_JPIMMED_1_01: JU_IMMSET_01(1, uint8_t *, cJU_JPIMMED_1_02); - -// 2_01 leads to 2_02, and 3_01 leads to 3_02, except for JudyL 32-bit, where -// they lead to a leaf: -// -// (2_01 => [ 2_02 => 2_03 => [ 2_04..07 => ]] LeafL) -// (3_01 => [ 3_02 => [ 3_03..05 => ]] LeafL) - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_01: JU_IMMSET_01(2, uint16_t *, cJU_JPIMMED_2_02); - case cJU_JPIMMED_3_01: JU_IMMSET_01_ODD (3, cJU_JPIMMED_3_02, - JU_COPY3_LONG_TO_PINDEX); -#else - case cJU_JPIMMED_2_01: - JU_IMMSET_01_CASCADE(2, uint16_t *, cJU_JPLEAF2, JL_LEAF2VALUEAREA, - JU_IMMSET_01_COPY_EVEN, ignore, - j__udyAllocJLL2); - case cJU_JPIMMED_3_01: - JU_IMMSET_01_CASCADE(3, uint8_t *, cJU_JPLEAF3, JL_LEAF3VALUEAREA, - JU_IMMSET_01_COPY_ODD, - JU_COPY3_LONG_TO_PINDEX, j__udyAllocJLL3); -#endif - -#ifdef JU_64BIT - -// [4-7]_01 lead to [4-7]_02 for Judy1, and to leaves for JudyL: -// -// (4_01 => [[ 4_02..03 => ]] LeafL) -// (5_01 => [[ 5_02..03 => ]] LeafL) -// (6_01 => [[ 6_02 => ]] LeafL) -// (7_01 => [[ 7_02 => ]] LeafL) - -#ifdef JUDY1 - case cJU_JPIMMED_4_01: JU_IMMSET_01(4, uint32_t *, cJ1_JPIMMED_4_02); - case cJU_JPIMMED_5_01: JU_IMMSET_01_ODD(5, cJ1_JPIMMED_5_02, - JU_COPY5_LONG_TO_PINDEX); - case cJU_JPIMMED_6_01: JU_IMMSET_01_ODD(6, cJ1_JPIMMED_6_02, - JU_COPY6_LONG_TO_PINDEX); - case cJU_JPIMMED_7_01: JU_IMMSET_01_ODD(7, cJ1_JPIMMED_7_02, - JU_COPY7_LONG_TO_PINDEX); -#else // JUDYL - case cJU_JPIMMED_4_01: - JU_IMMSET_01_CASCADE(4, uint32_t *, cJU_JPLEAF4, JL_LEAF4VALUEAREA, - JU_IMMSET_01_COPY_EVEN, ignore, - j__udyAllocJLL4); - case cJU_JPIMMED_5_01: - JU_IMMSET_01_CASCADE(5, uint8_t *, cJU_JPLEAF5, JL_LEAF5VALUEAREA, - JU_IMMSET_01_COPY_ODD, - JU_COPY5_LONG_TO_PINDEX, j__udyAllocJLL5); - case cJU_JPIMMED_6_01: - JU_IMMSET_01_CASCADE(6, uint8_t *, cJU_JPLEAF6, JL_LEAF6VALUEAREA, - JU_IMMSET_01_COPY_ODD, - JU_COPY6_LONG_TO_PINDEX, j__udyAllocJLL6); - case cJU_JPIMMED_7_01: - JU_IMMSET_01_CASCADE(7, uint8_t *, cJU_JPLEAF7, JL_LEAF7VALUEAREA, - JU_IMMSET_01_COPY_ODD, - JU_COPY7_LONG_TO_PINDEX, j__udyAllocJLL7); -#endif // JUDYL -#endif // JU_64BIT - -// cJU_JPIMMED_1_* cases that can grow in place: -// -// (1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] LeafL) - - case cJU_JPIMMED_1_02: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_03: - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJU_JPIMMED_1_07: - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: -#endif - JU_IMMSETINPLACE(1, uint8_t *, cJU_JPIMMED_1_02, j__udySearchLeaf1, - JU_INSERTINPLACE); - -// cJU_JPIMMED_1_* cases that must cascade: -// -// (1_01 => 1_02 => 1_03 => [ 1_04 => ... => 1_07 => [ 1_08..15 => ]] LeafL) - -#if (defined(JUDYL) && (! defined(JU_64BIT))) - case cJU_JPIMMED_1_03: - JU_IMMSETCASCADE(1, 3, uint8_t *, cJU_JPLEAF1, JL_LEAF1VALUEAREA, - j__udySearchLeaf1, JU_INSERTCOPY, - j__udyAllocJLL1); -#endif -#if (defined(JUDY1) && (! defined(JU_64BIT))) - case cJU_JPIMMED_1_07: - JU_IMMSETCASCADE(1, 7, uint8_t *, cJU_JPLEAF1, ignore, - j__udySearchLeaf1, JU_INSERTCOPY, - j__udyAllocJLL1); - -#endif -#if (defined(JUDYL) && defined(JU_64BIT)) - case cJU_JPIMMED_1_07: - JU_IMMSETCASCADE(1, 7, uint8_t *, cJU_JPLEAF1, JL_LEAF1VALUEAREA, - j__udySearchLeaf1, JU_INSERTCOPY, - j__udyAllocJLL1); - -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) -// Special case, as described above, go directly from Immed to LeafB1: - - case cJ1_JPIMMED_1_15: - { - Word_t DcdP0; - int offset; - Pjlb_t PjlbRaw; - Pjlb_t Pjlb; - - offset = j__udySearchLeaf1((Pjll_t) Pjp->jp_1Index, 15, Index); - - JU_CHECK_IF_EXISTS(offset, ignore, Pjpm); - -// Create a bitmap leaf (special case for Judy1 64-bit only, see usage): Set -// new Index in bitmap, copy an Immed1_15 to the bitmap, and set the parent JP -// EXCEPT jp_DcdPopO, leaving any followup to the caller: - - if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL) - return(-1); - Pjlb = P_JLB(PjlbRaw); - - JU_BITMAPSETL(Pjlb, Index); - - for (offset = 0; offset < 15; ++offset) - JU_BITMAPSETL(Pjlb, Pjp->jp_1Index[offset]); - -// Set jp_DcdPopO including the current pop0; incremented later: - DcdP0 = (Index & cJU_DCDMASK(1)) + 15 - 1; - JU_JPSETADT(Pjp, (Word_t)PjlbRaw, DcdP0, cJU_JPLEAF_B1); - - return(1); - } -#endif - -// cJU_JPIMMED_[2..7]_[02..15] cases that grow in place or cascade: -// -// (2_01 => [ 2_02 => 2_03 => [ 2_04..07 => ]] LeafL) - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJU_JPIMMED_2_03: - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - JU_IMMSETINPLACE(2, uint16_t *, cJU_JPIMMED_2_02, j__udySearchLeaf2, - JU_INSERTINPLACE); -#endif - -#undef OLDPOP1 -#if ((defined(JUDY1) && (! defined(JU_64BIT))) || (defined(JUDYL) && defined(JU_64BIT))) - case cJU_JPIMMED_2_03: -#define OLDPOP1 3 -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_07: -#define OLDPOP1 7 -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - JU_IMMSETCASCADE(2, OLDPOP1, uint16_t *, cJU_JPLEAF2, - JL_LEAF2VALUEAREA, j__udySearchLeaf2, - JU_INSERTCOPY, j__udyAllocJLL2); -#endif - -// (3_01 => [ 3_02 => [ 3_03..05 => ]] LeafL) - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJU_JPIMMED_3_02: - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - - JU_IMMSETINPLACE(3, uint8_t *, cJU_JPIMMED_3_02, j__udySearchLeaf3, - JU_INSERTINPLACE3); -#endif - -#undef OLDPOP1 -#if ((defined(JUDY1) && (! defined(JU_64BIT))) || (defined(JUDYL) && defined(JU_64BIT))) - case cJU_JPIMMED_3_02: -#define OLDPOP1 2 -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_05: -#define OLDPOP1 5 -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - JU_IMMSETCASCADE(3, OLDPOP1, uint8_t *, cJU_JPLEAF3, - JL_LEAF3VALUEAREA, j__udySearchLeaf3, - JU_INSERTCOPY3, j__udyAllocJLL3); -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - -// (4_01 => [[ 4_02..03 => ]] LeafL) - - case cJ1_JPIMMED_4_02: - - JU_IMMSETINPLACE(4, uint32_t *, cJ1_JPIMMED_4_02, j__udySearchLeaf4, - JU_INSERTINPLACE); - - case cJ1_JPIMMED_4_03: - - JU_IMMSETCASCADE(4, 3, uint32_t *, cJU_JPLEAF4, ignore, - j__udySearchLeaf4, JU_INSERTCOPY, - j__udyAllocJLL4); - -// (5_01 => [[ 5_02..03 => ]] LeafL) - - case cJ1_JPIMMED_5_02: - - JU_IMMSETINPLACE(5, uint8_t *, cJ1_JPIMMED_5_02, j__udySearchLeaf5, - JU_INSERTINPLACE5); - - case cJ1_JPIMMED_5_03: - - JU_IMMSETCASCADE(5, 3, uint8_t *, cJU_JPLEAF5, ignore, - j__udySearchLeaf5, JU_INSERTCOPY5, - j__udyAllocJLL5); - -// (6_01 => [[ 6_02 => ]] LeafL) - - case cJ1_JPIMMED_6_02: - - JU_IMMSETCASCADE(6, 2, uint8_t *, cJU_JPLEAF6, ignore, - j__udySearchLeaf6, JU_INSERTCOPY6, - j__udyAllocJLL6); - -// (7_01 => [[ 7_02 => ]] LeafL) - - case cJ1_JPIMMED_7_02: - - JU_IMMSETCASCADE(7, 2, uint8_t *, cJU_JPLEAF7, ignore, - j__udySearchLeaf7, JU_INSERTCOPY7, - j__udyAllocJLL7); - -#endif // (JUDY1 && JU_64BIT) - - -// **************************************************************************** -// INVALID JP TYPE: - - default: JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); return(-1); - - } // switch on JP type - - { - -#ifdef SUBEXPCOUNTS - -// This code might seem strange here. However it saves some memory read time -// during insert (~70nS) because a pipelined processor does not need to "stall" -// waiting for the memory read to complete. Hope the compiler is not too smart -// or dumb and moves the code down to where it looks like it belongs (below a -// few lines). - - Word_t SubExpCount = 0; // current subexpanse counter. - - if (PSubExp != (PWord_t) NULL) // only if BranchB/U. - SubExpCount = PSubExp[0]; -#endif - -// PROCESS JP -- RECURSIVELY: -// -// For non-Immed JP types, if successful, post-increment the population count -// at this Level. - - retcode = j__udyInsWalk(Pjp, Index, Pjpm); - -// Successful insert, increment JP and subexpanse count: - - if ((JU_JPTYPE(Pjp) < cJU_JPIMMED_1_01) && (retcode == 1)) - { - jp_t JP; - Word_t DcdP0; -#ifdef SUBEXPCOUNTS - -// Note: Pjp must be a pointer to a BranchB/U: - - if (PSubExp != (PWord_t) NULL) PSubExp[0] = SubExpCount + 1; -#endif - - JP = *Pjp; - DcdP0 = JU_JPDCDPOP0(Pjp) + 1; - JU_JPSETADT(Pjp, JP.jp_Addr, DcdP0, JU_JPTYPE(&JP)); - } - } - return(retcode); - -} // j__udyInsWalk() - - -// **************************************************************************** -// J U D Y 1 S E T -// J U D Y L I N S -// -// Main entry point. See the manual entry for details. - -#ifdef JUDY1 -FUNCTION int Judy1Set -#else -FUNCTION PPvoid_t JudyLIns -#endif - ( - PPvoid_t PPArray, // in which to insert. - Word_t Index, // to insert. - PJError_t PJError // optional, for returning error info. - ) -{ -#ifdef JUDY1 -#define Pjv ignore // placeholders for macros. -#define Pjvnew ignore -#else - Pjv_t Pjv; // value area in old leaf. - Pjv_t Pjvnew; // value area in new leaf. -#endif - Pjpm_t Pjpm; // array-global info. - int offset; // position in which to store new Index. - Pjlw_t Pjlw; - - -// CHECK FOR NULL POINTER (error by caller): - - if (PPArray == (PPvoid_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjlw = P_JLW(*PPArray); // first word of leaf. - -// **************************************************************************** -// PROCESS TOP LEVEL "JRP" BRANCHES AND LEAVES: - -// **************************************************************************** -// JRPNULL (EMPTY ARRAY): BUILD A LEAFW WITH ONE INDEX: - -// if a valid empty array (null pointer), so create an array of population == 1: - - if (Pjlw == (Pjlw_t)NULL) - { - Pjlw_t Pjlwnew; - - Pjlwnew = j__udyAllocJLW(1); - JUDY1CODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI );) - JUDYLCODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, PPJERR);) - - Pjlwnew[0] = 1 - 1; // pop0 = 0. - Pjlwnew[1] = Index; - - *PPArray = (Pvoid_t) Pjlwnew; - DBGCODE(JudyCheckPop(*PPArray);) - - JUDY1CODE(return(1); ) - JUDYLCODE(Pjlwnew[2] = 0; ) // value area. - JUDYLCODE(return((PPvoid_t) (Pjlwnew + 2)); ) - - } // NULL JRP - -// **************************************************************************** -// LEAFW, OTHER SIZE: - - if (JU_LEAFW_POP0(*PPArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlwnew; - Word_t pop1; - - Pjlw = P_JLW(*PPArray); // first word of leaf. - pop1 = Pjlw[0] + 1; - -#ifdef JUDYL - Pjv = JL_LEAFWVALUEAREA(Pjlw, pop1); -#endif - offset = j__udySearchLeafW(Pjlw + 1, pop1, Index); - - if (offset >= 0) // index is already valid: - { - DBGCODE(JudyCheckPop(*PPArray);) - JUDY1CODE(return(0); ) - JUDYLCODE(return((PPvoid_t) (Pjv + offset)); ) - } - - offset = ~offset; - -// Insert index in cases where no new memory is needed: - - if (JU_LEAFWGROWINPLACE(pop1)) - { - ++Pjlw[0]; // increase population. - - JU_INSERTINPLACE(Pjlw + 1, pop1, offset, Index); -#ifdef JUDYL - JU_INSERTINPLACE(Pjv, pop1, offset, 0); -#endif - DBGCODE(JudyCheckPop(*PPArray);) - DBGCODE(JudyCheckSorted(Pjlw + 1, pop1 + 1, cJU_ROOTSTATE);) - - JUDY1CODE(return(1); ) - JUDYLCODE(return((PPvoid_t) (Pjv + offset)); ) - } - -// Insert index into a new, larger leaf: - - if (pop1 < cJU_LEAFW_MAXPOP1) // can grow to a larger leaf. - { - Pjlwnew = j__udyAllocJLW(pop1 + 1); - JUDY1CODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, JERRI );) - JUDYLCODE(JU_CHECKALLOC(Pjlw_t, Pjlwnew, PPJERR);) - - Pjlwnew[0] = pop1; // set pop0 in new leaf. - - JU_INSERTCOPY(Pjlwnew + 1, Pjlw + 1, pop1, offset, Index); -#ifdef JUDYL - Pjvnew = JL_LEAFWVALUEAREA(Pjlwnew, pop1 + 1); - JU_INSERTCOPY(Pjvnew, Pjv, pop1, offset, 0); -#endif - DBGCODE(JudyCheckSorted(Pjlwnew + 1, pop1 + 1, cJU_ROOTSTATE);) - - j__udyFreeJLW(Pjlw, pop1, NULL); - - *PPArray = (Pvoid_t) Pjlwnew; - DBGCODE(JudyCheckPop(*PPArray);) - - JUDY1CODE(return(1); ) - JUDYLCODE(return((PPvoid_t) (Pjvnew + offset)); ) - } - - assert(pop1 == cJU_LEAFW_MAXPOP1); - -// Leaf at max size => cannot insert new index, so cascade instead: -// -// Upon cascading from a LEAFW leaf to the first branch, must allocate and -// initialize a JPM. - - Pjpm = j__udyAllocJPM(); - JUDY1CODE(JU_CHECKALLOC(Pjpm_t, Pjpm, JERRI );) - JUDYLCODE(JU_CHECKALLOC(Pjpm_t, Pjpm, PPJERR);) - - (Pjpm->jpm_Pop0) = cJU_LEAFW_MAXPOP1 - 1; - (Pjpm->jpm_JP.jp_Addr) = (Word_t) Pjlw; - - if (j__udyCascadeL(&(Pjpm->jpm_JP), Pjpm) == -1) - { - JU_COPY_ERRNO(PJError, Pjpm); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -// Note: No need to pass Pjpm for memory decrement; LEAFW memory is never -// counted in a JPM at all: - - j__udyFreeJLW(Pjlw, cJU_LEAFW_MAXPOP1, NULL); - *PPArray = (Pvoid_t) Pjpm; - - } // JU_LEAFW - -// **************************************************************************** -// BRANCH: - - { - int retcode; // really only needed for Judy1, but free for JudyL. - - Pjpm = P_JPM(*PPArray); - retcode = j__udyInsWalk(&(Pjpm->jpm_JP), Index, Pjpm); - - if (retcode == -1) - { - JU_COPY_ERRNO(PJError, Pjpm); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - if (retcode == 1) ++(Pjpm->jpm_Pop0); // incr total array popu. - - assert(((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_L) - || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_B) - || ((Pjpm->jpm_JP.jp_Type) == cJU_JPBRANCH_U)); - DBGCODE(JudyCheckPop(*PPArray);) - -#ifdef JUDY1 - assert((retcode == 0) || (retcode == 1)); - return(retcode); // == JU_RET_*_JPM(). -#else - assert(Pjpm->jpm_PValue != (Pjv_t) NULL); - return((PPvoid_t) Pjpm->jpm_PValue); -#endif - } - /*NOTREACHED*/ - -} // Judy1Set() / JudyLIns() diff --git a/libjudy/src/JudyL/JudyLInsArray.c b/libjudy/src/JudyL/JudyLInsArray.c deleted file mode 100644 index f8e361f277..0000000000 --- a/libjudy/src/JudyL/JudyLInsArray.c +++ /dev/null @@ -1,1178 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// TBD: It would probably be faster for the caller if the JudyL version took -// PIndex as an interleaved array of indexes and values rather than just -// indexes with a separate values array (PValue), especially considering -// indexes and values are copied here with for-loops anyway and not the -// equivalent of memcpy(). All code could be revised to simply count by two -// words for JudyL? Supports "streaming" the data to/from disk better later? -// In which case get rid of JU_ERRNO_NULLPVALUE, no longer needed, and simplify -// the API to this code. -// _________________ - -// @(#) $Revision: 4.21 $ $Source: /judy/src/JudyCommon/JudyInsArray.c $ -// -// Judy1SetArray() and JudyLInsArray() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -DBGCODE(extern void JudyCheckPop(Pvoid_t PArray);) - - -// IMMED AND LEAF SIZE AND BRANCH TYPE ARRAYS: -// -// These support fast and easy lookup by level. - -static uint8_t immed_maxpop1[] = { - 0, - cJU_IMMED1_MAXPOP1, - cJU_IMMED2_MAXPOP1, - cJU_IMMED3_MAXPOP1, -#ifdef JU_64BIT - cJU_IMMED4_MAXPOP1, - cJU_IMMED5_MAXPOP1, - cJU_IMMED6_MAXPOP1, - cJU_IMMED7_MAXPOP1, -#endif - // note: There are no IMMEDs for whole words. -}; - -static uint8_t leaf_maxpop1[] = { - 0, -#if (defined(JUDYL) || (! defined(JU_64BIT))) - cJU_LEAF1_MAXPOP1, -#else - 0, // 64-bit Judy1 has no Leaf1. -#endif - cJU_LEAF2_MAXPOP1, - cJU_LEAF3_MAXPOP1, -#ifdef JU_64BIT - cJU_LEAF4_MAXPOP1, - cJU_LEAF5_MAXPOP1, - cJU_LEAF6_MAXPOP1, - cJU_LEAF7_MAXPOP1, -#endif - // note: Root-level leaves are handled differently. -}; - -static uint8_t branchL_JPtype[] = { - 0, - 0, - cJU_JPBRANCH_L2, - cJU_JPBRANCH_L3, -#ifdef JU_64BIT - cJU_JPBRANCH_L4, - cJU_JPBRANCH_L5, - cJU_JPBRANCH_L6, - cJU_JPBRANCH_L7, -#endif - cJU_JPBRANCH_L, -}; - -static uint8_t branchB_JPtype[] = { - 0, - 0, - cJU_JPBRANCH_B2, - cJU_JPBRANCH_B3, -#ifdef JU_64BIT - cJU_JPBRANCH_B4, - cJU_JPBRANCH_B5, - cJU_JPBRANCH_B6, - cJU_JPBRANCH_B7, -#endif - cJU_JPBRANCH_B, -}; - -static uint8_t branchU_JPtype[] = { - 0, - 0, - cJU_JPBRANCH_U2, - cJU_JPBRANCH_U3, -#ifdef JU_64BIT - cJU_JPBRANCH_U4, - cJU_JPBRANCH_U5, - cJU_JPBRANCH_U6, - cJU_JPBRANCH_U7, -#endif - cJU_JPBRANCH_U, -}; - -// Subexpanse masks are similer to JU_DCDMASK() but without the need to clear -// the first digits bits. Avoid doing variable shifts by precomputing a -// lookup array. - -static Word_t subexp_mask[] = { - 0, - ~cJU_POP0MASK(1), - ~cJU_POP0MASK(2), - ~cJU_POP0MASK(3), -#ifdef JU_64BIT - ~cJU_POP0MASK(4), - ~cJU_POP0MASK(5), - ~cJU_POP0MASK(6), - ~cJU_POP0MASK(7), -#endif -}; - - -// FUNCTION PROTOTYPES: - -static bool_t j__udyInsArray(Pjp_t PjpParent, int Level, PWord_t PPop1, - PWord_t PIndex, -#ifdef JUDYL - Pjv_t PValue, -#endif - Pjpm_t Pjpm); - - -// **************************************************************************** -// J U D Y 1 S E T A R R A Y -// J U D Y L I N S A R R A Y -// -// Main entry point. See the manual entry for external overview. -// -// TBD: Until thats written, note that the function returns 1 for success or -// JERRI for serious error, including insufficient memory to build whole array; -// use Judy*Count() to see how many were stored, the first N of the total -// Count. Also, since it takes Count == Pop1, it cannot handle a full array. -// Also, "sorted" means ascending without duplicates, otherwise you get the -// "unsorted" error. -// -// The purpose of these functions is to allow rapid construction of a large -// Judy array given a sorted list of indexes (and for JudyL, corresponding -// values). At least one customer saw this as useful, and probably it would -// also be useful as a sufficient workaround for fast(er) unload/reload to/from -// disk. -// -// This code is written recursively for simplicity, until/unless someone -// decides to make it faster and more complex. Hopefully recursion is fast -// enough simply because the function is so much faster than a series of -// Set/Ins calls. - -#ifdef JUDY1 -FUNCTION int Judy1SetArray -#else -FUNCTION int JudyLInsArray -#endif - ( - PPvoid_t PPArray, // in which to insert, initially empty. - Word_t Count, // number of indexes (and values) to insert. -const Word_t * const PIndex, // list of indexes to insert. -#ifdef JUDYL -const Word_t * const PValue, // list of corresponding values. -#endif - PJError_t PJError // optional, for returning error info. - ) -{ - Pjlw_t Pjlw; // new root-level leaf. - Pjlw_t Pjlwindex; // first index in root-level leaf. - int offset; // in PIndex. - - -// CHECK FOR NULL OR NON-NULL POINTER (error by caller): - - if (PPArray == (PPvoid_t) NULL) - { JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); return(JERRI); } - - if (*PPArray != (Pvoid_t) NULL) - { JU_SET_ERRNO(PJError, JU_ERRNO_NONNULLPARRAY); return(JERRI); } - - if (PIndex == (PWord_t) NULL) - { JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); return(JERRI); } - -#ifdef JUDYL - if (PValue == (PWord_t) NULL) - { JU_SET_ERRNO(PJError, JU_ERRNO_NULLPVALUE); return(JERRI); } -#endif - - -// HANDLE LARGE COUNT (= POP1) (typical case): -// -// Allocate and initialize a JPM, set the root pointer to point to it, and then -// build the tree underneath it. - -// Common code for unusual error handling when no JPM available: - - if (Count > cJU_LEAFW_MAXPOP1) // too big for root-level leaf. - { - Pjpm_t Pjpm; // new, to allocate. - -// Allocate JPM: - - Pjpm = j__udyAllocJPM(); - JU_CHECKALLOC(Pjpm_t, Pjpm, JERRI); - *PPArray = (Pvoid_t) Pjpm; - -// Set some JPM fields: - - (Pjpm->jpm_Pop0) = Count - 1; - // note: (Pjpm->jpm_TotalMemWords) is now initialized. - -// Build Judy tree: -// -// In case of error save the final Count, possibly modified, unless modified to -// 0, in which case free the JPM itself: - - if (! j__udyInsArray(&(Pjpm->jpm_JP), cJU_ROOTSTATE, &Count, - (PWord_t) PIndex, -#ifdef JUDYL - (Pjv_t) PValue, -#endif - Pjpm)) - { - JU_COPY_ERRNO(PJError, Pjpm); - - if (Count) // partial success, adjust pop0: - { - (Pjpm->jpm_Pop0) = Count - 1; - } - else // total failure, free JPM: - { - j__udyFreeJPM(Pjpm, (Pjpm_t) NULL); - *PPArray = (Pvoid_t) NULL; - } - - DBGCODE(JudyCheckPop(*PPArray);) - return(JERRI); - } - - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - - } // large count - - -// HANDLE SMALL COUNT (= POP1): -// -// First ensure indexes are in sorted order: - - for (offset = 1; offset < Count; ++offset) - { - if (PIndex[offset - 1] >= PIndex[offset]) - { JU_SET_ERRNO(PJError, JU_ERRNO_UNSORTED); return(JERRI); } - } - - if (Count == 0) return(1); // *PPArray remains null. - - { - Pjlw = j__udyAllocJLW(Count + 1); - JU_CHECKALLOC(Pjlw_t, Pjlw, JERRI); - *PPArray = (Pvoid_t) Pjlw; - Pjlw[0] = Count - 1; // set pop0. - Pjlwindex = Pjlw + 1; - } - -// Copy whole-word indexes (and values) to the root-level leaf: - - JU_COPYMEM(Pjlwindex, PIndex, Count); -JUDYLCODE(JU_COPYMEM(JL_LEAFWVALUEAREA(Pjlw, Count), PValue, Count)); - - DBGCODE(JudyCheckPop(*PPArray);) - return(1); - -} // Judy1SetArray() / JudyLInsArray() - - -// **************************************************************************** -// __ J U D Y I N S A R R A Y -// -// Given: -// -// - a pointer to a JP -// -// - the JPs level in the tree, that is, the number of digits left to decode -// in the indexes under the JP (one less than the level of the JPM or branch -// in which the JP resides); cJU_ROOTSTATE on first entry (when JP is the one -// in the JPM), down to 1 for a Leaf1, LeafB1, or FullPop -// -// - a pointer to the number of indexes (and corresponding values) to store in -// this subtree, to modify in case of partial success -// -// - a list of indexes (and for JudyL, corresponding values) to store in this -// subtree -// -// - a JPM for tracking memory usage and returning errors -// -// Recursively build a subtree (immediate indexes, leaf, or branch with -// subtrees) and modify the JP accordingly. On the way down, build a BranchU -// (only) for any expanse with *PPop1 too high for a leaf; on the way out, -// convert the BranchU to a BranchL or BranchB if appropriate. Keep memory -// statistics in the JPM. -// -// Return TRUE for success, or FALSE with error information set in the JPM in -// case of error, in which case leave a partially constructed but healthy tree, -// and modify parent population counts on the way out. -// -// Note: Each call of this function makes all modifications to the PjpParent -// it receives; neither the parent nor child calls do this. - -FUNCTION static bool_t j__udyInsArray( - Pjp_t PjpParent, // parent JP in/under which to store. - int Level, // initial digits remaining to decode. - PWord_t PPop1, // number of indexes to store. - PWord_t PIndex, // list of indexes to store. -#ifdef JUDYL - Pjv_t PValue, // list of corresponding values. -#endif - Pjpm_t Pjpm) // for memory and errors. -{ - Pjp_t Pjp; // lower-level JP. - Word_t Pjbany; // any type of branch. - int levelsub; // actual, of Pjps node, <= Level. - Word_t pop1 = *PPop1; // fast local value. - Word_t pop1sub; // population of one subexpanse. - uint8_t JPtype; // current JP type. - uint8_t JPtype_null; // precomputed value for new branch. - jp_t JPnull; // precomputed for speed. - Pjbu_t PjbuRaw; // constructed BranchU. - Pjbu_t Pjbu; - int digit; // in BranchU. - Word_t digitmask; // for a digit in a BranchU. - Word_t digitshifted; // shifted to correct offset. - Word_t digitshincr; // increment for digitshifted. - int offset; // in PIndex, or a bitmap subexpanse. - int numJPs; // number non-null in a BranchU. - bool_t retval; // to return from this func. -JUDYLCODE(Pjv_t PjvRaw); // destination value area. -JUDYLCODE(Pjv_t Pjv); - - -// MACROS FOR COMMON CODE: -// -// Note: These use function and local parameters from the context. -// Note: Assume newly allocated memory is zeroed. - -// Indicate whether a sorted list of indexes in PIndex, based on the first and -// last indexes in the list using pop1, are in the same subexpanse between -// Level and L_evel: -// -// This can be confusing! Note that SAMESUBEXP(L) == TRUE means the indexes -// are the same through level L + 1, and it says nothing about level L and -// lower; they might be the same or they might differ. -// -// Note: In principle SAMESUBEXP needs a mask for the digits from Level, -// inclusive, to L_evel, exclusive. But in practice, since the indexes are all -// known to be identical above Level, it just uses a mask for the digits -// through L_evel + 1; see subexp_mask[]. - -#define SAMESUBEXP(L_evel) \ - (! ((PIndex[0] ^ PIndex[pop1 - 1]) & subexp_mask[L_evel])) - -// Set PjpParent to a null JP appropriate for the level of the node to which it -// points, which is 1 less than the level of the node in which the JP resides, -// which is by definition Level: -// -// Note: This can set the JPMs JP to an invalid jp_Type, but it doesnt -// matter because the JPM is deleted by the caller. - -#define SETJPNULL_PARENT \ - JU_JPSETADT(PjpParent, 0, 0, cJU_JPNULL1 + Level - 1); - -// Variation to set a specified JP (in a branch being built) to a precomputed -// null JP: - -#define SETJPNULL(Pjp) *(Pjp) = JPnull - -// Handle complete (as opposed to partial) memory allocation failure: Set the -// parent JP to an appropriate null type (to leave a consistent tree), zero the -// callers population count, and return FALSE: -// -// Note: At Level == cJU_ROOTSTATE this sets the JPMs JPs jp_Type to a bogus -// value, but it doesnt matter because the JPM should be deleted by the -// caller. - -#define NOMEM { SETJPNULL_PARENT; *PPop1 = 0; return(FALSE); } - -// Allocate a Leaf1-N and save the address in Pjll; in case of failure, NOMEM: - -#define ALLOCLEAF(AllocLeaf) \ - if ((PjllRaw = AllocLeaf(pop1, Pjpm)) == (Pjll_t) NULL) NOMEM; \ - Pjll = P_JLL(PjllRaw); - -// Copy indexes smaller than words (and values which are whole words) from -// given arrays to immediate indexes or a leaf: -// -// TBD: These macros overlap with some of the code in JudyCascade.c; do some -// merging? That file has functions while these are macros. - -#define COPYTOLEAF_EVEN_SUB(Pjll,LeafType) \ - { \ - LeafType * P_leaf = (LeafType *) (Pjll); \ - Word_t p_op1 = pop1; \ - PWord_t P_Index = PIndex; \ - \ - assert(pop1 > 0); \ - \ - do { *P_leaf++ = *P_Index++; /* truncates */\ - } while (--(p_op1)); \ - } - -#define COPYTOLEAF_ODD_SUB(cLevel,Pjll,Copy) \ - { \ - uint8_t * P_leaf = (uint8_t *) (Pjll); \ - Word_t p_op1 = pop1; \ - PWord_t P_Index = PIndex; \ - \ - assert(pop1 > 0); \ - \ - do { \ - Copy(P_leaf, *P_Index); \ - P_leaf += (cLevel); ++P_Index; \ - } while (--(p_op1)); \ - } - -#ifdef JUDY1 - -#define COPYTOLEAF_EVEN(Pjll,LeafType) COPYTOLEAF_EVEN_SUB(Pjll,LeafType) -#define COPYTOLEAF_ODD(cLevel,Pjll,Copy) COPYTOLEAF_ODD_SUB(cLevel,Pjll,Copy) - -#else // JUDYL adds copying of values: - -#define COPYTOLEAF_EVEN(Pjll,LeafType) \ - { \ - COPYTOLEAF_EVEN_SUB(Pjll,LeafType) \ - JU_COPYMEM(Pjv, PValue, pop1); \ - } - -#define COPYTOLEAF_ODD(cLevel,Pjll,Copy) \ - { \ - COPYTOLEAF_ODD_SUB( cLevel,Pjll,Copy) \ - JU_COPYMEM(Pjv, PValue, pop1); \ - } - -#endif - -// Set the JP type for an immediate index, where BaseJPType is JPIMMED_*_02: - -#define SETIMMTYPE(BaseJPType) (PjpParent->jp_Type) = (BaseJPType) + pop1 - 2 - -// Allocate and populate a Leaf1-N: -// -// Build MAKELEAF_EVEN() and MAKELEAF_ODD() using macros for common code. - -#define MAKELEAF_SUB1(AllocLeaf,ValueArea,LeafType) \ - ALLOCLEAF(AllocLeaf); \ - JUDYLCODE(Pjv = ValueArea(Pjll, pop1)) - - -#define MAKELEAF_SUB2(cLevel,JPType) \ -{ \ - Word_t D_cdP0; \ - assert(pop1 - 1 <= cJU_POP0MASK(cLevel)); \ - D_cdP0 = (*PIndex & cJU_DCDMASK(cLevel)) | (pop1 - 1); \ - JU_JPSETADT(PjpParent, (Word_t)PjllRaw, D_cdP0, JPType); \ -} - - -#define MAKELEAF_EVEN(cLevel,JPType,AllocLeaf,ValueArea,LeafType) \ - MAKELEAF_SUB1(AllocLeaf,ValueArea,LeafType); \ - COPYTOLEAF_EVEN(Pjll, LeafType); \ - MAKELEAF_SUB2(cLevel, JPType) - -#define MAKELEAF_ODD(cLevel,JPType,AllocLeaf,ValueArea,Copy) \ - MAKELEAF_SUB1(AllocLeaf,ValueArea,LeafType); \ - COPYTOLEAF_ODD(cLevel, Pjll, Copy); \ - MAKELEAF_SUB2(cLevel, JPType) - -// Ensure that the indexes to be stored in immediate indexes or a leaf are -// sorted: -// -// This check is pure overhead, but required in order to protect the Judy array -// against caller error, to avoid a later corruption or core dump from a -// seemingly valid Judy array. Do this check piecemeal at the leaf level while -// the indexes are already in the cache. Higher-level order-checking occurs -// while building branches. -// -// Note: Any sorting error in the expanse of a single immediate indexes JP or -// a leaf => save no indexes in that expanse. - -#define CHECKLEAFORDER \ - { \ - for (offset = 1; offset < pop1; ++offset) \ - { \ - if (PIndex[offset - 1] >= PIndex[offset]) \ - { \ - SETJPNULL_PARENT; \ - *PPop1 = 0; \ - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_UNSORTED); \ - return(FALSE); \ - } \ - } \ - } - - -// ------ START OF CODE ------ - - assert( Level >= 1); - assert( Level <= cJU_ROOTSTATE); - assert((Level < cJU_ROOTSTATE) || (pop1 > cJU_LEAFW_MAXPOP1)); - - -// CHECK FOR TOP LEVEL: -// -// Special case: If at the top level (PjpParent is in the JPM), a top-level -// branch must be created, even if its a BranchL with just one JP. (The JPM -// cannot point to a leaf because the leaf would have to be a lower-level, -// higher-capacity leaf under a narrow pointer (otherwise a root-level leaf -// would suffice), and the JPMs JP cant handle a narrow pointer because the -// jp_DcdPopO field isnt big enough.) Otherwise continue to check for a pop1 -// small enough to support immediate indexes or a leaf before giving up and -// making a lower-level branch. - - if (Level == cJU_ROOTSTATE) - { - levelsub = cJU_ROOTSTATE; - goto BuildBranch2; - } - assert(Level < cJU_ROOTSTATE); - - -// SKIP JPIMMED_*_01: -// -// Immeds with pop1 == 1 should be handled in-line during branch construction. - - assert(pop1 > 1); - - -// BUILD JPIMMED_*_02+: -// -// The starting address of the indexes depends on Judy1 or JudyL; also, JudyL -// includes a pointer to a values-only leaf. - - if (pop1 <= immed_maxpop1[Level]) // note: always < root level. - { - JUDY1CODE(uint8_t * Pjll = (uint8_t *) (PjpParent->jp_1Index);) - JUDYLCODE(uint8_t * Pjll = (uint8_t *) (PjpParent->jp_LIndex);) - - CHECKLEAFORDER; // indexes to be stored are sorted. - -#ifdef JUDYL - if ((PjvRaw = j__udyLAllocJV(pop1, Pjpm)) == (Pjv_t) NULL) - NOMEM; - (PjpParent->jp_Addr) = (Word_t) PjvRaw; - Pjv = P_JV(PjvRaw); -#endif - - switch (Level) - { - case 1: COPYTOLEAF_EVEN(Pjll, uint8_t); - SETIMMTYPE(cJU_JPIMMED_1_02); - break; -#if (defined(JUDY1) || defined(JU_64BIT)) - case 2: COPYTOLEAF_EVEN(Pjll, uint16_t); - SETIMMTYPE(cJU_JPIMMED_2_02); - break; - case 3: COPYTOLEAF_ODD(3, Pjll, JU_COPY3_LONG_TO_PINDEX); - SETIMMTYPE(cJU_JPIMMED_3_02); - break; -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case 4: COPYTOLEAF_EVEN(Pjll, uint32_t); - SETIMMTYPE(cJ1_JPIMMED_4_02); - break; - case 5: COPYTOLEAF_ODD(5, Pjll, JU_COPY5_LONG_TO_PINDEX); - SETIMMTYPE(cJ1_JPIMMED_5_02); - break; - case 6: COPYTOLEAF_ODD(6, Pjll, JU_COPY6_LONG_TO_PINDEX); - SETIMMTYPE(cJ1_JPIMMED_6_02); - break; - case 7: COPYTOLEAF_ODD(7, Pjll, JU_COPY7_LONG_TO_PINDEX); - SETIMMTYPE(cJ1_JPIMMED_7_02); - break; -#endif - default: assert(FALSE); // should be impossible. - } - - return(TRUE); // note: no children => no *PPop1 mods. - - } // JPIMMED_*_02+ - - -// BUILD JPLEAF*: -// -// This code is a little tricky. The method is: For each level starting at -// the present Level down through levelsub = 1, and then as a special case for -// LeafB1 and FullPop (which are also at levelsub = 1 but have different -// capacity, see later), check if pop1 fits in a leaf (using leaf_maxpop1[]) -// at that level. If so, except for Level == levelsub, check if all of the -// current indexes to be stored are in the same (narrow) subexpanse, that is, -// the digits from Level to levelsub + 1, inclusive, are identical between the -// first and last index in the (sorted) list (in PIndex). If this condition is -// satisfied at any level, build a leaf at that level (under a narrow pointer -// if Level > levelsub). -// -// Note: Doing the search in this order results in storing the indexes in -// "least compressed form." - - for (levelsub = Level; levelsub >= 1; --levelsub) - { - Pjll_t PjllRaw; - Pjll_t Pjll; - -// Check if pop1 is too large to fit in a leaf at levelsub; if so, try the next -// lower level: - - if (pop1 > leaf_maxpop1[levelsub]) continue; - -// If pop1 fits in a leaf at levelsub, but levelsub is lower than Level, must -// also check whether all the indexes in the expanse to store can in fact be -// placed under a narrow pointer; if not, a leaf cannot be used, at this or any -// lower level (levelsub): - - if ((levelsub < Level) && (! SAMESUBEXP(levelsub))) - goto BuildBranch; // cant use a narrow, need a branch. - -// Ensure valid pop1 and all indexes are in fact common through Level: - - assert(pop1 <= cJU_POP0MASK(Level) + 1); - assert(! ((PIndex[0] ^ PIndex[pop1 - 1]) & cJU_DCDMASK(Level))); - - CHECKLEAFORDER; // indexes to be stored are sorted. - -// Build correct type of leaf: -// -// Note: The jp_DcdPopO and jp_Type assignments in MAKELEAF_* happen correctly -// for the levelsub (not Level) of the new leaf, even if its under a narrow -// pointer. - - switch (levelsub) - { -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case 1: MAKELEAF_EVEN(1, cJU_JPLEAF1, j__udyAllocJLL1, - JL_LEAF1VALUEAREA, uint8_t); - break; -#endif - case 2: MAKELEAF_EVEN(2, cJU_JPLEAF2, j__udyAllocJLL2, - JL_LEAF2VALUEAREA, uint16_t); - break; - case 3: MAKELEAF_ODD( 3, cJU_JPLEAF3, j__udyAllocJLL3, - JL_LEAF3VALUEAREA, JU_COPY3_LONG_TO_PINDEX); - break; -#ifdef JU_64BIT - case 4: MAKELEAF_EVEN(4, cJU_JPLEAF4, j__udyAllocJLL4, - JL_LEAF4VALUEAREA, uint32_t); - break; - case 5: MAKELEAF_ODD( 5, cJU_JPLEAF5, j__udyAllocJLL5, - JL_LEAF5VALUEAREA, JU_COPY5_LONG_TO_PINDEX); - break; - case 6: MAKELEAF_ODD( 6, cJU_JPLEAF6, j__udyAllocJLL6, - JL_LEAF6VALUEAREA, JU_COPY6_LONG_TO_PINDEX); - break; - case 7: MAKELEAF_ODD( 7, cJU_JPLEAF7, j__udyAllocJLL7, - JL_LEAF7VALUEAREA, JU_COPY7_LONG_TO_PINDEX); - break; -#endif - default: assert(FALSE); // should be impossible. - } - - return(TRUE); // note: no children => no *PPop1 mods. - - } // JPLEAF* - - -// BUILD JPLEAF_B1 OR JPFULLPOPU1: -// -// See above about JPLEAF*. If pop1 doesnt fit in any level of linear leaf, -// it might still fit in a LeafB1 or FullPop, perhaps under a narrow pointer. - - if ((Level == 1) || SAMESUBEXP(1)) // same until last digit. - { - Pjlb_t PjlbRaw; // for bitmap leaf. - Pjlb_t Pjlb; - - assert(pop1 <= cJU_JPFULLPOPU1_POP0 + 1); - CHECKLEAFORDER; // indexes to be stored are sorted. - -#ifdef JUDY1 - -// JPFULLPOPU1: - - if (pop1 == cJU_JPFULLPOPU1_POP0 + 1) - { - Word_t Addr = PjpParent->jp_Addr; - Word_t DcdP0 = (*PIndex & cJU_DCDMASK(1)) - | cJU_JPFULLPOPU1_POP0; - JU_JPSETADT(PjpParent, Addr, DcdP0, cJ1_JPFULLPOPU1); - - return(TRUE); - } -#endif - -// JPLEAF_B1: - - if ((PjlbRaw = j__udyAllocJLB1(Pjpm)) == (Pjlb_t) NULL) - NOMEM; - Pjlb = P_JLB(PjlbRaw); - - for (offset = 0; offset < pop1; ++offset) - JU_BITMAPSETL(Pjlb, PIndex[offset]); - - retval = TRUE; // default. - -#ifdef JUDYL - -// Build subexpanse values-only leaves (LeafVs) under LeafB1: - - for (offset = 0; offset < cJU_NUMSUBEXPL; ++offset) - { - if (! (pop1sub = j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, offset)))) - continue; // skip empty subexpanse. - -// Allocate one LeafV = JP subarray; if out of memory, clear bitmaps for higher -// subexpanses and adjust *PPop1: - - if ((PjvRaw = j__udyLAllocJV(pop1sub, Pjpm)) - == (Pjv_t) NULL) - { - for (/* null */; offset < cJU_NUMSUBEXPL; ++offset) - { - *PPop1 -= j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, offset)); - JU_JLB_BITMAP(Pjlb, offset) = 0; - } - - retval = FALSE; - break; - } - -// Populate values-only leaf and save the pointer to it: - - Pjv = P_JV(PjvRaw); - JU_COPYMEM(Pjv, PValue, pop1sub); - JL_JLB_PVALUE(Pjlb, offset) = PjvRaw; // first-tier pointer. - PValue += pop1sub; - - } // for each subexpanse - -#endif // JUDYL - -// Attach new LeafB1 to parent JP; note use of *PPop1 possibly < pop1: - - JU_JPSETADT(PjpParent, (Word_t) PjlbRaw, - (*PIndex & cJU_DCDMASK(1)) | (*PPop1 - 1), cJU_JPLEAF_B1); - - return(retval); - - } // JPLEAF_B1 or JPFULLPOPU1 - - -// BUILD JPBRANCH_U*: -// -// Arriving at BuildBranch means Level < top level but the pop1 is too large -// for immediate indexes or a leaf, even under a narrow pointer, including a -// LeafB1 or FullPop at level 1. This implies SAMESUBEXP(1) == FALSE, that is, -// the indexes to be stored "branch" at level 2 or higher. - -BuildBranch: // come here directly if a leaf wont work. - - assert(Level >= 2); - assert(Level < cJU_ROOTSTATE); - assert(! SAMESUBEXP(1)); // sanity check, see above. - -// Determine the appropriate level for a new branch node; see if a narrow -// pointer can be used: -// -// This can be confusing. The branch is required at the lowest level L where -// the indexes to store are not in the same subexpanse at level L-1. Work down -// from Level to tree level 3, which is 1 above the lowest tree level = 2 at -// which a branch can be used. Theres no need to check SAMESUBEXP at level 2 -// because its known to be false at level 2-1 = 1. -// -// Note: Unlike for a leaf node, a narrow pointer is always used for a branch -// if possible, that is, maximum compression is always used, except at the top -// level of the tree, where a JPM cannot support a narrow pointer, meaning a -// top BranchL can have a single JP (fanout = 1); but that case jumps directly -// to BuildBranch2. -// -// Note: For 32-bit systems the only usable values for a narrow pointer are -// Level = 3 and levelsub = 2; 64-bit systems have many more choices; but -// hopefully this for-loop is fast enough even on a 32-bit system. -// -// TBD: If not fast enough, #ifdef JU_64BIT and handle the 32-bit case faster. - - for (levelsub = Level; levelsub >= 3; --levelsub) // see above. - if (! SAMESUBEXP(levelsub - 1)) // at limit of narrow pointer. - break; // put branch at levelsub. - -BuildBranch2: // come here directly for Level = levelsub = cJU_ROOTSTATE. - - assert(levelsub >= 2); - assert(levelsub <= Level); - -// Initially build a BranchU: -// -// Always start with a BranchU because the number of populated subexpanses is -// not yet known. Use digitmask, digitshifted, and digitshincr to avoid -// expensive variable shifts within JU_DIGITATSTATE within the loop. -// -// TBD: The use of digitmask, etc. results in more increment operations per -// loop, is there an even faster way? -// -// TBD: Would it pay to pre-count the populated JPs (subexpanses) and -// pre-compress the branch, that is, build a BranchL or BranchB immediately, -// also taking account of opportunistic uncompression rules? Probably not -// because at high levels of the tree there might be huge numbers of indexes -// (hence cache lines) to scan in the PIndex array to determine the fanout -// (number of JPs) needed. - - if ((PjbuRaw = j__udyAllocJBU(Pjpm)) == (Pjbu_t) NULL) NOMEM; - Pjbu = P_JBU(PjbuRaw); - - JPtype_null = cJU_JPNULL1 + levelsub - 2; // in new BranchU. - JU_JPSETADT(&JPnull, 0, 0, JPtype_null); - - Pjp = Pjbu->jbu_jp; // for convenience in loop. - numJPs = 0; // non-null in the BranchU. - digitmask = cJU_MASKATSTATE(levelsub); // see above. - digitshincr = 1UL << (cJU_BITSPERBYTE * (levelsub - 1)); - retval = TRUE; - -// Scan and populate JPs (subexpanses): -// -// Look for all indexes matching each digit in the BranchU (at the correct -// levelsub), and meanwhile notice any sorting error. Increment PIndex (and -// PValue) and reduce pop1 for each subexpanse handled successfully. - - for (digit = digitshifted = 0; - digit < cJU_BRANCHUNUMJPS; - ++digit, digitshifted += digitshincr, ++Pjp) - { - DBGCODE(Word_t pop1subprev;) - assert(pop1 != 0); // end of indexes is handled elsewhere. - -// Count indexes in digits subexpanse: - - for (pop1sub = 0; pop1sub < pop1; ++pop1sub) - if (digitshifted != (PIndex[pop1sub] & digitmask)) break; - -// Empty subexpanse (typical, performance path) or sorting error (rare): - - if (pop1sub == 0) - { - if (digitshifted < (PIndex[0] & digitmask)) - { SETJPNULL(Pjp); continue; } // empty subexpanse. - - assert(pop1 < *PPop1); // did save >= 1 index and decr pop1. - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_UNSORTED); - goto AbandonBranch; - } - -// Non-empty subexpanse: -// -// First shortcut by handling pop1sub == 1 (JPIMMED_*_01) inline locally. - - if (pop1sub == 1) // note: can be at root level. - { - Word_t Addr = 0; - JUDYLCODE(Addr = (Word_t) (*PValue++);) - JU_JPSETADT(Pjp, Addr, *PIndex, cJU_JPIMMED_1_01 + levelsub -2); - - ++numJPs; - - if (--pop1) { ++PIndex; continue; } // more indexes to store. - - ++digit; ++Pjp; // skip JP just saved. - goto ClearBranch; // save time. - } - -// Recurse to populate one digits (subexpanses) JP; if successful, skip -// indexes (and values) just stored (performance path), except when expanse is -// completely stored: - - DBGCODE(pop1subprev = pop1sub;) - - if (j__udyInsArray(Pjp, levelsub - 1, &pop1sub, (PWord_t) PIndex, -#ifdef JUDYL - (Pjv_t) PValue, -#endif - Pjpm)) - { // complete success. - ++numJPs; - assert(pop1subprev == pop1sub); - assert(pop1 >= pop1sub); - - if ((pop1 -= pop1sub) != 0) // more indexes to store: - { - PIndex += pop1sub; // skip indexes just stored. - JUDYLCODE(PValue += pop1sub;) - continue; - } - // else leave PIndex in BranchUs expanse. - -// No more indexes to store in BranchUs expanse: - - ++digit; ++Pjp; // skip JP just saved. - goto ClearBranch; // save time. - } - -// Handle any error at a lower level of recursion: -// -// In case of partial success, pop1sub != 0, but it was reduced from the value -// passed to j__udyInsArray(); skip this JP later during ClearBranch. - - assert(pop1subprev > pop1sub); // check j__udyInsArray(). - assert(pop1 > pop1sub); // check j__udyInsArray(). - - if (pop1sub) // partial success. - { ++digit; ++Pjp; ++numJPs; } // skip JP just saved. - - pop1 -= pop1sub; // deduct saved indexes if any. - -// Same-level sorting error, or any lower-level error; abandon the rest of the -// branch: -// -// Arrive here with pop1 = remaining unsaved indexes (always non-zero). Adjust -// the *PPop1 value to record and return, modify retval, and use ClearBranch to -// finish up. - -AbandonBranch: - assert(pop1 != 0); // more to store, see above. - assert(pop1 <= *PPop1); // sanity check. - - *PPop1 -= pop1; // deduct unsaved indexes. - pop1 = 0; // to avoid error later. - retval = FALSE; - -// Error (rare), or end of indexes while traversing new BranchU (performance -// path); either way, mark the remaining JPs, if any, in the BranchU as nulls -// and exit the loop: -// -// Arrive here with digit and Pjp set to the first JP to set to null. - -ClearBranch: - for (/* null */; digit < cJU_BRANCHUNUMJPS; ++digit, ++Pjp) - SETJPNULL(Pjp); - break; // saves one more compare. - - } // for each digit - - -// FINISH JPBRANCH_U*: -// -// Arrive here with a BranchU built under Pjbu, numJPs set, and either: retval -// == TRUE and *PPop1 unmodified, or else retval == FALSE, *PPop1 set to the -// actual number of indexes saved (possibly 0 for complete failure at a lower -// level upon the first call of j__udyInsArray()), and the Judy error set in -// Pjpm. Either way, PIndex points to an index within the expanse just -// handled. - - Pjbany = (Word_t) PjbuRaw; // default = use this BranchU. - JPtype = branchU_JPtype[levelsub]; - -// Check for complete failure above: - - assert((! retval) || *PPop1); // sanity check. - - if ((! retval) && (*PPop1 == 0)) // nothing stored, full failure. - { - j__udyFreeJBU(PjbuRaw, Pjpm); - SETJPNULL_PARENT; - return(FALSE); - } - -// Complete or partial success so far; watch for sorting error after the -// maximum digit (255) in the BranchU, which is indicated by having more -// indexes to store in the BranchUs expanse: -// -// For example, if an index to store has a digit of 255 at levelsub, followed -// by an index with a digit of 254, the for-loop above runs out of digits -// without reducing pop1 to 0. - - if (pop1 != 0) - { - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_UNSORTED); - *PPop1 -= pop1; // deduct unsaved indexes. - retval = FALSE; - } - assert(*PPop1 != 0); // branch (still) cannot be empty. - - -// OPTIONALLY COMPRESS JPBRANCH_U*: -// -// See if the BranchU should be compressed to a BranchL or BranchB; if so, do -// that and free the BranchU; otherwise just use the existing BranchU. Follow -// the same rules as in JudyIns.c (version 4.95): Only check local population -// (cJU_OPP_UNCOMP_POP0) for BranchL, and only check global memory efficiency -// (JU_OPP_UNCOMPRESS) for BranchB. TBD: Have the rules changed? -// -// Note: Because of differing order of operations, the latter compression -// might not result in the same set of branch nodes as a series of sequential -// insertions. -// -// Note: Allocating a BranchU only to sometimes convert it to a BranchL or -// BranchB is unfortunate, but attempting to work with a temporary BranchU on -// the stack and then allocate and keep it as a BranchU in many cases is worse -// in terms of error handling. - - -// COMPRESS JPBRANCH_U* TO JPBRANCH_L*: - - if (numJPs <= cJU_BRANCHLMAXJPS) // JPs fit in a BranchL. - { - Pjbl_t PjblRaw = (Pjbl_t) NULL; // new BranchL; init for cc. - Pjbl_t Pjbl; - - if ((*PPop1 > JU_BRANCHL_MAX_POP) // pop too high. - || ((PjblRaw = j__udyAllocJBL(Pjpm)) == (Pjbl_t) NULL)) - { // cant alloc BranchL. - goto SetParent; // just keep BranchU. - } - - Pjbl = P_JBL(PjblRaw); - -// Copy BranchU JPs to BranchL: - - (Pjbl->jbl_NumJPs) = numJPs; - offset = 0; - - for (digit = 0; digit < cJU_BRANCHUNUMJPS; ++digit) - { - if ((((Pjbu->jbu_jp) + digit)->jp_Type) == JPtype_null) - continue; - - (Pjbl->jbl_Expanse[offset ]) = digit; - (Pjbl->jbl_jp [offset++]) = Pjbu->jbu_jp[digit]; - } - assert(offset == numJPs); // found same number. - -// Free the BranchU and prepare to use the new BranchL instead: - - j__udyFreeJBU(PjbuRaw, Pjpm); - - Pjbany = (Word_t) PjblRaw; - JPtype = branchL_JPtype[levelsub]; - - } // compress to BranchL - - -// COMPRESS JPBRANCH_U* TO JPBRANCH_B*: -// -// If unable to allocate the BranchB or any JP subarray, free all related -// memory and just keep the BranchU. -// -// Note: This use of JU_OPP_UNCOMPRESS is a bit conservative because the -// BranchU is already allocated while the (presumably smaller) BranchB is not, -// the opposite of how its used in single-insert code. - - else - { - Pjbb_t PjbbRaw = (Pjbb_t) NULL; // new BranchB; init for cc. - Pjbb_t Pjbb; - Pjp_t Pjp2; // in BranchU. - - if ((*PPop1 > JU_BRANCHB_MAX_POP) // pop too high. - || ((PjbbRaw = j__udyAllocJBB(Pjpm)) == (Pjbb_t) NULL)) - { // cant alloc BranchB. - goto SetParent; // just keep BranchU. - } - - Pjbb = P_JBB(PjbbRaw); - -// Set bits in bitmap for populated subexpanses: - - Pjp2 = Pjbu->jbu_jp; - - for (digit = 0; digit < cJU_BRANCHUNUMJPS; ++digit) - if ((((Pjbu->jbu_jp) + digit)->jp_Type) != JPtype_null) - JU_BITMAPSETB(Pjbb, digit); - -// Copy non-null JPs to BranchB JP subarrays: - - for (offset = 0; offset < cJU_NUMSUBEXPB; ++offset) - { - Pjp_t PjparrayRaw; - Pjp_t Pjparray; - - if (! (numJPs = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, offset)))) - continue; // skip empty subexpanse. - -// If unable to allocate a JP subarray, free all BranchB memory so far and -// continue to use the BranchU: - - if ((PjparrayRaw = j__udyAllocJBBJP(numJPs, Pjpm)) - == (Pjp_t) NULL) - { - while (offset-- > 0) - { - if (JU_JBB_PJP(Pjbb, offset) == (Pjp_t) NULL) continue; - - j__udyFreeJBBJP(JU_JBB_PJP(Pjbb, offset), - j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, offset)), - Pjpm); - } - j__udyFreeJBB(PjbbRaw, Pjpm); - goto SetParent; // keep BranchU. - } - -// Set one JP subarray pointer and copy the subexpanses JPs to the subarray: -// -// Scan the BranchU for non-null JPs until numJPs JPs are copied. - - JU_JBB_PJP(Pjbb, offset) = PjparrayRaw; - Pjparray = P_JP(PjparrayRaw); - - while (numJPs-- > 0) - { - while ((Pjp2->jp_Type) == JPtype_null) - { - ++Pjp2; - assert(Pjp2 < (Pjbu->jbu_jp) + cJU_BRANCHUNUMJPS); - } - *Pjparray++ = *Pjp2++; - } - } // for each subexpanse - -// Free the BranchU and prepare to use the new BranchB instead: - - j__udyFreeJBU(PjbuRaw, Pjpm); - - Pjbany = (Word_t) PjbbRaw; - JPtype = branchB_JPtype[levelsub]; - - } // compress to BranchB - - -// COMPLETE OR PARTIAL SUCCESS: -// -// Attach new branch (under Pjp, with JPtype) to parent JP; note use of *PPop1, -// possibly reduced due to partial failure. - -SetParent: - (PjpParent->jp_Addr) = Pjbany; - (PjpParent->jp_Type) = JPtype; - - if (Level < cJU_ROOTSTATE) // PjpParent not in JPM: - { - Word_t DcdP0 = (*PIndex & cJU_DCDMASK(levelsub)) | (*PPop1 - 1); - - JU_JPSETADT(PjpParent ,Pjbany, DcdP0, JPtype); - } - - return(retval); - -} // j__udyInsArray() diff --git a/libjudy/src/JudyL/JudyLInsertBranch.c b/libjudy/src/JudyL/JudyLInsertBranch.c deleted file mode 100644 index eaf8a5c94f..0000000000 --- a/libjudy/src/JudyL/JudyLInsertBranch.c +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.17 $ $Source: /judy/src/JudyCommon/JudyInsertBranch.c $ - -// BranchL insertion functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -extern int j__udyCreateBranchL(Pjp_t, Pjp_t, uint8_t *, Word_t, Pvoid_t); - - -// **************************************************************************** -// __ J U D Y I N S E R T B R A N C H -// -// Insert 2-element BranchL in between Pjp and Pjp->jp_Addr. -// -// Return -1 if out of memory, otherwise return 1. - -FUNCTION int j__udyInsertBranch( - Pjp_t Pjp, // JP containing narrow pointer. - Word_t Index, // outlier to Pjp. - Word_t BranchLevel, // of what JP points to, mapped from JP type. - Pjpm_t Pjpm) // for global accounting. -{ - jp_t JP2 [2]; - jp_t JP; - Pjp_t PjpNull; - Word_t XorExp; - Word_t Inew, Iold; - Word_t DCDMask; // initially for original BranchLevel. - int Ret; - uint8_t Exp2[2]; - uint8_t DecodeByteN, DecodeByteO; - -// Get the current mask for the DCD digits: - - DCDMask = cJU_DCDMASK(BranchLevel); - -// Obtain Dcd bits that differ between Index and JP, shifted so the -// digit for BranchLevel is the LSB: - - XorExp = ((Index ^ JU_JPDCDPOP0(Pjp)) & (cJU_ALLONES >> cJU_BITSPERBYTE)) - >> (BranchLevel * cJU_BITSPERBYTE); - assert(XorExp); // Index must be an outlier. - -// Count levels between object under narrow pointer and the level at which -// the outlier diverges from it, which is always at least initial -// BranchLevel + 1, to end up with the level (JP type) at which to insert -// the new intervening BranchL: - - do { ++BranchLevel; } while ((XorExp >>= cJU_BITSPERBYTE)); - assert((BranchLevel > 1) && (BranchLevel < cJU_ROOTSTATE)); - -// Get the MSB (highest digit) that differs between the old expanse and -// the new Index to insert: - - DecodeByteO = JU_DIGITATSTATE(JU_JPDCDPOP0(Pjp), BranchLevel); - DecodeByteN = JU_DIGITATSTATE(Index, BranchLevel); - - assert(DecodeByteO != DecodeByteN); - -// Determine sorted order for old expanse and new Index digits: - - if (DecodeByteN > DecodeByteO) { Iold = 0; Inew = 1; } - else { Iold = 1; Inew = 0; } - -// Copy old JP into staging area for new Branch - JP2 [Iold] = *Pjp; - Exp2[Iold] = DecodeByteO; - Exp2[Inew] = DecodeByteN; - -// Create a 2 Expanse Linear branch -// -// Note: Pjp->jp_Addr is set by j__udyCreateBranchL() - - Ret = j__udyCreateBranchL(Pjp, JP2, Exp2, 2, Pjpm); - if (Ret == -1) return(-1); - -// Get Pjp to the NULL of where to do insert - PjpNull = ((P_JBL(Pjp->jp_Addr))->jbl_jp) + Inew; - -// Convert to a cJU_JPIMMED_*_01 at the correct level: -// Build JP and set type below to: cJU_JPIMMED_X_01 - JU_JPSETADT(PjpNull, 0, Index, cJU_JPIMMED_1_01 - 2 + BranchLevel); - -// Return pointer to Value area in cJU_JPIMMED_X_01 - JUDYLCODE(Pjpm->jpm_PValue = (Pjv_t) PjpNull;) - -// The old JP now points to a BranchL that is at higher level. Therefore -// it contains excess DCD bits (in the least significant position) that -// must be removed (zeroed); that is, they become part of the Pop0 -// subfield. Note that the remaining (lower) bytes in the Pop0 field do -// not change. -// -// Take from the old DCDMask, which went "down" to a lower BranchLevel, -// and zero any high bits that are still in the mask at the new, higher -// BranchLevel; then use this mask to zero the bits in jp_DcdPopO: - -// Set old JP to a BranchL at correct level - - Pjp->jp_Type = cJU_JPBRANCH_L2 - 2 + BranchLevel; - DCDMask ^= cJU_DCDMASK(BranchLevel); - DCDMask = ~DCDMask & JU_JPDCDPOP0(Pjp); - JP = *Pjp; - JU_JPSETADT(Pjp, JP.jp_Addr, DCDMask, JP.jp_Type); - - return(1); - -} // j__udyInsertBranch() diff --git a/libjudy/src/JudyL/JudyLMallocIF.c b/libjudy/src/JudyL/JudyLMallocIF.c deleted file mode 100644 index 9a7d02f210..0000000000 --- a/libjudy/src/JudyL/JudyLMallocIF.c +++ /dev/null @@ -1,782 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.45 $ $Source: /judy/src/JudyCommon/JudyMallocIF.c $ -// -// Judy malloc/free interface functions for Judy1 and JudyL. -// -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DTRACEMI (Malloc Interface) to turn on tracing of malloc/free -// calls at the interface level. (See also TRACEMF in lower-level code.) -// Use -DTRACEMI2 for a terser format suitable for trace analysis. -// -// There can be malloc namespace bits in the LSBs of "raw" addresses from most, -// but not all, of the j__udy*Alloc*() functions; see also JudyPrivate.h. To -// test the Judy code, compile this file with -DMALLOCBITS and use debug flavor -// only (for assertions). This test ensures that (a) all callers properly mask -// the namespace bits out before dereferencing a pointer (or else a core dump -// occurs), and (b) all callers send "raw" (unmasked) addresses to -// j__udy*Free*() calls. -// -// Note: Currently -DDEBUG turns on MALLOCBITS automatically. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -// Set "hidden" global j__uMaxWords to the maximum number of words to allocate -// to any one array (large enough to have a JPM, otherwise j__uMaxWords is -// ignored), to trigger a fake malloc error when the number is exceeded. Note, -// this code is always executed, not #ifdefd, because its virtually free. -// -// Note: To keep the MALLOC macro faster and simpler, set j__uMaxWords to -// MAXINT, not zero, by default. - -Word_t j__uMaxWords = ~0UL; - -// This macro hides the faking of a malloc failure: -// -// Note: To keep this fast, just compare WordsPrev to j__uMaxWords without the -// complexity of first adding WordsNow, meaning the trigger point is not -// exactly where you might assume, but it shouldnt matter. - -#define MALLOC(MallocFunc,WordsPrev,WordsNow) \ - (((WordsPrev) > j__uMaxWords) ? 0UL : MallocFunc(WordsNow)) - -// Clear words starting at address: -// -// Note: Only use this for objects that care; in other cases, it doesnt -// matter if the objects memory is pre-zeroed. - -#define ZEROWORDS(Addr,Words) \ - { \ - Word_t Words__ = (Words); \ - PWord_t Addr__ = (PWord_t) (Addr); \ - while (Words__--) *Addr__++ = 0UL; \ - } - -#ifdef TRACEMI - -// TRACING SUPPORT: -// -// Note: For TRACEMI, use a format for address printing compatible with other -// tracing facilities; in particular, %x not %lx, to truncate the "noisy" high -// part on 64-bit systems. -// -// TBD: The trace macros need fixing for alternate address types. -// -// Note: TRACEMI2 supports trace analysis no matter the underlying malloc/free -// engine used. - -#include - -static Word_t j__udyMemSequence = 0L; // event sequence number. - -#define TRACE_ALLOC5(a,b,c,d,e) (void) printf(a, (b), c, d) -#define TRACE_FREE5( a,b,c,d,e) (void) printf(a, (b), c, d) -#define TRACE_ALLOC6(a,b,c,d,e,f) (void) printf(a, (b), c, d, e) -#define TRACE_FREE6( a,b,c,d,e,f) (void) printf(a, (b), c, d, e) - -#else - -#ifdef TRACEMI2 - -#include - -#define b_pw cJU_BYTESPERWORD - -#define TRACE_ALLOC5(a,b,c,d,e) \ - (void) printf("a %lx %lx %lx\n", (b), (d) * b_pw, e) -#define TRACE_FREE5( a,b,c,d,e) \ - (void) printf("f %lx %lx %lx\n", (b), (d) * b_pw, e) -#define TRACE_ALLOC6(a,b,c,d,e,f) \ - (void) printf("a %lx %lx %lx\n", (b), (e) * b_pw, f) -#define TRACE_FREE6( a,b,c,d,e,f) \ - (void) printf("f %lx %lx %lx\n", (b), (e) * b_pw, f) - -static Word_t j__udyMemSequence = 0L; // event sequence number. - -#else - -#define TRACE_ALLOC5(a,b,c,d,e) // null. -#define TRACE_FREE5( a,b,c,d,e) // null. -#define TRACE_ALLOC6(a,b,c,d,e,f) // null. -#define TRACE_FREE6( a,b,c,d,e,f) // null. - -#endif // ! TRACEMI2 -#endif // ! TRACEMI - - -// MALLOC NAMESPACE SUPPORT: - -#if (defined(DEBUG) && (! defined(MALLOCBITS))) // for now, DEBUG => MALLOCBITS: -#define MALLOCBITS 1 -#endif - -#ifdef MALLOCBITS -#define MALLOCBITS_VALUE 0x3 // bit pattern to use. -#define MALLOCBITS_MASK 0x7 // note: matches mask__ in JudyPrivate.h. - -#define MALLOCBITS_SET( Type,Addr) \ - ((Addr) = (Type) ((Word_t) (Addr) | MALLOCBITS_VALUE)) -#define MALLOCBITS_TEST(Type,Addr) \ - assert((((Word_t) (Addr)) & MALLOCBITS_MASK) == MALLOCBITS_VALUE); \ - ((Addr) = (Type) ((Word_t) (Addr) & ~MALLOCBITS_VALUE)) -#else -#define MALLOCBITS_SET( Type,Addr) // null. -#define MALLOCBITS_TEST(Type,Addr) // null. -#endif - - -// SAVE ERROR INFORMATION IN A Pjpm: -// -// "Small" (invalid) Addr values are used to distinguish overrun and no-mem -// errors. (TBD, non-zero invalid values are no longer returned from -// lower-level functions, that is, JU_ERRNO_OVERRUN is no longer detected.) - -#define J__UDYSETALLOCERROR(Addr) \ - { \ - JU_ERRID(Pjpm) = __LINE__; \ - if ((Word_t) (Addr) > 0) JU_ERRNO(Pjpm) = JU_ERRNO_OVERRUN; \ - else JU_ERRNO(Pjpm) = JU_ERRNO_NOMEM; \ - return(0); \ - } - - -// **************************************************************************** -// ALLOCATION FUNCTIONS: -// -// To help the compiler catch coding errors, each function returns a specific -// object type. -// -// Note: Only j__udyAllocJPM() and j__udyAllocJLW() return multiple values <= -// sizeof(Word_t) to indicate the type of memory allocation failure. Other -// allocation functions convert this failure to a JU_ERRNO. - - -// Note: Unlike other j__udyAlloc*() functions, Pjpms are returned non-raw, -// that is, without malloc namespace or root pointer type bits: - -FUNCTION Pjpm_t j__udyAllocJPM(void) -{ - Word_t Words = (sizeof(jpm_t) + cJU_BYTESPERWORD - 1) / cJU_BYTESPERWORD; - Pjpm_t Pjpm = (Pjpm_t) MALLOC(JudyMalloc, Words, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jpm_t)); - - if ((Word_t) Pjpm > sizeof(Word_t)) - { - ZEROWORDS(Pjpm, Words); - Pjpm->jpm_TotalMemWords = Words; - } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJPM(), Words = %lu\n", - Pjpm, j__udyMemSequence++, Words, cJU_LEAFW_MAXPOP1 + 1); - // MALLOCBITS_SET(Pjpm_t, Pjpm); // see above. - return(Pjpm); - -} // j__udyAllocJPM() - - -FUNCTION Pjbl_t j__udyAllocJBL(Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbl_t) / cJU_BYTESPERWORD; - Pjbl_t PjblRaw = (Pjbl_t) MALLOC(JudyMallocVirtual, - Pjpm->jpm_TotalMemWords, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jbl_t)); - - if ((Word_t) PjblRaw > sizeof(Word_t)) - { - ZEROWORDS(P_JBL(PjblRaw), Words); - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjblRaw); } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJBL(), Words = %lu\n", PjblRaw, - j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjbl_t, PjblRaw); - return(PjblRaw); - -} // j__udyAllocJBL() - - -FUNCTION Pjbb_t j__udyAllocJBB(Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbb_t) / cJU_BYTESPERWORD; - Pjbb_t PjbbRaw = (Pjbb_t) MALLOC(JudyMallocVirtual, - Pjpm->jpm_TotalMemWords, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jbb_t)); - - if ((Word_t) PjbbRaw > sizeof(Word_t)) - { - ZEROWORDS(P_JBB(PjbbRaw), Words); - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjbbRaw); } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJBB(), Words = %lu\n", PjbbRaw, - j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjbb_t, PjbbRaw); - return(PjbbRaw); - -} // j__udyAllocJBB() - - -FUNCTION Pjp_t j__udyAllocJBBJP(Word_t NumJPs, Pjpm_t Pjpm) -{ - Word_t Words = JU_BRANCHJP_NUMJPSTOWORDS(NumJPs); - Pjp_t PjpRaw; - - PjpRaw = (Pjp_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjpRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjpRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJBBJP(%lu), Words = %lu\n", PjpRaw, - j__udyMemSequence++, NumJPs, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjp_t, PjpRaw); - return(PjpRaw); - -} // j__udyAllocJBBJP() - - -FUNCTION Pjbu_t j__udyAllocJBU(Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbu_t) / cJU_BYTESPERWORD; - Pjbu_t PjbuRaw = (Pjbu_t) MALLOC(JudyMallocVirtual, - Pjpm->jpm_TotalMemWords, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jbu_t)); - - if ((Word_t) PjbuRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjbuRaw); } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJBU(), Words = %lu\n", PjbuRaw, - j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjbu_t, PjbuRaw); - return(PjbuRaw); - -} // j__udyAllocJBU() - - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -FUNCTION Pjll_t j__udyAllocJLL1(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF1POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL1(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL1() - -#endif // (JUDYL || (! JU_64BIT)) - - -FUNCTION Pjll_t j__udyAllocJLL2(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF2POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL2(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL2() - - -FUNCTION Pjll_t j__udyAllocJLL3(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF3POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL3(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL3() - - -#ifdef JU_64BIT - -FUNCTION Pjll_t j__udyAllocJLL4(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF4POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL4(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL4() - - -FUNCTION Pjll_t j__udyAllocJLL5(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF5POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL5(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL5() - - -FUNCTION Pjll_t j__udyAllocJLL6(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF6POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL6(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL6() - - -FUNCTION Pjll_t j__udyAllocJLL7(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF7POPTOWORDS(Pop1); - Pjll_t PjllRaw; - - PjllRaw = (Pjll_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjllRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjllRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLL7(%lu), Words = %lu\n", PjllRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjll_t, PjllRaw); - return(PjllRaw); - -} // j__udyAllocJLL7() - -#endif // JU_64BIT - - -// Note: Root-level leaf addresses are always whole words (Pjlw_t), and unlike -// other j__udyAlloc*() functions, they are returned non-raw, that is, without -// malloc namespace or root pointer type bits (the latter are added later by -// the caller): - -FUNCTION Pjlw_t j__udyAllocJLW(Word_t Pop1) -{ - Word_t Words = JU_LEAFWPOPTOWORDS(Pop1); - Pjlw_t Pjlw = (Pjlw_t) MALLOC(JudyMalloc, Words, Words); - - TRACE_ALLOC6("0x%x %8lu = j__udyAllocJLW(%lu), Words = %lu\n", Pjlw, - j__udyMemSequence++, Pop1, Words, Pop1); - // MALLOCBITS_SET(Pjlw_t, Pjlw); // see above. - return(Pjlw); - -} // j__udyAllocJLW() - - -FUNCTION Pjlb_t j__udyAllocJLB1(Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jlb_t) / cJU_BYTESPERWORD; - Pjlb_t PjlbRaw; - - PjlbRaw = (Pjlb_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - assert((Words * cJU_BYTESPERWORD) == sizeof(jlb_t)); - - if ((Word_t) PjlbRaw > sizeof(Word_t)) - { - ZEROWORDS(P_JLB(PjlbRaw), Words); - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjlbRaw); } - - TRACE_ALLOC5("0x%x %8lu = j__udyAllocJLB1(), Words = %lu\n", PjlbRaw, - j__udyMemSequence++, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjlb_t, PjlbRaw); - return(PjlbRaw); - -} // j__udyAllocJLB1() - - -#ifdef JUDYL - -FUNCTION Pjv_t j__udyLAllocJV(Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JL_LEAFVPOPTOWORDS(Pop1); - Pjv_t PjvRaw; - - PjvRaw = (Pjv_t) MALLOC(JudyMalloc, Pjpm->jpm_TotalMemWords, Words); - - if ((Word_t) PjvRaw > sizeof(Word_t)) - { - Pjpm->jpm_TotalMemWords += Words; - } - else { J__UDYSETALLOCERROR(PjvRaw); } - - TRACE_ALLOC6("0x%x %8lu = j__udyLAllocJV(%lu), Words = %lu\n", PjvRaw, - j__udyMemSequence++, Pop1, Words, (Pjpm->jpm_Pop0) + 2); - MALLOCBITS_SET(Pjv_t, PjvRaw); - return(PjvRaw); - -} // j__udyLAllocJV() - -#endif // JUDYL - - -// **************************************************************************** -// FREE FUNCTIONS: -// -// To help the compiler catch coding errors, each function takes a specific -// object type to free. - - -// Note: j__udyFreeJPM() receives a root pointer with NO root pointer type -// bits present, that is, they must be stripped by the caller using P_JPM(): - -FUNCTION void j__udyFreeJPM(Pjpm_t PjpmFree, Pjpm_t PjpmStats) -{ - Word_t Words = (sizeof(jpm_t) + cJU_BYTESPERWORD - 1) / cJU_BYTESPERWORD; - - // MALLOCBITS_TEST(Pjpm_t, PjpmFree); // see above. - JudyFree((Pvoid_t) PjpmFree, Words); - - if (PjpmStats != (Pjpm_t) NULL) PjpmStats->jpm_TotalMemWords -= Words; - -// Note: Log PjpmFree->jpm_Pop0, similar to other j__udyFree*() functions, not -// an assumed value of cJU_LEAFW_MAXPOP1, for when the caller is -// Judy*FreeArray(), jpm_Pop0 is set to 0, and the population after the free -// really will be 0, not cJU_LEAFW_MAXPOP1. - - TRACE_FREE6("0x%x %8lu = j__udyFreeJPM(%lu), Words = %lu\n", PjpmFree, - j__udyMemSequence++, Words, Words, PjpmFree->jpm_Pop0); - - -} // j__udyFreeJPM() - - -FUNCTION void j__udyFreeJBL(Pjbl_t Pjbl, Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbl_t) / cJU_BYTESPERWORD; - - MALLOCBITS_TEST(Pjbl_t, Pjbl); - JudyFreeVirtual((Pvoid_t) Pjbl, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE5("0x%x %8lu = j__udyFreeJBL(), Words = %lu\n", Pjbl, - j__udyMemSequence++, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJBL() - - -FUNCTION void j__udyFreeJBB(Pjbb_t Pjbb, Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbb_t) / cJU_BYTESPERWORD; - - MALLOCBITS_TEST(Pjbb_t, Pjbb); - JudyFreeVirtual((Pvoid_t) Pjbb, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE5("0x%x %8lu = j__udyFreeJBB(), Words = %lu\n", Pjbb, - j__udyMemSequence++, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJBB() - - -FUNCTION void j__udyFreeJBBJP(Pjp_t Pjp, Word_t NumJPs, Pjpm_t Pjpm) -{ - Word_t Words = JU_BRANCHJP_NUMJPSTOWORDS(NumJPs); - - MALLOCBITS_TEST(Pjp_t, Pjp); - JudyFree((Pvoid_t) Pjp, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJBBJP(%lu), Words = %lu\n", Pjp, - j__udyMemSequence++, NumJPs, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJBBJP() - - -FUNCTION void j__udyFreeJBU(Pjbu_t Pjbu, Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jbu_t) / cJU_BYTESPERWORD; - - MALLOCBITS_TEST(Pjbu_t, Pjbu); - JudyFreeVirtual((Pvoid_t) Pjbu, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE5("0x%x %8lu = j__udyFreeJBU(), Words = %lu\n", Pjbu, - j__udyMemSequence++, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJBU() - - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - -FUNCTION void j__udyFreeJLL1(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF1POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL1(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL1() - -#endif // (JUDYL || (! JU_64BIT)) - - -FUNCTION void j__udyFreeJLL2(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF2POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL2(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL2() - - -FUNCTION void j__udyFreeJLL3(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF3POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL3(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL3() - - -#ifdef JU_64BIT - -FUNCTION void j__udyFreeJLL4(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF4POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL4(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL4() - - -FUNCTION void j__udyFreeJLL5(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF5POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL5(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL5() - - -FUNCTION void j__udyFreeJLL6(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF6POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL6(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL6() - - -FUNCTION void j__udyFreeJLL7(Pjll_t Pjll, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAF7POPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjll_t, Pjll); - JudyFree((Pvoid_t) Pjll, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLL7(%lu), Words = %lu\n", Pjll, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLL7() - -#endif // JU_64BIT - - -// Note: j__udyFreeJLW() receives a root pointer with NO root pointer type -// bits present, that is, they are stripped by P_JLW(): - -FUNCTION void j__udyFreeJLW(Pjlw_t Pjlw, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JU_LEAFWPOPTOWORDS(Pop1); - - // MALLOCBITS_TEST(Pjlw_t, Pjlw); // see above. - JudyFree((Pvoid_t) Pjlw, Words); - - if (Pjpm) Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyFreeJLW(%lu), Words = %lu\n", Pjlw, - j__udyMemSequence++, Pop1, Words, Pop1 - 1); - - -} // j__udyFreeJLW() - - -FUNCTION void j__udyFreeJLB1(Pjlb_t Pjlb, Pjpm_t Pjpm) -{ - Word_t Words = sizeof(jlb_t) / cJU_BYTESPERWORD; - - MALLOCBITS_TEST(Pjlb_t, Pjlb); - JudyFree((Pvoid_t) Pjlb, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE5("0x%x %8lu = j__udyFreeJLB1(), Words = %lu\n", Pjlb, - j__udyMemSequence++, Words, Pjpm->jpm_Pop0); - - -} // j__udyFreeJLB1() - - -#ifdef JUDYL - -FUNCTION void j__udyLFreeJV(Pjv_t Pjv, Word_t Pop1, Pjpm_t Pjpm) -{ - Word_t Words = JL_LEAFVPOPTOWORDS(Pop1); - - MALLOCBITS_TEST(Pjv_t, Pjv); - JudyFree((Pvoid_t) Pjv, Words); - - Pjpm->jpm_TotalMemWords -= Words; - - TRACE_FREE6("0x%x %8lu = j__udyLFreeJV(%lu), Words = %lu\n", Pjv, - j__udyMemSequence++, Pop1, Words, Pjpm->jpm_Pop0); - - -} // j__udyLFreeJV() - -#endif // JUDYL diff --git a/libjudy/src/JudyL/JudyLMemActive.c b/libjudy/src/JudyL/JudyLMemActive.c deleted file mode 100644 index 701cc34910..0000000000 --- a/libjudy/src/JudyL/JudyLMemActive.c +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.7 $ $Source: /judy/src/JudyCommon/JudyMemActive.c $ -// -// Return number of bytes of memory used to support a Judy1/L array. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -FUNCTION static Word_t j__udyGetMemActive(Pjp_t); - - -// **************************************************************************** -// J U D Y 1 M E M A C T I V E -// J U D Y L M E M A C T I V E - -#ifdef JUDY1 -FUNCTION Word_t Judy1MemActive -#else -FUNCTION Word_t JudyLMemActive -#endif - ( - Pcvoid_t PArray // from which to retrieve. - ) -{ - if (PArray == (Pcvoid_t)NULL) return(0); - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - Word_t Words = Pjlw[0] + 1; // population. -#ifdef JUDY1 - return((Words + 1) * sizeof(Word_t)); -#else - return(((Words * 2) + 1) * sizeof(Word_t)); -#endif - } - else - { - Pjpm_t Pjpm = P_JPM(PArray); - return(j__udyGetMemActive(&Pjpm->jpm_JP) + sizeof(jpm_t)); - } - -} // JudyMemActive() - - -// **************************************************************************** -// __ J U D Y G E T M E M A C T I V E - -FUNCTION static Word_t j__udyGetMemActive( - Pjp_t Pjp) // top of subtree. -{ - Word_t offset; // in a branch. - Word_t Bytes = 0; // actual bytes used at this level. - Word_t IdxSz; // bytes per index in leaves - - switch (JU_JPTYPE(Pjp)) - { - - case cJU_JPBRANCH_L2: - case cJU_JPBRANCH_L3: -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - case cJU_JPBRANCH_L5: - case cJU_JPBRANCH_L6: - case cJU_JPBRANCH_L7: -#endif - case cJU_JPBRANCH_L: - { - Pjbl_t Pjbl = P_JBL(Pjp->jp_Addr); - - for (offset = 0; offset < (Pjbl->jbl_NumJPs); ++offset) - Bytes += j__udyGetMemActive((Pjbl->jbl_jp) + offset); - - return(Bytes + sizeof(jbl_t)); - } - - case cJU_JPBRANCH_B2: - case cJU_JPBRANCH_B3: -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - case cJU_JPBRANCH_B5: - case cJU_JPBRANCH_B6: - case cJU_JPBRANCH_B7: -#endif - case cJU_JPBRANCH_B: - { - Word_t subexp; - Word_t jpcount; - Pjbb_t Pjbb = P_JBB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - Bytes += jpcount * sizeof(jp_t); - - for (offset = 0; offset < jpcount; ++offset) - { - Bytes += j__udyGetMemActive(P_JP(JU_JBB_PJP(Pjbb, subexp)) - + offset); - } - } - - return(Bytes + sizeof(jbb_t)); - } - - case cJU_JPBRANCH_U2: - case cJU_JPBRANCH_U3: -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: - case cJU_JPBRANCH_U5: - case cJU_JPBRANCH_U6: - case cJU_JPBRANCH_U7: -#endif - case cJU_JPBRANCH_U: - { - Pjbu_t Pjbu = P_JBU(Pjp->jp_Addr); - - for (offset = 0; offset < cJU_BRANCHUNUMJPS; ++offset) - { - if (((Pjbu->jbu_jp[offset].jp_Type) >= cJU_JPNULL1) - && ((Pjbu->jbu_jp[offset].jp_Type) <= cJU_JPNULLMAX)) - { - continue; // skip null JP to save time. - } - - Bytes += j__udyGetMemActive(Pjbu->jbu_jp + offset); - } - - return(Bytes + sizeof(jbu_t)); - } - - -// -- Cases below here terminate and do not recurse. -- - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: IdxSz = 1; goto LeafWords; -#endif - case cJU_JPLEAF2: IdxSz = 2; goto LeafWords; - case cJU_JPLEAF3: IdxSz = 3; goto LeafWords; -#ifdef JU_64BIT - case cJU_JPLEAF4: IdxSz = 4; goto LeafWords; - case cJU_JPLEAF5: IdxSz = 5; goto LeafWords; - case cJU_JPLEAF6: IdxSz = 6; goto LeafWords; - case cJU_JPLEAF7: IdxSz = 7; goto LeafWords; -#endif -LeafWords: - -#ifdef JUDY1 - return(IdxSz * (JU_JPLEAF_POP0(Pjp) + 1)); -#else - return((IdxSz + sizeof(Word_t)) - * (JU_JPLEAF_POP0(Pjp) + 1)); -#endif - case cJU_JPLEAF_B1: - { -#ifdef JUDY1 - return(sizeof(jlb_t)); -#else - Bytes = (JU_JPLEAF_POP0(Pjp) + 1) * sizeof(Word_t); - - return(Bytes + sizeof(jlb_t)); -#endif - } - - JUDY1CODE(case cJ1_JPFULLPOPU1: return(0);) - -#ifdef JUDY1 -#define J__Mpy 0 -#else -#define J__Mpy sizeof(Word_t) -#endif - - case cJU_JPIMMED_1_01: return(0); - case cJU_JPIMMED_2_01: return(0); - case cJU_JPIMMED_3_01: return(0); -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: return(0); - case cJU_JPIMMED_5_01: return(0); - case cJU_JPIMMED_6_01: return(0); - case cJU_JPIMMED_7_01: return(0); -#endif - - case cJU_JPIMMED_1_02: return(J__Mpy * 2); - case cJU_JPIMMED_1_03: return(J__Mpy * 3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: return(J__Mpy * 4); - case cJU_JPIMMED_1_05: return(J__Mpy * 5); - case cJU_JPIMMED_1_06: return(J__Mpy * 6); - case cJU_JPIMMED_1_07: return(J__Mpy * 7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: return(0); - case cJ1_JPIMMED_1_09: return(0); - case cJ1_JPIMMED_1_10: return(0); - case cJ1_JPIMMED_1_11: return(0); - case cJ1_JPIMMED_1_12: return(0); - case cJ1_JPIMMED_1_13: return(0); - case cJ1_JPIMMED_1_14: return(0); - case cJ1_JPIMMED_1_15: return(0); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: return(J__Mpy * 2); - case cJU_JPIMMED_2_03: return(J__Mpy * 3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: return(0); - case cJ1_JPIMMED_2_05: return(0); - case cJ1_JPIMMED_2_06: return(0); - case cJ1_JPIMMED_2_07: return(0); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: return(J__Mpy * 2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: return(0); - case cJ1_JPIMMED_3_04: return(0); - case cJ1_JPIMMED_3_05: return(0); - - case cJ1_JPIMMED_4_02: return(0); - case cJ1_JPIMMED_4_03: return(0); - case cJ1_JPIMMED_5_02: return(0); - case cJ1_JPIMMED_5_03: return(0); - case cJ1_JPIMMED_6_02: return(0); - case cJ1_JPIMMED_7_02: return(0); -#endif - - } // switch (JU_JPTYPE(Pjp)) - - return(0); // to make some compilers happy. - -} // j__udyGetMemActive() diff --git a/libjudy/src/JudyL/JudyLMemUsed.c b/libjudy/src/JudyL/JudyLMemUsed.c deleted file mode 100644 index fc92d48800..0000000000 --- a/libjudy/src/JudyL/JudyLMemUsed.c +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.5 $ $Source: /judy/src/JudyCommon/JudyMemUsed.c $ -// -// Return number of bytes of memory used to support a Judy1/L array. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -#ifdef JUDY1 -FUNCTION Word_t Judy1MemUsed -#else // JUDYL -FUNCTION Word_t JudyLMemUsed -#endif - ( - Pcvoid_t PArray // from which to retrieve. - ) -{ - Word_t Words = 0; - - if (PArray == (Pcvoid_t) NULL) return(0); - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - Words = JU_LEAFWPOPTOWORDS(Pjlw[0] + 1); // based on pop1. - } - else - { - Pjpm_t Pjpm = P_JPM(PArray); - Words = Pjpm->jpm_TotalMemWords; - } - - return(Words * sizeof(Word_t)); // convert to bytes. - -} // Judy1MemUsed() / JudyLMemUsed() diff --git a/libjudy/src/JudyL/JudyLNext.c b/libjudy/src/JudyL/JudyLNext.c deleted file mode 100644 index d15db1596c..0000000000 --- a/libjudy/src/JudyL/JudyLNext.c +++ /dev/null @@ -1,1890 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.54 $ $Source: /judy/src/JudyCommon/JudyPrevNext.c $ -// -// Judy*Prev() and Judy*Next() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DJUDYNEXT for the Judy*Next() function; otherwise defaults to -// Judy*Prev(). - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifndef JUDYNEXT -#ifndef JUDYPREV -#define JUDYPREV 1 // neither set => use default. -#endif -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - - -// **************************************************************************** -// J U D Y 1 P R E V -// J U D Y 1 N E X T -// J U D Y L P R E V -// J U D Y L N E X T -// -// See the manual entry for the API. -// -// OVERVIEW OF Judy*Prev(): -// -// Use a reentrant switch statement (state machine, SM1 = "get") to decode the -// callers *PIndex-1, starting with the (PArray), through branches, if -// any, down to an immediate or a leaf. Look for *PIndex-1 in that leaf, and -// if found, return it. -// -// A dead end is either a branch that does not contain a JP for the appropriate -// digit in *PIndex-1, or a leaf that does not contain the undecoded digits of -// *PIndex-1. Upon reaching a dead end, backtrack through the leaf/branches -// that were just traversed, using a list (history) of parent JPs that is built -// while going forward in SM1Get. Start with the current leaf or branch. In a -// backtracked leaf, look for an Index less than *PIndex-1. In each -// backtracked branch, look "sideways" for the next JP, if any, lower than the -// one for the digit (from *PIndex-1) that was previously decoded. While -// backtracking, if a leaf has no previous Index or a branch has no lower JP, -// go to its parent branch in turn. Upon reaching the JRP, return failure, "no -// previous Index". The backtrack process is sufficiently different from -// SM1Get to merit its own separate reentrant switch statement (SM2 = -// "backtrack"). -// -// While backtracking, upon finding a lower JP in a branch, there is certain to -// be a "prev" Index under that JP (unless the Judy array is corrupt). -// Traverse forward again, this time taking the last (highest, right-most) JP -// in each branch, and the last (highest) Index upon reaching an immediate or a -// leaf. This traversal is sufficiently different from SM1Get and SM2Backtrack -// to merit its own separate reentrant switch statement (SM3 = "findlimit"). -// -// "Decode" bytes in JPs complicate this process a little. In SM1Get, when a -// JP is a narrow pointer, that is, when states are skipped (so the skipped -// digits are stored in jp_DcdPopO), compare the relevant digits to the same -// digits in *PIndex-1. If they are EQUAL, proceed in SM1Get as before. If -// jp_DcdPopOs digits are GREATER, treat the JP as a dead end and proceed in -// SM2Backtrack. If jp_DcdPopOs digits are LESS, treat the JP as if it had -// just been found during a backtrack and proceed directly in SM3Findlimit. -// -// Note that Decode bytes can be ignored in SM3Findlimit; they dont matter. -// Also note that in practice the Decode bytes are routinely compared with -// *PIndex-1 because thats simpler and no slower than first testing for -// narrowness. -// -// Decode bytes also make it unnecessary to construct the Index to return (the -// revised *PIndex) during the search. This step is deferred until finding an -// Index during backtrack or findlimit, before returning it. The first digit -// of *PIndex is derived (saved) based on which JP is used in a JRP branch. -// The remaining digits are obtained from the jp_DcdPopO field in the JP (if -// any) above the immediate or leaf containing the found (prev) Index, plus the -// remaining digit(s) in the immediate or leaf itself. In the case of a LEAFW, -// the Index to return is found directly in the leaf. -// -// Note: Theoretically, as described above, upon reaching a dead end, SM1Get -// passes control to SM2Backtrack to look sideways, even in a leaf. Actually -// its a little more efficient for the SM1Get leaf cases to shortcut this and -// take care of the sideways searches themselves. Hence the history list only -// contains branch JPs, and SM2Backtrack only handles branches. In fact, even -// the branch handling cases in SM1Get do some shortcutting (sideways -// searching) to avoid pushing history and calling SM2Backtrack unnecessarily. -// -// Upon reaching an Index to return after backtracking, *PIndex must be -// modified to the found Index. In principle this could be done by building -// the Index from a saved rootdigit (in the top branch) plus the Dcd bytes from -// the parent JP plus the appropriate Index bytes from the leaf. However, -// Immediates are difficult because their parent JPs lack one (last) digit. So -// instead just build the *PIndex to return "top down" while backtracking and -// findlimiting. -// -// This function is written iteratively for speed, rather than recursively. -// -// CAVEATS: -// -// Why use a backtrack list (history stack), since it has finite size? The -// size is small for Judy on both 32-bit and 64-bit systems, and a list (really -// just an array) is fast to maintain and use. Other alternatives include -// doing a lookahead (lookaside) in each branch while traversing forward -// (decoding), and restarting from the top upon a dead end. -// -// A lookahead means noting the last branch traversed which contained a -// non-null JP lower than the one specified by a digit in *PIndex-1, and -// returning to that point for SM3Findlimit. This seems like a good idea, and -// should be pretty cheap for linear and bitmap branches, but it could result -// in up to 31 unnecessary additional cache line fills (in extreme cases) for -// every uncompressed branch traversed. We have considered means of attaching -// to or hiding within an uncompressed branch (in null JPs) a "cache line map" -// or other structure, such as an offset to the next non-null JP, that would -// speed this up, but it seems unnecessary merely to avoid having a -// finite-length list (array). (If JudySL is ever made "native", the finite -// list length will be an issue.) -// -// Restarting at the top of the Judy array after a dead end requires a careful -// modification of *PIndex-1 to decrement the digit for the parent branch and -// set the remaining lower digits to all 1s. This must be repeated each time a -// parent branch contains another dead end, so even though it should all happen -// in cache, the CPU time can be excessive. (For JudySL or an equivalent -// "infinitely deep" Judy array, consider a hybrid of a large, finite, -// "circular" list and a restart-at-top when the list is backtracked to -// exhaustion.) -// -// Why search for *PIndex-1 instead of *PIndex during SM1Get? In rare -// instances this prevents an unnecessary decode down the wrong path followed -// by a backtrack; its pretty cheap to set up initially; and it means the -// SM1Get machine can simply return if/when it finds that Index. -// -// TBD: Wed like to enhance this function to make successive searches faster. -// This would require saving some previous state, including the previous Index -// returned, and in which leaf it was found. If the next call is for the same -// Index and the array has not been modified, start at the same leaf. This -// should be much easier to implement since this is iterative rather than -// recursive code. -// -// VARIATIONS FOR Judy*Next(): -// -// The Judy*Next() code is nearly a perfect mirror of the Judy*Prev() code. -// See the Judy*Prev() overview comments, and mentally switch the following: -// -// - "*PIndex-1" => "*PIndex+1" -// - "less than" => "greater than" -// - "lower" => "higher" -// - "lowest" => "highest" -// - "next-left" => "next-right" -// - "right-most" => "left-most" -// -// Note: SM3Findlimit could be called SM3Findmax/SM3Findmin, but a common name -// for both Prev and Next means many fewer ifdefs in this code. -// -// TBD: Currently this code traverses a JP whether its expanse is partially or -// completely full (populated). For Judy1 (only), since there is no value area -// needed, consider shortcutting to a "success" return upon encountering a full -// JP in SM1Get (or even SM3Findlimit?) A full JP looks like this: -// -// (((JU_JPDCDPOP0(Pjp) ^ cJU_ALLONES) & cJU_POP0MASK(cLevel)) == 0) - -#ifdef JUDY1 -#ifdef JUDYPREV -FUNCTION int Judy1Prev -#else -FUNCTION int Judy1Next -#endif -#else -#ifdef JUDYPREV -FUNCTION PPvoid_t JudyLPrev -#else -FUNCTION PPvoid_t JudyLNext -#endif -#endif - ( - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError // optional, for returning error info. - ) -{ - Pjp_t Pjp, Pjp2; // current JPs. - Pjbl_t Pjbl; // Pjp->jp_Addr masked and cast to types: - Pjbb_t Pjbb; - Pjbu_t Pjbu; - -// Note: The following initialization is not strictly required but it makes -// gcc -Wall happy because there is an "impossible" path from Immed handling to -// SM1LeafLImm code that looks like Pjll might be used before set: - - Pjll_t Pjll = (Pjll_t) NULL; - Word_t state; // current state in SM. - Word_t digit; // next digit to decode from Index. - -// Note: The following initialization is not strictly required but it makes -// gcc -Wall happy because there is an "impossible" path from Immed handling to -// SM1LeafLImm code (for JudyL & JudyPrev only) that looks like pop1 might be -// used before set: - -#if (defined(JUDYL) && defined(JUDYPREV)) - Word_t pop1 = 0; // in a leaf. -#else - Word_t pop1; // in a leaf. -#endif - int offset; // linear branch/leaf, from j__udySearchLeaf*(). - int subexp; // subexpanse in a bitmap branch. - Word_t bitposmask; // bit in bitmap for Index. - -// History for SM2Backtrack: -// -// For a given histnum, APjphist[histnum] is a parent JP that points to a -// branch, and Aoffhist[histnum] is the offset of the NEXT JP in the branch to -// which the parent JP points. The meaning of Aoffhist[histnum] depends on the -// type of branch to which the parent JP points: -// -// Linear: Offset of the next JP in the JP list. -// -// Bitmap: Which subexpanse, plus the offset of the next JP in the -// subexpanses JP list (to avoid bit-counting again), plus for Judy*Next(), -// hidden one byte to the left, which digit, because Judy*Next() also needs -// this. -// -// Uncompressed: Digit, which is actually the offset of the JP in the branch. -// -// Note: Only branch JPs are stored in APjphist[] because, as explained -// earlier, SM1Get shortcuts sideways searches in leaves (and even in branches -// in some cases), so SM2Backtrack only handles branches. - -#define HISTNUMMAX cJU_ROOTSTATE // maximum branches traversable. - Pjp_t APjphist[HISTNUMMAX]; // list of branch JPs traversed. - int Aoffhist[HISTNUMMAX]; // list of next JP offsets; see above. - int histnum = 0; // number of JPs now in list. - - -// ---------------------------------------------------------------------------- -// M A C R O S -// -// These are intended to make the code a bit more readable and less redundant. - - -// "PUSH" AND "POP" Pjp AND offset ON HISTORY STACKS: -// -// Note: Ensure a corrupt Judy array does not overflow *hist[]. Meanwhile, -// underflowing *hist[] simply means theres no more room to backtrack => -// "no previous/next Index". - -#define HISTPUSH(Pjp,Offset) \ - APjphist[histnum] = (Pjp); \ - Aoffhist[histnum] = (Offset); \ - \ - if (++histnum >= HISTNUMMAX) \ - { \ - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT) \ - JUDY1CODE(return(JERRI );) \ - JUDYLCODE(return(PPJERR);) \ - } - -#define HISTPOP(Pjp,Offset) \ - if ((histnum--) < 1) JU_RET_NOTFOUND; \ - (Pjp) = APjphist[histnum]; \ - (Offset) = Aoffhist[histnum] - -// How to pack/unpack Aoffhist[] values for bitmap branches: - -#ifdef JUDYPREV - -#define HISTPUSHBOFF(Subexp,Offset,Digit) \ - (((Subexp) * cJU_BITSPERSUBEXPB) | (Offset)) - -#define HISTPOPBOFF(Subexp,Offset,Digit) \ - (Subexp) = (Offset) / cJU_BITSPERSUBEXPB; \ - (Offset) %= cJU_BITSPERSUBEXPB -#else - -#define HISTPUSHBOFF(Subexp,Offset,Digit) \ - (((Digit) << cJU_BITSPERBYTE) \ - | ((Subexp) * cJU_BITSPERSUBEXPB) | (Offset)) - -#define HISTPOPBOFF(Subexp,Offset,Digit) \ - (Digit) = (Offset) >> cJU_BITSPERBYTE; \ - (Subexp) = ((Offset) & JU_LEASTBYTESMASK(1)) / cJU_BITSPERSUBEXPB; \ - (Offset) %= cJU_BITSPERSUBEXPB -#endif - - -// CHECK FOR NULL JP: - -#define JPNULL(Type) (((Type) >= cJU_JPNULL1) && ((Type) <= cJU_JPNULLMAX)) - - -// SEARCH A BITMAP: -// -// This is a weak analog of j__udySearchLeaf*() for bitmaps. Return the actual -// or next-left position, base 0, of Digit in the single uint32_t bitmap, also -// given a Bitposmask for Digit. -// -// Unlike j__udySearchLeaf*(), the offset is not returned bit-complemented if -// Digits bit is unset, because the caller can check the bitmap themselves to -// determine that. Also, if Digits bit is unset, the returned offset is to -// the next-left JP (including -1), not to the "ideal" position for the Index = -// next-right JP. -// -// Shortcut and skip calling j__udyCountBits*() if the bitmap is full, in which -// case (Digit % cJU_BITSPERSUBEXP*) itself is the base-0 offset. -// -// TBD for Judy*Next(): Should this return next-right instead of next-left? -// That is, +1 from current value? Maybe not, if Digits bit IS set, +1 would -// be wrong. - -#define SEARCHBITMAPB(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPB) ? (Digit % cJU_BITSPERSUBEXPB) : \ - j__udyCountBitsB((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#define SEARCHBITMAPL(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPL) ? (Digit % cJU_BITSPERSUBEXPL) : \ - j__udyCountBitsL((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#ifdef JUDYPREV -// Equivalent to search for the highest offset in Bitmap: - -#define SEARCHBITMAPMAXB(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPB) ? cJU_BITSPERSUBEXPB - 1 : \ - j__udyCountBitsB(Bitmap) - 1) - -#define SEARCHBITMAPMAXL(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPL) ? cJU_BITSPERSUBEXPL - 1 : \ - j__udyCountBitsL(Bitmap) - 1) -#endif - - -// CHECK DECODE BYTES: -// -// Check Decode bytes in a JP against the equivalent portion of *PIndex. If -// *PIndex is lower (for Judy*Prev()) or higher (for Judy*Next()), this JP is a -// dead end (the same as if it had been absent in a linear or bitmap branch or -// null in an uncompressed branch), enter SM2Backtrack; otherwise enter -// SM3Findlimit to find the highest/lowest Index under this JP, as if the code -// had already backtracked to this JP. - -#ifdef JUDYPREV -#define CDcmp__ < -#else -#define CDcmp__ > -#endif - -#define CHECKDCD(cState) \ - if (JU_DCDNOTMATCHINDEX(*PIndex, Pjp, cState)) \ - { \ - if ((*PIndex & cJU_DCDMASK(cState)) \ - CDcmp__(JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(cState))) \ - { \ - goto SM2Backtrack; \ - } \ - goto SM3Findlimit; \ - } - - -// PREPARE TO HANDLE A LEAFW OR JRP BRANCH IN SM1: -// -// Extract a state-dependent digit from Index in a "constant" way, then jump to -// common code for multiple cases. - -#define SM1PREPB(cState,Next) \ - state = (cState); \ - digit = JU_DIGITATSTATE(*PIndex, cState); \ - goto Next - - -// PREPARE TO HANDLE A LEAFW OR JRP BRANCH IN SM3: -// -// Optionally save Dcd bytes into *PIndex, then save state and jump to common -// code for multiple cases. - -#define SM3PREPB_DCD(cState,Next) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - SM3PREPB(cState,Next) - -#define SM3PREPB(cState,Next) state = (cState); goto Next - - -// ---------------------------------------------------------------------------- -// CHECK FOR SHORTCUTS: -// -// Error out if PIndex is null. Execute JU_RET_NOTFOUND if the Judy array is -// empty or *PIndex is already the minimum/maximum Index possible. -// -// Note: As documented, in case of failure *PIndex may be modified. - - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -#ifdef JUDYPREV - if ((PArray == (Pvoid_t) NULL) || ((*PIndex)-- == 0)) -#else - if ((PArray == (Pvoid_t) NULL) || ((*PIndex)++ == cJU_ALLONES)) -#endif - JU_RET_NOTFOUND; - - -// HANDLE JRP: -// -// Before even entering SM1Get, check the JRP type. For JRP branches, traverse -// the JPM; handle LEAFW leaves directly; but look for the most common cases -// first. - -// ROOT-STATE LEAF that starts with a Pop0 word; just look within the leaf: -// -// If *PIndex is in the leaf, return it; otherwise return the Index, if any, -// below where it would belong. - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - pop1 = Pjlw[0] + 1; - - if ((offset = j__udySearchLeafW(Pjlw + 1, pop1, *PIndex)) - >= 0) // Index is present. - { - assert(offset < pop1); // in expected range. - JU_RET_FOUND_LEAFW(Pjlw, pop1, offset); // *PIndex is set. - } - -#ifdef JUDYPREV - if ((offset = ~offset) == 0) // no next-left Index. -#else - if ((offset = ~offset) >= pop1) // no next-right Index. -#endif - JU_RET_NOTFOUND; - - assert(offset <= pop1); // valid result. - -#ifdef JUDYPREV - *PIndex = Pjlw[offset--]; // next-left Index, base 1. -#else - *PIndex = Pjlw[offset + 1]; // next-right Index, base 1. -#endif - JU_RET_FOUND_LEAFW(Pjlw, pop1, offset); // base 0. - - } - else // JRP BRANCH - { - Pjpm_t Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); - -// goto SM1Get; - } - -// ============================================================================ -// STATE MACHINE 1 -- GET INDEX: -// -// Search for *PIndex (already decremented/incremented so as to be inclusive). -// If found, return it. Otherwise in theory hand off to SM2Backtrack or -// SM3Findlimit, but in practice "shortcut" by first sideways searching the -// current branch or leaf upon hitting a dead end. During sideways search, -// modify *PIndex to a new path taken. -// -// ENTRY: Pjp points to next JP to interpret, whose Decode bytes have not yet -// been checked. This JP is not yet listed in history. -// -// Note: Check Decode bytes at the start of each loop, not after looking up a -// new JP, so its easy to do constant shifts/masks, although this requires -// cautious handling of Pjp, offset, and *hist[] for correct entry to -// SM2Backtrack. -// -// EXIT: Return, or branch to SM2Backtrack or SM3Findlimit with correct -// interface, as described elsewhere. -// -// WARNING: For run-time efficiency the following cases replicate code with -// varying constants, rather than using common code with variable values! - -SM1Get: // return here for next branch/leaf. - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_L2: CHECKDCD(2); SM1PREPB(2, SM1BranchL); - case cJU_JPBRANCH_L3: CHECKDCD(3); SM1PREPB(3, SM1BranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: CHECKDCD(4); SM1PREPB(4, SM1BranchL); - case cJU_JPBRANCH_L5: CHECKDCD(5); SM1PREPB(5, SM1BranchL); - case cJU_JPBRANCH_L6: CHECKDCD(6); SM1PREPB(6, SM1BranchL); - case cJU_JPBRANCH_L7: CHECKDCD(7); SM1PREPB(7, SM1BranchL); -#endif - case cJU_JPBRANCH_L: SM1PREPB(cJU_ROOTSTATE, SM1BranchL); - -// Common code (state-independent) for all cases of linear branches: - -SM1BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -// Found JP matching current digit in *PIndex; record parent JP and the next -// JPs offset, and iterate to the next JP: - - if ((offset = j__udySearchLeaf1((Pjll_t) (Pjbl->jbl_Expanse), - Pjbl->jbl_NumJPs, digit)) >= 0) - { - HISTPUSH(Pjp, offset); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM1Get; - } - -// Dead end, no JP in BranchL for next digit in *PIndex: -// -// Get the ideal location of digits JP, and if theres no next-left/right JP -// in the BranchL, shortcut and start backtracking one level up; ignore the -// current Pjp because it points to a BranchL with no next-left/right JP. - -#ifdef JUDYPREV - if ((offset = (~offset) - 1) < 0) // no next-left JP in BranchL. -#else - if ((offset = (~offset)) >= Pjbl->jbl_NumJPs) // no next-right. -#endif - goto SM2Backtrack; - -// Theres a next-left/right JP in the current BranchL; save its digit in -// *PIndex and shortcut to SM3Findlimit: - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Check Decode bytes, if any, in the current JP, then look for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_B2: CHECKDCD(2); SM1PREPB(2, SM1BranchB); - case cJU_JPBRANCH_B3: CHECKDCD(3); SM1PREPB(3, SM1BranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: CHECKDCD(4); SM1PREPB(4, SM1BranchB); - case cJU_JPBRANCH_B5: CHECKDCD(5); SM1PREPB(5, SM1BranchB); - case cJU_JPBRANCH_B6: CHECKDCD(6); SM1PREPB(6, SM1BranchB); - case cJU_JPBRANCH_B7: CHECKDCD(7); SM1PREPB(7, SM1BranchB); -#endif - case cJU_JPBRANCH_B: SM1PREPB(cJU_ROOTSTATE, SM1BranchB); - -// Common code (state-independent) for all cases of bitmap branches: - -SM1BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - -// Locate the digits JP in the subexpanse list, if present, otherwise the -// offset of the next-left JP, if any: - - subexp = digit / cJU_BITSPERSUBEXPB; - assert(subexp < cJU_NUMSUBEXPB); // falls in expected range. - bitposmask = JU_BITPOSMASKB(digit); - offset = SEARCHBITMAPB(JU_JBB_BITMAP(Pjbb, subexp), digit, - bitposmask); - // right range: - assert((offset >= -1) && (offset < (int) cJU_BITSPERSUBEXPB)); - -// Found JP matching current digit in *PIndex: -// -// Record the parent JP and the next JPs offset; and iterate to the next JP. - -// if (JU_BITMAPTESTB(Pjbb, digit)) // slower. - if (JU_JBB_BITMAP(Pjbb, subexp) & bitposmask) // faster. - { - // not negative since at least one bit is set: - assert(offset >= 0); - - HISTPUSH(Pjp, HISTPUSHBOFF(subexp, offset, digit)); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM1Get; // iterate to next JP. - } - -// Dead end, no JP in BranchB for next digit in *PIndex: -// -// If theres a next-left/right JP in the current BranchB, shortcut to -// SM3Findlimit. Note: offset is already set to the correct value for the -// next-left/right JP. - -#ifdef JUDYPREV - if (offset >= 0) // next-left JP is in this subexpanse. - goto SM1BranchBFindlimit; - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JBB_BITMAP(Pjbb, subexp) & JU_MASKHIGHEREXC(bitposmask)) - { - ++offset; // next-left => next-right. - goto SM1BranchBFindlimit; - } - - while (++subexp < cJU_NUMSUBEXPB) // search next-right subexps. -#endif - { - if (! JU_JBB_PJP(Pjbb, subexp)) continue; // empty subexpanse. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - offset = 0; -#endif - -// Save the next-left/right JPs digit in *PIndex: - -SM1BranchBFindlimit: - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), - offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchB: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a BranchB with no next-left/right JP. - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Check Decode bytes, if any, in the current JP, then look for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_U2: CHECKDCD(2); SM1PREPB(2, SM1BranchU); - case cJU_JPBRANCH_U3: CHECKDCD(3); SM1PREPB(3, SM1BranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: CHECKDCD(4); SM1PREPB(4, SM1BranchU); - case cJU_JPBRANCH_U5: CHECKDCD(5); SM1PREPB(5, SM1BranchU); - case cJU_JPBRANCH_U6: CHECKDCD(6); SM1PREPB(6, SM1BranchU); - case cJU_JPBRANCH_U7: CHECKDCD(7); SM1PREPB(7, SM1BranchU); -#endif - case cJU_JPBRANCH_U: SM1PREPB(cJU_ROOTSTATE, SM1BranchU); - -// Common code (state-independent) for all cases of uncompressed branches: - -SM1BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - Pjp2 = (Pjbu->jbu_jp) + digit; - -// Found JP matching current digit in *PIndex: -// -// Record the parent JP and the next JPs digit, and iterate to the next JP. -// -// TBD: Instead of this, just goto SM1Get, and add cJU_JPNULL* cases to the -// SM1Get state machine? Then backtrack? However, it means you cant detect -// an inappropriate cJU_JPNULL*, when it occurs in other than a BranchU, and -// return JU_RET_CORRUPT. - - if (! JPNULL(JU_JPTYPE(Pjp2))) // digit has a JP. - { - HISTPUSH(Pjp, digit); - Pjp = Pjp2; - goto SM1Get; - } - -// Dead end, no JP in BranchU for next digit in *PIndex: -// -// Search for a next-left/right JP in the current BranchU, and if one is found, -// save its digit in *PIndex and shortcut to SM3Findlimit: - -#ifdef JUDYPREV - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - while (digit < cJU_BRANCHUNUMJPS - 1) - { - Pjp = (Pjbu->jbu_jp) + (++digit); -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchU: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a BranchU with no next-left/right JP. - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for -// *PIndex. - -#define SM1LEAFL(Func) \ - Pjll = P_JLL(Pjp->jp_Addr); \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - offset = Func(Pjll, pop1, *PIndex); \ - goto SM1LeafLImm - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKDCD(1); SM1LEAFL(j__udySearchLeaf1); -#endif - case cJU_JPLEAF2: CHECKDCD(2); SM1LEAFL(j__udySearchLeaf2); - case cJU_JPLEAF3: CHECKDCD(3); SM1LEAFL(j__udySearchLeaf3); - -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKDCD(4); SM1LEAFL(j__udySearchLeaf4); - case cJU_JPLEAF5: CHECKDCD(5); SM1LEAFL(j__udySearchLeaf5); - case cJU_JPLEAF6: CHECKDCD(6); SM1LEAFL(j__udySearchLeaf6); - case cJU_JPLEAF7: CHECKDCD(7); SM1LEAFL(j__udySearchLeaf7); -#endif - -// Common code (state-independent) for all cases of linear leaves and -// immediates: - -SM1LeafLImm: - if (offset >= 0) // *PIndex is in LeafL / Immed. -#ifdef JUDY1 - JU_RET_FOUND; -#else - { // JudyL is trickier... - switch (JU_JPTYPE(Pjp)) - { -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - case cJU_JPLEAF2: JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - case cJU_JPLEAF3: JU_RET_FOUND_LEAF3(Pjll, pop1, offset); -#ifdef JU_64BIT - case cJU_JPLEAF4: JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - case cJU_JPLEAF5: JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - case cJU_JPLEAF6: JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - case cJU_JPLEAF7: JU_RET_FOUND_LEAF7(Pjll, pop1, offset); -#endif - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - JU_RET_FOUND_IMM_01(Pjp); - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#ifdef JU_64BIT - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: - case cJU_JPIMMED_3_02: -#endif - JU_RET_FOUND_IMM(Pjp, offset); - } - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // impossible? - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // found *PIndex - -#endif // JUDYL - -// Dead end, no Index in LeafL / Immed for remaining digit(s) in *PIndex: -// -// Get the ideal location of Index, and if theres no next-left/right Index in -// the LeafL / Immed, shortcut and start backtracking one level up; ignore the -// current Pjp because it points to a LeafL / Immed with no next-left/right -// Index. - -#ifdef JUDYPREV - if ((offset = (~offset) - 1) < 0) // no next-left Index. -#else - if ((offset = (~offset)) >= pop1) // no next-right Index. -#endif - goto SM2Backtrack; - -// Theres a next-left/right Index in the current LeafL / Immed; shortcut by -// copying its digit(s) to *PIndex and returning it. -// -// Unfortunately this is pretty hairy, especially avoiding endian issues. -// -// The cJU_JPLEAF* cases are very similar to same-index-size cJU_JPIMMED* cases -// for *_02 and above, but must return differently, at least for JudyL, so -// spell them out separately here at the cost of a little redundant code for -// Judy1. - - switch (JU_JPTYPE(Pjp)) - { -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]); - JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - - case cJU_JPLEAF2: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - - case cJU_JPLEAF3: - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - -#ifdef JU_64BIT - case cJU_JPLEAF4: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - - case cJU_JPLEAF5: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - } - - case cJU_JPLEAF6: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - } - - case cJU_JPLEAF7: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_LEAF7(Pjll, pop1, offset); - } - -#endif // JU_64BIT - -#define SET_01(cState) JU_SETDIGITS(*PIndex, JU_JPDCDPOP0(Pjp), cState) - - case cJU_JPIMMED_1_01: SET_01(1); goto SM1Imm_01; - case cJU_JPIMMED_2_01: SET_01(2); goto SM1Imm_01; - case cJU_JPIMMED_3_01: SET_01(3); goto SM1Imm_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: SET_01(4); goto SM1Imm_01; - case cJU_JPIMMED_5_01: SET_01(5); goto SM1Imm_01; - case cJU_JPIMMED_6_01: SET_01(6); goto SM1Imm_01; - case cJU_JPIMMED_7_01: SET_01(7); goto SM1Imm_01; -#endif -SM1Imm_01: JU_RET_FOUND_IMM_01(Pjp); - -// Shorthand for where to find start of Index bytes array: - -#ifdef JUDY1 -#define PJI (Pjp->jp_1Index) -#else -#define PJI (Pjp->jp_LIndex) -#endif - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]); - JU_RET_FOUND_IMM(Pjp, offset); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: - case cJ1_JPIMMED_4_03: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); - - case cJ1_JPIMMED_5_02: - case cJ1_JPIMMED_5_03: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_6_02: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_7_02: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - -#endif // (JUDY1 && JU_64BIT) - - } // switch for not-found *PIndex - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // impossible? - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Check Decode bytes, if any, in the current JP, then look in the leaf for -// *PIndex. - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; - CHECKDCD(1); - - Pjlb = P_JLB(Pjp->jp_Addr); - digit = JU_DIGITATSTATE(*PIndex, 1); - subexp = JU_SUBEXPL(digit); - bitposmask = JU_BITPOSMASKL(digit); - assert(subexp < cJU_NUMSUBEXPL); // falls in expected range. - -// *PIndex exists in LeafB1: - -// if (JU_BITMAPTESTL(Pjlb, digit)) // slower. - if (JU_JLB_BITMAP(Pjlb, subexp) & bitposmask) // faster. - { -#ifdef JUDYL // needs offset at this point: - offset = SEARCHBITMAPL(JU_JLB_BITMAP(Pjlb, subexp), digit, bitposmask); -#endif - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - } - -// Dead end, no Index in LeafB1 for remaining digit in *PIndex: -// -// If theres a next-left/right Index in the current LeafB1, which for -// Judy*Next() is true if any bits are set for higher Indexes, shortcut by -// returning it. Note: For Judy*Prev(), offset is set here to the correct -// value for the next-left JP. - - offset = SEARCHBITMAPL(JU_JLB_BITMAP(Pjlb, subexp), digit, - bitposmask); - // right range: - assert((offset >= -1) && (offset < (int) cJU_BITSPERSUBEXPL)); - -#ifdef JUDYPREV - if (offset >= 0) // next-left JP is in this subexpanse. - goto SM1LeafB1Findlimit; - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JLB_BITMAP(Pjlb, subexp) & JU_MASKHIGHEREXC(bitposmask)) - { - ++offset; // next-left => next-right. - goto SM1LeafB1Findlimit; - } - - while (++subexp < cJU_NUMSUBEXPL) // search next-right subexps. -#endif - { - if (! JU_JLB_BITMAP(Pjlb, subexp)) continue; // empty subexp. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXL(JU_JLB_BITMAP(Pjlb, subexp)); - // expected range: - assert((offset >= 0) && (offset < (int) cJU_BITSPERSUBEXPL)); -#else - offset = 0; -#endif - -// Save the next-left/right Indexess digit in *PIndex: - -SM1LeafB1Findlimit: - JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset); - JU_SETDIGIT1(*PIndex, digit); - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - } - -// Theres no next-left/right Index in the LeafB1: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a LeafB1 with no next-left/right Index. - - goto SM2Backtrack; - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// If the Decode bytes match, *PIndex is found (without modification). - - case cJ1_JPFULLPOPU1: - - CHECKDCD(1); - JU_RET_FOUND_FULLPOPU1; -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: - -#ifdef JUDYPREV -#define SM1IMM_SETPOP1(cPop1) -#else -#define SM1IMM_SETPOP1(cPop1) pop1 = (cPop1) -#endif - -#define SM1IMM(Func,cPop1) \ - SM1IMM_SETPOP1(cPop1); \ - offset = Func((Pjll_t) (PJI), cPop1, *PIndex); \ - goto SM1LeafLImm - -// Special case for Pop1 = 1 Immediate JPs: -// -// If *PIndex is in the immediate, offset is 0, otherwise the binary NOT of the -// offset where it belongs, 0 or 1, same as from the search functions. - -#ifdef JUDYPREV -#define SM1IMM_01_SETPOP1 -#else -#define SM1IMM_01_SETPOP1 pop1 = 1 -#endif - -#define SM1IMM_01 \ - SM1IMM_01_SETPOP1; \ - offset = ((JU_JPDCDPOP0(Pjp) < JU_TRIMTODCDSIZE(*PIndex)) ? ~1 : \ - (JU_JPDCDPOP0(Pjp) == JU_TRIMTODCDSIZE(*PIndex)) ? 0 : \ - ~0); \ - goto SM1LeafLImm - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - SM1IMM_01; - -// TBD: Doug says it would be OK to have fewer calls and calculate arg 2, here -// and in Judy*Count() also. - - case cJU_JPIMMED_1_02: SM1IMM(j__udySearchLeaf1, 2); - case cJU_JPIMMED_1_03: SM1IMM(j__udySearchLeaf1, 3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: SM1IMM(j__udySearchLeaf1, 4); - case cJU_JPIMMED_1_05: SM1IMM(j__udySearchLeaf1, 5); - case cJU_JPIMMED_1_06: SM1IMM(j__udySearchLeaf1, 6); - case cJU_JPIMMED_1_07: SM1IMM(j__udySearchLeaf1, 7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: SM1IMM(j__udySearchLeaf1, 8); - case cJ1_JPIMMED_1_09: SM1IMM(j__udySearchLeaf1, 9); - case cJ1_JPIMMED_1_10: SM1IMM(j__udySearchLeaf1, 10); - case cJ1_JPIMMED_1_11: SM1IMM(j__udySearchLeaf1, 11); - case cJ1_JPIMMED_1_12: SM1IMM(j__udySearchLeaf1, 12); - case cJ1_JPIMMED_1_13: SM1IMM(j__udySearchLeaf1, 13); - case cJ1_JPIMMED_1_14: SM1IMM(j__udySearchLeaf1, 14); - case cJ1_JPIMMED_1_15: SM1IMM(j__udySearchLeaf1, 15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: SM1IMM(j__udySearchLeaf2, 2); - case cJU_JPIMMED_2_03: SM1IMM(j__udySearchLeaf2, 3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: SM1IMM(j__udySearchLeaf2, 4); - case cJ1_JPIMMED_2_05: SM1IMM(j__udySearchLeaf2, 5); - case cJ1_JPIMMED_2_06: SM1IMM(j__udySearchLeaf2, 6); - case cJ1_JPIMMED_2_07: SM1IMM(j__udySearchLeaf2, 7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: SM1IMM(j__udySearchLeaf3, 2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: SM1IMM(j__udySearchLeaf3, 3); - case cJ1_JPIMMED_3_04: SM1IMM(j__udySearchLeaf3, 4); - case cJ1_JPIMMED_3_05: SM1IMM(j__udySearchLeaf3, 5); - - case cJ1_JPIMMED_4_02: SM1IMM(j__udySearchLeaf4, 2); - case cJ1_JPIMMED_4_03: SM1IMM(j__udySearchLeaf4, 3); - - case cJ1_JPIMMED_5_02: SM1IMM(j__udySearchLeaf5, 2); - case cJ1_JPIMMED_5_03: SM1IMM(j__udySearchLeaf5, 3); - - case cJ1_JPIMMED_6_02: SM1IMM(j__udySearchLeaf6, 2); - - case cJ1_JPIMMED_7_02: SM1IMM(j__udySearchLeaf7, 2); -#endif - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM1Get switch. - - /*NOTREACHED*/ - - -// ============================================================================ -// STATE MACHINE 2 -- BACKTRACK BRANCH TO PREVIOUS JP: -// -// Look for the next-left/right JP in a branch, backing up the history list as -// necessary. Upon finding a next-left/right JP, modify the corresponding -// digit in *PIndex before passing control to SM3Findlimit. -// -// Note: As described earlier, only branch JPs are expected here; other types -// fall into the default case. -// -// Note: If a found JP contains needed Dcd bytes, thats OK, theyre copied to -// *PIndex in SM3Findlimit. -// -// TBD: This code has a lot in common with similar code in the shortcut cases -// in SM1Get. Can combine this code somehow? -// -// ENTRY: List, possibly empty, of JPs and offsets in APjphist[] and -// Aoffhist[]; see earlier comments. -// -// EXIT: Execute JU_RET_NOTFOUND if no previous/next JP; otherwise jump to -// SM3Findlimit to resume a new but different downward search. - -SM2Backtrack: // come or return here for first/next sideways search. - - HISTPOP(Pjp, offset); - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: - - case cJU_JPBRANCH_L2: state = 2; goto SM2BranchL; - case cJU_JPBRANCH_L3: state = 3; goto SM2BranchL; -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: state = 4; goto SM2BranchL; - case cJU_JPBRANCH_L5: state = 5; goto SM2BranchL; - case cJU_JPBRANCH_L6: state = 6; goto SM2BranchL; - case cJU_JPBRANCH_L7: state = 7; goto SM2BranchL; -#endif - case cJU_JPBRANCH_L: state = cJU_ROOTSTATE; goto SM2BranchL; - -SM2BranchL: -#ifdef JUDYPREV - if (--offset < 0) goto SM2Backtrack; // no next-left JP in BranchL. -#endif - Pjbl = P_JBL(Pjp->jp_Addr); -#ifdef JUDYNEXT - if (++offset >= (Pjbl->jbl_NumJPs)) goto SM2Backtrack; - // no next-right JP in BranchL. -#endif - -// Theres a next-left/right JP in the current BranchL; save its digit in -// *PIndex and continue with SM3Findlimit: - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: - - case cJU_JPBRANCH_B2: state = 2; goto SM2BranchB; - case cJU_JPBRANCH_B3: state = 3; goto SM2BranchB; -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: state = 4; goto SM2BranchB; - case cJU_JPBRANCH_B5: state = 5; goto SM2BranchB; - case cJU_JPBRANCH_B6: state = 6; goto SM2BranchB; - case cJU_JPBRANCH_B7: state = 7; goto SM2BranchB; -#endif - case cJU_JPBRANCH_B: state = cJU_ROOTSTATE; goto SM2BranchB; - -SM2BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - HISTPOPBOFF(subexp, offset, digit); // unpack values. - -// If theres a next-left/right JP in the current BranchB, which for -// Judy*Next() is true if any bits are set for higher Indexes, continue to -// SM3Findlimit: -// -// Note: offset is set to the JP previously traversed; go one to the -// left/right. - -#ifdef JUDYPREV - if (offset > 0) // next-left JP is in this subexpanse. - { - --offset; - goto SM2BranchBFindlimit; - } - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JBB_BITMAP(Pjbb, subexp) - & JU_MASKHIGHEREXC(JU_BITPOSMASKB(digit))) - { - ++offset; // next-left => next-right. - goto SM2BranchBFindlimit; - } - - while (++subexp < cJU_NUMSUBEXPB) // search next-right subexps. -#endif - { - if (! JU_JBB_PJP(Pjbb, subexp)) continue; // empty subexpanse. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - offset = 0; -#endif - -// Save the next-left/right JPs digit in *PIndex: - -SM2BranchBFindlimit: - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), - offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchB: - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: - - case cJU_JPBRANCH_U2: state = 2; goto SM2BranchU; - case cJU_JPBRANCH_U3: state = 3; goto SM2BranchU; -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: state = 4; goto SM2BranchU; - case cJU_JPBRANCH_U5: state = 5; goto SM2BranchU; - case cJU_JPBRANCH_U6: state = 6; goto SM2BranchU; - case cJU_JPBRANCH_U7: state = 7; goto SM2BranchU; -#endif - case cJU_JPBRANCH_U: state = cJU_ROOTSTATE; goto SM2BranchU; - -SM2BranchU: - -// Search for a next-left/right JP in the current BranchU, and if one is found, -// save its digit in *PIndex and continue to SM3Findlimit: - - Pjbu = P_JBU(Pjp->jp_Addr); - digit = offset; - -#ifdef JUDYPREV - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - while (digit < cJU_BRANCHUNUMJPS - 1) - { - Pjp = (Pjbu->jbu_jp) + (++digit); -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchU: - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM2Backtrack switch. - - /*NOTREACHED*/ - - -// ============================================================================ -// STATE MACHINE 3 -- FIND LIMIT JP/INDEX: -// -// Look for the highest/lowest (right/left-most) JP in each branch and the -// highest/lowest Index in a leaf or immediate, and return it. While -// traversing, modify appropriate digit(s) in *PIndex to reflect the path -// taken, including Dcd bytes in each JP (which could hold critical missing -// digits for skipped branches). -// -// ENTRY: Pjp set to a JP under which to find max/min JPs (if a branch JP) or -// a max/min Index and return (if a leaf or immediate JP). -// -// EXIT: Execute JU_RET_FOUND* upon reaching a leaf or immediate. Should be -// impossible to fail, unless the Judy array is corrupt. - -SM3Findlimit: // come or return here for first/next branch/leaf. - - switch (JU_JPTYPE(Pjp)) - { -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Simply use the highest/lowest (right/left-most) JP in the BranchL, but first -// copy the Dcd bytes to *PIndex if there are any (only if state < -// cJU_ROOTSTATE - 1). - - case cJU_JPBRANCH_L2: SM3PREPB_DCD(2, SM3BranchL); -#ifndef JU_64BIT - case cJU_JPBRANCH_L3: SM3PREPB( 3, SM3BranchL); -#else - case cJU_JPBRANCH_L3: SM3PREPB_DCD(3, SM3BranchL); - case cJU_JPBRANCH_L4: SM3PREPB_DCD(4, SM3BranchL); - case cJU_JPBRANCH_L5: SM3PREPB_DCD(5, SM3BranchL); - case cJU_JPBRANCH_L6: SM3PREPB_DCD(6, SM3BranchL); - case cJU_JPBRANCH_L7: SM3PREPB( 7, SM3BranchL); -#endif - case cJU_JPBRANCH_L: SM3PREPB( cJU_ROOTSTATE, SM3BranchL); - -SM3BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -#ifdef JUDYPREV - if ((offset = (Pjbl->jbl_NumJPs) - 1) < 0) -#else - offset = 0; if ((Pjbl->jbl_NumJPs) == 0) -#endif - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Look for the highest/lowest (right/left-most) non-null subexpanse, then use -// the highest/lowest JP in that subexpanse, but first copy Dcd bytes, if there -// are any (only if state < cJU_ROOTSTATE - 1), to *PIndex. - - case cJU_JPBRANCH_B2: SM3PREPB_DCD(2, SM3BranchB); -#ifndef JU_64BIT - case cJU_JPBRANCH_B3: SM3PREPB( 3, SM3BranchB); -#else - case cJU_JPBRANCH_B3: SM3PREPB_DCD(3, SM3BranchB); - case cJU_JPBRANCH_B4: SM3PREPB_DCD(4, SM3BranchB); - case cJU_JPBRANCH_B5: SM3PREPB_DCD(5, SM3BranchB); - case cJU_JPBRANCH_B6: SM3PREPB_DCD(6, SM3BranchB); - case cJU_JPBRANCH_B7: SM3PREPB( 7, SM3BranchB); -#endif - case cJU_JPBRANCH_B: SM3PREPB( cJU_ROOTSTATE, SM3BranchB); - -SM3BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); -#ifdef JUDYPREV - subexp = cJU_NUMSUBEXPB; - - while (! (JU_JBB_BITMAP(Pjbb, --subexp))) // find non-empty subexp. - { - if (subexp <= 0) // wholly empty bitmap. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - subexp = -1; - - while (! (JU_JBB_BITMAP(Pjbb, ++subexp))) // find non-empty subexp. - { - if (subexp >= cJU_NUMSUBEXPB - 1) // didnt find one. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = 0; -#endif - - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Look for the highest/lowest (right/left-most) non-null JP, and use it, but -// first copy Dcd bytes to *PIndex if there are any (only if state < -// cJU_ROOTSTATE - 1). - - case cJU_JPBRANCH_U2: SM3PREPB_DCD(2, SM3BranchU); -#ifndef JU_64BIT - case cJU_JPBRANCH_U3: SM3PREPB( 3, SM3BranchU); -#else - case cJU_JPBRANCH_U3: SM3PREPB_DCD(3, SM3BranchU); - case cJU_JPBRANCH_U4: SM3PREPB_DCD(4, SM3BranchU); - case cJU_JPBRANCH_U5: SM3PREPB_DCD(5, SM3BranchU); - case cJU_JPBRANCH_U6: SM3PREPB_DCD(6, SM3BranchU); - case cJU_JPBRANCH_U7: SM3PREPB( 7, SM3BranchU); -#endif - case cJU_JPBRANCH_U: SM3PREPB( cJU_ROOTSTATE, SM3BranchU); - -SM3BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); -#ifdef JUDYPREV - digit = cJU_BRANCHUNUMJPS; - - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - - for (digit = 0; digit < cJU_BRANCHUNUMJPS; ++digit) - { - Pjp = (Pjbu->jbu_jp) + digit; -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// No non-null JPs in BranchU: - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Simply use the highest/lowest (right/left-most) Index in the LeafL, but the -// details vary depending on leaf Index Size. First copy Dcd bytes, if there -// are any (only if state < cJU_ROOTSTATE - 1), to *PIndex. - -#define SM3LEAFLDCD(cState) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - SM3LEAFLNODCD - -#ifdef JUDY1 -#define SM3LEAFL_SETPOP1 // not needed in any cases. -#else -#define SM3LEAFL_SETPOP1 pop1 = JU_JPLEAF_POP0(Pjp) + 1 -#endif - -#ifdef JUDYPREV -#define SM3LEAFLNODCD \ - Pjll = P_JLL(Pjp->jp_Addr); \ - SM3LEAFL_SETPOP1; \ - offset = JU_JPLEAF_POP0(Pjp); assert(offset >= 0) -#else -#define SM3LEAFLNODCD \ - Pjll = P_JLL(Pjp->jp_Addr); \ - SM3LEAFL_SETPOP1; \ - offset = 0; assert(JU_JPLEAF_POP0(Pjp) >= 0); -#endif - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - SM3LEAFLDCD(1); - JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]); - JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - - case cJU_JPLEAF2: - - SM3LEAFLDCD(2); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - -#ifndef JU_64BIT - case cJU_JPLEAF3: - { - Word_t lsb; - SM3LEAFLNODCD; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - -#else - case cJU_JPLEAF3: - { - Word_t lsb; - SM3LEAFLDCD(3); - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - - case cJU_JPLEAF4: - - SM3LEAFLDCD(4); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - - case cJU_JPLEAF5: - { - Word_t lsb; - SM3LEAFLDCD(5); - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - } - - case cJU_JPLEAF6: - { - Word_t lsb; - SM3LEAFLDCD(6); - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - } - - case cJU_JPLEAF7: - { - Word_t lsb; - SM3LEAFLNODCD; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_LEAF7(Pjll, pop1, offset); - } -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Look for the highest/lowest (right/left-most) non-null subexpanse, then use -// the highest/lowest Index in that subexpanse, but first copy Dcd bytes -// (always present since state 1 < cJU_ROOTSTATE) to *PIndex. - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; - - JU_SETDCD(*PIndex, Pjp, 1); - - Pjlb = P_JLB(Pjp->jp_Addr); -#ifdef JUDYPREV - subexp = cJU_NUMSUBEXPL; - - while (! JU_JLB_BITMAP(Pjlb, --subexp)) // find non-empty subexp. - { - if (subexp <= 0) // wholly empty bitmap. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - -// TBD: Might it be faster to just use a variant of BITMAPDIGIT*() that yields -// the digit for the right-most Index with a bit set? - - offset = SEARCHBITMAPMAXL(JU_JLB_BITMAP(Pjlb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPL)); -#else - subexp = -1; - - while (! JU_JLB_BITMAP(Pjlb, ++subexp)) // find non-empty subexp. - { - if (subexp >= cJU_NUMSUBEXPL - 1) // didnt find one. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = 0; -#endif - - JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset); - JU_SETDIGIT1(*PIndex, digit); - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// Copy Dcd bytes to *PIndex (always present since state 1 < cJU_ROOTSTATE), -// then set the highest/lowest possible digit as the LSB in *PIndex. - - case cJ1_JPFULLPOPU1: - - JU_SETDCD( *PIndex, Pjp, 1); -#ifdef JUDYPREV - JU_SETDIGIT1(*PIndex, cJU_BITSPERBITMAP - 1); -#else - JU_SETDIGIT1(*PIndex, 0); -#endif - JU_RET_FOUND_FULLPOPU1; -#endif // JUDY1 - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: -// -// Simply use the highest/lowest (right/left-most) Index in the Imm, but the -// details vary depending on leaf Index Size and pop1. Note: There are no Dcd -// bytes in an Immediate JP, but in a cJU_JPIMMED_*_01 JP, the field holds the -// least bytes of the immediate Index. - - case cJU_JPIMMED_1_01: SET_01(1); goto SM3Imm_01; - case cJU_JPIMMED_2_01: SET_01(2); goto SM3Imm_01; - case cJU_JPIMMED_3_01: SET_01(3); goto SM3Imm_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: SET_01(4); goto SM3Imm_01; - case cJU_JPIMMED_5_01: SET_01(5); goto SM3Imm_01; - case cJU_JPIMMED_6_01: SET_01(6); goto SM3Imm_01; - case cJU_JPIMMED_7_01: SET_01(7); goto SM3Imm_01; -#endif -SM3Imm_01: JU_RET_FOUND_IMM_01(Pjp); - -#ifdef JUDYPREV -#define SM3IMM_OFFSET(cPop1) (cPop1) - 1 // highest. -#else -#define SM3IMM_OFFSET(cPop1) 0 // lowest. -#endif - -#define SM3IMM(cPop1,Next) \ - offset = SM3IMM_OFFSET(cPop1); \ - goto Next - - case cJU_JPIMMED_1_02: SM3IMM( 2, SM3Imm1); - case cJU_JPIMMED_1_03: SM3IMM( 3, SM3Imm1); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: SM3IMM( 4, SM3Imm1); - case cJU_JPIMMED_1_05: SM3IMM( 5, SM3Imm1); - case cJU_JPIMMED_1_06: SM3IMM( 6, SM3Imm1); - case cJU_JPIMMED_1_07: SM3IMM( 7, SM3Imm1); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: SM3IMM( 8, SM3Imm1); - case cJ1_JPIMMED_1_09: SM3IMM( 9, SM3Imm1); - case cJ1_JPIMMED_1_10: SM3IMM(10, SM3Imm1); - case cJ1_JPIMMED_1_11: SM3IMM(11, SM3Imm1); - case cJ1_JPIMMED_1_12: SM3IMM(12, SM3Imm1); - case cJ1_JPIMMED_1_13: SM3IMM(13, SM3Imm1); - case cJ1_JPIMMED_1_14: SM3IMM(14, SM3Imm1); - case cJ1_JPIMMED_1_15: SM3IMM(15, SM3Imm1); -#endif - -SM3Imm1: JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]); - JU_RET_FOUND_IMM(Pjp, offset); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: SM3IMM(2, SM3Imm2); - case cJU_JPIMMED_2_03: SM3IMM(3, SM3Imm2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: SM3IMM(4, SM3Imm2); - case cJ1_JPIMMED_2_05: SM3IMM(5, SM3Imm2); - case cJ1_JPIMMED_2_06: SM3IMM(6, SM3Imm2); - case cJ1_JPIMMED_2_07: SM3IMM(7, SM3Imm2); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -SM3Imm2: *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: SM3IMM(2, SM3Imm3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: SM3IMM(3, SM3Imm3); - case cJ1_JPIMMED_3_04: SM3IMM(4, SM3Imm3); - case cJ1_JPIMMED_3_05: SM3IMM(5, SM3Imm3); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -SM3Imm3: - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: SM3IMM(2, SM3Imm4); - case cJ1_JPIMMED_4_03: SM3IMM(3, SM3Imm4); - -SM3Imm4: *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); - - case cJ1_JPIMMED_5_02: SM3IMM(2, SM3Imm5); - case cJ1_JPIMMED_5_03: SM3IMM(3, SM3Imm5); - -SM3Imm5: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_6_02: SM3IMM(2, SM3Imm6); - -SM3Imm6: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_7_02: SM3IMM(2, SM3Imm7); - -SM3Imm7: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif // (JUDY1 && JU_64BIT) - - -// ---------------------------------------------------------------------------- -// OTHER CASES: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM3Findlimit switch. - - /*NOTREACHED*/ - -} // Judy1Prev() / Judy1Next() / JudyLPrev() / JudyLNext() diff --git a/libjudy/src/JudyL/JudyLNextEmpty.c b/libjudy/src/JudyL/JudyLNextEmpty.c deleted file mode 100644 index 96a5901e3d..0000000000 --- a/libjudy/src/JudyL/JudyLNextEmpty.c +++ /dev/null @@ -1,1390 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.32 $ $Source: /judy/src/JudyCommon/JudyPrevNextEmpty.c $ -// -// Judy*PrevEmpty() and Judy*NextEmpty() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DJUDYNEXT for the Judy*NextEmpty() function; otherwise -// defaults to Judy*PrevEmpty(). -// -// Compile with -DTRACEJPSE to trace JP traversals. -// -// This file is separate from JudyPrevNext.c because it differs too greatly for -// ifdefs. This might be a bit surprising, but there are two reasons: -// -// - First, down in the details, searching for an empty index (SearchEmpty) is -// remarkably asymmetric with searching for a valid index (SearchValid), -// mainly with respect to: No return of a value area for JudyL; partially- -// full versus totally-full JPs; and handling of narrow pointers. -// -// - Second, we chose to implement SearchEmpty without a backtrack stack or -// backtrack engine, partly as an experiment, and partly because we think -// restarting from the top of the tree is less likely for SearchEmpty than -// for SearchValid, because empty indexes are more likely than valid indexes. -// -// A word about naming: A prior version of this feature (see 4.13) was named -// Judy*Free(), but there were concerns about that being read as a verb rather -// than an adjective. After prolonged debate and based on user input, we -// changed "Free" to "Empty". - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifndef JUDYNEXT -#ifndef JUDYPREV -#define JUDYPREV 1 // neither set => use default. -#endif -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -#ifdef TRACEJPSE -#include "JudyPrintJP.c" -#endif - - -// **************************************************************************** -// J U D Y 1 P R E V E M P T Y -// J U D Y 1 N E X T E M P T Y -// J U D Y L P R E V E M P T Y -// J U D Y L N E X T E M P T Y -// -// See the manual entry for the API. -// -// OVERVIEW OF Judy*PrevEmpty() / Judy*NextEmpty(): -// -// See also for comparison the equivalent comments in JudyPrevNext.c. -// -// Take the callers *PIndex and subtract/add 1, but watch out for -// underflow/overflow, which means "no previous/next empty index found." Use a -// reentrant switch statement (state machine, see SMGetRestart and -// SMGetContinue) to decode Index, starting with the JRP (PArray), through a -// JPM and branches, if any, down to an immediate or a leaf. Look for Index in -// that immediate or leaf, and if not found (invalid index), return success -// (Index is empty). -// -// This search can result in a dead end where taking a different path is -// required. There are four kinds of dead ends: -// -// BRANCH PRIMARY dead end: Encountering a fully-populated JP for the -// appropriate digit in Index. Search sideways in the branch for the -// previous/next absent/null/non-full JP, and if one is found, set Index to the -// highest/lowest index possible in that JPs expanse. Then if the JP is an -// absent or null JP, return success; otherwise for a non-full JP, traverse -// through the partially populated JP. -// -// BRANCH SECONDARY dead end: Reaching the end of a branch during a sideways -// search after a branch primary dead end. Set Index to the lowest/highest -// index possible in the whole branchs expanse (one higher/lower than the -// previous/next branchs expanse), then restart at the top of the tree, which -// includes pre-decrementing/incrementing Index (again) and watching for -// underflow/overflow (again). -// -// LEAF PRIMARY dead end: Finding a valid (non-empty) index in an immediate or -// leaf matching Index. Search sideways in the immediate/leaf for the -// previous/next empty index; if found, set *PIndex to match and return success. -// -// LEAF SECONDARY dead end: Reaching the end of an immediate or leaf during a -// sideways search after a leaf primary dead end. Just as for a branch -// secondary dead end, restart at the top of the tree with Index set to the -// lowest/highest index possible in the whole immediate/leafs expanse. -// TBD: If leaf secondary dead end occurs, could shortcut and treat it as a -// branch primary dead end; but this would require remembering the parent -// branchs type and offset (a "one-deep stack"), and also wrestling with -// narrow pointers, at least for leaves (but not for immediates). -// -// Note some ASYMMETRIES between SearchValid and SearchEmpty: -// -// - The SearchValid code, upon descending through a narrow pointer, if Index -// is outside the expanse of the subsidiary node (effectively a secondary -// dead end), must decide whether to backtrack or findlimit. But the -// SearchEmpty code simply returns success (Index is empty). -// -// - Similarly, the SearchValid code, upon finding no previous/next index in -// the expanse of a narrow pointer (again, a secondary dead end), can simply -// start to backtrack at the parent JP. But the SearchEmpty code would have -// to first determine whether or not the parent JPs narrow expanse contains -// a previous/next empty index outside the subexpanse. Rather than keeping a -// parent state stack and backtracking this way, upon a secondary dead end, -// the SearchEmpty code simply restarts at the top of the tree, whether or -// not a narrow pointer is involved. Again, see the equivalent comments in -// JudyPrevNext.c for comparison. -// -// This function is written iteratively for speed, rather than recursively. -// -// TBD: Wed like to enhance this function to make successive searches faster. -// This would require saving some previous state, including the previous Index -// returned, and in which leaf it was found. If the next call is for the same -// Index and the array has not been modified, start at the same leaf. This -// should be much easier to implement since this is iterative rather than -// recursive code. - -#ifdef JUDY1 -#ifdef JUDYPREV -FUNCTION int Judy1PrevEmpty -#else -FUNCTION int Judy1NextEmpty -#endif -#else -#ifdef JUDYPREV -FUNCTION int JudyLPrevEmpty -#else -FUNCTION int JudyLNextEmpty -#endif -#endif - ( - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError // optional, for returning error info. - ) -{ - Word_t Index; // fast copy, in a register. - Pjp_t Pjp; // current JP. - Pjbl_t Pjbl; // Pjp->jp_Addr masked and cast to types: - Pjbb_t Pjbb; - Pjbu_t Pjbu; - Pjlb_t Pjlb; - PWord_t Pword; // alternate name for use by GET* macros. - - Word_t digit; // next digit to decode from Index. - Word_t digits; // current state in SM = digits left to decode. - Word_t pop0; // in a leaf. - Word_t pop0mask; // precalculated to avoid variable shifts. - long offset; // within a branch or leaf (can be large). - int subexp; // subexpanse in a bitmap branch. - BITMAPB_t bitposmaskB; // bit in bitmap for bitmap branch. - BITMAPL_t bitposmaskL; // bit in bitmap for bitmap leaf. - Word_t possfullJP1; // JP types for possibly full subexpanses: - Word_t possfullJP2; - Word_t possfullJP3; - - -// ---------------------------------------------------------------------------- -// M A C R O S -// -// These are intended to make the code a bit more readable and less redundant. - - -// CHECK FOR NULL JP: -// -// TBD: In principle this can be reduced (here and in other *.c files) to just -// the latter clause since no Type should ever be below cJU_JPNULL1, but in -// fact some root pointer types can be lower, so for safety do both checks. - -#define JPNULL(Type) (((Type) >= cJU_JPNULL1) && ((Type) <= cJU_JPNULLMAX)) - - -// CHECK FOR A FULL JP: -// -// Given a JP, indicate if it is fully populated. Use digits, pop0mask, and -// possfullJP1..3 in the context. -// -// This is a difficult problem because it requires checking the Pop0 bits for -// all-ones, but the number of bytes depends on the JP type, which is not -// directly related to the parent branchs type or level -- the JPs child -// could be under a narrow pointer (hence not full). The simple answer -// requires switching on or otherwise calculating the JP type, which could be -// slow. Instead, in SMPREPB* precalculate pop0mask and also record in -// possfullJP1..3 the child JP (branch) types that could possibly be full (one -// level down), and use them here. For level-2 branches (with digits == 2), -// the test for a full child depends on Judy1/JudyL. -// -// Note: This cannot be applied to the JP in a JPM because it doesnt have -// enough pop0 digits. -// -// TBD: JPFULL_BRANCH diligently checks for BranchL or BranchB, where neither -// of those can ever be full as it turns out. Could just check for a BranchU -// at the right level. Also, pop0mask might be overkill, its not used much, -// so perhaps just call cJU_POP0MASK(digits - 1) here? -// -// First, JPFULL_BRANCH checks for a full expanse for a JP whose child can be a -// branch, that is, a JP in a branch at level 3 or higher: - -#define JPFULL_BRANCH(Pjp) \ - ((((JU_JPDCDPOP0(Pjp) ^ cJU_ALLONES) & pop0mask) == 0) \ - && ((JU_JPTYPE(Pjp) == possfullJP1) \ - || (JU_JPTYPE(Pjp) == possfullJP2) \ - || (JU_JPTYPE(Pjp) == possfullJP3))) - -#ifdef JUDY1 -#define JPFULL(Pjp) \ - ((digits == 2) ? \ - (JU_JPTYPE(Pjp) == cJ1_JPFULLPOPU1) : JPFULL_BRANCH(Pjp)) -#else -#define JPFULL(Pjp) \ - ((digits == 2) ? \ - (JU_JPTYPE(Pjp) == cJU_JPLEAF_B1) \ - && (((JU_JPDCDPOP0(Pjp) & cJU_POP0MASK(1)) == cJU_POP0MASK(1))) : \ - JPFULL_BRANCH(Pjp)) -#endif - - -// RETURN SUCCESS: -// -// This hides the need to set *PIndex back to the local value of Index -- use a -// local value for faster operation. Note that the callers *PIndex is ALWAYS -// modified upon success, at least decremented/incremented. - -#define RET_SUCCESS { *PIndex = Index; return(1); } - - -// RETURN A CORRUPTION: - -#define RET_CORRUPT { JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); return(JERRI); } - - -// SEARCH A BITMAP BRANCH: -// -// This is a weak analog of j__udySearchLeaf*() for bitmap branches. Return -// the actual or next-left position, base 0, of Digit in a BITMAPB_t bitmap -// (subexpanse of a full bitmap), also given a Bitposmask for Digit. The -// position is the offset within the set bits. -// -// Unlike j__udySearchLeaf*(), the offset is not returned bit-complemented if -// Digits bit is unset, because the caller can check the bitmap themselves to -// determine that. Also, if Digits bit is unset, the returned offset is to -// the next-left JP or index (including -1), not to the "ideal" position for -// the index = next-right JP or index. -// -// Shortcut and skip calling j__udyCountBitsB() if the bitmap is full, in which -// case (Digit % cJU_BITSPERSUBEXPB) itself is the base-0 offset. - -#define SEARCHBITMAPB(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPB) ? (Digit % cJU_BITSPERSUBEXPB) : \ - j__udyCountBitsB((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#ifdef JUDYPREV -// Equivalent to search for the highest offset in Bitmap, that is, one less -// than the number of bits set: - -#define SEARCHBITMAPMAXB(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPB) ? cJU_BITSPERSUBEXPB - 1 : \ - j__udyCountBitsB(Bitmap) - 1) -#endif - - -// CHECK DECODE BYTES: -// -// Check Decode bytes in a JP against the equivalent portion of Index. If they -// dont match, Index is outside the subexpanse of a narrow pointer, hence is -// empty. - -#define CHECKDCD(cDigits) \ - if (JU_DCDNOTMATCHINDEX(Index, Pjp, cDigits)) RET_SUCCESS - - -// REVISE REMAINDER OF INDEX: -// -// Put one digit in place in Index and clear/set the lower digits, if any, so -// the resulting Index is at the start/end of an expanse, or just clear/set the -// least digits. -// -// Actually, to make simple use of JU_LEASTBYTESMASK, first clear/set all least -// digits of Index including the digit to be overridden, then set the value of -// that one digit. If Digits == 1 the first operation is redundant, but either -// very fast or even removed by the optimizer. - -#define CLEARLEASTDIGITS(Digits) Index &= ~JU_LEASTBYTESMASK(Digits) -#define SETLEASTDIGITS( Digits) Index |= JU_LEASTBYTESMASK(Digits) - -#define CLEARLEASTDIGITS_D(Digit,Digits) \ - { \ - CLEARLEASTDIGITS(Digits); \ - JU_SETDIGIT(Index, Digit, Digits); \ - } - -#define SETLEASTDIGITS_D(Digit,Digits) \ - { \ - SETLEASTDIGITS(Digits); \ - JU_SETDIGIT(Index, Digit, Digits); \ - } - - -// SET REMAINDER OF INDEX AND THEN RETURN OR CONTINUE: - -#define SET_AND_RETURN(OpLeastDigits,Digit,Digits) \ - { \ - OpLeastDigits(Digit, Digits); \ - RET_SUCCESS; \ - } - -#define SET_AND_CONTINUE(OpLeastDigits,Digit,Digits) \ - { \ - OpLeastDigits(Digit, Digits); \ - goto SMGetContinue; \ - } - - -// PREPARE TO HANDLE A LEAFW OR JP BRANCH IN THE STATE MACHINE: -// -// Extract a state-dependent digit from Index in a "constant" way, then jump to -// common code for multiple cases. -// -// TBD: Should this macro do more, such as preparing variable-shift masks for -// use in CLEARLEASTDIGITS and SETLEASTDIGITS? - -#define SMPREPB(cDigits,Next,PossFullJP1,PossFullJP2,PossFullJP3) \ - digits = (cDigits); \ - digit = JU_DIGITATSTATE(Index, cDigits); \ - pop0mask = cJU_POP0MASK((cDigits) - 1); /* for branchs JPs */ \ - possfullJP1 = (PossFullJP1); \ - possfullJP2 = (PossFullJP2); \ - possfullJP3 = (PossFullJP3); \ - goto Next - -// Variations for specific-level branches and for shorthands: -// -// Note: SMPREPB2 need not initialize possfullJP* because JPFULL does not use -// them for digits == 2, but gcc -Wall isnt quite smart enough to see this, so -// waste a bit of time and space to get rid of the warning: - -#define SMPREPB2(Next) \ - digits = 2; \ - digit = JU_DIGITATSTATE(Index, 2); \ - pop0mask = cJU_POP0MASK(1); /* for branchs JPs */ \ - possfullJP1 = possfullJP2 = possfullJP3 = 0; \ - goto Next - -#define SMPREPB3(Next) SMPREPB(3, Next, cJU_JPBRANCH_L2, \ - cJU_JPBRANCH_B2, \ - cJU_JPBRANCH_U2) -#ifndef JU_64BIT -#define SMPREPBL(Next) SMPREPB(cJU_ROOTSTATE, Next, cJU_JPBRANCH_L3, \ - cJU_JPBRANCH_B3, \ - cJU_JPBRANCH_U3) -#else -#define SMPREPB4(Next) SMPREPB(4, Next, cJU_JPBRANCH_L3, \ - cJU_JPBRANCH_B3, \ - cJU_JPBRANCH_U3) -#define SMPREPB5(Next) SMPREPB(5, Next, cJU_JPBRANCH_L4, \ - cJU_JPBRANCH_B4, \ - cJU_JPBRANCH_U4) -#define SMPREPB6(Next) SMPREPB(6, Next, cJU_JPBRANCH_L5, \ - cJU_JPBRANCH_B5, \ - cJU_JPBRANCH_U5) -#define SMPREPB7(Next) SMPREPB(7, Next, cJU_JPBRANCH_L6, \ - cJU_JPBRANCH_B6, \ - cJU_JPBRANCH_U6) -#define SMPREPBL(Next) SMPREPB(cJU_ROOTSTATE, Next, cJU_JPBRANCH_L7, \ - cJU_JPBRANCH_B7, \ - cJU_JPBRANCH_U7) -#endif - - -// RESTART AFTER SECONDARY DEAD END: -// -// Set Index to the first/last index in the branch or leaf subexpanse and start -// over at the top of the tree. - -#ifdef JUDYPREV -#define SMRESTART(Digits) { CLEARLEASTDIGITS(Digits); goto SMGetRestart; } -#else -#define SMRESTART(Digits) { SETLEASTDIGITS( Digits); goto SMGetRestart; } -#endif - - -// CHECK EDGE OF LEAFS EXPANSE: -// -// Given the LSBs of the lowest/highest valid index in a leaf (or equivalently -// in an immediate JP), the level (index size) of the leaf, and the full index -// to return (as Index in the context) already set to the full index matching -// the lowest/highest one, determine if there is an empty index in the leafs -// expanse below/above the lowest/highest index, which is true if the -// lowest/highest index is not at the "edge" of the leafs expanse based on its -// LSBs. If so, return Index decremented/incremented; otherwise restart at the -// top of the tree. -// -// Note: In many cases Index is already at the right spot and calling -// SMRESTART instead of just going directly to SMGetRestart is a bit of -// overkill. -// -// Note: Variable shift occurs if Digits is not a constant. - -#ifdef JUDYPREV -#define LEAF_EDGE(MinIndex,Digits) \ - { \ - if (MinIndex) { --Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#else -#define LEAF_EDGE(MaxIndex,Digits) \ - { \ - if ((MaxIndex) != JU_LEASTBYTES(cJU_ALLONES, Digits)) \ - { ++Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#endif - -// Same as above except Index is not already set to match the lowest/highest -// index, so do that before decrementing/incrementing it: - -#ifdef JUDYPREV -#define LEAF_EDGE_SET(MinIndex,Digits) \ - { \ - if (MinIndex) \ - { JU_SETDIGITS(Index, MinIndex, Digits); --Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#else -#define LEAF_EDGE_SET(MaxIndex,Digits) \ - { \ - if ((MaxIndex) != JU_LEASTBYTES(cJU_ALLONES, Digits)) \ - { JU_SETDIGITS(Index, MaxIndex, Digits); ++Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#endif - - -// FIND A HOLE (EMPTY INDEX) IN AN IMMEDIATE OR LEAF: -// -// Given an index location in a leaf (or equivalently an immediate JP) known to -// contain a usable hole (an empty index less/greater than Index), and the LSBs -// of a minimum/maximum index to locate, find the previous/next empty index and -// return it. -// -// Note: "Even" index sizes (1,2,4[,8] bytes) have corresponding native C -// types; "odd" index sizes dont, but they are not represented here because -// they are handled completely differently; see elsewhere. - -#ifdef JUDYPREV - -#define LEAF_HOLE_EVEN(cDigits,Pjll,IndexLSB) \ - { \ - while (*(Pjll) > (IndexLSB)) --(Pjll); /* too high */ \ - if (*(Pjll) < (IndexLSB)) RET_SUCCESS /* Index is empty */ \ - while (*(--(Pjll)) == --(IndexLSB)) /* null, find a hole */;\ - JU_SETDIGITS(Index, IndexLSB, cDigits); \ - RET_SUCCESS; \ - } -#else -#define LEAF_HOLE_EVEN(cDigits,Pjll,IndexLSB) \ - { \ - while (*(Pjll) < (IndexLSB)) ++(Pjll); /* too low */ \ - if (*(Pjll) > (IndexLSB)) RET_SUCCESS /* Index is empty */ \ - while (*(++(Pjll)) == ++(IndexLSB)) /* null, find a hole */;\ - JU_SETDIGITS(Index, IndexLSB, cDigits); \ - RET_SUCCESS; \ - } -#endif - - -// SEARCH FOR AN EMPTY INDEX IN AN IMMEDIATE OR LEAF: -// -// Given a pointer to the first index in a leaf (or equivalently an immediate -// JP), the population of the leaf, and a first empty Index to find (inclusive, -// as Index in the context), where Index is known to fall within the expanse of -// the leaf to search, efficiently find the previous/next empty index in the -// leaf, if any. For simplicity the following overview is stated in terms of -// Judy*NextEmpty() only, but the same concepts apply symmetrically for -// Judy*PrevEmpty(). Also, in each case the comparisons are for the LSBs of -// Index and leaf indexes, according to the leafs level. -// -// 1. If Index is GREATER than the last (highest) index in the leaf -// (maxindex), return success, Index is empty. (Remember, Index is known -// to be in the leafs expanse.) -// -// 2. If Index is EQUAL to maxindex: If maxindex is not at the edge of the -// leafs expanse, increment Index and return success, there is an empty -// Index one higher than any in the leaf; otherwise restart with Index -// reset to the upper edge of the leafs expanse. Note: This might cause -// an extra cache line fill, but this is OK for repeatedly-called search -// code, and it saves CPU time. -// -// 3. If Index is LESS than maxindex, check for "dense to end of leaf": -// Subtract Index from maxindex, and back up that many slots in the leaf. -// If the resulting offset is not before the start of the leaf then compare -// the index at this offset (baseindex) with Index: -// -// 3a. If GREATER, the leaf must be corrupt, since indexes are sorted and -// there are no duplicates. -// -// 3b. If EQUAL, the leaf is "dense" from Index to maxindex, meaning there is -// no reason to search it. "Slide right" to the high end of the leaf -// (modify Index to maxindex) and continue with step 2 above. -// -// 3c. If LESS, continue with step 4. -// -// 4. If the offset based on maxindex minus Index falls BEFORE the start of -// the leaf, or if, per 3c above, baseindex is LESS than Index, the leaf is -// guaranteed "not dense to the end" and a usable empty Index must exist. -// This supports a more efficient search loop. Start at the FIRST index in -// the leaf, or one BEYOND baseindex, respectively, and search the leaf as -// follows, comparing each current index (currindex) with Index: -// -// 4a. If LESS, keep going to next index. Note: This is certain to terminate -// because maxindex is known to be greater than Index, hence the loop can -// be small and fast. -// -// 4b. If EQUAL, loop and increment Index until finding currindex greater than -// Index, and return success with the modified Index. -// -// 4c. If GREATER, return success, Index (unmodified) is empty. -// -// Note: These are macros rather than functions for speed. - -#ifdef JUDYPREV - -#define JSLE_EVEN(Addr,Pop0,cDigits,LeafType) \ - { \ - LeafType * PjllLSB = (LeafType *) (Addr); \ - LeafType IndexLSB = Index; /* auto-masking */ \ - \ - /* Index before or at start of leaf: */ \ - \ - if (*PjllLSB >= IndexLSB) /* no need to search */ \ - { \ - if (*PjllLSB > IndexLSB) RET_SUCCESS; /* Index empty */ \ - LEAF_EDGE(*PjllLSB, cDigits); \ - } \ - \ - /* Index in or after leaf: */ \ - \ - offset = IndexLSB - *PjllLSB; /* tentative offset */ \ - if (offset <= (Pop0)) /* can check density */ \ - { \ - PjllLSB += offset; /* move to slot */ \ - \ - if (*PjllLSB <= IndexLSB) /* dense or corrupt */ \ - { \ - if (*PjllLSB == IndexLSB) /* dense, check edge */ \ - LEAF_EDGE_SET(PjllLSB[-offset], cDigits); \ - RET_CORRUPT; \ - } \ - --PjllLSB; /* not dense, start at previous */ \ - } \ - else PjllLSB = ((LeafType *) (Addr)) + (Pop0); /* start at max */ \ - \ - LEAF_HOLE_EVEN(cDigits, PjllLSB, IndexLSB); \ - } - -// JSLE_ODD is completely different from JSLE_EVEN because its important to -// minimize copying odd indexes to compare them (see 4.14). Furthermore, a -// very complex version (4.17, but abandoned before fully debugged) that -// avoided calling j__udySearchLeaf*() ran twice as fast as 4.14, but still -// half as fast as SearchValid. Doug suggested that to minimize complexity and -// share common code we should use j__udySearchLeaf*() for the initial search -// to establish if Index is empty, which should be common. If Index is valid -// in a leaf or immediate indexes, odds are good that an empty Index is nearby, -// so for simplicity just use a *COPY* function to linearly search the -// remainder. -// -// TBD: Pathological case? Average performance should be good, but worst-case -// might suffer. When Search says the initial Index is valid, so a linear -// copy-and-compare is begun, if the caller builds fairly large leaves with -// dense clusters AND frequently does a SearchEmpty at one end of such a -// cluster, performance wont be very good. Might a dense-check help? This -// means checking offset against the index at offset, and then against the -// first/last index in the leaf. We doubt the pathological case will appear -// much in real applications because they will probably alternate SearchValid -// and SearchEmpty calls. - -#define JSLE_ODD(cDigits,Pjll,Pop0,Search,Copy) \ - { \ - Word_t IndexLSB; /* least bytes only */ \ - Word_t IndexFound; /* in leaf */ \ - \ - if ((offset = Search(Pjll, (Pop0) + 1, Index)) < 0) \ - RET_SUCCESS; /* Index is empty */ \ - \ - IndexLSB = JU_LEASTBYTES(Index, cDigits); \ - offset *= (cDigits); \ - \ - while ((offset -= (cDigits)) >= 0) \ - { /* skip until empty or start */ \ - Copy(IndexFound, ((uint8_t *) (Pjll)) + offset); \ - if (IndexFound != (--IndexLSB)) /* found an empty */ \ - { JU_SETDIGITS(Index, IndexLSB, cDigits); RET_SUCCESS; }\ - } \ - LEAF_EDGE_SET(IndexLSB, cDigits); \ - } - -#else // JUDYNEXT - -#define JSLE_EVEN(Addr,Pop0,cDigits,LeafType) \ - { \ - LeafType * PjllLSB = ((LeafType *) (Addr)) + (Pop0); \ - LeafType IndexLSB = Index; /* auto-masking */ \ - \ - /* Index at or after end of leaf: */ \ - \ - if (*PjllLSB <= IndexLSB) /* no need to search */ \ - { \ - if (*PjllLSB < IndexLSB) RET_SUCCESS; /* Index empty */\ - LEAF_EDGE(*PjllLSB, cDigits); \ - } \ - \ - /* Index before or in leaf: */ \ - \ - offset = *PjllLSB - IndexLSB; /* tentative offset */ \ - if (offset <= (Pop0)) /* can check density */ \ - { \ - PjllLSB -= offset; /* move to slot */ \ - \ - if (*PjllLSB >= IndexLSB) /* dense or corrupt */ \ - { \ - if (*PjllLSB == IndexLSB) /* dense, check edge */ \ - LEAF_EDGE_SET(PjllLSB[offset], cDigits); \ - RET_CORRUPT; \ - } \ - ++PjllLSB; /* not dense, start at next */ \ - } \ - else PjllLSB = (LeafType *) (Addr); /* start at minimum */ \ - \ - LEAF_HOLE_EVEN(cDigits, PjllLSB, IndexLSB); \ - } - -#define JSLE_ODD(cDigits,Pjll,Pop0,Search,Copy) \ - { \ - Word_t IndexLSB; /* least bytes only */ \ - Word_t IndexFound; /* in leaf */ \ - int offsetmax; /* in bytes */ \ - \ - if ((offset = Search(Pjll, (Pop0) + 1, Index)) < 0) \ - RET_SUCCESS; /* Index is empty */ \ - \ - IndexLSB = JU_LEASTBYTES(Index, cDigits); \ - offset *= (cDigits); \ - offsetmax = (Pop0) * (cDigits); /* single multiply */ \ - \ - while ((offset += (cDigits)) <= offsetmax) \ - { /* skip until empty or end */ \ - Copy(IndexFound, ((uint8_t *) (Pjll)) + offset); \ - if (IndexFound != (++IndexLSB)) /* found an empty */ \ - { JU_SETDIGITS(Index, IndexLSB, cDigits); RET_SUCCESS; } \ - } \ - LEAF_EDGE_SET(IndexLSB, cDigits); \ - } - -#endif // JUDYNEXT - -// Note: Immediate indexes never fill a single index group, so for odd index -// sizes, save time by calling JSLE_ODD_IMM instead of JSLE_ODD. - -#define j__udySearchLeafEmpty1(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 1, uint8_t) - -#define j__udySearchLeafEmpty2(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 2, uint16_t) - -#define j__udySearchLeafEmpty3(Addr,Pop0) \ - JSLE_ODD(3, Addr, Pop0, j__udySearchLeaf3, JU_COPY3_PINDEX_TO_LONG) - -#ifndef JU_64BIT - -#define j__udySearchLeafEmptyL(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 4, Word_t) - -#else - -#define j__udySearchLeafEmpty4(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 4, uint32_t) - -#define j__udySearchLeafEmpty5(Addr,Pop0) \ - JSLE_ODD(5, Addr, Pop0, j__udySearchLeaf5, JU_COPY5_PINDEX_TO_LONG) - -#define j__udySearchLeafEmpty6(Addr,Pop0) \ - JSLE_ODD(6, Addr, Pop0, j__udySearchLeaf6, JU_COPY6_PINDEX_TO_LONG) - -#define j__udySearchLeafEmpty7(Addr,Pop0) \ - JSLE_ODD(7, Addr, Pop0, j__udySearchLeaf7, JU_COPY7_PINDEX_TO_LONG) - -#define j__udySearchLeafEmptyL(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 8, Word_t) - -#endif // JU_64BIT - - -// ---------------------------------------------------------------------------- -// START OF CODE: -// -// CHECK FOR SHORTCUTS: -// -// Error out if PIndex is null. - - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return(JERRI); - } - - Index = *PIndex; // fast local copy. - -// Set and pre-decrement/increment Index, watching for underflow/overflow: -// -// An out-of-bounds Index means failure: No previous/next empty index. - -SMGetRestart: // return here with revised Index. - -#ifdef JUDYPREV - if (Index-- == 0) return(0); -#else - if (++Index == 0) return(0); -#endif - -// An empty array with an in-bounds (not underflowed/overflowed) Index means -// success: -// -// Note: This check is redundant after restarting at SMGetRestart, but should -// take insignificant time. - - if (PArray == (Pvoid_t) NULL) RET_SUCCESS; - -// ---------------------------------------------------------------------------- -// ROOT-LEVEL LEAF that starts with a Pop0 word; just look within the leaf: -// -// If Index is not in the leaf, return success; otherwise return the first -// empty Index, if any, below/above where it would belong. - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - pop0 = Pjlw[0]; - -#ifdef JUDY1 - if (pop0 == 0) // special case. - { -#ifdef JUDYPREV - if ((Index != Pjlw[1]) || (Index-- != 0)) RET_SUCCESS; -#else - if ((Index != Pjlw[1]) || (++Index != 0)) RET_SUCCESS; -#endif - return(0); // no previous/next empty index. - } -#endif // JUDY1 - - j__udySearchLeafEmptyL(Pjlw + 1, pop0); - -// No return -- thanks ALAN - - } - else - -// ---------------------------------------------------------------------------- -// HANDLE JRP Branch: -// -// For JRP branches, traverse the JPM; handle LEAFW -// directly; but look for the most common cases first. - - { - Pjpm_t Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); - -// goto SMGetContinue; - } - - -// ============================================================================ -// STATE MACHINE -- GET INDEX: -// -// Search for Index (already decremented/incremented so as to be an inclusive -// search). If not found (empty index), return success. Otherwise do a -// previous/next search, and if successful modify Index to the empty index -// found. See function header comments. -// -// ENTRY: Pjp points to next JP to interpret, whose Decode bytes have not yet -// been checked. -// -// Note: Check Decode bytes at the start of each loop, not after looking up a -// new JP, so its easy to do constant shifts/masks. -// -// EXIT: Return, or branch to SMGetRestart with modified Index, or branch to -// SMGetContinue with a modified Pjp, as described elsewhere. -// -// WARNING: For run-time efficiency the following cases replicate code with -// varying constants, rather than using common code with variable values! - -SMGetContinue: // return here for next branch/leaf. - -#ifdef TRACEJPSE - JudyPrintJP(Pjp, "sf", __LINE__); -#endif - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_L2: CHECKDCD(2); SMPREPB2(SMBranchL); - case cJU_JPBRANCH_L3: CHECKDCD(3); SMPREPB3(SMBranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: CHECKDCD(4); SMPREPB4(SMBranchL); - case cJU_JPBRANCH_L5: CHECKDCD(5); SMPREPB5(SMBranchL); - case cJU_JPBRANCH_L6: CHECKDCD(6); SMPREPB6(SMBranchL); - case cJU_JPBRANCH_L7: CHECKDCD(7); SMPREPB7(SMBranchL); -#endif - case cJU_JPBRANCH_L: SMPREPBL(SMBranchL); - -// Common code (state-independent) for all cases of linear branches: - -SMBranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -// First, check if Indexs expanse (digit) is below/above the first/last -// populated expanse in the BranchL, in which case Index is empty; otherwise -// find the offset of the lowest/highest populated expanse at or above/below -// digit, if any: -// -// Note: The for-loop is guaranteed to exit eventually because the first/last -// expanse is known to be a terminator. -// -// Note: Cannot use j__udySearchLeaf*Empty1() here because it only applies to -// leaves and does not know about partial versus full JPs, unlike the use of -// j__udySearchLeaf1() for BranchLs in SearchValid code. Also, since linear -// leaf expanse lists are small, dont waste time calling j__udySearchLeaf1(), -// just scan the expanse list. - -#ifdef JUDYPREV - if ((Pjbl->jbl_Expanse[0]) > digit) RET_SUCCESS; - - for (offset = (Pjbl->jbl_NumJPs) - 1; /* null */; --offset) -#else - if ((Pjbl->jbl_Expanse[(Pjbl->jbl_NumJPs) - 1]) < digit) - RET_SUCCESS; - - for (offset = 0; /* null */; ++offset) -#endif - { - -// Too low/high, keep going; or too high/low, meaning the loop passed a hole -// and the initial Index is empty: - -#ifdef JUDYPREV - if ((Pjbl->jbl_Expanse[offset]) > digit) continue; - if ((Pjbl->jbl_Expanse[offset]) < digit) RET_SUCCESS; -#else - if ((Pjbl->jbl_Expanse[offset]) < digit) continue; - if ((Pjbl->jbl_Expanse[offset]) > digit) RET_SUCCESS; -#endif - -// Found expanse matching digit; if its not full, traverse through it: - - if (! JPFULL((Pjbl->jbl_jp) + offset)) - { - Pjp = (Pjbl->jbl_jp) + offset; - goto SMGetContinue; - } - -// Common code: While searching for a lower/higher hole or a non-full JP, upon -// finding a lower/higher hole, adjust Index using the revised digit and -// return; or upon finding a consecutive lower/higher expanse, if the expanses -// JP is non-full, modify Index and traverse through the JP: - -#define BRANCHL_CHECK(OpIncDec,OpLeastDigits,Digit,Digits) \ - { \ - if ((Pjbl->jbl_Expanse[offset]) != OpIncDec digit) \ - SET_AND_RETURN(OpLeastDigits, Digit, Digits); \ - \ - if (! JPFULL((Pjbl->jbl_jp) + offset)) \ - { \ - Pjp = (Pjbl->jbl_jp) + offset; \ - SET_AND_CONTINUE(OpLeastDigits, Digit, Digits); \ - } \ - } - -// BranchL primary dead end: Expanse matching Index/digit is full (rare except -// for dense/sequential indexes): -// -// Search for a lower/higher hole, a non-full JP, or the end of the expanse -// list, while decrementing/incrementing digit. - -#ifdef JUDYPREV - while (--offset >= 0) - BRANCHL_CHECK(--, SETLEASTDIGITS_D, digit, digits) -#else - while (++offset < Pjbl->jbl_NumJPs) - BRANCHL_CHECK(++, CLEARLEASTDIGITS_D, digit, digits) -#endif - -// Passed end of BranchL expanse list after finding a matching but full -// expanse: -// -// Digit now matches the lowest/highest expanse, which is a full expanse; if -// digit is at the end of BranchLs expanse (no hole before/after), break out -// of the loop; otherwise modify Index to the next lower/higher digit and -// return success: - -#ifdef JUDYPREV - if (digit == 0) break; - --digit; SET_AND_RETURN(SETLEASTDIGITS_D, digit, digits); -#else - if (digit == JU_LEASTBYTES(cJU_ALLONES, 1)) break; - ++digit; SET_AND_RETURN(CLEARLEASTDIGITS_D, digit, digits); -#endif - } // for-loop - -// BranchL secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_B2: CHECKDCD(2); SMPREPB2(SMBranchB); - case cJU_JPBRANCH_B3: CHECKDCD(3); SMPREPB3(SMBranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: CHECKDCD(4); SMPREPB4(SMBranchB); - case cJU_JPBRANCH_B5: CHECKDCD(5); SMPREPB5(SMBranchB); - case cJU_JPBRANCH_B6: CHECKDCD(6); SMPREPB6(SMBranchB); - case cJU_JPBRANCH_B7: CHECKDCD(7); SMPREPB7(SMBranchB); -#endif - case cJU_JPBRANCH_B: SMPREPBL(SMBranchB); - -// Common code (state-independent) for all cases of bitmap branches: - -SMBranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - -// Locate the digits JP in the subexpanse list, if present: - - subexp = digit / cJU_BITSPERSUBEXPB; - assert(subexp < cJU_NUMSUBEXPB); // falls in expected range. - bitposmaskB = JU_BITPOSMASKB(digit); - -// Absent JP = no JP matches current digit in Index: - -// if (! JU_BITMAPTESTB(Pjbb, digit)) // slower. - if (! (JU_JBB_BITMAP(Pjbb, subexp) & bitposmaskB)) // faster. - RET_SUCCESS; - -// Non-full JP matches current digit in Index: -// -// Iterate to the subsidiary non-full JP. - - offset = SEARCHBITMAPB(JU_JBB_BITMAP(Pjbb, subexp), digit, - bitposmaskB); - // not negative since at least one bit is set: - assert(offset >= 0); - assert(offset < (int) cJU_BITSPERSUBEXPB); - -// Watch for null JP subarray pointer with non-null bitmap (a corruption): - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) - == (Pjp_t) NULL) RET_CORRUPT; - - Pjp += offset; - if (! JPFULL(Pjp)) goto SMGetContinue; - -// BranchB primary dead end: -// -// Upon hitting a full JP in a BranchB for the next digit in Index, search -// sideways for a previous/next absent JP (unset bit) or non-full JP (set bit -// with non-full JP); first in the current bitmap subexpanse, then in -// lower/higher subexpanses. Upon entry, Pjp points to a known-unusable JP, -// ready to decrement/increment. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. -// -// TBD: For speed, shift bitposmaskB instead of using JU_BITMAPTESTB or -// JU_BITPOSMASKB, but this shift has knowledge of bit order that really should -// be encapsulated in a header file. - -#define BRANCHB_CHECKBIT(OpLeastDigits) \ - if (! (JU_JBB_BITMAP(Pjbb, subexp) & bitposmaskB)) /* absent JP */ \ - SET_AND_RETURN(OpLeastDigits, digit, digits) - -#define BRANCHB_CHECKJPFULL(OpLeastDigits) \ - if (! JPFULL(Pjp)) \ - SET_AND_CONTINUE(OpLeastDigits, digit, digits) - -#define BRANCHB_STARTSUBEXP(OpLeastDigits) \ - if (! JU_JBB_BITMAP(Pjbb, subexp)) /* empty subexpanse, shortcut */ \ - SET_AND_RETURN(OpLeastDigits, digit, digits) \ - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) RET_CORRUPT - -#ifdef JUDYPREV - - --digit; // skip initial digit. - bitposmaskB >>= 1; // see TBD above. - -BranchBNextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskB) // more bits to check in subexp. - { - BRANCHB_CHECKBIT(SETLEASTDIGITS_D); - --Pjp; // previous in subarray. - BRANCHB_CHECKJPFULL(SETLEASTDIGITS_D); - assert(digit >= 0); - --digit; - bitposmaskB >>= 1; - } - - if (subexp-- > 0) // more subexpanses. - { - BRANCHB_STARTSUBEXP(SETLEASTDIGITS_D); - Pjp += SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)) + 1; - bitposmaskB = (1U << (cJU_BITSPERSUBEXPB - 1)); - goto BranchBNextSubexp; - } - -#else // JUDYNEXT - - ++digit; // skip initial digit. - bitposmaskB <<= 1; // note: BITMAPB_t. - -BranchBNextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskB) // more bits to check in subexp. - { - BRANCHB_CHECKBIT(CLEARLEASTDIGITS_D); - ++Pjp; // previous in subarray. - BRANCHB_CHECKJPFULL(CLEARLEASTDIGITS_D); - assert(digit < cJU_SUBEXPPERSTATE); - ++digit; - bitposmaskB <<= 1; // note: BITMAPB_t. - } - - if (++subexp < cJU_NUMSUBEXPB) // more subexpanses. - { - BRANCHB_STARTSUBEXP(CLEARLEASTDIGITS_D); - --Pjp; // pre-decrement. - bitposmaskB = 1; - goto BranchBNextSubexp; - } - -#endif // JUDYNEXT - -// BranchB secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_U2: CHECKDCD(2); SMPREPB2(SMBranchU); - case cJU_JPBRANCH_U3: CHECKDCD(3); SMPREPB3(SMBranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: CHECKDCD(4); SMPREPB4(SMBranchU); - case cJU_JPBRANCH_U5: CHECKDCD(5); SMPREPB5(SMBranchU); - case cJU_JPBRANCH_U6: CHECKDCD(6); SMPREPB6(SMBranchU); - case cJU_JPBRANCH_U7: CHECKDCD(7); SMPREPB7(SMBranchU); -#endif - case cJU_JPBRANCH_U: SMPREPBL(SMBranchU); - -// Common code (state-independent) for all cases of uncompressed branches: - -SMBranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - Pjp = (Pjbu->jbu_jp) + digit; - -// Absent JP = null JP for current digit in Index: - - if (JPNULL(JU_JPTYPE(Pjp))) RET_SUCCESS; - -// Non-full JP matches current digit in Index: -// -// Iterate to the subsidiary JP. - - if (! JPFULL(Pjp)) goto SMGetContinue; - -// BranchU primary dead end: -// -// Upon hitting a full JP in a BranchU for the next digit in Index, search -// sideways for a previous/next null or non-full JP. BRANCHU_CHECKJP() is -// shorthand for common code. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. - -#define BRANCHU_CHECKJP(OpIncDec,OpLeastDigits) \ - { \ - OpIncDec Pjp; \ - \ - if (JPNULL(JU_JPTYPE(Pjp))) \ - SET_AND_RETURN(OpLeastDigits, digit, digits) \ - \ - if (! JPFULL(Pjp)) \ - SET_AND_CONTINUE(OpLeastDigits, digit, digits) \ - } - -#ifdef JUDYPREV - while (digit-- > 0) - BRANCHU_CHECKJP(--, SETLEASTDIGITS_D); -#else - while (++digit < cJU_BRANCHUNUMJPS) - BRANCHU_CHECKJP(++, CLEARLEASTDIGITS_D); -#endif - -// BranchU secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for the -// previous/next empty index starting at Index. Primary leaf dead end is -// hidden within j__udySearchLeaf*Empty*(). In case of secondary leaf dead -// end, restart at the top of the tree. -// -// Note: Pword is the name known to GET*; think of it as Pjlw. - -#define SMLEAFL(cDigits,Func) \ - Pword = (PWord_t) P_JLW(Pjp->jp_Addr); \ - pop0 = JU_JPLEAF_POP0(Pjp); \ - Func(Pword, pop0) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKDCD(1); SMLEAFL(1, j__udySearchLeafEmpty1); -#endif - case cJU_JPLEAF2: CHECKDCD(2); SMLEAFL(2, j__udySearchLeafEmpty2); - case cJU_JPLEAF3: CHECKDCD(3); SMLEAFL(3, j__udySearchLeafEmpty3); - -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKDCD(4); SMLEAFL(4, j__udySearchLeafEmpty4); - case cJU_JPLEAF5: CHECKDCD(5); SMLEAFL(5, j__udySearchLeafEmpty5); - case cJU_JPLEAF6: CHECKDCD(6); SMLEAFL(6, j__udySearchLeafEmpty6); - case cJU_JPLEAF7: CHECKDCD(7); SMLEAFL(7, j__udySearchLeafEmpty7); -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for the -// previous/next empty index starting at Index. - - case cJU_JPLEAF_B1: - - CHECKDCD(1); - - Pjlb = P_JLB(Pjp->jp_Addr); - digit = JU_DIGITATSTATE(Index, 1); - subexp = digit / cJU_BITSPERSUBEXPL; - bitposmaskL = JU_BITPOSMASKL(digit); - assert(subexp < cJU_NUMSUBEXPL); // falls in expected range. - -// Absent index = no index matches current digit in Index: - -// if (! JU_BITMAPTESTL(Pjlb, digit)) // slower. - if (! (JU_JLB_BITMAP(Pjlb, subexp) & bitposmaskL)) // faster. - RET_SUCCESS; - -// LeafB1 primary dead end: -// -// Upon hitting a valid (non-empty) index in a LeafB1 for the last digit in -// Index, search sideways for a previous/next absent index, first in the -// current bitmap subexpanse, then in lower/higher subexpanses. -// LEAFB1_CHECKBIT() is shorthand for common code to handle one bit in one -// bitmap subexpanse. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. -// -// TBD: For speed, shift bitposmaskL instead of using JU_BITMAPTESTL or -// JU_BITPOSMASKL, but this shift has knowledge of bit order that really should -// be encapsulated in a header file. - -#define LEAFB1_CHECKBIT(OpLeastDigits) \ - if (! (JU_JLB_BITMAP(Pjlb, subexp) & bitposmaskL)) \ - SET_AND_RETURN(OpLeastDigits, digit, 1) - -#define LEAFB1_STARTSUBEXP(OpLeastDigits) \ - if (! JU_JLB_BITMAP(Pjlb, subexp)) /* empty subexp */ \ - SET_AND_RETURN(OpLeastDigits, digit, 1) - -#ifdef JUDYPREV - - --digit; // skip initial digit. - bitposmaskL >>= 1; // see TBD above. - -LeafB1NextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskL) // more bits to check in subexp. - { - LEAFB1_CHECKBIT(SETLEASTDIGITS_D); - assert(digit >= 0); - --digit; - bitposmaskL >>= 1; - } - - if (subexp-- > 0) // more subexpanses. - { - LEAFB1_STARTSUBEXP(SETLEASTDIGITS_D); - bitposmaskL = (1UL << (cJU_BITSPERSUBEXPL - 1)); - goto LeafB1NextSubexp; - } - -#else // JUDYNEXT - - ++digit; // skip initial digit. - bitposmaskL <<= 1; // note: BITMAPL_t. - -LeafB1NextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskL) // more bits to check in subexp. - { - LEAFB1_CHECKBIT(CLEARLEASTDIGITS_D); - assert(digit < cJU_SUBEXPPERSTATE); - ++digit; - bitposmaskL <<= 1; // note: BITMAPL_t. - } - - if (++subexp < cJU_NUMSUBEXPL) // more subexpanses. - { - LEAFB1_STARTSUBEXP(CLEARLEASTDIGITS_D); - bitposmaskL = 1; - goto LeafB1NextSubexp; - } - -#endif // JUDYNEXT - -// LeafB1 secondary dead end, no empty index: - - SMRESTART(1); - - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// If the Decode bytes do not match, Index is empty (without modification); -// otherwise restart. - - case cJ1_JPFULLPOPU1: - - CHECKDCD(1); - SMRESTART(1); -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: -// -// Pop1 = 1 Immediate JPs: -// -// If Index is not in the immediate JP, return success; otherwise check if -// there is an empty index below/above the immediate JPs index, and if so, -// return success with modified Index, else restart. -// -// Note: Doug says its fast enough to calculate the index size (digits) in -// the following; no need to set it separately for each case. - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - if (JU_JPDCDPOP0(Pjp) != JU_TRIMTODCDSIZE(Index)) RET_SUCCESS; - digits = JU_JPTYPE(Pjp) - cJU_JPIMMED_1_01 + 1; - LEAF_EDGE(JU_LEASTBYTES(JU_JPDCDPOP0(Pjp), digits), digits); - -// Immediate JPs with Pop1 > 1: - -#define IMM_MULTI(Func,BaseJPType) \ - JUDY1CODE(Pword = (PWord_t) (Pjp->jp_1Index);) \ - JUDYLCODE(Pword = (PWord_t) (Pjp->jp_LIndex);) \ - Func(Pword, JU_JPTYPE(Pjp) - (BaseJPType) + 1) - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - IMM_MULTI(j__udySearchLeafEmpty1, cJU_JPIMMED_1_02); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - IMM_MULTI(j__udySearchLeafEmpty2, cJU_JPIMMED_2_02); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - IMM_MULTI(j__udySearchLeafEmpty3, cJU_JPIMMED_3_02); -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: - case cJ1_JPIMMED_4_03: - IMM_MULTI(j__udySearchLeafEmpty4, cJ1_JPIMMED_4_02); - - case cJ1_JPIMMED_5_02: - case cJ1_JPIMMED_5_03: - IMM_MULTI(j__udySearchLeafEmpty5, cJ1_JPIMMED_5_02); - - case cJ1_JPIMMED_6_02: - IMM_MULTI(j__udySearchLeafEmpty6, cJ1_JPIMMED_6_02); - - case cJ1_JPIMMED_7_02: - IMM_MULTI(j__udySearchLeafEmpty7, cJ1_JPIMMED_7_02); -#endif - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: RET_CORRUPT; - - } // SMGet switch. - -} // Judy1PrevEmpty() / Judy1NextEmpty() / JudyLPrevEmpty() / JudyLNextEmpty() diff --git a/libjudy/src/JudyL/JudyLPrev.c b/libjudy/src/JudyL/JudyLPrev.c deleted file mode 100644 index d15db1596c..0000000000 --- a/libjudy/src/JudyL/JudyLPrev.c +++ /dev/null @@ -1,1890 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.54 $ $Source: /judy/src/JudyCommon/JudyPrevNext.c $ -// -// Judy*Prev() and Judy*Next() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DJUDYNEXT for the Judy*Next() function; otherwise defaults to -// Judy*Prev(). - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifndef JUDYNEXT -#ifndef JUDYPREV -#define JUDYPREV 1 // neither set => use default. -#endif -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - - -// **************************************************************************** -// J U D Y 1 P R E V -// J U D Y 1 N E X T -// J U D Y L P R E V -// J U D Y L N E X T -// -// See the manual entry for the API. -// -// OVERVIEW OF Judy*Prev(): -// -// Use a reentrant switch statement (state machine, SM1 = "get") to decode the -// callers *PIndex-1, starting with the (PArray), through branches, if -// any, down to an immediate or a leaf. Look for *PIndex-1 in that leaf, and -// if found, return it. -// -// A dead end is either a branch that does not contain a JP for the appropriate -// digit in *PIndex-1, or a leaf that does not contain the undecoded digits of -// *PIndex-1. Upon reaching a dead end, backtrack through the leaf/branches -// that were just traversed, using a list (history) of parent JPs that is built -// while going forward in SM1Get. Start with the current leaf or branch. In a -// backtracked leaf, look for an Index less than *PIndex-1. In each -// backtracked branch, look "sideways" for the next JP, if any, lower than the -// one for the digit (from *PIndex-1) that was previously decoded. While -// backtracking, if a leaf has no previous Index or a branch has no lower JP, -// go to its parent branch in turn. Upon reaching the JRP, return failure, "no -// previous Index". The backtrack process is sufficiently different from -// SM1Get to merit its own separate reentrant switch statement (SM2 = -// "backtrack"). -// -// While backtracking, upon finding a lower JP in a branch, there is certain to -// be a "prev" Index under that JP (unless the Judy array is corrupt). -// Traverse forward again, this time taking the last (highest, right-most) JP -// in each branch, and the last (highest) Index upon reaching an immediate or a -// leaf. This traversal is sufficiently different from SM1Get and SM2Backtrack -// to merit its own separate reentrant switch statement (SM3 = "findlimit"). -// -// "Decode" bytes in JPs complicate this process a little. In SM1Get, when a -// JP is a narrow pointer, that is, when states are skipped (so the skipped -// digits are stored in jp_DcdPopO), compare the relevant digits to the same -// digits in *PIndex-1. If they are EQUAL, proceed in SM1Get as before. If -// jp_DcdPopOs digits are GREATER, treat the JP as a dead end and proceed in -// SM2Backtrack. If jp_DcdPopOs digits are LESS, treat the JP as if it had -// just been found during a backtrack and proceed directly in SM3Findlimit. -// -// Note that Decode bytes can be ignored in SM3Findlimit; they dont matter. -// Also note that in practice the Decode bytes are routinely compared with -// *PIndex-1 because thats simpler and no slower than first testing for -// narrowness. -// -// Decode bytes also make it unnecessary to construct the Index to return (the -// revised *PIndex) during the search. This step is deferred until finding an -// Index during backtrack or findlimit, before returning it. The first digit -// of *PIndex is derived (saved) based on which JP is used in a JRP branch. -// The remaining digits are obtained from the jp_DcdPopO field in the JP (if -// any) above the immediate or leaf containing the found (prev) Index, plus the -// remaining digit(s) in the immediate or leaf itself. In the case of a LEAFW, -// the Index to return is found directly in the leaf. -// -// Note: Theoretically, as described above, upon reaching a dead end, SM1Get -// passes control to SM2Backtrack to look sideways, even in a leaf. Actually -// its a little more efficient for the SM1Get leaf cases to shortcut this and -// take care of the sideways searches themselves. Hence the history list only -// contains branch JPs, and SM2Backtrack only handles branches. In fact, even -// the branch handling cases in SM1Get do some shortcutting (sideways -// searching) to avoid pushing history and calling SM2Backtrack unnecessarily. -// -// Upon reaching an Index to return after backtracking, *PIndex must be -// modified to the found Index. In principle this could be done by building -// the Index from a saved rootdigit (in the top branch) plus the Dcd bytes from -// the parent JP plus the appropriate Index bytes from the leaf. However, -// Immediates are difficult because their parent JPs lack one (last) digit. So -// instead just build the *PIndex to return "top down" while backtracking and -// findlimiting. -// -// This function is written iteratively for speed, rather than recursively. -// -// CAVEATS: -// -// Why use a backtrack list (history stack), since it has finite size? The -// size is small for Judy on both 32-bit and 64-bit systems, and a list (really -// just an array) is fast to maintain and use. Other alternatives include -// doing a lookahead (lookaside) in each branch while traversing forward -// (decoding), and restarting from the top upon a dead end. -// -// A lookahead means noting the last branch traversed which contained a -// non-null JP lower than the one specified by a digit in *PIndex-1, and -// returning to that point for SM3Findlimit. This seems like a good idea, and -// should be pretty cheap for linear and bitmap branches, but it could result -// in up to 31 unnecessary additional cache line fills (in extreme cases) for -// every uncompressed branch traversed. We have considered means of attaching -// to or hiding within an uncompressed branch (in null JPs) a "cache line map" -// or other structure, such as an offset to the next non-null JP, that would -// speed this up, but it seems unnecessary merely to avoid having a -// finite-length list (array). (If JudySL is ever made "native", the finite -// list length will be an issue.) -// -// Restarting at the top of the Judy array after a dead end requires a careful -// modification of *PIndex-1 to decrement the digit for the parent branch and -// set the remaining lower digits to all 1s. This must be repeated each time a -// parent branch contains another dead end, so even though it should all happen -// in cache, the CPU time can be excessive. (For JudySL or an equivalent -// "infinitely deep" Judy array, consider a hybrid of a large, finite, -// "circular" list and a restart-at-top when the list is backtracked to -// exhaustion.) -// -// Why search for *PIndex-1 instead of *PIndex during SM1Get? In rare -// instances this prevents an unnecessary decode down the wrong path followed -// by a backtrack; its pretty cheap to set up initially; and it means the -// SM1Get machine can simply return if/when it finds that Index. -// -// TBD: Wed like to enhance this function to make successive searches faster. -// This would require saving some previous state, including the previous Index -// returned, and in which leaf it was found. If the next call is for the same -// Index and the array has not been modified, start at the same leaf. This -// should be much easier to implement since this is iterative rather than -// recursive code. -// -// VARIATIONS FOR Judy*Next(): -// -// The Judy*Next() code is nearly a perfect mirror of the Judy*Prev() code. -// See the Judy*Prev() overview comments, and mentally switch the following: -// -// - "*PIndex-1" => "*PIndex+1" -// - "less than" => "greater than" -// - "lower" => "higher" -// - "lowest" => "highest" -// - "next-left" => "next-right" -// - "right-most" => "left-most" -// -// Note: SM3Findlimit could be called SM3Findmax/SM3Findmin, but a common name -// for both Prev and Next means many fewer ifdefs in this code. -// -// TBD: Currently this code traverses a JP whether its expanse is partially or -// completely full (populated). For Judy1 (only), since there is no value area -// needed, consider shortcutting to a "success" return upon encountering a full -// JP in SM1Get (or even SM3Findlimit?) A full JP looks like this: -// -// (((JU_JPDCDPOP0(Pjp) ^ cJU_ALLONES) & cJU_POP0MASK(cLevel)) == 0) - -#ifdef JUDY1 -#ifdef JUDYPREV -FUNCTION int Judy1Prev -#else -FUNCTION int Judy1Next -#endif -#else -#ifdef JUDYPREV -FUNCTION PPvoid_t JudyLPrev -#else -FUNCTION PPvoid_t JudyLNext -#endif -#endif - ( - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError // optional, for returning error info. - ) -{ - Pjp_t Pjp, Pjp2; // current JPs. - Pjbl_t Pjbl; // Pjp->jp_Addr masked and cast to types: - Pjbb_t Pjbb; - Pjbu_t Pjbu; - -// Note: The following initialization is not strictly required but it makes -// gcc -Wall happy because there is an "impossible" path from Immed handling to -// SM1LeafLImm code that looks like Pjll might be used before set: - - Pjll_t Pjll = (Pjll_t) NULL; - Word_t state; // current state in SM. - Word_t digit; // next digit to decode from Index. - -// Note: The following initialization is not strictly required but it makes -// gcc -Wall happy because there is an "impossible" path from Immed handling to -// SM1LeafLImm code (for JudyL & JudyPrev only) that looks like pop1 might be -// used before set: - -#if (defined(JUDYL) && defined(JUDYPREV)) - Word_t pop1 = 0; // in a leaf. -#else - Word_t pop1; // in a leaf. -#endif - int offset; // linear branch/leaf, from j__udySearchLeaf*(). - int subexp; // subexpanse in a bitmap branch. - Word_t bitposmask; // bit in bitmap for Index. - -// History for SM2Backtrack: -// -// For a given histnum, APjphist[histnum] is a parent JP that points to a -// branch, and Aoffhist[histnum] is the offset of the NEXT JP in the branch to -// which the parent JP points. The meaning of Aoffhist[histnum] depends on the -// type of branch to which the parent JP points: -// -// Linear: Offset of the next JP in the JP list. -// -// Bitmap: Which subexpanse, plus the offset of the next JP in the -// subexpanses JP list (to avoid bit-counting again), plus for Judy*Next(), -// hidden one byte to the left, which digit, because Judy*Next() also needs -// this. -// -// Uncompressed: Digit, which is actually the offset of the JP in the branch. -// -// Note: Only branch JPs are stored in APjphist[] because, as explained -// earlier, SM1Get shortcuts sideways searches in leaves (and even in branches -// in some cases), so SM2Backtrack only handles branches. - -#define HISTNUMMAX cJU_ROOTSTATE // maximum branches traversable. - Pjp_t APjphist[HISTNUMMAX]; // list of branch JPs traversed. - int Aoffhist[HISTNUMMAX]; // list of next JP offsets; see above. - int histnum = 0; // number of JPs now in list. - - -// ---------------------------------------------------------------------------- -// M A C R O S -// -// These are intended to make the code a bit more readable and less redundant. - - -// "PUSH" AND "POP" Pjp AND offset ON HISTORY STACKS: -// -// Note: Ensure a corrupt Judy array does not overflow *hist[]. Meanwhile, -// underflowing *hist[] simply means theres no more room to backtrack => -// "no previous/next Index". - -#define HISTPUSH(Pjp,Offset) \ - APjphist[histnum] = (Pjp); \ - Aoffhist[histnum] = (Offset); \ - \ - if (++histnum >= HISTNUMMAX) \ - { \ - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT) \ - JUDY1CODE(return(JERRI );) \ - JUDYLCODE(return(PPJERR);) \ - } - -#define HISTPOP(Pjp,Offset) \ - if ((histnum--) < 1) JU_RET_NOTFOUND; \ - (Pjp) = APjphist[histnum]; \ - (Offset) = Aoffhist[histnum] - -// How to pack/unpack Aoffhist[] values for bitmap branches: - -#ifdef JUDYPREV - -#define HISTPUSHBOFF(Subexp,Offset,Digit) \ - (((Subexp) * cJU_BITSPERSUBEXPB) | (Offset)) - -#define HISTPOPBOFF(Subexp,Offset,Digit) \ - (Subexp) = (Offset) / cJU_BITSPERSUBEXPB; \ - (Offset) %= cJU_BITSPERSUBEXPB -#else - -#define HISTPUSHBOFF(Subexp,Offset,Digit) \ - (((Digit) << cJU_BITSPERBYTE) \ - | ((Subexp) * cJU_BITSPERSUBEXPB) | (Offset)) - -#define HISTPOPBOFF(Subexp,Offset,Digit) \ - (Digit) = (Offset) >> cJU_BITSPERBYTE; \ - (Subexp) = ((Offset) & JU_LEASTBYTESMASK(1)) / cJU_BITSPERSUBEXPB; \ - (Offset) %= cJU_BITSPERSUBEXPB -#endif - - -// CHECK FOR NULL JP: - -#define JPNULL(Type) (((Type) >= cJU_JPNULL1) && ((Type) <= cJU_JPNULLMAX)) - - -// SEARCH A BITMAP: -// -// This is a weak analog of j__udySearchLeaf*() for bitmaps. Return the actual -// or next-left position, base 0, of Digit in the single uint32_t bitmap, also -// given a Bitposmask for Digit. -// -// Unlike j__udySearchLeaf*(), the offset is not returned bit-complemented if -// Digits bit is unset, because the caller can check the bitmap themselves to -// determine that. Also, if Digits bit is unset, the returned offset is to -// the next-left JP (including -1), not to the "ideal" position for the Index = -// next-right JP. -// -// Shortcut and skip calling j__udyCountBits*() if the bitmap is full, in which -// case (Digit % cJU_BITSPERSUBEXP*) itself is the base-0 offset. -// -// TBD for Judy*Next(): Should this return next-right instead of next-left? -// That is, +1 from current value? Maybe not, if Digits bit IS set, +1 would -// be wrong. - -#define SEARCHBITMAPB(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPB) ? (Digit % cJU_BITSPERSUBEXPB) : \ - j__udyCountBitsB((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#define SEARCHBITMAPL(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPL) ? (Digit % cJU_BITSPERSUBEXPL) : \ - j__udyCountBitsL((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#ifdef JUDYPREV -// Equivalent to search for the highest offset in Bitmap: - -#define SEARCHBITMAPMAXB(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPB) ? cJU_BITSPERSUBEXPB - 1 : \ - j__udyCountBitsB(Bitmap) - 1) - -#define SEARCHBITMAPMAXL(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPL) ? cJU_BITSPERSUBEXPL - 1 : \ - j__udyCountBitsL(Bitmap) - 1) -#endif - - -// CHECK DECODE BYTES: -// -// Check Decode bytes in a JP against the equivalent portion of *PIndex. If -// *PIndex is lower (for Judy*Prev()) or higher (for Judy*Next()), this JP is a -// dead end (the same as if it had been absent in a linear or bitmap branch or -// null in an uncompressed branch), enter SM2Backtrack; otherwise enter -// SM3Findlimit to find the highest/lowest Index under this JP, as if the code -// had already backtracked to this JP. - -#ifdef JUDYPREV -#define CDcmp__ < -#else -#define CDcmp__ > -#endif - -#define CHECKDCD(cState) \ - if (JU_DCDNOTMATCHINDEX(*PIndex, Pjp, cState)) \ - { \ - if ((*PIndex & cJU_DCDMASK(cState)) \ - CDcmp__(JU_JPDCDPOP0(Pjp) & cJU_DCDMASK(cState))) \ - { \ - goto SM2Backtrack; \ - } \ - goto SM3Findlimit; \ - } - - -// PREPARE TO HANDLE A LEAFW OR JRP BRANCH IN SM1: -// -// Extract a state-dependent digit from Index in a "constant" way, then jump to -// common code for multiple cases. - -#define SM1PREPB(cState,Next) \ - state = (cState); \ - digit = JU_DIGITATSTATE(*PIndex, cState); \ - goto Next - - -// PREPARE TO HANDLE A LEAFW OR JRP BRANCH IN SM3: -// -// Optionally save Dcd bytes into *PIndex, then save state and jump to common -// code for multiple cases. - -#define SM3PREPB_DCD(cState,Next) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - SM3PREPB(cState,Next) - -#define SM3PREPB(cState,Next) state = (cState); goto Next - - -// ---------------------------------------------------------------------------- -// CHECK FOR SHORTCUTS: -// -// Error out if PIndex is null. Execute JU_RET_NOTFOUND if the Judy array is -// empty or *PIndex is already the minimum/maximum Index possible. -// -// Note: As documented, in case of failure *PIndex may be modified. - - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - -#ifdef JUDYPREV - if ((PArray == (Pvoid_t) NULL) || ((*PIndex)-- == 0)) -#else - if ((PArray == (Pvoid_t) NULL) || ((*PIndex)++ == cJU_ALLONES)) -#endif - JU_RET_NOTFOUND; - - -// HANDLE JRP: -// -// Before even entering SM1Get, check the JRP type. For JRP branches, traverse -// the JPM; handle LEAFW leaves directly; but look for the most common cases -// first. - -// ROOT-STATE LEAF that starts with a Pop0 word; just look within the leaf: -// -// If *PIndex is in the leaf, return it; otherwise return the Index, if any, -// below where it would belong. - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - pop1 = Pjlw[0] + 1; - - if ((offset = j__udySearchLeafW(Pjlw + 1, pop1, *PIndex)) - >= 0) // Index is present. - { - assert(offset < pop1); // in expected range. - JU_RET_FOUND_LEAFW(Pjlw, pop1, offset); // *PIndex is set. - } - -#ifdef JUDYPREV - if ((offset = ~offset) == 0) // no next-left Index. -#else - if ((offset = ~offset) >= pop1) // no next-right Index. -#endif - JU_RET_NOTFOUND; - - assert(offset <= pop1); // valid result. - -#ifdef JUDYPREV - *PIndex = Pjlw[offset--]; // next-left Index, base 1. -#else - *PIndex = Pjlw[offset + 1]; // next-right Index, base 1. -#endif - JU_RET_FOUND_LEAFW(Pjlw, pop1, offset); // base 0. - - } - else // JRP BRANCH - { - Pjpm_t Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); - -// goto SM1Get; - } - -// ============================================================================ -// STATE MACHINE 1 -- GET INDEX: -// -// Search for *PIndex (already decremented/incremented so as to be inclusive). -// If found, return it. Otherwise in theory hand off to SM2Backtrack or -// SM3Findlimit, but in practice "shortcut" by first sideways searching the -// current branch or leaf upon hitting a dead end. During sideways search, -// modify *PIndex to a new path taken. -// -// ENTRY: Pjp points to next JP to interpret, whose Decode bytes have not yet -// been checked. This JP is not yet listed in history. -// -// Note: Check Decode bytes at the start of each loop, not after looking up a -// new JP, so its easy to do constant shifts/masks, although this requires -// cautious handling of Pjp, offset, and *hist[] for correct entry to -// SM2Backtrack. -// -// EXIT: Return, or branch to SM2Backtrack or SM3Findlimit with correct -// interface, as described elsewhere. -// -// WARNING: For run-time efficiency the following cases replicate code with -// varying constants, rather than using common code with variable values! - -SM1Get: // return here for next branch/leaf. - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_L2: CHECKDCD(2); SM1PREPB(2, SM1BranchL); - case cJU_JPBRANCH_L3: CHECKDCD(3); SM1PREPB(3, SM1BranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: CHECKDCD(4); SM1PREPB(4, SM1BranchL); - case cJU_JPBRANCH_L5: CHECKDCD(5); SM1PREPB(5, SM1BranchL); - case cJU_JPBRANCH_L6: CHECKDCD(6); SM1PREPB(6, SM1BranchL); - case cJU_JPBRANCH_L7: CHECKDCD(7); SM1PREPB(7, SM1BranchL); -#endif - case cJU_JPBRANCH_L: SM1PREPB(cJU_ROOTSTATE, SM1BranchL); - -// Common code (state-independent) for all cases of linear branches: - -SM1BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -// Found JP matching current digit in *PIndex; record parent JP and the next -// JPs offset, and iterate to the next JP: - - if ((offset = j__udySearchLeaf1((Pjll_t) (Pjbl->jbl_Expanse), - Pjbl->jbl_NumJPs, digit)) >= 0) - { - HISTPUSH(Pjp, offset); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM1Get; - } - -// Dead end, no JP in BranchL for next digit in *PIndex: -// -// Get the ideal location of digits JP, and if theres no next-left/right JP -// in the BranchL, shortcut and start backtracking one level up; ignore the -// current Pjp because it points to a BranchL with no next-left/right JP. - -#ifdef JUDYPREV - if ((offset = (~offset) - 1) < 0) // no next-left JP in BranchL. -#else - if ((offset = (~offset)) >= Pjbl->jbl_NumJPs) // no next-right. -#endif - goto SM2Backtrack; - -// Theres a next-left/right JP in the current BranchL; save its digit in -// *PIndex and shortcut to SM3Findlimit: - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Check Decode bytes, if any, in the current JP, then look for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_B2: CHECKDCD(2); SM1PREPB(2, SM1BranchB); - case cJU_JPBRANCH_B3: CHECKDCD(3); SM1PREPB(3, SM1BranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: CHECKDCD(4); SM1PREPB(4, SM1BranchB); - case cJU_JPBRANCH_B5: CHECKDCD(5); SM1PREPB(5, SM1BranchB); - case cJU_JPBRANCH_B6: CHECKDCD(6); SM1PREPB(6, SM1BranchB); - case cJU_JPBRANCH_B7: CHECKDCD(7); SM1PREPB(7, SM1BranchB); -#endif - case cJU_JPBRANCH_B: SM1PREPB(cJU_ROOTSTATE, SM1BranchB); - -// Common code (state-independent) for all cases of bitmap branches: - -SM1BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - -// Locate the digits JP in the subexpanse list, if present, otherwise the -// offset of the next-left JP, if any: - - subexp = digit / cJU_BITSPERSUBEXPB; - assert(subexp < cJU_NUMSUBEXPB); // falls in expected range. - bitposmask = JU_BITPOSMASKB(digit); - offset = SEARCHBITMAPB(JU_JBB_BITMAP(Pjbb, subexp), digit, - bitposmask); - // right range: - assert((offset >= -1) && (offset < (int) cJU_BITSPERSUBEXPB)); - -// Found JP matching current digit in *PIndex: -// -// Record the parent JP and the next JPs offset; and iterate to the next JP. - -// if (JU_BITMAPTESTB(Pjbb, digit)) // slower. - if (JU_JBB_BITMAP(Pjbb, subexp) & bitposmask) // faster. - { - // not negative since at least one bit is set: - assert(offset >= 0); - - HISTPUSH(Pjp, HISTPUSHBOFF(subexp, offset, digit)); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM1Get; // iterate to next JP. - } - -// Dead end, no JP in BranchB for next digit in *PIndex: -// -// If theres a next-left/right JP in the current BranchB, shortcut to -// SM3Findlimit. Note: offset is already set to the correct value for the -// next-left/right JP. - -#ifdef JUDYPREV - if (offset >= 0) // next-left JP is in this subexpanse. - goto SM1BranchBFindlimit; - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JBB_BITMAP(Pjbb, subexp) & JU_MASKHIGHEREXC(bitposmask)) - { - ++offset; // next-left => next-right. - goto SM1BranchBFindlimit; - } - - while (++subexp < cJU_NUMSUBEXPB) // search next-right subexps. -#endif - { - if (! JU_JBB_PJP(Pjbb, subexp)) continue; // empty subexpanse. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - offset = 0; -#endif - -// Save the next-left/right JPs digit in *PIndex: - -SM1BranchBFindlimit: - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), - offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchB: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a BranchB with no next-left/right JP. - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Check Decode bytes, if any, in the current JP, then look for a JP for the -// next digit in *PIndex. - - case cJU_JPBRANCH_U2: CHECKDCD(2); SM1PREPB(2, SM1BranchU); - case cJU_JPBRANCH_U3: CHECKDCD(3); SM1PREPB(3, SM1BranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: CHECKDCD(4); SM1PREPB(4, SM1BranchU); - case cJU_JPBRANCH_U5: CHECKDCD(5); SM1PREPB(5, SM1BranchU); - case cJU_JPBRANCH_U6: CHECKDCD(6); SM1PREPB(6, SM1BranchU); - case cJU_JPBRANCH_U7: CHECKDCD(7); SM1PREPB(7, SM1BranchU); -#endif - case cJU_JPBRANCH_U: SM1PREPB(cJU_ROOTSTATE, SM1BranchU); - -// Common code (state-independent) for all cases of uncompressed branches: - -SM1BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - Pjp2 = (Pjbu->jbu_jp) + digit; - -// Found JP matching current digit in *PIndex: -// -// Record the parent JP and the next JPs digit, and iterate to the next JP. -// -// TBD: Instead of this, just goto SM1Get, and add cJU_JPNULL* cases to the -// SM1Get state machine? Then backtrack? However, it means you cant detect -// an inappropriate cJU_JPNULL*, when it occurs in other than a BranchU, and -// return JU_RET_CORRUPT. - - if (! JPNULL(JU_JPTYPE(Pjp2))) // digit has a JP. - { - HISTPUSH(Pjp, digit); - Pjp = Pjp2; - goto SM1Get; - } - -// Dead end, no JP in BranchU for next digit in *PIndex: -// -// Search for a next-left/right JP in the current BranchU, and if one is found, -// save its digit in *PIndex and shortcut to SM3Findlimit: - -#ifdef JUDYPREV - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - while (digit < cJU_BRANCHUNUMJPS - 1) - { - Pjp = (Pjbu->jbu_jp) + (++digit); -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchU: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a BranchU with no next-left/right JP. - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for -// *PIndex. - -#define SM1LEAFL(Func) \ - Pjll = P_JLL(Pjp->jp_Addr); \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - offset = Func(Pjll, pop1, *PIndex); \ - goto SM1LeafLImm - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKDCD(1); SM1LEAFL(j__udySearchLeaf1); -#endif - case cJU_JPLEAF2: CHECKDCD(2); SM1LEAFL(j__udySearchLeaf2); - case cJU_JPLEAF3: CHECKDCD(3); SM1LEAFL(j__udySearchLeaf3); - -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKDCD(4); SM1LEAFL(j__udySearchLeaf4); - case cJU_JPLEAF5: CHECKDCD(5); SM1LEAFL(j__udySearchLeaf5); - case cJU_JPLEAF6: CHECKDCD(6); SM1LEAFL(j__udySearchLeaf6); - case cJU_JPLEAF7: CHECKDCD(7); SM1LEAFL(j__udySearchLeaf7); -#endif - -// Common code (state-independent) for all cases of linear leaves and -// immediates: - -SM1LeafLImm: - if (offset >= 0) // *PIndex is in LeafL / Immed. -#ifdef JUDY1 - JU_RET_FOUND; -#else - { // JudyL is trickier... - switch (JU_JPTYPE(Pjp)) - { -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - case cJU_JPLEAF2: JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - case cJU_JPLEAF3: JU_RET_FOUND_LEAF3(Pjll, pop1, offset); -#ifdef JU_64BIT - case cJU_JPLEAF4: JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - case cJU_JPLEAF5: JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - case cJU_JPLEAF6: JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - case cJU_JPLEAF7: JU_RET_FOUND_LEAF7(Pjll, pop1, offset); -#endif - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - JU_RET_FOUND_IMM_01(Pjp); - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#ifdef JU_64BIT - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: - case cJU_JPIMMED_3_02: -#endif - JU_RET_FOUND_IMM(Pjp, offset); - } - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // impossible? - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // found *PIndex - -#endif // JUDYL - -// Dead end, no Index in LeafL / Immed for remaining digit(s) in *PIndex: -// -// Get the ideal location of Index, and if theres no next-left/right Index in -// the LeafL / Immed, shortcut and start backtracking one level up; ignore the -// current Pjp because it points to a LeafL / Immed with no next-left/right -// Index. - -#ifdef JUDYPREV - if ((offset = (~offset) - 1) < 0) // no next-left Index. -#else - if ((offset = (~offset)) >= pop1) // no next-right Index. -#endif - goto SM2Backtrack; - -// Theres a next-left/right Index in the current LeafL / Immed; shortcut by -// copying its digit(s) to *PIndex and returning it. -// -// Unfortunately this is pretty hairy, especially avoiding endian issues. -// -// The cJU_JPLEAF* cases are very similar to same-index-size cJU_JPIMMED* cases -// for *_02 and above, but must return differently, at least for JudyL, so -// spell them out separately here at the cost of a little redundant code for -// Judy1. - - switch (JU_JPTYPE(Pjp)) - { -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]); - JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - - case cJU_JPLEAF2: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - - case cJU_JPLEAF3: - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - -#ifdef JU_64BIT - case cJU_JPLEAF4: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - - case cJU_JPLEAF5: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - } - - case cJU_JPLEAF6: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - } - - case cJU_JPLEAF7: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_LEAF7(Pjll, pop1, offset); - } - -#endif // JU_64BIT - -#define SET_01(cState) JU_SETDIGITS(*PIndex, JU_JPDCDPOP0(Pjp), cState) - - case cJU_JPIMMED_1_01: SET_01(1); goto SM1Imm_01; - case cJU_JPIMMED_2_01: SET_01(2); goto SM1Imm_01; - case cJU_JPIMMED_3_01: SET_01(3); goto SM1Imm_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: SET_01(4); goto SM1Imm_01; - case cJU_JPIMMED_5_01: SET_01(5); goto SM1Imm_01; - case cJU_JPIMMED_6_01: SET_01(6); goto SM1Imm_01; - case cJU_JPIMMED_7_01: SET_01(7); goto SM1Imm_01; -#endif -SM1Imm_01: JU_RET_FOUND_IMM_01(Pjp); - -// Shorthand for where to find start of Index bytes array: - -#ifdef JUDY1 -#define PJI (Pjp->jp_1Index) -#else -#define PJI (Pjp->jp_LIndex) -#endif - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]); - JU_RET_FOUND_IMM(Pjp, offset); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: - case cJ1_JPIMMED_4_03: - - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); - - case cJ1_JPIMMED_5_02: - case cJ1_JPIMMED_5_03: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_6_02: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_7_02: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - -#endif // (JUDY1 && JU_64BIT) - - } // switch for not-found *PIndex - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); // impossible? - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Check Decode bytes, if any, in the current JP, then look in the leaf for -// *PIndex. - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; - CHECKDCD(1); - - Pjlb = P_JLB(Pjp->jp_Addr); - digit = JU_DIGITATSTATE(*PIndex, 1); - subexp = JU_SUBEXPL(digit); - bitposmask = JU_BITPOSMASKL(digit); - assert(subexp < cJU_NUMSUBEXPL); // falls in expected range. - -// *PIndex exists in LeafB1: - -// if (JU_BITMAPTESTL(Pjlb, digit)) // slower. - if (JU_JLB_BITMAP(Pjlb, subexp) & bitposmask) // faster. - { -#ifdef JUDYL // needs offset at this point: - offset = SEARCHBITMAPL(JU_JLB_BITMAP(Pjlb, subexp), digit, bitposmask); -#endif - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - } - -// Dead end, no Index in LeafB1 for remaining digit in *PIndex: -// -// If theres a next-left/right Index in the current LeafB1, which for -// Judy*Next() is true if any bits are set for higher Indexes, shortcut by -// returning it. Note: For Judy*Prev(), offset is set here to the correct -// value for the next-left JP. - - offset = SEARCHBITMAPL(JU_JLB_BITMAP(Pjlb, subexp), digit, - bitposmask); - // right range: - assert((offset >= -1) && (offset < (int) cJU_BITSPERSUBEXPL)); - -#ifdef JUDYPREV - if (offset >= 0) // next-left JP is in this subexpanse. - goto SM1LeafB1Findlimit; - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JLB_BITMAP(Pjlb, subexp) & JU_MASKHIGHEREXC(bitposmask)) - { - ++offset; // next-left => next-right. - goto SM1LeafB1Findlimit; - } - - while (++subexp < cJU_NUMSUBEXPL) // search next-right subexps. -#endif - { - if (! JU_JLB_BITMAP(Pjlb, subexp)) continue; // empty subexp. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXL(JU_JLB_BITMAP(Pjlb, subexp)); - // expected range: - assert((offset >= 0) && (offset < (int) cJU_BITSPERSUBEXPL)); -#else - offset = 0; -#endif - -// Save the next-left/right Indexess digit in *PIndex: - -SM1LeafB1Findlimit: - JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset); - JU_SETDIGIT1(*PIndex, digit); - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - } - -// Theres no next-left/right Index in the LeafB1: -// -// Shortcut and start backtracking one level up; ignore the current Pjp because -// it points to a LeafB1 with no next-left/right Index. - - goto SM2Backtrack; - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// If the Decode bytes match, *PIndex is found (without modification). - - case cJ1_JPFULLPOPU1: - - CHECKDCD(1); - JU_RET_FOUND_FULLPOPU1; -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: - -#ifdef JUDYPREV -#define SM1IMM_SETPOP1(cPop1) -#else -#define SM1IMM_SETPOP1(cPop1) pop1 = (cPop1) -#endif - -#define SM1IMM(Func,cPop1) \ - SM1IMM_SETPOP1(cPop1); \ - offset = Func((Pjll_t) (PJI), cPop1, *PIndex); \ - goto SM1LeafLImm - -// Special case for Pop1 = 1 Immediate JPs: -// -// If *PIndex is in the immediate, offset is 0, otherwise the binary NOT of the -// offset where it belongs, 0 or 1, same as from the search functions. - -#ifdef JUDYPREV -#define SM1IMM_01_SETPOP1 -#else -#define SM1IMM_01_SETPOP1 pop1 = 1 -#endif - -#define SM1IMM_01 \ - SM1IMM_01_SETPOP1; \ - offset = ((JU_JPDCDPOP0(Pjp) < JU_TRIMTODCDSIZE(*PIndex)) ? ~1 : \ - (JU_JPDCDPOP0(Pjp) == JU_TRIMTODCDSIZE(*PIndex)) ? 0 : \ - ~0); \ - goto SM1LeafLImm - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - SM1IMM_01; - -// TBD: Doug says it would be OK to have fewer calls and calculate arg 2, here -// and in Judy*Count() also. - - case cJU_JPIMMED_1_02: SM1IMM(j__udySearchLeaf1, 2); - case cJU_JPIMMED_1_03: SM1IMM(j__udySearchLeaf1, 3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: SM1IMM(j__udySearchLeaf1, 4); - case cJU_JPIMMED_1_05: SM1IMM(j__udySearchLeaf1, 5); - case cJU_JPIMMED_1_06: SM1IMM(j__udySearchLeaf1, 6); - case cJU_JPIMMED_1_07: SM1IMM(j__udySearchLeaf1, 7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: SM1IMM(j__udySearchLeaf1, 8); - case cJ1_JPIMMED_1_09: SM1IMM(j__udySearchLeaf1, 9); - case cJ1_JPIMMED_1_10: SM1IMM(j__udySearchLeaf1, 10); - case cJ1_JPIMMED_1_11: SM1IMM(j__udySearchLeaf1, 11); - case cJ1_JPIMMED_1_12: SM1IMM(j__udySearchLeaf1, 12); - case cJ1_JPIMMED_1_13: SM1IMM(j__udySearchLeaf1, 13); - case cJ1_JPIMMED_1_14: SM1IMM(j__udySearchLeaf1, 14); - case cJ1_JPIMMED_1_15: SM1IMM(j__udySearchLeaf1, 15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: SM1IMM(j__udySearchLeaf2, 2); - case cJU_JPIMMED_2_03: SM1IMM(j__udySearchLeaf2, 3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: SM1IMM(j__udySearchLeaf2, 4); - case cJ1_JPIMMED_2_05: SM1IMM(j__udySearchLeaf2, 5); - case cJ1_JPIMMED_2_06: SM1IMM(j__udySearchLeaf2, 6); - case cJ1_JPIMMED_2_07: SM1IMM(j__udySearchLeaf2, 7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: SM1IMM(j__udySearchLeaf3, 2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: SM1IMM(j__udySearchLeaf3, 3); - case cJ1_JPIMMED_3_04: SM1IMM(j__udySearchLeaf3, 4); - case cJ1_JPIMMED_3_05: SM1IMM(j__udySearchLeaf3, 5); - - case cJ1_JPIMMED_4_02: SM1IMM(j__udySearchLeaf4, 2); - case cJ1_JPIMMED_4_03: SM1IMM(j__udySearchLeaf4, 3); - - case cJ1_JPIMMED_5_02: SM1IMM(j__udySearchLeaf5, 2); - case cJ1_JPIMMED_5_03: SM1IMM(j__udySearchLeaf5, 3); - - case cJ1_JPIMMED_6_02: SM1IMM(j__udySearchLeaf6, 2); - - case cJ1_JPIMMED_7_02: SM1IMM(j__udySearchLeaf7, 2); -#endif - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM1Get switch. - - /*NOTREACHED*/ - - -// ============================================================================ -// STATE MACHINE 2 -- BACKTRACK BRANCH TO PREVIOUS JP: -// -// Look for the next-left/right JP in a branch, backing up the history list as -// necessary. Upon finding a next-left/right JP, modify the corresponding -// digit in *PIndex before passing control to SM3Findlimit. -// -// Note: As described earlier, only branch JPs are expected here; other types -// fall into the default case. -// -// Note: If a found JP contains needed Dcd bytes, thats OK, theyre copied to -// *PIndex in SM3Findlimit. -// -// TBD: This code has a lot in common with similar code in the shortcut cases -// in SM1Get. Can combine this code somehow? -// -// ENTRY: List, possibly empty, of JPs and offsets in APjphist[] and -// Aoffhist[]; see earlier comments. -// -// EXIT: Execute JU_RET_NOTFOUND if no previous/next JP; otherwise jump to -// SM3Findlimit to resume a new but different downward search. - -SM2Backtrack: // come or return here for first/next sideways search. - - HISTPOP(Pjp, offset); - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: - - case cJU_JPBRANCH_L2: state = 2; goto SM2BranchL; - case cJU_JPBRANCH_L3: state = 3; goto SM2BranchL; -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: state = 4; goto SM2BranchL; - case cJU_JPBRANCH_L5: state = 5; goto SM2BranchL; - case cJU_JPBRANCH_L6: state = 6; goto SM2BranchL; - case cJU_JPBRANCH_L7: state = 7; goto SM2BranchL; -#endif - case cJU_JPBRANCH_L: state = cJU_ROOTSTATE; goto SM2BranchL; - -SM2BranchL: -#ifdef JUDYPREV - if (--offset < 0) goto SM2Backtrack; // no next-left JP in BranchL. -#endif - Pjbl = P_JBL(Pjp->jp_Addr); -#ifdef JUDYNEXT - if (++offset >= (Pjbl->jbl_NumJPs)) goto SM2Backtrack; - // no next-right JP in BranchL. -#endif - -// Theres a next-left/right JP in the current BranchL; save its digit in -// *PIndex and continue with SM3Findlimit: - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: - - case cJU_JPBRANCH_B2: state = 2; goto SM2BranchB; - case cJU_JPBRANCH_B3: state = 3; goto SM2BranchB; -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: state = 4; goto SM2BranchB; - case cJU_JPBRANCH_B5: state = 5; goto SM2BranchB; - case cJU_JPBRANCH_B6: state = 6; goto SM2BranchB; - case cJU_JPBRANCH_B7: state = 7; goto SM2BranchB; -#endif - case cJU_JPBRANCH_B: state = cJU_ROOTSTATE; goto SM2BranchB; - -SM2BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - HISTPOPBOFF(subexp, offset, digit); // unpack values. - -// If theres a next-left/right JP in the current BranchB, which for -// Judy*Next() is true if any bits are set for higher Indexes, continue to -// SM3Findlimit: -// -// Note: offset is set to the JP previously traversed; go one to the -// left/right. - -#ifdef JUDYPREV - if (offset > 0) // next-left JP is in this subexpanse. - { - --offset; - goto SM2BranchBFindlimit; - } - - while (--subexp >= 0) // search next-left subexpanses. -#else - if (JU_JBB_BITMAP(Pjbb, subexp) - & JU_MASKHIGHEREXC(JU_BITPOSMASKB(digit))) - { - ++offset; // next-left => next-right. - goto SM2BranchBFindlimit; - } - - while (++subexp < cJU_NUMSUBEXPB) // search next-right subexps. -#endif - { - if (! JU_JBB_PJP(Pjbb, subexp)) continue; // empty subexpanse. - -#ifdef JUDYPREV - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - offset = 0; -#endif - -// Save the next-left/right JPs digit in *PIndex: - -SM2BranchBFindlimit: - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), - offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchB: - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: - - case cJU_JPBRANCH_U2: state = 2; goto SM2BranchU; - case cJU_JPBRANCH_U3: state = 3; goto SM2BranchU; -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: state = 4; goto SM2BranchU; - case cJU_JPBRANCH_U5: state = 5; goto SM2BranchU; - case cJU_JPBRANCH_U6: state = 6; goto SM2BranchU; - case cJU_JPBRANCH_U7: state = 7; goto SM2BranchU; -#endif - case cJU_JPBRANCH_U: state = cJU_ROOTSTATE; goto SM2BranchU; - -SM2BranchU: - -// Search for a next-left/right JP in the current BranchU, and if one is found, -// save its digit in *PIndex and continue to SM3Findlimit: - - Pjbu = P_JBU(Pjp->jp_Addr); - digit = offset; - -#ifdef JUDYPREV - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - while (digit < cJU_BRANCHUNUMJPS - 1) - { - Pjp = (Pjbu->jbu_jp) + (++digit); -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// Theres no next-left/right JP in the BranchU: - - goto SM2Backtrack; - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM2Backtrack switch. - - /*NOTREACHED*/ - - -// ============================================================================ -// STATE MACHINE 3 -- FIND LIMIT JP/INDEX: -// -// Look for the highest/lowest (right/left-most) JP in each branch and the -// highest/lowest Index in a leaf or immediate, and return it. While -// traversing, modify appropriate digit(s) in *PIndex to reflect the path -// taken, including Dcd bytes in each JP (which could hold critical missing -// digits for skipped branches). -// -// ENTRY: Pjp set to a JP under which to find max/min JPs (if a branch JP) or -// a max/min Index and return (if a leaf or immediate JP). -// -// EXIT: Execute JU_RET_FOUND* upon reaching a leaf or immediate. Should be -// impossible to fail, unless the Judy array is corrupt. - -SM3Findlimit: // come or return here for first/next branch/leaf. - - switch (JU_JPTYPE(Pjp)) - { -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Simply use the highest/lowest (right/left-most) JP in the BranchL, but first -// copy the Dcd bytes to *PIndex if there are any (only if state < -// cJU_ROOTSTATE - 1). - - case cJU_JPBRANCH_L2: SM3PREPB_DCD(2, SM3BranchL); -#ifndef JU_64BIT - case cJU_JPBRANCH_L3: SM3PREPB( 3, SM3BranchL); -#else - case cJU_JPBRANCH_L3: SM3PREPB_DCD(3, SM3BranchL); - case cJU_JPBRANCH_L4: SM3PREPB_DCD(4, SM3BranchL); - case cJU_JPBRANCH_L5: SM3PREPB_DCD(5, SM3BranchL); - case cJU_JPBRANCH_L6: SM3PREPB_DCD(6, SM3BranchL); - case cJU_JPBRANCH_L7: SM3PREPB( 7, SM3BranchL); -#endif - case cJU_JPBRANCH_L: SM3PREPB( cJU_ROOTSTATE, SM3BranchL); - -SM3BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -#ifdef JUDYPREV - if ((offset = (Pjbl->jbl_NumJPs) - 1) < 0) -#else - offset = 0; if ((Pjbl->jbl_NumJPs) == 0) -#endif - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - JU_SETDIGIT(*PIndex, Pjbl->jbl_Expanse[offset], state); - Pjp = (Pjbl->jbl_jp) + offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Look for the highest/lowest (right/left-most) non-null subexpanse, then use -// the highest/lowest JP in that subexpanse, but first copy Dcd bytes, if there -// are any (only if state < cJU_ROOTSTATE - 1), to *PIndex. - - case cJU_JPBRANCH_B2: SM3PREPB_DCD(2, SM3BranchB); -#ifndef JU_64BIT - case cJU_JPBRANCH_B3: SM3PREPB( 3, SM3BranchB); -#else - case cJU_JPBRANCH_B3: SM3PREPB_DCD(3, SM3BranchB); - case cJU_JPBRANCH_B4: SM3PREPB_DCD(4, SM3BranchB); - case cJU_JPBRANCH_B5: SM3PREPB_DCD(5, SM3BranchB); - case cJU_JPBRANCH_B6: SM3PREPB_DCD(6, SM3BranchB); - case cJU_JPBRANCH_B7: SM3PREPB( 7, SM3BranchB); -#endif - case cJU_JPBRANCH_B: SM3PREPB( cJU_ROOTSTATE, SM3BranchB); - -SM3BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); -#ifdef JUDYPREV - subexp = cJU_NUMSUBEXPB; - - while (! (JU_JBB_BITMAP(Pjbb, --subexp))) // find non-empty subexp. - { - if (subexp <= 0) // wholly empty bitmap. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPB)); -#else - subexp = -1; - - while (! (JU_JBB_BITMAP(Pjbb, ++subexp))) // find non-empty subexp. - { - if (subexp >= cJU_NUMSUBEXPB - 1) // didnt find one. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = 0; -#endif - - JU_BITMAPDIGITB(digit, subexp, JU_JBB_BITMAP(Pjbb, subexp), offset); - JU_SETDIGIT(*PIndex, digit, state); - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - - Pjp += offset; - goto SM3Findlimit; - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Look for the highest/lowest (right/left-most) non-null JP, and use it, but -// first copy Dcd bytes to *PIndex if there are any (only if state < -// cJU_ROOTSTATE - 1). - - case cJU_JPBRANCH_U2: SM3PREPB_DCD(2, SM3BranchU); -#ifndef JU_64BIT - case cJU_JPBRANCH_U3: SM3PREPB( 3, SM3BranchU); -#else - case cJU_JPBRANCH_U3: SM3PREPB_DCD(3, SM3BranchU); - case cJU_JPBRANCH_U4: SM3PREPB_DCD(4, SM3BranchU); - case cJU_JPBRANCH_U5: SM3PREPB_DCD(5, SM3BranchU); - case cJU_JPBRANCH_U6: SM3PREPB_DCD(6, SM3BranchU); - case cJU_JPBRANCH_U7: SM3PREPB( 7, SM3BranchU); -#endif - case cJU_JPBRANCH_U: SM3PREPB( cJU_ROOTSTATE, SM3BranchU); - -SM3BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); -#ifdef JUDYPREV - digit = cJU_BRANCHUNUMJPS; - - while (digit >= 1) - { - Pjp = (Pjbu->jbu_jp) + (--digit); -#else - - for (digit = 0; digit < cJU_BRANCHUNUMJPS; ++digit) - { - Pjp = (Pjbu->jbu_jp) + digit; -#endif - if (JPNULL(JU_JPTYPE(Pjp))) continue; - - JU_SETDIGIT(*PIndex, digit, state); - goto SM3Findlimit; - } - -// No non-null JPs in BranchU: - - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Simply use the highest/lowest (right/left-most) Index in the LeafL, but the -// details vary depending on leaf Index Size. First copy Dcd bytes, if there -// are any (only if state < cJU_ROOTSTATE - 1), to *PIndex. - -#define SM3LEAFLDCD(cState) \ - JU_SETDCD(*PIndex, Pjp, cState); \ - SM3LEAFLNODCD - -#ifdef JUDY1 -#define SM3LEAFL_SETPOP1 // not needed in any cases. -#else -#define SM3LEAFL_SETPOP1 pop1 = JU_JPLEAF_POP0(Pjp) + 1 -#endif - -#ifdef JUDYPREV -#define SM3LEAFLNODCD \ - Pjll = P_JLL(Pjp->jp_Addr); \ - SM3LEAFL_SETPOP1; \ - offset = JU_JPLEAF_POP0(Pjp); assert(offset >= 0) -#else -#define SM3LEAFLNODCD \ - Pjll = P_JLL(Pjp->jp_Addr); \ - SM3LEAFL_SETPOP1; \ - offset = 0; assert(JU_JPLEAF_POP0(Pjp) >= 0); -#endif - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: - - SM3LEAFLDCD(1); - JU_SETDIGIT1(*PIndex, ((uint8_t *) Pjll)[offset]); - JU_RET_FOUND_LEAF1(Pjll, pop1, offset); -#endif - - case cJU_JPLEAF2: - - SM3LEAFLDCD(2); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF2(Pjll, pop1, offset); - -#ifndef JU_64BIT - case cJU_JPLEAF3: - { - Word_t lsb; - SM3LEAFLNODCD; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - -#else - case cJU_JPLEAF3: - { - Word_t lsb; - SM3LEAFLDCD(3); - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_LEAF3(Pjll, pop1, offset); - } - - case cJU_JPLEAF4: - - SM3LEAFLDCD(4); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) Pjll)[offset]; - JU_RET_FOUND_LEAF4(Pjll, pop1, offset); - - case cJU_JPLEAF5: - { - Word_t lsb; - SM3LEAFLDCD(5); - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_LEAF5(Pjll, pop1, offset); - } - - case cJU_JPLEAF6: - { - Word_t lsb; - SM3LEAFLDCD(6); - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_LEAF6(Pjll, pop1, offset); - } - - case cJU_JPLEAF7: - { - Word_t lsb; - SM3LEAFLNODCD; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) Pjll) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_LEAF7(Pjll, pop1, offset); - } -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Look for the highest/lowest (right/left-most) non-null subexpanse, then use -// the highest/lowest Index in that subexpanse, but first copy Dcd bytes -// (always present since state 1 < cJU_ROOTSTATE) to *PIndex. - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; - - JU_SETDCD(*PIndex, Pjp, 1); - - Pjlb = P_JLB(Pjp->jp_Addr); -#ifdef JUDYPREV - subexp = cJU_NUMSUBEXPL; - - while (! JU_JLB_BITMAP(Pjlb, --subexp)) // find non-empty subexp. - { - if (subexp <= 0) // wholly empty bitmap. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - -// TBD: Might it be faster to just use a variant of BITMAPDIGIT*() that yields -// the digit for the right-most Index with a bit set? - - offset = SEARCHBITMAPMAXL(JU_JLB_BITMAP(Pjlb, subexp)); - // expected range: - assert((offset >= 0) && (offset < cJU_BITSPERSUBEXPL)); -#else - subexp = -1; - - while (! JU_JLB_BITMAP(Pjlb, ++subexp)) // find non-empty subexp. - { - if (subexp >= cJU_NUMSUBEXPL - 1) // didnt find one. - { - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - } - } - - offset = 0; -#endif - - JU_BITMAPDIGITL(digit, subexp, JU_JLB_BITMAP(Pjlb, subexp), offset); - JU_SETDIGIT1(*PIndex, digit); - JU_RET_FOUND_LEAF_B1(Pjlb, subexp, offset); -// == return((PPvoid_t) (P_JV(JL_JLB_PVALUE(Pjlb, subexp)) + (offset))); - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// Copy Dcd bytes to *PIndex (always present since state 1 < cJU_ROOTSTATE), -// then set the highest/lowest possible digit as the LSB in *PIndex. - - case cJ1_JPFULLPOPU1: - - JU_SETDCD( *PIndex, Pjp, 1); -#ifdef JUDYPREV - JU_SETDIGIT1(*PIndex, cJU_BITSPERBITMAP - 1); -#else - JU_SETDIGIT1(*PIndex, 0); -#endif - JU_RET_FOUND_FULLPOPU1; -#endif // JUDY1 - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: -// -// Simply use the highest/lowest (right/left-most) Index in the Imm, but the -// details vary depending on leaf Index Size and pop1. Note: There are no Dcd -// bytes in an Immediate JP, but in a cJU_JPIMMED_*_01 JP, the field holds the -// least bytes of the immediate Index. - - case cJU_JPIMMED_1_01: SET_01(1); goto SM3Imm_01; - case cJU_JPIMMED_2_01: SET_01(2); goto SM3Imm_01; - case cJU_JPIMMED_3_01: SET_01(3); goto SM3Imm_01; -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: SET_01(4); goto SM3Imm_01; - case cJU_JPIMMED_5_01: SET_01(5); goto SM3Imm_01; - case cJU_JPIMMED_6_01: SET_01(6); goto SM3Imm_01; - case cJU_JPIMMED_7_01: SET_01(7); goto SM3Imm_01; -#endif -SM3Imm_01: JU_RET_FOUND_IMM_01(Pjp); - -#ifdef JUDYPREV -#define SM3IMM_OFFSET(cPop1) (cPop1) - 1 // highest. -#else -#define SM3IMM_OFFSET(cPop1) 0 // lowest. -#endif - -#define SM3IMM(cPop1,Next) \ - offset = SM3IMM_OFFSET(cPop1); \ - goto Next - - case cJU_JPIMMED_1_02: SM3IMM( 2, SM3Imm1); - case cJU_JPIMMED_1_03: SM3IMM( 3, SM3Imm1); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: SM3IMM( 4, SM3Imm1); - case cJU_JPIMMED_1_05: SM3IMM( 5, SM3Imm1); - case cJU_JPIMMED_1_06: SM3IMM( 6, SM3Imm1); - case cJU_JPIMMED_1_07: SM3IMM( 7, SM3Imm1); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: SM3IMM( 8, SM3Imm1); - case cJ1_JPIMMED_1_09: SM3IMM( 9, SM3Imm1); - case cJ1_JPIMMED_1_10: SM3IMM(10, SM3Imm1); - case cJ1_JPIMMED_1_11: SM3IMM(11, SM3Imm1); - case cJ1_JPIMMED_1_12: SM3IMM(12, SM3Imm1); - case cJ1_JPIMMED_1_13: SM3IMM(13, SM3Imm1); - case cJ1_JPIMMED_1_14: SM3IMM(14, SM3Imm1); - case cJ1_JPIMMED_1_15: SM3IMM(15, SM3Imm1); -#endif - -SM3Imm1: JU_SETDIGIT1(*PIndex, ((uint8_t *) PJI)[offset]); - JU_RET_FOUND_IMM(Pjp, offset); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: SM3IMM(2, SM3Imm2); - case cJU_JPIMMED_2_03: SM3IMM(3, SM3Imm2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: SM3IMM(4, SM3Imm2); - case cJ1_JPIMMED_2_05: SM3IMM(5, SM3Imm2); - case cJ1_JPIMMED_2_06: SM3IMM(6, SM3Imm2); - case cJ1_JPIMMED_2_07: SM3IMM(7, SM3Imm2); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -SM3Imm2: *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(2))) - | ((uint16_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: SM3IMM(2, SM3Imm3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: SM3IMM(3, SM3Imm3); - case cJ1_JPIMMED_3_04: SM3IMM(4, SM3Imm3); - case cJ1_JPIMMED_3_05: SM3IMM(5, SM3Imm3); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) -SM3Imm3: - { - Word_t lsb; - JU_COPY3_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (3 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(3))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: SM3IMM(2, SM3Imm4); - case cJ1_JPIMMED_4_03: SM3IMM(3, SM3Imm4); - -SM3Imm4: *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(4))) - | ((uint32_t *) PJI)[offset]; - JU_RET_FOUND_IMM(Pjp, offset); - - case cJ1_JPIMMED_5_02: SM3IMM(2, SM3Imm5); - case cJ1_JPIMMED_5_03: SM3IMM(3, SM3Imm5); - -SM3Imm5: - { - Word_t lsb; - JU_COPY5_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (5 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(5))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_6_02: SM3IMM(2, SM3Imm6); - -SM3Imm6: - { - Word_t lsb; - JU_COPY6_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (6 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(6))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } - - case cJ1_JPIMMED_7_02: SM3IMM(2, SM3Imm7); - -SM3Imm7: - { - Word_t lsb; - JU_COPY7_PINDEX_TO_LONG(lsb, ((uint8_t *) PJI) + (7 * offset)); - *PIndex = (*PIndex & (~JU_LEASTBYTESMASK(7))) | lsb; - JU_RET_FOUND_IMM(Pjp, offset); - } -#endif // (JUDY1 && JU_64BIT) - - -// ---------------------------------------------------------------------------- -// OTHER CASES: - - default: JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // SM3Findlimit switch. - - /*NOTREACHED*/ - -} // Judy1Prev() / Judy1Next() / JudyLPrev() / JudyLNext() diff --git a/libjudy/src/JudyL/JudyLPrevEmpty.c b/libjudy/src/JudyL/JudyLPrevEmpty.c deleted file mode 100644 index 96a5901e3d..0000000000 --- a/libjudy/src/JudyL/JudyLPrevEmpty.c +++ /dev/null @@ -1,1390 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.32 $ $Source: /judy/src/JudyCommon/JudyPrevNextEmpty.c $ -// -// Judy*PrevEmpty() and Judy*NextEmpty() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. -// -// Compile with -DJUDYNEXT for the Judy*NextEmpty() function; otherwise -// defaults to Judy*PrevEmpty(). -// -// Compile with -DTRACEJPSE to trace JP traversals. -// -// This file is separate from JudyPrevNext.c because it differs too greatly for -// ifdefs. This might be a bit surprising, but there are two reasons: -// -// - First, down in the details, searching for an empty index (SearchEmpty) is -// remarkably asymmetric with searching for a valid index (SearchValid), -// mainly with respect to: No return of a value area for JudyL; partially- -// full versus totally-full JPs; and handling of narrow pointers. -// -// - Second, we chose to implement SearchEmpty without a backtrack stack or -// backtrack engine, partly as an experiment, and partly because we think -// restarting from the top of the tree is less likely for SearchEmpty than -// for SearchValid, because empty indexes are more likely than valid indexes. -// -// A word about naming: A prior version of this feature (see 4.13) was named -// Judy*Free(), but there were concerns about that being read as a verb rather -// than an adjective. After prolonged debate and based on user input, we -// changed "Free" to "Empty". - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifndef JUDYNEXT -#ifndef JUDYPREV -#define JUDYPREV 1 // neither set => use default. -#endif -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -#ifdef TRACEJPSE -#include "JudyPrintJP.c" -#endif - - -// **************************************************************************** -// J U D Y 1 P R E V E M P T Y -// J U D Y 1 N E X T E M P T Y -// J U D Y L P R E V E M P T Y -// J U D Y L N E X T E M P T Y -// -// See the manual entry for the API. -// -// OVERVIEW OF Judy*PrevEmpty() / Judy*NextEmpty(): -// -// See also for comparison the equivalent comments in JudyPrevNext.c. -// -// Take the callers *PIndex and subtract/add 1, but watch out for -// underflow/overflow, which means "no previous/next empty index found." Use a -// reentrant switch statement (state machine, see SMGetRestart and -// SMGetContinue) to decode Index, starting with the JRP (PArray), through a -// JPM and branches, if any, down to an immediate or a leaf. Look for Index in -// that immediate or leaf, and if not found (invalid index), return success -// (Index is empty). -// -// This search can result in a dead end where taking a different path is -// required. There are four kinds of dead ends: -// -// BRANCH PRIMARY dead end: Encountering a fully-populated JP for the -// appropriate digit in Index. Search sideways in the branch for the -// previous/next absent/null/non-full JP, and if one is found, set Index to the -// highest/lowest index possible in that JPs expanse. Then if the JP is an -// absent or null JP, return success; otherwise for a non-full JP, traverse -// through the partially populated JP. -// -// BRANCH SECONDARY dead end: Reaching the end of a branch during a sideways -// search after a branch primary dead end. Set Index to the lowest/highest -// index possible in the whole branchs expanse (one higher/lower than the -// previous/next branchs expanse), then restart at the top of the tree, which -// includes pre-decrementing/incrementing Index (again) and watching for -// underflow/overflow (again). -// -// LEAF PRIMARY dead end: Finding a valid (non-empty) index in an immediate or -// leaf matching Index. Search sideways in the immediate/leaf for the -// previous/next empty index; if found, set *PIndex to match and return success. -// -// LEAF SECONDARY dead end: Reaching the end of an immediate or leaf during a -// sideways search after a leaf primary dead end. Just as for a branch -// secondary dead end, restart at the top of the tree with Index set to the -// lowest/highest index possible in the whole immediate/leafs expanse. -// TBD: If leaf secondary dead end occurs, could shortcut and treat it as a -// branch primary dead end; but this would require remembering the parent -// branchs type and offset (a "one-deep stack"), and also wrestling with -// narrow pointers, at least for leaves (but not for immediates). -// -// Note some ASYMMETRIES between SearchValid and SearchEmpty: -// -// - The SearchValid code, upon descending through a narrow pointer, if Index -// is outside the expanse of the subsidiary node (effectively a secondary -// dead end), must decide whether to backtrack or findlimit. But the -// SearchEmpty code simply returns success (Index is empty). -// -// - Similarly, the SearchValid code, upon finding no previous/next index in -// the expanse of a narrow pointer (again, a secondary dead end), can simply -// start to backtrack at the parent JP. But the SearchEmpty code would have -// to first determine whether or not the parent JPs narrow expanse contains -// a previous/next empty index outside the subexpanse. Rather than keeping a -// parent state stack and backtracking this way, upon a secondary dead end, -// the SearchEmpty code simply restarts at the top of the tree, whether or -// not a narrow pointer is involved. Again, see the equivalent comments in -// JudyPrevNext.c for comparison. -// -// This function is written iteratively for speed, rather than recursively. -// -// TBD: Wed like to enhance this function to make successive searches faster. -// This would require saving some previous state, including the previous Index -// returned, and in which leaf it was found. If the next call is for the same -// Index and the array has not been modified, start at the same leaf. This -// should be much easier to implement since this is iterative rather than -// recursive code. - -#ifdef JUDY1 -#ifdef JUDYPREV -FUNCTION int Judy1PrevEmpty -#else -FUNCTION int Judy1NextEmpty -#endif -#else -#ifdef JUDYPREV -FUNCTION int JudyLPrevEmpty -#else -FUNCTION int JudyLNextEmpty -#endif -#endif - ( - Pcvoid_t PArray, // Judy array to search. - Word_t * PIndex, // starting point and result. - PJError_t PJError // optional, for returning error info. - ) -{ - Word_t Index; // fast copy, in a register. - Pjp_t Pjp; // current JP. - Pjbl_t Pjbl; // Pjp->jp_Addr masked and cast to types: - Pjbb_t Pjbb; - Pjbu_t Pjbu; - Pjlb_t Pjlb; - PWord_t Pword; // alternate name for use by GET* macros. - - Word_t digit; // next digit to decode from Index. - Word_t digits; // current state in SM = digits left to decode. - Word_t pop0; // in a leaf. - Word_t pop0mask; // precalculated to avoid variable shifts. - long offset; // within a branch or leaf (can be large). - int subexp; // subexpanse in a bitmap branch. - BITMAPB_t bitposmaskB; // bit in bitmap for bitmap branch. - BITMAPL_t bitposmaskL; // bit in bitmap for bitmap leaf. - Word_t possfullJP1; // JP types for possibly full subexpanses: - Word_t possfullJP2; - Word_t possfullJP3; - - -// ---------------------------------------------------------------------------- -// M A C R O S -// -// These are intended to make the code a bit more readable and less redundant. - - -// CHECK FOR NULL JP: -// -// TBD: In principle this can be reduced (here and in other *.c files) to just -// the latter clause since no Type should ever be below cJU_JPNULL1, but in -// fact some root pointer types can be lower, so for safety do both checks. - -#define JPNULL(Type) (((Type) >= cJU_JPNULL1) && ((Type) <= cJU_JPNULLMAX)) - - -// CHECK FOR A FULL JP: -// -// Given a JP, indicate if it is fully populated. Use digits, pop0mask, and -// possfullJP1..3 in the context. -// -// This is a difficult problem because it requires checking the Pop0 bits for -// all-ones, but the number of bytes depends on the JP type, which is not -// directly related to the parent branchs type or level -- the JPs child -// could be under a narrow pointer (hence not full). The simple answer -// requires switching on or otherwise calculating the JP type, which could be -// slow. Instead, in SMPREPB* precalculate pop0mask and also record in -// possfullJP1..3 the child JP (branch) types that could possibly be full (one -// level down), and use them here. For level-2 branches (with digits == 2), -// the test for a full child depends on Judy1/JudyL. -// -// Note: This cannot be applied to the JP in a JPM because it doesnt have -// enough pop0 digits. -// -// TBD: JPFULL_BRANCH diligently checks for BranchL or BranchB, where neither -// of those can ever be full as it turns out. Could just check for a BranchU -// at the right level. Also, pop0mask might be overkill, its not used much, -// so perhaps just call cJU_POP0MASK(digits - 1) here? -// -// First, JPFULL_BRANCH checks for a full expanse for a JP whose child can be a -// branch, that is, a JP in a branch at level 3 or higher: - -#define JPFULL_BRANCH(Pjp) \ - ((((JU_JPDCDPOP0(Pjp) ^ cJU_ALLONES) & pop0mask) == 0) \ - && ((JU_JPTYPE(Pjp) == possfullJP1) \ - || (JU_JPTYPE(Pjp) == possfullJP2) \ - || (JU_JPTYPE(Pjp) == possfullJP3))) - -#ifdef JUDY1 -#define JPFULL(Pjp) \ - ((digits == 2) ? \ - (JU_JPTYPE(Pjp) == cJ1_JPFULLPOPU1) : JPFULL_BRANCH(Pjp)) -#else -#define JPFULL(Pjp) \ - ((digits == 2) ? \ - (JU_JPTYPE(Pjp) == cJU_JPLEAF_B1) \ - && (((JU_JPDCDPOP0(Pjp) & cJU_POP0MASK(1)) == cJU_POP0MASK(1))) : \ - JPFULL_BRANCH(Pjp)) -#endif - - -// RETURN SUCCESS: -// -// This hides the need to set *PIndex back to the local value of Index -- use a -// local value for faster operation. Note that the callers *PIndex is ALWAYS -// modified upon success, at least decremented/incremented. - -#define RET_SUCCESS { *PIndex = Index; return(1); } - - -// RETURN A CORRUPTION: - -#define RET_CORRUPT { JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); return(JERRI); } - - -// SEARCH A BITMAP BRANCH: -// -// This is a weak analog of j__udySearchLeaf*() for bitmap branches. Return -// the actual or next-left position, base 0, of Digit in a BITMAPB_t bitmap -// (subexpanse of a full bitmap), also given a Bitposmask for Digit. The -// position is the offset within the set bits. -// -// Unlike j__udySearchLeaf*(), the offset is not returned bit-complemented if -// Digits bit is unset, because the caller can check the bitmap themselves to -// determine that. Also, if Digits bit is unset, the returned offset is to -// the next-left JP or index (including -1), not to the "ideal" position for -// the index = next-right JP or index. -// -// Shortcut and skip calling j__udyCountBitsB() if the bitmap is full, in which -// case (Digit % cJU_BITSPERSUBEXPB) itself is the base-0 offset. - -#define SEARCHBITMAPB(Bitmap,Digit,Bitposmask) \ - (((Bitmap) == cJU_FULLBITMAPB) ? (Digit % cJU_BITSPERSUBEXPB) : \ - j__udyCountBitsB((Bitmap) & JU_MASKLOWERINC(Bitposmask)) - 1) - -#ifdef JUDYPREV -// Equivalent to search for the highest offset in Bitmap, that is, one less -// than the number of bits set: - -#define SEARCHBITMAPMAXB(Bitmap) \ - (((Bitmap) == cJU_FULLBITMAPB) ? cJU_BITSPERSUBEXPB - 1 : \ - j__udyCountBitsB(Bitmap) - 1) -#endif - - -// CHECK DECODE BYTES: -// -// Check Decode bytes in a JP against the equivalent portion of Index. If they -// dont match, Index is outside the subexpanse of a narrow pointer, hence is -// empty. - -#define CHECKDCD(cDigits) \ - if (JU_DCDNOTMATCHINDEX(Index, Pjp, cDigits)) RET_SUCCESS - - -// REVISE REMAINDER OF INDEX: -// -// Put one digit in place in Index and clear/set the lower digits, if any, so -// the resulting Index is at the start/end of an expanse, or just clear/set the -// least digits. -// -// Actually, to make simple use of JU_LEASTBYTESMASK, first clear/set all least -// digits of Index including the digit to be overridden, then set the value of -// that one digit. If Digits == 1 the first operation is redundant, but either -// very fast or even removed by the optimizer. - -#define CLEARLEASTDIGITS(Digits) Index &= ~JU_LEASTBYTESMASK(Digits) -#define SETLEASTDIGITS( Digits) Index |= JU_LEASTBYTESMASK(Digits) - -#define CLEARLEASTDIGITS_D(Digit,Digits) \ - { \ - CLEARLEASTDIGITS(Digits); \ - JU_SETDIGIT(Index, Digit, Digits); \ - } - -#define SETLEASTDIGITS_D(Digit,Digits) \ - { \ - SETLEASTDIGITS(Digits); \ - JU_SETDIGIT(Index, Digit, Digits); \ - } - - -// SET REMAINDER OF INDEX AND THEN RETURN OR CONTINUE: - -#define SET_AND_RETURN(OpLeastDigits,Digit,Digits) \ - { \ - OpLeastDigits(Digit, Digits); \ - RET_SUCCESS; \ - } - -#define SET_AND_CONTINUE(OpLeastDigits,Digit,Digits) \ - { \ - OpLeastDigits(Digit, Digits); \ - goto SMGetContinue; \ - } - - -// PREPARE TO HANDLE A LEAFW OR JP BRANCH IN THE STATE MACHINE: -// -// Extract a state-dependent digit from Index in a "constant" way, then jump to -// common code for multiple cases. -// -// TBD: Should this macro do more, such as preparing variable-shift masks for -// use in CLEARLEASTDIGITS and SETLEASTDIGITS? - -#define SMPREPB(cDigits,Next,PossFullJP1,PossFullJP2,PossFullJP3) \ - digits = (cDigits); \ - digit = JU_DIGITATSTATE(Index, cDigits); \ - pop0mask = cJU_POP0MASK((cDigits) - 1); /* for branchs JPs */ \ - possfullJP1 = (PossFullJP1); \ - possfullJP2 = (PossFullJP2); \ - possfullJP3 = (PossFullJP3); \ - goto Next - -// Variations for specific-level branches and for shorthands: -// -// Note: SMPREPB2 need not initialize possfullJP* because JPFULL does not use -// them for digits == 2, but gcc -Wall isnt quite smart enough to see this, so -// waste a bit of time and space to get rid of the warning: - -#define SMPREPB2(Next) \ - digits = 2; \ - digit = JU_DIGITATSTATE(Index, 2); \ - pop0mask = cJU_POP0MASK(1); /* for branchs JPs */ \ - possfullJP1 = possfullJP2 = possfullJP3 = 0; \ - goto Next - -#define SMPREPB3(Next) SMPREPB(3, Next, cJU_JPBRANCH_L2, \ - cJU_JPBRANCH_B2, \ - cJU_JPBRANCH_U2) -#ifndef JU_64BIT -#define SMPREPBL(Next) SMPREPB(cJU_ROOTSTATE, Next, cJU_JPBRANCH_L3, \ - cJU_JPBRANCH_B3, \ - cJU_JPBRANCH_U3) -#else -#define SMPREPB4(Next) SMPREPB(4, Next, cJU_JPBRANCH_L3, \ - cJU_JPBRANCH_B3, \ - cJU_JPBRANCH_U3) -#define SMPREPB5(Next) SMPREPB(5, Next, cJU_JPBRANCH_L4, \ - cJU_JPBRANCH_B4, \ - cJU_JPBRANCH_U4) -#define SMPREPB6(Next) SMPREPB(6, Next, cJU_JPBRANCH_L5, \ - cJU_JPBRANCH_B5, \ - cJU_JPBRANCH_U5) -#define SMPREPB7(Next) SMPREPB(7, Next, cJU_JPBRANCH_L6, \ - cJU_JPBRANCH_B6, \ - cJU_JPBRANCH_U6) -#define SMPREPBL(Next) SMPREPB(cJU_ROOTSTATE, Next, cJU_JPBRANCH_L7, \ - cJU_JPBRANCH_B7, \ - cJU_JPBRANCH_U7) -#endif - - -// RESTART AFTER SECONDARY DEAD END: -// -// Set Index to the first/last index in the branch or leaf subexpanse and start -// over at the top of the tree. - -#ifdef JUDYPREV -#define SMRESTART(Digits) { CLEARLEASTDIGITS(Digits); goto SMGetRestart; } -#else -#define SMRESTART(Digits) { SETLEASTDIGITS( Digits); goto SMGetRestart; } -#endif - - -// CHECK EDGE OF LEAFS EXPANSE: -// -// Given the LSBs of the lowest/highest valid index in a leaf (or equivalently -// in an immediate JP), the level (index size) of the leaf, and the full index -// to return (as Index in the context) already set to the full index matching -// the lowest/highest one, determine if there is an empty index in the leafs -// expanse below/above the lowest/highest index, which is true if the -// lowest/highest index is not at the "edge" of the leafs expanse based on its -// LSBs. If so, return Index decremented/incremented; otherwise restart at the -// top of the tree. -// -// Note: In many cases Index is already at the right spot and calling -// SMRESTART instead of just going directly to SMGetRestart is a bit of -// overkill. -// -// Note: Variable shift occurs if Digits is not a constant. - -#ifdef JUDYPREV -#define LEAF_EDGE(MinIndex,Digits) \ - { \ - if (MinIndex) { --Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#else -#define LEAF_EDGE(MaxIndex,Digits) \ - { \ - if ((MaxIndex) != JU_LEASTBYTES(cJU_ALLONES, Digits)) \ - { ++Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#endif - -// Same as above except Index is not already set to match the lowest/highest -// index, so do that before decrementing/incrementing it: - -#ifdef JUDYPREV -#define LEAF_EDGE_SET(MinIndex,Digits) \ - { \ - if (MinIndex) \ - { JU_SETDIGITS(Index, MinIndex, Digits); --Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#else -#define LEAF_EDGE_SET(MaxIndex,Digits) \ - { \ - if ((MaxIndex) != JU_LEASTBYTES(cJU_ALLONES, Digits)) \ - { JU_SETDIGITS(Index, MaxIndex, Digits); ++Index; RET_SUCCESS; } \ - SMRESTART(Digits); \ - } -#endif - - -// FIND A HOLE (EMPTY INDEX) IN AN IMMEDIATE OR LEAF: -// -// Given an index location in a leaf (or equivalently an immediate JP) known to -// contain a usable hole (an empty index less/greater than Index), and the LSBs -// of a minimum/maximum index to locate, find the previous/next empty index and -// return it. -// -// Note: "Even" index sizes (1,2,4[,8] bytes) have corresponding native C -// types; "odd" index sizes dont, but they are not represented here because -// they are handled completely differently; see elsewhere. - -#ifdef JUDYPREV - -#define LEAF_HOLE_EVEN(cDigits,Pjll,IndexLSB) \ - { \ - while (*(Pjll) > (IndexLSB)) --(Pjll); /* too high */ \ - if (*(Pjll) < (IndexLSB)) RET_SUCCESS /* Index is empty */ \ - while (*(--(Pjll)) == --(IndexLSB)) /* null, find a hole */;\ - JU_SETDIGITS(Index, IndexLSB, cDigits); \ - RET_SUCCESS; \ - } -#else -#define LEAF_HOLE_EVEN(cDigits,Pjll,IndexLSB) \ - { \ - while (*(Pjll) < (IndexLSB)) ++(Pjll); /* too low */ \ - if (*(Pjll) > (IndexLSB)) RET_SUCCESS /* Index is empty */ \ - while (*(++(Pjll)) == ++(IndexLSB)) /* null, find a hole */;\ - JU_SETDIGITS(Index, IndexLSB, cDigits); \ - RET_SUCCESS; \ - } -#endif - - -// SEARCH FOR AN EMPTY INDEX IN AN IMMEDIATE OR LEAF: -// -// Given a pointer to the first index in a leaf (or equivalently an immediate -// JP), the population of the leaf, and a first empty Index to find (inclusive, -// as Index in the context), where Index is known to fall within the expanse of -// the leaf to search, efficiently find the previous/next empty index in the -// leaf, if any. For simplicity the following overview is stated in terms of -// Judy*NextEmpty() only, but the same concepts apply symmetrically for -// Judy*PrevEmpty(). Also, in each case the comparisons are for the LSBs of -// Index and leaf indexes, according to the leafs level. -// -// 1. If Index is GREATER than the last (highest) index in the leaf -// (maxindex), return success, Index is empty. (Remember, Index is known -// to be in the leafs expanse.) -// -// 2. If Index is EQUAL to maxindex: If maxindex is not at the edge of the -// leafs expanse, increment Index and return success, there is an empty -// Index one higher than any in the leaf; otherwise restart with Index -// reset to the upper edge of the leafs expanse. Note: This might cause -// an extra cache line fill, but this is OK for repeatedly-called search -// code, and it saves CPU time. -// -// 3. If Index is LESS than maxindex, check for "dense to end of leaf": -// Subtract Index from maxindex, and back up that many slots in the leaf. -// If the resulting offset is not before the start of the leaf then compare -// the index at this offset (baseindex) with Index: -// -// 3a. If GREATER, the leaf must be corrupt, since indexes are sorted and -// there are no duplicates. -// -// 3b. If EQUAL, the leaf is "dense" from Index to maxindex, meaning there is -// no reason to search it. "Slide right" to the high end of the leaf -// (modify Index to maxindex) and continue with step 2 above. -// -// 3c. If LESS, continue with step 4. -// -// 4. If the offset based on maxindex minus Index falls BEFORE the start of -// the leaf, or if, per 3c above, baseindex is LESS than Index, the leaf is -// guaranteed "not dense to the end" and a usable empty Index must exist. -// This supports a more efficient search loop. Start at the FIRST index in -// the leaf, or one BEYOND baseindex, respectively, and search the leaf as -// follows, comparing each current index (currindex) with Index: -// -// 4a. If LESS, keep going to next index. Note: This is certain to terminate -// because maxindex is known to be greater than Index, hence the loop can -// be small and fast. -// -// 4b. If EQUAL, loop and increment Index until finding currindex greater than -// Index, and return success with the modified Index. -// -// 4c. If GREATER, return success, Index (unmodified) is empty. -// -// Note: These are macros rather than functions for speed. - -#ifdef JUDYPREV - -#define JSLE_EVEN(Addr,Pop0,cDigits,LeafType) \ - { \ - LeafType * PjllLSB = (LeafType *) (Addr); \ - LeafType IndexLSB = Index; /* auto-masking */ \ - \ - /* Index before or at start of leaf: */ \ - \ - if (*PjllLSB >= IndexLSB) /* no need to search */ \ - { \ - if (*PjllLSB > IndexLSB) RET_SUCCESS; /* Index empty */ \ - LEAF_EDGE(*PjllLSB, cDigits); \ - } \ - \ - /* Index in or after leaf: */ \ - \ - offset = IndexLSB - *PjllLSB; /* tentative offset */ \ - if (offset <= (Pop0)) /* can check density */ \ - { \ - PjllLSB += offset; /* move to slot */ \ - \ - if (*PjllLSB <= IndexLSB) /* dense or corrupt */ \ - { \ - if (*PjllLSB == IndexLSB) /* dense, check edge */ \ - LEAF_EDGE_SET(PjllLSB[-offset], cDigits); \ - RET_CORRUPT; \ - } \ - --PjllLSB; /* not dense, start at previous */ \ - } \ - else PjllLSB = ((LeafType *) (Addr)) + (Pop0); /* start at max */ \ - \ - LEAF_HOLE_EVEN(cDigits, PjllLSB, IndexLSB); \ - } - -// JSLE_ODD is completely different from JSLE_EVEN because its important to -// minimize copying odd indexes to compare them (see 4.14). Furthermore, a -// very complex version (4.17, but abandoned before fully debugged) that -// avoided calling j__udySearchLeaf*() ran twice as fast as 4.14, but still -// half as fast as SearchValid. Doug suggested that to minimize complexity and -// share common code we should use j__udySearchLeaf*() for the initial search -// to establish if Index is empty, which should be common. If Index is valid -// in a leaf or immediate indexes, odds are good that an empty Index is nearby, -// so for simplicity just use a *COPY* function to linearly search the -// remainder. -// -// TBD: Pathological case? Average performance should be good, but worst-case -// might suffer. When Search says the initial Index is valid, so a linear -// copy-and-compare is begun, if the caller builds fairly large leaves with -// dense clusters AND frequently does a SearchEmpty at one end of such a -// cluster, performance wont be very good. Might a dense-check help? This -// means checking offset against the index at offset, and then against the -// first/last index in the leaf. We doubt the pathological case will appear -// much in real applications because they will probably alternate SearchValid -// and SearchEmpty calls. - -#define JSLE_ODD(cDigits,Pjll,Pop0,Search,Copy) \ - { \ - Word_t IndexLSB; /* least bytes only */ \ - Word_t IndexFound; /* in leaf */ \ - \ - if ((offset = Search(Pjll, (Pop0) + 1, Index)) < 0) \ - RET_SUCCESS; /* Index is empty */ \ - \ - IndexLSB = JU_LEASTBYTES(Index, cDigits); \ - offset *= (cDigits); \ - \ - while ((offset -= (cDigits)) >= 0) \ - { /* skip until empty or start */ \ - Copy(IndexFound, ((uint8_t *) (Pjll)) + offset); \ - if (IndexFound != (--IndexLSB)) /* found an empty */ \ - { JU_SETDIGITS(Index, IndexLSB, cDigits); RET_SUCCESS; }\ - } \ - LEAF_EDGE_SET(IndexLSB, cDigits); \ - } - -#else // JUDYNEXT - -#define JSLE_EVEN(Addr,Pop0,cDigits,LeafType) \ - { \ - LeafType * PjllLSB = ((LeafType *) (Addr)) + (Pop0); \ - LeafType IndexLSB = Index; /* auto-masking */ \ - \ - /* Index at or after end of leaf: */ \ - \ - if (*PjllLSB <= IndexLSB) /* no need to search */ \ - { \ - if (*PjllLSB < IndexLSB) RET_SUCCESS; /* Index empty */\ - LEAF_EDGE(*PjllLSB, cDigits); \ - } \ - \ - /* Index before or in leaf: */ \ - \ - offset = *PjllLSB - IndexLSB; /* tentative offset */ \ - if (offset <= (Pop0)) /* can check density */ \ - { \ - PjllLSB -= offset; /* move to slot */ \ - \ - if (*PjllLSB >= IndexLSB) /* dense or corrupt */ \ - { \ - if (*PjllLSB == IndexLSB) /* dense, check edge */ \ - LEAF_EDGE_SET(PjllLSB[offset], cDigits); \ - RET_CORRUPT; \ - } \ - ++PjllLSB; /* not dense, start at next */ \ - } \ - else PjllLSB = (LeafType *) (Addr); /* start at minimum */ \ - \ - LEAF_HOLE_EVEN(cDigits, PjllLSB, IndexLSB); \ - } - -#define JSLE_ODD(cDigits,Pjll,Pop0,Search,Copy) \ - { \ - Word_t IndexLSB; /* least bytes only */ \ - Word_t IndexFound; /* in leaf */ \ - int offsetmax; /* in bytes */ \ - \ - if ((offset = Search(Pjll, (Pop0) + 1, Index)) < 0) \ - RET_SUCCESS; /* Index is empty */ \ - \ - IndexLSB = JU_LEASTBYTES(Index, cDigits); \ - offset *= (cDigits); \ - offsetmax = (Pop0) * (cDigits); /* single multiply */ \ - \ - while ((offset += (cDigits)) <= offsetmax) \ - { /* skip until empty or end */ \ - Copy(IndexFound, ((uint8_t *) (Pjll)) + offset); \ - if (IndexFound != (++IndexLSB)) /* found an empty */ \ - { JU_SETDIGITS(Index, IndexLSB, cDigits); RET_SUCCESS; } \ - } \ - LEAF_EDGE_SET(IndexLSB, cDigits); \ - } - -#endif // JUDYNEXT - -// Note: Immediate indexes never fill a single index group, so for odd index -// sizes, save time by calling JSLE_ODD_IMM instead of JSLE_ODD. - -#define j__udySearchLeafEmpty1(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 1, uint8_t) - -#define j__udySearchLeafEmpty2(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 2, uint16_t) - -#define j__udySearchLeafEmpty3(Addr,Pop0) \ - JSLE_ODD(3, Addr, Pop0, j__udySearchLeaf3, JU_COPY3_PINDEX_TO_LONG) - -#ifndef JU_64BIT - -#define j__udySearchLeafEmptyL(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 4, Word_t) - -#else - -#define j__udySearchLeafEmpty4(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 4, uint32_t) - -#define j__udySearchLeafEmpty5(Addr,Pop0) \ - JSLE_ODD(5, Addr, Pop0, j__udySearchLeaf5, JU_COPY5_PINDEX_TO_LONG) - -#define j__udySearchLeafEmpty6(Addr,Pop0) \ - JSLE_ODD(6, Addr, Pop0, j__udySearchLeaf6, JU_COPY6_PINDEX_TO_LONG) - -#define j__udySearchLeafEmpty7(Addr,Pop0) \ - JSLE_ODD(7, Addr, Pop0, j__udySearchLeaf7, JU_COPY7_PINDEX_TO_LONG) - -#define j__udySearchLeafEmptyL(Addr,Pop0) \ - JSLE_EVEN(Addr, Pop0, 8, Word_t) - -#endif // JU_64BIT - - -// ---------------------------------------------------------------------------- -// START OF CODE: -// -// CHECK FOR SHORTCUTS: -// -// Error out if PIndex is null. - - if (PIndex == (PWord_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return(JERRI); - } - - Index = *PIndex; // fast local copy. - -// Set and pre-decrement/increment Index, watching for underflow/overflow: -// -// An out-of-bounds Index means failure: No previous/next empty index. - -SMGetRestart: // return here with revised Index. - -#ifdef JUDYPREV - if (Index-- == 0) return(0); -#else - if (++Index == 0) return(0); -#endif - -// An empty array with an in-bounds (not underflowed/overflowed) Index means -// success: -// -// Note: This check is redundant after restarting at SMGetRestart, but should -// take insignificant time. - - if (PArray == (Pvoid_t) NULL) RET_SUCCESS; - -// ---------------------------------------------------------------------------- -// ROOT-LEVEL LEAF that starts with a Pop0 word; just look within the leaf: -// -// If Index is not in the leaf, return success; otherwise return the first -// empty Index, if any, below/above where it would belong. - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - pop0 = Pjlw[0]; - -#ifdef JUDY1 - if (pop0 == 0) // special case. - { -#ifdef JUDYPREV - if ((Index != Pjlw[1]) || (Index-- != 0)) RET_SUCCESS; -#else - if ((Index != Pjlw[1]) || (++Index != 0)) RET_SUCCESS; -#endif - return(0); // no previous/next empty index. - } -#endif // JUDY1 - - j__udySearchLeafEmptyL(Pjlw + 1, pop0); - -// No return -- thanks ALAN - - } - else - -// ---------------------------------------------------------------------------- -// HANDLE JRP Branch: -// -// For JRP branches, traverse the JPM; handle LEAFW -// directly; but look for the most common cases first. - - { - Pjpm_t Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); - -// goto SMGetContinue; - } - - -// ============================================================================ -// STATE MACHINE -- GET INDEX: -// -// Search for Index (already decremented/incremented so as to be an inclusive -// search). If not found (empty index), return success. Otherwise do a -// previous/next search, and if successful modify Index to the empty index -// found. See function header comments. -// -// ENTRY: Pjp points to next JP to interpret, whose Decode bytes have not yet -// been checked. -// -// Note: Check Decode bytes at the start of each loop, not after looking up a -// new JP, so its easy to do constant shifts/masks. -// -// EXIT: Return, or branch to SMGetRestart with modified Index, or branch to -// SMGetContinue with a modified Pjp, as described elsewhere. -// -// WARNING: For run-time efficiency the following cases replicate code with -// varying constants, rather than using common code with variable values! - -SMGetContinue: // return here for next branch/leaf. - -#ifdef TRACEJPSE - JudyPrintJP(Pjp, "sf", __LINE__); -#endif - - switch (JU_JPTYPE(Pjp)) - { - - -// ---------------------------------------------------------------------------- -// LINEAR BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_L2: CHECKDCD(2); SMPREPB2(SMBranchL); - case cJU_JPBRANCH_L3: CHECKDCD(3); SMPREPB3(SMBranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: CHECKDCD(4); SMPREPB4(SMBranchL); - case cJU_JPBRANCH_L5: CHECKDCD(5); SMPREPB5(SMBranchL); - case cJU_JPBRANCH_L6: CHECKDCD(6); SMPREPB6(SMBranchL); - case cJU_JPBRANCH_L7: CHECKDCD(7); SMPREPB7(SMBranchL); -#endif - case cJU_JPBRANCH_L: SMPREPBL(SMBranchL); - -// Common code (state-independent) for all cases of linear branches: - -SMBranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - -// First, check if Indexs expanse (digit) is below/above the first/last -// populated expanse in the BranchL, in which case Index is empty; otherwise -// find the offset of the lowest/highest populated expanse at or above/below -// digit, if any: -// -// Note: The for-loop is guaranteed to exit eventually because the first/last -// expanse is known to be a terminator. -// -// Note: Cannot use j__udySearchLeaf*Empty1() here because it only applies to -// leaves and does not know about partial versus full JPs, unlike the use of -// j__udySearchLeaf1() for BranchLs in SearchValid code. Also, since linear -// leaf expanse lists are small, dont waste time calling j__udySearchLeaf1(), -// just scan the expanse list. - -#ifdef JUDYPREV - if ((Pjbl->jbl_Expanse[0]) > digit) RET_SUCCESS; - - for (offset = (Pjbl->jbl_NumJPs) - 1; /* null */; --offset) -#else - if ((Pjbl->jbl_Expanse[(Pjbl->jbl_NumJPs) - 1]) < digit) - RET_SUCCESS; - - for (offset = 0; /* null */; ++offset) -#endif - { - -// Too low/high, keep going; or too high/low, meaning the loop passed a hole -// and the initial Index is empty: - -#ifdef JUDYPREV - if ((Pjbl->jbl_Expanse[offset]) > digit) continue; - if ((Pjbl->jbl_Expanse[offset]) < digit) RET_SUCCESS; -#else - if ((Pjbl->jbl_Expanse[offset]) < digit) continue; - if ((Pjbl->jbl_Expanse[offset]) > digit) RET_SUCCESS; -#endif - -// Found expanse matching digit; if its not full, traverse through it: - - if (! JPFULL((Pjbl->jbl_jp) + offset)) - { - Pjp = (Pjbl->jbl_jp) + offset; - goto SMGetContinue; - } - -// Common code: While searching for a lower/higher hole or a non-full JP, upon -// finding a lower/higher hole, adjust Index using the revised digit and -// return; or upon finding a consecutive lower/higher expanse, if the expanses -// JP is non-full, modify Index and traverse through the JP: - -#define BRANCHL_CHECK(OpIncDec,OpLeastDigits,Digit,Digits) \ - { \ - if ((Pjbl->jbl_Expanse[offset]) != OpIncDec digit) \ - SET_AND_RETURN(OpLeastDigits, Digit, Digits); \ - \ - if (! JPFULL((Pjbl->jbl_jp) + offset)) \ - { \ - Pjp = (Pjbl->jbl_jp) + offset; \ - SET_AND_CONTINUE(OpLeastDigits, Digit, Digits); \ - } \ - } - -// BranchL primary dead end: Expanse matching Index/digit is full (rare except -// for dense/sequential indexes): -// -// Search for a lower/higher hole, a non-full JP, or the end of the expanse -// list, while decrementing/incrementing digit. - -#ifdef JUDYPREV - while (--offset >= 0) - BRANCHL_CHECK(--, SETLEASTDIGITS_D, digit, digits) -#else - while (++offset < Pjbl->jbl_NumJPs) - BRANCHL_CHECK(++, CLEARLEASTDIGITS_D, digit, digits) -#endif - -// Passed end of BranchL expanse list after finding a matching but full -// expanse: -// -// Digit now matches the lowest/highest expanse, which is a full expanse; if -// digit is at the end of BranchLs expanse (no hole before/after), break out -// of the loop; otherwise modify Index to the next lower/higher digit and -// return success: - -#ifdef JUDYPREV - if (digit == 0) break; - --digit; SET_AND_RETURN(SETLEASTDIGITS_D, digit, digits); -#else - if (digit == JU_LEASTBYTES(cJU_ALLONES, 1)) break; - ++digit; SET_AND_RETURN(CLEARLEASTDIGITS_D, digit, digits); -#endif - } // for-loop - -// BranchL secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// BITMAP BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_B2: CHECKDCD(2); SMPREPB2(SMBranchB); - case cJU_JPBRANCH_B3: CHECKDCD(3); SMPREPB3(SMBranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: CHECKDCD(4); SMPREPB4(SMBranchB); - case cJU_JPBRANCH_B5: CHECKDCD(5); SMPREPB5(SMBranchB); - case cJU_JPBRANCH_B6: CHECKDCD(6); SMPREPB6(SMBranchB); - case cJU_JPBRANCH_B7: CHECKDCD(7); SMPREPB7(SMBranchB); -#endif - case cJU_JPBRANCH_B: SMPREPBL(SMBranchB); - -// Common code (state-independent) for all cases of bitmap branches: - -SMBranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - -// Locate the digits JP in the subexpanse list, if present: - - subexp = digit / cJU_BITSPERSUBEXPB; - assert(subexp < cJU_NUMSUBEXPB); // falls in expected range. - bitposmaskB = JU_BITPOSMASKB(digit); - -// Absent JP = no JP matches current digit in Index: - -// if (! JU_BITMAPTESTB(Pjbb, digit)) // slower. - if (! (JU_JBB_BITMAP(Pjbb, subexp) & bitposmaskB)) // faster. - RET_SUCCESS; - -// Non-full JP matches current digit in Index: -// -// Iterate to the subsidiary non-full JP. - - offset = SEARCHBITMAPB(JU_JBB_BITMAP(Pjbb, subexp), digit, - bitposmaskB); - // not negative since at least one bit is set: - assert(offset >= 0); - assert(offset < (int) cJU_BITSPERSUBEXPB); - -// Watch for null JP subarray pointer with non-null bitmap (a corruption): - - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) - == (Pjp_t) NULL) RET_CORRUPT; - - Pjp += offset; - if (! JPFULL(Pjp)) goto SMGetContinue; - -// BranchB primary dead end: -// -// Upon hitting a full JP in a BranchB for the next digit in Index, search -// sideways for a previous/next absent JP (unset bit) or non-full JP (set bit -// with non-full JP); first in the current bitmap subexpanse, then in -// lower/higher subexpanses. Upon entry, Pjp points to a known-unusable JP, -// ready to decrement/increment. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. -// -// TBD: For speed, shift bitposmaskB instead of using JU_BITMAPTESTB or -// JU_BITPOSMASKB, but this shift has knowledge of bit order that really should -// be encapsulated in a header file. - -#define BRANCHB_CHECKBIT(OpLeastDigits) \ - if (! (JU_JBB_BITMAP(Pjbb, subexp) & bitposmaskB)) /* absent JP */ \ - SET_AND_RETURN(OpLeastDigits, digit, digits) - -#define BRANCHB_CHECKJPFULL(OpLeastDigits) \ - if (! JPFULL(Pjp)) \ - SET_AND_CONTINUE(OpLeastDigits, digit, digits) - -#define BRANCHB_STARTSUBEXP(OpLeastDigits) \ - if (! JU_JBB_BITMAP(Pjbb, subexp)) /* empty subexpanse, shortcut */ \ - SET_AND_RETURN(OpLeastDigits, digit, digits) \ - if ((Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp))) == (Pjp_t) NULL) RET_CORRUPT - -#ifdef JUDYPREV - - --digit; // skip initial digit. - bitposmaskB >>= 1; // see TBD above. - -BranchBNextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskB) // more bits to check in subexp. - { - BRANCHB_CHECKBIT(SETLEASTDIGITS_D); - --Pjp; // previous in subarray. - BRANCHB_CHECKJPFULL(SETLEASTDIGITS_D); - assert(digit >= 0); - --digit; - bitposmaskB >>= 1; - } - - if (subexp-- > 0) // more subexpanses. - { - BRANCHB_STARTSUBEXP(SETLEASTDIGITS_D); - Pjp += SEARCHBITMAPMAXB(JU_JBB_BITMAP(Pjbb, subexp)) + 1; - bitposmaskB = (1U << (cJU_BITSPERSUBEXPB - 1)); - goto BranchBNextSubexp; - } - -#else // JUDYNEXT - - ++digit; // skip initial digit. - bitposmaskB <<= 1; // note: BITMAPB_t. - -BranchBNextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskB) // more bits to check in subexp. - { - BRANCHB_CHECKBIT(CLEARLEASTDIGITS_D); - ++Pjp; // previous in subarray. - BRANCHB_CHECKJPFULL(CLEARLEASTDIGITS_D); - assert(digit < cJU_SUBEXPPERSTATE); - ++digit; - bitposmaskB <<= 1; // note: BITMAPB_t. - } - - if (++subexp < cJU_NUMSUBEXPB) // more subexpanses. - { - BRANCHB_STARTSUBEXP(CLEARLEASTDIGITS_D); - --Pjp; // pre-decrement. - bitposmaskB = 1; - goto BranchBNextSubexp; - } - -#endif // JUDYNEXT - -// BranchB secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// UNCOMPRESSED BRANCH: -// -// Check Decode bytes, if any, in the current JP, then search for a JP for the -// next digit in Index. - - case cJU_JPBRANCH_U2: CHECKDCD(2); SMPREPB2(SMBranchU); - case cJU_JPBRANCH_U3: CHECKDCD(3); SMPREPB3(SMBranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: CHECKDCD(4); SMPREPB4(SMBranchU); - case cJU_JPBRANCH_U5: CHECKDCD(5); SMPREPB5(SMBranchU); - case cJU_JPBRANCH_U6: CHECKDCD(6); SMPREPB6(SMBranchU); - case cJU_JPBRANCH_U7: CHECKDCD(7); SMPREPB7(SMBranchU); -#endif - case cJU_JPBRANCH_U: SMPREPBL(SMBranchU); - -// Common code (state-independent) for all cases of uncompressed branches: - -SMBranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - Pjp = (Pjbu->jbu_jp) + digit; - -// Absent JP = null JP for current digit in Index: - - if (JPNULL(JU_JPTYPE(Pjp))) RET_SUCCESS; - -// Non-full JP matches current digit in Index: -// -// Iterate to the subsidiary JP. - - if (! JPFULL(Pjp)) goto SMGetContinue; - -// BranchU primary dead end: -// -// Upon hitting a full JP in a BranchU for the next digit in Index, search -// sideways for a previous/next null or non-full JP. BRANCHU_CHECKJP() is -// shorthand for common code. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. - -#define BRANCHU_CHECKJP(OpIncDec,OpLeastDigits) \ - { \ - OpIncDec Pjp; \ - \ - if (JPNULL(JU_JPTYPE(Pjp))) \ - SET_AND_RETURN(OpLeastDigits, digit, digits) \ - \ - if (! JPFULL(Pjp)) \ - SET_AND_CONTINUE(OpLeastDigits, digit, digits) \ - } - -#ifdef JUDYPREV - while (digit-- > 0) - BRANCHU_CHECKJP(--, SETLEASTDIGITS_D); -#else - while (++digit < cJU_BRANCHUNUMJPS) - BRANCHU_CHECKJP(++, CLEARLEASTDIGITS_D); -#endif - -// BranchU secondary dead end, no non-full previous/next JP: - - SMRESTART(digits); - - -// ---------------------------------------------------------------------------- -// LINEAR LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for the -// previous/next empty index starting at Index. Primary leaf dead end is -// hidden within j__udySearchLeaf*Empty*(). In case of secondary leaf dead -// end, restart at the top of the tree. -// -// Note: Pword is the name known to GET*; think of it as Pjlw. - -#define SMLEAFL(cDigits,Func) \ - Pword = (PWord_t) P_JLW(Pjp->jp_Addr); \ - pop0 = JU_JPLEAF_POP0(Pjp); \ - Func(Pword, pop0) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKDCD(1); SMLEAFL(1, j__udySearchLeafEmpty1); -#endif - case cJU_JPLEAF2: CHECKDCD(2); SMLEAFL(2, j__udySearchLeafEmpty2); - case cJU_JPLEAF3: CHECKDCD(3); SMLEAFL(3, j__udySearchLeafEmpty3); - -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKDCD(4); SMLEAFL(4, j__udySearchLeafEmpty4); - case cJU_JPLEAF5: CHECKDCD(5); SMLEAFL(5, j__udySearchLeafEmpty5); - case cJU_JPLEAF6: CHECKDCD(6); SMLEAFL(6, j__udySearchLeafEmpty6); - case cJU_JPLEAF7: CHECKDCD(7); SMLEAFL(7, j__udySearchLeafEmpty7); -#endif - - -// ---------------------------------------------------------------------------- -// BITMAP LEAF: -// -// Check Decode bytes, if any, in the current JP, then search the leaf for the -// previous/next empty index starting at Index. - - case cJU_JPLEAF_B1: - - CHECKDCD(1); - - Pjlb = P_JLB(Pjp->jp_Addr); - digit = JU_DIGITATSTATE(Index, 1); - subexp = digit / cJU_BITSPERSUBEXPL; - bitposmaskL = JU_BITPOSMASKL(digit); - assert(subexp < cJU_NUMSUBEXPL); // falls in expected range. - -// Absent index = no index matches current digit in Index: - -// if (! JU_BITMAPTESTL(Pjlb, digit)) // slower. - if (! (JU_JLB_BITMAP(Pjlb, subexp) & bitposmaskL)) // faster. - RET_SUCCESS; - -// LeafB1 primary dead end: -// -// Upon hitting a valid (non-empty) index in a LeafB1 for the last digit in -// Index, search sideways for a previous/next absent index, first in the -// current bitmap subexpanse, then in lower/higher subexpanses. -// LEAFB1_CHECKBIT() is shorthand for common code to handle one bit in one -// bitmap subexpanse. -// -// Note: The preceding code is separate from this loop because Index does not -// need revising (see SET_AND_*()) if the initial index is an empty index. -// -// TBD: For speed, shift bitposmaskL instead of using JU_BITMAPTESTL or -// JU_BITPOSMASKL, but this shift has knowledge of bit order that really should -// be encapsulated in a header file. - -#define LEAFB1_CHECKBIT(OpLeastDigits) \ - if (! (JU_JLB_BITMAP(Pjlb, subexp) & bitposmaskL)) \ - SET_AND_RETURN(OpLeastDigits, digit, 1) - -#define LEAFB1_STARTSUBEXP(OpLeastDigits) \ - if (! JU_JLB_BITMAP(Pjlb, subexp)) /* empty subexp */ \ - SET_AND_RETURN(OpLeastDigits, digit, 1) - -#ifdef JUDYPREV - - --digit; // skip initial digit. - bitposmaskL >>= 1; // see TBD above. - -LeafB1NextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskL) // more bits to check in subexp. - { - LEAFB1_CHECKBIT(SETLEASTDIGITS_D); - assert(digit >= 0); - --digit; - bitposmaskL >>= 1; - } - - if (subexp-- > 0) // more subexpanses. - { - LEAFB1_STARTSUBEXP(SETLEASTDIGITS_D); - bitposmaskL = (1UL << (cJU_BITSPERSUBEXPL - 1)); - goto LeafB1NextSubexp; - } - -#else // JUDYNEXT - - ++digit; // skip initial digit. - bitposmaskL <<= 1; // note: BITMAPL_t. - -LeafB1NextSubexp: // return here to check next bitmap subexpanse. - - while (bitposmaskL) // more bits to check in subexp. - { - LEAFB1_CHECKBIT(CLEARLEASTDIGITS_D); - assert(digit < cJU_SUBEXPPERSTATE); - ++digit; - bitposmaskL <<= 1; // note: BITMAPL_t. - } - - if (++subexp < cJU_NUMSUBEXPL) // more subexpanses. - { - LEAFB1_STARTSUBEXP(CLEARLEASTDIGITS_D); - bitposmaskL = 1; - goto LeafB1NextSubexp; - } - -#endif // JUDYNEXT - -// LeafB1 secondary dead end, no empty index: - - SMRESTART(1); - - -#ifdef JUDY1 -// ---------------------------------------------------------------------------- -// FULL POPULATION: -// -// If the Decode bytes do not match, Index is empty (without modification); -// otherwise restart. - - case cJ1_JPFULLPOPU1: - - CHECKDCD(1); - SMRESTART(1); -#endif - - -// ---------------------------------------------------------------------------- -// IMMEDIATE: -// -// Pop1 = 1 Immediate JPs: -// -// If Index is not in the immediate JP, return success; otherwise check if -// there is an empty index below/above the immediate JPs index, and if so, -// return success with modified Index, else restart. -// -// Note: Doug says its fast enough to calculate the index size (digits) in -// the following; no need to set it separately for each case. - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - if (JU_JPDCDPOP0(Pjp) != JU_TRIMTODCDSIZE(Index)) RET_SUCCESS; - digits = JU_JPTYPE(Pjp) - cJU_JPIMMED_1_01 + 1; - LEAF_EDGE(JU_LEASTBYTES(JU_JPDCDPOP0(Pjp), digits), digits); - -// Immediate JPs with Pop1 > 1: - -#define IMM_MULTI(Func,BaseJPType) \ - JUDY1CODE(Pword = (PWord_t) (Pjp->jp_1Index);) \ - JUDYLCODE(Pword = (PWord_t) (Pjp->jp_LIndex);) \ - Func(Pword, JU_JPTYPE(Pjp) - (BaseJPType) + 1) - - case cJU_JPIMMED_1_02: - case cJU_JPIMMED_1_03: -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: - case cJU_JPIMMED_1_05: - case cJU_JPIMMED_1_06: - case cJU_JPIMMED_1_07: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: - case cJ1_JPIMMED_1_09: - case cJ1_JPIMMED_1_10: - case cJ1_JPIMMED_1_11: - case cJ1_JPIMMED_1_12: - case cJ1_JPIMMED_1_13: - case cJ1_JPIMMED_1_14: - case cJ1_JPIMMED_1_15: -#endif - IMM_MULTI(j__udySearchLeafEmpty1, cJU_JPIMMED_1_02); - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: - case cJU_JPIMMED_2_03: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: - case cJ1_JPIMMED_2_05: - case cJ1_JPIMMED_2_06: - case cJ1_JPIMMED_2_07: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - IMM_MULTI(j__udySearchLeafEmpty2, cJU_JPIMMED_2_02); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: - case cJ1_JPIMMED_3_04: - case cJ1_JPIMMED_3_05: -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - IMM_MULTI(j__udySearchLeafEmpty3, cJU_JPIMMED_3_02); -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_4_02: - case cJ1_JPIMMED_4_03: - IMM_MULTI(j__udySearchLeafEmpty4, cJ1_JPIMMED_4_02); - - case cJ1_JPIMMED_5_02: - case cJ1_JPIMMED_5_03: - IMM_MULTI(j__udySearchLeafEmpty5, cJ1_JPIMMED_5_02); - - case cJ1_JPIMMED_6_02: - IMM_MULTI(j__udySearchLeafEmpty6, cJ1_JPIMMED_6_02); - - case cJ1_JPIMMED_7_02: - IMM_MULTI(j__udySearchLeafEmpty7, cJ1_JPIMMED_7_02); -#endif - - -// ---------------------------------------------------------------------------- -// INVALID JP TYPE: - - default: RET_CORRUPT; - - } // SMGet switch. - -} // Judy1PrevEmpty() / Judy1NextEmpty() / JudyLPrevEmpty() / JudyLNextEmpty() diff --git a/libjudy/src/JudyL/JudyLTablesGen.c b/libjudy/src/JudyL/JudyLTablesGen.c deleted file mode 100644 index 5b6009f0b7..0000000000 --- a/libjudy/src/JudyL/JudyLTablesGen.c +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.37 $ $Source: /judy/src/JudyCommon/JudyTables.c $ - -#ifndef JU_WIN -#include // unavailable on win_*. -#endif - -#include -#include - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#define TERMINATOR 999 // terminator for Alloc tables - -#define BPW sizeof(Word_t) // define bytes per word - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -FILE *fd; - -// Definitions come from header files Judy1.h and JudyL.h: - -int AllocSizes[] = ALLOCSIZES; - -#define ROUNDUP(BYTES,BPW,OFFSETW) \ - ((((BYTES) + (BPW) - 1) / (BPW)) + (OFFSETW)) - - -// **************************************************************************** -// G E N T A B L E -// -// Note: "const" is required for newer compilers. - -FUNCTION void GenTable( - const char * TableName, // name of table string - const char * TableSize, // dimentioned size string - int IndexBytes, // bytes per Index - int LeafSize, // number elements in object - int ValueBytes, // bytes per Value - int OffsetWords) // 1 for LEAFW -{ - int * PAllocSizes = AllocSizes; - int OWord; - int CurWord; - int IWord; - int ii; - int BytesOfIndex; - int BytesOfObject; - int Index; - int LastWords; - int Words [1000] = { 0 }; - int Offset[1000] = { 0 }; - int MaxWords; - - MaxWords = ROUNDUP((IndexBytes + ValueBytes) * LeafSize, BPW, OffsetWords); - Words[0] = 0; - Offset[0] = 0; - CurWord = TERMINATOR; - -// Walk through all number of Indexes in table: - - for (Index = 1; /* null */; ++Index) - { - -// Calculate byte required for next size: - - BytesOfIndex = IndexBytes * Index; - BytesOfObject = (IndexBytes + ValueBytes) * Index; - -// Round up and calculate words required for next size: - - OWord = ROUNDUP(BytesOfObject, BPW, OffsetWords); - IWord = ROUNDUP(BytesOfIndex, BPW, OffsetWords); - -// Root-level leaves of population of 1 and 2 do not have the 1 word offset: - -// Save minimum value of offset: - - Offset[Index] = IWord; - -// Round up to next available size of words: - - while (OWord > *PAllocSizes) PAllocSizes++; - - if (Index == LeafSize) - { - CurWord = Words[Index] = OWord; - break; - } -// end of available sizes ? - - if (*PAllocSizes == TERMINATOR) - { - fprintf(stderr, "BUG, in %sPopToWords, sizes not big enough for object\n", TableName); - exit(1); - } - -// Save words required and last word: - - if (*PAllocSizes < MaxWords) { CurWord = Words[Index] = *PAllocSizes; } - else { CurWord = Words[Index] = MaxWords; } - - } // for each index - - LastWords = TERMINATOR; - -// Round up to largest size in each group of malloc sizes: - - for (ii = LeafSize; ii > 0; ii--) - { - if (LastWords > (Words[ii] - ii)) LastWords = Offset[ii]; - else Offset[ii] = LastWords; - } - -// Print the PopToWords[] table: - - fprintf(fd,"\n//\tobject uses %d words\n", CurWord); - fprintf(fd,"//\t%s = %d\n", TableSize, LeafSize); - - fprintf(fd,"const uint8_t\n"); - fprintf(fd,"%sPopToWords[%s + 1] =\n", TableName, TableSize); - fprintf(fd,"{\n\t 0,"); - - for (ii = 1; ii <= LeafSize; ii++) - { - -// 8 columns per line, starting with 1: - - if ((ii % 8) == 1) fprintf(fd,"\n\t"); - - fprintf(fd,"%2d", Words[ii]); - -// If not last number place comma: - - if (ii != LeafSize) fprintf(fd,", "); - } - fprintf(fd,"\n};\n"); - -// Print the Offset table if needed: - - if (! ValueBytes) return; - - fprintf(fd,"const uint8_t\n"); - fprintf(fd,"%sOffset[%s + 1] =\n", TableName, TableSize); - fprintf(fd,"{\n"); - fprintf(fd,"\t 0,"); - - for (ii = 1; ii <= LeafSize; ii++) - { - if ((ii % 8) == 1) fprintf(fd,"\n\t"); - - fprintf(fd,"%2d", Offset[ii]); - - if (ii != LeafSize) fprintf(fd,", "); - } - fprintf(fd,"\n};\n"); - -} // GenTable() - - -// **************************************************************************** -// M A I N - -FUNCTION int main() -{ - int ii; - -#ifdef JUDY1 - char *fname = "Judy1Tables.c"; -#else - char *fname = "JudyLTables.c"; -#endif - - if ((fd = fopen(fname, "w")) == NULL){ - perror("FATAL ERROR: could not write to Judy[1L]Tables.c file\n"); - return (-1); - } - - - fprintf(fd,"// @(#) From generation tool: $Revision: 4.37 $ $Source: /judy/src/JudyCommon/JudyTables.c $\n"); - fprintf(fd,"//\n\n"); - - -// ================================ Judy1 ================================= -#ifdef JUDY1 - - fprintf(fd,"#include \"Judy1.h\"\n"); - - fprintf(fd,"// Leave the malloc() sizes readable in the binary (via " - "strings(1)):\n"); - fprintf(fd,"const char * Judy1MallocSizes = \"Judy1MallocSizes ="); - - for (ii = 0; AllocSizes[ii] != TERMINATOR; ii++) - fprintf(fd," %d,", AllocSizes[ii]); - -#ifndef JU_64BIT - fprintf(fd," Leaf1 = %d\";\n\n", cJ1_LEAF1_MAXPOP1); -#else - fprintf(fd,"\";\n\n"); // no Leaf1 in this case. -#endif - -// ================================ 32 bit ================================ -#ifndef JU_64BIT - - GenTable("j__1_BranchBJP","cJU_BITSPERSUBEXPB", 8, cJU_BITSPERSUBEXPB,0,0); - - GenTable("j__1_Leaf1", "cJ1_LEAF1_MAXPOP1", 1, cJ1_LEAF1_MAXPOP1, 0, 0); - GenTable("j__1_Leaf2", "cJ1_LEAF2_MAXPOP1", 2, cJ1_LEAF2_MAXPOP1, 0, 0); - GenTable("j__1_Leaf3", "cJ1_LEAF3_MAXPOP1", 3, cJ1_LEAF3_MAXPOP1, 0, 0); - GenTable("j__1_LeafW", "cJ1_LEAFW_MAXPOP1", 4, cJ1_LEAFW_MAXPOP1, 0, 1); - -#endif - -// ================================ 64 bit ================================ -#ifdef JU_64BIT - GenTable("j__1_BranchBJP","cJU_BITSPERSUBEXPB",16, cJU_BITSPERSUBEXPB,0,0); - - GenTable("j__1_Leaf2", "cJ1_LEAF2_MAXPOP1", 2, cJ1_LEAF2_MAXPOP1, 0, 0); - GenTable("j__1_Leaf3", "cJ1_LEAF3_MAXPOP1", 3, cJ1_LEAF3_MAXPOP1, 0, 0); - GenTable("j__1_Leaf4", "cJ1_LEAF4_MAXPOP1", 4, cJ1_LEAF4_MAXPOP1, 0, 0); - GenTable("j__1_Leaf5", "cJ1_LEAF5_MAXPOP1", 5, cJ1_LEAF5_MAXPOP1, 0, 0); - GenTable("j__1_Leaf6", "cJ1_LEAF6_MAXPOP1", 6, cJ1_LEAF6_MAXPOP1, 0, 0); - GenTable("j__1_Leaf7", "cJ1_LEAF7_MAXPOP1", 7, cJ1_LEAF7_MAXPOP1, 0, 0); - GenTable("j__1_LeafW", "cJ1_LEAFW_MAXPOP1", 8, cJ1_LEAFW_MAXPOP1, 0, 1); -#endif -#endif // JUDY1 - - -// ================================ JudyL ================================= -#ifdef JUDYL - - fprintf(fd,"#include \"JudyL.h\"\n"); - - fprintf(fd,"// Leave the malloc() sizes readable in the binary (via " - "strings(1)):\n"); - fprintf(fd,"const char * JudyLMallocSizes = \"JudyLMallocSizes ="); - - for (ii = 0; AllocSizes[ii] != TERMINATOR; ii++) - fprintf(fd," %d,", AllocSizes[ii]); - - fprintf(fd," Leaf1 = %ld\";\n\n", (Word_t)cJL_LEAF1_MAXPOP1); - -#ifndef JU_64BIT -// ================================ 32 bit ================================ - GenTable("j__L_BranchBJP","cJU_BITSPERSUBEXPB", 8, cJU_BITSPERSUBEXPB, 0,0); - - GenTable("j__L_Leaf1", "cJL_LEAF1_MAXPOP1", 1, cJL_LEAF1_MAXPOP1, BPW,0); - GenTable("j__L_Leaf2", "cJL_LEAF2_MAXPOP1", 2, cJL_LEAF2_MAXPOP1, BPW,0); - GenTable("j__L_Leaf3", "cJL_LEAF3_MAXPOP1", 3, cJL_LEAF3_MAXPOP1, BPW,0); - GenTable("j__L_LeafW", "cJL_LEAFW_MAXPOP1", 4, cJL_LEAFW_MAXPOP1, BPW,1); - GenTable("j__L_LeafV", "cJU_BITSPERSUBEXPL", 4, cJU_BITSPERSUBEXPL, 0,0); -#endif // 32 BIT - -#ifdef JU_64BIT -// ================================ 64 bit ================================ - GenTable("j__L_BranchBJP","cJU_BITSPERSUBEXPB",16, cJU_BITSPERSUBEXPB, 0,0); - - GenTable("j__L_Leaf1", "cJL_LEAF1_MAXPOP1", 1, cJL_LEAF1_MAXPOP1, BPW,0); - GenTable("j__L_Leaf2", "cJL_LEAF2_MAXPOP1", 2, cJL_LEAF2_MAXPOP1, BPW,0); - GenTable("j__L_Leaf3", "cJL_LEAF3_MAXPOP1", 3, cJL_LEAF3_MAXPOP1, BPW,0); - GenTable("j__L_Leaf4", "cJL_LEAF4_MAXPOP1", 4, cJL_LEAF4_MAXPOP1, BPW,0); - GenTable("j__L_Leaf5", "cJL_LEAF5_MAXPOP1", 5, cJL_LEAF5_MAXPOP1, BPW,0); - GenTable("j__L_Leaf6", "cJL_LEAF6_MAXPOP1", 6, cJL_LEAF6_MAXPOP1, BPW,0); - GenTable("j__L_Leaf7", "cJL_LEAF7_MAXPOP1", 7, cJL_LEAF7_MAXPOP1, BPW,0); - GenTable("j__L_LeafW", "cJL_LEAFW_MAXPOP1", 8, cJL_LEAFW_MAXPOP1, BPW,1); - GenTable("j__L_LeafV", "cJU_BITSPERSUBEXPL", 8, cJU_BITSPERSUBEXPL, 0,0); -#endif // 64 BIT - -#endif // JUDYL - fclose(fd); - - return(0); - -} // main() diff --git a/libjudy/src/JudyL/Makefile.in b/libjudy/src/JudyL/Makefile.in deleted file mode 100644 index ae386b0cfa..0000000000 --- a/libjudy/src/JudyL/Makefile.in +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright (C) 2006 Imperial College London and others. -# -# Please see the AUTHORS file in the main source directory for a full list -# of copyright holders. -# -# Prof. C Pain -# Applied Modelling and Computation Group -# Department of Earth Science and Engineering -# Imperial College London -# -# amcgsoftware@imperial.ac.uk -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation, -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA - -SHELL = @SHELL@ - -PACKAGE_NAME = @PACKAGE_NAME@ -FLUIDITY = $(PACKAGE_NAME) - -MPIF90 = @MPIF90@ - -CC = @CC@ -CFLAGS = @CPPFLAGS@ @CFLAGS@ @JUDY_CFLAGS@ -I../include -I/usr/local/include -I.. -I../JudyCommon -DJUDYL - -MAKE = @MAKE@ - -LIBS = -L../lib -l$(FLUIDITY) @LIBS@ @BLAS_LIBS@ - -OBJS = JudyLByCount.o JudyLCount.o JudyLDecascade.o JudyLFirst.o j__udyLGet.o JudyLInsArray.o JudyLInsertBranch.o JudyLMemActive.o JudyLNext.o JudyLPrev.o JudyLTables.o \ - JudyLCascade.o JudyLCreateBranch.o JudyLDel.o JudyLFreeArray.o JudyLGet.o JudyLIns.o JudyLMallocIF.o JudyLMemUsed.o JudyLNextEmpty.o JudyLPrevEmpty.o - -.SUFFIXES: .f90 .F90 .cpp .c .o .a - -# cancel implicit rule that tries to make .o from .mod with m2c: -%.o: %.mod - -default: $(OBJS) - cp *.o ../obj/ - -.c.o: - @echo " CC $<" - $(CC) $(CFLAGS) -c $< - -j__udyLTest.o: j__udyLTest.c - @echo " CC $<" - $(CC) $(CFLAGS) -DJUDYGETINLINE -c $< - -JudyLNext.o: JudyLNext.c - @echo " CC $<" - $(CC) $(CFLAGS) -DJUDYNEXT -c $< - -JudyLNextEmpty.o: JudyLNextEmpty.c - @echo " CC $<" - $(CC) $(CFLAGS) -DJUDYNEXT -c $< - -JudyLPrev.o: JudyLPrev.c - @echo " CC $<" - $(CC) $(CFLAGS) -DJUDYPREV -c $< - -JudyLPrevEmpty.o: JudyLPrevEmpty.c - @echo " CC $<" - $(CC) $(CFLAGS) -DJUDYPREV -c $< - -JudyLByCount.o: JudyLByCount.c - @echo " CC $<" - $(CC) $(CFLAGS) -DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB -c $< - -JudyLTables.o: JudyLTables.c - @echo " CC $<" - $(CC) $(CFLAGS) -c $< - -JudyLTables.c: - $(CC) $(CFLAGS) -DJUDYL JudyLTablesGen.c -o JudyLTablesGen - ./JudyLTablesGen - -clean: - rm -f *.o - rm -f JudyLTables.c diff --git a/libjudy/src/JudyL/README b/libjudy/src/JudyL/README deleted file mode 100644 index bac5d511ca..0000000000 --- a/libjudy/src/JudyL/README +++ /dev/null @@ -1,8 +0,0 @@ -# @(#) $Revision: 4.19 $ $Source: /judy/src/JudyL/README $ -# -# This tree contains sources for the JudyL*() functions. -# - -JudyL.h - -lint.waivers see usage in makefile diff --git a/libjudy/src/JudyL/j__udyLGet.c b/libjudy/src/JudyL/j__udyLGet.c deleted file mode 100644 index 0bb9971cc8..0000000000 --- a/libjudy/src/JudyL/j__udyLGet.c +++ /dev/null @@ -1,1094 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.43 $ $Source: /judy/src/JudyCommon/JudyGet.c $ -// -// Judy1Test() and JudyLGet() functions for Judy1 and JudyL. -// Compile with one of -DJUDY1 or -DJUDYL. - -#if (! (defined(JUDY1) || defined(JUDYL))) -#error: One of -DJUDY1 or -DJUDYL must be specified. -#endif - -#ifdef JUDY1 -#include "Judy1.h" -#else -#include "JudyL.h" -#endif - -#include "JudyPrivate1L.h" - -#ifdef TRACEJPR // different macro name, for "retrieval" only. -#include "JudyPrintJP.c" -#endif - - -// **************************************************************************** -// J U D Y 1 T E S T -// J U D Y L G E T -// -// See the manual entry for details. Note support for "shortcut" entries to -// trees known to start with a JPM. - -#ifdef JUDY1 - -#ifdef JUDYGETINLINE -FUNCTION int j__udy1Test -#else -FUNCTION int Judy1Test -#endif - -#else // JUDYL - -#ifdef JUDYGETINLINE -FUNCTION PPvoid_t j__udyLGet -#else -FUNCTION PPvoid_t JudyLGet -#endif - -#endif // JUDYL - ( -#ifdef JUDYGETINLINE - Pvoid_t PArray, // from which to retrieve. - Word_t Index // to retrieve. -#else - Pcvoid_t PArray, // from which to retrieve. - Word_t Index, // to retrieve. - PJError_t PJError // optional, for returning error info. -#endif - ) -{ - Pjp_t Pjp; // current JP while walking the tree. - Pjpm_t Pjpm; // for global accounting. - uint8_t Digit; // byte just decoded from Index. - Word_t Pop1; // leaf population (number of indexes). - Pjll_t Pjll; // pointer to LeafL. - DBGCODE(uint8_t ParentJPType;) - -#ifndef JUDYGETINLINE - - if (PArray == (Pcvoid_t) NULL) // empty array. - { - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - } - -// **************************************************************************** -// PROCESS TOP LEVEL BRANCHES AND LEAF: - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - { - Pjlw_t Pjlw = P_JLW(PArray); // first word of leaf. - int posidx; // signed offset in leaf. - - Pop1 = Pjlw[0] + 1; - posidx = j__udySearchLeafW(Pjlw + 1, Pop1, Index); - - if (posidx >= 0) - { - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAFWVALUEAREA(Pjlw, Pop1) + posidx));) - } - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - } - -#endif // ! JUDYGETINLINE - - Pjpm = P_JPM(PArray); - Pjp = &(Pjpm->jpm_JP); // top branch is below JPM. - -// **************************************************************************** -// WALK THE JUDY TREE USING A STATE MACHINE: - -ContinueWalk: // for going down one level; come here with Pjp set. - -#ifdef TRACEJPR - JudyPrintJP(Pjp, "g", __LINE__); -#endif - switch (JU_JPTYPE(Pjp)) - { - -// Ensure the switch table starts at 0 for speed; otherwise more code is -// executed: - - case 0: goto ReturnCorrupt; // save a little code. - - -// **************************************************************************** -// JPNULL*: -// -// Note: These are legitimate in a BranchU (only) and do not constitute a -// fault. - - case cJU_JPNULL1: - case cJU_JPNULL2: - case cJU_JPNULL3: -#ifdef JU_64BIT - case cJU_JPNULL4: - case cJU_JPNULL5: - case cJU_JPNULL6: - case cJU_JPNULL7: -#endif - assert(ParentJPType >= cJU_JPBRANCH_U2); - assert(ParentJPType <= cJU_JPBRANCH_U); - JUDY1CODE(return(0);) - JUDYLCODE(return((PPvoid_t) NULL);) - - -// **************************************************************************** -// JPBRANCH_L*: -// -// Note: The use of JU_DCDNOTMATCHINDEX() in branches is not strictly -// required,since this can be done at leaf level, but it costs nothing to do it -// sooner, and it aborts an unnecessary traversal sooner. - - case cJU_JPBRANCH_L2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - Digit = JU_DIGITATSTATE(Index, 2); - goto JudyBranchL; - - case cJU_JPBRANCH_L3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - Digit = JU_DIGITATSTATE(Index, 3); - goto JudyBranchL; - -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - Digit = JU_DIGITATSTATE(Index, 4); - goto JudyBranchL; - - case cJU_JPBRANCH_L5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - Digit = JU_DIGITATSTATE(Index, 5); - goto JudyBranchL; - - case cJU_JPBRANCH_L6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - Digit = JU_DIGITATSTATE(Index, 6); - goto JudyBranchL; - - case cJU_JPBRANCH_L7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Digit = JU_DIGITATSTATE(Index, 7); - goto JudyBranchL; - -#endif // JU_64BIT - - case cJU_JPBRANCH_L: - { - Pjbl_t Pjbl; - int posidx; - - Digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - -// Common code for all BranchLs; come here with Digit set: - -JudyBranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - - posidx = 0; - - do { - if (Pjbl->jbl_Expanse[posidx] == Digit) - { // found Digit; continue traversal: - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = Pjbl->jbl_jp + posidx; - goto ContinueWalk; - } - } while (++posidx != Pjbl->jbl_NumJPs); - - break; - } - - -// **************************************************************************** -// JPBRANCH_B*: - - case cJU_JPBRANCH_B2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - Digit = JU_DIGITATSTATE(Index, 2); - goto JudyBranchB; - - case cJU_JPBRANCH_B3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - Digit = JU_DIGITATSTATE(Index, 3); - goto JudyBranchB; - - -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - Digit = JU_DIGITATSTATE(Index, 4); - goto JudyBranchB; - - case cJU_JPBRANCH_B5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - Digit = JU_DIGITATSTATE(Index, 5); - goto JudyBranchB; - - case cJU_JPBRANCH_B6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - Digit = JU_DIGITATSTATE(Index, 6); - goto JudyBranchB; - - case cJU_JPBRANCH_B7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Digit = JU_DIGITATSTATE(Index, 7); - goto JudyBranchB; - -#endif // JU_64BIT - - case cJU_JPBRANCH_B: - { - Pjbb_t Pjbb; - Word_t subexp; // in bitmap, 0..7. - BITMAPB_t BitMap; // for one subexpanse. - BITMAPB_t BitMask; // bit in BitMap for Indexs Digit. - - Digit = JU_DIGITATSTATE(Index, cJU_ROOTSTATE); - -// Common code for all BranchBs; come here with Digit set: - -JudyBranchB: - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjbb = P_JBB(Pjp->jp_Addr); - subexp = Digit / cJU_BITSPERSUBEXPB; - - BitMap = JU_JBB_BITMAP(Pjbb, subexp); - Pjp = P_JP(JU_JBB_PJP(Pjbb, subexp)); - - BitMask = JU_BITPOSMASKB(Digit); - -// No JP in subexpanse for Index => Index not found: - - if (! (BitMap & BitMask)) break; - -// Count JPs in the subexpanse below the one for Index: - - Pjp += j__udyCountBitsB(BitMap & (BitMask - 1)); - - goto ContinueWalk; - - } // case cJU_JPBRANCH_B* - - -// **************************************************************************** -// JPBRANCH_U*: -// -// Notice the reverse order of the cases, and falling through to the next case, -// for performance. - - case cJU_JPBRANCH_U: - - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, cJU_ROOTSTATE); - -// If not a BranchU, traverse; otherwise fall into the next case, which makes -// this very fast code for a large Judy array (mainly BranchUs), especially -// when branches are already in the cache, such as for prev/next: - -#ifndef JU_64BIT - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U3) goto ContinueWalk; -#else - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U7) goto ContinueWalk; -#endif - -#ifdef JU_64BIT - case cJU_JPBRANCH_U7: - - // JU_DCDNOTMATCHINDEX() would be a no-op. - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 7); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U6) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U6: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 6); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U5) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U5: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 5); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U4) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U4: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 4); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U3) goto ContinueWalk; - // and fall through. - -#endif // JU_64BIT - - case cJU_JPBRANCH_U3: - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 3); - - if (JU_JPTYPE(Pjp) != cJU_JPBRANCH_U2) goto ContinueWalk; - // and fall through. - - case cJU_JPBRANCH_U2: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - DBGCODE(ParentJPType = JU_JPTYPE(Pjp);) - Pjp = JU_JBU_PJP(Pjp, Index, 2); - -// Note: BranchU2 is a special case that must continue traversal to a leaf, -// immed, full, or null type: - - goto ContinueWalk; - - -// **************************************************************************** -// JPLEAF*: -// -// Note: Here the calls of JU_DCDNOTMATCHINDEX() are necessary and check -// whether Index is out of the expanse of a narrow pointer. - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - - case cJU_JPLEAF1: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf1(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF1VALUEAREA(Pjll, Pop1) + posidx));) - } - -#endif // (JUDYL || (! JU_64BIT)) - - case cJU_JPLEAF2: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 2)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf2(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF2VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF3: - { - int posidx; // signed offset in leaf. - -#ifdef JU_64BIT // otherwise its a no-op: - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 3)) break; -#endif - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf3(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF3VALUEAREA(Pjll, Pop1) + posidx));) - } -#ifdef JU_64BIT - case cJU_JPLEAF4: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 4)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf4(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF4VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF5: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 5)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf5(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF5VALUEAREA(Pjll, Pop1) + posidx));) - } - - case cJU_JPLEAF6: - { - int posidx; // signed offset in leaf. - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 6)) break; - - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf6(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF6VALUEAREA(Pjll, Pop1) + posidx));) - } - case cJU_JPLEAF7: - { - int posidx; // signed offset in leaf. - - // JU_DCDNOTMATCHINDEX() would be a no-op. - Pop1 = JU_JPLEAF_POP0(Pjp) + 1; - Pjll = P_JLL(Pjp->jp_Addr); - - if ((posidx = j__udySearchLeaf7(Pjll, Pop1, Index)) < 0) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) (JL_LEAF7VALUEAREA(Pjll, Pop1) + posidx));) - } -#endif // JU_64BIT - - -// **************************************************************************** -// JPLEAF_B1: - - case cJU_JPLEAF_B1: - { - Pjlb_t Pjlb; -#ifdef JUDYL - int posidx; - Word_t subexp; // in bitmap, 0..7. - BITMAPL_t BitMap; // for one subexpanse. - BITMAPL_t BitMask; // bit in BitMap for Indexs Digit. - Pjv_t Pjv; -#endif - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - Pjlb = P_JLB(Pjp->jp_Addr); - -#ifdef JUDY1 - -// Simply check if Indexs bit is set in the bitmap: - - if (JU_BITMAPTESTL(Pjlb, Index)) return(1); - break; - -#else // JUDYL - -// JudyL is much more complicated because of value area subarrays: - - Digit = JU_DIGITATSTATE(Index, 1); - subexp = Digit / cJU_BITSPERSUBEXPL; - BitMap = JU_JLB_BITMAP(Pjlb, subexp); - BitMask = JU_BITPOSMASKL(Digit); - -// No value in subexpanse for Index => Index not found: - - if (! (BitMap & BitMask)) break; - -// Count value areas in the subexpanse below the one for Index: - - Pjv = P_JV(JL_JLB_PVALUE(Pjlb, subexp)); - assert(Pjv != (Pjv_t) NULL); - posidx = j__udyCountBitsL(BitMap & (BitMask - 1)); - - return((PPvoid_t) (Pjv + posidx)); - -#endif // JUDYL - - } // case cJU_JPLEAF_B1 - -#ifdef JUDY1 - -// **************************************************************************** -// JPFULLPOPU1: -// -// If the Index is in the expanse, it is necessarily valid (found). - - case cJ1_JPFULLPOPU1: - - if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - return(1); - -#ifdef notdef // for future enhancements -#ifdef JU_64BIT - -// Note: Need ? if (JU_DCDNOTMATCHINDEX(Index, Pjp, 1)) break; - - case cJ1_JPFULLPOPU1m15: - if (Pjp->jp_1Index[14] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m14: - if (Pjp->jp_1Index[13] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m13: - if (Pjp->jp_1Index[12] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m12: - if (Pjp->jp_1Index[11] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m11: - if (Pjp->jp_1Index[10] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m10: - if (Pjp->jp_1Index[9] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m9: - if (Pjp->jp_1Index[8] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m8: - if (Pjp->jp_1Index[7] == (uint8_t)Index) break; -#endif - case cJ1_JPFULLPOPU1m7: - if (Pjp->jp_1Index[6] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m6: - if (Pjp->jp_1Index[5] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m5: - if (Pjp->jp_1Index[4] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m4: - if (Pjp->jp_1Index[3] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m3: - if (Pjp->jp_1Index[2] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m2: - if (Pjp->jp_1Index[1] == (uint8_t)Index) break; - case cJ1_JPFULLPOPU1m1: - if (Pjp->jp_1Index[0] == (uint8_t)Index) break; - - return(1); // found, not in exclusion list - -#endif // JUDY1 -#endif // notdef - -// **************************************************************************** -// JPIMMED*: -// -// Note that the contents of jp_DcdPopO are different for cJU_JPIMMED_*_01: - - case cJU_JPIMMED_1_01: - case cJU_JPIMMED_2_01: - case cJU_JPIMMED_3_01: -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: - case cJU_JPIMMED_5_01: - case cJU_JPIMMED_6_01: - case cJU_JPIMMED_7_01: -#endif - if (JU_JPDCDPOP0(Pjp) != JU_TRIMTODCDSIZE(Index)) break; - - JUDY1CODE(return(1);) - JUDYLCODE(return((PPvoid_t) &(Pjp->jp_Addr));) // immediate value area. - - -// Macros to make code more readable and avoid dup errors - -#ifdef JUDY1 - -#define CHECKINDEXNATIVE(LEAF_T, PJP, IDX, INDEX) \ -if (((LEAF_T *)((PJP)->jp_1Index))[(IDX) - 1] == (LEAF_T)(INDEX)) \ - return(1) - -#define CHECKLEAFNONNAT(LFBTS, PJP, INDEX, IDX, COPY) \ -{ \ - Word_t i_ndex; \ - uint8_t *a_ddr; \ - a_ddr = (PJP)->jp_1Index + (((IDX) - 1) * (LFBTS)); \ - COPY(i_ndex, a_ddr); \ - if (i_ndex == JU_LEASTBYTES((INDEX), (LFBTS))) \ - return(1); \ -} -#endif - -#ifdef JUDYL - -#define CHECKINDEXNATIVE(LEAF_T, PJP, IDX, INDEX) \ -if (((LEAF_T *)((PJP)->jp_LIndex))[(IDX) - 1] == (LEAF_T)(INDEX)) \ - return((PPvoid_t)(P_JV((PJP)->jp_Addr) + (IDX) - 1)) - -#define CHECKLEAFNONNAT(LFBTS, PJP, INDEX, IDX, COPY) \ -{ \ - Word_t i_ndex; \ - uint8_t *a_ddr; \ - a_ddr = (PJP)->jp_LIndex + (((IDX) - 1) * (LFBTS)); \ - COPY(i_ndex, a_ddr); \ - if (i_ndex == JU_LEASTBYTES((INDEX), (LFBTS))) \ - return((PPvoid_t)(P_JV((PJP)->jp_Addr) + (IDX) - 1)); \ -} -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_15: CHECKINDEXNATIVE(uint8_t, Pjp, 15, Index); - case cJ1_JPIMMED_1_14: CHECKINDEXNATIVE(uint8_t, Pjp, 14, Index); - case cJ1_JPIMMED_1_13: CHECKINDEXNATIVE(uint8_t, Pjp, 13, Index); - case cJ1_JPIMMED_1_12: CHECKINDEXNATIVE(uint8_t, Pjp, 12, Index); - case cJ1_JPIMMED_1_11: CHECKINDEXNATIVE(uint8_t, Pjp, 11, Index); - case cJ1_JPIMMED_1_10: CHECKINDEXNATIVE(uint8_t, Pjp, 10, Index); - case cJ1_JPIMMED_1_09: CHECKINDEXNATIVE(uint8_t, Pjp, 9, Index); - case cJ1_JPIMMED_1_08: CHECKINDEXNATIVE(uint8_t, Pjp, 8, Index); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_07: CHECKINDEXNATIVE(uint8_t, Pjp, 7, Index); - case cJU_JPIMMED_1_06: CHECKINDEXNATIVE(uint8_t, Pjp, 6, Index); - case cJU_JPIMMED_1_05: CHECKINDEXNATIVE(uint8_t, Pjp, 5, Index); - case cJU_JPIMMED_1_04: CHECKINDEXNATIVE(uint8_t, Pjp, 4, Index); -#endif - case cJU_JPIMMED_1_03: CHECKINDEXNATIVE(uint8_t, Pjp, 3, Index); - case cJU_JPIMMED_1_02: CHECKINDEXNATIVE(uint8_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint8_t, Pjp, 1, Index); - break; - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_07: CHECKINDEXNATIVE(uint16_t, Pjp, 7, Index); - case cJ1_JPIMMED_2_06: CHECKINDEXNATIVE(uint16_t, Pjp, 6, Index); - case cJ1_JPIMMED_2_05: CHECKINDEXNATIVE(uint16_t, Pjp, 5, Index); - case cJ1_JPIMMED_2_04: CHECKINDEXNATIVE(uint16_t, Pjp, 4, Index); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_03: CHECKINDEXNATIVE(uint16_t, Pjp, 3, Index); - case cJU_JPIMMED_2_02: CHECKINDEXNATIVE(uint16_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint16_t, Pjp, 1, Index); - break; -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_05: - CHECKLEAFNONNAT(3, Pjp, Index, 5, JU_COPY3_PINDEX_TO_LONG); - case cJ1_JPIMMED_3_04: - CHECKLEAFNONNAT(3, Pjp, Index, 4, JU_COPY3_PINDEX_TO_LONG); - case cJ1_JPIMMED_3_03: - CHECKLEAFNONNAT(3, Pjp, Index, 3, JU_COPY3_PINDEX_TO_LONG); -#endif -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: - CHECKLEAFNONNAT(3, Pjp, Index, 2, JU_COPY3_PINDEX_TO_LONG); - CHECKLEAFNONNAT(3, Pjp, Index, 1, JU_COPY3_PINDEX_TO_LONG); - break; -#endif - -#if (defined(JUDY1) && defined(JU_64BIT)) - - case cJ1_JPIMMED_4_03: CHECKINDEXNATIVE(uint32_t, Pjp, 3, Index); - case cJ1_JPIMMED_4_02: CHECKINDEXNATIVE(uint32_t, Pjp, 2, Index); - CHECKINDEXNATIVE(uint32_t, Pjp, 1, Index); - break; - - case cJ1_JPIMMED_5_03: - CHECKLEAFNONNAT(5, Pjp, Index, 3, JU_COPY5_PINDEX_TO_LONG); - case cJ1_JPIMMED_5_02: - CHECKLEAFNONNAT(5, Pjp, Index, 2, JU_COPY5_PINDEX_TO_LONG); - CHECKLEAFNONNAT(5, Pjp, Index, 1, JU_COPY5_PINDEX_TO_LONG); - break; - - case cJ1_JPIMMED_6_02: - CHECKLEAFNONNAT(6, Pjp, Index, 2, JU_COPY6_PINDEX_TO_LONG); - CHECKLEAFNONNAT(6, Pjp, Index, 1, JU_COPY6_PINDEX_TO_LONG); - break; - - case cJ1_JPIMMED_7_02: - CHECKLEAFNONNAT(7, Pjp, Index, 2, JU_COPY7_PINDEX_TO_LONG); - CHECKLEAFNONNAT(7, Pjp, Index, 1, JU_COPY7_PINDEX_TO_LONG); - break; - -#endif // (JUDY1 && JU_64BIT) - - -// **************************************************************************** -// INVALID JP TYPE: - - default: - -ReturnCorrupt: - -#ifdef JUDYGETINLINE // Pjpm is known to be non-null: - JU_SET_ERRNO_NONNULL(Pjpm, JU_ERRNO_CORRUPT); -#else - JU_SET_ERRNO(PJError, JU_ERRNO_CORRUPT); -#endif - JUDY1CODE(return(JERRI );) - JUDYLCODE(return(PPJERR);) - - } // switch on JP type - -JUDY1CODE(return(0);) -JUDYLCODE(return((PPvoid_t) NULL);) - -} // Judy1Test() / JudyLGet() - - -#ifndef JUDYGETINLINE // only compile the following function once: -#ifdef DEBUG - -// **************************************************************************** -// J U D Y C H E C K P O P -// -// Given a pointer to a Judy array, traverse the entire array to ensure -// population counts add up correctly. This can catch various coding errors. -// -// Since walking the entire tree is probably time-consuming, enable this -// function by setting env parameter $CHECKPOP to first call at which to start -// checking. Note: This function is called both from insert and delete code. -// -// Note: Even though this function does nothing useful for LEAFW leaves, its -// good practice to call it anyway, and cheap too. -// -// TBD: This is a debug-only check function similar to JudyCheckSorted(), but -// since it walks the tree it is Judy1/JudyL-specific and must live in a source -// file that is built both ways. -// -// TBD: As feared, enabling this code for every insert/delete makes Judy -// deathly slow, even for a small tree (10K indexes). Its not so bad if -// present but disabled (<1% slowdown measured). Still, should it be ifdefd -// other than DEBUG and/or called less often? -// -// TBD: Should this "population checker" be expanded to a comprehensive tree -// checker? It currently detects invalid LEAFW/JP types as well as inconsistent -// pop1s. Other possible checks, all based on essentially redundant data in -// the Judy tree, include: -// -// - Zero LS bits in jp_Addr field. -// -// - Correct Dcd bits. -// -// - Consistent JP types (always descending down the tree). -// -// - Sorted linear lists in BranchLs and leaves (using JudyCheckSorted(), but -// ideally that function is already called wherever appropriate after any -// linear list is modified). -// -// - Any others possible? - -#include // for getenv() and atol(). - -static Word_t JudyCheckPopSM(Pjp_t Pjp, Word_t RootPop1); - -FUNCTION void JudyCheckPop( - Pvoid_t PArray) -{ -static bool_t checked = FALSE; // already checked env parameter. -static bool_t enabled = FALSE; // env parameter set. -static bool_t active = FALSE; // calls >= callsmin. -static Word_t callsmin; // start point from $CHECKPOP. -static Word_t calls = 0; // times called so far. - - -// CHECK FOR EXTERNAL ENABLING: - - if (! checked) // only check once. - { - char * value; // for getenv(). - - checked = TRUE; - - if ((value = getenv("CHECKPOP")) == (char *) NULL) - { -#ifdef notdef -// Take this out because nightly tests want to be flavor-independent; its not -// OK to emit special non-error output from the debug flavor: - - (void) puts("JudyCheckPop() present but not enabled by " - "$CHECKPOP env parameter; set it to the number of " - "calls at which to begin checking"); -#endif - return; - } - - callsmin = atol(value); // note: non-number evaluates to 0. - enabled = TRUE; - - (void) printf("JudyCheckPop() present and enabled; callsmin = " - "%lu\n", callsmin); - } - else if (! enabled) return; - -// Previously or just now enabled; check if non-active or newly active: - - if (! active) - { - if (++calls < callsmin) return; - - (void) printf("JudyCheckPop() activated at call %lu\n", calls); - active = TRUE; - } - -// IGNORE LEAFW AT TOP OF TREE: - - if (JU_LEAFW_POP0(PArray) < cJU_LEAFW_MAXPOP1) // must be a LEAFW - return; - -// Check JPM pop0 against tree, recursively: -// -// Note: The traversal code in JudyCheckPopSM() is simplest when the case -// statement for each JP type compares the pop1 for that JP to its subtree (if -// any) after traversing the subtree (thats the hard part) and adding up -// actual pop1s. A top branchs JP in the JPM does not have room for a -// full-word pop1, so pass it in as a special case. - - { - Pjpm_t Pjpm = P_JPM(PArray); - (void) JudyCheckPopSM(&(Pjpm->jpm_JP), Pjpm->jpm_Pop0 + 1); - return; - } - -} // JudyCheckPop() - - -// **************************************************************************** -// J U D Y C H E C K P O P S M -// -// Recursive state machine (subroutine) for JudyCheckPop(): Given a Pjp (other -// than JPNULL*; caller should shortcut) and the root population for top-level -// branches, check the subtrees actual pop1 against its nominal value, and -// return the total pop1 for the subtree. -// -// Note: Expect RootPop1 to be ignored at lower levels, so pass down 0, which -// should pop an assertion if this expectation is violated. - -FUNCTION static Word_t JudyCheckPopSM( - Pjp_t Pjp, // top of subtree. - Word_t RootPop1) // whole array, for top-level branches only. -{ - Word_t pop1_jp; // nominal population from the JP. - Word_t pop1 = 0; // actual population at this level. - Word_t offset; // in a branch. - -#define PREPBRANCH(cPopBytes,Next) \ - pop1_jp = JU_JPBRANCH_POP0(Pjp, cPopBytes) + 1; goto Next - -assert((((Word_t) (Pjp->jp_Addr)) & 7) == 3); - switch (JU_JPTYPE(Pjp)) - { - - case cJU_JPBRANCH_L2: PREPBRANCH(2, BranchL); - case cJU_JPBRANCH_L3: PREPBRANCH(3, BranchL); -#ifdef JU_64BIT - case cJU_JPBRANCH_L4: PREPBRANCH(4, BranchL); - case cJU_JPBRANCH_L5: PREPBRANCH(5, BranchL); - case cJU_JPBRANCH_L6: PREPBRANCH(6, BranchL); - case cJU_JPBRANCH_L7: PREPBRANCH(7, BranchL); -#endif - case cJU_JPBRANCH_L: pop1_jp = RootPop1; - { - Pjbl_t Pjbl; -BranchL: - Pjbl = P_JBL(Pjp->jp_Addr); - - for (offset = 0; offset < (Pjbl->jbl_NumJPs); ++offset) - pop1 += JudyCheckPopSM((Pjbl->jbl_jp) + offset, 0); - - assert(pop1_jp == pop1); - return(pop1); - } - - case cJU_JPBRANCH_B2: PREPBRANCH(2, BranchB); - case cJU_JPBRANCH_B3: PREPBRANCH(3, BranchB); -#ifdef JU_64BIT - case cJU_JPBRANCH_B4: PREPBRANCH(4, BranchB); - case cJU_JPBRANCH_B5: PREPBRANCH(5, BranchB); - case cJU_JPBRANCH_B6: PREPBRANCH(6, BranchB); - case cJU_JPBRANCH_B7: PREPBRANCH(7, BranchB); -#endif - case cJU_JPBRANCH_B: pop1_jp = RootPop1; - { - Word_t subexp; - Word_t jpcount; - Pjbb_t Pjbb; -BranchB: - Pjbb = P_JBB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPB; ++subexp) - { - jpcount = j__udyCountBitsB(JU_JBB_BITMAP(Pjbb, subexp)); - - for (offset = 0; offset < jpcount; ++offset) - { - pop1 += JudyCheckPopSM(P_JP(JU_JBB_PJP(Pjbb, subexp)) - + offset, 0); - } - } - - assert(pop1_jp == pop1); - return(pop1); - } - - case cJU_JPBRANCH_U2: PREPBRANCH(2, BranchU); - case cJU_JPBRANCH_U3: PREPBRANCH(3, BranchU); -#ifdef JU_64BIT - case cJU_JPBRANCH_U4: PREPBRANCH(4, BranchU); - case cJU_JPBRANCH_U5: PREPBRANCH(5, BranchU); - case cJU_JPBRANCH_U6: PREPBRANCH(6, BranchU); - case cJU_JPBRANCH_U7: PREPBRANCH(7, BranchU); -#endif - case cJU_JPBRANCH_U: pop1_jp = RootPop1; - { - Pjbu_t Pjbu; -BranchU: - Pjbu = P_JBU(Pjp->jp_Addr); - - for (offset = 0; offset < cJU_BRANCHUNUMJPS; ++offset) - { - if (((Pjbu->jbu_jp[offset].jp_Type) >= cJU_JPNULL1) - && ((Pjbu->jbu_jp[offset].jp_Type) <= cJU_JPNULLMAX)) - { - continue; // skip null JP to save time. - } - - pop1 += JudyCheckPopSM((Pjbu->jbu_jp) + offset, 0); - } - - assert(pop1_jp == pop1); - return(pop1); - } - - -// -- Cases below here terminate and do not recurse. -- -// -// For all of these cases except JPLEAF_B1, there is no way to check the JPs -// pop1 against the object itself; just return the pop1; but for linear leaves, -// a bounds check is possible. - -#define CHECKLEAF(MaxPop1) \ - pop1 = JU_JPLEAF_POP0(Pjp) + 1; \ - assert(pop1 >= 1); \ - assert(pop1 <= (MaxPop1)); \ - return(pop1) - -#if (defined(JUDYL) || (! defined(JU_64BIT))) - case cJU_JPLEAF1: CHECKLEAF(cJU_LEAF1_MAXPOP1); -#endif - case cJU_JPLEAF2: CHECKLEAF(cJU_LEAF2_MAXPOP1); - case cJU_JPLEAF3: CHECKLEAF(cJU_LEAF3_MAXPOP1); -#ifdef JU_64BIT - case cJU_JPLEAF4: CHECKLEAF(cJU_LEAF4_MAXPOP1); - case cJU_JPLEAF5: CHECKLEAF(cJU_LEAF5_MAXPOP1); - case cJU_JPLEAF6: CHECKLEAF(cJU_LEAF6_MAXPOP1); - case cJU_JPLEAF7: CHECKLEAF(cJU_LEAF7_MAXPOP1); -#endif - - case cJU_JPLEAF_B1: - { - Word_t subexp; - Pjlb_t Pjlb; - - pop1_jp = JU_JPLEAF_POP0(Pjp) + 1; - - Pjlb = P_JLB(Pjp->jp_Addr); - - for (subexp = 0; subexp < cJU_NUMSUBEXPL; ++subexp) - pop1 += j__udyCountBitsL(JU_JLB_BITMAP(Pjlb, subexp)); - - assert(pop1_jp == pop1); - return(pop1); - } - - JUDY1CODE(case cJ1_JPFULLPOPU1: return(cJU_JPFULLPOPU1_POP0);) - - case cJU_JPIMMED_1_01: return(1); - case cJU_JPIMMED_2_01: return(1); - case cJU_JPIMMED_3_01: return(1); -#ifdef JU_64BIT - case cJU_JPIMMED_4_01: return(1); - case cJU_JPIMMED_5_01: return(1); - case cJU_JPIMMED_6_01: return(1); - case cJU_JPIMMED_7_01: return(1); -#endif - - case cJU_JPIMMED_1_02: return(2); - case cJU_JPIMMED_1_03: return(3); -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_1_04: return(4); - case cJU_JPIMMED_1_05: return(5); - case cJU_JPIMMED_1_06: return(6); - case cJU_JPIMMED_1_07: return(7); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_1_08: return(8); - case cJ1_JPIMMED_1_09: return(9); - case cJ1_JPIMMED_1_10: return(10); - case cJ1_JPIMMED_1_11: return(11); - case cJ1_JPIMMED_1_12: return(12); - case cJ1_JPIMMED_1_13: return(13); - case cJ1_JPIMMED_1_14: return(14); - case cJ1_JPIMMED_1_15: return(15); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_2_02: return(2); - case cJU_JPIMMED_2_03: return(3); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_2_04: return(4); - case cJ1_JPIMMED_2_05: return(5); - case cJ1_JPIMMED_2_06: return(6); - case cJ1_JPIMMED_2_07: return(7); -#endif - -#if (defined(JUDY1) || defined(JU_64BIT)) - case cJU_JPIMMED_3_02: return(2); -#endif -#if (defined(JUDY1) && defined(JU_64BIT)) - case cJ1_JPIMMED_3_03: return(3); - case cJ1_JPIMMED_3_04: return(4); - case cJ1_JPIMMED_3_05: return(5); - - case cJ1_JPIMMED_4_02: return(2); - case cJ1_JPIMMED_4_03: return(3); - case cJ1_JPIMMED_5_02: return(2); - case cJ1_JPIMMED_5_03: return(3); - case cJ1_JPIMMED_6_02: return(2); - case cJ1_JPIMMED_7_02: return(2); -#endif - - } // switch (JU_JPTYPE(Pjp)) - - assert(FALSE); // unrecognized JP type => corruption. - return(0); // to make some compilers happy. - -} // JudyCheckPopSM() - -#endif // DEBUG -#endif // ! JUDYGETINLINE diff --git a/libjudy/src/JudySL/JudySL.c b/libjudy/src/JudySL/JudySL.c deleted file mode 100644 index d7314a7360..0000000000 --- a/libjudy/src/JudySL/JudySL.c +++ /dev/null @@ -1,1127 +0,0 @@ -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.38 $ $Source: /judy/src/JudySL/JudySL.c $ -// -// JUDY FUNCTIONS FOR STRING INDEXES, where associated values are longs. One -// JudySL*() corresponds to each JudyL*() function (with exceptions). -// -// See the manual entry for details. -// -// METHOD: Break up each null-terminated Index (string) into chunks of W -// bytes, where W is the machines word size, with null-padding in the last -// word if necessary. Store strings as a tree of JudyL arrays, that is, array -// of array of array... where each level consumes W bytes (one word) as an -// index to the JudyL array at that level. Since strings can begin on -// arbitrary byte boundaries, copy each chunk of W bytes from Index into a -// word-aligned object before using it as a Judy index. -// -// The JudySL tree also supports "single-index shortcut leaves". A simple -// JudySL array (tree of JudyL arrays) would go as many levels deep as the -// Index (string) is long, which wastes time and memory when an Index is unique -// beyond a certain point. When theres just one Index under a pointer, given -// a reliable way to tell that the pointer is not a root pointer to another -// JudyL array, it should save a lot of time to instead point to a "leaf" -// object, similar to leaves in JudyL arrays. -// -// TBD: Multi-index leaves, like those in JudyL, are also worth considering, -// but their payback for JudySL is less certain. Likewise, shortcut branches -// are worth considering too. -// -// This code uses the Judy.h definitions and Doug Baskins convention of a "P" -// prefix for pointers, except no "P" for the first level of char * (strings). - -// IMPORTS: - -#include // for strcmp(), strlen(), strcpy() -#include - -#ifndef NDEDUG -#define NDEBUG 1 -#endif -#include - -//======================================================================= -// Compile: -// -// cc -O JudyHS.c -c -// -// Notes: -// 1) use -DJU_64BIT for 64 bit compiles (HP, Sun, IPF, Motorola/IBM? etc..) -// 2) In gcc version 3.3.1 for a Centrino, -O2 is faster than -O -// 3) In gcc version 3.3.2 for a Centrino, -O3 is faster than -O2 -//======================================================================= - -#define JU_SET_ERRNO(PJERROR, JERRNO) \ -{ \ - if (PJERROR != (PJError_t)NULL) \ - { \ - JU_ERRNO(PJERROR) = (JERRNO); \ - JU_ERRID(PJERROR) = __LINE__; \ - } \ -} - -#define JU_SET_ERRNO_NONNULL(PJERROR, JERRNO) \ -{ \ - JU_ERRNO(PJERROR) = (JERRNO); \ - JU_ERRID(PJERROR) = __LINE__; \ -} - -// SUPPORT FOR HANDLING WORDS: - -#define WORDSIZE (sizeof (Word_t)) // bytes in word = JudyL index. -#define WORDS(BYTES) (((BYTES) + WORDSIZE - 1) / WORDSIZE) // round up. - -// To mark a pointer is to a "short cut leaf", set least bit - -#define IS_PSCL(PSCL) (((Word_t) (PSCL)) & JLAP_INVALID) -#define CLEAR_PSCL(PSCL) ((Pscl_t)(((Word_t) (PSCL)) & (~JLAP_INVALID))) -#define SET_PSCL(PSCL) (((Word_t) (PSCL)) | JLAP_INVALID) - -// MISCELLANEOUS GLOBALS: - -// Get the Index (string) length in bytes, including the trailing \0, which -// is an integral part of the string: - -// A string is "in the last word" if a previously-set byte count is at or below -// the system word size, or in some cases if the last byte in the (null-padded) -// word is null (assume big-endian, including in a register on a little-endian -// machine): - -#define LASTWORD_BY_VALUE(WORD) (! ((WORD) & 0xffL)) - -#ifdef JU_64BIT - -// copy from 1..7 bytes from string to Word_t and test if \0 bytes -// -#define COPYSTRINGtoWORD(WORD,STR) \ -{ \ - do \ - { \ - uint8_t chr; \ - WORD = (Word_t)(STR)[0] << 56; \ - if (!(WORD)) break; \ - if (!(chr = (STR)[1])) break; \ - WORD += ((Word_t)(chr) << 48); \ - if (!(chr = (STR)[2])) break; \ - WORD += ((Word_t)(chr) << 40); \ - if (!(chr = (STR)[3])) break; \ - WORD += ((Word_t)(chr) << 32); \ - if (!(chr = (STR)[4])) break; \ - WORD += ((Word_t)(chr) << 24); \ - if (!(chr = (STR)[5])) break; \ - WORD += ((Word_t)(chr) << 16); \ - if (!(chr = (STR)[6])) break; \ - WORD += ((Word_t)(chr) << 8) + (STR)[7]; \ - } while(0); \ -} - -// copy Word_t from 1..8 bytes to string and test of \0 bytes -// -#define COPYWORDtoSTRING(STR,WORD) \ -{ \ - do \ - { \ - if (!((STR)[0] = (uint8_t)((WORD) >> 56))) break; \ - if (!((STR)[1] = (uint8_t)((WORD) >> 48))) break; \ - if (!((STR)[2] = (uint8_t)((WORD) >> 40))) break; \ - if (!((STR)[3] = (uint8_t)((WORD) >> 32))) break; \ - if (!((STR)[4] = (uint8_t)((WORD) >> 24))) break; \ - if (!((STR)[5] = (uint8_t)((WORD) >> 16))) break; \ - if (!((STR)[6] = (uint8_t)((WORD) >> 8))) break; \ - (STR)[7] = (uint8_t)(WORD); \ - } while(0); \ -} - -#else // JU_32BIT - -// copy from 1..4 bytes from string to Word_t and test if \0 bytes - -#define COPYSTRINGtoWORD(WORD,STR) \ -{ \ - do \ - { \ - uint8_t chr; \ - WORD = (STR)[0] << 24; \ - if (WORD == 0) break; \ - if (!(chr = (STR)[1])) break; \ - WORD += (Word_t)(chr << 16); \ - if (!(chr = (STR)[2])) break; \ - WORD += (Word_t)(chr << 8) + (STR)[3]; \ - } while(0); \ -} - -// copy Word_t from 1..4 bytes to string and test of \0 bytes - -#define COPYWORDtoSTRING(STR,WORD) \ -{ \ - do \ - { \ - if (!((STR)[0] = (uint8_t)((WORD) >> 24))) break; \ - if (!((STR)[1] = (uint8_t)((WORD) >> 16))) break; \ - if (!((STR)[2] = (uint8_t)((WORD) >> 8))) break; \ - (STR)[3] = (uint8_t)(WORD); \ - } while(0); \ -} -#endif // JU_32BIT - - -// SUPPORT FOR SINGLE-INDEX SHORTCUT LEAVES: - -typedef struct SHORCUTLEAF -{ - Pvoid_t scl_Pvalue; // callers value area. - uint8_t scl_Index[WORDSIZE]; // base Index string. -} scl_t , *Pscl_t; - -// overhead of the scl_Pvalue only, the scl_Index is calculate elsewhere - -#define STRUCTOVD (sizeof(scl_t) - WORDSIZE) - -// How big to malloc a shortcut leaf; stringlen should already include the -// trailing null char: - -#define SCLSIZE(LEN) (((LEN) + STRUCTOVD + WORDSIZE - 1) / WORDSIZE) - -// string routines, may replace with your own -// -#define STRCMP(S1,S2) strcmp((void *)(S1), (void *)(S2)) -#define STRCPY(S1,S2) strcpy((void *)(S1), (void *)(S2)) -#define STRLEN(S1) (strlen((void *)(S1)) + 1) - - -// Index and value area for a shortcut leaf, depending on how it matches the -// undecoded remainder of the Index, given a Pscl_t that includes type bits -// that must be cleared: -// -// PSCLINDEX() and PSCLVALUE() are also useful when Pscl contains uncleared -// TYPE bits. -// -// Note: SCLCMP() cannot take advantage of knowing the Index length because -// the scl_Index length is not pre-known when these macros are used. - -#define PSCLINDEX(PSCL) ((CLEAR_PSCL(PSCL))->scl_Index) -#define PSCLVALUE(PSCL) ((CLEAR_PSCL(PSCL))->scl_Pvalue) - -#define SCLCMP(INDEX,PSCL) STRCMP(INDEX, PSCLINDEX(PSCL)) - -#define PPSCLVALUE_EQ(INDEX,PSCL) \ - ((SCLCMP(INDEX, PSCL) == 0) ? &PSCLVALUE(PSCL) : (PPvoid_t)NULL) - -#define PPSCLVALUE_LT(INDEX,PSCL) \ - ((SCLCMP(INDEX, PSCL) < 0) ? &PSCLVALUE(PSCL) : (PPvoid_t)NULL) - -#define PPSCLVALUE_GT(INDEX,PSCL) \ - ((SCLCMP(INDEX, PSCL) > 0) ? &PSCLVALUE(PSCL) : (PPvoid_t)NULL) - -// Common in-lined code to append or free a shortcut leaf: -// -// See header comments about premature return(). Note that malloc() does not -// pre-zero the memory, so ensure scl_Pvalue is zeroed, just like a value area -// in a JudyL array. Hope strcpy() is fast enough in this context. - -#define APPEND_SCL(PSCL,PPARRAY,INDEX,LEN,PJERROR) \ -{ \ - if (((PSCL) = (Pscl_t) JudyMalloc(SCLSIZE(LEN))) == (Pscl_t)NULL) \ - { \ - JU_SET_ERRNO(PJERROR, JU_ERRNO_NOMEM); \ - return (PPJERR); \ - } \ - *(PPARRAY) = (Pvoid_t)SET_PSCL(PSCL); \ - ((PSCL)->scl_Pvalue) = (Pvoid_t)NULL; \ - (void)STRCPY((PSCL)->scl_Index, INDEX); \ -} - -// "FORWARD" DECLARATIONS: - -static void JudySLModifyErrno(PJError_t PJError, - Pcvoid_t PArray, Pcvoid_t PArrayOrig); -static int JudySLDelSub(PPvoid_t PPArray, PPvoid_t PPArrayOrig, - const uint8_t * Index, Word_t len, PJError_t PJError); -static PPvoid_t JudySLPrevSub(Pcvoid_t PArray, uint8_t * Index, int orig, - Word_t len, PJError_t PJError); -static PPvoid_t JudySLNextSub(Pcvoid_t PArray, uint8_t * Index, int orig, - Word_t len, PJError_t PJError); - -// **************************************************************************** -// J U D Y S L M O D I F Y E R R N O -// -// Common code for error translation: When a caller passes an invalid JAP -// ("not a JudyL pointer"), OR if the JudySL array is corrupted at a lower -// level, various JudyL*() calls return JU_ERRNO_NOTJUDYL. If the caller wants -// detailed error info, convert this particular error to JU_ERRNO_NOTJUDYSL if -// at the top of the tree, otherwise convert it to JU_ERRNO_CORRUPT, meaning -// there was a corruption (the only one even detectable outside JudyL) in the -// JudySL tree; but pass through any other errors unaltered. - -static void -JudySLModifyErrno(PJError_t PJError, // to modify if non-null. - Pcvoid_t PArray, // current JudyL array. - Pcvoid_t PArrayOrig // top-of-tree JudyL array. - ) -{ // map this Judy errno. - if ((PJError != PJE0) && (JU_ERRNO(PJError) == JU_ERRNO_NOTJUDYL)) - { - if (PArray == PArrayOrig) // callers fault. - { - JU_SET_ERRNO_NONNULL(PJError, JU_ERRNO_NOTJUDYSL); - } - else // lower level. - { - JU_SET_ERRNO_NONNULL(PJError, JU_ERRNO_CORRUPT); - } - } -} // JudySLModifyErrno() - -// **************************************************************************** -// J U D Y S L G E T -// -// See comments in file header and below. - -PPvoid_t -JudySLGet(Pcvoid_t PArray, const uint8_t * Index, PJError_t PJError) -{ - const uint8_t *pos = Index; // place in Index. - Word_t indexword; // buffer for aligned copy. - PPvoid_t PPValue; // from JudyL array. - -// CHECK FOR CALLER ERROR (NULL POINTER): - - if (Index == (uint8_t *) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return (PPJERR); - } - -// SEARCH NEXT LEVEL JUDYL ARRAY IN TREE: -// -// Use or copy each word from the Index string and check for it in the next -// level JudyL array in the array tree, but first watch for shortcut leaves. -// Upon invalid Index or end of Index (string) in current word, return. - - do // until return. - { - if (IS_PSCL(PArray)) // a shortcut leaf. - return (PPSCLVALUE_EQ(pos, PArray)); - - COPYSTRINGtoWORD(indexword, pos); // copy next 4[8] bytes. - - JLG(PPValue, PArray, indexword); - - if ((PPValue == (PPvoid_t) NULL) || LASTWORD_BY_VALUE(indexword)) - return (PPValue); - -// CONTINUE TO NEXT LEVEL DOWN JUDYL ARRAY TREE: -// -// If a previous JudySLIns() ran out of memory partway down the tree, it left a -// null *PPValue; this is automatically treated here as a dead-end (not a core -// dump or assertion; see version 1.25). - - pos += WORDSIZE; - PArray = *PPValue; // each value -> next array. - } while(1); // forever -// NOTREACHED JudySLGet() -} - -// **************************************************************************** -// J U D Y S L I N S -// -// See also the comments in JudySLGet(), which is somewhat similar, though -// simpler. -// -// Theory of operation: -// -// Upon encountering a null pointer in the tree of JudyL arrays, insert a -// shortcut leaf -- including directly under a null root pointer for the first -// Index in the JudySL array. -// -// Upon encountering a pre-existing shortcut leaf, if the old Index is equal to -// the new one, return the old value area. Otherwise, "carry down" the old -// Index until the old and new Indexes diverge, at which point each Index -// either terminates in the last JudyL array or a new shortcut leaf is inserted -// under it for the Indexs remainder. -// -// TBD: Running out of memory below the starting point causes a premature -// return below (in several places) and leaves a dead-end in the JudySL tree. -// Ideally the code here would back this out rather than wasting a little -// memory, but in lieu of that, the get, delete, and search functions -// understand dead-ends and handle them appropriately. - -PPvoid_t -JudySLIns(PPvoid_t PPArray, const uint8_t * Index, PJError_t PJError) -{ - PPvoid_t PPArrayOrig = PPArray; // for error reporting. - const uint8_t *pos = Index; // place in Index. - const uint8_t *pos2 = (uint8_t *) NULL; // old Index (SCL being moved). - Word_t len; // bytes remaining. - -// Note: len2 is set when needed and only used when valid, but this is not -// clear to gcc -Wall, so initialize it here to avoid a warning: - - Word_t len2 = 0; // for old Index (SCL being moved). - Word_t scl2 = 0; // size in words of SCL - Word_t indexword; // buffer for aligned copy. - Word_t indexword2; // for old Index (SCL being moved). - PPvoid_t PPValue; // from JudyL array. - PPvoid_t PPValue2; // for old Index (SCL being moved). - Pscl_t Pscl = (Pscl_t) NULL; // shortcut leaf. - Pscl_t Pscl2; // for old Index (SCL being moved). - -// CHECK FOR CALLER ERROR (NULL POINTERS): - - if (PPArray == (PPvoid_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); - return (PPJERR); - } - if (Index == (uint8_t *) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return (PPJERR); - } - - len = STRLEN(Index); // bytes remaining. - -// APPEND SHORTCUT LEAF: -// -// If PPArray, which is the root pointer to the first or next JudyL array in -// the tree, points to null (no next JudyL array), AND there is no shortcut -// leaf being carried down, append a shortcut leaf here for the new Index, no -// matter how much of the Index string remains (one or more bytes, including -// the trailing \0). - - while (1) // until return. - { - if (*PPArray == (Pvoid_t)NULL) // no next JudyL array. - { - if (Pscl == (Pscl_t) NULL) // no SCL being carried down. - { - APPEND_SCL(Pscl, PPArray, pos, len, PJError); // returns if error. - return (&(Pscl->scl_Pvalue)); - } - // else do nothing here; see below. - } - -// CARRY DOWN PRE-EXISTING SHORTCUT LEAF: -// -// When PPArray points to a pre-existing shortcut leaf, if its Index is equal -// to the Index to be inserted, meaning no insertion is required, return its -// value area; otherwise, "move it aside" and "carry it down" -- replace it -// (see below) with one or more levels of JudyL arrays. Moving it aside -// initially just means setting Pscl non-null, both as a flag and for later -// use, and clearing the pointer to the SCL in the JudyL array. - - else if (IS_PSCL(*PPArray)) - { - assert(Pscl == (Pscl_t) NULL); // no nested SCLs. - - Pscl = CLEAR_PSCL(*PPArray); - - pos2 = Pscl->scl_Index; // note: pos2 is always word-aligned. - len2 = STRLEN(pos2); // bytes remaining. - -// first check if string is already inserted - - if ((len == len2) && (STRCMP(pos, pos2) == 0)) - return (&(Pscl->scl_Pvalue)); - - *PPArray = (Pvoid_t)NULL; // disconnect SCL. - - scl2 = SCLSIZE(len2); // save for JudyFree - - // continue with *PPArray now clear, and Pscl, pos2, len2 set. - } - -// CHECK IF OLD AND NEW INDEXES DIVERGE IN THE CURRENT INDEX WORD: -// -// If a shortcut leaf is being carried down and its remaining Index chars now -// diverge from the remaining chars of the Index being inserted, that is, if -// the next words of each Index differ, "plug in" the old Index here, in a new -// JudyL array, before proceeding. -// -// Note: Call JudyLIns() for the SCL Index word before calling it for the new -// Index word, so PPValue remains correct for the latter. (JudyLIns() return -// values are not stable across multiple calls.) -// -// Note: Although pos2 is word-aligned, and a Pscl_t is a whole number of -// words in size, pos2 is not certain to be null-padded through a whole word, -// so copy it first to an index word for later use. -// -// See header comments about premature return(). - - COPYSTRINGtoWORD(indexword, pos); // copy next 4[8] bytes. - - if (Pscl != (Pscl_t) NULL) - { - COPYSTRINGtoWORD(indexword2, pos2); // copy next 4[8] bytes. - - if (indexword != indexword2) // SCL and new Indexes diverge. - { - assert(*PPArray == (Pvoid_t)NULL); // should be new JudyL array. - -// Note: If JudyLIns() returns JU_ERRNO_NOTJUDYL here, *PPArray should not be -// modified, so JudySLModifyErrno() can do the right thing. - - if ((PPValue2 = JudyLIns(PPArray, indexword2, PJError)) - == PPJERR) - { - JudySLModifyErrno(PJError, *PPArray, *PPArrayOrig); - return (PPJERR); - } - - assert(PPValue2 != (PPvoid_t) NULL); - -// If the old (SCL) Index terminates here, copy its value directly into the -// JudyL value area; otherwise create a new shortcut leaf for it, under -// *PPValue2 (skipping the word just inserted), and copy its value to the new -// SCL: - - if (len2 <= WORDSIZE) - { - *((PWord_t)PPValue2) = (Word_t)(Pscl->scl_Pvalue); - } - else - { - APPEND_SCL(Pscl2, PPValue2, pos2 + WORDSIZE, - len2 - WORDSIZE, PJError); - (Pscl2->scl_Pvalue) = Pscl->scl_Pvalue; - } -// old SCL no longer needed. - - JudyFree((void *)Pscl, scl2); - - Pscl = (Pscl_t) NULL; - } - } - -// APPEND NEXT LEVEL JUDYL ARRAY TO TREE: -// -// If a shortcut leaf was carried down and diverged at this level, the code -// above already appended the new JudyL array, but the next word of the new -// Index still must be inserted in it. -// -// See header comments about premature return(). -// -// Note: If JudyLIns() returns JU_ERRNO_NOTJUDYL here, *PPArray should not be -// modified, so JudySLModifyErrno() can do the right thing. - - if ((PPValue = JudyLIns(PPArray, indexword, PJError)) == PPJERR) - { - JudySLModifyErrno(PJError, *PPArray, *PPArrayOrig); - return (PPJERR); - } - - assert(PPValue != (PPvoid_t) NULL); - -// CHECK IF NEW INDEX TERMINATES: -// -// Note that if it does, and an old SCL was being carried down, it must have -// diverged by this point, and is already handled. - - if (len <= WORDSIZE) - { - assert(Pscl == (Pscl_t) NULL); - return (PPValue); // is value for whole Index string. - } - - pos += WORDSIZE; - len -= WORDSIZE; - pos2 += WORDSIZE; // useless unless Pscl is set. - len2 -= WORDSIZE; - - PPArray = PPValue; // each value -> next array. - } // while. -} // NOTREACHED, JudySLIns() - -// **************************************************************************** -// J U D Y S L D E L -// -// See the comments in JudySLGet(), which is somewhat similar. -// -// Unlike JudySLGet() and JudySLIns(), recurse downward through the tree of -// JudyL arrays to find and delete the given Index, if present, and then on the -// way back up, any of its parent arrays which ends up empty. -// -// TECHNICAL NOTES: -// -// Recursion seems bad, but this allows for an arbitrary-length Index. Also, a -// more clever iterative solution that used JudyLCount() (see below) would -// still require a function call per tree level, so why not just recurse? -// -// An earlier version (1.20) used a fixed-size stack, which limited the Index -// size. We were going to replace this with using JudyLCount(), in order to -// note and return to (read this carefully) the highest level JudyL array with -// a count of 1, all of whose descendant JudyL arrays also have a count of 1, -// and delete from that point downwards. This solution would traverse the -// array tree downward looking to see if the given Index is in the tree, then -// if so, delete layers downwards starting below the last one that contains -// other Indexes than the one being deleted. -// -// TBD: To save time coding, and to very likely save time overall during -// execution, this function does "lazy deletions", or putting it more nicely, -// it allows "hysteresis" in the JudySL tree, when shortcut leafs are present. -// It only removes the specified Index, and recursively any empty JudyL arrays -// above it, without fully reversing the effects of JudySLIns(). This is -// probably OK because any application that calls JudySLDel() is likely to call -// JudySLIns() again with the same or a neighbor Index. - -int -JudySLDel(PPvoid_t PPArray, const uint8_t * Index, PJError_t PJError) // optional, for returning error info. -{ - -// Check for caller error (null pointer): - - if (PPArray == (PPvoid_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); - return (JERR); - } - if (Index == (uint8_t *) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return (JERR); - } - -// Do the deletion: - - return (JudySLDelSub(PPArray, PPArray, Index, STRLEN(Index), PJError)); - -} // JudySLDel() - -// **************************************************************************** -// J U D Y S L D E L S U B -// -// This is the "engine" for JudySLDel() that expects aligned and len to already -// be computed (only once). See the header comments for JudySLDel(). - -static int -JudySLDelSub(PPvoid_t PPArray, // in which to delete. - PPvoid_t PPArrayOrig, // for error reporting. - const uint8_t * Index, // to delete. - Word_t len, // bytes remaining. - PJError_t PJError) // optional, for returning error info. -{ - Word_t indexword; // next word to find. - PPvoid_t PPValue; // from JudyL array. - int retcode; // from lower-level call. - - assert(PPArray != (PPvoid_t) NULL); - assert(Index != (uint8_t *) NULL); - -// DELETE SHORTCUT LEAF: -// -// As described above, this can leave an empty JudyL array, or one containing -// only a single other Index word -- which could be, but is not, condensed into -// a higher-level shortcut leaf. More precisely, at this level it leaves a -// temporary "dead end" in the JudySL tree, similar to when running out of -// memory during JudySLIns(), and this is somewhat cleaned up by higher -// recursions of the same function (see below); but remaining shortcut leaves -// for other Indexes are not coalesced. - - if (IS_PSCL(*PPArray)) - { - Pscl_t Pscll = CLEAR_PSCL(*PPArray); - Word_t words; - - if (STRCMP(Index, Pscll->scl_Index)) - return (0); // incorrect index. - - words = SCLSIZE(STRLEN(Pscll->scl_Index)); - JudyFree((void *)Pscll, words); - - *PPArray = (Pvoid_t)NULL; - return (1); // correct index deleted. - } - -// DELETE LAST INDEX WORD, FROM CURRENT JUDYL ARRAY: -// -// When at the end of the full Index, delete the last word, if present, from -// the current JudyL array, and return the result all the way up. - - COPYSTRINGtoWORD(indexword, Index); // copy next 4[8] bytes. - - if (len <= WORDSIZE) - { - if ((retcode = JudyLDel(PPArray, indexword, PJError)) == JERR) - { - JudySLModifyErrno(PJError, *PPArray, *PPArrayOrig); - return (JERR); - } - return (retcode); - } - -// DELETE BELOW NON-LAST INDEX WORD IN CURRENT JUDYL ARRAY: -// -// If a word before the end of the full Index is present in the current JudyL -// array, recurse through its value, which must be a pointer to another JudyL -// array, to continue the deletion at the next level. Return the JudyLGet() -// return if the Indexs current word is not in the JudyL array, or if no -// delete occurs below this level, both of which mean the whole Index is not -// currently valid. -// - - JLG(PPValue, *PPArray, indexword); - if (PPValue == (PPvoid_t) NULL) - return (0); // Index not in JudySL array. -// If a previous JudySLIns() ran out of memory partway down the tree, it left a -// null *PPValue; this is automatically treated as a dead-end (not a core dump -// or assertion; see version 1.25). - if ((retcode = - JudySLDelSub(PPValue, PPArrayOrig, Index + WORDSIZE, - len - WORDSIZE, PJError)) != 1) - { - return (retcode); // no lower-level delete, or error. - } - -// DELETE EMPTY JUDYL ARRAY: -// -// A delete occurred below in the tree. If the child JudyL array became empty, -// delete the current Index word from the current JudyL array, which could -// empty the current array and null out *PPArray in turn (or pass through an -// error). Otherwise simply indicate that a deletion did occur. - - if (*PPValue == (Pvoid_t)NULL) - { - if ((retcode = JudyLDel(PPArray, indexword, PJError)) == JERR) - { - JudySLModifyErrno(PJError, *PPArray, *PPArrayOrig); - return (JERR); - } - - return (retcode); - } - - return (1); -} // JudySLDelSub() - -// **************************************************************************** -// J U D Y S L P R E V -// -// Recursively traverse the JudySL tree downward using JudyLGet() to look for -// each successive index word from Index in the JudyL array at each level. At -// the last level for the Index (LASTWORD_BY_LEN()), use JudyLPrev() instead of -// JudyLGet(), to exclude the initial Index. If this doesnt result in finding -// a previous Index, work back up the tree using JudyLPrev() at each higher -// level to search for a previous index word. Upon finding a previous index -// word, descend again if/as necessary, this time inclusively, to find and -// return the full previous Index. -// -// Also support shortcut leaves. -// -// Since this function is recursive and it also needs to know if its still -// looking for the original Index (to exclude it at the LASTWORD_BY_LEN() -// level) or for the remaining words of the previous Index (inclusive), -// actually call a subroutine that takes an additional parameter. -// -// See also the technical notes in JudySLDel() regarding the use of recursion -// rather than iteration. - -PPvoid_t -JudySLPrev(Pcvoid_t PArray, uint8_t * Index, PJError_t PJError) // optional, for returning error info. -{ -// Check for caller error (null pointer), or empty JudySL array: - - if (Index == (uint8_t *) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return (PPJERR); - } - - if (PArray == (Pvoid_t)NULL) - return ((PPvoid_t) NULL); -// Do the search: - return (JudySLPrevSub(PArray, Index, /* original = */ 1, - STRLEN(Index), PJError)); -} // JudySLPrev() - -// **************************************************************************** -// J U D Y S L P R E V S U B -// -// This is the "engine" for JudySLPrev() that knows whether its still looking -// for the original Index (exclusive) or a neighbor index (inclusive), and that -// expects aligned and len to already be computed (only once). See the header -// comments for JudySLPrev(). - -static PPvoid_t -JudySLPrevSub(Pcvoid_t PArray, uint8_t * Index, int orig, - Word_t len, // bytes remaining. - PJError_t PJError) // optional, for returning error info. -{ - Word_t indexword; // next word to find. - PPvoid_t PPValue; // from JudyL array. -// ORIGINAL SEARCH: -// -// When at a shortcut leaf, copy its remaining Index (string) chars into Index -// and return its value area if the current Index is after (greater than) the -// SCLs index; otherwise return null. - if (orig) - { - if (IS_PSCL(PArray)) - { - if ((PPValue = PPSCLVALUE_GT(Index, PArray)) != (PPvoid_t) NULL) - (void)STRCPY(Index, PSCLINDEX(PArray)); - return (PPValue); - } - -// If the current Index word: -// - is not the last word in Index (end of string), -// - exists in the current JudyL array, and, -// - a previous Index is found below it, return that Indexs value area. - - COPYSTRINGtoWORD(indexword, Index); // copy next 4[8] bytes. - if (len > WORDSIZE) // not at end of Index. - { - JLG(PPValue, PArray, indexword); - if (PPValue != (PPvoid_t) NULL) - { - -// If a previous JudySLIns() ran out of memory partway down the tree, it left a -// null *PPValue; this is automatically treated as a dead-end (not a core dump -// or assertion; see version 1.25): - - PPValue = JudySLPrevSub(*PPValue, Index + WORDSIZE, - /* original = */ 1, - len - WORDSIZE, PJError); - if (PPValue == PPJERR) - return (PPJERR); // propagate error. - if (PPValue != (PPvoid_t) NULL) - return (PPValue); // see above. - } - } - -// Search for previous index word: -// -// One of the above conditions is false. Search the current JudyL array for -// the Index word, if any, prior to the current index word. If none is found, -// return null; otherwise fall through to common later code. - - if ((PPValue = JudyLPrev(PArray, &indexword, PJError)) == PPJERR) - { - JudySLModifyErrno(PJError, PArray, orig ? PArray : (Pvoid_t)NULL); - return (PPJERR); - } - - if (PPValue == (PPvoid_t) NULL) - return ((PPvoid_t) NULL); // no previous index word. - } // if. - -// SUBSEQUENT SEARCH: -// -// A higher level search already excluded the initial Index, then found a -// previous index word, and is now traversing down to determine the rest of the -// Index and to obtain its value area. If at a shortcut leaf, return its value -// area. Otherwise search the current JudyL array backward from the upper -// limit for its last index word. If no index word is found, return null -- -// should never happen unless the JudySL tree is corrupt; otherwise fall -// through to common later code. - - else - { - if (IS_PSCL(PArray)) // at shortcut leaf. - { - (void)STRCPY(Index, PSCLINDEX(PArray)); - return (&PSCLVALUE(PArray)); - } - - indexword = ~0UL; - if ((PPValue = JudyLLast(PArray, &indexword, PJError)) == PPJERR) - { - JudySLModifyErrno(PJError, PArray, orig ? PArray : (Pvoid_t)NULL); - return (PPJERR); - } - -// If a previous JudySLIns() ran out of memory partway down the tree, it left a -// null *PPValue; this is automatically treated as a dead-end (not a core dump -// or assertion; see version 1.25): - - if (PPValue == (PPvoid_t) NULL) - return ((PPvoid_t) NULL); // no previous index word. - } - -// FOUND PREVIOUS INDEX WORD: -// -// A previous (if original) or last (if subsequent) index word was located in -// the current JudyL array. Store it into the callers Index (string). Then -// if the found (previous) Index ends here, return its value area; otherwise do -// a subsequent search below this point, which should never fail unless the -// JudySL tree is corrupt, but this is detected at a lower level by the above -// assertion. -// -// Note: Treat Index as unaligned, even if it is aligned, to avoid writing -// past the end of allocated memory (in case its less than a whole number of -// words). - - COPYWORDtoSTRING(Index, indexword); // copy next 4[8] bytes. - if (LASTWORD_BY_VALUE(indexword)) - return (PPValue); -// If a previous JudySLIns() ran out of memory partway down the tree, it left a -// null *PPValue; this is automatically treated as a dead-end (not a core dump -// or assertion; see version 1.25): - return (JudySLPrevSub(*PPValue, Index + WORDSIZE, /* original = */ 0, - len - WORDSIZE, PJError)); -} // JudySLPrevSub() - -// **************************************************************************** -// J U D Y S L N E X T -// -// See the comments in JudySLPrev(), which is very similar. -// -// TBD: Could the two functions call a common engine function with various -// subfunctions and other constants specified? - -PPvoid_t -JudySLNext(Pcvoid_t PArray, uint8_t * Index, PJError_t PJError) // optional, for returning error info. -{ -// Check for caller error (null pointer), or empty JudySL array: - - if (Index == (uint8_t *) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return (PPJERR); - } - - if (PArray == (Pvoid_t)NULL) - return ((PPvoid_t) NULL); -// Do the search: - return (JudySLNextSub(PArray, Index, /* original = */ 1, - STRLEN(Index), PJError)); -} // JudySLNext() - -// **************************************************************************** -// J U D Y S L N E X T S U B -// -// See the comments in JudySLPrevSub(), which is very similar. - -static PPvoid_t -JudySLNextSub(Pcvoid_t PArray, uint8_t * Index, int orig, - Word_t len, // bytes remaining. - PJError_t PJError) // optional, for returning error info. -{ - Word_t indexword; // next word to find. - PPvoid_t PPValue; // from JudyL array. - if (orig) - { - if (IS_PSCL(PArray)) - { - if ((PPValue = PPSCLVALUE_LT(Index, PArray)) != (PPvoid_t) NULL) - (void)STRCPY(Index, PSCLINDEX(PArray)); - return (PPValue); - } - - COPYSTRINGtoWORD(indexword, Index); // copy next 4[8] bytes. - - if (len > WORDSIZE) // not at end of Index. - { - JLG(PPValue, PArray, indexword); - if (PPValue != (PPvoid_t) NULL) - { -// If a previous JudySLIns() ran out of memory partway down the tree, it left a -// null *PPValue; this is automatically treated as a dead-end (not a core dump -// or assertion; see version 1.25): - - PPValue = JudySLNextSub(*PPValue, Index + WORDSIZE, - /* original = */ 1, - len - WORDSIZE, PJError); - if (PPValue == PPJERR) - return (PPJERR); // propagate error. - if (PPValue != (PPvoid_t) NULL) - return (PPValue); // see above. - } - } - - if ((PPValue = JudyLNext(PArray, &indexword, PJError)) == PPJERR) - { - JudySLModifyErrno(PJError, PArray, orig ? PArray : (Pvoid_t)NULL); - return (PPJERR); - } - - if (PPValue == (PPvoid_t) NULL) - return ((PPvoid_t) NULL); // no next index word. - } - else - { - if (IS_PSCL(PArray)) // at shortcut leaf. - { - (void)STRCPY(Index, PSCLINDEX(PArray)); - return (&PSCLVALUE(PArray)); - } - - indexword = 0; - if ((PPValue = JudyLFirst(PArray, &indexword, PJError)) == PPJERR) - { - JudySLModifyErrno(PJError, PArray, orig ? PArray : (Pvoid_t)NULL); - return (PPJERR); - } - -// If a previous JudySLIns() ran out of memory partway down the tree, it left a -// null *PPValue; this is automatically treated as a dead-end (not a core dump -// or assertion; see version 1.25): - - if (PPValue == (PPvoid_t) NULL) - return ((PPvoid_t) NULL); // no next index word. - } - - COPYWORDtoSTRING(Index, indexword); // copy next 4[8] bytes - if (LASTWORD_BY_VALUE(indexword)) - return (PPValue); -// If a previous JudySLIns() ran out of memory partway down the tree, it left a -// null *PPValue; this is automatically treated as a dead-end (not a core dump -// or assertion; see version 1.25): - return (JudySLNextSub(*PPValue, Index + WORDSIZE, /* original = */ 0, - len - WORDSIZE, PJError)); -} // JudySLNextSub() - -// **************************************************************************** -// J U D Y S L F I R S T -// -// Like JudyLFirst(), do a JudySLGet(), then if necessary a JudySLNext(). - -PPvoid_t -JudySLFirst(Pcvoid_t PArray, uint8_t * Index, PJError_t PJError) // optional, for returning error info. -{ - PPvoid_t PPValue; // from JudyL array. - if (Index == (uint8_t *) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return (PPJERR); - } - - if ((PPValue = JudySLGet(PArray, Index, PJError)) == PPJERR) - return (PPJERR); // propagate serious error. - if ((PPValue == (PPvoid_t) NULL) // first try failed. - && ((PPValue = JudySLNext(PArray, Index, PJError)) == PPJERR)) - { - return (PPJERR); // propagate serious error. - } - - return (PPValue); -} // JudySLFirst() - -// **************************************************************************** -// J U D Y S L L A S T -// -// Like JudyLLast(), do a JudySLGet(), then if necessary a JudySLPrev(). - -PPvoid_t -JudySLLast(Pcvoid_t PArray, uint8_t * Index, PJError_t PJError) // optional, for returning error info. -{ - PPvoid_t PPValue; // from JudyL array. - if (Index == (uint8_t *) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPINDEX); - return (PPJERR); - } - - if ((PPValue = JudySLGet(PArray, Index, PJError)) == PPJERR) - return (PPJERR); // propagate serious error. - if ((PPValue == (PPvoid_t) NULL) // first try failed. - && ((PPValue = JudySLPrev(PArray, Index, PJError)) == PPJERR)) - { - return (PPJERR); // propagate serious error. - } - - return (PPValue); -} // JudySLLast() - -// **************************************************************************** -// J U D Y S L F R E E A R R A Y -// -// Walk the JudySL tree of JudyL arrays to free each JudyL array, depth-first. -// During the walk, ignore indexes (strings) that end in the current JudyL -// array to be freed. Just recurse through those indexes which do not end, -// that is, those whose associated value areas point to subsidiary JudyL -// arrays, except for those which point to shortcut leaves. Return the total -// bytes freed in all of the JudyL arrays at or below the current level. -// -// Like the JudyLFreeArray() and Judy1FreeArray() code, this is written -// recursively, which is probably fast enough, to allow indexes (strings) of -// arbitrary size. If recursion turns out to be a problem, consider instead -// doing some large, fixed number of iterative descents (like 100) using a -// fixed-size "stack" (array), then recursing upon overflow (relatively -// rarely). - -Word_t -JudySLFreeArray(PPvoid_t PPArray, PJError_t PJError) // optional, for returning error info. -{ - PPvoid_t PPArrayOrig = PPArray; // for error reporting. - Word_t indexword = 0; // word just found. - PPvoid_t PPValue; // from Judy array. - Word_t bytes_freed = 0; // bytes freed at this level. - Word_t bytes_total = 0; // bytes freed at all levels. - if (PPArray == (PPvoid_t) NULL) - { - JU_SET_ERRNO(PJError, JU_ERRNO_NULLPPARRAY); - return (JERR); - } - -// FREE SHORTCUT LEAF: - - if (IS_PSCL(*PPArray)) - { - Word_t freewords; - Pscl_t Pscl; - - Pscl = CLEAR_PSCL(*PPArray); - - freewords = SCLSIZE(STRLEN(Pscl->scl_Index)); - - JudyFree((void *)Pscl, freewords); - - *PPArray = (Pvoid_t)NULL; - - return (freewords * WORDSIZE); - } - -// FREE EACH SUB-ARRAY (DEPTH-FIRST): -// -// If a previous JudySLIns() ran out of memory partway down the tree, it left a -// null *PPValue. This is automatically treated correctly here as a dead-end. -// -// An Index (string) ends in the current word iff the last byte of the -// (null-padded) word is null. - - for (PPValue = JudyLFirst(*PPArray, &indexword, PJError); - (PPValue != (PPvoid_t) NULL) && (PPValue != PPJERR); - PPValue = JudyLNext(*PPArray, &indexword, PJError)) - { - if (!LASTWORD_BY_VALUE(indexword)) - { - if ((bytes_freed = JudySLFreeArray(PPValue, PJError)) == JERR) - return (JERR); // propagate serious error. - bytes_total += bytes_freed; - } - } - -// Check for a serious error in a JudyL*() call: - - if (PPValue == PPJERR) - { - JudySLModifyErrno(PJError, *PPArray, *PPArrayOrig); - return (JERR); - } - -// Now free the current array, which also nulls the pointer: -// -// Note: *PPArray can be null here for a totally null JudySL array => -// JudyLFreeArray() returns zero. - - if ((bytes_freed = JudyLFreeArray(PPArray, PJError)) == JERR) - { - JudySLModifyErrno(PJError, *PPArray, *PPArrayOrig); - return (JERR); - } - return (bytes_total + bytes_freed); -} // JudySLFreeArray() diff --git a/libjudy/src/JudySL/Makefile.in b/libjudy/src/JudySL/Makefile.in deleted file mode 100644 index 9a986ba2de..0000000000 --- a/libjudy/src/JudySL/Makefile.in +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (C) 2006 Imperial College London and others. -# -# Please see the AUTHORS file in the main source directory for a full list -# of copyright holders. -# -# Prof. C Pain -# Applied Modelling and Computation Group -# Department of Earth Science and Engineering -# Imperial College London -# -# amcgsoftware@imperial.ac.uk -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation, -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA - -SHELL = @SHELL@ - -PACKAGE_NAME = @PACKAGE_NAME@ -FLUIDITY = $(PACKAGE_NAME) - -MPIF90 = @MPIF90@ - -CC = @CC@ -CFLAGS = @CPPFLAGS@ @CFLAGS@ @JUDY_CFLAGS@ -I../include -I/usr/local/include -I.. -I../JudyCommon - -MAKE = @MAKE@ - -LIBS = -L../lib -l$(FLUIDITY) @LIBS@ @BLAS_LIBS@ - -OBJS = JudySL.o - -.SUFFIXES: .f90 .F90 .cpp .c .o .a - -# cancel implicit rule that tries to make .o from .mod with m2c: -%.o: %.mod - -.c.o: - @echo " CC $<" - $(CC) $(CFLAGS) -c $< - -default: $(OBJS) - cp *.o ../obj/ - -clean: - rm -f *.o - diff --git a/libjudy/src/JudySL/README b/libjudy/src/JudySL/README deleted file mode 100644 index 6ca44b9f7f..0000000000 --- a/libjudy/src/JudySL/README +++ /dev/null @@ -1,6 +0,0 @@ -# @(#) $Revision: 4.3 $ $Source: /judy/src/JudySL/README $ -# -# This tree contains sources for the JudySL*() functions. - -JudySL.c source file -Note: JudySL.h is no longer needed (May 2004) diff --git a/libjudy/src/Makefile.in b/libjudy/src/Makefile.in deleted file mode 100644 index b6c5af20d7..0000000000 --- a/libjudy/src/Makefile.in +++ /dev/null @@ -1,18 +0,0 @@ -MAKE = @MAKE@ - -default: - mkdir -p obj - cd JudyCommon; $(MAKE); cd .. - cd Judy1; $(MAKE); cd .. - cd JudyL; $(MAKE); cd .. - cd JudySL; $(MAKE); cd .. - cd JudyHS; $(MAKE); cd .. - ar cr libjudy.a obj/*.o - -clean: - cd JudyCommon; $(MAKE) clean; cd .. - cd Judy1; $(MAKE) clean; cd .. - cd JudyL; $(MAKE) clean; cd .. - cd JudySL; $(MAKE) clean; cd .. - cd JudyHS; $(MAKE) clean; cd .. - rm -f obj/* libjudy.a diff --git a/libjudy/src/README b/libjudy/src/README deleted file mode 100644 index 5b2c858f3b..0000000000 --- a/libjudy/src/README +++ /dev/null @@ -1,20 +0,0 @@ -# @(#) $Revision: 4.10 $ $Source: /judy/src/README $ - -# This tree contains sources for the Judy project. - -# For more on how to build Judy files, see make_includes/README. - -The 'sh_build' script to compiling Judy manually for other platforms - -# Current stuff: - -Judy.h exported header file for libJudy.a -Judy.h.check.c test program for Judy.h - -JudyCommon/ shared utility functions and common source files -Judy1/ Judy1.h -JudyL/ JudyL.h -JudySL/ JudySL*() -JudyHS/ JudyHS*() - -apps/ applications done or redone using Judy diff --git a/libjudy/src/apps/README b/libjudy/src/apps/README deleted file mode 100644 index 096a7b23bf..0000000000 --- a/libjudy/src/apps/README +++ /dev/null @@ -1,21 +0,0 @@ -# @(#) $Revision: 4.4 $ $Source: /judy/src/apps/README $ -# -# This tree contains sources for Judy-related applications, that is, for -# sources including a main() function, suitable for building an executable -# program. Some of these sources are packaged and delivered to Judy users -# as an optional package of example sources. - -benchmark/ sources for benchmarking programs, that is, demos that - yield performance metrics; including sources for metrics - displayed on the Judy website - -demo/ sources for programs that demonstrate the use of Judy - but are probably not useful as templates for writing - Judy-based applications - -# misc/ other sources; none exist at this time; and as they come - along, they might go in misc/ or in other, more-specific - directories - -noship/ other example sources we are not free to deliver to Judy - users, or which it's inappropriate or premature to deliver diff --git a/libjudy/src/apps/demo/JudySort.c b/libjudy/src/apps/demo/JudySort.c deleted file mode 100644 index 05b70b040e..0000000000 --- a/libjudy/src/apps/demo/JudySort.c +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include -#include - -#include - -// By Doug Baskins Aug 2002 - for JudySL man page - -int // Usage: JudySort < file_to_sort -main() -{ - Pvoid_t PJArray = (PWord_t)NULL; // Judy array. - PWord_t PValue; // Judy array element. - Word_t Bytes; // size of JudySL array. - char Index[BUFSIZ]; // string to sort. - - while (fgets(Index, sizeof(Index), stdin) != (char *)NULL) - { - JSLI(PValue, PJArray, Index); // store string into array - ++(*PValue); // count instances of string - } - Index[0] = '\0'; // start with smallest string. - JSLF(PValue, PJArray, Index); // get first string - while (PValue != NULL) - { - while ((*PValue)--) // print duplicates - printf("%s", Index); - JSLN(PValue, PJArray, Index); // get next string - } - JSLFA(Bytes, PJArray); // free array - - fprintf(stderr, "The JudySL array used %lu bytes of memory\n", Bytes); - return (0); -} diff --git a/libjudy/src/apps/demo/Makefile_deliver b/libjudy/src/apps/demo/Makefile_deliver deleted file mode 100644 index ce84492a32..0000000000 --- a/libjudy/src/apps/demo/Makefile_deliver +++ /dev/null @@ -1,52 +0,0 @@ -# @(#) $Revision: 4.11 $ $Source: /judy/src/apps/demo/Makefile_deliver $ - -# Makefile for Judy demo programs. - -# Locations of Judy header file and library; correct if necessary: -# -# Note the use of the archive version (libJudy.a) for speed, although the -# difference from shared libs is not great on Linux. - -JUDY = /usr - -JUDY_INCDIR = $(JUDY)/include -JUDY_LIBDIR = $(JUDY)/lib -JUDY_HEADER = $(JUDY_INCDIR)/Judy.h -JUDY_LIBBASE = Judy -JUDY_LIB = $(JUDY_LIBDIR)/lib$(JUDY_LIBBASE).a - -DEBUG = -O -CFLAGS = $(DEBUG) -CC = cc - -# Place files locally by default: - -OBJS = interL.o interSL.o funhist.o JudySort.o -EXECS = interL interSL funhist JudySort - -# === RULES === - -all: $(EXECS) -debug:; make -f Makefile DEBUG='-g' - -# Unfortunately not all make programs understand filename generation via $(@F), -# or at least $$(@F) on a dependencies line, so spell out each $EXECS target -# separately: - -interL: interL.c $(JUDY_HEADER) $(JUDY_LIB) - $(CC) $(CFLAGS) -I $(JUDY_INCDIR) $(@F).c \ - -L$(JUDY_LIBDIR) -l$(JUDY_LIBBASE) -o $@ - -interSL: interSL.c $(JUDY_HEADER) $(JUDY_LIB) - $(CC) $(CFLAGS) -I $(JUDY_INCDIR) $(@F).c \ - -L$(JUDY_LIBDIR) -l$(JUDY_LIBBASE) -o $@ - -funhist: funhist.c $(JUDY_HEADER) $(JUDY_LIB) - $(CC) $(CFLAGS) -I $(JUDY_INCDIR) $(@F).c \ - -L$(JUDY_LIBDIR) -l$(JUDY_LIBBASE) -o $@ - -JudySort: JudySort.c $(JUDY_HEADER) $(JUDY_LIB) - $(CC) $(CFLAGS) -I $(JUDY_INCDIR) $(@F).c \ - -L$(JUDY_LIBDIR) -l$(JUDY_LIBBASE) -o $@ - -clean:; rm -rf core $(OBJS) $(EXECS) diff --git a/libjudy/src/apps/demo/README b/libjudy/src/apps/demo/README deleted file mode 100644 index 3e760c7035..0000000000 --- a/libjudy/src/apps/demo/README +++ /dev/null @@ -1,24 +0,0 @@ -# @(#) $Revision: 4.8 $ $Source: /judy/src/apps/demo/README $ - -# Demo programs to be included with the Judy distribution. - -README_deliver delivered with files from this directory, renamed to "README" - -run_demo simple Judy example script; explains, shows source code, - compiles and runs it - -Makefile_deliver - delivered as "Makefile"; by default, makes all the demo - programs; the libJudy.a and Judy.h locations might have - to be changed (via cc -I options) - NOTE: This file contains "#ifdef" directives that look - to make like comments, but don't expect the makefile to - run prior to unifdef'ing in the makefile. That is, use - the constructed version for a given platform. - -funhist.c function histogram program - -interL.c interactive JudyL program -interSL.c interactive JudySL program - -JudySort.c JudySL version of "sort -u" diff --git a/libjudy/src/apps/demo/README_deliver b/libjudy/src/apps/demo/README_deliver deleted file mode 100644 index 8946fee262..0000000000 --- a/libjudy/src/apps/demo/README_deliver +++ /dev/null @@ -1,17 +0,0 @@ -# @(#) $Revision: 4.5 $ $Source: /judy/src/apps/demo/README_deliver $ - -# Demo programs to be included with the Judy distribution. - -run_demo Simple Judy example script; explains, shows source code, - compiles and runs it. - -Makefile By default, makes all the demo programs. The libJudy.a - and Judy.h locations might have to be changed (via cc -I - options). - -funhist.c Function histogram program. - -interL.c Interactive JudyL program. -interSL.c Interactive JudySL program. - -JudySort.c JudySL version of "sort -u". diff --git a/libjudy/src/apps/demo/funhist.c b/libjudy/src/apps/demo/funhist.c deleted file mode 100644 index 0350e5172d..0000000000 --- a/libjudy/src/apps/demo/funhist.c +++ /dev/null @@ -1,243 +0,0 @@ -// @(#) $Revision: 4.5 $ $Source: /judy/src/apps/demo/funhist.c $ -// -// FUNCTION HISTOGRAM; JUDYL DEMO PROGRAM -// -// This program uses JudyL to create a histogram of data generated by the -// function random(3M). Other functions could be substituted in. -// -// The program generates n random numbers, stores them in a JudyL array -// and then prints a histogram. All aspects of the generation and -// histogram are timed so the user can see how long various JudyL functions -// take. -// -// -// This demonstrates: -// JLI (JudyLIns) -// JLF (JudyLFirst) -// JLL (JudyLLast) -// JLN (JudyLNext) -// JLC (JudyLCount) -// JLBC (JudyLByCount) -// how to access a JudyL value. -// -// Notice that using JudyL gives you fast stores and lookups as with hashing -// but without having to define a hash function, initialize the hash table -// or having to predetermine a good hash table size. It also gives you a -// sorted list at the same time. -// Also notice that JudyLCount is much faster than you can sequentially -// count items in an array. -// - -#include // random() -#include // printf() -#include // gettimeofday() -#include // JL*() routines - -// Default number of iterations (number of random numbers generated) -// This may be overridden on the command line - -#define DEFAULT_ITER 1000000 - -// The number of buckets the histogram is divided into. - -#define DEFAULT_HISTO_BUCKETS 32 - -// Macro for correction english output for plurals - -#define PLURAL(count) ((count == 1) ? "" : "s") - -// timing routines - -struct timeval TBeg, TEnd; -#define STARTTm gettimeofday(&TBeg, NULL) -#define ENDTm gettimeofday(&TEnd, NULL) -#define DeltaUSec \ - ((double)(TEnd.tv_sec - TBeg.tv_sec) * 1E6 + \ - (TEnd.tv_usec - TBeg.tv_usec)) - -// End of timing routines - -int -main(int argc, char **argv) -{ - Pvoid_t PJArray = NULL; // main JudyL array - // key is random number, value is repeat count - Pvoid_t PJCount = NULL; // second JudyL array - // key is repeat count (from PJArray) - // value is count of items with the same - // repeat count - Word_t Index; // index in JudyLFirst/Next loop - PWord_t PValue; // pointer to Judy array value - PWord_t PGenCount; // pointer to generation count - Word_t num_vals; // number of randoms to generate - Word_t iter; // for loop iteration - Word_t unique_nums; // number of unique randoms generated - Word_t random_num; // random number - Word_t median; // random number - Word_t tmp1, tmp2; // temporary variable - double random_gen_time; // time to generate random numbers - Word_t histo_incr; // histogram increment - unsigned long long ran_sum = 0; // sum of all generated randoms - -// TITLE - - printf("\nJudyL demonstration: random(3M) histogram\n"); - -// SET NUMBER OF RANDOMS TO GENERATE - - if (argc != 2) - { - // SET TO DEFAULT_ITER - num_vals = DEFAULT_ITER; - printf("Usage: %s [numvals]\n", argv[0]); - printf(" Since you did not specify a number of values, %ld\n", - num_vals); - printf(" will be used as the number of random numbers to insert\n"); - printf(" into the Judy array\n"); - } - else - { -// OVERRIDE NUMBER OF RANDOMS TO GENERATE - - num_vals = atol(argv[1]); - } - -// TIME THE GENERATION OF ALL THE RANDOM NUMBERS. THIS TIME IS LATER -// -// This time is later subtracted from the insert loop time so that the -// time it takes to do the actual JudyLIns can be isolated from the -// total time. - - printf("\ntiming random number generation\n"); - STARTTm; - for (iter = num_vals; iter; iter--) - { - random(); - } /* end of random number generator time */ - ENDTm; - random_gen_time = DeltaUSec; - printf("It took %.3f sec to generate %ld random numbers\n", - random_gen_time / 1000000, num_vals); - printf(" (ie. %.3f uSec/number)\n\n", random_gen_time / num_vals); - -// REGENERATE RANDOMS AND INSERT THEM INTO A JUDYL ARRAY - - printf("Please wait while the random numbers are inserted into\n"); - printf("a JudyL array (with a usage count) ...\n"); - - STARTTm; - for (iter = num_vals; iter; iter--) - { - random_num = (Word_t)random(); - - JLI(PValue, PJArray, random_num); - - /* increment hit count */ - (*PValue)++; - - /* sum the random number */ - ran_sum += random_num; - } /* end of random number generator time */ - ENDTm; - printf("That took %.3f uSec/Index.\n", - (DeltaUSec - random_gen_time) / num_vals); - -// COUNT THE NUMBER OF ELEMENTS IN THE JUDYL ARRAY -// IE. COUNT THE NUMBER OF UNIQUE RANDOM NUMBERS - - JLC(unique_nums, PJArray, 0, -1); - printf("\nThere were %ld unique random numbers generated\n", unique_nums); - -// FIND HOW MANY NUMBERS WERE GENERATED ONCE, TWICE, ... -// -// Create a new JudyL array where the index is the count from PJArray -// and the value is a count of the number of elements with that count. - - if (unique_nums != num_vals) - { - printf("\nLooping through the entire Judy array to create a\n"); - printf("new Judy counting array (PJCount in the source code)\n"); - printf("...\n"); - - STARTTm; - Index = 0; - JLF(PValue, PJArray, Index); - while (PValue != (PWord_t)NULL) - { - JLI(PGenCount, PJCount, *PValue); - - (*PGenCount)++; // increment hit count - - JLN(PValue, PJArray, Index); - } - ENDTm; - - printf("That took %.3f Secs or %.3f uSec/Index\n\n", - DeltaUSec / 1000000, DeltaUSec / unique_nums); - -// PRINT DUPLICATES HISTOGRAM - - printf("Duplicates Histogram:\n"); - - Index = 0; - JLF(PValue, PJCount, Index); - while (PValue != (PWord_t)NULL) - { - printf(" %ld numbers were generated %ld time%s\n", - *PValue, Index, PLURAL(Index)); - - JLN(PValue, PJCount, Index); - } - } - -// PRINT DISTRIBUTION HISTOGRAM - - printf("\nCompute the random number distribution by counting index ranges\n"); - - histo_incr = ((Word_t)~0L / DEFAULT_HISTO_BUCKETS) >> 1; - - Index = 0L; - for (iter = 0; iter < DEFAULT_HISTO_BUCKETS; iter++) - { - Word_t Count; - - JLC(Count, PJArray, Index, Index + histo_incr); - printf(" %ld unique values from 0x%08lx - 0x%08lx\n", Count, - Index, Index + histo_incr); - - Index += histo_incr + 1; - - } - -// PRINT MEAN (average), -// MEDIAN (middle value, or average of two middle values) -// RANGE (low and high value) - - tmp1 = (Word_t)(ran_sum / (long long)num_vals); - printf(" mean: 0x%lx\n", tmp1); - -// If there were an even number of randoms generated, then average -// the two middle numbers. Otherwise, the mean is the middle value - if (num_vals & 1) - { - JLBC(PValue, PJArray, num_vals / 2, tmp1); - JLBC(PValue, PJArray, (num_vals / 2) + 1, tmp2); - median = (tmp1 + tmp2) / 2; - } - else - { - JLBC(PValue, PJArray, (num_vals + 1) / 2, median); - } - printf(" median: 0x%lx\n", median); - - Index = 0; - JLF(PValue, PJArray, Index); - printf("first random generated: 0x%lx\n", Index); - - Index = ~0; - JLL(PValue, PJArray, Index); - printf(" last random generated: 0x%lx\n", Index); - - return (0); - -} // main() diff --git a/libjudy/src/apps/demo/interL.c b/libjudy/src/apps/demo/interL.c deleted file mode 100644 index 9ac3de9301..0000000000 --- a/libjudy/src/apps/demo/interL.c +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include - -main() // Simple JudyL demo, see "run_demo" script; @(#) $Revision: 4.4 $ -{ - Pvoid_t Parray = (Pvoid_t) NULL; // empty JudyL array. - Word_t * Pvalue; // value for one index. - char line[BUFSIZ]; // input line. - Word_t index; // in JudyL array. - - printf("Interactive Judy demo program to input, sort, and list numbers.\n" - "Enter a number: "); // fflush(stdout); ? - - while (fgets(line, BUFSIZ, stdin)) // input. - { - index = strtoul(line, NULL, 0); // note: bad input => 0. - JLI(Pvalue, Parray, index); // insert index in JudyL array. - ++(*Pvalue); // count duplicates. - - printf(" Index Dups\n"); // print all saved indexes: - index = 0; // start search at zero. - JLF(Pvalue, Parray, index); // find first saved index. - - while (Pvalue != NULL) - { - printf("%12lu %5lu\n", index, *Pvalue); - JLN(Pvalue, Parray, index); // find next saved index. - } - printf("Next: "); // fflush(stdout); ? - } -} diff --git a/libjudy/src/apps/demo/interSL.c b/libjudy/src/apps/demo/interSL.c deleted file mode 100644 index 0fca37f57c..0000000000 --- a/libjudy/src/apps/demo/interSL.c +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (C) 2000 - 2002 Hewlett-Packard Company -// -// This program is free software; you can redistribute it and/or modify it -// under the term of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 2 of the License, or (at your -// option) any later version. -// -// This 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 Lesser General Public License -// for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// _________________ - -// @(#) $Revision: 4.5 $ $Source: /judy/src/apps/demo/interSL.c $ -// -// INTERACTIVE JUDYSL DEMO PROGRAM -// -// This program is a very simple interactive demonstration of JudySL. Text -// keywords are entered. The program uses that text as a key into a JudySL -// array and increments a usage count. -// -// Keys can be single keywords like, "mykey", or multiple words like, "now is -// the time for the quick brown fox to take the bull by the horns". -// -// The program recognizes the following keywords as special: -// -// CMD_LIST lists all the currently entered keys and their counts -// CMD_QUIT terminates the program -// -// This program demonstrates: -// -// JudySLIns -// JudySLFirst -// JudySLNext -// how to access a JudySL value -// -// Note: Using JudySL gives you fast lookups as with hashing but without -// having to define a hash function, and without having to predetermine the -// hash table size. It also gives you a sorted list at the same time. - -#include -#include -#include - -#include "Judy.h" - -// Commands recognized by the program: - -#define CMD_LIST "list" -#define CMD_QUIT "quit" - -#define PLURAL(count) ((count == 1) ? "" : "s") - -main() -{ - char Index [BUFSIZ]; // value from user. - void ** PPValue; // associated with Index. - void * PArray = (Pvoid_t) NULL; // JudySL array. - JError_t JError; // Judy error structure - char * Pc; // place in string. - -// EMIT INSTRUCTIONS: - - (void) puts ("JudySL interactive demonstration:"); - (void) puts ("When asked for input, enter some text or:"); - (void) printf ("- \"%s\" to list previously entered text or\n", CMD_LIST); - (void) printf ("- \"%s\" (or EOF) to quit the program\n\n", CMD_QUIT); - - -// ACCEPT COMMANDS: - - while (1) - { - (void) printf ("\nEnter key/list/quit: "); - (void) fflush (stdout); - - if (fgets (Index, BUFSIZ, stdin) == (char *) NULL) - break; - - if ((Pc = strchr (Index, '\n')) != (char *) NULL) - *Pc = '\0'; // strip trailing newline. - -// QUIT: - - if (! strcmp (Index, CMD_QUIT)) break; - - -// LIST ALL INPUT IN ALPHABETICAL ORDER: - - if (! strcmp (Index, CMD_LIST)) - { - Index[0] = '\0'; - - for (PPValue = JudySLFirst (PArray, Index, 0); - PPValue != (PPvoid_t) NULL; - PPValue = JudySLNext (PArray, Index, 0)) - { - (void) printf (" \"%s\" stored %lu time%s\n", - Index, *((PWord_t) PPValue), - PLURAL (*((PWord_t) PPValue))); - } - - continue; - } - - -// ALL OTHER VALUES ARE KEYS: -// -// Insert Index into the array. If Index already exists, JudySLIns() returns a -// pointer to the old value. If Index doesn't already exist, then a slot is -// created and a pointer to this slot (initialized to zero) is returned. - - if ((PPValue = JudySLIns (& PArray, Index, &JError)) == PPJERR) - { // assume out of memory. - (void) printf ("Error %d, cannot insert \"%s\" in array.\n", - JU_ERRNO(&JError), Index); - exit (1); - } - - ++(*((PWord_t) PPValue)); // increment usage count. - - (void) printf (" \"%s\" stored %ld time%s\n", - Index, *((PWord_t) PPValue), - PLURAL (*((PWord_t) PPValue))); - - } // while 1 (continuous loop until user quits) - - exit (0); - /*NOTREACHED*/ - -} // main() diff --git a/libjudy/src/apps/demo/run_demo b/libjudy/src/apps/demo/run_demo deleted file mode 100755 index 5a94b45956..0000000000 --- a/libjudy/src/apps/demo/run_demo +++ /dev/null @@ -1,64 +0,0 @@ -# @(#) $Revision: 4.4 $ $Source: /judy/src/apps/demo/run_demo $ - -# Simple Judy example script. See the first block of text below, or just run -# this with no arguments. - - BASE='interL' - PROGRAM="$BASE.c" - COMPILE="cc -I../.. -o $BASE $PROGRAM `find ../../ -name libJudy.a`" - - set -e # exit if anything goes wrong. - - -# GREET THE USER: - - cat <<-'EOF' - This script illustrates a simple program that calls the Judy library, - shows how to compile it, and then runs it for you. - - The program reads numbers from standard input and stores them in a - JudyL array as array indexes. The target value associated with each - number (index) is the number of times it was duplicated in the input. - Exit with ^D or ^C. - - Press RETURN to continue and view the program source code... - EOF - - read input - - -# SHOW THE SAMPLE C PROGRAM: - - echo '____________________________________' - echo - - cat $PROGRAM - - echo - echo 'Press RETURN to continue...' - read input - - -# COMPILE THE SAMPLE C PROGRAM: - - cat <<-EOF - - To compile this program with the Judy library already installed on your - system, the simplest command line is: - - $COMPILE - - Press RETURN to continue and compile the program source code... - EOF - - read input - $COMPILE - - -# RUN THE SAMPLE C PROGRAM: - - echo - echo "Press RETURN to run the sample program \"$BASE\"..." - read input - - ./$BASE diff --git a/libjudy/src/build.bat b/libjudy/src/build.bat deleted file mode 100755 index 7c7432f93f..0000000000 --- a/libjudy/src/build.bat +++ /dev/null @@ -1,185 +0,0 @@ -@ECHO OFF - -echo Set Compiler -SET CC=cl - -echo Set Options -SET COPT=-DJU_WIN -SET O=-DJUDY1 -SET L=-DJUDYL -SET INC=-I.. -I..\JudyCommon - -echo Deleting Old Files -del JudyCommon\*.obj JudySL\*.obj JudyHS\*.obj Judy1\*.obj JudyL\*.obj *.dll - -echo Giving Judy1 the proper Names -copy JudyCommon\JudyByCount.c Judy1\Judy1ByCount.c -copy JudyCommon\JudyCascade.c Judy1\Judy1Cascade.c -copy JudyCommon\JudyCount.c Judy1\Judy1Count.c -copy JudyCommon\JudyCreateBranch.c Judy1\Judy1CreateBranch.c -copy JudyCommon\JudyDecascade.c Judy1\Judy1Decascade.c -copy JudyCommon\JudyDel.c Judy1\Judy1Unset.c -copy JudyCommon\JudyFirst.c Judy1\Judy1First.c -copy JudyCommon\JudyFreeArray.c Judy1\Judy1FreeArray.c -copy JudyCommon\JudyGet.c Judy1\Judy1Test.c -copy JudyCommon\JudyGet.c Judy1\j__udy1Test.c -copy JudyCommon\JudyInsArray.c Judy1\Judy1SetArray.c -copy JudyCommon\JudyIns.c Judy1\Judy1Set.c -copy JudyCommon\JudyInsertBranch.c Judy1\Judy1InsertBranch.c -copy JudyCommon\JudyMallocIF.c Judy1\Judy1MallocIF.c -copy JudyCommon\JudyMemActive.c Judy1\Judy1MemActive.c -copy JudyCommon\JudyMemUsed.c Judy1\Judy1MemUsed.c -copy JudyCommon\JudyPrevNext.c Judy1\Judy1Next.c -copy JudyCommon\JudyPrevNext.c Judy1\Judy1Prev.c -copy JudyCommon\JudyPrevNextEmpty.c Judy1\Judy1NextEmpty.c -copy JudyCommon\JudyPrevNextEmpty.c Judy1\Judy1PrevEmpty.c -copy JudyCommon\JudyTables.c Judy1\Judy1TablesGen.c - -echo Giving JudyL the proper Names -copy JudyCommon\JudyByCount.c JudyL\JudyLByCount.c -copy JudyCommon\JudyCascade.c JudyL\JudyLCascade.c -copy JudyCommon\JudyCount.c JudyL\JudyLCount.c -copy JudyCommon\JudyCreateBranch.c JudyL\JudyLCreateBranch.c -copy JudyCommon\JudyDecascade.c JudyL\JudyLDecascade.c -copy JudyCommon\JudyDel.c JudyL\JudyLDel.c -copy JudyCommon\JudyFirst.c JudyL\JudyLFirst.c -copy JudyCommon\JudyFreeArray.c JudyL\JudyLFreeArray.c -copy JudyCommon\JudyGet.c JudyL\JudyLGet.c -copy JudyCommon\JudyGet.c JudyL\j__udyLGet.c -copy JudyCommon\JudyInsArray.c JudyL\JudyLInsArray.c -copy JudyCommon\JudyIns.c JudyL\JudyLIns.c -copy JudyCommon\JudyInsertBranch.c JudyL\JudyLInsertBranch.c -copy JudyCommon\JudyMallocIF.c JudyL\JudyLMallocIF.c -copy JudyCommon\JudyMemActive.c JudyL\JudyLMemActive.c -copy JudyCommon\JudyMemUsed.c JudyL\JudyLMemUsed.c -copy JudyCommon\JudyPrevNext.c JudyL\JudyLNext.c -copy JudyCommon\JudyPrevNext.c JudyL\JudyLPrev.c -copy JudyCommon\JudyPrevNextEmpty.c JudyL\JudyLNextEmpty.c -copy JudyCommon\JudyPrevNextEmpty.c JudyL\JudyLPrevEmpty.c -copy JudyCommon\JudyTables.c JudyL\JudyLTablesGen.c - - -echo Compile JudyCommon\JudyMalloc - common to Judy1 and JudyL -cd JudyCommon -%CC% -I. -I.. -DJU_WIN -c JudyMalloc.c - -cd .. - -echo This table is constructed from Juudy1.h data to match malloc(3) needs -cd Judy1 -%CC% %INC% %COPT% %O% Judy1TablesGen.c -o Judy1TablesGen -del Judy1TablesGen.obj -Judy1TablesGen -%CC% %INC% %COPT% %O% -c Judy1Tables.c - -echo compile the main line Judy1 modules -echo %CC% %INC% %COPT% %O% -c Judy1Test.c -%CC% %INC% %COPT% %O% -c Judy1Test.c -echo %CC% %INC% %COPT% %O% -c -DJUDYGETINLINE j__udy1Test.c -%CC% %INC% %COPT% %O% -c -DJUDYGETINLINE j__udy1Test.c -echo %CC% %INC% %COPT% %O% -c Judy1Set.c -%CC% %INC% %COPT% %O% -c Judy1Set.c -echo %CC% %INC% %COPT% %O% -c Judy1SetArray.c -%CC% %INC% %COPT% %O% -c Judy1SetArray.c -echo %CC% %INC% %COPT% %O% -c Judy1Unset.c -%CC% %INC% %COPT% %O% -c Judy1Unset.c -echo %CC% %INC% %COPT% %O% -c Judy1First.c -%CC% %INC% %COPT% %O% -c Judy1First.c -echo %CC% %INC% %COPT% %O% -DJUDYNEXT -c Judy1Next.c -%CC% %INC% %COPT% %O% -DJUDYNEXT -c Judy1Next.c -echo %CC% %INC% %COPT% %O% -DJUDYPREV -c Judy1Prev.c -%CC% %INC% %COPT% %O% -DJUDYPREV -c Judy1Prev.c -echo %CC% %INC% %COPT% %O% -DJUDYNEXT -c Judy1NextEmpty.c -%CC% %INC% %COPT% %O% -DJUDYNEXT -c Judy1NextEmpty.c -echo %CC% %INC% %COPT% %O% -DJUDYPREV -c Judy1PrevEmpty.c -%CC% %INC% %COPT% %O% -DJUDYPREV -c Judy1PrevEmpty.c -echo %CC% %INC% %COPT% %O% -c Judy1Count.c -%CC% %INC% %COPT% %O% -c Judy1Count.c -echo %CC% %INC% %COPT% %O% -c -DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB Judy1ByCount.c -%CC% %INC% %COPT% %O% -c -DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB Judy1ByCount.c -echo %CC% %INC% %COPT% %O% -c Judy1FreeArray.c -%CC% %INC% %COPT% %O% -c Judy1FreeArray.c -echo %CC% %INC% %COPT% %O% -c Judy1MemUsed.c -%CC% %INC% %COPT% %O% -c Judy1MemUsed.c -echo %CC% %INC% %COPT% %O% -c Judy1MemActive.c -%CC% %INC% %COPT% %O% -c Judy1MemActive.c -echo %CC% %INC% %COPT% %O% -c Judy1Cascade.c -%CC% %INC% %COPT% %O% -c Judy1Cascade.c -echo %CC% %INC% %COPT% %O% -c Judy1Decascade.c -%CC% %INC% %COPT% %O% -c Judy1Decascade.c -echo %CC% %INC% %COPT% %O% -c Judy1CreateBranch.c -%CC% %INC% %COPT% %O% -c Judy1CreateBranch.c -echo %CC% %INC% %COPT% %O% -c Judy1InsertBranch.C -%CC% %INC% %COPT% %O% -c Judy1InsertBranch.C -echo %CC% %INC% %COPT% %O% -c Judy1MallocIF.c -%CC% %INC% %COPT% %O% -c Judy1MallocIF.c - -cd .. -cd JudyL - -echo This table is constructed from Juudy1.h data to match malloc(3) needs -%CC% %INC% %COPT% JudyLTablesGen.c %L% -o JudyLTablesGen -del JudyLTablesGen.obj -JudyLTablesGen -%CC% %INC% %COPT% %L% -c JudyLTables.c - -echo compile the main line JudyL modules -echo %CC% %INC% %COPT% %L% -c JudyLGet.c -%CC% %INC% %COPT% %L% -c JudyLGet.c -echo %CC% %INC% %COPT% %L% -c -DJUDYGETINLINE j__udyLGet.c -%CC% %INC% %COPT% %L% -c -DJUDYGETINLINE j__udyLGet.c -echo %CC% %INC% %COPT% %L% -c JudyLIns.c -%CC% %INC% %COPT% %L% -c JudyLIns.c -echo %CC% %INC% %COPT% %L% -c JudyLInsArray.c -%CC% %INC% %COPT% %L% -c JudyLInsArray.c -echo %CC% %INC% %COPT% %L% -c JudyLDel.c -%CC% %INC% %COPT% %L% -c JudyLDel.c -echo %CC% %INC% %COPT% %L% -c JudyLFirst.c -%CC% %INC% %COPT% %L% -c JudyLFirst.c -echo %CC% %INC% %COPT% %L% -c -DJUDYNEXT JudyLNext.c -%CC% %INC% %COPT% %L% -c -DJUDYNEXT JudyLNext.c -echo %CC% %INC% %COPT% %L% -c -DJUDYPREV JudyLPrev.c -%CC% %INC% %COPT% %L% -c -DJUDYPREV JudyLPrev.c -echo %CC% %INC% %COPT% %L% -c -DJUDYNEXT JudyLNextEmpty.c -%CC% %INC% %COPT% %L% -c -DJUDYNEXT JudyLNextEmpty.c -echo %CC% %INC% %COPT% %L% -c -DJUDYPREV JudyLPrevEmpty.c -%CC% %INC% %COPT% %L% -c -DJUDYPREV JudyLPrevEmpty.c -echo %CC% %INC% %COPT% %L% -c JudyLCount.c -%CC% %INC% %COPT% %L% -c JudyLCount.c -echo %CC% %INC% %COPT% %L% -c -DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB JudyLByCount.c -%CC% %INC% %COPT% %L% -c -DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB JudyLByCount.c -echo %CC% %INC% %COPT% %L% -c JudyLFreeArray.c -%CC% %INC% %COPT% %L% -c JudyLFreeArray.c -echo %CC% %INC% %COPT% %L% -c JudyLMemUsed.c -%CC% %INC% %COPT% %L% -c JudyLMemUsed.c -echo %CC% %INC% %COPT% %L% -c JudyLMemActive.c -%CC% %INC% %COPT% %L% -c JudyLMemActive.c -echo %CC% %INC% %COPT% %L% -c JudyLCascade.c -%CC% %INC% %COPT% %L% -c JudyLCascade.c -echo %CC% %INC% %COPT% %L% -c JudyLDecascade.c -%CC% %INC% %COPT% %L% -c JudyLDecascade.c -echo %CC% %INC% %COPT% %L% -c JudyLCreateBranch.c -%CC% %INC% %COPT% %L% -c JudyLCreateBranch.c -echo %CC% %INC% %COPT% %L% -c JudyLInsertBranch.c -%CC% %INC% %COPT% %L% -c JudyLInsertBranch.c -echo %CC% %INC% %COPT% %L% -c JudyLMallocIF.c -%CC% %INC% %COPT% %L% -c JudyLMallocIF.c - -cd .. -cd JudySL -echo Compile the JudySL routine -echo %CC% %INC% %COPT% -c JudySL.c -%CC% %INC% %COPT% -c JudySL.c - -cd .. -cd JudyHS -echo Compile the JudyHS routine -echo %CC% %INC% %COPT% -c JudyHS.c -%CC% %INC% %COPT% -c JudyHS.c - -cd .. -echo Make a Judy dll by linking all the objects togeather -link /DLL JudyCommon\*.obj Judy1\*.obj JudyL\*.obj JudySL\*.obj JudyHS\*.obj /OUT:Judy.dll - -echo Make a Judy archive library by linking all the objects togeather -link /LIB JudyCommon\*.obj Judy1\*.obj JudyL\*.obj JudySL\*.obj JudyHS\*.obj /OUT:Judy.lib diff --git a/libjudy/src/sh_build b/libjudy/src/sh_build deleted file mode 100755 index 743fca2979..0000000000 --- a/libjudy/src/sh_build +++ /dev/null @@ -1,206 +0,0 @@ -echo "--- This is a compile kit to suggest how to port to your machine" -echo "--- This script runs in 7 seconds on a 3.2Ghz Pentium P4C" -echo "--- Must be in the 'src' directory to execute this script" -echo "--- I normally run it like: COPT='-O3 -march=i686' sh_build" - -echo "--- Set Compiler" -CC='cc' - -echo "--- Set Optimization" -# COPT='-O' - -echo "--- Set Shared library option" -# CPIC='-fPIC -CPIC='' - -echo "--- Compile JudyMalloc - common to Judy1 and JudyL" -echo "--- cd JudyCommon" -cd JudyCommon -rm -f *.o -$CC $COPT $CPIC -I. -I.. -c JudyMalloc.c -echo "--- cd .." -cd .. - -echo "--- Give Judy1 the proper names" -echo "--- cd Judy1" -cd Judy1 -rm -f *.o -ln -sf ../JudyCommon/JudyByCount.c Judy1ByCount.c -ln -sf ../JudyCommon/JudyCascade.c Judy1Cascade.c -ln -sf ../JudyCommon/JudyCount.c Judy1Count.c -ln -sf ../JudyCommon/JudyCreateBranch.c Judy1CreateBranch.c -ln -sf ../JudyCommon/JudyDecascade.c Judy1Decascade.c -ln -sf ../JudyCommon/JudyDel.c Judy1Unset.c -ln -sf ../JudyCommon/JudyFirst.c Judy1First.c -ln -sf ../JudyCommon/JudyFreeArray.c Judy1FreeArray.c -ln -sf ../JudyCommon/JudyGet.c Judy1Test.c -ln -sf ../JudyCommon/JudyGet.c j__udy1Test.c -ln -sf ../JudyCommon/JudyInsArray.c Judy1SetArray.c -ln -sf ../JudyCommon/JudyIns.c Judy1Set.c -ln -sf ../JudyCommon/JudyInsertBranch.c Judy1InsertBranch.c -ln -sf ../JudyCommon/JudyMallocIF.c Judy1MallocIF.c -ln -sf ../JudyCommon/JudyMemActive.c Judy1MemActive.c -ln -sf ../JudyCommon/JudyMemUsed.c Judy1MemUsed.c -ln -sf ../JudyCommon/JudyPrevNext.c Judy1Next.c -ln -sf ../JudyCommon/JudyPrevNext.c Judy1Prev.c -ln -sf ../JudyCommon/JudyPrevNextEmpty.c Judy1NextEmpty.c -ln -sf ../JudyCommon/JudyPrevNextEmpty.c Judy1PrevEmpty.c -ln -sf ../JudyCommon/JudyTables.c Judy1TablesGen.c - - -echo "--- This table is constructed from Judy1.h data to match malloc(3) needs" -echo "--- $CC $COPT -I. -I.. -I../JudyCommon -DJUDY1 Judy1TablesGen.c -o Judy1TablesGen" -$CC $COPT -I. -I.. -I../JudyCommon -DJUDY1 Judy1TablesGen.c -o Judy1TablesGen -rm -f *.o -./Judy1TablesGen -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1Tables.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1Tables.c - -echo "--- Compile the main line Judy1 modules" -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1Test.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1Test.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 -DJUDYGETINLINE j__udy1Test.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 -DJUDYGETINLINE j__udy1Test.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1Set.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1Set.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1SetArray.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1SetArray.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1Unset.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1Unset.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1First.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1First.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 -DJUDYNEXT Judy1Next.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 -DJUDYNEXT Judy1Next.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 -DJUDYPREV Judy1Prev.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 -DJUDYPREV Judy1Prev.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 -DJUDYNEXT Judy1NextEmpty.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 -DJUDYNEXT Judy1NextEmpty.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 -DJUDYPREV Judy1PrevEmpty.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 -DJUDYPREV Judy1PrevEmpty.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1Count.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1Count.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 -DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB Judy1ByCount.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 -DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB Judy1ByCount.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1FreeArray.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1FreeArray.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1MemUsed.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1MemUsed.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1MemActive.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1MemActive.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1Cascade.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1Cascade.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1Decascade.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1Decascade.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1CreateBranch.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1CreateBranch.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1InsertBranch.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1InsertBranch.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1MallocIF.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDY1 Judy1MallocIF.c -echo "--- cd .." -cd .. - -echo "--- Give JudyL the proper names" -echo "--- cd JudyL" -cd JudyL -rm -f *.o -ln -sf ../JudyCommon/JudyByCount.c JudyLByCount.c -ln -sf ../JudyCommon/JudyCascade.c JudyLCascade.c -ln -sf ../JudyCommon/JudyCount.c JudyLCount.c -ln -sf ../JudyCommon/JudyCreateBranch.c JudyLCreateBranch.c -ln -sf ../JudyCommon/JudyDecascade.c JudyLDecascade.c -ln -sf ../JudyCommon/JudyDel.c JudyLDel.c -ln -sf ../JudyCommon/JudyFirst.c JudyLFirst.c -ln -sf ../JudyCommon/JudyFreeArray.c JudyLFreeArray.c -ln -sf ../JudyCommon/JudyGet.c JudyLGet.c -ln -sf ../JudyCommon/JudyGet.c j__udyLGet.c -ln -sf ../JudyCommon/JudyInsArray.c JudyLInsArray.c -ln -sf ../JudyCommon/JudyIns.c JudyLIns.c -ln -sf ../JudyCommon/JudyInsertBranch.c JudyLInsertBranch.c -ln -sf ../JudyCommon/JudyMallocIF.c JudyLMallocIF.c -ln -sf ../JudyCommon/JudyMemActive.c JudyLMemActive.c -ln -sf ../JudyCommon/JudyMemUsed.c JudyLMemUsed.c -ln -sf ../JudyCommon/JudyPrevNext.c JudyLNext.c -ln -sf ../JudyCommon/JudyPrevNext.c JudyLPrev.c -ln -sf ../JudyCommon/JudyPrevNextEmpty.c JudyLNextEmpty.c -ln -sf ../JudyCommon/JudyPrevNextEmpty.c JudyLPrevEmpty.c -ln -sf ../JudyCommon/JudyTables.c JudyLTablesGen.c - -echo "--- This table is constructed from JudyL.h data to match malloc(3) needs" -echo "--- $CC $COPT -I. -I.. -I../JudyCommon -DJUDYL JudyLTablesGen.c -o JudyLTablesGen" -$CC $COPT -I. -I.. -I../JudyCommon -DJUDYL JudyLTablesGen.c -o JudyLTablesGen -rm -f *.o -./JudyLTablesGen -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLTables.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLTables.c - -echo "--- Compile the main line JudyL modules" -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLGet.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLGet.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL -DJUDYGETINLINE j__udyLGet.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL -DJUDYGETINLINE j__udyLGet.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLIns.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLIns.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLIns.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLInsArray.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLDel.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLDel.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLFirst.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLFirst.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL -DJUDYNEXT JudyLNext.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL -DJUDYNEXT JudyLNext.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL -DJUDYPREV JudyLPrev.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL -DJUDYPREV JudyLPrev.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL -DJUDYNEXT JudyLNextEmpty.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL -DJUDYNEXT JudyLNextEmpty.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL -DJUDYPREV JudyLPrevEmpty.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL -DJUDYPREV JudyLPrevEmpty.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLCount.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLCount.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL -DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB JudyLByCount.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL -DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB JudyLByCount.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLFreeArray.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLFreeArray.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLMemUsed.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLMemUsed.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLMemActive.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLMemActive.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLCascade.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLCascade.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLDecascade.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLDecascade.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLCreateBranch.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLCreateBranch.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLInsertBranch.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLInsertBranch.c -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLMallocIF.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c -DJUDYL JudyLMallocIF.c -echo "--- cd .." -cd .. - -echo "--- Compile the JudySL routine" -echo "--- cd JudySL" -cd JudySL -rm -f *.o -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c JudySL.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c JudySL.c -echo "--- cd .." -cd .. -echo "--- Compile the JudyHS routine" -echo "--- cd JudyHS" -cd JudyHS -rm -f *.o -echo "--- $CC $COPT $CPIC -I. -I.. -I../JudyCommon -c JudyHS.c" -$CC $COPT $CPIC -I. -I.. -I../JudyCommon -c JudyHS.c -echo "--- cd .." -cd .. - -# Make a Judy shared library with CPIC='-fPIC' above -#ld -shared -o libJudy.so Judy*/*.o -# -# -OR- -# -echo "--- Make a Judy static library" -ar -r libJudy.a Judy*/*.o - -echo "--- Done" diff --git a/libjudy/test/Centrino_1.3Mhz_Plots/Hash_CO.plot b/libjudy/test/Centrino_1.3Mhz_Plots/Hash_CO.plot deleted file mode 100644 index b4d2f0aacf..0000000000 --- a/libjudy/test/Centrino_1.3Mhz_Plots/Hash_CO.plot +++ /dev/null @@ -1,565 +0,0 @@ -# StringCompare -n14962357 -A Hash -H1048576 -P40 -L10 -C -M100000 /home/data/domnames.txt -# This file is in a format to input to 'jbgraph' -# XLABEL Stored -# YLABEL Microseconds / Index -# COLHEAD 1 Total Insert attempts -# COLHEAD 2 Number Gets -# COLHEAD 3 Duplicate strings -# COLHEAD 4 Insert Time (uS) -# COLHEAD 5 Get Time (uS) -# COLHEAD 6 Hash Chain Length -# COLHEAD 7 Average RAM/String -# Linux localhost 2.6.3-4mdkenterprise #1 SMP Tue Mar 2 07:00:53 CET 2004 i686 -# 32 Bit CPU -# Processor speed compiled at 1299 Mhz -# Hash record struct: sizeof(hrec_t) = 16 -# Allocate Hash table = 1048576 elements -# 11218731 (75.0%) non-Word_t aligned string buffers -# Ram used for input data = 372621771 bytes -# Average string length = 15.9 bytes -# 3200000 bytes malloc() for 'cached' strings for Get measurement -# Access Time = 0.103 uS average per string (mostly from Cache) -# HashStr() Time = 0.270 uS average per string (mostly from Cache) -# Access Time = 0.287 uS average per string (mostly from RAM) -# HashStr() Time = 0.477 uS average per string (mostly from RAM) -# Pass 0 -# TotInserts DeltaGets DupStrs InsTime GetTime HChainLen Ram/String -# 1 1 0 5775.911 1.182 1.000000 4194356.0 -# 2 2 0 3.406 0.417 1.000000 2097190.0 -# 3 3 0 1.251 0.374 1.000000 1398136.0 -# 4 4 0 1.465 0.380 1.000000 1048610.0 -# 5 5 0 1.154 0.363 1.000000 838893.6 -# 6 6 0 0.996 0.347 1.000000 699082.0 -# 7 7 0 1.109 0.356 1.000000 599217.7 -# 8 8 0 1.564 0.347 1.000000 524318.5 -# 9 9 0 1.189 0.355 1.000000 466064.4 -# 10 10 0 1.176 0.352 1.000000 419460.8 -# 11 11 0 1.268 0.359 1.000000 381330.9 -# 12 12 0 1.264 0.364 1.000000 349556.0 -# 13 13 0 1.357 0.363 1.000000 322669.2 -# 14 14 0 1.467 0.364 1.000000 299623.7 -# 15 15 0 1.070 0.366 1.000000 279650.9 -# 16 16 0 1.404 0.375 1.000000 262175.0 -# 17 17 0 1.544 0.367 1.000000 246754.4 -# 18 18 0 0.851 0.364 1.000000 233047.1 -# 19 19 0 1.139 0.366 1.000000 220783.2 -# 20 20 0 1.238 0.366 1.000000 209745.4 -# 21 21 0 1.195 0.363 1.000000 199758.9 -# 22 22 0 1.176 0.365 1.000000 190680.4 -# 23 23 0 13.957 0.366 1.000000 182391.1 -# 24 24 0 1.159 0.361 1.000000 174792.5 -# 25 25 0 1.288 0.356 1.000000 167801.8 -# 26 26 0 1.179 0.357 1.000000 161348.9 -# 27 27 0 1.204 0.361 1.000000 155374.4 -# 28 28 0 1.125 0.359 1.000000 149826.1 -# 29 29 0 1.052 0.359 1.000000 144660.8 -# 30 30 0 2.443 0.368 1.000000 139839.6 -# 31 31 0 1.527 0.368 1.000000 135330.2 -# 32 32 0 1.390 0.365 1.000000 131102.0 -# 34 34 0 1.179 0.365 1.000000 123391.6 -# 36 36 0 1.034 0.366 1.000000 116538.3 -# 38 38 0 1.010 0.368 1.000000 110406.4 -# 40 40 0 1.142 0.367 1.000000 104887.5 -# 42 42 0 0.941 0.366 1.000000 99894.2 -# 44 44 0 1.292 0.368 1.000000 95355.0 -# 46 46 0 1.072 0.369 1.000000 91210.5 -# 48 48 0 0.946 0.365 1.000000 87411.2 -# 50 50 0 1.057 0.375 1.000000 83916.0 -# 53 53 0 1.134 0.368 1.000000 79168.0 -# 56 56 0 1.022 0.367 1.000000 74928.4 -# 59 59 0 0.736 0.364 1.000000 71119.7 -# 62 62 0 1.059 0.364 1.000000 67680.0 -# 65 65 0 1.049 0.364 1.000000 64557.7 -# 69 69 0 1.011 0.365 1.000000 60816.9 -# 73 73 0 0.864 0.359 1.000000 57485.9 -# 77 77 0 0.998 0.359 1.000000 54501.0 -# 81 81 0 0.989 0.361 1.000000 51811.2 -# 85 85 0 0.977 0.362 1.000000 49374.4 -# 90 90 0 1.068 0.369 1.000000 46633.3 -# 95 95 0 0.741 0.366 1.000000 44180.3 -# 100 100 0 0.886 0.364 1.000000 41972.7 -# 106 106 0 0.892 0.362 1.000000 39598.4 -# 112 112 0 0.932 0.361 1.000000 37478.6 -# 118 118 0 0.902 0.363 1.000000 35574.5 -# 125 125 0 0.973 0.363 1.000000 33584.0 -# 132 132 0 1.011 0.362 1.000000 31804.5 -# 139 139 0 1.878 0.366 1.000000 30204.3 -# 147 147 0 0.888 0.361 1.000000 28562.1 -# 155 155 0 1.028 0.362 1.000000 27089.4 -# 164 164 0 0.903 2.031 1.000000 25604.5 -# 173 173 0 1.077 0.372 1.000000 24273.9 -# 183 183 0 0.920 0.362 1.000000 22949.1 -# 194 194 0 0.882 0.364 1.000000 21649.6 -# 205 205 0 0.909 0.363 1.000000 20489.5 -# 217 217 0 0.903 0.363 1.000000 19358.1 -# 230 230 0 0.888 0.362 1.000000 18265.5 -# 243 243 0 0.885 0.360 1.000000 17289.9 -# 257 257 0 1.200 0.360 1.000000 16349.6 -# 272 272 0 1.403 0.362 1.000000 15449.7 -# 288 288 0 0.915 0.368 1.000000 14593.1 -# 305 305 0 0.926 0.365 1.000000 13781.5 -# 323 323 0 0.933 0.366 1.000000 13015.2 -# 342 342 0 0.931 0.387 1.000000 12293.8 -# 362 362 0 0.889 0.367 1.000000 11616.2 -# 383 383 0 1.089 0.367 1.000000 10981.0 -# 405 405 0 0.866 0.368 1.000000 10386.1 -# 429 429 0 0.915 0.368 1.000000 9806.8 -# 454 454 0 0.875 0.369 1.000000 9268.3 -# 480 480 0 0.898 0.366 1.000000 8767.9 -# 508 508 0 1.044 0.380 1.000000 8286.3 -# 538 538 0 0.859 0.368 1.000000 7825.8 -# 569 569 0 0.917 0.366 1.000000 7401.0 -# 602 602 0 0.987 0.365 1.000000 6996.9 -# 637 637 0 0.888 0.364 1.000000 6614.1 -# 674 674 0 0.918 0.375 1.001484 6252.6 -# 714 714 0 0.983 0.367 1.001401 5904.0 -# 756 756 0 0.860 0.373 1.001323 5577.6 -# 800 800 0 0.874 0.365 1.001250 5272.5 -# 847 847 0 0.963 0.372 1.001181 4981.5 -# 897 897 0 0.883 0.363 1.001115 4705.5 -# 950 950 0 0.968 0.372 1.001053 4444.6 -# 1006 1006 0 0.911 0.364 1.000994 4198.8 -# 1065 1065 0 1.088 0.366 1.001878 3967.9 -# 1128 1128 0 0.888 0.369 1.001773 3747.9 -# 1194 1194 0 0.942 0.372 1.001675 3542.4 -# 1264 1264 0 0.864 0.365 1.001582 3347.8 -# 1339 1339 0 0.908 0.367 1.001494 3162.0 -# 1418 1418 0 0.913 0.366 1.001410 2987.4 -# 1502 1502 0 0.849 0.367 1.001332 2822.0 -# 1591 1591 0 0.922 0.369 1.001257 2665.8 -# 1685 1685 0 0.903 0.369 1.001187 2518.7 -# 1784 1784 0 0.880 0.370 1.001121 2380.6 -# 1884 1884 0 0.879 0.375 1.001062 2255.7 -# 1995 1995 0 0.921 0.388 1.001504 2131.9 -# 2113 2113 0 0.895 0.379 1.001420 2014.5 -# 2239 2239 0 0.858 0.380 1.001340 1902.7 -# 2371 2371 0 0.884 0.386 1.001265 1798.4 -# 2512 2512 0 0.918 0.392 1.001194 1699.1 -# 2661 2661 0 0.865 0.411 1.001503 1605.6 -# 2818 2818 0 0.897 0.407 1.002129 1517.8 -# 2985 2985 0 0.859 0.444 1.002010 1434.5 -# 3162 3162 0 0.931 0.439 1.001898 1355.9 -# 3350 3350 0 0.863 0.428 1.002388 1281.5 -# 3548 3548 0 0.879 0.434 1.002537 1211.6 -# 3758 3758 0 0.934 0.450 1.002661 1145.5 -# 3981 3981 0 0.908 0.459 1.002763 1083.0 -# 4217 4217 0 0.908 0.469 1.003083 1024.1 -# 4467 4467 0 0.905 0.477 1.002910 968.4 -# 4732 4732 0 0.869 0.487 1.002747 915.8 -# 5012 5012 0 0.918 0.499 1.003192 866.3 -# 5309 5309 0 0.868 0.508 1.003390 819.5 -# 5623 5623 0 0.887 0.515 1.003913 775.4 -# 5957 5957 0 0.906 0.520 1.004532 733.6 -# 6310 6310 0 0.887 0.559 1.004596 694.2 -# 6683 6683 0 0.916 0.532 1.004788 657.1 -# 7079 7079 0 0.897 0.535 1.004662 622.0 -# 7499 7499 0 0.904 0.544 1.004534 588.8 -# 7943 7943 0 0.911 0.618 1.004658 557.5 -# 8414 8414 0 0.918 0.559 1.004635 528.0 -# 8913 8913 0 1.030 0.614 1.004937 500.1 -# 9441 9441 0 0.989 0.551 1.005614 473.7 -# 10000 10000 0 0.930 0.552 1.005500 448.9 -# 10593 10593 0 0.923 0.629 1.005947 425.4 -# 11220 11220 0 0.929 0.556 1.005793 403.3 -# 11885 11885 0 0.914 0.574 1.005890 382.4 -# 12589 12589 0 0.906 0.583 1.006116 362.6 -# 13335 13335 0 0.919 0.561 1.006224 344.0 -# 14125 14125 0 0.912 0.576 1.006796 326.4 -# 14962 14962 0 1.057 0.565 1.007018 309.8 -# 15849 15849 0 0.903 0.568 1.007193 294.1 -# 16788 16788 0 0.896 0.575 1.007744 279.3 -# 17783 17783 0 1.004 0.572 1.008154 265.3 -# 18836 18836 0 0.908 0.575 1.008335 252.1 -# 19953 19953 0 0.918 0.593 1.008871 239.6 -# 21135 21135 0 0.913 0.580 1.009558 227.9 -# 22387 22387 0 0.911 0.593 1.010184 216.8 -# 23714 23714 0 0.910 0.598 1.010880 206.3 -# 25119 25119 0 0.901 0.605 1.011744 196.4 -# 26607 26607 0 0.919 0.590 1.012553 187.1 -# 28184 28184 0 0.896 0.598 1.013163 178.2 -# 29854 29854 0 0.888 0.603 1.013633 169.9 -# 31623 31623 0 1.012 0.597 1.014704 162.1 -# 33497 33497 0 0.889 0.608 1.015554 154.6 -# 35481 35481 0 0.902 0.617 1.016319 147.6 -# 37584 37584 0 0.895 0.605 1.017481 141.0 -# 39811 39811 0 0.896 0.617 1.018337 134.8 -# 42170 42170 0 0.892 0.609 1.019753 128.9 -# 44668 44668 0 0.893 0.617 1.021201 123.3 -# 47315 47315 0 0.895 0.613 1.022678 118.1 -# 50119 50119 0 0.894 0.627 1.024322 113.1 -# 53088 53088 0 0.891 0.618 1.025599 108.4 -# 56234 56234 0 0.937 0.632 1.026728 104.0 -# 59566 59566 0 0.886 0.625 1.027734 99.8 -# 63096 63096 0 1.071 0.627 1.029923 95.9 -# 66834 66834 0 0.927 0.635 1.031825 92.2 -# 70795 70795 0 0.883 0.634 1.033703 88.7 -# 74989 74989 0 0.914 0.631 1.035152 85.4 -# 79433 79433 0 0.879 0.632 1.037453 82.2 -# 84140 84140 0 0.887 0.635 1.039458 79.3 -# 89125 89125 0 0.884 0.636 1.042098 76.5 -# 94406 94406 0 0.885 0.638 1.044764 73.8 -# 100000 100000 0 0.881 0.639 1.047350 71.3 -# 105925 100000 0 0.884 0.640 1.050080 69.0 -# 112202 100000 0 0.919 0.662 1.053600 66.8 -# 118850 100000 0 0.897 0.647 1.057100 64.7 -# 125893 100000 0 0.901 0.652 1.059820 62.7 -# 133352 100000 0 0.884 0.651 1.063240 60.9 -# 141254 100000 0 0.888 0.650 1.067290 59.1 -# 149624 100000 0 0.916 0.653 1.071780 57.4 -# 158489 100000 0 0.940 0.657 1.075130 55.9 -# 167880 100000 0 0.913 0.659 1.082310 54.4 -# 177828 100000 0 0.899 0.671 1.085360 53.0 -# 188365 100000 0 0.897 0.664 1.090720 51.7 -# 199526 100000 0 0.915 0.668 1.096770 50.4 -# 211349 100000 0 0.928 0.665 1.101930 49.3 -# 223872 100000 0 0.934 0.670 1.108100 48.2 -# 237137 100000 0 0.926 0.667 1.113690 47.1 -# 251189 100000 0 0.955 0.675 1.119180 46.1 -# 266073 100000 0 0.911 0.693 1.128930 45.2 -# 281838 100000 0 0.918 0.676 1.136280 44.3 -# 298538 100000 0 0.929 0.685 1.145900 43.5 -# 316228 100000 0 0.922 0.686 1.153400 42.7 -# 334965 100000 0 0.936 0.688 1.162440 41.9 -# 354813 100000 0 0.956 0.694 1.172560 41.2 -# 375837 100000 0 0.958 0.692 1.183690 40.6 -# 398107 100000 0 0.959 0.699 1.193780 40.0 -# 421697 100000 0 0.942 0.702 1.204740 39.4 -# 446684 100000 0 0.955 0.700 1.215820 38.8 -# 473151 100000 0 0.952 0.713 1.228310 38.3 -# 501187 100000 0 0.962 0.713 1.241420 37.8 -# 530884 100000 0 0.964 0.714 1.257920 37.3 -# 562341 100000 0 0.979 0.711 1.272740 36.9 -# 595662 100000 0 1.003 0.714 1.289160 36.5 -# 630957 100000 0 1.015 0.722 1.303190 36.1 -# 668344 100000 0 1.020 0.730 1.322380 35.7 -# 707946 100000 0 1.026 0.737 1.341750 35.4 -# 749894 100000 0 1.015 0.743 1.368090 35.0 -# 794328 100000 0 1.019 0.744 1.384790 34.7 -# 841395 100000 0 1.030 0.746 1.408600 34.4 -# 891251 100000 0 1.045 0.753 1.434040 34.1 -# 944061 100000 0 1.049 0.778 1.456490 33.9 -# 1000000 100000 0 1.057 0.766 1.485870 33.6 -# 1059254 100000 0 1.066 0.768 1.513600 33.4 -# 1122018 100000 0 1.106 0.778 1.542830 33.2 -# 1188502 100000 0 1.090 0.790 1.577200 33.0 -# 1258925 100000 0 1.138 0.792 1.612530 32.8 -# 1333521 100000 0 1.121 0.811 1.645650 32.6 -# 1412538 100000 0 1.135 0.810 1.682130 32.4 -# 1496236 100000 0 1.159 0.820 1.722840 32.2 -# 1584893 100000 0 1.171 0.847 1.765690 32.1 -# 1678804 100000 0 1.185 0.844 1.817750 31.9 -# 1778279 100000 0 1.202 0.853 1.864700 31.8 -# 1883649 100000 0 1.222 0.867 1.912490 31.7 -# 1995262 100000 0 1.242 0.876 1.967780 31.5 -# 2113489 100000 0 1.263 0.896 2.020420 31.4 -# 2238721 100000 0 1.286 0.922 2.075790 31.3 -# 2371374 100000 0 1.320 0.929 2.146300 31.2 -# 2511886 100000 0 1.335 0.945 2.209570 31.1 -# 2660725 100000 0 1.363 0.944 2.293110 31.0 -# 2818383 100000 0 1.391 0.960 2.360800 30.9 -# 2985383 100000 0 1.422 0.978 2.446730 30.8 -# 3162278 100000 0 1.461 1.009 2.537540 30.8 -# 3349654 100000 0 1.501 1.016 2.622900 30.7 -# 3548134 100000 0 1.533 1.060 2.710860 30.6 -# 3758374 100000 0 1.578 1.062 2.824550 30.5 -# 3981072 100000 0 1.622 1.273 2.922530 30.5 -# 4216965 100000 0 1.673 1.115 3.041830 30.4 -# 4466836 100000 0 1.729 1.160 3.149510 30.4 -# 4731513 100000 0 1.784 1.178 3.292520 30.3 -# 5011872 100000 0 1.854 1.216 3.433090 30.3 -# 5308844 100000 0 1.946 1.262 3.576600 30.2 -# 5623413 100000 0 1.958 1.262 3.719150 30.2 -# 5956621 100000 0 2.022 1.496 3.885680 30.1 -# 6309573 100000 0 2.180 1.357 4.057750 30.1 -# 6683439 100000 0 2.196 1.383 4.250390 30.1 -# 7079458 100000 0 2.257 1.431 4.444160 30.0 -# 7498942 100000 0 2.340 1.482 4.640880 30.0 -# 7943282 100000 0 2.445 1.525 4.852800 29.9 -# 8413951 100000 0 2.547 1.595 5.074780 29.9 -# 8912509 100000 0 2.691 1.656 5.320130 29.9 -# 9440609 100000 0 2.798 1.696 5.560000 29.9 -# 10000000 100000 0 2.996 1.784 5.853460 29.8 -# 10592537 100000 0 3.087 1.862 6.153020 29.8 -# 11220185 100000 0 3.233 1.922 6.430500 29.8 -# 11885022 100000 0 3.384 2.104 6.773630 29.8 -# 12589254 100000 0 3.566 2.118 7.090330 29.7 -# 13335214 100000 0 3.768 2.197 7.450920 29.7 -# 14125375 100000 0 7.923 2.316 7.868460 29.7 -# 14962357 100000 0 4.145 2.436 8.259020 29.7 -# Total Duplicate strings = 0 -# Begin HashFreeArray()... -# returned 444133848 bytes -# Free 14962357 strings, 0.312 uSecs Ave/string - -# Pass 1 -# Pass 2 -# Pass 3 -# Pass 4 -# Pass 5 -# Pass 6 -# Pass 7 -# Pass 8 -# Pass 9 -# TotInserts 0 0 InsTime GetTime 0 Ram/String - 1 0 0 5775.911 0.901 0 4194352.000 - 2 0 0 1.096 0.317 0 2097190.000 - 3 0 0 0.883 0.309 0 1398134.667 - 4 0 0 0.846 0.311 0 1048607.000 - 5 0 0 0.776 0.305 0 838890.400 - 6 0 0 0.911 0.296 0 699079.333 - 7 0 0 0.796 0.306 0 599215.429 - 8 0 0 0.711 0.302 0 524316.500 - 9 0 0 0.817 0.292 0 466061.333 - 10 0 0 0.633 0.295 0 419458.000 - 11 0 0 0.701 0.297 0 381328.000 - 12 0 0 0.732 0.307 0 349553.333 - 13 0 0 0.829 0.312 0 322667.385 - 14 0 0 0.778 0.317 0 299621.429 - 15 0 0 0.659 0.312 0 279648.267 - 16 0 0 0.871 0.319 0 262172.250 - 17 0 0 0.845 0.317 0 246752.000 - 18 0 0 0.851 0.321 0 233045.111 - 19 0 0 0.889 0.324 0 220781.263 - 20 0 0 0.923 0.329 0 209743.800 - 21 0 0 0.697 0.333 0 199757.905 - 22 0 0 0.646 0.329 0 190679.455 - 23 0 0 0.773 0.326 0 182390.261 - 24 0 0 1.035 0.325 0 174791.833 - 25 0 0 0.833 0.321 0 167801.120 - 26 0 0 0.834 0.323 0 161348.462 - 27 0 0 0.705 0.328 0 155373.778 - 28 0 0 0.666 0.331 0 149825.714 - 29 0 0 0.752 0.341 0 144660.414 - 30 0 0 0.728 0.342 0 139839.333 - 31 0 0 0.814 0.339 0 135329.290 - 32 0 0 0.931 0.339 0 131101.125 - 34 0 0 0.895 0.336 0 123391.412 - 36 0 0 0.888 0.339 0 116537.889 - 38 0 0 0.784 0.344 0 110406.526 - 40 0 0 0.985 0.348 0 104887.900 - 42 0 0 0.843 0.351 0 99894.381 - 44 0 0 0.914 0.348 0 95355.364 - 46 0 0 0.801 0.348 0 91210.609 - 48 0 0 0.875 0.347 0 87411.500 - 50 0 0 0.831 0.347 0 83916.240 - 53 0 0 0.856 0.346 0 79167.698 - 56 0 0 0.932 0.348 0 74928.286 - 59 0 0 0.736 0.346 0 71119.932 - 62 0 0 0.787 0.348 0 67680.000 - 65 0 0 0.862 0.348 0 64557.723 - 69 0 0 0.814 0.349 0 60817.043 - 73 0 0 0.864 0.350 0 57486.521 - 77 0 0 0.787 0.347 0 54501.662 - 81 0 0 0.900 0.351 0 51811.556 - 85 0 0 0.938 0.348 0 49374.824 - 90 0 0 0.947 0.347 0 46633.333 - 95 0 0 0.741 0.348 0 44180.337 - 100 0 0 0.844 0.347 0 41972.760 - 106 0 0 0.812 0.343 0 39598.604 - 112 0 0 0.899 0.347 0 37478.893 - 118 0 0 0.854 0.351 0 35574.508 - 125 0 0 0.914 0.351 0 33583.840 - 132 0 0 0.937 0.349 0 31804.333 - 139 0 0 0.902 0.352 0 30204.259 - 147 0 0 0.877 0.357 0 28562.122 - 155 0 0 0.853 0.358 0 27089.394 - 164 0 0 0.875 0.359 0 25604.463 - 173 0 0 0.833 0.359 0 24273.873 - 183 0 0 0.873 0.358 0 22948.962 - 194 0 0 0.848 0.357 0 21649.381 - 205 0 0 0.908 0.356 0 20489.190 - 217 0 0 0.876 0.358 0 19357.862 - 230 0 0 0.853 0.358 0 18265.443 - 243 0 0 0.884 0.358 0 17289.745 - 257 0 0 0.893 0.359 0 16349.479 - 272 0 0 0.857 0.358 0 15449.441 - 288 0 0 0.897 0.357 0 14592.708 - 305 0 0 0.848 0.356 0 13780.997 - 323 0 0 0.862 0.356 0 13014.625 - 342 0 0 0.891 0.357 0 12293.158 - 362 0 0 0.882 0.355 0 11615.613 - 383 0 0 0.876 0.356 0 10980.261 - 405 0 0 0.866 0.353 0 10385.363 - 429 0 0 0.863 0.353 0 9805.874 - 454 0 0 0.875 0.352 0 9267.436 - 480 0 0 0.881 0.351 0 8766.933 - 508 0 0 0.893 0.352 0 8285.331 - 538 0 0 0.859 0.352 0 7824.952 - 569 0 0 0.885 0.352 0 7400.239 - 602 0 0 0.881 0.354 0 6996.252 - 637 0 0 0.869 0.354 0 6613.495 - 674 0 0 0.887 0.356 0 6252.095 - 714 0 0 0.896 0.355 0 5903.445 - 756 0 0 0.860 0.356 0 5577.132 - 800 0 0 0.874 0.356 0 5271.980 - 847 0 0 0.890 0.357 0 4981.096 - 897 0 0 0.883 0.358 0 4705.137 - 950 0 0 0.871 0.357 0 4444.261 - 1006 0 0 0.887 0.358 0 4198.489 - 1065 0 0 0.853 0.358 0 3967.485 - 1128 0 0 0.873 0.357 0 3747.500 - 1194 0 0 0.866 0.361 0 3541.889 - 1264 0 0 0.864 0.359 0 3347.323 - 1339 0 0 0.860 0.356 0 3161.422 - 1418 0 0 0.860 0.356 0 2986.928 - 1502 0 0 0.849 0.358 0 2821.534 - 1591 0 0 0.877 0.364 0 2665.373 - 1685 0 0 0.844 0.363 0 2518.345 - 1784 0 0 0.865 0.367 0 2380.206 - 1884 0 0 0.861 0.364 0 2255.410 - 1995 0 0 0.861 0.366 0 2131.501 - 2113 0 0 0.866 0.370 0 2014.101 - 2239 0 0 0.843 0.375 0 1902.385 - 2371 0 0 0.864 0.376 0 1798.111 - 2512 0 0 0.840 0.382 0 1698.838 - 2661 0 0 0.843 0.385 0 1605.371 - 2818 0 0 0.846 0.391 0 1517.550 - 2985 0 0 0.843 0.398 0 1434.277 - 3162 0 0 0.850 0.404 0 1355.667 - 3350 0 0 0.835 0.411 0 1281.236 - 3548 0 0 0.828 0.420 0 1211.372 - 3758 0 0 0.835 0.431 0 1145.315 - 3981 0 0 0.836 0.442 0 1082.816 - 4217 0 0 0.825 0.454 0 1023.862 - 4467 0 0 0.844 0.465 0 968.220 - 4732 0 0 0.843 0.479 0 915.636 - 5012 0 0 0.822 0.486 0 866.150 - 5309 0 0 0.841 0.494 0 819.341 - 5623 0 0 0.837 0.503 0 775.233 - 5957 0 0 0.843 0.511 0 733.438 - 6310 0 0 0.845 0.522 0 694.063 - 6683 0 0 0.846 0.525 0 656.970 - 7079 0 0 0.853 0.530 0 621.868 - 7499 0 0 0.859 0.533 0 588.692 - 7943 0 0 0.848 0.536 0 557.414 - 8414 0 0 0.856 0.540 0 527.846 - 8913 0 0 0.865 0.545 0 499.951 - 9441 0 0 0.861 0.548 0 473.625 - 10000 0 0 0.866 0.547 0 448.798 - 10593 0 0 0.863 0.553 0 425.316 - 11220 0 0 0.869 0.551 0 403.170 - 11885 0 0 0.867 0.557 0 382.254 - 12589 0 0 0.887 0.553 0 362.524 - 13335 0 0 0.876 0.556 0 343.869 - 14125 0 0 0.876 0.562 0 326.281 - 14962 0 0 0.867 0.565 0 309.669 - 15849 0 0 0.871 0.564 0 293.998 - 16788 0 0 0.870 0.565 0 279.188 - 17783 0 0 0.874 0.571 0 265.211 - 18836 0 0 0.875 0.569 0 252.031 - 19953 0 0 0.873 0.577 0 239.567 - 21135 0 0 0.877 0.575 0 227.808 - 22387 0 0 0.870 0.577 0 216.718 - 23714 0 0 0.866 0.581 0 206.233 - 25119 0 0 0.874 0.589 0 196.347 - 26607 0 0 0.876 0.590 0 187.010 - 28184 0 0 0.871 0.594 0 178.199 - 29854 0 0 0.865 0.593 0 169.872 - 31623 0 0 0.872 0.597 0 162.009 - 33497 0 0 0.873 0.603 0 154.597 - 35481 0 0 0.870 0.605 0 147.609 - 37584 0 0 0.865 0.605 0 140.993 - 39811 0 0 0.871 0.606 0 134.766 - 42170 0 0 0.864 0.609 0 128.870 - 44668 0 0 0.865 0.614 0 123.302 - 47315 0 0 0.860 0.613 0 118.054 - 50119 0 0 0.864 0.618 0 113.093 - 53088 0 0 0.862 0.618 0 108.425 - 56234 0 0 0.863 0.621 0 104.002 - 59566 0 0 0.863 0.625 0 99.831 - 63096 0 0 0.862 0.627 0 95.893 - 66834 0 0 0.862 0.631 0 92.175 - 70795 0 0 0.859 0.630 0 88.667 - 74989 0 0 0.860 0.631 0 85.352 - 79433 0 0 0.863 0.632 0 82.232 - 84140 0 0 0.862 0.635 0 79.274 - 89125 0 0 0.861 0.636 0 76.479 - 94406 0 0 0.864 0.638 0 73.849 - 100000 0 0 0.864 0.639 0 71.366 - 105925 0 0 0.865 0.640 0 69.019 - 112202 0 0 0.863 0.645 0 66.805 - 118850 0 0 0.863 0.647 0 64.713 - 125893 0 0 0.868 0.647 0 62.739 - 133352 0 0 0.867 0.651 0 60.869 - 141254 0 0 0.871 0.650 0 59.111 - 149624 0 0 0.868 0.653 0 57.449 - 158489 0 0 0.872 0.656 0 55.878 - 167880 0 0 0.874 0.656 0 54.398 - 177828 0 0 0.880 0.661 0 53.002 - 188365 0 0 0.880 0.664 0 51.683 - 199526 0 0 0.879 0.663 0 50.439 - 211349 0 0 0.884 0.665 0 49.262 - 223872 0 0 0.887 0.663 0 48.152 - 237137 0 0 0.890 0.667 0 47.102 - 251189 0 0 0.892 0.668 0 46.115 - 266073 0 0 0.895 0.675 0 45.180 - 281838 0 0 0.898 0.676 0 44.298 - 298538 0 0 0.896 0.679 0 43.463 - 316228 0 0 0.905 0.678 0 42.674 - 334965 0 0 0.909 0.686 0 41.935 - 354813 0 0 0.907 0.690 0 41.231 - 375837 0 0 0.913 0.689 0 40.570 - 398107 0 0 0.918 0.694 0 39.944 - 421697 0 0 0.925 0.696 0 39.353 - 446684 0 0 0.932 0.694 0 38.796 - 473151 0 0 0.939 0.698 0 38.271 - 501187 0 0 0.942 0.706 0 37.772 - 530884 0 0 0.949 0.704 0 37.306 - 562341 0 0 0.957 0.711 0 36.863 - 595662 0 0 0.960 0.714 0 36.446 - 630957 0 0 0.967 0.722 0 36.050 - 668344 0 0 0.974 0.724 0 35.680 - 707946 0 0 0.980 0.725 0 35.329 - 749894 0 0 0.999 0.738 0 35.001 - 794328 0 0 0.996 0.738 0 34.687 - 841395 0 0 1.010 0.744 0 34.392 - 891251 0 0 1.016 0.748 0 34.112 - 944061 0 0 1.032 0.753 0 33.849 - 1000000 0 0 1.036 0.760 0 33.601 - 1059254 0 0 1.044 0.768 0 33.363 - 1122018 0 0 1.063 0.778 0 33.143 - 1188502 0 0 1.076 0.787 0 32.933 - 1258925 0 0 1.090 0.789 0 32.737 - 1333521 0 0 1.105 0.802 0 32.550 - 1412538 0 0 1.122 0.810 0 32.374 - 1496236 0 0 1.135 0.820 0 32.206 - 1584893 0 0 1.159 0.831 0 32.048 - 1678804 0 0 1.165 0.844 0 31.900 - 1778279 0 0 1.184 0.849 0 31.760 - 1883649 0 0 1.212 0.864 0 31.628 - 1995262 0 0 1.233 0.876 0 31.503 - 2113489 0 0 1.246 0.890 0 31.386 - 2238721 0 0 1.268 0.905 0 31.276 - 2371374 0 0 1.294 0.914 0 31.171 - 2511886 0 0 1.322 0.923 0 31.073 - 2660725 0 0 1.340 0.944 0 30.980 - 2818383 0 0 1.382 0.960 0 30.890 - 2985383 0 0 1.408 0.978 0 30.807 - 3162278 0 0 1.434 1.008 0 30.728 - 3349654 0 0 1.485 1.016 0 30.654 - 3548134 0 0 1.529 1.043 0 30.583 - 3758374 0 0 1.560 1.062 0 30.518 - 3981072 0 0 1.601 1.090 0 30.455 - 4216965 0 0 1.660 1.114 0 30.397 - 4466836 0 0 1.703 1.136 0 30.341 - 4731513 0 0 1.751 1.163 0 30.289 - 5011872 0 0 1.809 1.199 0 30.239 - 5308844 0 0 1.869 1.229 0 30.192 - 5623413 0 0 1.942 1.260 0 30.148 - 5956621 0 0 2.013 1.299 0 30.106 - 6309573 0 0 2.076 1.338 0 30.067 - 6683439 0 0 2.155 1.376 0 30.030 - 7079458 0 0 2.244 1.420 0 29.994 - 7498942 0 0 2.320 1.474 0 29.961 - 7943282 0 0 2.421 1.519 0 29.929 - 8413951 0 0 2.526 1.576 0 29.900 - 8912509 0 0 2.640 1.630 0 29.871 - 9440609 0 0 2.759 1.694 0 29.845 - 10000000 0 0 2.886 1.759 0 29.820 - 10592537 0 0 3.012 1.844 0 29.798 - 11220185 0 0 3.169 1.917 0 29.776 - 11885022 0 0 3.336 2.002 0 29.756 - 12589254 0 0 3.493 2.081 0 29.737 - 13335214 0 0 3.697 2.178 0 29.718 - 14125375 0 0 3.867 2.272 0 29.700 - 14962357 0 0 4.091 2.388 0 29.683 diff --git a/libjudy/test/Centrino_1.3Mhz_Plots/JLHash_CO.plot b/libjudy/test/Centrino_1.3Mhz_Plots/JLHash_CO.plot deleted file mode 100644 index 9f988dc36d..0000000000 --- a/libjudy/test/Centrino_1.3Mhz_Plots/JLHash_CO.plot +++ /dev/null @@ -1,560 +0,0 @@ -# StringCompare -n13335214 -A JLHash -P40 -L10 -C -M100000 /home/data/domnames.txt -# This file is in a format to input to 'jbgraph' -# XLABEL Stored -# YLABEL Microseconds / Index -# COLHEAD 1 Total Insert attempts -# COLHEAD 2 Number Gets -# COLHEAD 3 Duplicate strings -# COLHEAD 4 Insert Time (uS) -# COLHEAD 5 Get Time (uS) -# COLHEAD 6 Hash Chain Length -# COLHEAD 7 Average RAM/String -# Linux localhost 2.6.3-4mdkenterprise #1 SMP Tue Mar 2 07:00:53 CET 2004 i686 -# 32 Bit CPU -# Processor speed compiled at 1299 Mhz -# JLHash table virtual size = 4294967296 -# 9999673 (75.0%) non-Word_t aligned string buffers -# Ram used for input data = 333834600 bytes -# Average string length = 16.0 bytes -# 3400000 bytes malloc() for 'cached' strings for Get measurement -# Access Time = 0.102 uS average per string (mostly from Cache) -# HashStr() Time = 0.274 uS average per string (mostly from Cache) -# Access Time = 0.285 uS average per string (mostly from RAM) -# HashStr() Time = 0.474 uS average per string (mostly from RAM) -# Pass 0 -# TotInserts DeltaGets DupStrs InsTime GetTime HChainLen Ram/String -# 1 1 0 38.004 1.742 1.000000 108.0 -# 2 2 0 8.817 0.905 1.000000 74.0 -# 3 3 0 1.388 0.705 1.000000 60.0 -# 4 4 0 1.583 0.651 1.000000 58.0 -# 5 5 0 1.148 0.616 1.000000 52.8 -# 6 6 0 1.625 0.603 1.000000 52.7 -# 7 7 0 1.283 0.587 1.000000 50.3 -# 8 8 0 1.746 0.575 1.000000 52.0 -# 9 9 0 0.979 0.549 1.000000 48.9 -# 10 10 0 1.119 0.547 1.000000 47.6 -# 11 11 0 1.020 0.528 1.000000 45.8 -# 12 12 0 1.640 0.512 1.000000 46.7 -# 13 13 0 1.132 0.495 1.000000 45.2 -# 14 14 0 1.260 0.745 1.000000 44.3 -# 15 15 0 6.118 0.481 1.000000 42.9 -# 16 16 0 1.931 0.478 1.000000 45.8 -# 17 17 0 1.107 0.473 1.000000 44.5 -# 18 18 0 1.099 0.471 1.000000 44.0 -# 19 19 0 1.057 0.463 1.000000 42.9 -# 20 20 0 1.330 0.462 1.000000 42.2 -# 21 21 0 1.196 0.458 1.000000 41.5 -# 22 22 0 0.962 0.455 1.000000 40.7 -# 23 23 0 1.169 0.459 1.000000 40.5 -# 24 24 0 1.964 0.453 1.000000 42.5 -# 25 25 0 1.238 0.442 1.000000 41.8 -# 26 26 0 1.374 0.439 1.000000 41.1 -# 27 27 0 0.962 0.439 1.000000 40.6 -# 28 28 0 1.043 0.438 1.000000 40.1 -# 29 29 0 1.311 0.430 1.000000 39.6 -# 30 30 0 1.068 0.428 1.000000 38.9 -# 31 31 0 1.206 0.427 1.000000 38.5 -# 32 32 0 24.145 0.517 1.000000 44.2 -# 34 34 0 2.551 0.435 1.000000 43.9 -# 36 36 0 1.243 0.433 1.000000 43.7 -# 38 38 0 1.180 0.432 1.000000 43.3 -# 40 40 0 1.277 0.428 1.000000 42.9 -# 42 42 0 1.069 0.425 1.000000 42.5 -# 44 44 0 0.948 0.419 1.000000 42.0 -# 46 46 0 1.188 0.420 1.000000 41.9 -# 48 48 0 1.519 0.425 1.000000 42.0 -# 50 50 0 1.245 0.424 1.000000 42.2 -# 53 53 0 1.105 0.431 1.000000 42.3 -# 56 56 0 1.429 0.431 1.000000 43.0 -# 59 59 0 1.053 0.436 1.000000 42.6 -# 62 62 0 1.337 0.445 1.000000 43.2 -# 65 65 0 1.169 0.442 1.000000 43.6 -# 69 69 0 1.654 0.441 1.000000 42.8 -# 73 73 0 1.080 0.444 1.000000 42.5 -# 77 77 0 0.877 0.438 1.000000 41.9 -# 81 81 0 1.082 0.438 1.000000 41.8 -# 85 85 0 1.091 0.437 1.000000 41.7 -# 90 90 0 1.002 0.439 1.000000 41.2 -# 95 95 0 1.798 0.438 1.000000 42.1 -# 100 100 0 0.927 0.439 1.000000 41.8 -# 106 106 0 1.140 0.439 1.000000 42.4 -# 112 112 0 1.008 0.443 1.000000 42.5 -# 118 118 0 0.959 0.498 1.000000 42.0 -# 125 125 0 0.897 0.438 1.000000 41.5 -# 132 132 0 0.982 0.438 1.000000 41.1 -# 139 139 0 1.120 0.437 1.000000 41.7 -# 147 147 0 1.073 0.438 1.000000 41.8 -# 155 155 0 1.013 0.439 1.000000 41.8 -# 164 164 0 0.974 0.441 1.000000 41.7 -# 173 173 0 0.877 0.438 1.000000 41.3 -# 183 183 0 1.440 0.440 1.000000 41.7 -# 194 194 0 0.958 0.438 1.000000 41.5 -# 205 205 0 1.000 0.438 1.000000 41.6 -# 217 217 0 0.932 0.439 1.000000 41.4 -# 230 230 0 1.010 0.441 1.000000 41.7 -# 243 243 0 1.037 0.471 1.000000 41.8 -# 257 257 0 1.065 0.448 1.000000 41.7 -# 272 272 0 1.259 0.450 1.000000 41.8 -# 288 288 0 1.060 0.453 1.000000 42.3 -# 305 305 0 0.966 0.453 1.000000 42.0 -# 323 323 0 0.946 0.453 1.000000 41.6 -# 342 342 0 0.969 0.453 1.000000 41.7 -# 362 362 0 1.142 0.457 1.000000 41.5 -# 383 383 0 0.988 0.472 1.000000 41.4 -# 405 405 0 1.023 0.454 1.000000 41.3 -# 429 429 0 1.151 0.457 1.000000 41.4 -# 454 454 0 0.990 0.471 1.000000 41.4 -# 480 480 0 1.004 0.458 1.000000 41.3 -# 508 508 0 1.014 0.463 1.000000 41.4 -# 538 538 0 1.120 0.475 1.000000 41.2 -# 569 569 0 0.997 0.464 1.000000 41.1 -# 602 602 0 1.059 0.478 1.000000 40.9 -# 637 637 0 1.095 0.468 1.000000 40.7 -# 674 674 0 1.048 0.480 1.000000 40.6 -# 714 714 0 1.072 0.470 1.000000 40.4 -# 756 756 0 1.337 0.462 1.000000 40.2 -# 800 800 0 1.015 0.459 1.000000 40.1 -# 847 847 0 1.007 0.454 1.000000 40.0 -# 897 897 0 1.079 0.464 1.000000 39.9 -# 950 950 0 1.017 0.459 1.000000 39.8 -# 1006 1006 0 1.135 0.458 1.000000 39.9 -# 1065 1065 0 1.068 0.465 1.000000 39.9 -# 1128 1128 0 0.997 0.467 1.000000 39.8 -# 1194 1194 0 1.022 0.468 1.000000 39.5 -# 1264 1264 0 1.074 0.465 1.000000 39.5 -# 1339 1339 0 1.122 0.465 1.000000 39.3 -# 1418 1418 0 1.164 0.468 1.000000 39.3 -# 1502 1502 0 1.035 0.473 1.000000 39.2 -# 1591 1591 0 1.042 0.473 1.000000 39.2 -# 1685 1685 0 1.052 0.475 1.000000 39.2 -# 1784 1784 0 1.119 0.476 1.000000 39.2 -# 1884 1884 0 1.058 0.476 1.000000 39.1 -# 1995 1995 0 1.042 0.478 1.000000 39.1 -# 2113 2113 0 2.215 0.482 1.000000 38.9 -# 2239 2239 0 1.072 0.637 1.000000 38.8 -# 2371 2371 0 1.096 0.486 1.000000 38.7 -# 2512 2512 0 1.110 0.486 1.000000 38.8 -# 2661 2661 0 1.097 0.488 1.000000 38.8 -# 2818 2818 0 1.156 0.490 1.000000 38.7 -# 2985 2985 0 1.137 0.493 1.000000 38.7 -# 3162 3162 0 1.143 0.498 1.000000 38.7 -# 3350 3350 0 1.067 0.499 1.000000 38.5 -# 3548 3548 0 1.121 0.500 1.000000 38.5 -# 3758 3758 0 1.161 0.528 1.000000 38.6 -# 3981 3981 0 1.103 0.512 1.000000 38.5 -# 4217 4217 0 1.120 0.515 1.000000 38.5 -# 4467 4467 0 1.116 0.520 1.000000 38.4 -# 4732 4732 0 1.151 0.525 1.000000 38.4 -# 5012 5012 0 1.124 0.527 1.000000 38.3 -# 5309 5309 0 1.165 0.532 1.000000 38.3 -# 5623 5623 0 1.654 0.542 1.000000 38.2 -# 5957 5957 0 1.175 0.542 1.000000 38.2 -# 6310 6310 0 1.221 0.547 1.000000 38.2 -# 6683 6683 0 1.269 0.554 1.000000 38.3 -# 7079 7079 0 1.224 0.553 1.000000 38.3 -# 7499 7499 0 1.267 0.556 1.000000 38.4 -# 7943 7943 0 1.344 0.556 1.000000 38.6 -# 8414 8414 0 1.320 0.606 1.000000 38.8 -# 8913 8913 0 1.485 0.556 1.000000 39.2 -# 9441 9441 0 1.483 0.551 1.000000 39.7 -# 10000 10000 0 1.336 0.549 1.000000 40.0 -# 10593 10593 0 1.374 0.545 1.000000 40.3 -# 11220 11220 0 1.361 0.605 1.000000 40.7 -# 11885 11885 0 1.233 0.552 1.000000 40.8 -# 12589 12589 0 1.201 0.546 1.000000 40.9 -# 13335 13335 0 1.145 0.545 1.000000 40.9 -# 14125 14125 0 1.169 0.594 1.000000 40.8 -# 14962 14962 0 1.152 0.563 1.000000 40.8 -# 15849 15849 0 1.137 0.558 1.000000 40.7 -# 16788 16788 0 1.168 0.622 1.000000 40.7 -# 17783 17783 0 1.159 0.579 1.000000 40.6 -# 18836 18836 0 1.162 0.605 1.000000 40.5 -# 19953 19953 0 1.270 0.582 1.000000 40.5 -# 21135 21135 0 1.153 0.589 1.000000 40.4 -# 22387 22387 0 1.321 0.601 1.000000 40.3 -# 23714 23714 0 1.289 0.602 1.000000 40.3 -# 25119 25119 0 1.256 0.639 1.000000 40.2 -# 26607 26607 0 1.205 0.626 1.000000 40.1 -# 28184 28184 0 1.200 0.625 1.000000 40.1 -# 29854 29854 0 1.203 0.659 1.000000 40.2 -# 31623 31623 0 1.213 0.651 1.000000 40.2 -# 33497 33497 0 1.210 0.654 1.000000 40.4 -# 35481 35481 0 1.208 0.681 1.000000 40.5 -# 37584 37584 0 1.264 0.672 1.000000 40.6 -# 39811 39811 0 1.222 0.693 1.000000 40.7 -# 42170 42170 0 1.224 0.695 1.000000 40.7 -# 44668 44668 0 1.225 0.710 1.000000 40.8 -# 47315 47315 0 1.218 0.702 1.000000 40.8 -# 50119 50119 0 1.231 0.722 1.000000 40.8 -# 53088 53088 0 1.284 0.718 1.000000 40.8 -# 56234 56234 0 1.228 0.729 1.000000 40.8 -# 59566 59566 0 1.228 0.754 1.000000 40.7 -# 63096 63096 0 1.234 0.750 1.000000 40.7 -# 66834 66834 0 1.230 0.745 1.000000 40.6 -# 70795 70795 0 1.236 0.752 1.000000 40.5 -# 74989 74989 0 1.243 0.760 1.000000 40.4 -# 79433 79433 0 1.289 0.762 1.000000 40.3 -# 84140 84140 0 1.291 0.766 1.000000 40.2 -# 89125 89125 0 1.254 0.768 1.000000 40.1 -# 94406 94406 0 1.256 0.767 1.000011 40.0 -# 100000 100000 0 1.255 0.769 1.000010 39.9 -# 105925 100000 0 1.283 0.784 1.000010 39.8 -# 112202 100000 0 1.305 0.787 1.000010 39.7 -# 118850 100000 0 1.256 0.784 1.000010 39.5 -# 125893 100000 0 1.336 0.792 1.000010 39.4 -# 133352 100000 0 1.310 0.798 1.000010 39.3 -# 141254 100000 0 1.292 0.806 1.000000 39.3 -# 149624 100000 0 1.310 0.816 1.000000 39.2 -# 158489 100000 0 1.326 0.823 1.000000 39.1 -# 167880 100000 0 1.379 0.825 1.000010 39.1 -# 177828 100000 0 1.355 0.833 1.000000 39.0 -# 188365 100000 0 1.365 0.838 1.000010 38.9 -# 199526 100000 0 1.398 0.845 1.000030 38.9 -# 211349 100000 0 1.382 0.852 1.000030 38.8 -# 223872 100000 0 1.411 0.853 1.000010 38.8 -# 237137 100000 0 1.471 0.870 1.000030 38.7 -# 251189 100000 0 1.403 0.869 1.000030 38.6 -# 266073 100000 0 1.411 0.873 1.000020 38.6 -# 281838 100000 0 1.417 0.875 1.000050 38.5 -# 298538 100000 0 1.418 0.880 1.000040 38.4 -# 316228 100000 0 1.424 0.892 1.000020 38.3 -# 334965 100000 0 1.423 0.894 1.000040 38.3 -# 354813 100000 0 1.435 0.895 1.000020 38.2 -# 375837 100000 0 1.437 0.904 1.000070 38.1 -# 398107 100000 0 1.419 0.914 1.000070 38.0 -# 421697 100000 0 1.440 0.912 1.000100 37.9 -# 446684 100000 0 1.426 0.954 1.000080 37.8 -# 473151 100000 0 1.434 0.923 1.000080 37.7 -# 501187 100000 0 1.465 0.931 1.000150 37.7 -# 530884 100000 0 1.470 0.937 1.000060 37.6 -# 562341 100000 0 1.469 0.943 1.000100 37.6 -# 595662 100000 0 1.488 0.959 1.000100 37.5 -# 630957 100000 0 1.500 0.956 1.000130 37.5 -# 668344 100000 0 1.484 0.959 1.000070 37.4 -# 707946 100000 0 1.517 0.965 1.000110 37.4 -# 749894 100000 0 1.523 0.971 1.000070 37.3 -# 794328 100000 0 1.533 0.985 1.000130 37.3 -# 841395 100000 0 1.547 0.985 1.000180 37.3 -# 891251 100000 0 1.558 0.991 1.000100 37.2 -# 944061 100000 0 1.552 0.997 1.000130 37.2 -# 1000000 100000 0 1.577 1.004 1.000100 37.2 -# 1059254 100000 0 1.582 1.009 1.000140 37.1 -# 1122018 100000 0 1.588 1.011 1.000070 37.1 -# 1188502 100000 0 1.609 1.019 1.000130 37.1 -# 1258925 100000 0 1.594 1.032 1.000200 37.1 -# 1333521 100000 0 1.615 1.032 1.000130 37.1 -# 1412538 100000 0 1.610 1.036 1.000150 37.1 -# 1496236 100000 0 1.612 1.048 1.000150 37.1 -# 1584893 100000 0 1.627 1.049 1.000190 37.0 -# 1678804 100000 0 1.646 1.056 1.000210 37.0 -# 1778279 100000 0 1.646 1.060 1.000310 36.9 -# 1883649 100000 0 1.667 1.065 1.000230 36.9 -# 1995262 100000 0 1.699 1.069 1.000350 36.9 -# 2113489 100000 0 1.734 1.072 1.000300 37.0 -# 2238721 100000 0 1.790 1.086 1.000240 37.1 -# 2371374 100000 0 1.861 1.088 1.000250 37.4 -# 2511886 100000 0 1.925 1.092 1.000320 37.8 -# 2660725 100000 0 2.046 1.096 1.000320 38.4 -# 2818383 100000 0 1.983 1.109 1.000320 39.0 -# 2985383 100000 0 1.953 1.099 1.000460 39.6 -# 3162278 100000 0 1.883 1.098 1.000430 40.1 -# 3349654 100000 0 1.809 1.104 1.000420 40.4 -# 3548134 100000 0 1.725 1.110 1.000490 40.6 -# 3758374 100000 0 1.691 1.119 1.000330 40.6 -# 3981072 100000 0 1.663 1.132 1.000410 40.6 -# 4216965 100000 0 1.665 1.140 1.000460 40.6 -# 4466836 100000 0 1.672 1.135 1.000550 40.5 -# 4731513 100000 0 1.685 1.157 1.000490 40.5 -# 5011872 100000 0 1.688 1.180 1.000520 40.4 -# 5308844 100000 0 1.702 1.170 1.000580 40.3 -# 5623413 100000 0 1.715 1.181 1.000570 40.2 -# 5956621 100000 0 1.727 1.184 1.000820 40.2 -# 6309573 100000 0 1.734 1.203 1.000690 40.1 -# 6683439 100000 0 1.740 1.198 1.000910 40.0 -# 7079458 100000 0 1.742 1.214 1.000800 40.0 -# 7498942 100000 0 1.755 1.217 1.000750 40.0 -# 7943282 100000 0 1.767 1.223 1.000940 40.0 -# 8413951 100000 0 1.860 1.239 1.000920 40.1 -# 8912509 100000 0 1.795 1.249 1.001020 40.2 -# 9440609 100000 0 1.800 1.257 1.001150 40.3 -# 10000000 100000 0 1.798 1.257 1.000990 40.3 -# 10592537 100000 0 1.783 1.301 1.001150 40.4 -# 11220185 100000 0 1.845 1.295 1.001400 40.4 -# 11885022 100000 0 1.829 1.286 1.001310 40.4 -# 12589254 100000 0 10.482 1.917 1.001420 40.4 -# 13335214 100000 0 5.906 4.791 1.001610 40.3 -# Total Duplicate strings = 0 -# Begin JLHashFreeArray()... -# returned 538058560 bytes -# Free 13335214 strings, 1.065 uSecs Ave/string - -# Pass 1 -# Pass 2 -# Pass 3 -# Pass 4 -# Pass 5 -# Pass 6 -# Pass 7 -# Pass 8 -# Pass 9 -# TotInserts 0 0 InsTime GetTime 0 Ram/String - 1 0 0 3.635 0.601 0 48.000 - 2 0 0 2.086 0.268 0 40.000 - 3 0 0 0.989 0.349 0 41.333 - 4 0 0 0.952 0.324 0 42.000 - 5 0 0 0.765 0.330 0 39.200 - 6 0 0 1.010 0.354 0 39.333 - 7 0 0 0.748 0.363 0 37.714 - 8 0 0 1.226 0.362 0 41.500 - 9 0 0 0.823 0.364 0 40.889 - 10 0 0 0.774 0.373 0 40.400 - 11 0 0 0.794 0.365 0 40.000 - 12 0 0 1.554 0.366 0 42.333 - 13 0 0 0.743 0.370 0 41.231 - 14 0 0 0.817 0.375 0 40.286 - 15 0 0 0.798 0.384 0 38.933 - 16 0 0 1.259 0.382 0 42.000 - 17 0 0 0.716 0.382 0 41.647 - 18 0 0 0.751 0.380 0 41.333 - 19 0 0 0.785 0.383 0 40.211 - 20 0 0 0.875 0.382 0 39.800 - 21 0 0 0.798 0.380 0 39.619 - 22 0 0 0.875 0.381 0 39.273 - 23 0 0 0.751 0.388 0 39.130 - 24 0 0 1.964 0.388 0 41.167 - 25 0 0 0.880 0.382 0 40.480 - 26 0 0 0.908 0.387 0 39.846 - 27 0 0 0.740 0.389 0 39.556 - 28 0 0 0.842 0.388 0 39.429 - 29 0 0 0.895 0.390 0 39.034 - 30 0 0 0.877 0.387 0 38.800 - 31 0 0 0.781 0.388 0 38.452 - 32 0 0 7.634 0.424 0 43.375 - 34 0 0 0.995 0.398 0 43.294 - 36 0 0 0.886 0.409 0 42.667 - 38 0 0 0.915 0.413 0 42.421 - 40 0 0 0.905 0.416 0 42.200 - 42 0 0 0.895 0.417 0 42.857 - 44 0 0 0.769 0.418 0 42.727 - 46 0 0 0.858 0.416 0 42.435 - 48 0 0 1.019 0.414 0 42.250 - 50 0 0 0.946 0.415 0 41.920 - 53 0 0 0.985 0.413 0 42.340 - 56 0 0 1.024 0.417 0 42.643 - 59 0 0 0.876 0.415 0 42.712 - 62 0 0 0.992 0.412 0 43.097 - 65 0 0 0.931 0.419 0 43.077 - 69 0 0 0.884 0.424 0 42.899 - 73 0 0 0.967 0.422 0 42.685 - 77 0 0 0.831 0.428 0 42.857 - 81 0 0 0.860 0.416 0 42.864 - 85 0 0 0.864 0.416 0 43.529 - 90 0 0 0.866 0.419 0 43.156 - 95 0 0 0.968 0.422 0 42.653 - 100 0 0 0.927 0.425 0 42.160 - 106 0 0 0.997 0.427 0 42.075 - 112 0 0 0.880 0.430 0 42.250 - 118 0 0 0.959 0.429 0 42.373 - 125 0 0 0.897 0.428 0 42.656 - 132 0 0 0.982 0.430 0 42.364 - 139 0 0 0.892 0.430 0 41.899 - 147 0 0 1.004 0.437 0 42.395 - 155 0 0 0.962 0.433 0 42.348 - 164 0 0 0.945 0.436 0 42.146 - 173 0 0 0.877 0.438 0 41.734 - 183 0 0 0.890 0.440 0 41.727 - 194 0 0 0.958 0.438 0 41.794 - 205 0 0 1.000 0.438 0 41.795 - 217 0 0 0.923 0.439 0 41.604 - 230 0 0 0.996 0.441 0 42.070 - 243 0 0 0.991 0.452 0 42.091 - 257 0 0 0.939 0.448 0 41.696 - 272 0 0 0.981 0.450 0 41.559 - 288 0 0 1.022 0.453 0 41.667 - 305 0 0 0.966 0.453 0 41.902 - 323 0 0 0.946 0.453 0 41.895 - 342 0 0 0.969 0.453 0 42.058 - 362 0 0 1.064 0.457 0 42.188 - 383 0 0 0.988 0.464 0 42.057 - 405 0 0 1.023 0.454 0 42.272 - 429 0 0 1.066 0.457 0 42.256 - 454 0 0 0.990 0.468 0 41.947 - 480 0 0 1.004 0.458 0 41.917 - 508 0 0 1.014 0.463 0 41.819 - 538 0 0 1.068 0.471 0 41.465 - 569 0 0 0.997 0.464 0 41.244 - 602 0 0 1.059 0.478 0 41.143 - 637 0 0 1.095 0.468 0 41.017 - 674 0 0 1.048 0.480 0 40.914 - 714 0 0 1.062 0.470 0 40.734 - 756 0 0 1.337 0.462 0 40.439 - 800 0 0 1.015 0.459 0 40.220 - 847 0 0 1.007 0.454 0 40.142 - 897 0 0 1.016 0.464 0 40.143 - 950 0 0 1.017 0.459 0 40.029 - 1006 0 0 1.033 0.458 0 40.016 - 1065 0 0 1.033 0.465 0 39.985 - 1128 0 0 0.997 0.467 0 39.897 - 1194 0 0 1.007 0.467 0 39.863 - 1264 0 0 1.027 0.465 0 39.750 - 1339 0 0 1.022 0.465 0 39.555 - 1418 0 0 1.007 0.468 0 39.368 - 1502 0 0 1.035 0.473 0 39.204 - 1591 0 0 1.023 0.473 0 39.110 - 1685 0 0 1.027 0.475 0 39.119 - 1784 0 0 0.998 0.476 0 39.029 - 1884 0 0 1.028 0.476 0 39.096 - 1995 0 0 1.012 0.478 0 38.983 - 2113 0 0 1.023 0.482 0 39.000 - 2239 0 0 0.998 0.493 0 38.916 - 2371 0 0 1.006 0.486 0 38.962 - 2512 0 0 1.035 0.486 0 38.861 - 2661 0 0 1.027 0.488 0 38.825 - 2818 0 0 1.046 0.490 0 38.755 - 2985 0 0 1.029 0.493 0 38.596 - 3162 0 0 1.063 0.498 0 38.530 - 3350 0 0 1.036 0.499 0 38.427 - 3548 0 0 1.037 0.500 0 38.444 - 3758 0 0 1.068 0.528 0 38.506 - 3981 0 0 1.073 0.512 0 38.551 - 4217 0 0 1.079 0.515 0 38.367 - 4467 0 0 1.072 0.520 0 38.433 - 4732 0 0 1.083 0.525 0 38.343 - 5012 0 0 1.061 0.527 0 38.311 - 5309 0 0 1.085 0.532 0 38.320 - 5623 0 0 1.072 0.542 0 38.251 - 5957 0 0 1.103 0.542 0 38.209 - 6310 0 0 1.142 0.547 0 38.255 - 6683 0 0 1.096 0.554 0 38.122 - 7079 0 0 1.132 0.553 0 38.204 - 7499 0 0 1.208 0.556 0 38.365 - 7943 0 0 1.227 0.556 0 38.610 - 8414 0 0 1.225 0.588 0 38.839 - 8913 0 0 1.310 0.556 0 39.063 - 9441 0 0 1.319 0.551 0 39.620 - 10000 0 0 1.270 0.549 0 40.091 - 10593 0 0 1.271 0.545 0 40.405 - 11220 0 0 1.175 0.570 0 40.668 - 11885 0 0 1.125 0.552 0 40.855 - 12589 0 0 1.080 0.546 0 40.874 - 13335 0 0 1.057 0.545 0 40.788 - 14125 0 0 1.067 0.574 0 40.824 - 14962 0 0 1.061 0.563 0 40.771 - 15849 0 0 1.059 0.558 0 40.713 - 16788 0 0 1.057 0.585 0 40.635 - 17783 0 0 1.070 0.579 0 40.554 - 18836 0 0 1.071 0.598 0 40.488 - 19953 0 0 1.091 0.582 0 40.426 - 21135 0 0 1.099 0.589 0 40.368 - 22387 0 0 1.099 0.601 0 40.336 - 23714 0 0 1.104 0.602 0 40.275 - 25119 0 0 1.113 0.629 0 40.186 - 26607 0 0 1.126 0.626 0 40.160 - 28184 0 0 1.174 0.625 0 40.113 - 29854 0 0 1.152 0.656 0 40.181 - 31623 0 0 1.154 0.651 0 40.274 - 33497 0 0 1.156 0.654 0 40.354 - 35481 0 0 1.154 0.677 0 40.434 - 37584 0 0 1.159 0.672 0 40.553 - 39811 0 0 1.165 0.693 0 40.664 - 42170 0 0 1.164 0.695 0 40.727 - 44668 0 0 1.166 0.710 0 40.820 - 47315 0 0 1.167 0.702 0 40.855 - 50119 0 0 1.167 0.722 0 40.883 - 53088 0 0 1.169 0.718 0 40.892 - 56234 0 0 1.169 0.729 0 40.829 - 59566 0 0 1.169 0.748 0 40.793 - 63096 0 0 1.173 0.750 0 40.721 - 66834 0 0 1.169 0.745 0 40.633 - 70795 0 0 1.173 0.752 0 40.553 - 74989 0 0 1.176 0.760 0 40.462 - 79433 0 0 1.189 0.762 0 40.373 - 84140 0 0 1.187 0.766 0 40.280 - 89125 0 0 1.192 0.768 0 40.185 - 94406 0 0 1.199 0.767 0 40.075 - 100000 0 0 1.201 0.769 0 39.939 - 105925 0 0 1.195 0.784 0 39.811 - 112202 0 0 1.183 0.787 0 39.690 - 118850 0 0 1.192 0.784 0 39.577 - 125893 0 0 1.203 0.792 0 39.473 - 133352 0 0 1.213 0.798 0 39.383 - 141254 0 0 1.226 0.806 0 39.303 - 149624 0 0 1.243 0.816 0 39.233 - 158489 0 0 1.252 0.823 0 39.167 - 167880 0 0 1.267 0.825 0 39.100 - 177828 0 0 1.276 0.833 0 39.041 - 188365 0 0 1.284 0.838 0 38.987 - 199526 0 0 1.293 0.845 0 38.928 - 211349 0 0 1.304 0.852 0 38.867 - 223872 0 0 1.310 0.853 0 38.806 - 237137 0 0 1.320 0.870 0 38.750 - 251189 0 0 1.331 0.869 0 38.690 - 266073 0 0 1.329 0.873 0 38.620 - 281838 0 0 1.338 0.875 0 38.553 - 298538 0 0 1.339 0.880 0 38.477 - 316228 0 0 1.339 0.892 0 38.394 - 334965 0 0 1.349 0.894 0 38.310 - 354813 0 0 1.352 0.895 0 38.220 - 375837 0 0 1.348 0.904 0 38.126 - 398107 0 0 1.350 0.914 0 38.043 - 421697 0 0 1.359 0.912 0 37.948 - 446684 0 0 1.359 0.927 0 37.865 - 473151 0 0 1.372 0.923 0 37.786 - 501187 0 0 1.380 0.931 0 37.707 - 530884 0 0 1.385 0.937 0 37.640 - 562341 0 0 1.391 0.943 0 37.581 - 595662 0 0 1.403 0.953 0 37.533 - 630957 0 0 1.414 0.956 0 37.486 - 668344 0 0 1.427 0.959 0 37.438 - 707946 0 0 1.438 0.965 0 37.398 - 749894 0 0 1.449 0.971 0 37.357 - 794328 0 0 1.462 0.981 0 37.312 - 841395 0 0 1.481 0.985 0 37.273 - 891251 0 0 1.490 0.991 0 37.240 - 944061 0 0 1.509 0.997 0 37.206 - 1000000 0 0 1.522 1.004 0 37.181 - 1059254 0 0 1.532 1.009 0 37.168 - 1122018 0 0 1.538 1.011 0 37.153 - 1188502 0 0 1.544 1.019 0 37.148 - 1258925 0 0 1.555 1.028 0 37.151 - 1333521 0 0 1.557 1.031 0 37.142 - 1412538 0 0 1.566 1.036 0 37.120 - 1496236 0 0 1.571 1.044 0 37.091 - 1584893 0 0 1.582 1.049 0 37.050 - 1678804 0 0 1.591 1.056 0 36.997 - 1778279 0 0 1.597 1.060 0 36.944 - 1883649 0 0 1.628 1.065 0 36.896 - 1995262 0 0 1.667 1.069 0 36.898 - 2113489 0 0 1.697 1.072 0 36.960 - 2238721 0 0 1.750 1.085 0 37.110 - 2371374 0 0 1.819 1.086 0 37.407 - 2511886 0 0 1.867 1.090 0 37.835 - 2660725 0 0 1.901 1.094 0 38.385 - 2818383 0 0 1.905 1.091 0 39.012 - 2985383 0 0 1.867 1.089 0 39.605 - 3162278 0 0 1.805 1.089 0 40.094 - 3349654 0 0 1.727 1.092 0 40.422 - 3548134 0 0 1.657 1.096 0 40.599 - 3758374 0 0 1.610 1.106 0 40.658 - 3981072 0 0 1.588 1.111 0 40.640 - 4216965 0 0 1.578 1.122 0 40.590 - 4466836 0 0 1.587 1.130 0 40.530 - 4731513 0 0 1.595 1.134 0 40.461 - 5011872 0 0 1.607 1.145 0 40.391 - 5308844 0 0 1.625 1.154 0 40.316 - 5623413 0 0 1.642 1.167 0 40.240 - 5956621 0 0 1.652 1.176 0 40.164 - 6309573 0 0 1.669 1.188 0 40.084 - 6683439 0 0 1.710 1.198 0 40.011 - 7079458 0 0 1.711 1.208 0 39.956 - 7498942 0 0 1.719 1.217 0 39.961 - 7943282 0 0 1.727 1.223 0 40.035 - 8413951 0 0 1.727 1.233 0 40.119 - 8912509 0 0 1.726 1.243 0 40.194 - 9440609 0 0 1.737 1.248 0 40.263 - 10000000 0 0 1.723 1.251 0 40.323 - 10592537 0 0 1.718 1.259 0 40.370 - 11220185 0 0 1.715 1.265 0 40.399 - 11885022 0 0 1.710 1.270 0 40.407 - 12589254 0 0 1.704 1.276 0 40.389 - 13335214 0 0 1.697 1.277 0 40.347 diff --git a/libjudy/test/Centrino_1.3Mhz_Plots/JudyHS_CO.plot b/libjudy/test/Centrino_1.3Mhz_Plots/JudyHS_CO.plot deleted file mode 100644 index ee87bfa9fa..0000000000 --- a/libjudy/test/Centrino_1.3Mhz_Plots/JudyHS_CO.plot +++ /dev/null @@ -1,563 +0,0 @@ -# StringCompare -n14962357 -A JudyHS -P40 -L10 -C -M100000 /home/data/domnames.txt -# This file is in a format to input to 'jbgraph' -# XLABEL Stored -# YLABEL Microseconds / Index -# COLHEAD 1 Total Insert attempts -# COLHEAD 2 Number Gets -# COLHEAD 3 Duplicate strings -# COLHEAD 4 Insert Time (uS) -# COLHEAD 5 Get Time (uS) -# COLHEAD 6 Hash Chain Length -# COLHEAD 7 Average RAM/String -# Linux localhost 2.6.3-4mdkenterprise #1 SMP Tue Mar 2 07:00:53 CET 2004 i686 -# 32 Bit CPU -# Processor speed compiled at 1299 Mhz -# 11218731 (75.0%) non-Word_t aligned string buffers -# Ram used for input data = 372621771 bytes -# Average string length = 15.9 bytes -# 3200000 bytes malloc() for 'cached' strings for Get measurement -# Access Time = 0.112 uS average per string (mostly from Cache) -# HashStr() Time = 0.271 uS average per string (mostly from Cache) -# Access Time = 0.295 uS average per string (mostly from RAM) -# HashStr() Time = 0.476 uS average per string (mostly from RAM) -# Pass 0 -# TotInserts DeltaGets DupStrs InsTime GetTime HChainLen Ram/String -# 1 1 0 30.232 2.608 0.000000 52.0 -# 2 2 0 8.020 0.314 0.000000 44.0 -# 3 3 0 1.616 0.268 0.000000 42.7 -# 4 4 0 1.424 0.267 0.000000 45.0 -# 5 5 0 1.166 0.252 0.000000 41.6 -# 6 6 0 1.122 0.251 0.000000 39.3 -# 7 7 0 1.511 0.256 0.000000 41.1 -# 8 8 0 1.346 0.258 0.000000 39.5 -# 9 9 0 1.476 0.245 0.000000 38.7 -# 10 10 0 1.397 0.252 0.000000 41.2 -# 11 11 0 1.299 0.256 0.000000 40.4 -# 12 12 0 1.287 0.248 0.000000 39.7 -# 13 13 0 0.999 0.256 0.000000 39.1 -# 14 14 0 1.191 0.261 0.000000 38.9 -# 15 15 0 1.197 0.259 0.000000 38.7 -# 16 16 0 7.658 0.264 0.000000 41.0 -# 17 17 0 1.427 0.258 0.000000 40.0 -# 18 18 0 1.255 0.262 0.000000 39.1 -# 19 19 0 1.232 0.263 0.000000 38.7 -# 20 20 0 1.085 0.265 0.000000 38.4 -# 21 21 0 1.185 0.254 0.000000 37.9 -# 22 22 0 1.178 0.259 0.000000 38.0 -# 23 23 0 1.135 0.265 0.000000 37.6 -# 24 24 0 1.072 0.265 0.000000 37.0 -# 25 25 0 1.267 0.264 0.000000 36.6 -# 26 26 0 1.329 0.262 0.000000 36.3 -# 27 27 0 1.260 0.267 0.000000 36.3 -# 28 28 0 1.308 0.499 0.000000 36.1 -# 29 29 0 1.189 0.262 0.000000 36.0 -# 30 30 0 1.219 0.263 0.000000 35.6 -# 31 31 0 1.200 0.270 0.000000 36.1 -# 32 32 0 1.320 0.265 0.000000 35.9 -# 34 34 0 0.967 0.264 0.000000 35.3 -# 36 36 0 1.090 0.266 0.000000 35.1 -# 38 38 0 1.500 0.274 0.000000 36.8 -# 40 40 0 0.915 0.266 0.000000 36.2 -# 42 42 0 1.145 0.268 0.000000 36.0 -# 44 44 0 1.169 0.270 0.000000 36.0 -# 46 46 0 0.990 0.272 0.000000 35.9 -# 48 48 0 0.995 0.271 0.000000 35.5 -# 50 50 0 1.040 0.268 0.000000 35.4 -# 53 53 0 0.925 0.274 0.000000 35.2 -# 56 56 0 1.202 0.270 0.000000 35.1 -# 59 59 0 0.744 0.270 0.000000 34.3 -# 62 62 0 0.926 0.270 0.000000 34.1 -# 65 65 0 0.920 0.267 0.000000 34.0 -# 69 69 0 0.838 0.271 0.000000 33.9 -# 73 73 0 0.921 0.270 0.000000 33.9 -# 77 77 0 0.833 0.270 0.000000 33.8 -# 81 81 0 0.939 0.268 0.000000 33.9 -# 85 85 0 0.811 0.272 0.000000 33.7 -# 90 90 0 0.995 0.272 0.000000 34.2 -# 95 95 0 0.739 0.270 0.000000 33.5 -# 100 100 0 0.883 0.273 0.000000 33.2 -# 106 106 0 0.860 0.270 0.000000 32.6 -# 112 112 0 0.828 0.271 0.000000 32.4 -# 118 118 0 1.276 0.273 0.000000 32.2 -# 125 125 0 0.982 0.278 0.000000 32.4 -# 132 132 0 1.076 0.275 0.000000 32.8 -# 139 139 0 0.839 0.279 0.000000 32.3 -# 147 147 0 0.931 0.277 0.000000 32.6 -# 155 155 0 0.918 0.280 0.000000 32.5 -# 164 164 0 0.929 0.282 0.000000 32.8 -# 173 173 0 0.832 0.281 0.000000 32.6 -# 183 183 0 0.912 0.284 0.000000 32.7 -# 194 194 0 0.903 0.287 0.000000 32.6 -# 205 205 0 0.886 0.286 0.000000 32.5 -# 217 217 0 1.086 0.286 0.000000 32.3 -# 230 230 0 0.886 0.286 0.000000 32.5 -# 243 243 0 0.821 0.287 0.000000 32.5 -# 257 257 0 0.804 0.287 0.000000 32.1 -# 272 272 0 0.876 0.315 0.000000 32.0 -# 288 288 0 0.867 0.289 0.000000 31.8 -# 305 305 0 0.849 0.289 0.000000 31.8 -# 323 323 0 2.211 0.299 0.000000 32.1 -# 342 342 0 1.446 0.301 0.000000 32.8 -# 362 362 0 1.032 0.320 0.000000 33.0 -# 383 383 0 1.079 0.301 0.000000 33.4 -# 405 405 0 0.983 0.304 0.000000 33.4 -# 429 429 0 1.005 0.304 0.000000 33.3 -# 454 454 0 0.850 0.321 0.000000 33.0 -# 480 480 0 1.039 0.306 0.000000 33.4 -# 508 508 0 0.984 0.307 0.000000 33.5 -# 538 538 0 1.059 0.320 0.000000 33.6 -# 569 569 0 0.857 0.307 0.000000 33.5 -# 602 602 0 0.997 0.306 0.000000 33.8 -# 637 637 0 0.935 0.320 0.000000 33.7 -# 674 674 0 0.946 0.307 0.000000 33.7 -# 714 714 0 0.940 0.309 0.000000 33.6 -# 756 756 0 1.174 0.308 0.000000 33.8 -# 800 800 0 0.925 0.307 0.000000 34.0 -# 847 847 0 0.908 0.310 0.000000 33.9 -# 897 897 0 0.931 0.308 0.000000 34.0 -# 950 950 0 0.904 0.310 0.000000 34.0 -# 1006 1006 0 0.891 0.318 0.000000 33.9 -# 1065 1065 0 0.842 0.310 0.000000 33.7 -# 1128 1128 0 0.880 0.318 0.000000 33.6 -# 1194 1194 0 0.875 0.312 0.000000 33.6 -# 1264 1264 0 1.027 0.314 0.000000 33.6 -# 1339 1339 0 0.867 0.314 0.000000 33.5 -# 1418 1418 0 0.857 0.320 0.000000 33.3 -# 1502 1502 0 0.962 0.424 0.000000 33.4 -# 1591 1591 0 0.899 0.324 0.000000 33.5 -# 1685 1685 0 0.935 0.323 0.000000 33.5 -# 1784 1784 0 0.936 0.323 0.000000 33.6 -# 1884 1884 0 0.961 0.324 0.000000 33.8 -# 1995 1995 0 0.894 0.325 0.000000 33.7 -# 2113 2113 0 0.883 0.323 0.000000 33.7 -# 2239 2239 0 0.851 0.324 0.000000 33.6 -# 2371 2371 0 0.901 0.329 0.000000 33.5 -# 2512 2512 0 0.937 0.328 0.000000 33.6 -# 2661 2661 0 1.014 0.423 0.000000 33.7 -# 2818 2818 0 1.001 0.423 0.000000 33.7 -# 2985 2985 0 0.983 0.424 0.000000 33.7 -# 3162 3162 0 1.056 0.431 0.000000 33.8 -# 3350 3350 0 0.995 0.431 0.000000 33.7 -# 3548 3548 0 1.012 0.434 0.000000 33.7 -# 3758 3758 0 0.997 0.435 0.000000 33.7 -# 3981 3981 0 1.122 0.600 0.000000 33.8 -# 4217 4217 0 1.111 0.427 0.000000 33.8 -# 4467 4467 0 1.000 0.423 0.000000 33.8 -# 4732 4732 0 1.023 0.429 0.000000 33.8 -# 5012 5012 0 1.016 0.435 0.000000 33.8 -# 5309 5309 0 1.012 0.491 0.000000 33.8 -# 5623 5623 0 1.489 0.473 0.000000 33.8 -# 5957 5957 0 1.029 0.456 0.000000 33.7 -# 6310 6310 0 1.056 0.456 0.000000 33.6 -# 6683 6683 0 1.093 0.463 0.000000 33.5 -# 7079 7079 0 1.102 0.469 0.000000 33.5 -# 7499 7499 0 1.040 0.472 0.000000 33.3 -# 7943 7943 0 1.069 0.425 0.000000 33.2 -# 8414 8414 0 1.042 0.427 0.000000 33.1 -# 8913 8913 0 1.375 0.433 0.000000 33.0 -# 9441 9441 0 1.063 0.434 0.000000 32.9 -# 10000 10000 0 1.042 0.437 0.000000 32.8 -# 10593 10593 0 1.068 0.499 0.000000 32.7 -# 11220 11220 0 1.071 0.437 0.000000 32.6 -# 11885 11885 0 1.010 0.459 0.000000 32.4 -# 12589 12589 0 1.064 0.444 0.000000 32.3 -# 13335 13335 0 1.042 0.445 0.000000 32.2 -# 14125 14125 0 1.053 0.456 0.000000 32.1 -# 14962 14962 0 1.092 0.448 0.000000 32.0 -# 15849 15849 0 1.049 0.449 0.000000 31.9 -# 16788 16788 0 1.065 0.495 0.000000 31.8 -# 17783 17783 0 1.087 0.478 0.000000 31.7 -# 18836 18836 0 1.064 0.458 0.000000 31.7 -# 19953 19953 0 1.059 0.467 0.000000 31.6 -# 21135 21135 0 1.087 0.469 0.000000 31.5 -# 22387 22387 0 1.091 0.507 0.000000 31.5 -# 23714 23714 0 1.116 0.504 0.000000 31.4 -# 25119 25119 0 1.108 0.483 0.000000 31.4 -# 26607 26607 0 1.093 0.499 0.000000 31.3 -# 28184 28184 0 1.104 0.524 0.000000 31.2 -# 29854 29854 0 1.129 0.517 0.000000 31.2 -# 31623 31623 0 1.115 0.516 0.000000 31.1 -# 33497 33497 0 1.230 0.520 0.000000 31.1 -# 35481 35481 0 1.110 0.544 0.000000 31.0 -# 37584 37584 0 1.147 0.542 0.000000 30.9 -# 39811 39811 0 1.141 0.574 0.000000 30.8 -# 42170 42170 0 1.134 0.552 0.000000 30.8 -# 44668 44668 0 1.232 0.600 0.000000 30.7 -# 47315 47315 0 1.183 0.604 0.000000 30.7 -# 50119 50119 0 1.230 0.601 0.000000 30.7 -# 53088 53088 0 1.216 0.589 0.000000 30.6 -# 56234 56234 0 1.176 0.621 0.000000 30.6 -# 59566 59566 0 1.178 0.601 0.000000 30.5 -# 63096 63096 0 1.183 0.616 0.000000 30.5 -# 66834 66834 0 1.205 0.643 0.000000 30.5 -# 70795 70795 0 1.207 0.644 0.000000 30.5 -# 74989 74989 0 1.214 0.634 0.000000 30.4 -# 79433 79433 0 1.270 0.643 0.000000 30.4 -# 84140 84140 0 1.263 0.652 0.000000 30.4 -# 89125 89125 0 1.269 0.660 0.000000 30.4 -# 94406 94406 0 1.342 0.683 0.000000 30.5 -# 100000 100000 0 1.403 0.699 0.000000 30.7 -# 105925 100000 0 1.350 0.699 0.000000 30.8 -# 112202 100000 0 1.378 0.705 0.000000 31.0 -# 118850 100000 0 1.390 0.700 0.000000 31.2 -# 125893 100000 0 1.405 0.710 0.000000 31.4 -# 133352 100000 0 1.534 0.727 0.000000 31.5 -# 141254 100000 0 1.375 0.730 0.000000 31.7 -# 149624 100000 0 1.378 0.739 0.000000 31.8 -# 158489 100000 0 1.603 0.740 0.000000 31.9 -# 167880 100000 0 1.325 0.751 0.000000 31.9 -# 177828 100000 0 1.322 0.755 0.000000 32.0 -# 188365 100000 0 1.333 0.760 0.000000 32.0 -# 199526 100000 0 1.312 0.760 0.000000 32.1 -# 211349 100000 0 1.326 0.768 0.000000 32.1 -# 223872 100000 0 1.320 0.787 0.000000 32.1 -# 237137 100000 0 1.304 0.778 0.000000 32.1 -# 251189 100000 0 1.368 0.769 0.000000 32.1 -# 266073 100000 0 1.324 0.795 0.000000 32.1 -# 281838 100000 0 1.323 0.800 0.000000 32.1 -# 298538 100000 0 1.336 0.827 0.000000 32.0 -# 316228 100000 0 1.349 0.812 0.000000 32.0 -# 334965 100000 0 1.330 0.816 0.000000 32.0 -# 354813 100000 0 1.330 0.816 0.000000 32.0 -# 375837 100000 0 1.358 0.798 0.000000 32.1 -# 398107 100000 0 1.483 0.827 0.000000 32.1 -# 421697 100000 0 1.354 0.832 0.000000 32.2 -# 446684 100000 0 1.353 0.837 0.000000 32.2 -# 473151 100000 0 1.365 0.839 0.000000 32.3 -# 501187 100000 0 1.542 0.846 0.000000 32.3 -# 530884 100000 0 1.345 0.844 0.000000 32.4 -# 562341 100000 0 1.357 0.825 0.000000 32.4 -# 595662 100000 0 1.338 0.830 0.000000 32.5 -# 630957 100000 0 1.349 0.818 0.000000 32.5 -# 668344 100000 0 1.338 0.825 0.000000 32.5 -# 707946 100000 0 1.328 0.817 0.000000 32.5 -# 749894 100000 0 1.331 0.821 0.000000 32.5 -# 794328 100000 0 1.327 0.818 0.000000 32.5 -# 841395 100000 0 1.342 0.820 0.000000 32.4 -# 891251 100000 0 1.318 0.813 0.000000 32.4 -# 944061 100000 0 1.326 0.814 0.000000 32.4 -# 1000000 100000 0 1.316 0.812 0.000000 32.3 -# 1059254 100000 0 1.310 0.810 0.000000 32.3 -# 1122018 100000 0 1.309 0.808 0.000000 32.2 -# 1188502 100000 0 1.506 0.932 0.000000 32.1 -# 1258925 100000 0 1.468 0.810 0.000000 32.0 -# 1333521 100000 0 1.493 0.919 0.000000 32.0 -# 1412538 100000 0 1.445 0.913 0.000000 31.9 -# 1496236 100000 0 1.428 0.908 0.000000 31.8 -# 1584893 100000 0 1.422 0.890 0.000000 31.7 -# 1678804 100000 0 1.396 0.884 0.000000 31.7 -# 1778279 100000 0 1.385 0.824 0.000000 31.6 -# 1883649 100000 0 1.434 0.876 0.000000 31.5 -# 1995262 100000 0 1.415 0.868 0.000000 31.5 -# 2113489 100000 0 1.364 0.850 0.000000 31.4 -# 2238721 100000 0 1.376 0.843 0.000000 31.3 -# 2371374 100000 0 1.380 0.838 0.000000 31.3 -# 2511886 100000 0 1.389 0.851 0.000000 31.2 -# 2660725 100000 0 1.380 0.847 0.000000 31.2 -# 2818383 100000 0 1.382 0.854 0.000000 31.1 -# 2985383 100000 0 1.388 0.861 0.000000 31.0 -# 3162278 100000 0 1.399 0.865 0.000000 31.0 -# 3349654 100000 0 1.425 0.872 0.000000 30.9 -# 3548134 100000 0 1.413 0.882 0.000000 30.8 -# 3758374 100000 0 1.431 0.885 0.000000 30.8 -# 3981072 100000 0 1.428 0.920 0.000000 30.7 -# 4216965 100000 0 1.444 0.902 0.000000 30.6 -# 4466836 100000 0 1.468 0.916 0.000000 30.5 -# 4731513 100000 0 1.466 0.924 0.000000 30.5 -# 5011872 100000 0 1.468 0.930 0.000000 30.4 -# 5308844 100000 0 1.476 0.944 0.000000 30.3 -# 5623413 100000 0 1.482 0.952 0.000000 30.2 -# 5956621 100000 0 1.484 0.962 0.000000 30.1 -# 6309573 100000 0 1.496 0.983 0.000000 30.1 -# 6683439 100000 0 1.530 0.976 0.000000 30.0 -# 7079458 100000 0 1.514 1.006 0.000000 29.9 -# 7498942 100000 0 1.564 1.007 0.000000 29.9 -# 7943282 100000 0 1.550 1.016 0.000000 29.8 -# 8413951 100000 0 1.575 1.036 0.000000 29.7 -# 8912509 100000 0 1.659 1.038 0.000000 29.7 -# 9440609 100000 0 1.630 1.045 0.000000 29.6 -# 10000000 100000 0 1.612 1.180 0.000000 29.6 -# 10592537 100000 0 1.629 1.073 0.000000 29.5 -# 11220185 100000 0 1.650 1.085 0.000000 29.5 -# 11885022 100000 0 1.663 1.101 0.000000 29.5 -# 12589254 100000 0 5.162 1.354 0.000000 29.4 -# 13335214 100000 0 1.689 1.138 0.000000 29.4 -# 14125375 100000 0 1.700 1.138 0.000000 29.3 -# 14962357 100000 0 1.695 1.149 0.000000 29.3 -# Total Duplicate strings = 0 -# Begin JudyHSFreeArray()... -# returned 438636072 bytes -# Free 14962357 strings, 0.621 uSecs Ave/string - -# Pass 1 -# Pass 2 -# Pass 3 -# Pass 4 -# Pass 5 -# Pass 6 -# Pass 7 -# Pass 8 -# Pass 9 -# TotInserts 0 0 InsTime GetTime 0 Ram/String - 1 0 0 6.463 1.451 0 48.000 - 2 0 0 2.444 0.246 0 44.000 - 3 0 0 0.955 0.235 0 41.333 - 4 0 0 0.855 0.227 0 42.000 - 5 0 0 0.794 0.230 0 38.400 - 6 0 0 0.836 0.230 0 36.000 - 7 0 0 0.910 0.230 0 35.429 - 8 0 0 0.887 0.227 0 34.000 - 9 0 0 0.791 0.225 0 32.889 - 10 0 0 0.724 0.232 0 34.400 - 11 0 0 0.818 0.227 0 33.818 - 12 0 0 0.838 0.232 0 34.000 - 13 0 0 0.856 0.242 0 36.923 - 14 0 0 0.705 0.238 0 36.000 - 15 0 0 0.855 0.238 0 35.467 - 16 0 0 0.866 0.240 0 35.500 - 17 0 0 0.858 0.239 0 35.059 - 18 0 0 0.724 0.249 0 35.111 - 19 0 0 0.824 0.248 0 34.947 - 20 0 0 0.924 0.245 0 34.800 - 21 0 0 0.828 0.247 0 35.238 - 22 0 0 0.690 0.246 0 35.091 - 23 0 0 0.827 0.246 0 36.522 - 24 0 0 0.848 0.248 0 36.167 - 25 0 0 0.687 0.252 0 36.000 - 26 0 0 0.712 0.250 0 35.846 - 27 0 0 0.812 0.249 0 36.000 - 28 0 0 0.813 0.249 0 35.714 - 29 0 0 0.858 0.258 0 35.862 - 30 0 0 0.747 0.252 0 35.600 - 31 0 0 0.744 0.253 0 35.097 - 32 0 0 0.789 0.254 0 34.875 - 34 0 0 0.879 0.251 0 35.059 - 36 0 0 0.858 0.258 0 34.667 - 38 0 0 0.807 0.258 0 35.158 - 40 0 0 0.785 0.260 0 35.300 - 42 0 0 0.741 0.263 0 34.667 - 44 0 0 0.852 0.263 0 36.364 - 46 0 0 0.855 0.262 0 36.261 - 48 0 0 0.846 0.267 0 35.750 - 50 0 0 0.752 0.264 0 35.520 - 53 0 0 0.805 0.265 0 34.868 - 56 0 0 0.857 0.269 0 35.071 - 59 0 0 0.744 0.268 0 34.847 - 62 0 0 0.776 0.269 0 35.032 - 65 0 0 0.866 0.267 0 34.646 - 69 0 0 0.744 0.269 0 34.493 - 73 0 0 0.835 0.270 0 35.397 - 77 0 0 0.833 0.268 0 35.273 - 81 0 0 0.857 0.268 0 34.667 - 85 0 0 0.811 0.272 0 34.494 - 90 0 0 0.797 0.269 0 34.489 - 95 0 0 0.739 0.270 0 33.979 - 100 0 0 0.787 0.269 0 33.800 - 106 0 0 0.789 0.270 0 33.547 - 112 0 0 0.828 0.271 0 33.643 - 118 0 0 0.864 0.271 0 33.797 - 125 0 0 0.789 0.276 0 33.248 - 132 0 0 0.809 0.273 0 33.030 - 139 0 0 0.839 0.278 0 32.835 - 147 0 0 0.884 0.276 0 33.252 - 155 0 0 0.857 0.278 0 32.955 - 164 0 0 0.850 0.282 0 32.756 - 173 0 0 0.832 0.281 0 32.462 - 183 0 0 0.806 0.282 0 31.825 - 194 0 0 0.844 0.284 0 31.918 - 205 0 0 0.803 0.282 0 31.493 - 217 0 0 0.903 0.285 0 31.982 - 230 0 0 0.867 0.286 0 31.948 - 243 0 0 0.821 0.287 0 31.802 - 257 0 0 0.804 0.287 0 31.658 - 272 0 0 0.876 0.291 0 31.721 - 288 0 0 0.866 0.287 0 31.792 - 305 0 0 0.848 0.287 0 31.921 - 323 0 0 0.998 0.296 0 31.554 - 342 0 0 0.991 0.291 0 32.281 - 362 0 0 1.032 0.296 0 32.829 - 383 0 0 0.924 0.297 0 32.595 - 405 0 0 0.983 0.298 0 32.523 - 429 0 0 0.934 0.299 0 32.606 - 454 0 0 0.850 0.313 0 33.172 - 480 0 0 1.039 0.306 0 33.008 - 508 0 0 0.984 0.306 0 33.535 - 538 0 0 1.012 0.306 0 33.375 - 569 0 0 0.857 0.307 0 33.230 - 602 0 0 0.913 0.306 0 33.289 - 637 0 0 0.876 0.306 0 33.300 - 674 0 0 0.946 0.307 0 33.193 - 714 0 0 0.935 0.309 0 33.395 - 756 0 0 1.006 0.308 0 33.302 - 800 0 0 0.925 0.307 0 33.255 - 847 0 0 0.908 0.310 0 33.818 - 897 0 0 0.913 0.308 0 33.779 - 950 0 0 0.901 0.310 0 33.625 - 1006 0 0 0.866 0.310 0 33.435 - 1065 0 0 0.842 0.310 0 33.510 - 1128 0 0 0.880 0.312 0 33.394 - 1194 0 0 0.875 0.312 0 33.320 - 1264 0 0 0.855 0.314 0 33.278 - 1339 0 0 0.845 0.313 0 33.177 - 1418 0 0 0.857 0.314 0 33.078 - 1502 0 0 0.903 0.318 0 33.190 - 1591 0 0 0.899 0.319 0 33.360 - 1685 0 0 0.924 0.320 0 33.496 - 1784 0 0 0.898 0.320 0 33.404 - 1884 0 0 0.917 0.322 0 33.231 - 1995 0 0 0.885 0.324 0 33.211 - 2113 0 0 0.883 0.323 0 33.304 - 2239 0 0 0.851 0.324 0 33.402 - 2371 0 0 0.901 0.329 0 33.407 - 2512 0 0 0.937 0.328 0 33.460 - 2661 0 0 0.965 0.420 0 33.514 - 2818 0 0 0.986 0.419 0 33.469 - 2985 0 0 0.983 0.422 0 33.324 - 3162 0 0 0.992 0.426 0 33.264 - 3350 0 0 0.971 0.430 0 33.398 - 3548 0 0 0.982 0.434 0 33.359 - 3758 0 0 0.997 0.435 0 33.420 - 3981 0 0 0.999 0.440 0 33.516 - 4217 0 0 0.981 0.427 0 33.525 - 4467 0 0 1.000 0.420 0 33.595 - 4732 0 0 0.957 0.425 0 33.515 - 5012 0 0 0.950 0.435 0 33.534 - 5309 0 0 0.993 0.439 0 33.481 - 5623 0 0 0.971 0.441 0 33.435 - 5957 0 0 0.948 0.446 0 33.427 - 6310 0 0 0.982 0.451 0 33.374 - 6683 0 0 0.968 0.458 0 33.235 - 7079 0 0 0.963 0.469 0 33.154 - 7499 0 0 0.999 0.468 0 33.120 - 7943 0 0 1.007 0.425 0 33.031 - 8414 0 0 0.977 0.427 0 32.928 - 8913 0 0 1.039 0.433 0 32.851 - 9441 0 0 1.031 0.434 0 32.744 - 10000 0 0 1.010 0.437 0 32.649 - 10593 0 0 1.050 0.487 0 32.585 - 11220 0 0 1.007 0.437 0 32.440 - 11885 0 0 1.010 0.437 0 32.312 - 12589 0 0 0.973 0.440 0 32.236 - 13335 0 0 0.991 0.445 0 32.098 - 14125 0 0 0.984 0.444 0 31.988 - 14962 0 0 1.092 0.447 0 31.878 - 15849 0 0 0.994 0.444 0 31.790 - 16788 0 0 0.985 0.447 0 31.697 - 17783 0 0 0.994 0.451 0 31.628 - 18836 0 0 1.007 0.455 0 31.562 - 19953 0 0 1.002 0.459 0 31.544 - 21135 0 0 1.016 0.469 0 31.482 - 22387 0 0 1.016 0.474 0 31.438 - 23714 0 0 1.019 0.475 0 31.371 - 25119 0 0 1.052 0.483 0 31.315 - 26607 0 0 1.026 0.493 0 31.245 - 28184 0 0 1.033 0.496 0 31.192 - 29854 0 0 1.048 0.499 0 31.114 - 31623 0 0 1.053 0.510 0 31.061 - 33497 0 0 1.092 0.520 0 31.005 - 35481 0 0 1.075 0.527 0 30.960 - 37584 0 0 1.095 0.535 0 30.904 - 39811 0 0 1.127 0.543 0 30.849 - 42170 0 0 1.089 0.552 0 30.757 - 44668 0 0 1.119 0.559 0 30.711 - 47315 0 0 1.113 0.566 0 30.671 - 50119 0 0 1.129 0.576 0 30.635 - 53088 0 0 1.144 0.589 0 30.635 - 56234 0 0 1.171 0.597 0 30.595 - 59566 0 0 1.146 0.601 0 30.567 - 63096 0 0 1.152 0.607 0 30.533 - 66834 0 0 1.155 0.617 0 30.465 - 70795 0 0 1.172 0.629 0 30.434 - 74989 0 0 1.214 0.634 0 30.390 - 79433 0 0 1.199 0.643 0 30.414 - 84140 0 0 1.219 0.652 0 30.395 - 89125 0 0 1.238 0.658 0 30.416 - 94406 0 0 1.272 0.671 0 30.521 - 100000 0 0 1.300 0.672 0 30.589 - 105925 0 0 1.326 0.699 0 30.778 - 112202 0 0 1.363 0.705 0 31.016 - 118850 0 0 1.353 0.698 0 31.189 - 125893 0 0 1.351 0.702 0 31.389 - 133352 0 0 1.334 0.710 0 31.545 - 141254 0 0 1.312 0.710 0 31.709 - 149624 0 0 1.314 0.719 0 31.804 - 158489 0 0 1.286 0.731 0 31.886 - 167880 0 0 1.292 0.724 0 31.953 - 177828 0 0 1.269 0.733 0 32.006 - 188365 0 0 1.277 0.739 0 32.049 - 199526 0 0 1.277 0.742 0 32.057 - 211349 0 0 1.275 0.742 0 32.075 - 223872 0 0 1.260 0.750 0 32.078 - 237137 0 0 1.267 0.765 0 32.081 - 251189 0 0 1.270 0.761 0 32.079 - 266073 0 0 1.271 0.769 0 32.075 - 281838 0 0 1.276 0.772 0 32.063 - 298538 0 0 1.277 0.778 0 32.058 - 316228 0 0 1.316 0.788 0 32.033 - 334965 0 0 1.286 0.784 0 32.016 - 354813 0 0 1.294 0.788 0 32.052 - 375837 0 0 1.306 0.791 0 32.083 - 398107 0 0 1.305 0.785 0 32.123 - 421697 0 0 1.349 0.797 0 32.168 - 446684 0 0 1.314 0.794 0 32.219 - 473151 0 0 1.336 0.805 0 32.273 - 501187 0 0 1.304 0.806 0 32.318 - 530884 0 0 1.341 0.812 0 32.371 - 562341 0 0 1.318 0.813 0 32.419 - 595662 0 0 1.308 0.816 0 32.453 - 630957 0 0 1.297 0.818 0 32.474 - 668344 0 0 1.283 0.823 0 32.484 - 707946 0 0 1.328 0.817 0 32.481 - 749894 0 0 1.282 0.821 0 32.470 - 794328 0 0 1.324 0.818 0 32.449 - 841395 0 0 1.318 0.820 0 32.417 - 891251 0 0 1.317 0.813 0 32.375 - 944061 0 0 1.319 0.814 0 32.329 - 1000000 0 0 1.294 0.812 0 32.282 - 1059254 0 0 1.310 0.810 0 32.222 - 1122018 0 0 1.303 0.808 0 32.158 - 1188502 0 0 1.302 0.823 0 32.085 - 1258925 0 0 1.267 0.810 0 32.009 - 1333521 0 0 1.246 0.813 0 31.930 - 1412538 0 0 1.254 0.819 0 31.848 - 1496236 0 0 1.250 0.819 0 31.772 - 1584893 0 0 1.257 0.827 0 31.698 - 1678804 0 0 1.261 0.822 0 31.623 - 1778279 0 0 1.278 0.824 0 31.553 - 1883649 0 0 1.280 0.871 0 31.491 - 1995262 0 0 1.325 0.844 0 31.428 - 2113489 0 0 1.325 0.841 0 31.372 - 2238721 0 0 1.298 0.843 0 31.313 - 2371374 0 0 1.314 0.838 0 31.254 - 2511886 0 0 1.319 0.851 0 31.196 - 2660725 0 0 1.330 0.847 0 31.136 - 2818383 0 0 1.332 0.854 0 31.073 - 2985383 0 0 1.356 0.861 0 31.009 - 3162278 0 0 1.375 0.865 0 30.943 - 3349654 0 0 1.374 0.872 0 30.874 - 3548134 0 0 1.370 0.882 0 30.803 - 3758374 0 0 1.388 0.885 0 30.729 - 3981072 0 0 1.378 0.894 0 30.654 - 4216965 0 0 1.382 0.902 0 30.578 - 4466836 0 0 1.394 0.904 0 30.500 - 4731513 0 0 1.421 0.924 0 30.422 - 5011872 0 0 1.431 0.930 0 30.343 - 5308844 0 0 1.437 0.944 0 30.265 - 5623413 0 0 1.443 0.952 0 30.188 - 5956621 0 0 1.453 0.962 0 30.113 - 6309573 0 0 1.444 0.974 0 30.042 - 6683439 0 0 1.459 0.976 0 29.974 - 7079458 0 0 1.480 0.985 0 29.909 - 7498942 0 0 1.489 1.007 0 29.848 - 7943282 0 0 1.506 1.016 0 29.789 - 8413951 0 0 1.519 1.017 0 29.731 - 8912509 0 0 1.527 1.038 0 29.677 - 9440609 0 0 1.547 1.045 0 29.624 - 10000000 0 0 1.553 1.061 0 29.573 - 10592537 0 0 1.576 1.073 0 29.527 - 11220185 0 0 1.590 1.082 0 29.484 - 11885022 0 0 1.603 1.086 0 29.444 - 12589254 0 0 1.603 1.103 0 29.407 - 13335214 0 0 1.621 1.105 0 29.373 - 14125375 0 0 1.636 1.120 0 29.343 - 14962357 0 0 1.646 1.137 0 29.316 diff --git a/libjudy/test/Centrino_1.3Mhz_Plots/JudySL_CO.plot b/libjudy/test/Centrino_1.3Mhz_Plots/JudySL_CO.plot deleted file mode 100644 index b3377bb69a..0000000000 --- a/libjudy/test/Centrino_1.3Mhz_Plots/JudySL_CO.plot +++ /dev/null @@ -1,567 +0,0 @@ -# StringCompare -n16788040 -A JudySL -P40 -L10 -C -M100000 /home/data/domnames.txt -# This file is in a format to input to 'jbgraph' -# XLABEL Stored -# YLABEL Microseconds / Index -# COLHEAD 1 Total Insert attempts -# COLHEAD 2 Number Gets -# COLHEAD 3 Duplicate strings -# COLHEAD 4 Insert Time (uS) -# COLHEAD 5 Get Time (uS) -# COLHEAD 6 Hash Chain Length -# COLHEAD 7 Average RAM/String -# Linux localhost 2.6.3-4mdkenterprise #1 SMP Tue Mar 2 07:00:53 CET 2004 i686 -# 32 Bit CPU -# Processor speed compiled at 1299 Mhz -# 12587648 (75.0%) non-Word_t aligned string buffers -# Ram used for input data = 418243455 bytes -# Average string length = 15.9 bytes -# 3200000 bytes malloc() for 'cached' strings for Get measurement -# Access Time = 0.101 uS average per string (mostly from Cache) -# HashStr() Time = 0.270 uS average per string (mostly from Cache) -# Access Time = 0.296 uS average per string (mostly from RAM) -# HashStr() Time = 0.482 uS average per string (mostly from RAM) -# Pass 0 -# TotInserts DeltaGets DupStrs InsTime GetTime HChainLen Ram/String -# 1 1 0 24.309 5.002 0.000000 16.0 -# 2 2 0 21.507 0.328 0.000000 26.0 -# 3 3 0 1.485 0.184 0.000000 25.3 -# 4 4 0 1.438 0.173 0.000000 28.0 -# 5 5 0 1.045 0.183 0.000000 25.6 -# 6 6 0 1.435 0.172 0.000000 27.3 -# 7 7 0 0.820 0.166 0.000000 25.1 -# 8 8 0 1.261 0.157 0.000000 27.5 -# 9 9 0 1.092 0.159 0.000000 26.2 -# 10 10 0 0.993 0.154 0.000000 25.6 -# 11 11 0 1.030 0.156 0.000000 24.4 -# 12 12 0 2.002 0.157 0.000000 26.7 -# 13 13 0 1.041 0.153 0.000000 25.5 -# 14 14 0 0.993 0.151 0.000000 25.1 -# 15 15 0 1.127 0.152 0.000000 24.5 -# 16 16 0 6.505 0.167 0.000000 28.5 -# 17 17 0 1.215 0.163 0.000000 28.0 -# 18 18 0 1.001 0.159 0.000000 27.3 -# 19 19 0 0.945 0.163 0.000000 26.5 -# 20 20 0 0.935 0.159 0.000000 25.8 -# 21 21 0 1.032 0.159 0.000000 25.5 -# 22 22 0 1.381 0.160 0.000000 25.3 -# 23 23 0 1.505 0.167 0.000000 25.4 -# 24 24 0 2.011 0.165 0.000000 27.5 -# 25 25 0 1.118 0.160 0.000000 27.0 -# 26 26 0 0.883 0.162 0.000000 26.8 -# 27 27 0 1.025 0.158 0.000000 26.4 -# 28 28 0 1.024 0.164 0.000000 25.9 -# 29 29 0 0.938 0.163 0.000000 25.9 -# 30 30 0 1.272 0.159 0.000000 25.9 -# 31 31 0 1.132 0.165 0.000000 25.4 -# 32 32 0 26.102 0.294 0.000000 31.5 -# 34 34 0 1.351 0.228 0.000000 31.2 -# 36 36 0 1.230 0.228 0.000000 31.0 -# 38 38 0 1.286 0.230 0.000000 31.3 -# 40 40 0 1.182 0.225 0.000000 31.1 -# 42 42 0 1.211 0.233 0.000000 31.4 -# 44 44 0 1.158 0.285 0.000000 31.0 -# 46 46 0 1.280 0.234 0.000000 30.8 -# 48 48 0 1.042 0.235 0.000000 30.6 -# 50 50 0 1.325 0.236 0.000000 30.8 -# 53 53 0 1.140 0.238 0.000000 30.6 -# 56 56 0 1.038 0.235 0.000000 30.3 -# 59 59 0 1.012 0.234 0.000000 30.2 -# 62 62 0 1.834 0.240 0.000000 30.5 -# 65 65 0 1.084 0.239 0.000000 30.4 -# 69 69 0 1.006 0.240 0.000000 30.2 -# 73 73 0 0.838 0.240 0.000000 29.6 -# 77 77 0 0.969 0.244 0.000000 29.8 -# 81 81 0 1.057 0.241 0.000000 29.7 -# 85 85 0 0.920 0.247 0.000000 29.6 -# 90 90 0 0.873 0.245 0.000000 29.1 -# 95 95 0 1.041 0.248 0.000000 29.1 -# 100 100 0 1.169 0.252 0.000000 29.0 -# 106 106 0 1.025 0.254 0.000000 29.4 -# 112 112 0 0.992 0.314 0.000000 29.0 -# 118 118 0 0.902 0.257 0.000000 28.6 -# 125 125 0 1.013 0.256 0.000000 28.8 -# 132 132 0 1.438 0.258 0.000000 28.7 -# 139 139 0 0.984 0.257 0.000000 28.8 -# 147 147 0 1.134 0.260 0.000000 29.5 -# 155 155 0 1.127 0.264 0.000000 29.5 -# 164 164 0 0.975 0.261 0.000000 29.1 -# 173 173 0 0.924 0.267 0.000000 28.6 -# 183 183 0 1.115 0.267 0.000000 28.6 -# 194 194 0 1.188 0.272 0.000000 29.1 -# 205 205 0 1.063 0.272 0.000000 28.7 -# 217 217 0 1.030 0.273 0.000000 28.7 -# 230 230 0 0.879 0.274 0.000000 28.2 -# 243 243 0 1.329 0.274 0.000000 28.1 -# 257 257 0 1.788 0.279 0.000000 28.9 -# 272 272 0 0.900 0.277 0.000000 28.6 -# 288 288 0 1.180 0.276 0.000000 28.8 -# 305 305 0 1.091 0.276 0.000000 28.6 -# 323 323 0 1.082 0.284 0.000000 28.4 -# 342 342 0 1.313 0.277 0.000000 28.9 -# 362 362 0 1.203 0.280 0.000000 28.8 -# 383 383 0 1.041 0.282 0.000000 28.8 -# 405 405 0 1.047 0.283 0.000000 28.9 -# 429 429 0 0.988 0.285 0.000000 28.7 -# 454 454 0 1.055 0.286 0.000000 28.5 -# 480 480 0 1.300 0.287 0.000000 28.8 -# 508 508 0 1.050 0.291 0.000000 28.6 -# 538 538 0 1.133 0.300 0.000000 28.5 -# 569 569 0 1.041 0.289 0.000000 28.3 -# 602 602 0 1.161 0.294 0.000000 28.3 -# 637 637 0 1.178 0.298 0.000000 28.5 -# 674 674 0 1.167 0.287 0.000000 28.5 -# 714 714 0 1.180 0.287 0.000000 28.5 -# 756 756 0 1.364 0.286 0.000000 28.7 -# 800 800 0 1.087 0.290 0.000000 28.4 -# 847 847 0 1.186 0.290 0.000000 28.3 -# 897 897 0 1.218 0.277 0.000000 30.2 -# 950 950 0 1.147 0.276 0.000000 30.1 -# 1006 1006 0 1.059 0.283 0.000000 29.9 -# 1065 1065 0 1.245 0.280 0.000000 29.7 -# 1128 1128 0 1.164 0.286 0.000000 29.5 -# 1194 1194 0 1.136 0.282 0.000000 29.3 -# 1264 1264 0 1.176 0.282 0.000000 29.3 -# 1339 1339 0 1.160 0.287 0.000000 30.5 -# 1418 1418 0 1.123 0.289 0.000000 30.3 -# 1502 1502 0 1.163 0.285 0.000000 30.0 -# 1591 1591 0 1.284 0.286 0.000000 30.0 -# 1685 1685 0 1.158 0.288 0.000000 30.0 -# 1784 1784 0 1.149 0.289 0.000000 30.7 -# 1884 1884 0 1.093 0.289 0.000000 30.4 -# 1995 1995 0 1.241 0.292 0.000000 30.2 -# 2113 2113 0 1.217 0.297 0.000000 30.1 -# 2239 2239 0 1.161 0.297 0.000000 30.6 -# 2371 2371 0 1.135 0.296 0.000000 30.4 -# 2512 2512 0 1.093 0.301 0.000000 30.2 -# 2661 2661 0 1.096 0.302 0.000000 30.0 -# 2818 2818 0 1.193 0.359 0.000000 30.4 -# 2985 2985 0 1.238 0.303 0.000000 30.2 -# 3162 3162 0 1.119 0.303 0.000000 29.9 -# 3350 3350 0 1.229 0.302 0.000000 30.3 -# 3548 3548 0 1.257 0.307 0.000000 30.1 -# 3758 3758 0 1.177 0.311 0.000000 29.9 -# 3981 3981 0 1.293 0.311 0.000000 30.3 -# 4217 4217 0 1.178 0.316 0.000000 30.0 -# 4467 4467 0 1.215 0.318 0.000000 30.2 -# 4732 4732 0 1.200 0.321 0.000000 30.0 -# 5012 5012 0 1.187 0.326 0.000000 29.7 -# 5309 5309 0 1.276 0.330 0.000000 29.9 -# 5623 5623 0 1.208 0.330 0.000000 30.0 -# 5957 5957 0 1.234 0.337 0.000000 29.8 -# 6310 6310 0 1.297 0.338 0.000000 30.0 -# 6683 6683 0 1.245 0.344 0.000000 29.8 -# 7079 7079 0 1.275 0.350 0.000000 29.9 -# 7499 7499 0 1.287 0.352 0.000000 29.6 -# 7943 7943 0 1.257 0.356 0.000000 29.7 -# 8414 8414 0 1.249 0.357 0.000000 29.7 -# 8913 8913 0 1.263 0.362 0.000000 29.5 -# 9441 9441 0 1.230 0.363 0.000000 29.3 -# 10000 10000 0 1.226 0.369 0.000000 29.1 -# 10593 10593 0 1.257 0.371 0.000000 28.9 -# 11220 11220 0 1.308 0.377 0.000000 28.8 -# 11885 11885 0 1.276 0.409 0.000000 28.6 -# 12589 12589 0 1.283 0.398 0.000000 28.4 -# 13335 13335 0 1.318 0.450 0.000000 28.5 -# 14125 14125 0 1.309 0.392 0.000000 28.5 -# 14962 14962 0 1.280 0.395 0.000000 28.3 -# 15849 15849 0 1.304 0.400 0.000000 28.2 -# 16788 16788 0 1.295 0.405 0.000000 28.0 -# 17783 17783 0 1.324 0.411 0.000000 27.9 -# 18836 18836 0 1.338 0.416 0.000000 27.8 -# 19953 19953 0 1.353 0.426 0.000000 27.8 -# 21135 21135 0 1.342 0.429 0.000000 27.8 -# 22387 22387 0 1.365 0.448 0.000000 27.8 -# 23714 23714 0 1.343 0.451 0.000000 27.8 -# 25119 25119 0 1.361 0.452 0.000000 27.8 -# 26607 26607 0 1.482 0.469 0.000000 27.7 -# 28184 28184 0 1.368 0.479 0.000000 27.7 -# 29854 29854 0 1.350 0.477 0.000000 27.6 -# 31623 31623 0 1.477 0.511 0.000000 27.6 -# 33497 33497 0 1.397 0.501 0.000000 27.5 -# 35481 35481 0 1.496 0.515 0.000000 27.5 -# 37584 37584 0 1.404 0.529 0.000000 27.4 -# 39811 39811 0 1.420 0.543 0.000000 27.4 -# 42170 42170 0 1.443 0.554 0.000000 27.4 -# 44668 44668 0 1.439 0.568 0.000000 27.3 -# 47315 47315 0 1.469 0.592 0.000000 27.3 -# 50119 50119 0 1.473 0.593 0.000000 27.3 -# 53088 53088 0 1.524 0.623 0.000000 27.2 -# 56234 56234 0 1.491 0.617 0.000000 27.2 -# 59566 59566 0 1.510 0.631 0.000000 27.1 -# 63096 63096 0 1.508 0.644 0.000000 27.1 -# 66834 66834 0 1.517 0.667 0.000000 27.0 -# 70795 70795 0 1.549 0.688 0.000000 26.9 -# 74989 74989 0 1.614 0.689 0.000000 26.9 -# 79433 79433 0 1.573 0.701 0.000000 26.8 -# 84140 84140 0 1.596 0.715 0.000000 26.8 -# 89125 89125 0 1.594 0.731 0.000000 26.8 -# 94406 94406 0 1.602 0.742 0.000000 26.7 -# 100000 100000 0 1.631 0.755 0.000000 26.7 -# 105925 100000 0 1.646 0.773 0.000000 26.6 -# 112202 100000 0 1.691 0.788 0.000000 26.6 -# 118850 100000 0 1.721 0.808 0.000000 26.5 -# 125893 100000 0 1.695 0.810 0.000000 26.5 -# 133352 100000 0 1.785 0.823 0.000000 26.5 -# 141254 100000 0 1.755 0.835 0.000000 26.4 -# 149624 100000 0 1.781 0.859 0.000000 26.4 -# 158489 100000 0 1.784 0.868 0.000000 26.4 -# 167880 100000 0 1.762 0.889 0.000000 26.3 -# 177828 100000 0 1.789 0.896 0.000000 26.3 -# 188365 100000 0 1.820 0.904 0.000000 26.2 -# 199526 100000 0 1.830 0.914 0.000000 26.1 -# 211349 100000 0 1.870 0.930 0.000000 26.1 -# 223872 100000 0 1.861 0.944 0.000000 26.0 -# 237137 100000 0 1.862 0.967 0.000000 26.0 -# 251189 100000 0 1.894 0.975 0.000000 25.9 -# 266073 100000 0 1.906 0.985 0.000000 25.9 -# 281838 100000 0 1.942 1.006 0.000000 25.8 -# 298538 100000 0 1.997 1.027 0.000000 25.8 -# 316228 100000 0 1.965 1.029 0.000000 25.7 -# 334965 100000 0 1.966 1.042 0.000000 25.7 -# 354813 100000 0 1.975 1.054 0.000000 25.6 -# 375837 100000 0 1.999 1.074 0.000000 25.6 -# 398107 100000 0 2.026 1.083 0.000000 25.6 -# 421697 100000 0 2.046 1.094 0.000000 25.5 -# 446684 100000 0 2.057 1.117 0.000000 25.5 -# 473151 100000 0 2.069 1.124 0.000000 25.4 -# 501187 100000 0 2.083 1.135 0.000000 25.4 -# 530884 100000 0 2.112 1.153 0.000000 25.3 -# 562341 100000 0 2.116 1.164 0.000000 25.3 -# 595662 100000 0 2.148 1.179 0.000000 25.2 -# 630957 100000 0 2.182 1.195 0.000000 25.2 -# 668344 100000 0 2.206 1.207 0.000000 25.2 -# 707946 100000 0 2.183 1.228 0.000000 25.1 -# 749894 100000 0 2.186 1.233 0.000000 25.1 -# 794328 100000 0 2.216 1.251 0.000000 25.0 -# 841395 100000 0 2.243 1.260 0.000000 25.0 -# 891251 100000 0 2.254 1.270 0.000000 25.0 -# 944061 100000 0 2.272 1.285 0.000000 24.9 -# 1000000 100000 0 2.274 1.304 0.000000 24.9 -# 1059254 100000 0 2.300 1.312 0.000000 24.8 -# 1122018 100000 0 2.307 1.339 0.000000 24.8 -# 1188502 100000 0 2.321 1.345 0.000000 24.7 -# 1258925 100000 0 2.341 1.349 0.000000 24.7 -# 1333521 100000 0 2.351 1.373 0.000000 24.7 -# 1412538 100000 0 2.367 1.383 0.000000 24.6 -# 1496236 100000 0 2.396 1.393 0.000000 24.6 -# 1584893 100000 0 2.407 1.404 0.000000 24.5 -# 1678804 100000 0 2.427 1.415 0.000000 24.5 -# 1778279 100000 0 2.432 1.432 0.000000 24.4 -# 1883649 100000 0 2.460 1.444 0.000000 24.4 -# 1995262 100000 0 2.459 1.461 0.000000 24.4 -# 2113489 100000 0 2.493 1.471 0.000000 24.3 -# 2238721 100000 0 2.502 1.496 0.000000 24.3 -# 2371374 100000 0 2.530 1.508 0.000000 24.3 -# 2511886 100000 0 2.538 1.516 0.000000 24.2 -# 2660725 100000 0 2.551 1.539 0.000000 24.2 -# 2818383 100000 0 2.578 1.543 0.000000 24.1 -# 2985383 100000 0 2.590 1.562 0.000000 24.1 -# 3162278 100000 0 2.617 1.576 0.000000 24.1 -# 3349654 100000 0 2.625 1.615 0.000000 24.0 -# 3548134 100000 0 2.650 1.621 0.000000 24.0 -# 3758374 100000 0 2.679 1.642 0.000000 23.9 -# 3981072 100000 0 2.701 1.659 0.000000 23.9 -# 4216965 100000 0 2.722 1.671 0.000000 23.9 -# 4466836 100000 0 2.752 1.690 0.000000 23.8 -# 4731513 100000 0 2.772 1.707 0.000000 23.8 -# 5011872 100000 0 2.792 1.730 0.000000 23.7 -# 5308844 100000 0 3.166 1.753 0.000000 23.7 -# 5623413 100000 0 2.819 1.757 0.000000 23.7 -# 5956621 100000 0 2.841 1.776 0.000000 23.6 -# 6309573 100000 0 2.864 1.804 0.000000 23.6 -# 6683439 100000 0 2.885 1.807 0.000000 23.5 -# 7079458 100000 0 2.910 1.849 0.000000 23.5 -# 7498942 100000 0 2.932 1.865 0.000000 23.4 -# 7943282 100000 0 2.956 1.880 0.000000 23.4 -# 8413951 100000 0 2.989 1.914 0.000000 23.3 -# 8912509 100000 0 3.009 1.928 0.000000 23.3 -# 9440609 100000 0 3.035 1.950 0.000000 23.2 -# 10000000 100000 0 3.067 1.981 0.000000 23.2 -# 10592537 100000 0 3.109 2.017 0.000000 23.1 -# 11220185 100000 0 3.118 2.044 0.000000 23.1 -# 11885022 100000 0 3.151 2.074 0.000000 23.0 -# 12589254 100000 0 3.184 2.092 0.000000 23.0 -# 13335214 100000 0 3.202 2.133 0.000000 22.9 -# 14125375 100000 0 3.230 2.148 0.000000 22.8 -# 14962357 100000 0 3.258 2.190 0.000000 22.8 -# 15848932 100000 0 3.281 2.220 0.000000 22.7 -# 16788040 100000 0 3.319 2.228 0.000000 22.6 -# Total Duplicate strings = 0 -# Begin JudySLFreeArray()... -# returned 380043160 bytes -# Free 16788040 strings, 0.615 uSecs Ave/string - -# Pass 1 -# Pass 2 -# Pass 3 -# Pass 4 -# Pass 5 -# Pass 6 -# Pass 7 -# Pass 8 -# Pass 9 -# TotInserts 0 0 InsTime GetTime 0 Ram/String - 1 0 0 4.734 0.951 0 20.000 - 2 0 0 4.802 0.251 0 24.000 - 3 0 0 0.851 0.143 0 26.667 - 4 0 0 0.893 0.150 0 28.000 - 5 0 0 0.708 0.151 0 28.000 - 6 0 0 0.871 0.145 0 28.667 - 7 0 0 0.661 0.151 0 26.286 - 8 0 0 1.261 0.149 0 30.000 - 9 0 0 0.634 0.150 0 28.000 - 10 0 0 0.647 0.151 0 28.000 - 11 0 0 0.634 0.143 0 26.909 - 12 0 0 1.137 0.149 0 29.000 - 13 0 0 0.640 0.153 0 28.308 - 14 0 0 0.634 0.148 0 27.429 - 15 0 0 0.644 0.149 0 27.200 - 16 0 0 1.163 0.161 0 30.750 - 17 0 0 0.707 0.153 0 30.353 - 18 0 0 0.669 0.152 0 29.556 - 19 0 0 0.694 0.155 0 29.053 - 20 0 0 0.675 0.153 0 28.800 - 21 0 0 0.664 0.155 0 28.762 - 22 0 0 0.732 0.160 0 28.000 - 23 0 0 0.631 0.154 0 27.478 - 24 0 0 0.905 0.158 0 29.500 - 25 0 0 0.661 0.158 0 28.960 - 26 0 0 0.681 0.159 0 28.615 - 27 0 0 0.695 0.158 0 28.148 - 28 0 0 0.706 0.156 0 27.714 - 29 0 0 0.672 0.161 0 27.172 - 30 0 0 0.663 0.159 0 27.067 - 31 0 0 0.686 0.159 0 26.710 - 32 0 0 0.978 0.177 0 33.625 - 34 0 0 0.814 0.174 0 33.294 - 36 0 0 0.962 0.218 0 33.111 - 38 0 0 0.774 0.222 0 32.632 - 40 0 0 0.839 0.220 0 32.000 - 42 0 0 0.798 0.225 0 32.190 - 44 0 0 0.848 0.226 0 31.636 - 46 0 0 0.844 0.229 0 30.957 - 48 0 0 0.828 0.226 0 31.167 - 50 0 0 0.802 0.230 0 30.480 - 53 0 0 0.811 0.230 0 30.415 - 56 0 0 0.897 0.234 0 29.714 - 59 0 0 0.863 0.233 0 29.492 - 62 0 0 0.925 0.236 0 29.742 - 65 0 0 0.858 0.235 0 29.231 - 69 0 0 0.848 0.238 0 29.449 - 73 0 0 0.784 0.240 0 29.151 - 77 0 0 0.855 0.237 0 28.883 - 81 0 0 0.887 0.241 0 29.185 - 85 0 0 0.894 0.247 0 29.271 - 90 0 0 0.873 0.245 0 29.289 - 95 0 0 0.849 0.248 0 29.600 - 100 0 0 0.859 0.252 0 29.640 - 106 0 0 0.943 0.254 0 29.547 - 112 0 0 0.872 0.258 0 29.071 - 118 0 0 0.902 0.257 0 29.119 - 125 0 0 0.833 0.256 0 28.960 - 132 0 0 0.873 0.258 0 28.515 - 139 0 0 0.918 0.257 0 28.259 - 147 0 0 0.888 0.260 0 27.918 - 155 0 0 0.869 0.264 0 28.077 - 164 0 0 0.936 0.261 0 28.000 - 173 0 0 0.907 0.267 0 27.838 - 183 0 0 0.870 0.267 0 27.366 - 194 0 0 0.916 0.272 0 27.485 - 205 0 0 0.950 0.272 0 28.078 - 217 0 0 0.915 0.273 0 28.111 - 230 0 0 0.879 0.274 0 27.826 - 243 0 0 0.973 0.274 0 27.934 - 257 0 0 0.944 0.279 0 28.000 - 272 0 0 0.900 0.277 0 27.676 - 288 0 0 0.999 0.276 0 27.444 - 305 0 0 0.918 0.276 0 27.370 - 323 0 0 1.051 0.284 0 27.641 - 342 0 0 1.090 0.277 0 28.082 - 362 0 0 1.065 0.280 0 27.878 - 383 0 0 1.041 0.282 0 28.010 - 405 0 0 1.026 0.283 0 28.425 - 429 0 0 0.988 0.285 0 28.177 - 454 0 0 1.055 0.286 0 28.467 - 480 0 0 1.094 0.287 0 28.042 - 508 0 0 1.050 0.291 0 28.126 - 538 0 0 1.096 0.298 0 28.416 - 569 0 0 1.041 0.289 0 28.359 - 602 0 0 1.161 0.294 0 28.332 - 637 0 0 1.178 0.298 0 28.509 - 674 0 0 1.167 0.287 0 28.641 - 714 0 0 1.170 0.287 0 28.958 - 756 0 0 1.270 0.286 0 28.841 - 800 0 0 1.087 0.290 0 28.610 - 847 0 0 1.186 0.290 0 28.434 - 897 0 0 1.218 0.277 0 30.100 - 950 0 0 1.106 0.276 0 30.097 - 1006 0 0 1.059 0.283 0 29.920 - 1065 0 0 1.129 0.280 0 29.923 - 1128 0 0 1.058 0.286 0 29.652 - 1194 0 0 1.067 0.282 0 29.471 - 1264 0 0 1.176 0.282 0 29.256 - 1339 0 0 1.092 0.287 0 29.028 - 1418 0 0 1.081 0.289 0 28.996 - 1502 0 0 1.093 0.285 0 30.088 - 1591 0 0 1.036 0.286 0 29.715 - 1685 0 0 1.063 0.288 0 29.550 - 1784 0 0 1.094 0.289 0 29.330 - 1884 0 0 1.084 0.289 0 29.246 - 1995 0 0 1.066 0.292 0 30.129 - 2113 0 0 1.097 0.297 0 29.925 - 2239 0 0 1.128 0.297 0 29.747 - 2371 0 0 1.103 0.296 0 29.545 - 2512 0 0 1.082 0.301 0 30.013 - 2661 0 0 1.080 0.302 0 29.844 - 2818 0 0 1.135 0.322 0 29.612 - 2985 0 0 1.074 0.303 0 29.994 - 3162 0 0 1.099 0.303 0 29.736 - 3350 0 0 1.100 0.302 0 29.586 - 3548 0 0 1.092 0.307 0 29.948 - 3758 0 0 1.133 0.311 0 29.824 - 3981 0 0 1.127 0.311 0 29.521 - 4217 0 0 1.144 0.316 0 29.796 - 4467 0 0 1.165 0.318 0 29.630 - 4732 0 0 1.137 0.321 0 29.863 - 5012 0 0 1.149 0.326 0 29.686 - 5309 0 0 1.137 0.330 0 29.922 - 5623 0 0 1.110 0.330 0 29.685 - 5957 0 0 1.152 0.337 0 29.730 - 6310 0 0 1.149 0.338 0 29.636 - 6683 0 0 1.169 0.344 0 29.757 - 7079 0 0 1.188 0.350 0 29.522 - 7499 0 0 1.172 0.352 0 29.485 - 7943 0 0 1.184 0.356 0 29.481 - 8414 0 0 1.177 0.357 0 29.364 - 8913 0 0 1.173 0.362 0 29.487 - 9441 0 0 1.176 0.363 0 29.274 - 10000 0 0 1.182 0.369 0 29.111 - 10593 0 0 1.205 0.371 0 28.880 - 11220 0 0 1.197 0.377 0 28.883 - 11885 0 0 1.200 0.409 0 28.710 - 12589 0 0 1.207 0.398 0 28.586 - 13335 0 0 1.224 0.420 0 28.478 - 14125 0 0 1.213 0.392 0 28.337 - 14962 0 0 1.224 0.395 0 28.230 - 15849 0 0 1.243 0.400 0 28.074 - 16788 0 0 1.244 0.405 0 27.968 - 17783 0 0 1.261 0.411 0 27.827 - 18836 0 0 1.272 0.416 0 27.712 - 19953 0 0 1.283 0.426 0 27.697 - 21135 0 0 1.265 0.429 0 27.584 - 22387 0 0 1.287 0.448 0 27.546 - 23714 0 0 1.296 0.451 0 27.511 - 25119 0 0 1.298 0.452 0 27.519 - 26607 0 0 1.313 0.469 0 27.518 - 28184 0 0 1.325 0.479 0 27.524 - 29854 0 0 1.323 0.477 0 27.444 - 31623 0 0 1.338 0.511 0 27.434 - 33497 0 0 1.346 0.501 0 27.402 - 35481 0 0 1.368 0.515 0 27.335 - 37584 0 0 1.365 0.529 0 27.333 - 39811 0 0 1.377 0.543 0 27.306 - 42170 0 0 1.382 0.554 0 27.303 - 44668 0 0 1.404 0.568 0 27.259 - 47315 0 0 1.414 0.592 0 27.225 - 50119 0 0 1.417 0.593 0 27.198 - 53088 0 0 1.448 0.619 0 27.141 - 56234 0 0 1.452 0.617 0 27.096 - 59566 0 0 1.447 0.631 0 27.072 - 63096 0 0 1.474 0.644 0 27.052 - 66834 0 0 1.487 0.667 0 27.033 - 70795 0 0 1.506 0.683 0 26.991 - 74989 0 0 1.518 0.689 0 26.935 - 79433 0 0 1.525 0.701 0 26.883 - 84140 0 0 1.546 0.715 0 26.842 - 89125 0 0 1.556 0.731 0 26.823 - 94406 0 0 1.565 0.742 0 26.731 - 100000 0 0 1.589 0.755 0 26.702 - 105925 0 0 1.608 0.773 0 26.692 - 112202 0 0 1.627 0.788 0 26.645 - 118850 0 0 1.634 0.807 0 26.616 - 125893 0 0 1.645 0.810 0 26.572 - 133352 0 0 1.658 0.823 0 26.512 - 141254 0 0 1.670 0.835 0 26.464 - 149624 0 0 1.688 0.857 0 26.408 - 158489 0 0 1.700 0.866 0 26.358 - 167880 0 0 1.730 0.882 0 26.324 - 177828 0 0 1.730 0.896 0 26.276 - 188365 0 0 1.749 0.904 0 26.217 - 199526 0 0 1.769 0.914 0 26.156 - 211349 0 0 1.780 0.930 0 26.109 - 223872 0 0 1.791 0.944 0 26.065 - 237137 0 0 1.809 0.961 0 26.013 - 251189 0 0 1.828 0.971 0 25.967 - 266073 0 0 1.840 0.984 0 25.922 - 281838 0 0 1.870 0.997 0 25.863 - 298538 0 0 1.883 1.009 0 25.818 - 316228 0 0 1.897 1.023 0 25.746 - 334965 0 0 1.913 1.037 0 25.691 - 354813 0 0 1.917 1.049 0 25.659 - 375837 0 0 1.939 1.061 0 25.606 - 398107 0 0 1.957 1.075 0 25.560 - 421697 0 0 1.977 1.086 0 25.502 - 446684 0 0 1.994 1.103 0 25.468 - 473151 0 0 2.009 1.113 0 25.425 - 501187 0 0 2.019 1.127 0 25.383 - 530884 0 0 2.036 1.139 0 25.343 - 562341 0 0 2.060 1.151 0 25.294 - 595662 0 0 2.073 1.162 0 25.255 - 630957 0 0 2.093 1.177 0 25.212 - 668344 0 0 2.100 1.189 0 25.170 - 707946 0 0 2.116 1.203 0 25.128 - 749894 0 0 2.139 1.216 0 25.089 - 794328 0 0 2.147 1.229 0 25.046 - 841395 0 0 2.163 1.239 0 25.009 - 891251 0 0 2.171 1.252 0 24.968 - 944061 0 0 2.196 1.267 0 24.935 - 1000000 0 0 2.206 1.283 0 24.885 - 1059254 0 0 2.215 1.293 0 24.840 - 1122018 0 0 2.237 1.304 0 24.795 - 1188502 0 0 2.254 1.318 0 24.749 - 1258925 0 0 2.268 1.332 0 24.703 - 1333521 0 0 2.285 1.346 0 24.658 - 1412538 0 0 2.303 1.357 0 24.623 - 1496236 0 0 2.314 1.371 0 24.592 - 1584893 0 0 2.333 1.383 0 24.544 - 1678804 0 0 2.354 1.402 0 24.498 - 1778279 0 0 2.366 1.415 0 24.459 - 1883649 0 0 2.388 1.426 0 24.411 - 1995262 0 0 2.407 1.435 0 24.367 - 2113489 0 0 2.417 1.451 0 24.324 - 2238721 0 0 2.434 1.464 0 24.292 - 2371374 0 0 2.448 1.481 0 24.247 - 2511886 0 0 2.467 1.494 0 24.212 - 2660725 0 0 2.486 1.511 0 24.176 - 2818383 0 0 2.499 1.522 0 24.141 - 2985383 0 0 2.521 1.541 0 24.100 - 3162278 0 0 2.541 1.556 0 24.056 - 3349654 0 0 2.564 1.572 0 24.010 - 3548134 0 0 2.584 1.589 0 23.966 - 3758374 0 0 2.603 1.610 0 23.929 - 3981072 0 0 2.624 1.633 0 23.896 - 4216965 0 0 2.646 1.645 0 23.859 - 4466836 0 0 2.668 1.656 0 23.822 - 4731513 0 0 2.688 1.681 0 23.792 - 5011872 0 0 2.714 1.702 0 23.741 - 5308844 0 0 2.739 1.724 0 23.701 - 5623413 0 0 2.757 1.747 0 23.659 - 5956621 0 0 2.783 1.766 0 23.619 - 6309573 0 0 2.806 1.785 0 23.568 - 6683439 0 0 2.830 1.805 0 23.533 - 7079458 0 0 2.873 1.838 0 23.488 - 7498942 0 0 2.891 1.861 0 23.440 - 7943282 0 0 2.911 1.880 0 23.395 - 8413951 0 0 2.936 1.904 0 23.344 - 8912509 0 0 2.962 1.928 0 23.296 - 9440609 0 0 2.983 1.950 0 23.243 - 10000000 0 0 3.010 1.981 0 23.191 - 10592537 0 0 3.039 2.016 0 23.139 - 11220185 0 0 3.070 2.043 0 23.082 - 11885022 0 0 3.096 2.068 0 23.025 - 12589254 0 0 3.121 2.092 0 22.965 - 13335214 0 0 3.144 2.124 0 22.904 - 14125375 0 0 3.165 2.148 0 22.842 - 14962357 0 0 3.191 2.176 0 22.777 - 15848932 0 0 3.212 2.209 0 22.712 - 16788040 0 0 3.284 2.226 0 22.637 diff --git a/libjudy/test/CheckDupLines.c b/libjudy/test/CheckDupLines.c deleted file mode 100644 index 07d98dfb18..0000000000 --- a/libjudy/test/CheckDupLines.c +++ /dev/null @@ -1,44 +0,0 @@ -#include -#include -#include - -#include - -//#include "JudyHS.h" // for Judy.h without JudyHS*() - -// By Doug Baskins Apr 2004 - for JudyHS man page - -#define MAXLINE 1000000 /* max length of line */ -char Index[MAXLINE]; // string to check - -int // Usage: CheckDupLines < file -main() -{ - Pvoid_t PJArray = (PWord_t)NULL; // Judy array. - PWord_t PValue; // Judy array element. - Word_t Bytes; // size of JudyHS array. - Word_t LineNumb = 0; // current line number - Word_t Dups = 0; // number of duplicate lines - - while (fgets(Index, MAXLINE, stdin) != (char *)NULL) - { - LineNumb++; // line number - -// store string into array - JHSI(PValue, PJArray, Index, strlen(Index)); - if (*PValue) // check if duplicate - { - Dups++; // yes, count - printf("Duplicate lines %lu:%lu:%s", *PValue, LineNumb, Index); - } - else - { - *PValue = LineNumb; // store Line number - } - } - printf("%lu Duplicates, free JudyHS array of %lu Lines\n", - Dups, LineNumb - Dups); - JHSFA(Bytes, PJArray); // free array - printf("The JudyHS array allocated %lu bytes of memory\n", Bytes); - return (0); -} diff --git a/libjudy/test/Checkit b/libjudy/test/Checkit deleted file mode 100755 index b06083bc46..0000000000 --- a/libjudy/test/Checkit +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/sh -CC=${CC:-cc} - -echo -echo "=== +++++++++ This test runs in 15 seconds on a PIII 750Mhz +++++++" - -LIBJUDY=`find ../ -name libJudy.a` -JUDY_H=`find ../ -name Judy.h` - -echo "$CC -O SLcompare.c -DHASHMETHOD -o SL_Hash" - $CC -O SLcompare.c -DHASHMETHOD -o SL_Hash - -echo "$CC -O SLcompare.c -DSPLAYMETHOD -o SL_Splay" - $CC -O SLcompare.c -DSPLAYMETHOD -o SL_Splay - -echo "$CC -O SLcompare.c -DREDBLACKMETHOD -o SL_Redblack" - $CC -O SLcompare.c -DREDBLACKMETHOD -o SL_Redblack - -echo -echo Compiling with Judy library: $LIBJUDY -echo - -echo "$CC -O -I../src SLcompare.c -DJUDYMETHOD -o SL_Judy $LIBJUDY -lm" - $CC -O -I../src SLcompare.c -DJUDYMETHOD -o SL_Judy $LIBJUDY -lm -RET=$? -if [ $RET -ne 0 ] ; then -echo "=== $? Failed: $CC SLcompare.c -DJUDYMETHOD" -echo "=== $? Failed: $CC -O -I../src SLcompare.c -DJUDYMETHOD -o SL_Judy $LIBJUDY -lm" -exit $? -fi - -echo "$CC -O -I../src Judy1LHCheck.c -o Judy1LHCheck $LIBJUDY -lm" - $CC -O -I../src Judy1LHCheck.c -o Judy1LHCheck $LIBJUDY -lm -RET=$? -if [ $RET -ne 0 ] ; then -echo "=== $? Failed: $CC Judy1LHCheck.c" -exit $? -fi - - -echo "$CC -O -I../src Judy1LHTime.c -DNOINLINE -o Judy1LHTime $LIBJUDY -lm" - $CC -O -I../src Judy1LHTime.c -DNOINLINE -o Judy1LHTime $LIBJUDY -lm -RET=$? -if [ $RET -ne 0 ] ; then -echo "=== $? Failed: $CC Judy1LHTime.c" -exit $? -fi - -# -OR- if Judy is installed, these can be compiled from anywhere: -#cc -O SLcompare.c -DJUDYMETHOD -o SL_Judy -lJudy -lm -#cc -O Judy1LHCheck.c -o Judy1LHCheck -lJudy -lm -#cc -O Judy1LHTime.c -o Judy1LHTime -lJudy -lm -echo "=== Pass: Compile of tests" - -echo -echo " Validate Judy1/JudyL/JudyHS functions (except Judy*ByCount)" -./Judy1LHCheck -n 300000 -B20 > /dev/null -RET=$? -if [ $RET -ne 0 ] ; then -echo "=== $? Failed: Judy1/JudyL/JudyHS validate program" -exit $? -fi -echo "=== Pass: Judy1/JudyL/JudyHS validate program" - - -echo -echo " Do a few timings tests of Judy1/JudyL/JudyHS" -echo -# Pop1 is: current number of Indexes stored in Judy array -# Measmts is: lookups to make measurement -# J1 is: Judy1 -# JL is: JudyL -# /I is: per Index -# MU is: Memory Used (allocated thru malloc(3)) -# HEAP is: Memory change measured with sbrk(0) -echo " Pop1 Measmts J1S JLI J1T JLG J1MU/I JLMU/I HEAP/I" -./Judy1LHTime -n 2000000 -P1 -B19 | grep -v "^#" -echo "=== Pass: Judy1/JudyL/JudyHS performance program" - - - -echo -echo " Do a few timings tests of JudySL and friends" -echo -# lines is: number of lines in source file -# avg_linelen is: average bytes per line -# getline is: average time go get a line and remove white space -# StoreD is: number of unique lines stored into JudySL array -# RAMused/line is: Memory change measured with sbrk(0) -# store/ln is: average insert time (including duplicates) -# lookup/ln is: average lookup time in same order as inserts -# ADT is: Abstract Data Type method -echo " lines avg_linelen getline StoreD RAMused/line store/ln lookup/ln ADT" -./SL_Hash StringCompare.c | grep HASH -./SL_Splay StringCompare.c | grep SPLAY -./SL_Redblack StringCompare.c | grep REDBLACK -./SL_Judy StringCompare.c | grep JUDY -RET=$? -if [ $RET -ne 0 ] ; then -echo "=== $? Failed: JudySL if StoreD numbers are all the same" -exit $? -fi -echo "=== Pass: JudySL if StoreD numbers are all the same" -echo diff --git a/libjudy/test/Judy1LCheck.c b/libjudy/test/Judy1LCheck.c deleted file mode 100644 index 3e7afa6838..0000000000 --- a/libjudy/test/Judy1LCheck.c +++ /dev/null @@ -1,908 +0,0 @@ -// @(#) $Revision: 4.15 $ $Source: /judy/test/manual/Judy1LCheck.c $ -// This program tests the accuracy of a Judy1 with a JudyL Array. -// -by- -// Douglas L. Baskins (8/2001) doug@sourcejudy.com - -#ifndef JU_WIN_IA32 -#include // unavailable on Win32, and no getopt(). -#endif - -#include // calloc() -#include // pow() -#include // printf() - -#include - -// Common macro to handle a failure -#define FAILURE(STR, UL) \ -{ \ -printf( "Error: %s %lu, file='%s', 'function='%s', line %d\n", \ - STR, UL, __FILE__, __FUNCTI0N__, __LINE__); \ -fprintf(stderr, "Error: %s %lu, file='%s', 'function='%s', line %d\n", \ - STR, UL, __FILE__, __FUNCTI0N__, __LINE__); \ - exit(1); \ -} - -// Structure to keep track of times -typedef struct MEASUREMENTS_STRUCT -{ - Word_t ms_delta; -} -ms_t, *Pms_t; - -// Specify prototypes for each test routine -int -NextNumb(Word_t * PNumber, double *PDNumb, double DMult, Word_t MaxNumb); - -Word_t TestJudyIns(void **J1, void **JL, Word_t Seed, Word_t Elements); - -Word_t TestJudyDup(void **J1, void **JL, Word_t Seed, Word_t Elements); - -int TestJudyDel(void **J1, void **JL, Word_t Seed, Word_t Elements); - -Word_t TestJudyGet(void *J1, void *JL, Word_t Seed, Word_t Elements); - -int TestJudyCount(void *J1, void *JL, Word_t LowIndex, Word_t Elements); - -Word_t TestJudyNext(void *J1, void *JL, Word_t LowIndex, Word_t Elements); - -int TestJudyPrev(void *J1, void *JL, Word_t HighIndex, Word_t Elements); - -int -TestJudyNextEmpty(void *J1, void *JL, Word_t LowIndex, Word_t Elements); - -int -TestJudyPrevEmpty(void *J1, void *JL, Word_t HighIndex, Word_t Elements); - -Word_t MagicList[] = -{ - 0,0,0,0,0,0,0,0,0,0, // 0..9 - 0x27f, // 10 - 0x27f, // 11 - 0x27f, // 12 - 0x27f, // 13 - 0x27f, // 14 - 0x27f, // 15 - 0x1e71, // 16 - 0xdc0b, // 17 - 0xdc0b, // 18 - 0xdc0b, // 19 - 0xdc0b, // 20 - 0xc4fb, // 21 - 0xc4fb, // 22 - 0xc4fb, // 23 - 0x13aab, // 24 - 0x11ca3, // 25 - 0x11ca3, // 26 - 0x11ca3, // 27 - 0x13aab, // 28 - 0x11ca3, // 29 - 0xc4fb, // 30 - 0xc4fb, // 31 - 0x13aab, // 32 - 0x14e73, // 33 - 0x145d7, // 34 - 0x145f9, // 35 following tested with Seed=0xc1fc to 35Gig numbers - 0x151ed, // 36 .. 41 - 0x151ed, // 37 - 0x151ed, // 38 - 0x151ed, // 39 - 0x151ed, // 40 - 0x146c3, // 41 .. 64 - 0x146c3, // 42 - 0x146c3, // 43 - 0x146c3, // 44 - 0x146c3, // 45 - 0x146c3, // 46 - 0x146c3, // 47 - 0x146c3, // 48 - 0x146c3, // 49 - 0x146c3, // 50 - 0x146c3, // 51 - 0x146c3, // 52 - 0x146c3, // 53 - 0x146c3, // 54 - 0x146c3, // 55 - 0x146c3, // 56 - 0x146c3, // 57 - 0x146c3, // 58 - 0x146c3, // 59 - 0x146c3, // 60 - 0x146c3, // 61 - 0x146c3, // 62 - 0x146c3, // 63 - 0x146c3 // 64 -}; - -// Routine to "mirror" the input data word -static Word_t -Swizzle(Word_t word) -{ -// BIT REVERSAL, Ron Gutman in Dr. Dobb's Journal, #316, Sept 2000, pp133-136 -// - -#ifdef __LP64__ - word = ((word & 0x00000000ffffffff) << 32) | - ((word & 0xffffffff00000000) >> 32); - word = ((word & 0x0000ffff0000ffff) << 16) | - ((word & 0xffff0000ffff0000) >> 16); - word = ((word & 0x00ff00ff00ff00ff) << 8) | - ((word & 0xff00ff00ff00ff00) >> 8); - word = ((word & 0x0f0f0f0f0f0f0f0f) << 4) | - ((word & 0xf0f0f0f0f0f0f0f0) >> 4); - word = ((word & 0x3333333333333333) << 2) | - ((word & 0xcccccccccccccccc) >> 2); - word = ((word & 0x5555555555555555) << 1) | - ((word & 0xaaaaaaaaaaaaaaaa) >> 1); -#else // __LP64__ - word = ((word & 0x0000ffff) << 16) | ((word & 0xffff0000) >> 16); - word = ((word & 0x00ff00ff) << 8) | ((word & 0xff00ff00) >> 8); - word = ((word & 0x0f0f0f0f) << 4) | ((word & 0xf0f0f0f0) >> 4); - word = ((word & 0x33333333) << 2) | ((word & 0xcccccccc) >> 2); - word = ((word & 0x55555555) << 1) | ((word & 0xaaaaaaaa) >> 1); -#endif // __LP64__ - - return(word); -} - -Word_t dFlag = 1; -Word_t pFlag = 0; -Word_t CFlag = 0; -Word_t DFlag = 0; -Word_t SkipN = 0; // default == Random skip -Word_t nElms = 1000000; // Default = 1M -Word_t ErrorFlag = 0; -Word_t TotalIns = 0; -Word_t TotalPop = 0; -Word_t TotalDel = 0; - -// Stuff for LFSR (pseudo random number generator) -Word_t RandomBit = ~0UL / 2 + 1; -Word_t BValue = sizeof(Word_t) * 8; -Word_t Magic; -Word_t StartSeed = 0xc1fc; // default beginning number -Word_t FirstSeed; - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "Random" - -static Word_t // Placed here so INLINING compilers get to look at it. -Random(Word_t newseed) -{ - if (newseed & RandomBit) - { - newseed += newseed; - newseed ^= Magic; - } - else - { - newseed += newseed; - } - newseed &= RandomBit * 2 - 1; - if (newseed == FirstSeed) - { - printf("End of LFSR, Total Population = %lu\n", TotalPop); - exit(0); - } - return(newseed); -} - -static Word_t // Placed here so INLINING compilers get to look at it. -GetNextIndex(Word_t Index) -{ - if (SkipN) - Index += SkipN; - else - Index = Random(Index); - - return(Index); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "main" - -int -main(int argc, char *argv[]) -{ -// Names of Judy Arrays - void *J1 = NULL; // Judy1 - void *JL = NULL; // JudyL - - double Mult; - Pms_t Pms; - Word_t Seed; - Word_t PtsPdec = 10; // points per decade - Word_t Groups; // Number of measurement groups - Word_t grp; - - int c; - extern char *optarg; - -////////////////////////////////////////////////////////////// -// PARSE INPUT PARAMETERS -////////////////////////////////////////////////////////////// - - while ((c = getopt(argc, argv, "n:S:P:b:L:B:pdDC")) != -1) - { - switch (c) - { - case 'n': // Number of elements - nElms = strtoul(optarg, NULL, 0); // Size of Linear Array - if (nElms == 0) - FAILURE("No tests: -n", nElms); - -// Check if more than a trillion (64 bit only) - if ((double)nElms > 1e12) - FAILURE("Too many Indexes=", nElms); - break; - - case 'S': // Step Size, 0 == Random - SkipN = strtoul(optarg, NULL, 0); - break; - - case 'P': // - PtsPdec = strtoul(optarg, NULL, 0); - break; - - case 'b': // May not work past 35 bits if changed - StartSeed = strtoul(optarg, NULL, 0); - break; - - case 'B': - BValue = strtoul(optarg, NULL, 0); - if ( - (BValue > (sizeof(Word_t) * 8)) - || - (MagicList[BValue] == 0) - ) - { - ErrorFlag++; - printf("\nIllegal number of random bits of %lu !!!\n", BValue); - } - break; - - case 'p': // Print test indexes - pFlag = 1; - break; - - case 'd': // Delete indexes - dFlag = 0; - break; - - case 'D': // Swizzle indexes - DFlag = 1; - break; - - case 'C': // Skip counting test. - CFlag = 1; - break; - - default: - ErrorFlag++; - break; - } - } - - if (ErrorFlag) - { - printf("\n%s -n# -S# -B# -P# -b # -DRCpd\n\n", argv[0]); - printf("Where:\n"); - printf("-n <#> number of indexes used in tests\n"); - printf("-C skip JudyCount tests\n"); - printf("-p print index set - for debug\n"); - printf("-d do not call JudyDel/Unset\n"); - printf("-D Swizzle data (mirror)\n"); - printf("-S <#> index skip amount, 0 = random\n"); - printf("-B <#> # bits-1 in random number generator\n"); - printf("-P <#> number measurement points per decade\n"); - printf("\n"); - - exit(1); - } -// Set number of Random bits in LFSR - RandomBit = 1UL << (BValue - 1); - Magic = MagicList[BValue]; - - if (nElms > ((RandomBit-2) * 2)) - { - printf("# Number = -n%lu of Indexes reduced to max expanse of Random numbers\n", nElms); - nElms = ((RandomBit-2) * 2); - } - - printf("\n%s -n%lu -S%lu -B%lu", argv[0], nElms, SkipN, BValue); - - if (DFlag) - printf(" -D"); - if (!dFlag) - printf(" -d"); - if (pFlag) - printf(" -p"); - if (CFlag) - printf(" -C"); - printf("\n\n"); - - if (sizeof(Word_t) == 8) - printf("%s 64 Bit version\n", argv[0]); - else if (sizeof(Word_t) == 4) - printf("%s 32 Bit version\n", argv[0]); - -////////////////////////////////////////////////////////////// -// CALCULATE NUMBER OF MEASUREMENT GROUPS -////////////////////////////////////////////////////////////// - -// Calculate Multiplier for number of points per decade - Mult = pow(10.0, 1.0 / (double)PtsPdec); - { - double sum; - Word_t numb, prevnumb; - -// Count number of measurements needed (10K max) - sum = numb = 1; - for (Groups = 2; Groups < 10000; Groups++) - if (NextNumb(&numb, &sum, Mult, nElms)) - break; - -// Get memory for measurements - Pms = (Pms_t) calloc(Groups, sizeof(ms_t)); - -// Now calculate number of Indexes for each measurement point - numb = sum = 1; - prevnumb = 0; - for (grp = 0; grp < Groups; grp++) - { - Pms[grp].ms_delta = numb - prevnumb; - prevnumb = numb; - - NextNumb(&numb, &sum, Mult, nElms); - } - } // Groups = number of sizes - -////////////////////////////////////////////////////////////// -// BEGIN TESTS AT EACH GROUP SIZE -////////////////////////////////////////////////////////////// - -// Get the kicker to test the LFSR - FirstSeed = Seed = StartSeed & (RandomBit * 2 - 1); - - printf("Total Pop Total Ins New Ins Total Del"); - printf(" J1MU/I JLMU/I\n"); - -#ifdef testLFSR -{ - Word_t Seed1 = Seed; - - while(1) - { - Seed1 = GetNextIndex(Seed1); - TotalPop++; - if (TotalPop > 40000000000) printf("Total = %lu\n", TotalPop), exit(1); - } -} -#endif // testLFSR - - for (grp = 0; grp < Groups; grp++) - { - Word_t LowIndex, HighIndex; - Word_t Delta; - Word_t NewSeed; - - Delta = Pms[grp].ms_delta; - -// Test JLI, J1S - NewSeed = TestJudyIns(&J1, &JL, Seed, Delta); - -// Test JLG, J1T - LowIndex = TestJudyGet(J1, JL, Seed, Delta); - -// Test JLI, J1S -dup - LowIndex = TestJudyDup(&J1, &JL, Seed, Delta); - -// Test JLC, J1C - if (!CFlag) - { - TestJudyCount(J1, JL, LowIndex, Delta); - } -// Test JLN, J1N - HighIndex = TestJudyNext(J1, JL, LowIndex, Delta); - -// Test JLP, J1P - TestJudyPrev(J1, JL, HighIndex, Delta); - -// Test JLNE, J1NE - TestJudyNextEmpty(J1, JL, LowIndex, Delta); - -// Test JLPE, J1PE - TestJudyPrevEmpty(J1, JL, HighIndex, Delta); - -// Test JLD, J1U - if (dFlag) - { - TestJudyDel(&J1, &JL, Seed, Delta); - } - - printf("%9lu %9lu %7lu %9lu", TotalPop, TotalIns, Delta, TotalDel); - { - Word_t Count1, CountL; - -// Print the number of bytes used per Index - J1C(Count1, J1, 0, ~0); - printf(" %6.3f", (double)Judy1MemUsed(J1) / (double)Count1); - JLC(CountL, JL, 0, ~0); - printf(" %6.3f", (double)JudyLMemUsed(JL) / (double)CountL); - } - printf("\n"); - -// Advance Index number set - Seed = NewSeed; - } - { - Word_t Count1, CountL; - Word_t Bytes; - - JLC(CountL, JL, 0, ~0); - J1C(Count1, J1, 0, ~0); - - if (CountL != TotalPop) - FAILURE("JudyLCount wrong", CountL); - - if (Count1 != TotalPop) - FAILURE("Judy1Count wrong", Count1); - - if (TotalPop) - { - J1FA(Bytes, J1); // Free the Judy1 Array - printf("Judy1FreeArray = %6.3f Bytes/Index\n", - (double)Bytes / (double)Count1); - - if (pFlag) { printf("J1FA: %8lu\tbytes = %lu\n", TotalPop, Bytes); } - - JLFA(Bytes, JL); // Free the JudyL Array - printf("JudyLFreeArray = %6.3f Bytes/Index\n", - (double)Bytes / (double)CountL); - - if (pFlag) { printf("JLFA: %8lu\tbytes = %lu\n", TotalPop, Bytes); } - - TotalPop = 0; - } - } - printf("Passed JudyL and Judy1 tests\n"); - exit(0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyIns" - -Word_t -TestJudyIns(void **J1, void **JL, Word_t Seed, Word_t Elements) -{ - Word_t TstIndex; - Word_t elm; - Word_t *PValue, *PValue1; - Word_t Seed1; - int Rcode; - - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - if (Seed1 == 0) - FAILURE("This command not robust if Index == 0", elm); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (pFlag) { printf("Ins: %8lu\t0x%lx\n", elm, TstIndex); } - - J1S(Rcode, *J1, TstIndex); - if (Rcode == JERR) - FAILURE("Judy1Set failed at", elm); - if (Rcode == 0) - FAILURE("Judy1Set failed - DUP Index, population =", TotalPop); - - J1T(Rcode, *J1, TstIndex); - if (Rcode != 1) - FAILURE("Judy1Test failed - Index missing, population =", TotalPop); - - J1S(Rcode, *J1, TstIndex); - if (Rcode != 0) - FAILURE("Judy1Set failed - Index missing, population =", TotalPop); - - JLI(PValue, *JL, TstIndex); - if (PValue == PJERR) - FAILURE("JudyLIns failed at", elm); - if (*PValue == TstIndex) - FAILURE("JudyLIns failed - DUP Index, population =", TotalPop); - -// Save Index in Value - *PValue = TstIndex; - - JLG(PValue1, *JL, TstIndex); - if (PValue != PValue1) - FAILURE("JudyLGet failed - Index missing, population =", TotalPop); - - JLI(PValue1, *JL, TstIndex); - if (PValue != PValue1) - { - if (*PValue1 != TstIndex) - { - FAILURE("JudyLIns failed - Index missing, population =", TotalPop); - } - else - { -// not ready for this yet! printf("Index moved -- TotalPop = %lu\n", TotalPop); - } - } - TotalPop++; - TotalIns++; - } - return (Seed1); // New seed -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyGet" - -Word_t -TestJudyGet(void *J1, void *JL, Word_t Seed, Word_t Elements) -{ - Word_t LowIndex = ~0UL; - Word_t TstIndex; - Word_t elm; - Word_t *PValue; - Word_t Seed1; - int Rcode; - - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (TstIndex < LowIndex) - LowIndex = TstIndex; - - J1T(Rcode, J1, TstIndex); - if (Rcode != 1) - FAILURE("Judy1Test Rcode != 1", (Word_t) Rcode); - - JLG(PValue, JL, TstIndex); - if (PValue == (Word_t *) NULL) - FAILURE("JudyLGet ret PValue = NULL", 0L); - if (*PValue != TstIndex) - FAILURE("JudyLGet ret wrong Value at", elm); - } - - return(LowIndex); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyDup" - -Word_t -TestJudyDup(void **J1, void **JL, Word_t Seed, Word_t Elements) -{ - Word_t LowIndex = ~0UL; - Word_t TstIndex; - Word_t elm; - Word_t *PValue; - Word_t Seed1; - int Rcode; - - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (TstIndex < LowIndex) - LowIndex = TstIndex; - - J1S(Rcode, *J1, TstIndex); - if (Rcode != 0) - FAILURE("Judy1Set Rcode != 0", (Word_t) Rcode); - - JLI(PValue, *JL, TstIndex); - if (PValue == (Word_t *) NULL) - FAILURE("JudyLIns ret PValue = NULL", 0L); - if (*PValue != TstIndex) - FAILURE("JudyLIns ret wrong Value at", elm); - } - - return(LowIndex); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyCount" - -int -TestJudyCount(void *J1, void *JL, Word_t LowIndex, Word_t Elements) -{ - Word_t elm; - Word_t Count1, CountL; - Word_t TstIndex = LowIndex; - int Rcode; - - TstIndex = LowIndex; - for (elm = 0; elm < Elements; elm++) - { - J1C(Count1, J1, LowIndex, TstIndex); - if (Count1 == JERR) - FAILURE("Judy1Count ret JERR", (Word_t) Count1); - - if (Count1 != (elm + 1)) - { - J1C(CountL, J1, 0, -1); - printf("J1C(%lu, J1, 0, -1)\n", CountL); - - JLC(CountL, JL, 0, -1); - printf("JLC(%lu, JL, 0, -1)\n", CountL); - - printf("LowIndex = 0x%lx, TstIndex = 0x%lx, diff = %lu\n", LowIndex, - TstIndex, TstIndex - LowIndex); - JLC(CountL, JL, LowIndex, TstIndex); - printf("CountL = %lu, Count1 = %lu, should be: elm + 1 = %lu\n", CountL, Count1, elm + 1); - FAILURE("J1C at", elm); - } - - JLC(CountL, JL, LowIndex, TstIndex); - if (CountL == JERR) - FAILURE("JudyLCount ret JERR", (Word_t) CountL); - - if (CountL != (elm + 1)) FAILURE("JLC at", elm); - - J1N(Rcode, J1, TstIndex); - } - return(0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyNext" - -Word_t TestJudyNext(void *J1, void *JL, Word_t LowIndex, Word_t Elements) -{ - Word_t JLindex, J1index; - Word_t *PValue; - Word_t elm; - int Rcode; - -// Get an Index low enough for Elements - J1index = JLindex = LowIndex; - - JLF(PValue, JL, JLindex); - J1F(Rcode, J1, J1index); - - for (elm = 0; elm < Elements; elm++) - { - if (PValue == NULL) - FAILURE("JudyLNext ret NULL PValue at", elm); - if (Rcode != 1) - FAILURE("Judy1Next Rcode != 1 =", (Word_t) Rcode); - if (JLindex != J1index) - FAILURE("Judy1Next & Judy1Next ret different PIndex at", elm); - - JLN(PValue, JL, JLindex); // Get next one - J1N(Rcode, J1, J1index); // Get next one - } -// perhaps a check should be done here -- if I knew what to expect. - return(JLindex); // return last one -} - - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyPrev" - -int -TestJudyPrev(void *J1, void *JL, Word_t HighIndex, Word_t Elements) -{ - Word_t JLindex, J1index; - Word_t *PValue; - Word_t elm; - int Rcode; - -// Get an Index high enough for Elements - J1index = JLindex = HighIndex; - - JLL(PValue, JL, JLindex); - J1L(Rcode, J1, J1index); - - for (elm = 0; elm < Elements; elm++) - { - if (PValue == NULL) - FAILURE("JudyLPrev ret NULL PValue at", elm); - if (Rcode != 1) - FAILURE("Judy1Prev Rcode != 1 =", (Word_t) Rcode); - if (JLindex != J1index) - FAILURE("Judy1Prev & Judy1Prev ret different PIndex at", elm); - - JLP(PValue, JL, JLindex); // Get previous one - J1P(Rcode, J1, J1index); // Get previous one - } -// perhaps a check should be done here -- if I knew what to expect. - return(0); -} - - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyNextEmpty" - -int -TestJudyNextEmpty(void *J1, void *JL, Word_t LowIndex, Word_t Elements) -{ - Word_t elm; - Word_t JLindex, J1index; - Word_t Seed1; - int Rcode; // Return code - -// Set 1st search to .. - Seed1 = LowIndex; - J1index = JLindex = Seed1; - - for (elm = 0; elm < Elements; elm++) - { - Word_t *PValue; - -// Find next Empty Index, JLindex is modified by JLNE - JLNE(Rcode, JL, JLindex); // Rcode = JudyLNextEmpty(JL, &JLindex, PJE0) - if (Rcode != 1) - FAILURE("JudyLNextEmpty Rcode != 1 =", (Word_t) Rcode); - - if (pFlag) { printf("JNE: %8lu\t0x%lx\n", elm, JLindex); } - -// Find next Empty Index, J1index is modified by J1NE - J1NE(Rcode, J1, J1index); // Rcode = Judy1NextEmpty(J1, &J1index, PJE0) - if (Rcode != 1) - FAILURE("Judy1NextEmpty Rcode != 1 =", (Word_t) Rcode); - - if (J1index != JLindex) - FAILURE("JLNE != J1NE returned index at", elm); - - J1T(Rcode, J1, J1index); - if (Rcode != 0) - FAILURE("J1NE returned non-empty Index =", J1index); - - JLG(PValue, JL, JLindex); - if (PValue != (Word_t *) NULL) - FAILURE("JLNE returned non-empty Index =", JLindex); - - Seed1 = GetNextIndex(Seed1); - J1index = JLindex = Seed1; - } - return(0); -} - - -// Routine to JudyPrevEmpty routines - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyPrevEmpty" - -int -TestJudyPrevEmpty(void *J1, void *JL, Word_t HighIndex, Word_t Elements) -{ - Word_t elm; - Word_t JLindex, J1index; - Word_t Seed1; - int Rcode; - -// Set 1st search to .. - Seed1 = HighIndex; - J1index = JLindex = Seed1; - - for (elm = 0; elm < Elements; elm++) - { - Word_t *PValue; - - J1PE(Rcode, J1, J1index); // Rcode = Judy1PrevEmpty(J1, &J1index, PJE0) - if (Rcode != 1) - FAILURE("Judy1PrevEmpty Rcode != 1 =", (Word_t) Rcode); - - if (pFlag) { printf("JPE: %8lu\t0x%lx\n", elm, J1index); } - -// Find next Empty Index, JLindex is modified by JLPE - JLPE(Rcode, JL, JLindex); // Rcode = JudyLPrevEmpty(JL, &JLindex, PJE0) - if (Rcode != 1) - FAILURE("JudyLPrevEmpty Rcode != 1 =", (Word_t) Rcode); - - if (J1index != JLindex) - FAILURE("JLPE != J1PE returned index at", elm); - - J1T(Rcode, J1, J1index); - if (Rcode != 0) - FAILURE("J1PE returned non-empty Index =", J1index); - - JLG(PValue, JL, JLindex); - if (PValue != (Word_t *) NULL) - FAILURE("JLPE returned non-empty Index =", JLindex); - - Seed1 = GetNextIndex(Seed1); - J1index = JLindex = Seed1; - } - return(0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyDel" - -int -TestJudyDel(void **J1, void **JL, Word_t Seed, Word_t Elements) -{ - Word_t TstIndex; - Word_t elm; - Word_t Seed1; - int Rcode; - -// Only delete half of thoes inserted - for (Seed1 = Seed, elm = 0; elm < (Elements / 2); elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (pFlag) { printf("Del: %8lu\t0x%lx\n", elm, TstIndex); } - - TotalDel++; - - J1U(Rcode, *J1, TstIndex); - if (Rcode != 1) - FAILURE("Judy1Unset ret Rcode != 1", (Word_t) Rcode); - - JLD(Rcode, *JL, TstIndex); - if (Rcode != 1) - FAILURE("JudyLDel ret Rcode != 1", (Word_t) Rcode); - - TotalPop--; - } - return(0); -} - -// Routine to get next size of Indexes -int // return 1 if last number -NextNumb(Word_t * PNumber, // pointer to returned next number - double *PDNumb, // Temp double of above - double DMult, // Multiplier - Word_t MaxNumb) // Max number to return -{ - Word_t num; - -// Save prev number - Word_t PrevNumb = *PNumber; - -// Verify integer number increased - for (num = 0; num < 1000; num++) - { -// Calc next number - *PDNumb *= DMult; - -// Return it in integer format - *PNumber = (Word_t) (*PDNumb + 0.5); - - if (*PNumber != PrevNumb) - break; - } - -// Verify it did exceed max ulong - if ((*PDNumb + 0.5) > (double)(-1UL)) - { -// It did, so return max number - *PNumber = -1UL; - return (1); // flag it - } - -// Verify it did not exceed max number - if ((*PDNumb + 0.5) > (double)MaxNumb) - { -// it did, so return max - *PNumber = MaxNumb; - return(1); // flag it - } - return(0); // more available -} diff --git a/libjudy/test/Judy1LHCheck.c b/libjudy/test/Judy1LHCheck.c deleted file mode 100644 index f9b6411ef2..0000000000 --- a/libjudy/test/Judy1LHCheck.c +++ /dev/null @@ -1,1018 +0,0 @@ -// @(#) $Revision: 4.15 $ $Source: /judy/test/manual/Judy1LHCheck.c $ -// This program tests the accuracy of a Judy1 with a JudyL Array. -// -by- -// Douglas L. Baskins (8/2001) doug@sourcejudy.com - -#include // calloc() -#include // getopt() -#include // pow() -#include // printf() - -#include - -// Compile: -// # cc -O Judy1LHCheck.c -lm -lJudy -o Judy1LHCheck - -// Common macro to handle a failure -#define FAILURE(STR, UL) \ -{ \ -printf( "Error: %s %lu, file='%s', 'function='%s', line %d\n", \ - STR, (Word_t)(UL), __FILE__, __FUNCTI0N__, __LINE__); \ -fprintf(stderr, "Error: %s %lu, file='%s', 'function='%s', line %d\n", \ - STR, (Word_t)(UL), __FILE__, __FUNCTI0N__, __LINE__); \ - exit(1); \ -} - -// Structure to keep track of times -typedef struct MEASUREMENTS_STRUCT -{ - Word_t ms_delta; -} -ms_t, *Pms_t; - -// Specify prototypes for each test routine -int -NextNumb(Word_t * PNumber, double *PDNumb, double DMult, Word_t MaxNumb); - -Word_t TestJudyIns(void **J1, void **JL, void **JH, Word_t Seed, Word_t Elements); - -Word_t TestJudyDup(void **J1, void **JL, void **JH, Word_t Seed, Word_t Elements); - -int TestJudyDel(void **J1, void **JL, void **JH, Word_t Seed, Word_t Elements); - -Word_t TestJudyGet(void *J1, void *JL, void *JH, Word_t Seed, Word_t Elements); - -int TestJudyCount(void *J1, void *JL, Word_t LowIndex, Word_t Elements); - -Word_t TestJudyNext(void *J1, void *JL, Word_t LowIndex, Word_t Elements); - -int TestJudyPrev(void *J1, void *JL, Word_t HighIndex, Word_t Elements); - -int -TestJudyNextEmpty(void *J1, void *JL, Word_t LowIndex, Word_t Elements); - -int -TestJudyPrevEmpty(void *J1, void *JL, Word_t HighIndex, Word_t Elements); - -Word_t MagicList[] = -{ - 0,0,0,0,0,0,0,0,0,0, // 0..9 - 0x27f, // 10 - 0x27f, // 11 - 0x27f, // 12 - 0x27f, // 13 - 0x27f, // 14 - 0x27f, // 15 - 0x1e71, // 16 - 0xdc0b, // 17 - 0xdc0b, // 18 - 0xdc0b, // 19 - 0xdc0b, // 20 - 0xc4fb, // 21 - 0xc4fb, // 22 - 0xc4fb, // 23 - 0x13aab, // 24 - 0x11ca3, // 25 - 0x11ca3, // 26 - 0x11ca3, // 27 - 0x13aab, // 28 - 0x11ca3, // 29 - 0xc4fb, // 30 - 0xc4fb, // 31 - 0x13aab, // 32 - 0x14e73, // 33 - 0x145d7, // 34 - 0x145f9, // 35 following tested with Seed=0xc1fc to 35Gig numbers - 0x151ed, // 36 .. 41 - 0x151ed, // 37 - 0x151ed, // 38 - 0x151ed, // 39 fails at 549751488512 (549Gig) - 0x151ed, // 40 - 0x146c3, // 41 .. 64 - 0x146c3, // 42 - 0x146c3, // 43 - 0x146c3, // 44 - 0x146c3, // 45 - 0x146c3, // 46 - 0x146c3, // 47 - 0x146c3, // 48 - 0x146c3, // 49 - 0x146c3, // 50 - 0x146c3, // 51 - 0x146c3, // 52 - 0x146c3, // 53 - 0x146c3, // 54 - 0x146c3, // 55 - 0x146c3, // 56 - 0x146c3, // 57 - 0x146c3, // 58 - 0x146c3, // 59 - 0x146c3, // 60 - 0x146c3, // 61 - 0x146c3, // 62 - 0x146c3, // 63 - 0x146c3 // 64 -}; - -// Routine to "mirror" the input data word -static Word_t -Swizzle(Word_t word) -{ -// BIT REVERSAL, Ron Gutman in Dr. Dobb's Journal, #316, Sept 2000, pp133-136 -// - -#ifdef __LP64__ - word = ((word & 0x00000000ffffffff) << 32) | - ((word & 0xffffffff00000000) >> 32); - word = ((word & 0x0000ffff0000ffff) << 16) | - ((word & 0xffff0000ffff0000) >> 16); - word = ((word & 0x00ff00ff00ff00ff) << 8) | - ((word & 0xff00ff00ff00ff00) >> 8); - word = ((word & 0x0f0f0f0f0f0f0f0f) << 4) | - ((word & 0xf0f0f0f0f0f0f0f0) >> 4); - word = ((word & 0x3333333333333333) << 2) | - ((word & 0xcccccccccccccccc) >> 2); - word = ((word & 0x5555555555555555) << 1) | - ((word & 0xaaaaaaaaaaaaaaaa) >> 1); -#else // __LP64__ - word = ((word & 0x0000ffff) << 16) | ((word & 0xffff0000) >> 16); - word = ((word & 0x00ff00ff) << 8) | ((word & 0xff00ff00) >> 8); - word = ((word & 0x0f0f0f0f) << 4) | ((word & 0xf0f0f0f0) >> 4); - word = ((word & 0x33333333) << 2) | ((word & 0xcccccccc) >> 2); - word = ((word & 0x55555555) << 1) | ((word & 0xaaaaaaaa) >> 1); -#endif // __LP64__ - - return(word); -} - -Word_t dFlag = 1; -Word_t pFlag = 0; -Word_t CFlag = 0; -Word_t DFlag = 0; -Word_t SkipN = 0; // default == Random skip -Word_t nElms = 1000000; // Default = 1M -Word_t ErrorFlag = 0; -Word_t TotalIns = 0; -Word_t TotalPop = 0; -Word_t TotalDel = 0; - -// Stuff for LFSR (pseudo random number generator) -Word_t RandomBit = ~0UL / 2 + 1; -Word_t BValue = sizeof(Word_t) * 8; -Word_t Magic; -Word_t StartSeed = 0xc1fc; // default beginning number -Word_t FirstSeed; - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "Random" - -static Word_t // Placed here so INLINING compilers get to look at it. -Random(Word_t newseed) -{ - if (newseed & RandomBit) - { - newseed += newseed; - newseed ^= Magic; - } - else - { - newseed += newseed; - } - newseed &= RandomBit * 2 - 1; - if (newseed == FirstSeed) - { - printf("Passed (End of LFSR) Judy1, JudyL, JudyHS tests for %lu numbers with <= %ld bits\n", TotalPop, BValue); - exit(0); - } - return(newseed); -} - -static Word_t // Placed here so INLINING compilers get to look at it. -GetNextIndex(Word_t Index) -{ - if (SkipN) - Index += SkipN; - else - Index = Random(Index); - - return(Index); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "main" - -int -main(int argc, char *argv[]) -{ -// Names of Judy Arrays - void *J1 = NULL; // Judy1 - void *JL = NULL; // JudyL - void *JH = NULL; // JudyHS - - double Mult; - Pms_t Pms; - Word_t Seed; - Word_t PtsPdec = 10; // points per decade - Word_t Groups; // Number of measurement groups - Word_t grp; - - int c; - extern char *optarg; - -////////////////////////////////////////////////////////////// -// PARSE INPUT PARAMETERS -////////////////////////////////////////////////////////////// - - while ((c = getopt(argc, argv, "n:S:P:b:L:B:pdDC")) != -1) - { - switch (c) - { - case 'n': // Number of elements - nElms = strtoul(optarg, NULL, 0); // Size of Linear Array - if (nElms == 0) - FAILURE("No tests: -n", nElms); - -// Check if more than a trillion (64 bit only) - if ((double)nElms > 1e12) - FAILURE("Too many Indexes=", nElms); - break; - - case 'S': // Step Size, 0 == Random - SkipN = strtoul(optarg, NULL, 0); - break; - - case 'P': // - PtsPdec = strtoul(optarg, NULL, 0); - break; - - case 'b': // May not work past 35 bits if changed - StartSeed = strtoul(optarg, NULL, 0); - break; - - case 'B': - BValue = strtoul(optarg, NULL, 0); - if ( - (BValue > (sizeof(Word_t) * 8)) - || - (MagicList[BValue] == 0) - ) - { - ErrorFlag++; - printf("\nIllegal number of random bits of %lu !!!\n", BValue); - } - break; - - case 'p': // Print test indexes - pFlag = 1; - break; - - case 'd': // Delete indexes - dFlag = 0; - break; - - case 'D': // Swizzle indexes - DFlag = 1; - break; - - case 'C': // Skip counting test. - CFlag = 1; - break; - - default: - ErrorFlag++; - break; - } - } - - if (ErrorFlag) - { - printf("\n%s -n# -S# -B# -P# -b # -DRCpd\n\n", argv[0]); - printf("Where:\n"); - printf("-n <#> number of indexes used in tests\n"); - printf("-C skip JudyCount tests\n"); - printf("-p print index set - for debug\n"); - printf("-d do not call JudyDel/Unset\n"); - printf("-D Swizzle data (mirror)\n"); - printf("-S <#> index skip amount, 0 = random\n"); - printf("-B <#> # bits-1 in random number generator\n"); - printf("-P <#> number measurement points per decade\n"); - printf("\n"); - - exit(1); - } -// Set number of Random bits in LFSR - RandomBit = 1UL << (BValue - 1); - Magic = MagicList[BValue]; - - if (nElms > ((RandomBit-2) * 2)) - { - printf("# Number = -n%lu of Indexes reduced to max expanse of Random numbers\n", nElms); - nElms = ((RandomBit-2) * 2); - } - - printf("\n%s -n%lu -S%lu -B%lu", argv[0], nElms, SkipN, BValue); - - if (DFlag) - printf(" -D"); - if (!dFlag) - printf(" -d"); - if (pFlag) - printf(" -p"); - if (CFlag) - printf(" -C"); - printf("\n\n"); - - if (sizeof(Word_t) == 8) - printf("%s 64 Bit version\n", argv[0]); - else if (sizeof(Word_t) == 4) - printf("%s 32 Bit version\n", argv[0]); - -////////////////////////////////////////////////////////////// -// CALCULATE NUMBER OF MEASUREMENT GROUPS -////////////////////////////////////////////////////////////// - -// Calculate Multiplier for number of points per decade - Mult = pow(10.0, 1.0 / (double)PtsPdec); - { - double sum; - Word_t numb, prevnumb; - -// Count number of measurements needed (10K max) - sum = numb = 1; - for (Groups = 2; Groups < 10000; Groups++) - if (NextNumb(&numb, &sum, Mult, nElms)) - break; - -// Get memory for measurements - Pms = (Pms_t) calloc(Groups, sizeof(ms_t)); - -// Now calculate number of Indexes for each measurement point - numb = sum = 1; - prevnumb = 0; - for (grp = 0; grp < Groups; grp++) - { - Pms[grp].ms_delta = numb - prevnumb; - prevnumb = numb; - - NextNumb(&numb, &sum, Mult, nElms); - } - } // Groups = number of sizes - -////////////////////////////////////////////////////////////// -// BEGIN TESTS AT EACH GROUP SIZE -////////////////////////////////////////////////////////////// - -// Get the kicker to test the LFSR - FirstSeed = Seed = StartSeed & (RandomBit * 2 - 1); - - printf("Total Pop Total Ins New Ins Total Del"); - printf(" J1MU/I JLMU/I\n"); - -#ifdef testLFSR -{ - Word_t Seed1 = Seed; - - printf("Begin test of LSFR, BValue = %lu\n", BValue); - while(1) - { - Seed1 = GetNextIndex(Seed1); - TotalPop++; - if (TotalPop == 0) printf("BUG!!!\n"); - } - exit(0); -} -#endif // testLFSR - - for (grp = 0; grp < Groups; grp++) - { - Word_t LowIndex, HighIndex; - Word_t Delta; - Word_t NewSeed; - - Delta = Pms[grp].ms_delta; - -// Test JLI, J1S - NewSeed = TestJudyIns(&J1, &JL, &JH, Seed, Delta); - -// Test JLG, J1T - LowIndex = TestJudyGet(J1, JL, JH, Seed, Delta); - -// Test JLI, J1S -dup - LowIndex = TestJudyDup(&J1, &JL, &JH, Seed, Delta); - -// Test JLC, J1C - if (!CFlag) - { - TestJudyCount(J1, JL, LowIndex, Delta); - } -// Test JLN, J1N - HighIndex = TestJudyNext(J1, JL, 0UL, TotalPop); - -// Test JLP, J1P - TestJudyPrev(J1, JL, ~0UL, TotalPop); - -// Test JLNE, J1NE - TestJudyNextEmpty(J1, JL, LowIndex, Delta); - -// Test JLPE, J1PE - TestJudyPrevEmpty(J1, JL, HighIndex, Delta); - -// Test JLD, J1U - if (dFlag) - { - TestJudyDel(&J1, &JL, &JH, Seed, Delta); - } - - printf("%9lu %9lu %7lu %9lu", TotalPop, TotalIns, Delta, TotalDel); - { - Word_t Count1, CountL; - -// Print the number of bytes used per Index - J1C(Count1, J1, 0, ~0); - printf(" %6.3f", (double)Judy1MemUsed(J1) / (double)Count1); - JLC(CountL, JL, 0, ~0); - printf(" %6.3f", (double)JudyLMemUsed(JL) / (double)CountL); - } - printf("\n"); - -// Advance Index number set - Seed = NewSeed; - } - { - Word_t Count1, CountL; - Word_t Bytes; - - JLC(CountL, JL, 0, ~0); - J1C(Count1, J1, 0, ~0); - - if (CountL != TotalPop) - FAILURE("JudyLCount wrong", CountL); - - if (Count1 != TotalPop) - FAILURE("Judy1Count wrong", Count1); - - if (TotalPop) - { - J1FA(Bytes, J1); // Free the Judy1 Array - printf("Judy1FreeArray = %6.3f Bytes/Index\n", - (double)Bytes / (double)Count1); - - if (pFlag) { printf("J1FA: %8lu\tbytes = %lu\n", TotalPop, Bytes); } - - JLFA(Bytes, JL); // Free the JudyL Array - printf("JudyLFreeArray = %6.3f Bytes/Index\n", - (double)Bytes / (double)CountL); - - if (pFlag) { printf("JLFA: %8lu\tbytes = %lu\n", TotalPop, Bytes); } - - JHSFA(Bytes, JH); // Free the JudyL Array - printf("JudyHSFreeArray = %6.3f Bytes/Index\n", - (double)Bytes / (double)TotalPop); // Count not available yet - - if (pFlag) { printf("JHSFA: %8lu\tbytes = %lu\n", TotalPop, Bytes); } - - TotalPop = 0; - } - } - printf("Passed Judy1, JudyL, JudyHS tests for %lu numbers with <= %ld bits\n", nElms, BValue); - exit(0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyIns" - -Word_t -TestJudyIns(void **J1, void **JL, void **JH, Word_t Seed, Word_t Elements) -{ - Word_t TstIndex; - Word_t elm; - Word_t *PValue, *PValue1; - Word_t Seed1; - int Rcode; - - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - if (Seed1 == 0) - FAILURE("This command not robust if Index == 0", elm); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (pFlag) { printf("Ins: %8lu\t0x%lx\n", elm, TstIndex); } - -// Judy1 - - J1S(Rcode, *J1, TstIndex); - if (Rcode == JERR) - FAILURE("Judy1Set failed at", elm); - if (Rcode == 0) - FAILURE("Judy1Set failed - DUP Index, population =", TotalPop); - -#ifdef SKIPMACRO - Rcode = Judy1Test(*J1, TstIndex); -#else - J1T(Rcode, *J1, TstIndex); -#endif // SKIPMACRO - if (Rcode != 1) - FAILURE("Judy1Test failed - Index missing, population =", TotalPop); - - J1S(Rcode, *J1, TstIndex); - if (Rcode != 0) - FAILURE("Judy1Set failed - Index missing, population =", TotalPop); - -// JudyL - JLI(PValue, *JL, TstIndex); - if (PValue == PJERR) - FAILURE("JudyLIns failed at", elm); - if (*PValue == TstIndex) - FAILURE("JudyLIns failed - DUP Index, population =", TotalPop); - -// Save Index in Value - *PValue = TstIndex; - -#ifdef SKIPMACRO - PValue1 = (PWord_t)JudyLGet(*JL, TstIndex); -#else - JLG(PValue1, *JL, TstIndex); -#endif // SKIPMACRO - if (PValue != PValue1) - FAILURE("JudyLGet failed - Index missing, population =", TotalPop); - - JLI(PValue1, *JL, TstIndex); - if (PValue != PValue1) - { - if (*PValue1 != TstIndex) - { - FAILURE("JudyLIns failed - Index missing, population =", TotalPop); - } - else - { -// not ready for this yet! printf("Index moved -- TotalPop = %lu\n", TotalPop); - } - } -// JudyHS - JHSI(PValue, *JH, (void *)(&TstIndex), sizeof(Word_t)); - if (PValue == PJERR) - FAILURE("JudyHSIns failed at", elm); - if (*PValue == TstIndex) - FAILURE("JudyHSIns failed - DUP Index, population =", TotalPop); - -// Save Index in Value - *PValue = TstIndex; - - JHSG(PValue1, *JH, (void *)(&TstIndex), sizeof(Word_t)); - if (PValue != PValue1) - FAILURE("JudyHSGet failed - Index missing, population =", TotalPop); - - JHSI(PValue1, *JH, (void *)(&TstIndex), sizeof(Word_t)); - if (PValue != PValue1) - { - if (*PValue1 != TstIndex) - { - FAILURE("JudyHSIns failed - Index missing, population =", TotalPop); - } - else - { -// not ready for this yet! printf("Index moved -- TotalPop = %lu\n", TotalPop); - } - } - TotalPop++; - TotalIns++; - } - return (Seed1); // New seed -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyGet" - -Word_t -TestJudyGet(void *J1, void *JL, void *JH, Word_t Seed, Word_t Elements) -{ - Word_t LowIndex = ~0UL; - Word_t TstIndex; - Word_t elm; - Word_t *PValue; - Word_t Seed1; - int Rcode; - - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (TstIndex < LowIndex) - LowIndex = TstIndex; - -#ifdef SKIPMACRO - Rcode = Judy1Test(J1, TstIndex); -#else - J1T(Rcode, J1, TstIndex); -#endif // SKIPMACRO - if (Rcode != 1) - FAILURE("Judy1Test Rcode != 1", Rcode); - -#ifdef SKIPMACRO - PValue = (PWord_t)JudyLGet(JL, TstIndex); -#else - JLG(PValue, JL, TstIndex); -#endif // SKIPMACRO - if (PValue == (Word_t *) NULL) - FAILURE("JudyLGet ret PValue = NULL", 0L); - if (*PValue != TstIndex) - FAILURE("JudyLGet ret wrong Value at", elm); - - JHSG(PValue, JH, (void *)(&TstIndex), sizeof(Word_t)); - if (PValue == (Word_t *) NULL) - FAILURE("JudyHSGet ret PValue = NULL", 0L); - if (*PValue != TstIndex) - FAILURE("JudyHSGet ret wrong Value at", elm); - } - - return(LowIndex); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyDup" - -Word_t -TestJudyDup(void **J1, void **JL, void **JH, Word_t Seed, Word_t Elements) -{ - Word_t LowIndex = ~0UL; - Word_t TstIndex; - Word_t elm; - Word_t *PValue; - Word_t Seed1; - int Rcode; - - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (TstIndex < LowIndex) - LowIndex = TstIndex; - - J1S(Rcode, *J1, TstIndex); - if (Rcode != 0) - FAILURE("Judy1Set Rcode != 0", Rcode); - - JLI(PValue, *JL, TstIndex); - if (PValue == (Word_t *) NULL) - FAILURE("JudyLIns ret PValue = NULL", 0L); - if (*PValue != TstIndex) - FAILURE("JudyLIns ret wrong Value at", elm); - - JHSI(PValue, *JH, &TstIndex, sizeof(Word_t)); - if (PValue == (Word_t *) NULL) - FAILURE("JudyHSIns ret PValue = NULL", 0L); - if (*PValue != TstIndex) - FAILURE("JudyHSIns ret wrong Value at", elm); - } - - return(LowIndex); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyCount" - -int -TestJudyCount(void *J1, void *JL, Word_t LowIndex, Word_t Elements) -{ - Word_t elm; - Word_t Count1, CountL; - Word_t TstIndex = LowIndex; - int Rcode; - - TstIndex = LowIndex; - for (elm = 0; elm < Elements; elm++) - { - J1C(Count1, J1, LowIndex, TstIndex); - if (Count1 == JERR) - FAILURE("Judy1Count ret JERR", Count1); - - if (Count1 != (elm + 1)) - { - J1C(CountL, J1, 0, -1); - printf("J1C(%lu, J1, 0, -1)\n", CountL); - - JLC(CountL, JL, 0, -1); - printf("JLC(%lu, JL, 0, -1)\n", CountL); - - printf("LowIndex = 0x%lx, TstIndex = 0x%lx, diff = %lu\n", LowIndex, - TstIndex, TstIndex - LowIndex); - JLC(CountL, JL, LowIndex, TstIndex); - printf("CountL = %lu, Count1 = %lu, should be: elm + 1 = %lu\n", CountL, Count1, elm + 1); - FAILURE("J1C at", elm); - } - - JLC(CountL, JL, LowIndex, TstIndex); - if (CountL == JERR) - FAILURE("JudyLCount ret JERR", CountL); - - if (CountL != (elm + 1)) - { - printf("CountL = %lu, elm +1 = %lu\n", CountL, elm + 1); - FAILURE("JLC at", elm); - } - - J1N(Rcode, J1, TstIndex); - } - return(0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyNext" - -Word_t TestJudyNext(void *J1, void *JL, Word_t LowIndex, Word_t Elements) -{ - Word_t JLindex, J1index, JPindex = 0; - Word_t *PValue; - Word_t elm; - int Rcode; - -// Get an Index low enough for Elements - J1index = JLindex = LowIndex; - - JLF(PValue, JL, JLindex); - J1F(Rcode, J1, J1index); - - for (elm = 0; elm < Elements; elm++) - { - if (PValue == NULL) - FAILURE("JudyLNext ret NULL PValue at", elm); - if (Rcode != 1) - FAILURE("Judy1Next Rcode != 1 =", Rcode); - if (JLindex != J1index) - FAILURE("JudyLNext & Judy1Next ret different PIndex at", elm); - - JPindex = J1index; // save the last found index - - JLN(PValue, JL, JLindex); // Get next one - J1N(Rcode, J1, J1index); // Get next one - } - - if (PValue != NULL) - FAILURE("JudyLNext PValue != NULL", PValue); - if (Rcode != 0) - FAILURE("Judy1Next Rcode != 1 =", Rcode); - -// perhaps a check should be done here -- if I knew what to expect. - return(JPindex); // return last one -} - - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyPrev" - -int -TestJudyPrev(void *J1, void *JL, Word_t HighIndex, Word_t Elements) -{ - Word_t JLindex, J1index; - Word_t *PValue; - Word_t elm; - int Rcode; - -// Get an Index high enough for Elements - J1index = JLindex = HighIndex; - - JLL(PValue, JL, JLindex); - J1L(Rcode, J1, J1index); - - for (elm = 0; elm < Elements; elm++) - { - if (PValue == NULL) - FAILURE("JudyLPrev ret NULL PValue at", elm); - if (Rcode != 1) - FAILURE("Judy1Prev Rcode != 1 =", Rcode); - if (JLindex != J1index) - FAILURE("JudyLPrev & Judy1Prev ret different PIndex at", elm); - - JLP(PValue, JL, JLindex); // Get previous one - J1P(Rcode, J1, J1index); // Get previous one - } - if (PValue != NULL) - FAILURE("JudyLPrev PValue != NULL", PValue); - if (Rcode != 0) - FAILURE("Judy1Prev Rcode != 1 =", Rcode); -// perhaps a check should be done here -- if I knew what to expect. - return(0); -} - - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyNextEmpty" - -int -TestJudyNextEmpty(void *J1, void *JL, Word_t LowIndex, Word_t Elements) -{ - Word_t elm; - Word_t JLindex, J1index; - Word_t Seed1; - int Rcode1; // Return code - int RcodeL; // Return code - -// Set 1st search to .. - Seed1 = LowIndex; - J1index = JLindex = Seed1; - - for (elm = 0; elm < Elements; elm++) - { - Word_t *PValue; - - if (pFlag) { printf("JNE: %8lu\t0x%lx\n", elm, JLindex); } - -// Find next Empty Index, JLindex is modified by JLNE - JLNE(RcodeL, JL, JLindex); // Rcode = JudyLNextEmpty(JL, &JLindex, PJE0) - -// Find next Empty Index, J1index is modified by J1NE - J1NE(Rcode1, J1, J1index); // Rcode = Judy1NextEmpty(J1, &J1index, PJE0) - if ((Rcode1 != 1) || (RcodeL != 1)) - { - printf("RcodeL = %d, Rcode1 = %d, Index1 = 0x%lx, IndexL = 0x%lx\n", - RcodeL, Rcode1, J1index, JLindex); - FAILURE("Judy1NextEmpty Rcode != 1 =", Rcode1); - } - - if (J1index != JLindex) - FAILURE("JLNE != J1NE returned index at", elm); -#ifdef SKIPMACRO - Rcode1 = Judy1Test(J1, J1index); -#else - J1T(Rcode1, J1, J1index); -#endif // SKIPMACRO - if (Rcode1 != 0) - FAILURE("J1NE returned non-empty Index =", J1index); - -#ifdef SKIPMACRO - PValue = (PWord_t)JudyLGet(JL, JLindex); -#else - JLG(PValue, JL, JLindex); -#endif // SKIPMACRO - if (PValue != (Word_t *) NULL) - FAILURE("JLNE returned non-empty Index =", JLindex); - - Seed1 = GetNextIndex(Seed1); - J1index = JLindex = Seed1; - } - return(0); -} - - -// Routine to JudyPrevEmpty routines - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyPrevEmpty" - -int -TestJudyPrevEmpty(void *J1, void *JL, Word_t HighIndex, Word_t Elements) -{ - Word_t elm; - Word_t JLindex, J1index; - Word_t Seed1; - int Rcode1; - int RcodeL; - -// Set 1st search to .. - Seed1 = HighIndex; - J1index = JLindex = Seed1; - - for (elm = 0; elm < Elements; elm++) - { - Word_t *PValue; - Word_t JPIndex; - - JPIndex = J1index; - - if (pFlag) { printf("JPE: %8lu\t0x%lx\n", elm, JPIndex); } - - J1PE(Rcode1, J1, J1index); // Rcode = Judy1PrevEmpty(J1, &J1index, PJE0) - -// Find next Empty Index, JLindex is modified by JLPE - JLPE(RcodeL, JL, JLindex); // RcodeL = JudyLPrevEmpty(JL, &JLindex, PJE0) - if ((RcodeL != 1) || (Rcode1 != 1)) - { - printf("RcodeL = %d, Rcode1 = %d, Index1 = 0x%lx, IndexL = 0x%lx\n", - RcodeL, Rcode1, J1index, JLindex); - FAILURE("Judy*PrevEmpty Rcode* != 1 =", RcodeL); - } - - if (J1index != JLindex) - FAILURE("JLPE != J1PE returned index at", elm); - -#ifdef SKIPMACRO - Rcode1 = Judy1Test(J1, J1index); -#else - J1T(Rcode1, J1, J1index); -#endif // SKIPMACRO - if (Rcode1 != 0) - FAILURE("J1PE returned non-empty Index =", J1index); - -#ifdef SKIPMACRO - PValue = (PWord_t)JudyLGet(JL, JLindex); -#else - JLG(PValue, JL, JLindex); -#endif // SKIPMACRO - if (PValue != (Word_t *) NULL) - FAILURE("JLPE returned non-empty Index =", JLindex); - - Seed1 = GetNextIndex(Seed1); - J1index = JLindex = Seed1; - } - return(0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyDel" - -int -TestJudyDel(void **J1, void **JL, void **JH, Word_t Seed, Word_t Elements) -{ - Word_t TstIndex; - Word_t elm; - Word_t Seed1; - int Rcode; - -// Only delete half of those inserted - for (Seed1 = Seed, elm = 0; elm < (Elements / 2); elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (pFlag) { printf("Del: %8lu\t0x%lx\n", elm, TstIndex); } - - TotalDel++; - - J1U(Rcode, *J1, TstIndex); - if (Rcode != 1) - FAILURE("Judy1Unset ret Rcode != 1", Rcode); - - JLD(Rcode, *JL, TstIndex); - if (Rcode != 1) - FAILURE("JudyLDel ret Rcode != 1", Rcode); - - JHSD(Rcode, *JH, (void *)(&TstIndex), sizeof(Word_t)); - if (Rcode != 1) - FAILURE("JudyHSDel ret Rcode != 1", Rcode); - - TotalPop--; - } - return(0); -} - -// Routine to get next size of Indexes -int // return 1 if last number -NextNumb(Word_t * PNumber, // pointer to returned next number - double *PDNumb, // Temp double of above - double DMult, // Multiplier - Word_t MaxNumb) // Max number to return -{ - Word_t num; - -// Save prev number - Word_t PrevNumb = *PNumber; - -// Verify integer number increased - for (num = 0; num < 1000; num++) - { -// Calc next number - *PDNumb *= DMult; - -// Return it in integer format - *PNumber = (Word_t) (*PDNumb + 0.5); - - if (*PNumber != PrevNumb) - break; - } - -// Verify it did exceed max ulong - if ((*PDNumb + 0.5) > (double)(-1UL)) - { -// It did, so return max number - *PNumber = -1UL; - return (1); // flag it - } - -// Verify it did not exceed max number - if ((*PDNumb + 0.5) > (double)MaxNumb) - { -// it did, so return max - *PNumber = MaxNumb; - return(1); // flag it - } - return(0); // more available -} diff --git a/libjudy/test/Judy1LHTime.c b/libjudy/test/Judy1LHTime.c deleted file mode 100644 index a2ce5c1d76..0000000000 --- a/libjudy/test/Judy1LHTime.c +++ /dev/null @@ -1,2235 +0,0 @@ -// @(#) $Revision: 4.20 $ $Source: /judy/test/manual/Judy1LHTime.c $ -//======================================================================= -// This program measures the performance of a Judy1 and JudyL Array. -// -by- -// Author Douglas L. Baskins, Aug 2003. -// Permission to use this code is freely granted, provided that this -// statement is retained. -// email - dougbaskins@yahoo.com -//======================================================================= - -#include // sbrk() -#include // exit() -#include // printf(), setbuf() -#include // pow() -#include // gettimeofday() -#include // uname() - -#include // for Judy macros J*() -//#include // compiling with old Judy.h without JudyHS - -#ifdef NOINLINE /* this is the 21st century? */ -#define _INLINE_ static -#else -#define _INLINE_ inline -#endif - -//======================================================================= -// This program measures the performance of a Judy1, JudyL and -// limited to one size of string (sizeof Word_t) JudyHS Arrays. -// -// Compile: -// -// cc -O Judy1LHTime.c -lm -lJudy -o Judy1LHTime -// -or- -// cc -O -DCPUMHZ=2400 Judy1LHTime.c -lm -lJudy -o Judy1LHTime - -/* Notes: - 1) Use '-DCPUMHZ=2400' in cc line if better clock resolution is desired - and it compiles successfully. The 2400 is the cpu MHz : 2400 -or- - cat /proc/cpuinfo | grep "cpu MHz" in a Linux system. - 2) -*/ - -//======================================================================= -// T I M I N G M A C R O S -//======================================================================= - -double DeltaUSec; // Global for remembering delta times - -#ifdef CPUMHZ - -// For a 1.34 nS clock cycle processor (750Mhz) - -#define CPUSPEED (1.0 / (CPUMHZ)) - -//#define rdtscll(val) __asm__ __volatile__("rdtsc" : "=A" (val)) - -#define rdtscl(low) __asm__ __volatile__("rdtsc" : "=a" (low) : : "edx") - -static inline uint32_t -get_cycles(void) -{ - uint32_t ret = 0; - rdtscl(ret); - return (ret); -} - -#define STARTTm \ -{ \ - gettimeofday(&TVBeg__, NULL); \ - GCBeg__ = get_cycles(); \ -} - -#define ENDTm(D) \ -{ \ - uint32_t GCEnd__; \ - GCEnd__ = get_cycles(); \ - gettimeofday(&TVEnd__, NULL); \ - (D) = (double)(TVEnd__.tv_sec - TVBeg__.tv_sec) * 1E6 + \ - ((double)(TVEnd__.tv_usec - TVBeg__.tv_usec)); \ - if (D < 10000.0) D = (double)(GCEnd__ - GCBeg__) * CPUSPEED; \ -} - -#else // ! CPUMHZ - -#define STARTTm gettimeofday(&TVBeg__, NULL) - -#define ENDTm(D) \ -{ \ - gettimeofday(&TVEnd__, NULL); \ - (D) = (double)(TVEnd__.tv_sec - TVBeg__.tv_sec) * 1E6 + \ - ((double)(TVEnd__.tv_usec - TVBeg__.tv_usec)); \ -} - -#endif // ! CPUMHZ - -// **************************************************************************** -// J U D Y M A L L O C -// -// Allocate RAM. This is the single location in Judy code that calls -// malloc(3C). Note: JPM accounting occurs at a higher level. - -enum -{ - JudyMal1, - JudyMalL, - JudyMalHS -} MalFlag; - -static Word_t MalFreeCnt = 0; - -Word_t TotJudy1MemUsed = 0; -Word_t TotJudyLMemUsed = 0; -Word_t TotJudyHSMemUsed = 0; - -Word_t -JudyMalloc(Word_t Words) -{ - Word_t Addr; - Word_t IncWords; - - Addr = (Word_t)malloc(Words * sizeof(Word_t)); - - if (Addr) - { - IncWords = Words; - MalFreeCnt++; - -// Adjust for overhead of (dl)malloc - if (Words % 1) - IncWords += 1; - else - IncWords += 2; - - switch (MalFlag) - { - case JudyMal1: - TotJudy1MemUsed += IncWords; - break; - case JudyMalL: - TotJudyLMemUsed += IncWords; - break; - case JudyMalHS: - TotJudyHSMemUsed += IncWords; - break; - } - } - return (Addr); -} // JudyMalloc() - -// **************************************************************************** -// J U D Y F R E E - -void -JudyFree(void *PWord, Word_t Words) -{ - Word_t DecWords; - - if (Words == 0) - printf("OOps JudyFree called with 0 words\n"); - - free(PWord); - DecWords = Words; - MalFreeCnt++; - -// Adjust for overhead of (dl)malloc - if (Words % 1) - DecWords += 1; - else - DecWords += 2; - - switch (MalFlag) - { - case JudyMal1: - TotJudy1MemUsed -= DecWords; - break; - case JudyMalL: - TotJudyLMemUsed -= DecWords; - break; - case JudyMalHS: - TotJudyHSMemUsed -= DecWords; - break; - } -} // JudyFree() - -// **************************************************************************** -// J U D Y M A L L O C -// -// Higher-level "wrapper" for allocating objects that need not be in RAM, -// although at this time they are in fact only in RAM. Later we hope that some -// entire subtrees (at a JPM or branch) can be "virtual", so their allocations -// and frees should go through this level. - -Word_t -JudyMallocVirtual(Word_t Words) -{ - return (JudyMalloc(Words)); - -} // JudyMallocVirtual() - -// **************************************************************************** -// J U D Y F R E E - -void -JudyFreeVirtual(void *PWord, Word_t Words) -{ - JudyFree(PWord, Words); - -} // JudyFreeVirtual() - -//======================================================================= - -// Common macro to handle a failure -#define FAILURE(STR, UL) \ -{ \ -printf( "\nError: %s %lu, file='%s', 'function='%s', line %d\n", \ - STR, (Word_t)(UL), __FILE__, __FUNCTI0N__, __LINE__); \ -fprintf(stderr,"\nError: %s %lu, file='%s', 'function='%s', line %d\n", \ - STR, (Word_t)(UL), __FILE__, __FUNCTI0N__, __LINE__); \ - exit(1); \ -} - -// Interations without improvement -// Minimum of 2 loops, maximum of 1000000 -#define MINLOOPS 2 -#define MAXLOOPS 1000000 - -// Maximum or 10 loops with no improvement -#define ICNT 10 - -// Structure to keep track of times -typedef struct MEASUREMENTS_STRUCT -{ - Word_t ms_delta; -} -ms_t , *Pms_t; - -// Specify prototypes for each test routine -int NextNumb(Word_t *PNumber, double *PDNumb, double DMult, Word_t MaxN); - -Word_t TestJudyIns(void **J1, void **JL, void **JH, Word_t Seed, - Word_t Elems); - -Word_t TestJudyDup(void **J1, void **JL, void **JH, Word_t Seed, - Word_t Elems); - -int TestJudyDel(void **J1, void **JL, void **JH, Word_t Seed, - Word_t Elems); - -Word_t TestJudyGet(void *J1, void *JL, void *JH, Word_t Seed, Word_t Elems); - -int TestJudy1Copy(void *J1, Word_t Elem); - -int TestJudyCount(void *J1, void *JL, Word_t LowIndex, Word_t Elems); - -Word_t TestJudyNext(void *J1, void *JL, Word_t LowIndex, Word_t Elems); - -int TestJudyPrev(void *J1, void *JL, Word_t HighIndex, Word_t Elems); - -Word_t TestJudyNextEmpty(void *J1, void *JL, Word_t LowIndex, Word_t Elems); - -Word_t TestJudyPrevEmpty(void *J1, void *JL, Word_t HighIndex, Word_t Elems); - -//======================================================================= -// These are LFSF feedback taps for bitwidths of 10..64 sized numbers. -// Tested with Seed=0xc1fc to 35 billion numbers -//======================================================================= - -Word_t StartSeed = 0xc1fc; // default beginning number -Word_t FirstSeed; - -Word_t MagicList[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0..9 - 0x27f, // 10 - 0x27f, // 11 - 0x27f, // 12 - 0x27f, // 13 - 0x27f, // 14 - 0x27f, // 15 - 0x1e71, // 16 - 0xdc0b, // 17 - 0xdc0b, // 18 - 0xdc0b, // 19 - 0xdc0b, // 20 - 0xc4fb, // 21 - 0xc4fb, // 22 - 0xc4fb, // 23 - 0x13aab, // 24 - 0x11ca3, // 25 - 0x11ca3, // 26 - 0x11ca3, // 27 - 0x13aab, // 28 - 0x11ca3, // 29 - 0xc4fb, // 30 - 0xc4fb, // 31 - 0x13aab, // 32 - 0x14e73, // 33 - 0x145d7, // 34 - 0x145f9, // 35 following tested with Seed=0xc1fc to 35 billion numbers - 0x151ed, // 36 .. 41 - 0x151ed, // 37 - 0x151ed, // 38 - 0x151ed, // 39 - 0x151ed, // 40 - 0x146c3, // 41 .. 64 - 0x146c3, // 42 - 0x146c3, // 43 - 0x146c3, // 44 - 0x146c3, // 45 - 0x146c3, // 46 - 0x146c3, // 47 - 0x146c3, // 48 - 0x146c3, // 49 - 0x146c3, // 50 - 0x146c3, // 51 - 0x146c3, // 52 - 0x146c3, // 53 - 0x146c3, // 54 - 0x146c3, // 55 - 0x146c3, // 56 - 0x146c3, // 57 - 0x146c3, // 58 - 0x146c3, // 59 - 0x146c3, // 60 - 0x146c3, // 61 - 0x146c3, // 62 - 0x146c3, // 63 - 0x146c3 // 64 -}; - -// Routine to "mirror" the input data word -static Word_t -Swizzle(Word_t word) -{ -// BIT REVERSAL, Ron Gutman in Dr. Dobb's Journal, #316, Sept 2000, pp133-136 -// - -#ifdef __LP64__ - word = ((word & 0x00000000ffffffff) << 32) | - ((word & 0xffffffff00000000) >> 32); - word = ((word & 0x0000ffff0000ffff) << 16) | - ((word & 0xffff0000ffff0000) >> 16); - word = ((word & 0x00ff00ff00ff00ff) << 8) | - ((word & 0xff00ff00ff00ff00) >> 8); - word = ((word & 0x0f0f0f0f0f0f0f0f) << 4) | - ((word & 0xf0f0f0f0f0f0f0f0) >> 4); - word = ((word & 0x3333333333333333) << 2) | - ((word & 0xcccccccccccccccc) >> 2); - word = ((word & 0x5555555555555555) << 1) | - ((word & 0xaaaaaaaaaaaaaaaa) >> 1); -#else // not __LP64__ - word = ((word & 0x0000ffff) << 16) | ((word & 0xffff0000) >> 16); - word = ((word & 0x00ff00ff) << 8) | ((word & 0xff00ff00) >> 8); - word = ((word & 0x0f0f0f0f) << 4) | ((word & 0xf0f0f0f0) >> 4); - word = ((word & 0x33333333) << 2) | ((word & 0xcccccccc) >> 2); - word = ((word & 0x55555555) << 1) | ((word & 0xaaaaaaaa) >> 1); -#endif // not __LP64__ - - return (word); -} - -double DeltaUSec1 = 0.0; // Global for measuring delta times -double DeltaUSecL = 0.0; // Global for measuring delta times -double DeltaUSecHS = 0.0; // Global for measuring delta times -double DeltaMalFre1 = 0.0; // Delta mallocs/frees per inserted index -double DeltaMalFreL = 0.0; // Delta mallocs/frees per inserted index -double DeltaMalFreHS = 0.0; // Delta mallocs/frees per inserted index -double DeltaMalFre = 0.0; // Delta mallocs/frees per inserted index - -Word_t J1Flag = 0; // time Judy1 -Word_t JLFlag = 0; // time JudyL -Word_t JHFlag = 0; // time JudyHS -Word_t dFlag = 0; // time Judy1Unset JudyLDel -Word_t vFlag = 0; // time Searching -Word_t CFlag = 0; // time Counting -Word_t cFlag = 0; // time Copy of Judy1 array -Word_t IFlag = 0; // time duplicate inserts/sets -Word_t DFlag = 0; // bit reverse the data stream -Word_t lFlag = 0; // do not do multi-insert tests -Word_t SkipN = 0; // default == Random skip -Word_t TValues = 1000000; // Maximum retrieve tests for timing -Word_t nElms = 1000000; // Max population of arrays -Word_t ErrorFlag = 0; -Word_t PtsPdec = 40; // measurement points per decade - -// Stuff for LFSR (pseudo random number generator) -Word_t RandomBit = ~0UL / 2 + 1; -Word_t BValue = sizeof(Word_t) * 8; -Word_t Magic; - -// for error routines -- notice misspelling, name conflicts with some compilers -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "Random" - -_INLINE_ Word_t // so INLINING compilers get to look at it. -Random(Word_t newseed) -{ - if (newseed & RandomBit) - { - newseed += newseed; - newseed ^= Magic; - } - else - { - newseed += newseed; - } - newseed &= RandomBit * 2 - 1; - if (newseed == FirstSeed) - FAILURE("LFSR failed", newseed); - return (newseed); -} - -_INLINE_ Word_t // so INLINING compilers get to look at it. -GetNextIndex(Word_t Index) -{ - if (SkipN) - Index += SkipN; - else - Index = Random(Index); - - return (Index); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "main" - -struct timeval TVBeg__, TVEnd__; - -#ifdef CPUMHZ -uint32_t GCBeg__; -#endif // CPUMHZ - -int -main(int argc, char *argv[]) -{ -// Names of Judy Arrays - void *J1 = NULL; // Judy1 - void *JL = NULL; // JudyL - void *JH = NULL; // JudyHS - - Word_t Count1, CountL; // , CountHS; - Word_t Bytes; - - double Mult; - Pms_t Pms; - Word_t Seed; - Word_t PtsPdec = 40; // points per decade - Word_t Groups; // Number of measurement groups - Word_t grp; - Word_t Pop1; - Word_t Meas; - int Col; - - int c; - extern char *optarg; - - setbuf(stdout, NULL); // unbuffer output - -//============================================================ -// PARSE INPUT PARAMETERS -//============================================================ - - while ((c = getopt(argc, argv, "n:S:T:P:b:B:dDcC1LHvIl")) != -1) - { - switch (c) - { - case 'n': // Max population of arrays - nElms = strtoul(optarg, NULL, 0); // Size of Linear Array - if (nElms == 0) - FAILURE("No tests: -n", nElms); - break; - - case 'S': // Step Size, 0 == Random - SkipN = strtoul(optarg, NULL, 0); - break; - - case 'T': // Maximum retrieve tests for timing - TValues = strtoul(optarg, NULL, 0); - break; - - case 'P': // measurement points per decade - PtsPdec = strtoul(optarg, NULL, 0); - break; - - case 'b': // May not work past 35 bits if changed - StartSeed = strtoul(optarg, NULL, 0); - break; - - case 'B': // expanse of data points (random only) - BValue = strtoul(optarg, NULL, 0); - if ((BValue > 64) - || (MagicList[BValue] == 0) || (BValue > (sizeof(Word_t) * 8))) - { - ErrorFlag++; - printf("\nIllegal number of random bits of %lu !!!\n", BValue); - } - break; - - case 'v': - vFlag = 1; // time Searching - break; - - case '1': // time Judy1 - J1Flag = 1; - break; - - case 'L': // time JudyL - JLFlag = 1; - break; - - case 'H': // time JudyHS - JHFlag = 1; - break; - - case 'd': // time Judy1Unset JudyLDel - dFlag = 1; - break; - - case 'D': // bit reverse the data stream - DFlag = 1; - break; - - case 'c': // time Copy Judy1 array - cFlag = 1; - break; - - case 'C': // time Counting - CFlag = 1; - break; - - case 'I': // time duplicate insert/set - IFlag = 1; - break; - - case 'l': // do not loop in tests - lFlag = 1; - break; - - default: - ErrorFlag++; - break; - } - } - - if (ErrorFlag) - { - printf("\n%s -n# -P# -S# -B# -T# -dDcCpdI\n\n", argv[0]); - printf("Where:\n"); - printf("-n <#> number of indexes (1000000) used in tests\n"); - printf("-P <#> number measurement points (40) per decade\n"); - printf("-S <#> index skip amount, 0 = random\n"); - printf("-B <#> # bits (10..%d) in random number generator\n", - (int)sizeof(Word_t) * 8); - printf("-L time JudyL\n"); - printf("-1 time Judy1\n"); - printf("-H time JudyHS\n"); - printf("-I time DUPLICATE Ins/Set times\n"); - printf("-c time copy Judy1 Array\n"); - printf("-C time JudyCount tests\n"); - printf("-v time Judy First/Last/Next/Prev tests\n"); - printf("-d time JudyDel/Unset\n"); - printf("-l do not loop on same Indexes\n"); - printf("-T <#> max number indexes in read times - 0 == MAX\n"); - printf("\n"); - - exit(1); - } - -// If none, then all - if (!JLFlag && !J1Flag && !JHFlag) - JHFlag = JLFlag = J1Flag = 1; - -// Set number of Random bits in LFSR - RandomBit = 1UL << (BValue - 1); - Magic = MagicList[BValue]; - - if (nElms > ((RandomBit - 2) * 2)) - { - printf - ("# Number = -n%lu of Indexes reduced to max expanse of Random numbers\n", - nElms); - nElms = ((RandomBit - 2) * 2); - } - - printf("# TITLE %s -n%lu -S%lu -T%lu -B%lu -P%lu", - argv[0], nElms, SkipN, TValues, BValue, PtsPdec); - -// case 'b': // May not work past 35 bits if changed - - if (J1Flag) - printf(" -1"); - if (JLFlag) - printf(" -L"); - if (JHFlag) - printf(" -H"); - if (DFlag) - printf(" -D"); - if (dFlag) - printf(" -d"); - if (cFlag) - printf(" -c"); - if (CFlag) - printf(" -C"); - if (IFlag) - printf(" -I"); - if (lFlag) - printf(" -l"); - if (vFlag) - printf(" -v"); - printf("\n"); - -// uname(2) strings describing the machine - { - struct utsname ubuf; // for system name - - if (uname(&ubuf) == -1) - printf("# Uname(2) failed\n"); - else - printf("# %s %s %s %s %s\n", ubuf.sysname, ubuf.nodename, - ubuf.release, ubuf.version, ubuf.machine); - } - if (sizeof(Word_t) == 8) - printf("# %s 64 Bit version\n", argv[0]); - else if (sizeof(Word_t) == 4) - printf("# %s 32 Bit version\n", argv[0]); - - printf("# XLABEL Population\n"); - printf("# YLABEL Microseconds / Index\n"); - -//============================================================ -// CALCULATE NUMBER OF MEASUREMENT GROUPS -//============================================================ - -// Calculate Multiplier for number of points per decade - Mult = pow(10.0, 1.0 / (double)PtsPdec); - { - double sum; - Word_t numb, prevnumb; - -// Count number of measurements needed (10K max) - sum = numb = 1; - for (Groups = 2; Groups < 10000; Groups++) - { - if (NextNumb(&numb, &sum, Mult, nElms)) - break; - } - -// Get memory for measurements - Pms = (Pms_t) calloc(Groups, sizeof(ms_t)); - -// Now calculate number of Indexes for each measurement point - numb = sum = 1; - prevnumb = 0; - for (grp = 0; grp < Groups; grp++) - { - Pms[grp].ms_delta = numb - prevnumb; - prevnumb = numb; - - NextNumb(&numb, &sum, Mult, nElms); - } - } // Groups = number of sizes - -//============================================================ -// PRINT HEADER TO PERFORMANCE TIMERS -//============================================================ - - Col = 1; - printf("# COLHEAD %d Population\n", Col++); - printf("# COLHEAD %d Measurments\n", Col++); - printf("# COLHEAD %d J1S - Judy1Set\n", Col++); - printf("# COLHEAD %d JLI - JudyLIns\n", Col++); - printf("# COLHEAD %d JHSI - JudyHSIns\n", Col++); - printf("# COLHEAD %d J1T - Judy1Test\n", Col++); - printf("# COLHEAD %d JLG - JudyLGet\n", Col++); - printf("# COLHEAD %d JHSG - JudyHSGet\n", Col++); - - if (IFlag) - { - printf("# COLHEAD %d J1S-dup\n", Col++); - printf("# COLHEAD %d JLI-dup\n", Col++); - printf("# COLHEAD %d JHSI-dup\n", Col++); - } - if (cFlag) - { - printf("# COLHEAD %d Copy J1T->J1S\n", Col++); - } - if (CFlag) - { - printf("# COLHEAD %d J1C\n", Col++); - printf("# COLHEAD %d JLC\n", Col++); - } - if (vFlag) - { - printf("# COLHEAD %d J1N\n", Col++); - printf("# COLHEAD %d JLN\n", Col++); - printf("# COLHEAD %d J1P\n", Col++); - printf("# COLHEAD %d JLP\n", Col++); - printf("# COLHEAD %d J1NE\n", Col++); - printf("# COLHEAD %d JLNE\n", Col++); - printf("# COLHEAD %d J1PE\n", Col++); - printf("# COLHEAD %d JLPE\n", Col++); - } - if (dFlag) - { - printf("# COLHEAD %d J1U\n", Col++); - printf("# COLHEAD %d JLD\n", Col++); - printf("# COLHEAD %d JHSD\n", Col++); - } - printf("# COLHEAD %d 1heap/I - Judy1 heap memery per Index\n", Col++); - printf("# COLHEAD %d Lheap/I - JudyL heap memery per Index\n", Col++); - printf("# COLHEAD %d HSheap/I - JudyHS heap memery per Index\n", Col++); - printf("# COLHEAD %d MF1/I - Judy1 malloc+free's per delta Indexes\n", - Col++); - printf("# COLHEAD %d MFL/I - JudyL malloc+free's per delta Indexes\n", - Col++); - printf("# COLHEAD %d MFHS/I - JudyHS malloc+free's per delta Indexes\n", - Col++); - -#ifdef CPUMHZ - printf("#\n# Compiled for processor speed of %d Mhz\n#\n", CPUMHZ); -#endif // CPUMHZ - - printf("# %s - Leaf sizes in Words\n", Judy1MallocSizes); - printf("# %s - Leaf sizes in Words\n#\n", JudyLMallocSizes); - - printf("# Pop1 Measmts J1S JLI JHSI J1T JLG JHSG"); - - if (IFlag) - printf(" dupJ1S dupJLI dupJHI"); - - if (cFlag) - printf(" CopyJ1"); - - if (CFlag) - printf(" J1C JLC"); - - if (vFlag) - printf(" J1N JLN J1P JLP J1NE JLNE J1PE JLPE"); - - if (dFlag) - printf(" J1U JLD JHSD"); - - printf(" 1heap/I Lheap/I HSheap/I"); - - printf(" MF1/I"); - printf(" MFL/I"); - printf(" MFHS/I"); - - printf("\n"); - -//============================================================ -// BEGIN TESTS AT EACH GROUP SIZE -//============================================================ - -// Get the kicker to test the LFSR - FirstSeed = Seed = StartSeed & (RandomBit * 2 - 1); - - for (Pop1 = grp = 0; grp < Groups; grp++) - { - Word_t LowIndex; - Word_t Delta; - Word_t NewSeed; - - Delta = Pms[grp].ms_delta; - -// Test J1S, JLI - NewSeed = TestJudyIns(&J1, &JL, &JH, Seed, Delta); - -// Accumulate the Total population of arrays - Pop1 += Delta; - Meas = Pop1; - -// Only test the maximum of TValues if not zero - if (TValues) - Meas = (Pop1 < TValues) ? Pop1 : TValues; - - printf("%10lu %9lu", Pop1, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - printf(" %6.3f", DeltaUSecHS); - fflush(NULL); - -// Test J1T, JLG, JHSG - - LowIndex = TestJudyGet(J1, JL, JH, FirstSeed, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - printf(" %6.3f", DeltaUSecHS); - fflush(NULL); - -// Test J1T, JLI, JHSI - duplicates - - if (IFlag) - { - LowIndex = TestJudyDup(&J1, &JL, &JH, FirstSeed, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - printf(" %6.3f", DeltaUSecHS); - fflush(NULL); - } - if (cFlag) - { - TestJudy1Copy(J1, Meas); - printf(" %6.3f", DeltaUSec1); - fflush(NULL); - } - if (CFlag) - { - TestJudyCount(J1, JL, LowIndex, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - fflush(NULL); - } - if (vFlag) - { -// Test J1N, JLN -// HighIndex = TestJudyNext(J1, JL, LowIndex, Meas); - TestJudyNext(J1, JL, 0, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - fflush(NULL); - -// Test J1P, JLP - TestJudyPrev(J1, JL, ~0UL, Meas); -// TestJudyPrev(J1, JL, HighIndex, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - fflush(NULL); - -// Test J1NE, JLNE - TestJudyNextEmpty(J1, JL, 0UL, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - fflush(NULL); - -// Test J1PE, JLPE - TestJudyPrevEmpty(J1, JL, ~0UL, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - fflush(NULL); - } - -// Test J1U, JLD, JHSD - if (dFlag) - { - TestJudyDel(&J1, &JL, &JH, FirstSeed, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - printf(" %6.3f", DeltaUSecHS); - fflush(NULL); - -// Now put them back - TestJudyIns(&J1, &JL, &JH, FirstSeed, Meas); - } - -// Advance Index number set - Seed = NewSeed; - -// Print the number of bytes used per Index - printf(" %7.3f", - (double)TotJudy1MemUsed * sizeof(Word_t) / (double)Pop1); - printf(" %7.3f", - (double)TotJudyLMemUsed * sizeof(Word_t) / (double)Pop1); - printf(" %8.3f", - (double)TotJudyHSMemUsed * sizeof(Word_t) / (double)Pop1); - - printf(" %5.3f", DeltaMalFre1); - printf(" %5.3f", DeltaMalFreL); - printf(" %5.3f", DeltaMalFreHS); - - printf("\n"); - fflush(NULL); // assure data gets to file in case malloc fail - } - -#ifdef SKIPMACRO - Count1 = Judy1Count(J1, 0, -1, PJE0); - CountL = JudyLCount(JL, 0, -1, PJE0); -#else - JLC(CountL, JL, 0, -1); // get the counts - J1C(Count1, J1, 0, -1); -#endif // SKIPMACRO - - if (JLFlag && J1Flag) - { - if (CountL != Count1) - FAILURE("Judy1/LCount not equal", Count1); - } - -// if (Count1) - { - Word_t Cnt1 = Count1; - if (Cnt1 == 0) - Cnt1 = 1UL; - - STARTTm; - -#ifdef SKIPMACRO - Bytes = Judy1FreeArray(&J1, PJE0); -#else - J1FA(Bytes, J1); // Free the Judy1 Array -#endif // SKIPMACRO - - ENDTm(DeltaUSec1); - DeltaUSec1 /= (double)Cnt1; - - printf("# Judy1FreeArray: %lu, %0.3f bytes/Index, %0.3f USec/Index\n", - Count1, (double)Bytes / (double)Cnt1, DeltaUSec1); - } - -// if (CountL) - { - Word_t CntL = CountL; - if (CntL == 0) - CntL = 1UL; - - STARTTm; - -#ifdef SKIPMACRO - Bytes = JudyLFreeArray(&JL, PJE0); -#else - JLFA(Bytes, JL); // Free the JudyL Array -#endif // SKIPMACRO - - ENDTm(DeltaUSecL); - DeltaUSecL /= (double)CntL; - - printf("# JudyLFreeArray: %lu, %0.3f bytes/Index, %0.3f USec/Index\n", - CountL, (double)Bytes / (double)CntL, DeltaUSecL); - } -// if (CountHS) - { -// Word_t CntHS = CountHS; -// if (CntHS == 0) CntHS = 1UL; - - STARTTm; - -#ifdef SKIPMACRO - Bytes = JudyHSFreeArray(&JH, PJE0); // Free the JudyHS Array -#else - JHSFA(Bytes, JH); // Free the JudyHS Array -#endif // SKIPMACRO - - ENDTm(DeltaUSecHS); - DeltaUSecHS /= (double)nElms; // no Counts yet - - printf("# JudyHSFreeArray: %lu, %0.3f bytes/Index, %0.3f USec/Index\n", - nElms, (double)Bytes / (double)nElms, DeltaUSecHS); - } - exit(0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyIns" - -Word_t -TestJudyIns(void **J1, void **JL, void **JH, Word_t Seed, Word_t Elements) -{ - Word_t TstIndex; - Word_t elm; - Word_t *PValue; - Word_t Seed1 = 0; - int Rc; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - Word_t StartMallocs; - - if (Elements < 100) - Loops = (MAXLOOPS / Elements) + MINLOOPS; - else - Loops = 1; - - if (lFlag) - Loops = 1; - -// Judy1Set timings - - if (J1Flag) - { - MalFlag = JudyMal1; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - if (lp != 0) - { - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; -#ifdef SKIPMACRO - Rc = Judy1Unset(J1, TstIndex, PJE0); -#else - J1U(Rc, *J1, TstIndex); -#endif // SKIPMACRO - } - } - - StartMallocs = MalFreeCnt; - STARTTm; - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - J1S(Rc, *J1, TstIndex); - if (Rc == 0) - FAILURE("Judy1Set failed - DUP Index at", elm); -#ifdef DIAG - Rc = Judy1Test(*J1, TstIndex, PJE0); - if (Rc != 1) - FAILURE("Judy1Test failed at", elm); -#endif // DIAG - } - ENDTm(DeltaUSec1); - DeltaMalFre1 = (double)(MalFreeCnt - StartMallocs) / Elements; - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - -// JudyLIns timings - - if (JLFlag) - { - MalFlag = JudyMalL; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - if (lp != 0) - { - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; -#ifdef SKIPMACRO - Rc = JudyLDel(JL, TstIndex, PJE0); -#else - JLD(Rc, *JL, TstIndex); -#endif // SKIPMACRO - } - } - - StartMallocs = MalFreeCnt; - STARTTm; - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - JLI(PValue, *JL, TstIndex); - if (*PValue == TstIndex) - { - printf("Index = 0x%0lx, ", TstIndex); - FAILURE("JudyLIns failed - DUP Index", TstIndex); - } - *PValue = TstIndex; // save Index in Value -#ifdef DIAG - PValue = (PWord_t)JudyLGet(*JL, TstIndex, PJE0); - if (PValue == NULL) - { - printf("Index = 0x%0lx, ", TstIndex); - FAILURE("JudyLGet failed", TstIndex); - } -#endif // DIAG - } - ENDTm(DeltaUSecL); - DeltaUSecL /= Elements; - DeltaMalFreL = (double)(MalFreeCnt - StartMallocs) / Elements; - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - } - -// JudyHSIns timings - - if (JHFlag) - { - MalFlag = JudyMalHS; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - if (lp != 0) - { - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - JHSD(Rc, *JH, &TstIndex, sizeof(Word_t)); - } - } - - StartMallocs = MalFreeCnt; - STARTTm; - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - JHSI(PValue, *JH, &TstIndex, sizeof(Word_t)); - if (*PValue == TstIndex) - FAILURE("JudyHSIns failed - DUP Index", TstIndex); - - *PValue = TstIndex; // save Index in Value - } - ENDTm(DeltaUSecHS); - DeltaUSecHS /= Elements; - DeltaMalFreHS = (double)(MalFreeCnt - StartMallocs) / Elements; - - if (DDel > DeltaUSecHS) - { - icnt = ICNT; - DDel = DeltaUSecHS; - } - else - { - if (--icnt == 0) - break; - } - } - } - return (Seed1); // New seed -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyDup" - -Word_t -TestJudyDup(void **J1, void **JL, void **JH, Word_t Seed, Word_t Elements) -{ - Word_t LowIndex = ~0UL; - Word_t TstIndex; - Word_t elm; - Word_t *PValue; - Word_t Seed1; - int Rc; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - if (lFlag) - Loops = 1; - - if (J1Flag) - { - MalFlag = JudyMal1; - LowIndex = ~0UL; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - STARTTm; - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (TstIndex < LowIndex) - LowIndex = TstIndex; - - J1S(Rc, *J1, TstIndex); - if (Rc != 0) - FAILURE("Judy1Test Rc != 0", Rc); - } - ENDTm(DeltaUSec1); - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - - icnt = ICNT; - - if (JLFlag) - { - MalFlag = JudyMalL; - LowIndex = ~0UL; - for (DDel = 1e40, lp = 0; lp < Loops; lp++) - { - STARTTm; - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (TstIndex < LowIndex) - LowIndex = TstIndex; - - JLI(PValue, *JL, TstIndex); - if (PValue == (Word_t *)NULL) - FAILURE("JudyLGet ret PValue = NULL", 0L); - if (*PValue != TstIndex) - FAILURE("JudyLGet ret wrong Value at", elm); - } - ENDTm(DeltaUSecL); - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecL = DDel / (double)Elements; - } - - icnt = ICNT; - - if (JHFlag) - { - MalFlag = JudyMalHS; - LowIndex = ~0UL; - for (DDel = 1e40, lp = 0; lp < Loops; lp++) - { - STARTTm; - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (TstIndex < LowIndex) - LowIndex = TstIndex; - - JHSI(PValue, *JH, &TstIndex, sizeof(Word_t)); - if (PValue == (Word_t *)NULL) - FAILURE("JudyHSGet ret PValue = NULL", 0L); - if (*PValue != TstIndex) - FAILURE("JudyHSGet ret wrong Value at", elm); - } - ENDTm(DeltaUSecHS); - - if (DDel > DeltaUSecHS) - { - icnt = ICNT; - DDel = DeltaUSecHS; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecHS = DDel / (double)Elements; - } - return (LowIndex); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyGet" - -Word_t -TestJudyGet(void *J1, void *JL, void *JH, Word_t Seed, Word_t Elements) -{ - Word_t LowIndex = ~0UL; - Word_t TstIndex; - Word_t elm; - Word_t *PValue; - Word_t Seed1; - int Rc; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - - if (lFlag) - Loops = 1; - - if (J1Flag) - { - MalFlag = JudyMal1; - LowIndex = ~0UL; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - STARTTm; - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (TstIndex < LowIndex) - LowIndex = TstIndex; -#ifdef SKIPMACRO - Rc = Judy1Test(J1, TstIndex, PJE0); -#else - J1T(Rc, J1, TstIndex); -#endif // SKIPMACRO - if (Rc != 1) - { - printf - ("\nJudy1Test wrong Rc = %d, Index = 0x%lx, elm = %lu", - Rc, TstIndex, elm); - FAILURE("Judy1Test Rc != 1", Rc); - } - } - ENDTm(DeltaUSec1); - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - - icnt = ICNT; - - if (JLFlag) - { - MalFlag = JudyMalL; - LowIndex = ~0UL; - for (DDel = 1e40, lp = 0; lp < Loops; lp++) - { - STARTTm; - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (TstIndex < LowIndex) - LowIndex = TstIndex; -#ifdef SKIPMACRO - PValue = (PWord_t)JudyLGet(JL, TstIndex, PJE0); -#else - JLG(PValue, JL, TstIndex); -#endif // SKIPMACRO - - if (PValue == (Word_t *)NULL) - { - printf("\nJudyGet Index = 0x%lx", TstIndex); - FAILURE("JudyLGet ret PValue = NULL", 0L); - } - if (*PValue != TstIndex) - { - printf("JudyLGet returned Value=0x%lx, should be=0x%lx\n", - *PValue, TstIndex); - FAILURE("JudyLGet ret wrong Value at", elm); - } - } - ENDTm(DeltaUSecL); - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - - { - if (--icnt == 0) - break; - } - } - DeltaUSecL = DDel / (double)Elements; - } - - icnt = ICNT; - - if (JHFlag) - { - MalFlag = JudyMalHS; - LowIndex = ~0UL; - for (DDel = 1e40, lp = 0; lp < Loops; lp++) - { - STARTTm; - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (TstIndex < LowIndex) - LowIndex = TstIndex; - - JHSG(PValue, JH, &TstIndex, sizeof(Word_t)); - if (PValue == (Word_t *)NULL) - FAILURE("JudyHSGet ret PValue = NULL", 0L); - if (*PValue != TstIndex) - FAILURE("JudyHSGet ret wrong Value at", elm); - } - ENDTm(DeltaUSecHS); - - if (DDel > DeltaUSecHS) - { - icnt = ICNT; - DDel = DeltaUSecHS; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecHS = DDel / (double)Elements; - } - return (LowIndex); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudy1Copy" - -int -TestJudy1Copy(void *J1, Word_t Elements) -{ - Pvoid_t J1a; // Judy1 new array - Word_t elm = 0; - Word_t Bytes; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - if (lFlag) - Loops = 1; - - MalFlag = JudyMal1; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - Word_t NextIndex; - int Rc; - - STARTTm; - J1a = NULL; // Initialize To array - - NextIndex = 0; // Start at the beginning - elm = 0; - -#ifdef SKIPMACRO - Rc = Judy1First(J1, &NextIndex, PJE0); - while (Rc == 1) - { - if (elm++ == Elements) break; - - Rc = Judy1Set(&J1a, NextIndex, PJE0); - if (Rc != 1) - FAILURE("Judy1Set at", elm); - Rc = Judy1Next(J1, &NextIndex, PJE0); - } -#else - J1F(Rc, J1, NextIndex); // return first Index - while (Rc == 1) - { - if (elm++ == Elements) break; - - J1S(Rc, J1a, NextIndex); - if (Rc != 1) - FAILURE("J1S at", elm); - J1N(Rc, J1, NextIndex); - } -#endif // SKIPMACRO - - ENDTm(DeltaUSec1); - -#ifdef SKIPMACRO - Bytes = Judy1FreeArray(&J1a, PJE0); -#else - J1FA(Bytes, J1a); // no need to keep it around -#endif // SKIPMACRO - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)elm; - - return (0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyCount" - -int -TestJudyCount(void *J1, void *JL, Word_t LowIndex, Word_t Elements) -{ - Word_t elm; - Word_t Count1, CountL; - Word_t TstIndex = LowIndex; - int Rc; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - if (lFlag) - Loops = 1; - - if (J1Flag) - { - MalFlag = JudyMal1; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - TstIndex = LowIndex; - STARTTm; - for (elm = 0; elm < Elements; elm++) - { -#ifdef SKIPMACRO - Count1 = Judy1Count(J1, LowIndex, TstIndex, PJE0); -#else - J1C(Count1, J1, LowIndex, TstIndex); -#endif // SKIPMACRO - - if (Count1 != (elm + 1)) - { - printf("Count1 = %lu, elm +1 = %lu\n", Count1, elm + 1); - FAILURE("J1C at", elm); - } -#ifdef SKIPMACRO - Rc = Judy1Next(J1, &TstIndex, PJE0); -#else - J1N(Rc, J1, TstIndex); -#endif // SKIPMACRO - - } - ENDTm(DeltaUSec1); - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - - if (JLFlag) - { - MalFlag = JudyMalL; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - TstIndex = LowIndex; - STARTTm; - for (elm = 0; elm < Elements; elm++) - { - PWord_t PValue; -#ifdef SKIPMACRO - CountL = JudyLCount(JL, LowIndex, TstIndex, PJE0); -#else - JLC(CountL, JL, LowIndex, TstIndex); -#endif // SKIPMACRO - if (CountL != (elm + 1)) - { - printf("CountL = %lu, elm +1 = %lu\n", CountL, elm + 1); - FAILURE("JLC at", elm); - } -#ifdef SKIPMACRO - PValue = (PWord_t)JudyLNext(JL, &TstIndex, PJE0); -#else - JLN(PValue, JL, TstIndex); -#endif // SKIPMACRO - } - ENDTm(DeltaUSecL); - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecL = DDel / (double)Elements; - } - - return (0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyNext" - -Word_t -TestJudyNext(void *J1, void *JL, Word_t LowIndex, Word_t Elements) -{ - Word_t elm; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - Word_t JLindex; - Word_t J1index; - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - if (lFlag) - Loops = 1; - - if (J1Flag) - { - MalFlag = JudyMal1; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - int Rc; - - J1index = LowIndex; - - STARTTm; -#ifdef SKIPMACRO - Rc = Judy1First(J1, &J1index, PJE0); -#else - J1F(Rc, J1, J1index); -#endif // SKIPMACRO - for (elm = 0; elm < Elements; elm++) - { - if (Rc != 1) - { - printf("\nElements = %lu, elm = %lu\n", Elements, elm); - FAILURE("Judy1Next Rc != 1 =", Rc); - } -#ifdef SKIPMACRO - Rc = Judy1Next(J1, &J1index, PJE0); -#else - J1N(Rc, J1, J1index); // Get next one -#endif // SKIPMACRO - } - ENDTm(DeltaUSec1); - - if ((TValues == 0) && (Rc != 0)) - { - FAILURE("Judy1Next Rc != 0", Rc); - } - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - - if (JLFlag) - { - MalFlag = JudyMalL; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - Word_t *PValue; - -// Get an Index low enough for Elements - JLindex = LowIndex; - - STARTTm; - JLF(PValue, JL, JLindex); - - for (elm = 0; elm < Elements; elm++) - { - Word_t Prev; - if (PValue == NULL) - { - printf("\nElements = %lu, elm = %lu\n", Elements, elm); - FAILURE("JudyLNext ret NULL PValue at", elm); - } - if (*PValue != JLindex) - { - printf("\n*PValue=0x%lx, JLindex=0x%lx\n", *PValue, - JLindex); - FAILURE("JudyLNext ret bad *PValue at", elm); - } - Prev = JLindex; -#ifdef SKIPMACRO - PValue = (PWord_t)JudyLNext(JL, &JLindex, PJE0); -#else - JLN(PValue, JL, JLindex); // Get next one -#endif // SKIPMACRO - if (JLindex == Prev) - { - printf("OOPs, JLN did not advance 0x%lx\n", Prev); - FAILURE("JudyLNext ret did not advance", Prev); - } - } - ENDTm(DeltaUSecL); - - if ((TValues == 0) && (PValue != NULL)) - { - FAILURE("JudyLNext PValue != NULL", PValue); - } - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecL = DDel / (double)Elements; - } - -// perhaps a check should be done here -- if I knew what to expect. - if (JLFlag) - return (JLindex); - if (J1Flag) - return (J1index); - return (-1); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyPrev" - -int -TestJudyPrev(void *J1, void *JL, Word_t HighIndex, Word_t Elements) -{ - Word_t elm; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - Word_t J1index; - Word_t JLindex; - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - if (lFlag) - Loops = 1; - - if (J1Flag) - { - MalFlag = JudyMal1; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - J1index = HighIndex; - int Rc; - - STARTTm; -#ifdef SKIPMACRO - Rc = Judy1Last(J1, &J1index, PJE0); -#else - J1L(Rc, J1, J1index); -#endif // SKIPMACRO - - for (elm = 0; elm < Elements; elm++) - { - if (Rc != 1) - FAILURE("Judy1Prev Rc != 1, is: ", Rc); -#ifdef SKIPMACRO - Rc = Judy1Prev(J1, &J1index, PJE0); -#else - J1P(Rc, J1, J1index); // Get previous one -#endif // SKIPMACRO - - } - ENDTm(DeltaUSec1); - - if ((TValues == 0) && (Rc != 0)) - { - FAILURE("Judy1Prev Rc != 0", Rc); - } - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - - if (JLFlag) - { - MalFlag = JudyMalL; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - Word_t *PValue; - JLindex = HighIndex; - - STARTTm; - JLL(PValue, JL, JLindex); - - for (elm = 0; elm < Elements; elm++) - { - if (PValue == NULL) - { - printf("\nElements = %lu, elm = %lu\n", Elements, elm); - FAILURE("JudyLPrev ret NULL PValue at", elm); - } - if (*PValue != JLindex) - FAILURE("JudyLPrev ret bad *PValue at", elm); - - JLP(PValue, JL, JLindex); // Get previous one - } - ENDTm(DeltaUSecL); - - if ((TValues == 0) && (PValue != NULL)) - FAILURE("JudyLPrev PValue != NULL", PValue); - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecL = DDel / (double)Elements; - } - -// perhaps a check should be done here -- if I knew what to expect. - return (0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyNextEmpty" - -// Returns number of consecutive Indexes -Word_t -TestJudyNextEmpty(void *J1, void *JL, Word_t LowIndex, Word_t Elements) -{ - Word_t elm; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - int Rc; // Return code - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - if (lFlag) - Loops = 1; - - if (J1Flag) - { - MalFlag = JudyMal1; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - Word_t Seed1 = LowIndex; - - STARTTm; - for (elm = 0; elm < Elements; elm++) - { - Word_t J1index; - J1index = Seed1; - -#ifdef SKIPMACRO - Rc = Judy1NextEmpty(J1, &J1index, PJE0); -#else - J1NE(Rc, J1, J1index); -#endif // SKIPMACRO - - if (Rc != 1) - FAILURE("Judy1NextEmpty Rcode != 1 =", Rc); - - Seed1 = GetNextIndex(Seed1); - } - ENDTm(DeltaUSec1); - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - - if (JLFlag) - { - MalFlag = JudyMalL; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - Word_t Seed1 = LowIndex; - - STARTTm; - for (elm = 0; elm < Elements; elm++) - { - Word_t JLindex; - JLindex = Seed1; -#ifdef SKIPMACRO - Rc = JudyLNextEmpty(JL, &JLindex, PJE0); -#else - JLNE(Rc, JL, JLindex); -#endif // SKIPMACRO - if (Rc != 1) - FAILURE("JudyLNextEmpty Rcode != 1 =", Rc); - - Seed1 = GetNextIndex(Seed1); - } - ENDTm(DeltaUSecL); - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecL = DDel / (double)Elements; - } - - return (0); -} - -// Routine to time and test JudyPrevEmpty routines - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyPrevEmpty" - -Word_t -TestJudyPrevEmpty(void *J1, void *JL, Word_t HighIndex, Word_t Elements) -{ - Word_t elm; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - int Rc; - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - if (lFlag) - Loops = 1; - - if (J1Flag) - { - MalFlag = JudyMal1; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - Word_t Seed1 = HighIndex; - - STARTTm; - for (elm = 0; elm < Elements; elm++) - { - Word_t J1index; - J1index = Seed1; - -#ifdef SKIPMACRO - Rc = Judy1PrevEmpty(J1, &J1index, PJE0); -#else - J1PE(Rc, J1, J1index); -#endif // SKIPMACRO - - if (Rc != 1) - FAILURE("Judy1PrevEmpty Rc != 1 =", Rc); - - Seed1 = GetNextIndex(Seed1); - } - ENDTm(DeltaUSec1); - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - - if (JLFlag) - { - MalFlag = JudyMalL; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - Word_t Seed1 = HighIndex; - - STARTTm; - for (elm = 0; elm < Elements; elm++) - { - Word_t JLindex; - JLindex = Seed1; - - JLPE(Rc, JL, JLindex); // Rc = JudyLPrevEmpty(JL, &JLindex,PJE0) - - if (Rc != 1) - FAILURE("JudyLPrevEmpty Rcode != 1 =", Rc); - - Seed1 = GetNextIndex(Seed1); - } - ENDTm(DeltaUSecL); - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecL = DDel / (double)Elements; - } - - return (0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyDel" - -int -TestJudyDel(void **J1, void **JL, void **JH, Word_t Seed, Word_t Elements) -{ - Word_t TstIndex; - Word_t elm; - Word_t Seed1; - int Rc; - - if (J1Flag) - { - MalFlag = JudyMal1; - STARTTm; - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - -#ifdef SKIPMACRO - Rc = Judy1Unset(J1, TstIndex, PJE0); -#else - J1U(Rc, *J1, TstIndex); -#endif // SKIPMACRO - if (Rc != 1) - FAILURE("Judy1Unset ret Rcode != 1", Rc); - } - ENDTm(DeltaUSec1); - DeltaUSec1 /= Elements; - } - - if (JLFlag) - { - MalFlag = JudyMalL; - STARTTm; - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - -#ifdef SKIPMACRO - Rc = JudyLDel(JL, TstIndex, PJE0); -#else - JLD(Rc, *JL, TstIndex); -#endif // SKIPMACRO - if (Rc != 1) - FAILURE("JudyLDel ret Rcode != 1", Rc); - } - ENDTm(DeltaUSecL); - DeltaUSecL /= Elements; - } - - if (JHFlag) - { - MalFlag = JudyMalHS; - STARTTm; - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - JHSD(Rc, *JH, &TstIndex, sizeof(Word_t)); - if (Rc != 1) - FAILURE("JudyHSDel ret Rcode != 1", Rc); - } - ENDTm(DeltaUSecHS); - DeltaUSecHS /= Elements; - } - return (0); -} - -// Routine to get next size of Indexes -int // return 1 if last number -NextNumb(Word_t *PNumber, // pointer to returned next number - double *PDNumb, // Temp double of above - double DMult, // Multiplier - Word_t MaxNumb) // Max number to return -{ -// Save prev number - double PrevPDNumb = *PDNumb; - double DDiff; - -// Calc next number >= 1.0 beyond previous - do - { - *PDNumb *= DMult; - DDiff = *PDNumb - PrevPDNumb; - - } while (DDiff < 0.5); - -// Return it in integer format - if (DDiff < 100.0) - *PNumber += (Word_t)(DDiff + 0.5); - else - *PNumber = *PDNumb + 0.5; - -// Verify it did not exceed max number - if (*PNumber >= MaxNumb) - { -// it did, so return max - *PNumber = MaxNumb; - return (1); // flag it - } - return (0); // more available -} diff --git a/libjudy/test/Judy1LTime.c b/libjudy/test/Judy1LTime.c deleted file mode 100644 index b85b1990e3..0000000000 --- a/libjudy/test/Judy1LTime.c +++ /dev/null @@ -1,1620 +0,0 @@ -// @(#) $Revision: 4.20 $ $Source: /judy/test/manual/Judy1LTime.c $ -//======================================================================= -// This program measures the performance of a Judy1 and JudyL Array. -// -by- -// Douglas L. Baskins (8/2001) doug@sourcejudy.com -//======================================================================= - -#include // sbrk() -#include // exit() -#include // printf() -#include // pow() -#include // gettimeofday() -#include // for Judy macros J*() - -#ifdef NOINLINE /* this is the 21st century? */ -#define _INLINE_ static -#else -#define _INLINE_ inline -#endif - - -//======================================================================= -// C O M P I L E D: -//======================================================================= -// -// cc -static -O3 Judy1LTime.c -lJudy -lm -// -// the -static is for a little better performace on some platforms -// -// if optional high-resolution timers are desired: -// -// cc -static -O3 -DJU_LINUX_IA32 Judy1LTime.c -lJudy -lm -// -// and read below: -// -//======================================================================= -// T I M I N G M A C R O S -//======================================================================= -// if your machine is one of the supported types in the following header -// file then uncomment this corresponding to what the header file says. -// This will give very high timing resolution. -// -// #define JU_xxxxxxx 1 // read timeit.h -// #define JU_LINUX_IA32 1 // I.E. IA32 Linux -// -#include "timeit.h" // optional for high resolution times - -double DeltaUSec; // Global for remembering delta times - -#ifndef _TIMEIT_H - -// Note: I have found some Linux systems (2.4.18-6mdk) have bugs in the -// gettimeofday() routine. Sometimes the difference of two consective calls -// returns a negative ~2840 microseconds instead of 0 or 1. If you use the -// above #include "timeit.h" and compile with timeit.c and use -// -DJU_LINUX_IA32, that problem will be eliminated. This is because for -// delta times less than .1 sec, the hardware free running timer is used -// instead of gettimeofday(). I have found the negative time problem -// appears about 40-50 times per second with numerous gettimeofday() calls. -// You should just ignore negative times output. - -#define TIMER_vars(T) struct timeval __TVBeg_##T, __TVEnd_##T - -#define STARTTm(T) gettimeofday(&__TVBeg_##T, NULL) - -#define ENDTm(D,T) \ -{ \ - gettimeofday(&__TVEnd_##T, NULL); \ - (D) = (double)(__TVEnd_##T.tv_sec - __TVBeg_##T.tv_sec) * 1E6 + \ - ((double)(__TVEnd_##T.tv_usec - __TVBeg_##T.tv_usec)); \ -} - -#endif // _TIMEIT_H - -//======================================================================= -// M E M O R Y S I Z E M A C R O S -//======================================================================= -// Most mallocs have mallinfo() -// However, the size is an int, so just about worthless in 64 bit -// machines with more than 4Gb ram. But needed on 32 bit machines -// that have more than a 1Gbyte of memory, because malloc stops -// using sbrk() about at that time (runs out of heap -- use mmap()). - -// un-define this if your malloc has mallinfo(); see above - -#define NOMALLINFO 1 - -double DeltaMem; - -#ifndef NOMALLINFO - -#include // mallinfo() - -struct mallinfo malStart; - -#define STARTmem malStart = mallinfo() /* works with some mallocs */ -#define ENDmem \ -{ \ - struct mallinfo malEnd = mallinfo(); \ -/* strange little dance from signed to unsigned to double */ \ - unsigned int _un_int = malEnd.arena - malStart.arena; \ - DeltaMem = _un_int; /* to double */ \ -} - -#else // MALLINFO - -// this usually works for machines with less than 1-2Gb RAM. -// (it does not include memory ACQUIRED by mmap()) - -char *malStart; - -#define STARTmem (malStart = (char *)sbrk(0)) -#define ENDmem \ -{ \ - char *malEnd = (char *)sbrk(0); \ - DeltaMem = malEnd - malStart; \ -} - -#endif // MALLINFO - -//======================================================================= - -// Common macro to handle a failure -#define FAILURE(STR, UL) \ -{ \ -printf( "Error: %s %lu, file='%s', 'function='%s', line %d\n", \ - STR, UL, __FILE__, __FUNCTI0N__, __LINE__); \ -fprintf(stderr, "Error: %s %lu, file='%s', 'function='%s', line %d\n", \ - STR, UL, __FILE__, __FUNCTI0N__, __LINE__); \ - exit(1); \ -} - -// Interations without improvement -// Minimum of 2 loops, maximum of 1000000 -#define MINLOOPS 2 -#define MAXLOOPS 1000000 - -// Maximum or 10 loops with no improvement -#define ICNT 10 - -// Structure to keep track of times -typedef struct MEASUREMENTS_STRUCT -{ - Word_t ms_delta; -} -ms_t , *Pms_t; - -// Specify prototypes for each test routine -int NextNumb(Word_t *PNumber, double *PDNumb, double DMult, - Word_t MaxN); - -Word_t TestJudyIns(void **J1, void **JL, Word_t Seed, Word_t Elems); - -Word_t TestJudyDup(void **J1, void **JL, Word_t Seed, Word_t Elems); - -int TestJudyDel(void **J1, void **JL, Word_t Seed, Word_t Elems); - -Word_t TestJudyGet(void *J1, void *JL, Word_t Seed, Word_t Elems); - -int TestJudyCount(void *J1, void *JL, Word_t LowIndex, Word_t Elems); - -Word_t TestJudyNext(void *J1, void *JL, Word_t LowIndex, Word_t Elems); - -int TestJudyPrev(void *J1, void *JL, Word_t HighIndex, Word_t Elems); - -Word_t TestJudyNextEmpty(void *J1, void *JL, Word_t LowIndex, - Word_t Elems); - -Word_t TestJudyPrevEmpty(void *J1, void *JL, Word_t HighIndex, - Word_t Elems); - -//======================================================================= -// These are LFSF feedback taps for bitwidths of 10..64 sized numbers. -// Tested with Seed=0xc1fc to 35 billion numbers -//======================================================================= - -Word_t StartSeed = 0xc1fc; // default beginning number -Word_t FirstSeed; - -Word_t MagicList[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0..9 - 0x27f, // 10 - 0x27f, // 11 - 0x27f, // 12 - 0x27f, // 13 - 0x27f, // 14 - 0x27f, // 15 - 0x1e71, // 16 - 0xdc0b, // 17 - 0xdc0b, // 18 - 0xdc0b, // 19 - 0xdc0b, // 20 - 0xc4fb, // 21 - 0xc4fb, // 22 - 0xc4fb, // 23 - 0x13aab, // 24 - 0x11ca3, // 25 - 0x11ca3, // 26 - 0x11ca3, // 27 - 0x13aab, // 28 - 0x11ca3, // 29 - 0xc4fb, // 30 - 0xc4fb, // 31 - 0x13aab, // 32 - 0x14e73, // 33 - 0x145d7, // 34 - 0x145f9, // 35 following tested with Seed=0xc1fc to 35 billion numbers - 0x151ed, // 36 .. 41 - 0x151ed, // 37 - 0x151ed, // 38 - 0x151ed, // 39 - 0x151ed, // 40 - 0x146c3, // 41 .. 64 - 0x146c3, // 42 - 0x146c3, // 43 - 0x146c3, // 44 - 0x146c3, // 45 - 0x146c3, // 46 - 0x146c3, // 47 - 0x146c3, // 48 - 0x146c3, // 49 - 0x146c3, // 50 - 0x146c3, // 51 - 0x146c3, // 52 - 0x146c3, // 53 - 0x146c3, // 54 - 0x146c3, // 55 - 0x146c3, // 56 - 0x146c3, // 57 - 0x146c3, // 58 - 0x146c3, // 59 - 0x146c3, // 60 - 0x146c3, // 61 - 0x146c3, // 62 - 0x146c3, // 63 - 0x146c3 // 64 -}; - -// Routine to "mirror" the input data word -static Word_t -Swizzle(Word_t word) -{ -// BIT REVERSAL, Ron Gutman in Dr. Dobb's Journal, #316, Sept 2000, pp133-136 -// - -#ifdef __LP64__ - word = ((word & 0x00000000ffffffff) << 32) | - ((word & 0xffffffff00000000) >> 32); - word = ((word & 0x0000ffff0000ffff) << 16) | - ((word & 0xffff0000ffff0000) >> 16); - word = ((word & 0x00ff00ff00ff00ff) << 8) | - ((word & 0xff00ff00ff00ff00) >> 8); - word = ((word & 0x0f0f0f0f0f0f0f0f) << 4) | - ((word & 0xf0f0f0f0f0f0f0f0) >> 4); - word = ((word & 0x3333333333333333) << 2) | - ((word & 0xcccccccccccccccc) >> 2); - word = ((word & 0x5555555555555555) << 1) | - ((word & 0xaaaaaaaaaaaaaaaa) >> 1); -#else // not __LP64__ - word = ((word & 0x0000ffff) << 16) | ((word & 0xffff0000) >> 16); - word = ((word & 0x00ff00ff) << 8) | ((word & 0xff00ff00) >> 8); - word = ((word & 0x0f0f0f0f) << 4) | ((word & 0xf0f0f0f0) >> 4); - word = ((word & 0x33333333) << 2) | ((word & 0xcccccccc) >> 2); - word = ((word & 0x55555555) << 1) | ((word & 0xaaaaaaaa) >> 1); -#endif // not __LP64__ - - return (word); -} - -double DeltaUSec1 = 0.0; // Global for measuring delta times -double DeltaUSecL = 0.0; // Global for measuring delta times - -Word_t J1Flag = 0; // time Judy1 -Word_t JLFlag = 0; // time JudyL -Word_t dFlag = 0; // time Judy1Unset JudyLDel -Word_t vFlag = 0; // time Searching -Word_t CFlag = 0; // time Counting -Word_t IFlag = 0; // time duplicate inserts/sets -Word_t DFlag = 0; // bit reverse the data stream -Word_t lFlag = 0; // do not do multi-insert tests -Word_t aFlag = 0; // output active memory in array -Word_t SkipN = 0; // default == Random skip -Word_t TValues = 100000; // Maximum retrieve tests for timing -Word_t nElms = 1000000; // Max population of arrays -Word_t ErrorFlag = 0; -Word_t PtsPdec = 40; // measurement points per decade - -// Stuff for LFSR (pseudo random number generator) -Word_t RandomBit = ~0UL / 2 + 1; -Word_t BValue = sizeof(Word_t) * 8; -Word_t Magic; - -// for error routines -- notice misspelling, name conflicts with some compilers -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "Random" - -_INLINE_ Word_t // so INLINING compilers get to look at it. -Random(Word_t newseed) -{ - if (newseed & RandomBit) - { - newseed += newseed; - newseed ^= Magic; - } - else - { - newseed += newseed; - } - newseed &= RandomBit * 2 - 1; - if (newseed == FirstSeed) - FAILURE("LFSR failed", newseed); - return (newseed); -} - -_INLINE_ Word_t // so INLINING compilers get to look at it. -GetNextIndex(Word_t Index) -{ - if (SkipN) - Index += SkipN; - else - Index = Random(Index); - - return (Index); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "main" - -int -main(int argc, char *argv[]) -{ -// Names of Judy Arrays - void *J1 = NULL; // Judy1 - void *JL = NULL; // JudyL - - TIMER_vars(tm1); // declare timer variables - Word_t Count1, CountL; - Word_t Bytes; - - double Mult; - Pms_t Pms; - Word_t Seed; - Word_t PtsPdec = 40; // points per decade - Word_t Groups; // Number of measurement groups - Word_t grp; - Word_t Pop1; - Word_t Meas; - int Col; - - int c; - extern char *optarg; - -//============================================================ -// PARSE INPUT PARAMETERS -//============================================================ - - while ((c = getopt(argc, argv, "n:S:T:P:b:B:dDC1LvIla")) != -1) - { - switch (c) - { - case 'n': // Max population of arrays - nElms = strtoul(optarg, NULL, 0); // Size of Linear Array - if (nElms == 0) - FAILURE("No tests: -n", nElms); - -// Check if more than a trillion (64 bit only) - if ((double)nElms > 1e12) - FAILURE("Too many Indexes=", nElms); - break; - - case 'S': // Step Size, 0 == Random - SkipN = strtoul(optarg, NULL, 0); - break; - - case 'T': // Maximum retrieve tests for timing - TValues = strtoul(optarg, NULL, 0); - break; - - case 'P': // measurement points per decade - PtsPdec = strtoul(optarg, NULL, 0); - break; - - case 'b': // May not work past 35 bits if changed - StartSeed = strtoul(optarg, NULL, 0); - break; - - case 'B': // expanse of data points (random only) - BValue = strtoul(optarg, NULL, 0); - if ((BValue > 64) - || - (MagicList[BValue] == 0) || (BValue > (sizeof(Word_t) * 8))) - { - ErrorFlag++; - printf("\nIllegal number of random bits of %lu !!!\n", - BValue); - } - break; - - case 'v': - vFlag = 1; // time Searching - break; - - case '1': // time Judy1 - J1Flag = 1; - break; - - case 'L': // time JudyL - JLFlag = 1; - break; - - case 'd': // time Judy1Unset JudyLDel - dFlag = 1; - break; - - case 'D': // bit reverse the data stream - DFlag = 1; - break; - - case 'C': // time Counting - CFlag = 1; - break; - - case 'I': // time duplicate insert/set - IFlag = 1; - break; - - case 'l': // do not loop in tests - lFlag = 1; - break; - - case 'a': // output active memory in Judy array - aFlag = 1; - break; - - default: - ErrorFlag++; - break; - } - } - - if (ErrorFlag) - { - printf("\n%s -n# -P# -S# -B# -T# -b # -DCpdI\n\n", argv[0]); - printf("Where:\n"); - printf("-n <#> number of indexes used in tests\n"); - printf("-P <#> number measurement points per decade\n"); - printf("-S <#> index skip amount, 0 = random\n"); - printf("-B <#> # bits (10..%d) in random number generator\n", - (int)sizeof(Word_t) * 8); - printf("-L time JudyL\n"); - printf("-1 time Judy1\n"); - printf("-I time DUPLICATE Ins/Set times\n"); - printf("-C time JudyCount tests\n"); - printf("-v time Judy Search tests\n"); - printf("-d time JudyDel/Unset instead of JudyFreeArray\n"); - printf("-l do not loop on same Indexes\n"); - printf("-T <#> max number indexes in read times - 0 == MAX\n"); - printf("\n"); - - exit(1); - } - -// If none, then both - if (!JLFlag && !J1Flag) - JLFlag = J1Flag = 1; - -// Set number of Random bits in LFSR - RandomBit = 1UL << (BValue - 1); - Magic = MagicList[BValue]; - - if (nElms > ((RandomBit - 2) * 2)) - { - printf - ("# Number = -n%lu of Indexes reduced to max expanse of Random numbers\n", - nElms); - nElms = ((RandomBit - 2) * 2); - } - - printf("# TITLE %s -n%lu -S%lu -T%lu -B%lu -P%lu", - argv[0], nElms, SkipN, TValues, BValue, PtsPdec); - if (J1Flag) - printf(" -1"); - if (JLFlag) - printf(" -L"); - if (DFlag) - printf(" -D"); - if (dFlag) - printf(" -d"); - if (CFlag) - printf(" -C"); - if (IFlag) - printf(" -I"); - if (lFlag) - printf(" -l"); - if (aFlag) - printf(" -a"); - printf("\n"); - - if (sizeof(Word_t) == 8) - printf("#%s 64 Bit version\n", argv[0]); - else if (sizeof(Word_t) == 4) - printf("#%s 32 Bit version\n", argv[0]); - - printf("# XLABEL Population\n"); - printf("# YLABEL Microseconds / Index\n"); - -//============================================================ -// CALCULATE NUMBER OF MEASUREMENT GROUPS -//============================================================ - -// Calculate Multiplier for number of points per decade - Mult = pow(10.0, 1.0 / (double)PtsPdec); - { - double sum; - Word_t numb, prevnumb; - -// Count number of measurements needed (10K max) - sum = numb = 1; - for (Groups = 2; Groups < 10000; Groups++) - { - if (NextNumb(&numb, &sum, Mult, nElms)) break; - } - -// Get memory for measurements - Pms = (Pms_t) calloc(Groups, sizeof(ms_t)); - -// Now calculate number of Indexes for each measurement point - numb = sum = 1; - prevnumb = 0; - for (grp = 0; grp < Groups; grp++) - { - Pms[grp].ms_delta = numb - prevnumb; - prevnumb = numb; - - NextNumb(&numb, &sum, Mult, nElms); - } - } // Groups = number of sizes - -//============================================================ -// PRINT HEADER TO PERFORMANCE TIMERS -//============================================================ - - printf("# COLHEAD 1 Population\n"); - printf("# COLHEAD 2 Measurments\n"); - printf("# COLHEAD 3 J1S\n"); - printf("# COLHEAD 4 JLI\n"); - printf("# COLHEAD 5 J1T\n"); - printf("# COLHEAD 6 JLG\n"); - - Col = 7; - if (IFlag) - { - printf("# COLHEAD %d J1S-dup\n", Col++); - printf("# COLHEAD %d JLI-dup\n", Col++); - } - if (CFlag) - { - printf("# COLHEAD %d J1C\n", Col++); - printf("# COLHEAD %d JLC\n", Col++); - } - if (vFlag) - { - printf("# COLHEAD %d J1N\n", Col++); - printf("# COLHEAD %d JLN\n", Col++); - printf("# COLHEAD %d J1P\n", Col++); - printf("# COLHEAD %d JLP\n", Col++); - printf("# COLHEAD %d J1NE\n", Col++); - printf("# COLHEAD %d JLNE\n", Col++); - printf("# COLHEAD %d J1PE\n", Col++); - printf("# COLHEAD %d JLPE\n", Col++); - } - if (dFlag) - { - printf("# COLHEAD %d J1U\n", Col++); - printf("# COLHEAD %d JLD\n", Col++); - } - printf("# COLHEAD %d J1MU/I\n", Col++); - printf("# COLHEAD %d JLMU/I\n", Col++); - if (aFlag) - { - printf("# COLHEAD %d J1MA/I\n", Col++); - printf("# COLHEAD %d JLMA/I\n", Col++); - } - printf("# COLHEAD %d HEAP/I\n", Col++); - - printf("# %s\n", Judy1MallocSizes); - printf("# %s\n", JudyLMallocSizes); - - printf("# Pop1 Measmts J1S JLI J1T JLG"); - - if (IFlag) - printf(" dupJ1S dupJLI"); - - if (CFlag) - printf(" J1C JLC"); - - if (vFlag) - printf(" J1N JLN J1P JLP J1NE JLNE J1PE JLPE"); - - if (dFlag) - printf(" J1U JLD"); - - printf(" J1MU/I JLMU/I"); - if (aFlag) - { - printf(" J1MA/I JLMA/I"); - } - - printf(" HEAP/I"); - - printf("\n"); - -//============================================================ -// BEGIN TESTS AT EACH GROUP SIZE -//============================================================ - -// Get the kicker to test the LFSR - FirstSeed = Seed = StartSeed & (RandomBit * 2 - 1); - - STARTmem; - for (Pop1 = grp = 0; grp < Groups; grp++) - { - Word_t LowIndex, HighIndex; - Word_t Delta; - Word_t NewSeed; - - Delta = Pms[grp].ms_delta; - -// Test J1S, JLI - NewSeed = TestJudyIns(&J1, &JL, Seed, Delta); - -// Accumulate the Total population of arrays - Pop1 += Delta; - Meas = Pop1; - -// Only test the maximum of TValues if not zero - if (TValues) - Meas = (Pop1 < TValues) ? Pop1 : TValues; - - printf("%10lu %9lu", Pop1, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - -// Test J1T, JLG - - LowIndex = TestJudyGet(J1, JL, FirstSeed, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - -// Test J1T, JLI - duplicates - - if (IFlag) - { - LowIndex = TestJudyDup(&J1, &JL, FirstSeed, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - } - if (CFlag) - { - TestJudyCount(J1, JL, LowIndex, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - } - if (vFlag) - { -// Test J1N, JLN - HighIndex = TestJudyNext(J1, JL, LowIndex, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - -// Test J1P, JLP - TestJudyPrev(J1, JL, HighIndex, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - -// Test J1NE, JLNE - TestJudyNextEmpty(J1, JL, LowIndex, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - -// Test J1PE, JLPE - TestJudyPrevEmpty(J1, JL, HighIndex, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - } - -// Test J1U, JLD - if (dFlag) - { - TestJudyDel(&J1, &JL, FirstSeed, Meas); - printf(" %6.3f", DeltaUSec1); - printf(" %6.3f", DeltaUSecL); - -// Now put them back - TestJudyIns(&J1, &JL, FirstSeed, Meas); - } - -// Advance Index number set - Seed = NewSeed; - -// Print the number of bytes used per Index - printf(" %6.3f", (double)Judy1MemUsed(J1) / (double)Pop1); - printf(" %6.3f", (double)JudyLMemUsed(JL) / (double)Pop1); - if (aFlag) - { - printf(" %6.3f", (double)Judy1MemActive(J1) / (double)Pop1); - printf(" %6.3f", (double)JudyLMemActive(JL) / (double)Pop1); - } - - ENDmem; - printf(" %6.3f", DeltaMem / (double)Pop1); - printf("\n"); - fflush(NULL); // assure data gets to file in case malloc fail - } - - JLC(CountL, JL, 0, -1); // get the counts - J1C(Count1, J1, 0, -1); - - if (JLFlag && J1Flag) - { - if (CountL != Count1) - FAILURE("Judy1/LCount not equal", Count1); - } - - if (Count1) - { - STARTTm(tm1); - J1FA(Bytes, J1); // Free the Judy1 Array - ENDTm(DeltaUSec1, tm1); - DeltaUSec1 /= (double)Count1; - - printf("# Judy1FreeArray: %lu, %0.3f bytes/Index, %0.3f USec/Index\n", - Count1, (double)Bytes / (double)Count1, DeltaUSec1); - } - - if (CountL) - { - STARTTm(tm1); - JLFA(Bytes, JL); // Free the JudyL Array - ENDTm(DeltaUSecL, tm1); - DeltaUSecL /= (double)CountL; - - printf("# JudyLFreeArray: %lu, %0.3f bytes/Index, %0.3f USec/Index\n", - CountL, (double)Bytes / (double)CountL, DeltaUSecL); - } - exit(0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyIns" - -Word_t -TestJudyIns(void **J1, void **JL, Word_t Seed, Word_t Elements) -{ - TIMER_vars(tm1); // declare timer variables - Word_t TstIndex; - Word_t elm; - Word_t *PValue; - Word_t Seed1 = 0; - int Rc; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - - if (Elements < 100) - Loops = (MAXLOOPS / Elements) + MINLOOPS; - else - Loops = 1; - - if (lFlag) - Loops = 1; - -// Judy1Set timings - - if (J1Flag) - { - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - if (lp != 0) - { - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - J1U(Rc, *J1, TstIndex); - } - } - - STARTTm(tm1); - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - J1S(Rc, *J1, TstIndex); - if (Rc == 0) - FAILURE("Judy1Set failed - DUP Index at", elm); - } - ENDTm(DeltaUSec1, tm1); - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - -// JudyLIns timings - - if (JLFlag) - { - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - if (lp != 0) - { - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - JLD(Rc, *JL, TstIndex); - } - } - - STARTTm(tm1); - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - JLI(PValue, *JL, TstIndex); - if (*PValue == TstIndex) - FAILURE("JudyLIns failed - DUP Index", TstIndex); - - *PValue = TstIndex; // save Index in Value - } - ENDTm(DeltaUSecL, tm1); - DeltaUSecL /= Elements; - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - } - return (Seed1); // New seed -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyDup" - -Word_t -TestJudyDup(void **J1, void **JL, Word_t Seed, Word_t Elements) -{ - TIMER_vars(tm1); // declare timer variables - Word_t LowIndex = ~0UL; - Word_t TstIndex; - Word_t elm; - Word_t *PValue; - Word_t Seed1; - int Rc; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - - if (J1Flag) - { - LowIndex = ~0UL; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - STARTTm(tm1); - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (TstIndex < LowIndex) - LowIndex = TstIndex; - - J1S(Rc, *J1, TstIndex); - if (Rc != 0) - FAILURE("Judy1Test Rc != 0", (Word_t)Rc); - } - ENDTm(DeltaUSec1, tm1); - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - - icnt = ICNT; - - if (JLFlag) - { - LowIndex = ~0UL; - for (DDel = 1e40, lp = 0; lp < Loops; lp++) - { - STARTTm(tm1); - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (TstIndex < LowIndex) - LowIndex = TstIndex; - - JLI(PValue, *JL, TstIndex); - if (PValue == (Word_t *)NULL) - FAILURE("JudyLGet ret PValue = NULL", 0L); - if (*PValue != TstIndex) - FAILURE("JudyLGet ret wrong Value at", elm); - } - ENDTm(DeltaUSecL, tm1); - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecL = DDel / (double)Elements; - } - - return (LowIndex); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyGet" - -Word_t -TestJudyGet(void *J1, void *JL, Word_t Seed, Word_t Elements) -{ - TIMER_vars(tm1); // declare timer variables - Word_t LowIndex = ~0UL; - Word_t TstIndex; - Word_t elm; - Word_t *PValue; - Word_t Seed1; - int Rc; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - - if (J1Flag) - { - LowIndex = ~0UL; - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - STARTTm(tm1); - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (TstIndex < LowIndex) - LowIndex = TstIndex; - - J1T(Rc, J1, TstIndex); - if (Rc != 1) - FAILURE("Judy1Test Rc != 1", (Word_t)Rc); - } - ENDTm(DeltaUSec1, tm1); - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - - icnt = ICNT; - - if (JLFlag) - { - LowIndex = ~0UL; - for (DDel = 1e40, lp = 0; lp < Loops; lp++) - { - STARTTm(tm1); - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - if (TstIndex < LowIndex) - LowIndex = TstIndex; - - JLG(PValue, JL, TstIndex); - if (PValue == (Word_t *)NULL) - FAILURE("JudyLGet ret PValue = NULL", 0L); - if (*PValue != TstIndex) - FAILURE("JudyLGet ret wrong Value at", elm); - } - ENDTm(DeltaUSecL, tm1); - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecL = DDel / (double)Elements; - } - - return (LowIndex); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyCount" - -int -TestJudyCount(void *J1, void *JL, Word_t LowIndex, Word_t Elements) -{ - TIMER_vars(tm1); // declare timer variables - Word_t elm; - Word_t Count1, CountL; - Word_t TstIndex = LowIndex; - int Rc; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - - if (J1Flag) - { - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - TstIndex = LowIndex; - STARTTm(tm1); - for (elm = 0; elm < Elements; elm++) - { - J1C(Count1, J1, LowIndex, TstIndex); - - if (Count1 != (elm + 1)) - FAILURE("J1C at", elm); - - J1N(Rc, J1, TstIndex); - } - ENDTm(DeltaUSec1, tm1); - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - - if (JLFlag) - { - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - TstIndex = LowIndex; - STARTTm(tm1); - for (elm = 0; elm < Elements; elm++) - { - Word_t *PValue; - - JLC(CountL, JL, LowIndex, TstIndex); - - if (CountL != (elm + 1)) - FAILURE("JLC at", elm); - - JLN(PValue, JL, TstIndex); - } - ENDTm(DeltaUSecL, tm1); - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecL = DDel / (double)Elements; - } - - return (0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyNext" - -Word_t -TestJudyNext(void *J1, void *JL, Word_t LowIndex, Word_t Elements) -{ - TIMER_vars(tm1); // declare timer variables - Word_t elm; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - Word_t Jindex; - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - - if (J1Flag) - { - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - int Rc; - Jindex = LowIndex; - - STARTTm(tm1); - J1F(Rc, J1, Jindex); - - for (elm = 0; elm < Elements; elm++) - { - if (Rc != 1) - FAILURE("Judy1Next Rc != 1 =", (Word_t)Rc); - - J1N(Rc, J1, Jindex); // Get next one - } - ENDTm(DeltaUSec1, tm1); - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - - if (JLFlag) - { - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - Word_t *PValue; - -// Get an Index low enough for Elements - Jindex = LowIndex; - - STARTTm(tm1); - JLF(PValue, JL, Jindex); - - for (elm = 0; elm < Elements; elm++) - { - if (PValue == NULL) - FAILURE("JudyLNext ret NULL PValue at", elm); - - JLN(PValue, JL, Jindex); // Get next one - } - ENDTm(DeltaUSecL, tm1); - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecL = DDel / (double)Elements; - } - -// perhaps a check should be done here -- if I knew what to expect. - return (Jindex); // return last one -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyPrev" - -int -TestJudyPrev(void *J1, void *JL, Word_t HighIndex, Word_t Elements) -{ - TIMER_vars(tm1); // declare timer variables - Word_t elm; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - - if (J1Flag) - { - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - Word_t J1index = HighIndex; - int Rc; - - STARTTm(tm1); - J1L(Rc, J1, J1index); - - for (elm = 0; elm < Elements; elm++) - { - if (Rc != 1) - FAILURE("Judy1Prev Rc != 1 =", (Word_t)Rc); - - J1P(Rc, J1, J1index); // Get previous one - } - ENDTm(DeltaUSec1, tm1); - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - - if (JLFlag) - { - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - Word_t *PValue; - Word_t JLindex = HighIndex; - - STARTTm(tm1); - JLL(PValue, JL, JLindex); - - for (elm = 0; elm < Elements; elm++) - { - if (PValue == NULL) - FAILURE("JudyLPrev ret NULL PValue at", elm); - - JLP(PValue, JL, JLindex); // Get previous one - } - ENDTm(DeltaUSecL, tm1); - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecL = DDel / (double)Elements; - } - -// perhaps a check should be done here -- if I knew what to expect. - return (0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyNextEmpty" - -// Returns number of consecutive Indexes -Word_t -TestJudyNextEmpty(void *J1, void *JL, Word_t LowIndex, Word_t Elements) -{ - TIMER_vars(tm1); // declare timer variables - Word_t elm; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - int Rc; // Return code - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - - if (J1Flag) - { - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - Word_t Seed1 = LowIndex; - - STARTTm(tm1); - for (elm = 0; elm < Elements; elm++) - { - Word_t J1index; - J1index = Seed1; - -// Find next Empty Index, J1index is modified by J1NE - J1NE(Rc, J1, J1index); // Rc = Judy1NextEmpty(J1, &J1index,PJE0) - - if (Rc != 1) - FAILURE("Judy1NextEmpty Rcode != 1 =", (Word_t)Rc); - - Seed1 = GetNextIndex(Seed1); - } - ENDTm(DeltaUSec1, tm1); - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - - if (JLFlag) - { - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - Word_t Seed1 = LowIndex; - - STARTTm(tm1); - for (elm = 0; elm < Elements; elm++) - { - Word_t JLindex; - JLindex = Seed1; - -// Find next Empty Index, JLindex is modified by JLNE - JLNE(Rc, JL, JLindex); // Rc = JudyLNextEmpty(JL, &JLindex,PJE0) - - if (Rc != 1) - FAILURE("JudyLNextEmpty Rcode != 1 =", (Word_t)Rc); - - Seed1 = GetNextIndex(Seed1); - } - ENDTm(DeltaUSecL, tm1); - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecL = DDel / (double)Elements; - } - - return (0); -} - -// Routine to time and test JudyPrevEmpty routines - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyPrevEmpty" - -Word_t -TestJudyPrevEmpty(void *J1, void *JL, Word_t HighIndex, Word_t Elements) -{ - TIMER_vars(tm1); // declare timer variables - Word_t elm; - - double DDel; - Word_t icnt; - Word_t lp; - Word_t Loops; - int Rc; - - Loops = (MAXLOOPS / Elements) + MINLOOPS; - - if (J1Flag) - { - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - Word_t Seed1 = HighIndex; - - STARTTm(tm1); - for (elm = 0; elm < Elements; elm++) - { - Word_t J1index; - J1index = Seed1; - - J1PE(Rc, J1, J1index); // Rc = Judy1PrevEmpty(J1, &J1index,PJE0) - - if (Rc != 1) - FAILURE("Judy1PrevEmpty Rc != 1 =", (Word_t)Rc); - - Seed1 = GetNextIndex(Seed1); - } - ENDTm(DeltaUSec1, tm1); - - if (DDel > DeltaUSec1) - { - icnt = ICNT; - DDel = DeltaUSec1; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSec1 = DDel / (double)Elements; - } - - if (JLFlag) - { - for (DDel = 1e40, icnt = ICNT, lp = 0; lp < Loops; lp++) - { - Word_t Seed1 = HighIndex; - - STARTTm(tm1); - for (elm = 0; elm < Elements; elm++) - { - Word_t JLindex; - JLindex = Seed1; - -// Find next Empty Index, JLindex is modified by JLPE - JLPE(Rc, JL, JLindex); // Rc = JudyLPrevEmpty(JL, &JLindex,PJE0) - - if (Rc != 1) - FAILURE("JudyLPrevEmpty Rcode != 1 =", (Word_t)Rc); - - Seed1 = GetNextIndex(Seed1); - } - ENDTm(DeltaUSecL, tm1); - - if (DDel > DeltaUSecL) - { - icnt = ICNT; - DDel = DeltaUSecL; - } - else - { - if (--icnt == 0) - break; - } - } - DeltaUSecL = DDel / (double)Elements; - } - - return (0); -} - -#undef __FUNCTI0N__ -#define __FUNCTI0N__ "TestJudyDel" - -int -TestJudyDel(void **J1, void **JL, Word_t Seed, Word_t Elements) -{ - TIMER_vars(tm1); // declare timer variables - Word_t TstIndex; - Word_t elm; - Word_t Seed1; - int Rc; - - if (J1Flag) - { - STARTTm(tm1); - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - J1U(Rc, *J1, TstIndex); - if (Rc != 1) - FAILURE("Judy1Unset ret Rcode != 1", (Word_t)Rc); - } - ENDTm(DeltaUSec1, tm1); - DeltaUSec1 /= Elements; - } - - STARTTm(tm1); - if (JLFlag) - { - for (Seed1 = Seed, elm = 0; elm < Elements; elm++) - { - Seed1 = GetNextIndex(Seed1); - - if (DFlag) - TstIndex = Swizzle(Seed1); - else - TstIndex = Seed1; - - JLD(Rc, *JL, TstIndex); - if (Rc != 1) - FAILURE("JudyLDel ret Rcode != 1", (Word_t)Rc); - } - ENDTm(DeltaUSecL, tm1); - DeltaUSecL /= Elements; - } - return (0); -} - -// Routine to get next size of Indexes -int // return 1 if last number -NextNumb(Word_t *PNumber, // pointer to returned next number - double *PDNumb, // Temp double of above - double DMult, // Multiplier - Word_t MaxNumb) // Max number to return -{ -// Save prev number - double PrevPDNumb = *PDNumb; - double DDiff; - -// Calc next number >= 1.0 beyond previous - do { - *PDNumb *= DMult; - DDiff = *PDNumb - PrevPDNumb; - - } while (DDiff < 0.5); - -// Return it in integer format - if (DDiff < 100.0) *PNumber += (Word_t)(DDiff + 0.5); - else *PNumber = *PDNumb + 0.5; - -// Verify it did not exceed max number - if (*PNumber >= MaxNumb) - { -// it did, so return max - *PNumber = MaxNumb; - return (1); // flag it - } - return (0); // more available -} diff --git a/libjudy/test/JudyString.c b/libjudy/test/JudyString.c deleted file mode 100644 index 7f1fca9a52..0000000000 --- a/libjudy/test/JudyString.c +++ /dev/null @@ -1,106 +0,0 @@ -#include -#include -#include - -#include - -#define MAXLENSTR 1000000 - -char Index[MAXLENSTR]; // string to store. - -Pvoid_t PJHArray = (PWord_t)NULL; // Judy array. - -// By Doug Baskins Apr 2004 - for JudyHS man page -- but too long - -int // Usage: JudyString file_to_store -main(int argc, char *argv[]) -{ - Pvoid_t PJHArray = (PWord_t)NULL; // Judy array. - PWord_t PValue; // Judy array element. - Word_t Bytes; // size of JudySL array. - Word_t Len; // length of string - FILE *fid = NULL; // stream id - int Chr; // next char - long Lines; // number of lines input file - Word_t Dups; // Count duplicate lines - - if (argc < 2) - { - printf("Must supply input file in arg\n"); - exit(2); - } - if ((fid = fopen(argv[1], "r")) == NULL) - { - printf("Failed to open '%s'\n", argv[1]); - exit(2); - } - printf("Open '%s' and store strings in JudyHS array\n", argv[1]); - - Lines = 0; - Len = 0; - Dups = 0; - while ((Chr = fgetc(fid)) != EOF) - { - if (Chr == '\n' && Len) - { - Index[Len] = '\0'; - -//printf("%3lu,%lu: %s\n", Lines, Len, Index); -//printf("%s\n", Index); - - JHSI(PValue, PJHArray, Index, Len); // store string into array - if (*PValue != 0) Dups++; - *PValue += 1; - Lines++; - Len = 0; - } - else if (Len < MAXLENSTR) - { - Index[Len] = Chr; - Len++; - } - } - - fclose(fid); - fid = NULL; - - printf("'%s' has %lu lines, %lu duplicate lines\n", argv[1], Lines, Dups); - - printf("Re-open '%s' and verify each string is in JudyHS array\n", argv[1]); - - if ((fid = fopen(argv[1], "r")) == NULL) - { - printf("Failed to re-open '%s'\n", argv[1]); - exit(2); - } - - Lines = 0; - Len = 0; - while ((Chr = fgetc(fid)) != EOF) - { - if (Len < MAXLENSTR) Index[Len] = Chr; - - if (Chr == '\n' && Len) - { - Index[Len] = '\0'; - - JHSG(PValue, PJHArray, Index, Len); // store string into array - if (PValue == NULL) - { - printf("'%s'\n", Index); - printf("JHSG() failed at Line %lu\n", Lines); - exit(1); - } - Len = 0; - Lines++; - } - else Len++; - } - - printf("Begin JHSFA (JudyHSFreeArray)\n"); - - JHSFA(Bytes, PJHArray); // free array - - fprintf(stderr, "JHSFA() free'ed %lu bytes of memory\n", Bytes); - return (0); -} diff --git a/libjudy/test/Makefile.am b/libjudy/test/Makefile.am deleted file mode 100644 index 1b3256d54f..0000000000 --- a/libjudy/test/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -EXTRA_DIST = $(TESTS) - -TEST_ENVIRONMENT = top_builddir=$(top_builddir) - -TESTS = Checkit - -DISTCLEANFILES = .deps Makefile -CLEANFILES = Judy1LHCheck Judy1LHTime Makefile SL_Hash SL_Judy SL_Redblack SL_Splay diff --git a/libjudy/test/Makefile.in b/libjudy/test/Makefile.in deleted file mode 100644 index 5e9cc7f31d..0000000000 --- a/libjudy/test/Makefile.in +++ /dev/null @@ -1,408 +0,0 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = test -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FLAVOR = @FLAVOR@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -VERSION_INFO = @VERSION_INFO@ -WARN_CFLAGS = @WARN_CFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -EXTRA_DIST = $(TESTS) -TEST_ENVIRONMENT = top_builddir=$(top_builddir) -TESTS = Checkit -DISTCLEANFILES = .deps Makefile -CLEANFILES = Judy1LHCheck Judy1LHTime Makefile SL_Hash SL_Judy SL_Redblack SL_Splay -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu test/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ - srcdir=$(srcdir); export srcdir; \ - list=' $(TESTS) '; \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *$$ws$$tst$$ws*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - echo "XPASS: $$tst"; \ - ;; \ - *) \ - echo "PASS: $$tst"; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *$$ws$$tst$$ws*) \ - xfail=`expr $$xfail + 1`; \ - echo "XFAIL: $$tst"; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - echo "FAIL: $$tst"; \ - ;; \ - esac; \ - else \ - skip=`expr $$skip + 1`; \ - echo "SKIP: $$tst"; \ - fi; \ - done; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="All $$all tests passed"; \ - else \ - banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ - fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all tests failed"; \ - else \ - banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ - fi; \ - fi; \ - dashes="$$banner"; \ - skipped=""; \ - if test "$$skip" -ne 0; then \ - skipped="($$skip tests were not run)"; \ - test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$skipped"; \ - fi; \ - report=""; \ - if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ - report="Please report to $(PACKAGE_BUGREPORT)"; \ - test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$report"; \ - fi; \ - dashes=`echo "$$dashes" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes"; \ - test "$$failed" -eq 0; \ - else :; fi - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) - -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 - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -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 - -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 - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-TESTS check-am clean clean-generic \ - clean-libtool distclean distclean-generic distclean-libtool \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/libjudy/test/README b/libjudy/test/README deleted file mode 100644 index 2176d1abdd..0000000000 --- a/libjudy/test/README +++ /dev/null @@ -1,22 +0,0 @@ -StringCompare.c Program to compare JudyHS with other ADT's -Centrino_1.3Mhz_Plots/ Contains output of "StringCompare" on 1.3Mhz Centrino -Checkit Script to validate Judy works before installing -Judy1LHCheck.c Updated to include JudyHS() -Judy1LHTime.c Updated to include JudyHS() -jbgraph Script interface to 'gnuplot' to plot output of *Time.c progs. -testjbgraph Demo script to show how to use jbgraph (1+ Minute) -malloc-pre2.8a.c Only known malloc() (my me) that does not have performance - problem, See: for later version. - See: for further - information. -JudyMalloc.c For testing Judy free()s all memory that it malloc()ed. -CheckDupLines.c For the JudyHS manual example -JudyString.c For the JudyHS manual, but too long - --- The following are obsolete. - -Judy1LCheck.c Program to test functionality of Judy API. (obsolete) -Judy1LTime.c Program to time common Judy functions. (obsolete) -SLcompare.c Program to compare JudySL performance with others (obsolete) -timeit.c High resolution timers for certain platforms (obsolete) -timeit.h High resolution timers for certain platforms (obsolete) diff --git a/libjudy/test/SLcompare.c b/libjudy/test/SLcompare.c deleted file mode 100644 index 6e39ca6af1..0000000000 --- a/libjudy/test/SLcompare.c +++ /dev/null @@ -1,1079 +0,0 @@ -// @(#) $Revision: 4.1 $ $Source: /judy/test/manual/SLcompare.c $ -//======================================================================= -// Author Douglas L. Baskins, June 2002. -// Permission to use this code is freely granted, provided that this -// statement is retained. -// email - doug@sourcejudy.com -//======================================================================= - -// Compile for choice of algorithm: - -// cc -static -O -o Judy -DJUDYMETHOD SLcompare.c -lJudy -// cc -static -O -o Hash -DHASHMETHOD SLcompare.c -// cc -static -O -o Splay -DSPLAYMETHOD SLcompare.c -// cc -static -O -o Redblack -DREDBLACKMETHOD SLcompare.c -// -// Note: -static will generally get better performance because string -// routines are slower with shared librarys. -// -// Usage: -// -// Judy -// Hash -// Splay -// Redblack -/* - -This program will give you a chance to measure the speed/space -performance of 4 different string store/lookup algorithms on your data -set. All are very fast and generally can scale to very large data sets. -The memory efficiency is usually best with the Judy algorithm because it -uses the opportunity to compress data in a digital tree. The Hashing is -generally the fastest algorithm, however it looses its advantage when -the number of stored exceeds about 5X the size of the hash table. -Many thanks to J. Zobel for supplying the code for Hash, Splay and -Redblack algorithms. - -I will be including more algorithms as people donate code for testing. - -The Judy code is available at: -9/2002 (dlb). - -This is the output of this program when run on a 750Mhz P3 laptop. - -This output is using a file available from www.google.com. It looks -like 'http' web pages and was one of the files used in a March 2002 -contest by www.google.com - - wc google/data/repos.00 - 3440314 14613027 162822437 google/data/repos.00 - - lines avg_linelen getline stored RAMused/line store/ln lookup/ln ADT - 2807737 58.0 byts 0.856 uS 1455201 104.0 byts 4.859 uS 4.566 uS SPLAY - 2807737 58.0 byts 0.862 uS 1455201 96.0 byts 2.523 uS 2.101 uS HASH - 2807737 58.0 byts 0.856 uS 1455201 104.0 byts 4.601 uS 4.001 uS REDBLK - 2807737 58.0 byts 0.875 uS 1455201 78.7 byts 3.898 uS 2.687 uS JUDY - -With = 1.46 million lines stored and 2.81 million non-blank lines, -all the algorithms seem to keep their performance. The hash table is a -perfect size for this data set. I suspect only the HASH algorithm will -slow down with larger data sets unless the hash table is increased larger -than 2**20 million entrys. I have now tried a data set with about 10 -million unique lines on a 64 bit machine (google/data/repos.*). -The speeds are about the same. Lookup times are in the 2-4 uSec range -and this is probably insignificant compared to the application needing -the data. I think all four methods are fine for speed, and Judy is a -standout for its memory efficiency -- frequently using less memory than -the strings alone. - -I plan on tuning JudySL in the near future. This should improve the -performance of JudySL with short (a text word) strings. I have a data -base of all (28.8 million) domain names on the internet as a test case. - -wc /data/domnames.txt -28826508 28826508 488227095 /data/domnames.txt - -For the curious, JudySL (I.E JSLI/G macros in this program) is simply an -application subroutine that uses JudyL to the work. JudyL is a very -scaleable word to word (or pointer) mapper. JudySL is implemented as a -digital tree using JudyL arrays as 2^32 (or 2^64 in 64 bit machines) -wide (virtual) nodes. Each level in the digital tree decodes the next 4 -(or 8) bytes of the line/string until only one entry would be in the -node. Then the remaining undecoded portion of the line is stored as a -string from the parent node. A digital tree does not need rotation or -balancing. In practice, digital trees are rarely use because of their -poor memory efficiency in the nodes and a tendency to have large depths. -These problems are solved in the Judy algorithm. For more details see -application notes on: www.sourcejudy.com. And for the really curious, -a technical paper is available in the application section. If you would -like to be a reviewer, contact Doug Baskins at - -*/ - -#include -#include -#include // printf -#include -#include -#include // errno -#include // mmap() -#include // stat() -#include // gettimeofday() - -// remove all uses of this in production code. -int gDupCnt = 0; // counter for duplicate strings - -//======================================================================= -// T I M I N G M A C R O S -//======================================================================= -// if your machine is one of the supported types in the following header -// file then uncomment this corresponding to what the header file says. -// This will give very high timing resolution. -// -// #define JU_xxxxxxx 1 // read timeit.h -// #define JU_LINUX_IA32 1 // I.E. IA32 Linux -// -// -// optional for high resolution times and compile with timeit.c -// cc -static -O -o Judy -DJUDYMETHOD SLcompare.c timeit.c -lJudy -// -//#include "timeit.h" - -double DeltaUSec; // Global for remembering delta times - -#ifndef _TIMEIT_H - -// Note: I have found some Linux systems (2.4.18-6mdk) to have bugs in the -// gettimeofday() routine. Sometimes it returns a negative ~2840 microseconds -// instead of 0 or 1. If you use the above #include "timeit.h" and compile with -// timeit.c and use -DJU_LINUX_IA32, that problem will be eliminated. This is -// because for delta times less than .1 sec, the hardware free running timer -// is used instead of gettimeofday(). I have found the negative time problem -// appears about 40-50 times per second with consecutive gettimeofday() calls. - -#define TIMER_vars(T) struct timeval __TVBeg_##T, __TVEnd_##T - -#define STARTTm(T) gettimeofday(&__TVBeg_##T, NULL) - -#define ENDTm(D,T) \ -{ \ - gettimeofday(&__TVEnd_##T, NULL); \ - (D) = (double)(__TVEnd_##T.tv_sec - __TVBeg_##T.tv_sec) * 1E6 + \ - ((double)(__TVEnd_##T.tv_usec - __TVBeg_##T.tv_usec)); \ -} - -#endif // _TIMEIT_H - -//======================================================================= -// M E M O R Y S I Z E M A C R O S -//======================================================================= -// Most mallocs have mallinfo() - -// define this if your malloc does not have mallinfo(); -#define NOMALLINFO 1 - -double DeltaMem; // for remembering - -#ifndef NOMALLINFO - -#include // mallinfo() - -struct mallinfo malStart; - -#define STARTmem malStart = mallinfo() /* works with some mallocs */ -#define ENDmem \ -{ \ - struct mallinfo malEnd = mallinfo(); \ -/* strange little dance from signed to unsigned to double */ \ - unsigned int _un_int = malEnd.arena - malStart.arena; \ - DeltaMem = _un_int; /* to double */ \ -} - -#else // MALLINFO - -// this usually works for machines with less than 1-2Gb RAM. -// (it does not include memory ACQUIRED by mmap()) - -char *malStart; - -#define STARTmem (malStart = (char *)sbrk(0)) -#define ENDmem \ -{ \ - char *malEnd = (char *)sbrk(0); \ - DeltaMem = malEnd - malStart; \ -} - -#endif // MALLINFO - - -//======================================================================= -// G E T S T R I N G F R O M mmap() F I L E M A C R O -//======================================================================= -// -// From memory map POINTER store next '\n' terminated string to BUFFER -// Delete spaces, tabs, returns and resulting blank lines. - -// POINTER must be check to be within memory mapped file range -// -// NOTE: This code will core-dump if a corrupt text file because -// POINTER is not checked to exceed end of file. - -#define MAXLINE 10000 // max length line - -#define GETLINE(BUFFER,POINTER) \ -{ \ - char _chr; \ - int _count = 0; \ - for (;;) /* forever */ \ - { \ - switch (_chr = *POINTER++) \ - { \ - case ' ': /* eat spaces */ \ - case '\t': /* eat tabs */ \ - case '\r': /* eat returns */ \ - continue; \ - case '\n': /* eat blank lines */ \ - if (_count == 0) continue; \ - case '\0': /* Done */ \ - BUFFER[_count++] = '\0'; \ - break; \ - default: /* copy char */ \ - if (_count == (MAXLINE - 1)) \ - { /* cut into 2 lines */ \ - BUFFER[_count++] = '\0'; \ - POINTER--; \ - break; \ - } \ - BUFFER[_count++] = _chr; \ - continue; \ - } \ - break; \ - } \ -} - - -//======================================================================= -// J U D Y M E T H O D -//======================================================================= - -#ifdef JUDYMETHOD -#define ADTMETHOD "JUDY" - -#include - -#define MEMOVD 0 /* no overhead in Judy */ -#define INITARRAY Pvoid_t JudyArray = NULL - -// store string into array -#define STORESTRING(STRING) \ -{ \ - PWord_t _PValue; \ - JSLI(_PValue, JudyArray, (uint8_t *) STRING); \ - if (++(*_PValue) != 1) gDupCnt++; /* count dup strings */ \ -} - -// get pointer to Value associated with string - -#define GETSTRING(STRING) \ -{ \ - PWord_t _PValue; \ - JSLG(_PValue, JudyArray, (uint8_t *) STRING); \ - if (_PValue == NULL) /* not found -- bug */ \ - { \ - printf("GETSTRING failed(Judy) -- BUG!\n\n"); \ - exit(1); \ - } \ -} - -#endif // JUDYMETHOD - -// Note: this optimization by J. Zobel should not be necessary -// with the -static compile option (linux). (dlb) - -#ifdef SLOW_STRCMP -int -scmp(char *s1, char *s2) -{ - while (*s1 != '\0' && *s1 == *s2) - { - s1++; - s2++; - } - return (*s1 - *s2); -} -#else // ! SLOW_STRCMP - -#define scmp strcmp - -#endif // ! SLOW_STRCMP - -//======================================================================= -// H A S H M E T H O D -//======================================================================= - -#ifdef HASHMETHOD -#define ADTMETHOD "HASH" - -#define MEMOVD (sizeof(ht)) /* the hash table is overhead */ - -#define STORESTRING(STRING) hashinsert(ht, STRING) - -#define GETSTRING(STRING) \ -{ \ - HASHREC *_return; \ - _return = hashsearch(ht, STRING); \ - if (_return == NULL) /* not found -- bug */ \ - { \ - printf("GETSTRING(hash) failed -- BUG!\n\n"); \ - exit(1); \ - } \ -} - -/* Author J. Zobel, April 2001. - Permission to use this code is freely granted, provided that this - statement is retained. */ - -#define TSIZE (1LU << 20) /* many processors need this to be a pwr of 2 */ -#define SEED 1159241 -#define HASHFN bitwisehash - -#define INITARRAY static HASHREC *ht[TSIZE] -#define SIZEOFINIT sizeof(ht[TSIZE]) - -typedef struct hashrec -{ - char *word; - struct hashrec *next; -} -HASHREC; - -/* Bitwise hash function. Note that tsize does not have to be prime. */ -unsigned int -bitwisehash(char *word, int tsize, unsigned int seed) -{ - char c; - unsigned int h; - - h = seed; - for (; (c = *word) != '\0'; word++) - { - h ^= ((h << 5) + c + (h >> 2)); - } - return ((unsigned int)((h & 0x7fffffff) % tsize)); -} - -#ifdef notdef // not needed if a static definition used in UNIX -/* Create hash table, initialise ptrs to NULL */ -HASHREC ** -inithashtable() -{ - int i; - HASHREC **ht; - - ht = (HASHREC **) malloc(sizeof(HASHREC *) * TSIZE); - - for (i = 0; i < TSIZE; i++) - ht[i] = (HASHREC *) NULL; - - return (ht); -} -#endif // notdef - -/* Search hash table for given string, return record if found, else NULL */ -HASHREC * -hashsearch(HASHREC ** ht, char *w) -{ - HASHREC *htmp, *hprv; - unsigned int hval = HASHFN(w, TSIZE, SEED); - - for (hprv = NULL, htmp = ht[hval]; - htmp != NULL && scmp(htmp->word, w) != 0; - hprv = htmp, htmp = htmp->next) - { - ; - } - - if (hprv != NULL && htmp != NULL) /* move to front on access */ - { - hprv->next = htmp->next; - htmp->next = ht[hval]; - ht[hval] = htmp; - } - - return (htmp); -} - -/* Search hash table for given string, insert if not found */ -void -hashinsert(HASHREC ** ht, char *w) -{ - HASHREC *htmp, *hprv; - unsigned int hval = HASHFN(w, TSIZE, SEED); - - for (hprv = NULL, htmp = ht[hval]; - htmp != NULL && scmp(htmp->word, w) != 0; - hprv = htmp, htmp = htmp->next) - { - ; - } - - if (htmp == NULL) - { - htmp = (HASHREC *) malloc(sizeof(HASHREC)); - htmp->word = (char *)malloc(strlen(w) + 1); - strcpy(htmp->word, w); - htmp->next = NULL; - if (hprv == NULL) - ht[hval] = htmp; - else - hprv->next = htmp; - - /* new records are not moved to front */ - } - else - { - if (hprv != NULL) /* move to front on access */ - { - hprv->next = htmp->next; - htmp->next = ht[hval]; - ht[hval] = htmp; - } - gDupCnt++; /* count duplicate strings */ - } - - return; -} - -#endif // HASHMETHOD - -//======================================================================= -// S P L A Y M E T H O D -//======================================================================= - -#ifdef SPLAYMETHOD -#define ADTMETHOD "SPLAY" - -#define MEMOVD 0 /* not enough overhead to count */ - -/* Author J. Zobel, April 2001. - Permission to use this code is freely granted, provided that this - statement is retained. */ - -#define ROTATEFAC 11 - -typedef struct wordrec -{ - char *word; - struct wordrec *left, *right; - struct wordrec *par; -} -TREEREC; - -typedef struct ansrec -{ - struct wordrec *root; - struct wordrec *ans; -} -ANSREC; - -#define ONELEVEL(PAR,CURR,DIR,RID) \ - { \ - PAR->DIR = CURR->RID; \ - if(PAR->DIR!=NULL) \ - PAR->DIR->PAR = PAR; \ - CURR->RID = PAR; \ - PAR->PAR = CURR; \ - CURR->PAR = NULL; \ - } - -#define ZIGZIG(GPAR,PAR,CURR,DIR,RID) \ - { \ - CURR->PAR = GPAR->PAR; \ - if (CURR->PAR != NULL) \ - { \ - if (CURR->PAR->DIR == GPAR) \ - CURR->PAR->DIR = CURR; \ - else \ - CURR->PAR->RID = CURR; \ - } \ - GPAR->DIR = PAR->RID; \ - if (GPAR->DIR != NULL) \ - GPAR->DIR->PAR = GPAR; \ - PAR->DIR = CURR->RID; \ - if (CURR->RID != NULL) \ - CURR->RID->PAR = PAR; \ - CURR->RID = PAR; \ - PAR->PAR = CURR; \ - PAR->RID = GPAR; \ - GPAR->PAR = PAR; \ - } - -#define ZIGZAG(GPAR,PAR,CURR,DIR,RID) \ - { \ - CURR->PAR = GPAR->PAR; \ - if (CURR->PAR != NULL) \ - { \ - if (CURR->PAR->DIR == GPAR) \ - CURR->PAR->DIR = CURR; \ - else \ - CURR->PAR->RID = CURR; \ - } \ - PAR->RID = CURR->DIR; \ - if (PAR->RID != NULL) \ - PAR->RID->PAR = PAR; \ - GPAR->DIR = CURR->RID; \ - if (GPAR->DIR != NULL) \ - GPAR->DIR->PAR = GPAR; \ - CURR->DIR = PAR; \ - PAR->PAR = CURR; \ - CURR->RID = GPAR; \ - GPAR->PAR = CURR; \ - } - -int scount = ROTATEFAC; - -/* Search for word in a splay tree. If word is found, bring it to - root, possibly intermittently. Structure ans is used to pass - in the root, and to pass back both the new root (which may or - may not be changed) and the looked-for record. */ -void -splaysearch(ANSREC * ans, char *word) -{ - TREEREC *curr = ans->root, *par, *gpar; - int val; - - scount--; - - if (ans->root == NULL) - { - ans->ans = NULL; - return; - } - while (curr != NULL && (val = scmp(word, curr->word)) != 0) - { - if (val > 0) - curr = curr->right; - else - curr = curr->left; - } - - ans->ans = curr; - - if (curr == ans->root) - { - return; - } - - if (scount <= 0 && curr != NULL) /* Move node towards root */ - { - scount = ROTATEFAC; - - while ((par = curr->par) != NULL) - { - if (par->left == curr) - { - if ((gpar = par->par) == NULL) - { - ONELEVEL(par, curr, left, right); - } - else if (gpar->left == par) - { - ZIGZIG(gpar, par, curr, left, right); - } - else - { - ZIGZAG(gpar, par, curr, right, left); - } - } - else - { - if ((gpar = par->par) == NULL) - { - ONELEVEL(par, curr, right, left); - } - else if (gpar->left == par) - { - ZIGZAG(gpar, par, curr, left, right); - } - else - { - ZIGZIG(gpar, par, curr, right, left); - } - } - } - ans->root = curr; - } - - return; -} - -/* Insert word into a splay tree. If word is already present, bring it to - root, possibly intermittently. Structure ans is used to pass - in the root, and to pass back both the new root (which may or - may not be changed) and the looked-for record. */ - -void -splayinsert(ANSREC * ans, char *word) -{ - TREEREC *curr = ans->root, *par, *gpar, *prev = NULL, *wcreate(); - int val = 0; - - scount--; - - if (ans->root == NULL) - { - ans->ans = ans->root = wcreate(word, NULL); - return; - } - - while (curr != NULL && (val = scmp(word, curr->word)) != 0) - { - prev = curr; - if (val > 0) - curr = curr->right; - else - curr = curr->left; - } - - if (curr == NULL) - { - if (val > 0) - curr = prev->right = wcreate(word, prev); - else - curr = prev->left = wcreate(word, prev); - } - else - gDupCnt++; /* count duplicate strings */ - - ans->ans = curr; - - if (scount <= 0) /* Move node towards root */ - { - scount = ROTATEFAC; - - while ((par = curr->par) != NULL) - { - if (par->left == curr) - { - if ((gpar = par->par) == NULL) - { - ONELEVEL(par, curr, left, right); - } - else if (gpar->left == par) - { - ZIGZIG(gpar, par, curr, left, right); - } - else - { - ZIGZAG(gpar, par, curr, right, left); - } - } - else - { - if ((gpar = par->par) == NULL) - { - ONELEVEL(par, curr, right, left); - } - else if (gpar->left == par) - { - ZIGZAG(gpar, par, curr, left, right); - } - else - { - ZIGZIG(gpar, par, curr, right, left); - } - } - } - ans->root = curr; - } - return; -} - -/* Create a node to hold a word */ -TREEREC * -wcreate(char *word, TREEREC * par) -{ - TREEREC *tmp; - - tmp = (TREEREC *) malloc(sizeof(TREEREC)); - tmp->word = (char *)malloc(strlen(word) + 1); - strcpy(tmp->word, word); - tmp->left = tmp->right = NULL; - - tmp->par = par; - - return (tmp); -} - -#define INITARRAY ANSREC ans = {0} - -#define STORESTRING(STRING) splayinsert(&ans, STRING) - -#define GETSTRING(STRING) splaysearch(&ans, STRING) - -#endif // SPLAYMETHOD - -//======================================================================= -// R E D B L A C K M E T H O D -//======================================================================= - -#ifdef REDBLACKMETHOD -#define ADTMETHOD "REDBLACK" - -#define MEMOVD 0 /* not enough overhead to count */ - -/* Author J. Zobel, April 2001. - Permission to use this code is freely granted, provided that this - statement is retained. */ - -typedef struct wordrec -{ - char *word; - struct wordrec *left, *right; - struct wordrec *par; - char colour; -} -TREEREC; - -typedef struct ansrec -{ - struct wordrec *root; - struct wordrec *ans; -} -ANSREC; - -#define RED 0 -#define BLACK 1 - -/* Find word in a redblack tree */ - -void -redblacksearch(ANSREC * ans, char *word) -{ - TREEREC *curr = ans->root; - int val; - - if (ans->root != NULL) - { - while (curr != NULL && (val = scmp(word, curr->word)) != 0) - { - if (val > 0) - curr = curr->right; - else - curr = curr->left; - } - } - - ans->ans = curr; - - return; -} - -/* Rotate the right child of par upwards */ -/* Could be written as a macro, but not really necessary -as it is only called on insertion */ - -void -leftrotate(ANSREC * ans, TREEREC * par) -{ - TREEREC *curr, *gpar; - - if ((curr = par->right) != NULL) - { - par->right = curr->left; - if (curr->left != NULL) - curr->left->par = par; - curr->par = par->par; - if ((gpar = par->par) == NULL) - ans->root = curr; - else - { - if (par == gpar->left) - gpar->left = curr; - else - gpar->right = curr; - } - curr->left = par; - par->par = curr; - } -} - -/* Rotate the left child of par upwards */ -void -rightrotate(ANSREC * ans, TREEREC * par) -{ - TREEREC *curr, *gpar; - - if ((curr = par->left) != NULL) - { - par->left = curr->right; - if (curr->right != NULL) - curr->right->par = par; - curr->par = par->par; - if ((gpar = par->par) == NULL) - ans->root = curr; - else - { - if (par == gpar->left) - gpar->left = curr; - else - gpar->right = curr; - } - curr->right = par; - par->par = curr; - } -} - -/* Insert word into a redblack tree */ -void -redblackinsert(ANSREC * ans, char *word) -{ - TREEREC *curr = ans->root, *par, *gpar, *prev = NULL, *wcreate(); - int val; - - if (ans->root == NULL) - { - ans->ans = ans->root = wcreate(word, NULL); - return; - } - while (curr != NULL && (val = scmp(word, curr->word)) != 0) - { - prev = curr; - if (val > 0) - curr = curr->right; - else - curr = curr->left; - } - - ans->ans = curr; - - if (curr == NULL) - /* Insert a new node, rotate up if necessary */ - { - if (val > 0) - curr = prev->right = wcreate(word, prev); - else - curr = prev->left = wcreate(word, prev); - - curr->colour = RED; - while ((par = curr->par) != NULL - && (gpar = par->par) != NULL && curr->par->colour == RED) - { - if (par == gpar->left) - { - if (gpar->right != NULL && gpar->right->colour == RED) - { - par->colour = BLACK; - gpar->right->colour = BLACK; - gpar->colour = RED; - curr = gpar; - } - else - { - if (curr == par->right) - { - curr = par; - leftrotate(ans, curr); - par = curr->par; - } - par->colour = BLACK; - if ((gpar = par->par) != NULL) - { - gpar->colour = RED; - rightrotate(ans, gpar); - } - } - } - else - { - if (gpar->left != NULL && gpar->left->colour == RED) - { - par->colour = BLACK; - gpar->left->colour = BLACK; - gpar->colour = RED; - curr = gpar; - } - else - { - if (curr == par->left) - { - curr = par; - rightrotate(ans, curr); - par = curr->par; - } - par->colour = BLACK; - if ((gpar = par->par) != NULL) - { - gpar->colour = RED; - leftrotate(ans, gpar); - } - } - } - } - if (curr->par == NULL) - ans->root = curr; - ans->root->colour = BLACK; - } - else - gDupCnt++; /* count duplicate strings */ - - return; -} - -/* Create a node to hold a word */ -TREEREC * -wcreate(char *word, TREEREC * par) -{ - TREEREC *tmp; - - tmp = (TREEREC *) malloc(sizeof(TREEREC)); - tmp->word = (char *)malloc(strlen(word) + 1); - strcpy(tmp->word, word); - tmp->left = tmp->right = NULL; - - tmp->par = par; - - return (tmp); -} - -#define INITARRAY ANSREC ans = {0} - -#define STORESTRING(STRING) redblackinsert(&ans, STRING) - -#define GETSTRING(STRING) redblacksearch(&ans, STRING) - -#endif // REDBLACKMETHOD - -//======================================================================= -// M A I N P R O G R A M -by- Doug Baskins -//======================================================================= - -// error routine for system routines for accessing file - -#define FILERROR \ -{ \ - printf("%s: Cannot open file \"%s\": %s " \ - "(errno = %d)\n", argv[0], argv[1], strerror(errno), \ - errno); \ - fprintf(stderr, "%s: Cannot open file \"%s\": %s " \ - "(errno = %d)\n", argv[0], argv[1], strerror(errno), \ - errno); \ - exit(1); \ -} - - -//======================================================================= -// M E A S U R E A D T S P E E D and M E M O R Y U S A G E -//======================================================================= - -int -main(int argc, char *argv[]) -{ - TIMER_vars(tm); // declare timer variables - int fd; // to read file. - struct stat statbuf; // to get size of file - char *Pfile; // ram address of file - size_t fsize; // file size in bytes - char *FSmap; // start address of mapped file - char *FEmap; // end address+1 of mapped file - char String[MAXLINE]; // input buffer - int StrCnt; // line counter - int ii; // temp - - INITARRAY; - -// CHECK FOR REQUIRED INPUT FILE PARAMETER: - - if (argc != 2) - { - printf("Usage: %s \n", argv[0]); - exit(1); - } - -// GET FILE SIZE - - if (stat(argv[1], &statbuf) == -1) - FILERROR; - - fsize = statbuf.st_size; - -// OPEN INPUT FILE: - - if ((fd = open(argv[1], O_RDONLY)) == -1) - FILERROR; - -// MEMORY MAP FILE - - Pfile = - (char *)mmap(NULL, fsize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); - if (Pfile == (char *)-1) - FILERROR; - - FEmap = Pfile + fsize; // set end+1 address - -// print command name + run arguments - - printf("# "); - for (ii = 0; ii < argc; ii++) - printf("%s ", argv[ii]); - printf("\n"); - fflush(stdout); - -// file is in RAM, read again to measure time - - STARTTm(tm); // start timer - - for (StrCnt = 0, FSmap = Pfile; FSmap < FEmap; ) - { - GETLINE(String, FSmap); // 'read' next string - - StrCnt++; - } - ENDTm(DeltaUSec, tm); // end timer -// -// print header - 6 fields - - printf("# lines avg_linelen getline stored"); - printf(" RAMused/line store/ln lookup/ln ADT\n"); - -// print numb lines filesize/line - - printf("%8u", StrCnt); // Number of lines - printf(" %6.1f byts", (double)fsize / (double)StrCnt); // filesize/line - fflush(stdout); - -// print time to read a line - - printf(" %5.3f uS", DeltaUSec / (double)StrCnt); - fflush(stdout); - -// INPUT/STORE LOOP: - -// read each input line into String and store into ADT - - STARTmem; // current malloc() mem usage - STARTTm(tm); // start timer - - for (FSmap = Pfile; FSmap < FEmap; ) - { - GETLINE(String, FSmap); // 'read' next string - - STORESTRING(String); - } - ENDTm(DeltaUSec, tm); // end timer - ENDmem; // current malloc() mem usage - -// print number of non-duplicate lines - - printf(" %8u", StrCnt - gDupCnt); // duplicate lines - -// print RAM used by malloc() by ADT to store data - - printf(" %7.1f byts", (double)(DeltaMem + MEMOVD) / - (double)(StrCnt - gDupCnt)); - -// print time per line to store the data - - printf(" %6.3f uS", DeltaUSec / (double)StrCnt); - fflush(stdout); - -// READ BACK LOOP - - STARTTm(tm); // start timer - - for (FSmap = Pfile; FSmap < FEmap; ) - { - GETLINE(String, FSmap); // 'read' next string - - GETSTRING(String); - } - ENDTm(DeltaUSec, tm); // end timer - -// print time per line to lookup the data from the ADT - - printf(" %6.3f uS", DeltaUSec / (double)StrCnt); // store time/line - printf(" %s\n", ADTMETHOD); - - return (0); // done - -} // main() diff --git a/libjudy/test/StringCompare.c b/libjudy/test/StringCompare.c deleted file mode 100644 index 67f7bf0b3a..0000000000 --- a/libjudy/test/StringCompare.c +++ /dev/null @@ -1,2551 +0,0 @@ -// @(#) $Revision: 4.1 $ $Source: /judy/test/manual/StringCompare.c $ -//======================================================================= -// Author Douglas L. Baskins, Jan 2003. -// Permission to use this code is freely granted, provided that this -// statement is retained. -// email - dougbaskins .at, yahoo.com -//======================================================================= - -//======================================================================= -// -// This program will time various ADTs that store and retrieve strings. -// Currently there are 7 ADTs implemented: - -/* - 1) Hash - this is the fastest one when table size matches data size - 2) JudyHS - 2nd in speed and very scaleable. - 3) JLHash - this uses a JudyL() array instead of hash table and is - very scaleable because the hash table size is ~4 billion. - 4) JudySL - ordered and requires null terminated strings. - 5) Ternary - code borrowed from Mr Dobbs, perhaps 2000 - 6) Redblack - code borrowed from J. Zobel, April 2001. - 7) Splay - code borrowed from J. Zobel, April 2001. - - Note: Splay, Redblack and Ternary methods are not very fast, so they - have not been completed and made bug free. I.E. no Delete and Free - Array routines. Ternary is fastest retrieve of these three, but uses - an extraordinary amount of memory. -*/ -//======================================================================= -// -// Compile: -// -// cc -O StringCompare.c -lm -lJudy -o StringCompare -// -or- -// cc -O -DCPUMHZ=1299 StringCompare.c -lm -lJudy -o StringCompare - -/* Notes: - 1) Use '-DCPUMHZ=1299' in cc line if better clock resolution is desired - and it compiles successfully. The 1299 is the cpu MHz : 1298.916 from - cat /proc/cpuinfo in a Linux system. - - 2) -static will generally get better performance because memcmp(), - memcpy() routines are usually slower with shared librarys. -*/ - -// Usage: -// -// StringCompare -A Hash textfile -// StringCompare -A JudyHS textfile -// StringCompare -A JLHash textfile -// StringCompare -A JudySL textfile -// StringCompare -A Ternary textfile -// StringCompare -A Redblack textfile -// StringCompare -A Splay textfile - -#include // malloc(3) -#include // getopt(3) -#include // printf(3) -#include // open(2) -#include // memcmp(3), memcpy(3) -#include // errno(3) -#include // mmap(2) -#include // gettimeofday(2) -#include // pow(3) -#include // uname(2) -#include // Judy arrays - -//======================================================================= -// D e f i n e: T O T U R N O F F A S S E R T I O N S !!!!!!!! -//======================================================================= -//#define NDEBUG 1 -#include // assert(3) - -//======================================================================= -// G L O B A L D A T A -//======================================================================= - -int foolflag = 0; // fool compiler from optimizing -static Word_t gStored = 0; // number of strings inserted -static Word_t gChainln = 0; // links traversed during RETRIVE - -static Word_t PtsPdec = 40; // default measurement points per decade - -#define INFSTRGS 1000000000 // 1 billion strings is infinity - -static Word_t nStrg = INFSTRGS; // infinity -- measure all strings -static Word_t TValues = 100000; // max measure points for RETRIVE tests -static int pFlag = 0; // pre-fault hash table pages into RAM -static int rFlag = 0; // do not randomize input file -static int aFlag = 0; // word align string buffers -static int DFlag = 0; // do the delete measurement -static int CFlag = 0; // build sequential Get buffers -static Word_t aCount = 0; // Count of missaligned string buffers - -// define the maximum length of a string allowed -#define MAXSTRLEN (100000) -static int MLength = MAXSTRLEN; -static Word_t HTblsz; // 1M default hash table size -static int fileidx; // argv[fileidx] == file string - -// for saving input string data -typedef struct STRING_ -{ - int dt_strlen; - uint8_t *dt_string; - -} dt_t , *Pdt_t; - -static Pdt_t PdtS_ = NULL; // memory for Cache access Gets -static uint8_t *Strbuf_ = NULL; -static Word_t Strsiz_ = 0; - -// Roundup BYTES to an even number of words - -/* - On Linux 2.6.3-4mdkenterprise (Mandrake 10.0 Community) printing (even - to a file) makes the timings inaccurate. So, use -L2 or greater to - average (actually save min times) and print results after all tests are - completed. -*/ -#define Printf if (Pass == 0) printf - -#define ROUNDUPWORD(BYTES) (((BYTES) + sizeof(Word_t) - 1) & (-sizeof(Word_t))) -#define BYTES2WORDS(BYTES) (((BYTES) + sizeof(Word_t) - 1) / (sizeof(Word_t))) - -//======================================================================= -// T I M I N G M A C R O S -//======================================================================= - -static double DeltaUSec; // Global for remembering delta times - -// Some operating systems have get_cycles() in /usr/include/asm/timex.h - -#ifdef CPUMHZ - -// For a 1.34 nS clock cycle processor (750Mhz) - -#define CPUSPEED (1.0 / (CPUMHZ)) - -#include - -#define TIMER_vars(T) cycles_t __TVBeg_##T - -#define STARTTm(T) __TVBeg_##T = get_cycles() - -#define ENDTm(D,T) { (D) = (double)(get_cycles() - __TVBeg_##T) * CPUSPEED; } - -#else // ! CPUMHZ - -#define TIMER_vars(T) struct timeval __TVBeg_##T, __TVEnd_##T - -#define STARTTm(T) gettimeofday(&__TVBeg_##T, NULL) - -#define ENDTm(D,T) \ -{ \ - gettimeofday(&__TVEnd_##T, NULL); \ - (D) = (double)(__TVEnd_##T.tv_sec - __TVBeg_##T.tv_sec) * 1E6 + \ - ((double)(__TVEnd_##T.tv_usec - __TVBeg_##T.tv_usec)); \ -} - -#endif // ! CPUMHZ - -//======================================================================= -// M E M O R Y S I Z E M A C R O S -//======================================================================= - -// use mallinfo() instead of sbrk() for memory usage measurements -// this should include the RAM that was mmap()ed in malloc() - -static Word_t DeltaMem; // for remembering - -// Some mallocs have mallinfo() -// #define MALLINFO 1 - -#ifdef MALLINFO -#include // mallinfo() - -static struct mallinfo malStart; - -#define STARTmem malStart = mallinfo() -#define ENDmem(DELTAMEM) \ -{ \ - struct mallinfo malEnd = mallinfo(); \ -/* strange little dance from signed to unsigned to double */ \ - unsigned int _un_int = malEnd.arena - malStart.arena; \ - (DELTAMEM) = (double)_un_int; /* to double */ \ -} -#else // NO MALLINFO - -// this usually works for machines with less than 1-2Gb RAM. -// (it does NOT include memory ACQUIRED by mmap()) - -static char *malStart; - -#define STARTmem (malStart = (char *)sbrk(0)) -#define ENDmem(DELTAMEM) \ -{ \ - char *malEnd = (char *)sbrk(0); \ - (DELTAMEM) = (double)(malEnd - malStart); \ -} -#endif // NO MALLINFO - -//======================================================================= -// F I L E O P E N and M A L L O C F A I L M A C R O S -//======================================================================= - -#define FILERROR \ -{ \ - printf("\n !! OOps - Open file error \"%s\": %s (errno = %d)\n", \ - argv[fileidx], strerror(errno), errno); \ - fprintf(stderr, " OOps - Open file error \"%s\": %s (errno = %d)\n",\ - argv[fileidx], strerror(errno), errno); \ - exit(1); \ -} - -#define MALLOCERROR \ -{ \ - printf("\n !! OOps - malloc failed at Line = %d\n", __LINE__); \ - fprintf(stderr, " OOps - malloc failed at Line = %d\n", __LINE__); \ - exit(1); \ -} - -//======================================================================= -// This alternate form of JudyMalloc() is used to keep track how much ram is -// used on some of the below ADT's -//======================================================================= - -// JUDY INCLUDE FILES -//#include "Judy.h" - -// **************************************************************************** -// J U D Y M A L L O C -// -// Allocate RAM. This is the single location in Judy code that calls -// malloc(3C). Note: JPM accounting occurs at a higher level. - -static Word_t TotalJudyMalloc = 0; - -Word_t -JudyMalloc(Word_t Words) -{ - Word_t Addr; - - Addr = (Word_t)malloc(Words * sizeof(Word_t)); - - if (Addr) - TotalJudyMalloc += Words; - - return (Addr); - -} // JudyMalloc() - -// **************************************************************************** -// J U D Y F R E E - -void -JudyFree(void *PWord, Word_t Words) -{ - free(PWord); - assert((long)(TotalJudyMalloc - Words) >= 0L); - - TotalJudyMalloc -= Words; - -} // JudyFree() - -// **************************************************************************** -// J U D Y M A L L O C -// -// Higher-level "wrapper" for allocating objects that need not be in RAM, -// although at this time they are in fact only in RAM. Later we hope that some -// entire subtrees (at a JPM or branch) can be "virtual", so their allocations -// and frees should go through this level. - -Word_t -JudyMallocVirtual(Word_t Words) -{ - return (JudyMalloc(Words)); - -} // JudyMallocVirtual() - -// **************************************************************************** -// J U D Y F R E E - -void -JudyFreeVirtual(void *PWord, Word_t Words) -{ - JudyFree(PWord, Words); - -} // JudyFreeVirtual() - -//======================================================================= -// Routine to get next size of Indexes -//======================================================================= - -static int -NextNumb(Word_t *PNumber, // pointer to returned next number - double *PDNumb, // Temp double of above - double DMult, // Multiplier - Word_t MaxNumb) // Max number to return -{ -// Save prev number - double PrevPDNumb = *PDNumb; - double DDiff; - -// Calc next number >= 1.0 beyond previous - do - { - *PDNumb *= DMult; - DDiff = *PDNumb - PrevPDNumb; - } - while (DDiff < 0.5); - -// Return it in integer format - if (DDiff < 100.0) - *PNumber += (Word_t)(DDiff + 0.5); - else - *PNumber = (Word_t)(*PDNumb + 0.5); - -// Verify it did not exceed max number - if (*PNumber >= MaxNumb) - { - *PNumber = MaxNumb; // it did, so return max - return (1); // flag it - } - return (0); // more available -} - -//======================================================================= -// M E A S U R E M E N T S T R U C T U R E -//======================================================================= - -typedef struct _MEASUREMENTS_STRUCT *Pms_t; -typedef struct _MEASUREMENTS_STRUCT -{ - Word_t ms_delta; // number of points in current group - double ms_Bytes; // average allocated memory/per string - double ms_mininsert; // Min Retrive number - double ms_minretrive; // Min Retrive number -} ms_t; - -static Pms_t Pms; // array of MEASUREMENTS_STRUCT - -// Method type - -typedef enum -{ - M_invalid, - M_Print, - M_Hash, - M_JLHash, - M_JudySL, - M_JudyHS, - M_Splay, - M_Redblack, - M_Ternary -} Method_t; - -//======================================================================= -// R a n d o m i z e i n p u t s t r i n g s -//======================================================================= - -static void -Randomize(Pdt_t Pstrstr, Word_t Len) -{ - Word_t ii; - -// swap the "random" index with the sequential one - for (ii = 1; ii < Len; ii++) - { - dt_t dttemp; - Word_t swapii; - -// get "random" index - swapii = (Word_t)rand() % Len; - -// and swap - dttemp = Pstrstr[ii]; - Pstrstr[ii] = Pstrstr[swapii]; - Pstrstr[swapii] = dttemp; - } -} - -//======================================================================= -// B u i l d s e q u e n c i a l s t r i n g b u f f e r -//======================================================================= - -Pdt_t -BuildSeqBuf(Pdt_t Pstrstr, Word_t Len) -{ - Word_t SumStrings = 0; - Word_t ii; - Word_t Strlen; - uint8_t *string; - - assert(Len <= TValues); - -// calculate how much memory needed for strings - for (ii = 0; ii < Len; ii++) - { - Strlen = Pstrstr[ii].dt_strlen; - if (aFlag) - SumStrings += ROUNDUPWORD(Strlen + 1); - else - SumStrings += Strlen + 1; - } -// check if old string buffer is big enough - if (SumStrings > Strsiz_) - { - if (Strbuf_) - free(Strbuf_); - else - SumStrings += SumStrings / 5; // bump 20% - - Strbuf_ = (uint8_t *) malloc(SumStrings); - if (Strbuf_ == NULL) - MALLOCERROR; - Strsiz_ = SumStrings; - } - for (ii = 0, string = Strbuf_; ii < Len; ii++) - { - Strlen = Pstrstr[ii].dt_strlen; - - PdtS_[ii].dt_strlen = Strlen; - PdtS_[ii].dt_string = string; - - memcpy(string, Pstrstr[ii].dt_string, Strlen + 1); - - if (aFlag) - string += ROUNDUPWORD(Strlen + 1); - else - string += Strlen + 1; - } - return (PdtS_); -} - -//======================================================================= -// H A S H M E T H O D S T R U C T U R E S -//======================================================================= - -// These structures are used in Hash() and JLHash() ADTs - -// for storing length of string - -// Hash chain structure (varible length depending on string) -// static part of the length -#define HSTRUCTOVD (sizeof(hrec_t) - sizeof(int)) -typedef struct HASHREC_ *Phrec_t; -typedef struct HASHREC_ -{ - Phrec_t hr_Next; // collision chain link pointer - Word_t hr_Value; // Data associated with string - int hr_Strlen; // length of string 2 billion max - uint8_t hr_String[sizeof(int)]; // string is allocated with struct - -} hrec_t; - -// hash head structure to keep hash array information -typedef struct HASHINFO_ -{ - Pvoid_t hi_Htbl; // Hash table - Word_t hi_tblsize; // Hash table size (Words) - Word_t hi_TotalWords; // Hash array total words - Word_t hi_Pop1; // Hash array total population - -} hinfo_t, *Phinfo_t; - -// size in words of the header structure -#define HASHHEADSZ (sizeof(hinfo_t) / sizeof(Word_t)) - -//======================================================================= -// H A S H A L G O R I T H M -//======================================================================= -// -// For CPUs with a slow mod (%) use table size a power of 2. A test is -// made to see if the SIZE is a power of 2, and if so an .AND.(&) is used -// instead of a .MOD.(%) to trim the hash return size. Note: a SIZE == 0, -// results in no trimming of hash return size. - -#define HASHSTR(STRING,LENGTH,SIZE) \ - ((SIZE) == ((SIZE) & -(SIZE))) ? \ - (HashStr(STRING, LENGTH) & ((SIZE) -1)) : \ - (HashStr(STRING, LENGTH) % (SIZE)) - -// String hash function. Hash string to a unsigned int (uint32_t) This -// one needs a fast 32 bit mpy, which is often very slow on older(RISC) -// machines. If you are sure you will not over populate the hash table, -// then a poorer/faster hash algorithm should be used. Replace with your -// own, milage may vary. This program measures the speed, whether used -// or not. - -static uint32_t -HashStr(void *Str, Word_t Len) -{ - uint32_t A = 31415; - uint32_t hashv = Len; - uint8_t *k = (uint8_t *) Str; - - while (Len--) - { - hashv = (A * hashv) + *k++; - A *= 27183; - } - return (hashv); -} - -//======================================================================= -// S T O R E and R E T R I V E R O U T I N E S -//======================================================================= - -//======================================================================= -// H A S H M E T H O D U S I N G J U D Y L A S H A S H T A B L E -//======================================================================= - -PWord_t -JLHashGet(Pvoid_t JLHash, uint8_t * String, Word_t Strlen) -{ - Phinfo_t PHash = (Phinfo_t) JLHash; - Phrec_t Phrec, *PPhrec; - uint32_t hval; - - if (PHash == NULL) - return (NULL); - -// get hash value, if mod(%) is slow (in some CPUs), make it a power of 2 - hval = HASHSTR(String, Strlen, PHash->hi_tblsize); - - JLG(PPhrec, PHash->hi_Htbl, hval); // use JudyL to get &pointer - - if (PPhrec == NULL) - return (NULL); // no table entry - -// search for matching string - for (Phrec = *PPhrec; Phrec != NULL; Phrec = Phrec->hr_Next) - { - gChainln++; // Hash chain length - if (Phrec->hr_Strlen == Strlen) // length match? - { - if (memcmp(Phrec->hr_String, String, Strlen) == 0) - return (&(Phrec->hr_Value)); // match! pointer to Value - } - } - return (NULL); -} - -// Return pointer to struct hrec_t associated with string - -PWord_t -JLHashIns(PPvoid_t PPHash, uint8_t * String, Word_t Strlen, Word_t TblSize) -{ - Phrec_t Phrec, *PPhrec; - Phinfo_t PHash; - Word_t Len; - uint32_t hval; - - PHash = (Phinfo_t) * PPHash; // core-dump if calling error - if (PHash == NULL) // if hash table not allocated - { -// allocate the header - PHash = (Phinfo_t) JudyMalloc(HASHHEADSZ); - if (PHash == NULL) - MALLOCERROR; - -// Initialize the header struct - PHash->hi_tblsize = TblSize; - PHash->hi_TotalWords = HASHHEADSZ; - PHash->hi_Pop1 = 0; // none yet - PHash->hi_Htbl = NULL; - *PPHash = (Pvoid_t)PHash; // return header to caller - } -// get hash value, if mod(%) is slow (in some CPUs), make it a power of 2 - hval = HASHSTR(String, Strlen, PHash->hi_tblsize); - -// get pointer to hash table entry - JLI(PPhrec, PHash->hi_Htbl, hval); // JLI will exit if out of memory - -// search for matching string - for (Phrec = *PPhrec; Phrec != NULL; Phrec = Phrec->hr_Next) - { - if (Phrec->hr_Strlen == Strlen) // string length match? - { - if (memcmp(Phrec->hr_String, String, Strlen) == 0) - { - return (&(Phrec->hr_Value)); // match! pointer to Value - } - } - } - -// String match not found, so do an insert - - Len = BYTES2WORDS(Strlen + HSTRUCTOVD); - Phrec = (Phrec_t) JudyMalloc(Len); // get memory for storing string - if (Phrec == NULL) - MALLOCERROR; - - PHash->hi_TotalWords += Len; // keep track of total mallocs - - Phrec->hr_Strlen = Strlen; // set string length - memcpy(Phrec->hr_String, String, Strlen); - - Phrec->hr_Next = *PPhrec; // pointer to synonym - *PPhrec = Phrec; // place new struct in front of list - (PHash->hi_Pop1)++; // add one to population - Phrec->hr_Value = (Word_t)0; // zero the associated Value - - return (&(Phrec->hr_Value)); // return pointer to Value -} - -// Return 1 if successful, else 0 - -int -JLHashDel(PPvoid_t PPHash, uint8_t * String, Word_t Strlen) -{ - Phrec_t Phrec, *PPhrec, *PPhrec1; - Phinfo_t PHash; - uint32_t hval; - -// avoid an core dump here - if (PPHash == NULL) - return (0); - PHash = (Phinfo_t) (*PPHash); // get header - if (PHash == NULL) - return (0); // not found - -// get hash value, if mod(%) is slow (in some CPUs), make it a power of 2 - hval = HASHSTR(String, Strlen, PHash->hi_tblsize); - -// get pointer hash table entry - JLG(PPhrec, PHash->hi_Htbl, hval); - if (PPhrec == NULL) - return (0); // hash entry not found - - PPhrec1 = PPhrec; // save head hash entry ^ - -// search for matching string - for (Phrec = *PPhrec; Phrec != NULL; Phrec = Phrec->hr_Next) - { - if (Phrec->hr_Strlen == Strlen) // string length match? - { - if (memcmp(Phrec->hr_String, String, Strlen) == 0) // string match? - { - int Rc; // not used - Word_t Len; - - *PPhrec = Phrec->hr_Next; // put next in previous - - Len = BYTES2WORDS(Strlen + HSTRUCTOVD); - JudyFree(Phrec, Len); - PHash->hi_TotalWords -= Len; // ram usage accounting - - (PHash->hi_Pop1)--; // Decrement population - - if (*PPhrec1 == NULL) // no chain left - { -// delete hash table entry - JLD(Rc, PHash->hi_Htbl, hval); - assert(Rc == 1); - } -// If last element, free everything - if (PHash->hi_Pop1 == 0) - { - assert(PHash->hi_TotalWords == HASHHEADSZ); - - JudyFree(PHash, HASHHEADSZ); // the header table - *PPHash = NULL; // from caller - } - return (1); // successful - } - } - PPhrec = &(Phrec->hr_Next); // previous = current - } - return (0); // string not found -} - -// Free the whole JLHash structure - -Word_t -JLHashFreeArray(PPvoid_t PPHash) -{ - Phrec_t Phrec, *PPhrec; - Phinfo_t PHash; - Word_t DeletedWords, Bytes; - Word_t Index = 0; // for First, Next loop - -// avoid an core dump here - if (PPHash == NULL) - return ((Word_t)0); - PHash = (Phinfo_t) (*PPHash); // get header - if (PHash == NULL) - return ((Word_t)0); // not found - -// get bytes of memory usage in (JudyL) Hash table - JLMU(Bytes, PHash->hi_Htbl); - - DeletedWords = HASHHEADSZ; // start with header - -// Get 1st table entry in Hash table - JLF(PPhrec, PHash->hi_Htbl, Index); - -// found an entry in hash table? - while (PPhrec != NULL) - { - int Rc; // not used - Phrec = *PPhrec; - -// walk the synonym linked list - while (Phrec != NULL) - { - Word_t Len; - Phrec_t Phrecfree = Phrec; - -// number of words to free -- struct hrec_t - Len = BYTES2WORDS(Phrec->hr_Strlen + HSTRUCTOVD); - -// sum total length of mallocs in words - DeletedWords += Len; - - (PHash->hi_Pop1)--; // Decrement population - -// get pointer to next synonym on list - Phrec = Phrec->hr_Next; - -// free the struct hrec_t - JudyFree(Phrecfree, Len); - } -// delete hash table entry - JLD(Rc, PHash->hi_Htbl, Index); - assert(Rc == 1); - -// get next hash table entry - JLN(PPhrec, PHash->hi_Htbl, Index); - } - assert(PHash->hi_TotalWords == DeletedWords); - assert(PHash->hi_Pop1 == 0); - - JudyFree(PHash, HASHHEADSZ); // the header table - *PPHash = NULL; // set pointer null - -// return total bytes freed - return ((DeletedWords * sizeof(Word_t)) + Bytes); -} - -//======================================================================= -// H A S H M E T H O D -//======================================================================= - -PWord_t -HashGet(Phinfo_t PHash, uint8_t * String, Word_t Strlen) -{ - Phrec_t Phrec, *Htbl; - uint32_t hval; - -// avoid an core dump here - if (PHash == NULL) - return (NULL); - -// get hash value, if mod(%) is slow (in some CPUs), make it a power of 2 - hval = HASHSTR(String, Strlen, PHash->hi_tblsize); - -// type Hash table pointer - Htbl = (Phrec_t *) PHash->hi_Htbl; - -// search for matching string - for (Phrec = Htbl[hval]; Phrec != NULL; Phrec = Phrec->hr_Next) - { - gChainln++; // Hash chain length - if (Phrec->hr_Strlen == Strlen) // length match? - { - if (memcmp(Phrec->hr_String, String, Strlen) == 0) - return (&(Phrec->hr_Value)); // match! pointer to Value - } - } - return (NULL); -} - -// Return pointer to struct hrec_t associated with string - -Pvoid_t -HashIns(Phinfo_t * PPHash, uint8_t * String, Word_t Strlen, Word_t TblSize) -{ - Phrec_t Phrec, *Htbl; - Phinfo_t PHash; - Word_t Len; - uint32_t hval; - - PHash = *PPHash; // core-dump if calling error - if (PHash == NULL) // if hash table not allocated - { -// allocate the header - PHash = (Phinfo_t) JudyMalloc(HASHHEADSZ); - if (PHash == NULL) - MALLOCERROR; - -// allocate the hash table - PHash->hi_Htbl = (Pvoid_t)JudyMalloc(TblSize); - if (PHash->hi_Htbl == NULL) - MALLOCERROR; - -// you cant beat this with modern compilers/librarys - memset(PHash->hi_Htbl, 0, TblSize * sizeof(Word_t)); - -// Initialize the header struct - PHash->hi_tblsize = TblSize; - PHash->hi_TotalWords = TblSize + HASHHEADSZ; - PHash->hi_Pop1 = 0; // none yet - *PPHash = PHash; // return header to caller - } -// get hash value, if mod(%) is slow (in some CPUs), make it a power of 2 - hval = HASHSTR(String, Strlen, TblSize); - -// type Hash table pointer - Htbl = (Phrec_t *) PHash->hi_Htbl; - -// search for matching string in hash table entry - for (Phrec = Htbl[hval]; Phrec != NULL; Phrec = Phrec->hr_Next) - { - if (Phrec->hr_Strlen == Strlen) // string length match? - { - if (memcmp(Phrec->hr_String, String, Strlen) == 0) // string match? - { - return (&(Phrec->hr_Value)); // match! pointer to Value - } - } - } -// string not found, so do an insert - Len = BYTES2WORDS(Strlen + HSTRUCTOVD); - Phrec = (Phrec_t) JudyMalloc(Len); - if (Phrec == NULL) - MALLOCERROR; - PHash->hi_TotalWords += Len; // keep track of total mallocs - - Phrec->hr_Strlen = Strlen; // set string length - memcpy(Phrec->hr_String, String, Strlen); // copy it - -// place new allocation first in chain - Phrec->hr_Next = Htbl[hval]; - Htbl[hval] = Phrec; - - (PHash->hi_Pop1)++; // add one to population - Phrec->hr_Value = (Word_t)0; // zero the associated Value - - return (&(Phrec->hr_Value)); // return pointer to Value -} - -// Delete entry in hash array, return 1 if successful, else 0 - -int -HashDel(Phinfo_t * PPHash, uint8_t * String, Word_t Strlen) -{ - Phrec_t Phrec, *PPhrec, *Htbl; - Phinfo_t PHash; - uint32_t hval; - -// avoid an core dump here - if (PPHash == NULL) - return (0); - PHash = *PPHash; // get header - if (PHash == NULL) - return (0); // not found - -// get hash value, if mod(%) is slow (in some CPUs), make it a power of 2 - hval = HASHSTR(String, Strlen, PHash->hi_tblsize); - -// type Hash table pointer - Htbl = (Phrec_t *) PHash->hi_Htbl; - -// get pointer hash table entry - PPhrec = &Htbl[hval]; - -// search for matching string - for (Phrec = *PPhrec; Phrec != NULL; Phrec = Phrec->hr_Next) - { - if (Phrec->hr_Strlen == Strlen) // length match? - { - if (memcmp(Phrec->hr_String, String, Strlen) == 0) - { - Word_t Len; - -// put next hrec_t in previous hrec_t - *PPhrec = Phrec->hr_Next; - - Len = BYTES2WORDS(Strlen + HSTRUCTOVD); - JudyFree(Phrec, Len); - PHash->hi_TotalWords -= Len; - (PHash->hi_Pop1)--; // Decrement population - -// If last element, free everything - if (PHash->hi_Pop1 == 0) - { - assert(PHash->hi_TotalWords == - (HASHHEADSZ + PHash->hi_tblsize)); - - JudyFree(Htbl, PHash->hi_tblsize); // hash table - JudyFree(PHash, HASHHEADSZ); // header struct - *PPHash = NULL; // from caller - } - return (1); // successful - } - } - PPhrec = &(Phrec->hr_Next); // previous = current - } - return (0); // not found -} - -Word_t -HashFreeArray(Phinfo_t * PPHash) -{ - int ii; - Phrec_t Phrec, *Htbl; - Phinfo_t PHash; - Word_t DeletedWords; - -// avoid an core dump here - if (PPHash == NULL) - return ((Word_t)0); - PHash = (Phinfo_t) (*PPHash); // get header - if (PHash == NULL) - return ((Word_t)0); - -// start accumulator of deleted memory - DeletedWords = HASHHEADSZ + PHash->hi_tblsize; - -// type Hash table pointer - Htbl = (Phrec_t *) PHash->hi_Htbl; - -// walk thru all table entrys - for (ii = 0; ii < PHash->hi_tblsize; ii++) - { - Phrec = Htbl[ii]; // next hash table entry - - while (Phrec != NULL) // walk the synonym linked list - { - Word_t Len; - Phrec_t Phrecfree; - -// get pointer to next synonym on list - Phrecfree = Phrec; - Phrec = Phrec->hr_Next; - - (PHash->hi_Pop1)--; // Decrement population - -// number of words to free -- struct hrec_t - Len = BYTES2WORDS(Phrecfree->hr_Strlen + HSTRUCTOVD); - DeletedWords += Len; // sum words freed - -// free the struct hrec_t - JudyFree(Phrecfree, Len); - } - } - -// and free the hash table - JudyFree(Htbl, PHash->hi_tblsize); - assert(PHash->hi_TotalWords == DeletedWords); - assert(PHash->hi_Pop1 == 0); - - JudyFree(PHash, HASHHEADSZ); // the header table - *PPHash = NULL; // set pointer null - -// return total bytes freed - return (DeletedWords * sizeof(Word_t)); -} - -//======================================================================= -// S P L A Y M E T H O D -//======================================================================= - -/* Author J. Zobel, April 2001. - Permission to use this code is freely granted, provided that this - statement is retained. */ - -#define ROTATEFAC 11 - -typedef struct spwordrec -{ - char *word; - struct spwordrec *left, *right; - struct spwordrec *par; -} SPTREEREC; - -typedef struct spansrec -{ - struct spwordrec *root; - struct spwordrec *ans; -} SPANSREC; - -SPANSREC spans = { 0 }; - -#define ONELEVEL(PAR,CURR,DIR,RID) \ - { \ - PAR->DIR = CURR->RID; \ - if(PAR->DIR!=NULL) \ - PAR->DIR->PAR = PAR; \ - CURR->RID = PAR; \ - PAR->PAR = CURR; \ - CURR->PAR = NULL; \ - } - -#define ZIGZIG(GPAR,PAR,CURR,DIR,RID) \ - { \ - CURR->PAR = GPAR->PAR; \ - if (CURR->PAR != NULL) \ - { \ - if (CURR->PAR->DIR == GPAR) \ - CURR->PAR->DIR = CURR; \ - else \ - CURR->PAR->RID = CURR; \ - } \ - GPAR->DIR = PAR->RID; \ - if (GPAR->DIR != NULL) \ - GPAR->DIR->PAR = GPAR; \ - PAR->DIR = CURR->RID; \ - if (CURR->RID != NULL) \ - CURR->RID->PAR = PAR; \ - CURR->RID = PAR; \ - PAR->PAR = CURR; \ - PAR->RID = GPAR; \ - GPAR->PAR = PAR; \ - } - -#define ZIGZAG(GPAR,PAR,CURR,DIR,RID) \ - { \ - CURR->PAR = GPAR->PAR; \ - if (CURR->PAR != NULL) \ - { \ - if (CURR->PAR->DIR == GPAR) \ - CURR->PAR->DIR = CURR; \ - else \ - CURR->PAR->RID = CURR; \ - } \ - PAR->RID = CURR->DIR; \ - if (PAR->RID != NULL) \ - PAR->RID->PAR = PAR; \ - GPAR->DIR = CURR->RID; \ - if (GPAR->DIR != NULL) \ - GPAR->DIR->PAR = GPAR; \ - CURR->DIR = PAR; \ - PAR->PAR = CURR; \ - CURR->RID = GPAR; \ - GPAR->PAR = CURR; \ - } - -int scount = ROTATEFAC; - -/* Create a node to hold a word */ - -static SPTREEREC * -spwcreate(char *word, SPTREEREC * par) -{ - SPTREEREC *tmp; - - tmp = (SPTREEREC *) malloc(sizeof(SPTREEREC)); - tmp->word = (char *)malloc(strlen(word) + 1); - strcpy(tmp->word, word); - tmp->left = tmp->right = NULL; - - tmp->par = par; - - gStored++; // count stored - - return (tmp); -} - -/* Search for word in a splay tree. If word is found, bring it to - root, possibly intermittently. Structure ans is used to pass - in the root, and to pass back both the new root (which may or - may not be changed) and the looked-for record. */ - -static void -splaysearch(SPANSREC * ans, char *word) -{ - SPTREEREC *curr = ans->root, *par, *gpar; - int val; - - scount--; - - if (ans->root == NULL) - { - ans->ans = NULL; - return; - } - while (curr != NULL && (val = strcmp(word, curr->word)) != 0) - { - if (val > 0) - curr = curr->right; - else - curr = curr->left; - } - - ans->ans = curr; - - if (curr == ans->root) - { - return; - } - - if (scount <= 0 && curr != NULL) /* Move node towards root */ - { - scount = ROTATEFAC; - - while ((par = curr->par) != NULL) - { - if (par->left == curr) - { - if ((gpar = par->par) == NULL) - { - ONELEVEL(par, curr, left, right); - } - else if (gpar->left == par) - { - ZIGZIG(gpar, par, curr, left, right); - } - else - { - ZIGZAG(gpar, par, curr, right, left); - } - } - else - { - if ((gpar = par->par) == NULL) - { - ONELEVEL(par, curr, right, left); - } - else if (gpar->left == par) - { - ZIGZAG(gpar, par, curr, left, right); - } - else - { - ZIGZIG(gpar, par, curr, right, left); - } - } - } - ans->root = curr; - } - - return; -} - -/* Insert word into a splay tree. If word is already present, bring it to - root, possibly intermittently. Structure ans is used to pass - in the root, and to pass back both the new root (which may or - may not be changed) and the looked-for record. */ - -static void -splayinsert(SPANSREC * ans, char *word) -{ - SPTREEREC *curr = ans->root, *par, *gpar, *prev = NULL, *spwcreate(); - int val = 0; - - scount--; - - if (ans->root == NULL) - { - ans->ans = ans->root = spwcreate(word, NULL); - return; - } - - while (curr != NULL && (val = strcmp(word, curr->word)) != 0) - { - prev = curr; - if (val > 0) - curr = curr->right; - else - curr = curr->left; - } - - if (curr == NULL) - { - if (val > 0) - curr = prev->right = spwcreate(word, prev); - else - curr = prev->left = spwcreate(word, prev); - } - - ans->ans = curr; - - if (scount <= 0) /* Move node towards root */ - { - scount = ROTATEFAC; - - while ((par = curr->par) != NULL) - { - if (par->left == curr) - { - if ((gpar = par->par) == NULL) - { - ONELEVEL(par, curr, left, right); - } - else if (gpar->left == par) - { - ZIGZIG(gpar, par, curr, left, right); - } - else - { - ZIGZAG(gpar, par, curr, right, left); - } - } - else - { - if ((gpar = par->par) == NULL) - { - ONELEVEL(par, curr, right, left); - } - else if (gpar->left == par) - { - ZIGZAG(gpar, par, curr, left, right); - } - else - { - ZIGZIG(gpar, par, curr, right, left); - } - } - } - ans->root = curr; - } - return; -} - -//======================================================================= -// R E D B L A C K M E T H O D -//======================================================================= - -/* Author J. Zobel, April 2001. - Permission to use this code is freely granted, provided that this - statement is retained. */ - -typedef struct rbwordrec -{ - char *word; - struct rbwordrec *left, *right; - struct rbwordrec *par; - char colour; -} RBTREEREC; - -typedef struct rbansrec -{ - struct rbwordrec *root; - struct rbwordrec *ans; -} BRANSREC; - -BRANSREC rbans = { 0 }; - -#define RED 0 -#define BLACK 1 - -/* Find word in a redblack tree */ - -static void -redblacksearch(BRANSREC * ans, char *word) -{ - RBTREEREC *curr = ans->root; - int val; - - if (ans->root != NULL) - { - while (curr != NULL && (val = strcmp(word, curr->word)) != 0) - { - if (val > 0) - curr = curr->right; - else - curr = curr->left; - } - } - - ans->ans = curr; - - return; -} - -/* Rotate the right child of par upwards */ - -/* Could be written as a macro, but not really necessary -as it is only called on insertion */ - -void -leftrotate(BRANSREC * ans, RBTREEREC * par) -{ - RBTREEREC *curr, *gpar; - - if ((curr = par->right) != NULL) - { - par->right = curr->left; - if (curr->left != NULL) - curr->left->par = par; - curr->par = par->par; - if ((gpar = par->par) == NULL) - ans->root = curr; - else - { - if (par == gpar->left) - gpar->left = curr; - else - gpar->right = curr; - } - curr->left = par; - par->par = curr; - } -} - -/* Rotate the left child of par upwards */ -void -rightrotate(BRANSREC * ans, RBTREEREC * par) -{ - RBTREEREC *curr, *gpar; - - if ((curr = par->left) != NULL) - { - par->left = curr->right; - if (curr->right != NULL) - curr->right->par = par; - curr->par = par->par; - if ((gpar = par->par) == NULL) - ans->root = curr; - else - { - if (par == gpar->left) - gpar->left = curr; - else - gpar->right = curr; - } - curr->right = par; - par->par = curr; - } -} - -/* Create a node to hold a word */ - -RBTREEREC * -rbwcreate(char *word, RBTREEREC * par) -{ - RBTREEREC *tmp; - - tmp = (RBTREEREC *) malloc(sizeof(RBTREEREC)); - tmp->word = (char *)malloc(strlen(word) + 1); - strcpy(tmp->word, word); - tmp->left = tmp->right = NULL; - - tmp->par = par; - - gStored++; // count stored - - return (tmp); -} - -/* Insert word into a redblack tree */ - -void -redblackinsert(BRANSREC * ans, char *word) -{ - RBTREEREC *curr = ans->root, *par, *gpar, *prev = NULL, *rbwcreate(); - int val = 0; - - if (ans->root == NULL) - { - ans->ans = ans->root = rbwcreate(word, NULL); - return; - } - while (curr != NULL && (val = strcmp(word, curr->word)) != 0) - { - prev = curr; - if (val > 0) - curr = curr->right; - else - curr = curr->left; - } - - ans->ans = curr; - - if (curr == NULL) - /* Insert a new node, rotate up if necessary */ - { - if (val > 0) - curr = prev->right = rbwcreate(word, prev); - else - curr = prev->left = rbwcreate(word, prev); - - curr->colour = RED; - while ((par = curr->par) != NULL - && (gpar = par->par) != NULL && curr->par->colour == RED) - { - if (par == gpar->left) - { - if (gpar->right != NULL && gpar->right->colour == RED) - { - par->colour = BLACK; - gpar->right->colour = BLACK; - gpar->colour = RED; - curr = gpar; - } - else - { - if (curr == par->right) - { - curr = par; - leftrotate(ans, curr); - par = curr->par; - } - par->colour = BLACK; - if ((gpar = par->par) != NULL) - { - gpar->colour = RED; - rightrotate(ans, gpar); - } - } - } - else - { - if (gpar->left != NULL && gpar->left->colour == RED) - { - par->colour = BLACK; - gpar->left->colour = BLACK; - gpar->colour = RED; - curr = gpar; - } - else - { - if (curr == par->left) - { - curr = par; - rightrotate(ans, curr); - par = curr->par; - } - par->colour = BLACK; - if ((gpar = par->par) != NULL) - { - gpar->colour = RED; - leftrotate(ans, gpar); - } - } - } - } - if (curr->par == NULL) - ans->root = curr; - ans->root->colour = BLACK; - } - - return; -} - -//======================================================================= -// T E R N A R Y M E T H O D -//======================================================================= - -typedef struct tnode *Tptr; -typedef struct tnode -{ - uint8_t splitchar; - Tptr lokid, eqkid, hikid; -} -Tnode; - -void -TernaryIns(Tptr * p, uint8_t * s, int Len) -{ - int d; - uint8_t *instr = s; - Tptr pp; - while ((pp = *p) != NULL) - { - if ((d = *s - pp->splitchar) == 0) - { - if (*s++ == 0) - { - printf("Oops duplicate Ternary string %s\n", instr); - return; - } - p = &(pp->eqkid); - } - else if (d < 0) - p = &(pp->lokid); - else - p = &(pp->hikid); - } - for (;;) - { - *p = (Tptr) malloc(sizeof(Tnode)); - pp = *p; - pp->splitchar = *s; - pp->lokid = pp->eqkid = pp->hikid = 0; - if (*s++ == 0) - { - pp->eqkid = (Tptr) instr; - gStored++; // number of strings stored - return; - } - p = &(pp->eqkid); - } -} - -int -TernaryGet(Tptr p, uint8_t * s, int Len) -{ - while (p) - { - if (*s < p->splitchar) - p = p->lokid; - else if (*s == p->splitchar) - { - if (*s++ == 0) - return 1; - p = p->eqkid; - } - else - p = p->hikid; - } - return 0; -} - -//======================================================================= -// M E A S U R E A D T S P E E D and M E M O R Y U S A G E -//======================================================================= - -//Word_t TotalJudyMalloc; - -#define GETSTRING(PCurStr, Strlen) - -int -main(int argc, char *argv[]) -{ - TIMER_vars(tm); // declare timer variables - FILE *fid; // to read file. - int Chr; // char read from fgetc - Pdt_t Pdt, Pdts; // array of lengths and pointers to str - uint8_t *PCurStr; // Current string pointer - Word_t LineCnt; // line counter - int Strlen; // = strlen(); - Word_t StrTot; // Total len of strings - Word_t StrNumb; // current line number - Word_t ReadLin; // strings to read - double Mult; // multiplier between groups - Word_t Groups; // number of measurement groups - Word_t grp; // current group - Pvoid_t JudySL = NULL; // JudySL root pointer - Pvoid_t JudyHS = NULL; // JudyHS root pointer - Pvoid_t JLHash = NULL; // JLHash root pointer - Phinfo_t HRoot = NULL; // hash table root pointer - Tptr Ternary = { 0 }; // Ternary struct root pointer - - Method_t Method = M_invalid; // the method to measure - Word_t lines = 0; // to shut up compiler - Word_t Bytes = 0; // Bytes deallocated from FreeArray - Word_t StringMemory; // Bytes allocated for input data - int Pass; - int Passes = 1; - - int Opt; - extern char *optarg; - int ErrorFlag = 0; - -// un-buffer output - setbuf(stdout, NULL); - -//============================================================ -// PARSE INPUT PARAMETERS -//============================================================ - - while ((Opt = getopt(argc, argv, "A:H:L:n:T:P:M:praDC")) != -1) - { - switch (Opt) - { - case 'A': - if (Method != M_invalid) - { - printf("\nOnly ONE '-A' is allowed!!!!!!\n"); - ErrorFlag++; - break; - } - if (strcmp(optarg, "Print") == 0) - Method = M_Print; - if (strcmp(optarg, "Hash") == 0) - { - Method = M_Hash; - HTblsz = 1LU << 20; // default 1.0+ million - } - if (strcmp(optarg, "JLHash") == 0) - { - Method = M_JLHash; - HTblsz = 0; // max 2^32 - } - if (strcmp(optarg, "JudySL") == 0) - Method = M_JudySL; - if (strcmp(optarg, "Splay") == 0) - Method = M_Splay; - if (strcmp(optarg, "Redblack") == 0) - Method = M_Redblack; - if (strcmp(optarg, "JudyHS") == 0) - Method = M_JudyHS; - if (strcmp(optarg, "Ternary") == 0) - Method = M_Ternary; - break; - - case 'H': // Size of Hash table - HTblsz = strtoul(optarg, NULL, 0); - break; - - case 'L': // Number of Loops - Passes = atoi(optarg); - if (Passes <= 0) - { - printf("\n !! OOps - Number of Loops must be > 0\n"); - ErrorFlag++; - } - break; - - case 'n': // Max population of arrays - nStrg = strtoul(optarg, NULL, 0); // Size of Linear Array - if (nStrg == 0) - { - printf("\n !! OOps - Number of strings must be > 0\n"); - ErrorFlag++; - } - break; - - case 'T': // Maximum retrieve tests for timing - TValues = strtoul(optarg, NULL, 0); - break; - - case 'P': // measurement points per decade - PtsPdec = strtoul(optarg, NULL, 0); - break; - - case 'M': // maximum length of input string - MLength = atoi(optarg); - break; - - case 'p': // pre-initialize Hash table - pFlag = 1; - break; - - case 'r': // do not randomize input - if (CFlag) - { - printf - ("\n !! OOps '-r' and '-C' flag are mutually exclusive\n"); - ErrorFlag++; - break; - } - rFlag = 1; - break; - - case 'a': // word align string buffers - aFlag = 1; - break; - - case 'D': // do a delete at end - DFlag = 1; - break; - - case 'C': // build sequential Get string buffers - if (rFlag) - { - printf - ("\n !! OOps '-C' and '-r' flag are mutually exclusive\n"); - ErrorFlag++; - break; - } - CFlag = 1; - break; - - default: - ErrorFlag++; - break; - } - } - if (Method == -1) - { - printf - ("\n !! OOps -- '-A ' I.E. '-AHash' or '-AJudyHS' is a required option\n"); - ErrorFlag++; - } - - fileidx = optind; - if (optind >= argc) - { - printf("\n !! OOps -- No input file specified\n"); - ErrorFlag++; - } - - if (ErrorFlag) - { - printf("\n"); - printf("$ %s -A -n# -H# -P# -T# -p -r -a InputStringFile\n\n", - argv[0]); - printf("Where: "); - printf("'InputStringFile' is text file of strings to use in test\n\n"); - printf - ("-A is Hash|JLHash|JudySL|JudyHS|Splay|Redblack|Ternary|Print\n"); - printf("\n"); - printf("-n <#> max number of strings to use in tests (all)\n"); - printf("-H <#> is number elements in Hash table\n"); - printf("-P <#> number of measurement points per decade (40)\n"); - printf - ("-T <#> Change the 'Get' number_of_strings to measure per data point\n"); - printf("-D Use 'Delete' routine instead of 'FreeArray' routine\n"); - printf("-p pre-zero hash table to fault in all pages\n"); - printf("-r Do not randomize Insert and Get order of strings\n"); - printf("-C Build contigious string buffers for 'Get' tests\n"); - printf("-a Word_t align the start address of input strings\n"); - printf("-M <#> Change the maximum 'strlen(String)' of input Strings\n"); - printf("\n\n"); - - exit(1); - } - -// calculate max number mask used in hash routine - -//============================================================ -// PRINT COMMAND NAME + RUN ARGUMENTS -//============================================================ - - printf("# %s", argv[0]); - if (nStrg != INFSTRGS) - printf(" -n%lu", nStrg); - switch (Method) - { - case M_Hash: - printf(" -A Hash"); - break; - case M_JLHash: - printf(" -A JLHash"); - break; - case M_JudySL: - printf(" -A JudySL"); - break; - case M_JudyHS: - printf(" -A JudyHS"); - break; - case M_Splay: - printf(" -A Splay"); - break; - case M_Redblack: - printf(" -A Redblack"); - break; - case M_Ternary: - printf(" -A Ternary"); - break; - default: - break; - } - if (HTblsz) - printf(" -H%lu", HTblsz); - printf(" -P%lu", PtsPdec); - printf(" -L%d", Passes); - if (pFlag) - printf(" -p"); - if (rFlag) - printf(" -r"); - if (DFlag) - printf(" -D"); - if (CFlag) - printf(" -C"); - printf(" -M%d", MLength); - printf(" %s", argv[fileidx]); - printf("\n"); - -// print some header - - printf("# This file is in a format to input to 'jbgraph'\n"); - printf("# XLABEL Stored\n"); - printf("# YLABEL Microseconds / Index\n"); - printf("# COLHEAD 1 Total Insert attempts\n"); - printf("# COLHEAD 2 Number Gets\n"); - printf("# COLHEAD 3 Duplicate strings\n"); - printf("# COLHEAD 4 Insert Time (uS)\n"); - printf("# COLHEAD 5 Get Time (uS)\n"); - printf("# COLHEAD 6 Hash Chain Length\n"); - printf("# COLHEAD 7 Average RAM/String\n"); - -// uname(2) strings describing the machine - { - struct utsname ubuf; // for system name - - if (uname(&ubuf) == -1) - printf("# Uname(2) failed\n"); - else - printf("# %s %s %s %s %s\n", ubuf.sysname, ubuf.nodename, - ubuf.release, ubuf.version, ubuf.machine); - } - if (sizeof(Word_t) == 8) - printf("# 64 Bit CPU\n"); - else if (sizeof(Word_t) == 4) - printf("# 32 Bit CPU\n"); -#ifdef CPUMHZ - printf("# Processor speed compiled at %d Mhz\n", CPUMHZ); -#endif // CPUMHZ - - if (Method == M_Hash) - printf("# Hash record struct: sizeof(hrec_t) = %d\n", sizeof(hrec_t)); - if (Method == M_Ternary) - printf("# Ternary record struct: sizeof(Tnode) = %d\n", sizeof(Tnode)); - -// OPEN INPUT FILE: - - if ((fid = fopen(argv[fileidx], "r")) == NULL) - FILERROR; - - for (StrTot = Strlen = LineCnt = 0; (Chr = fgetc(fid)) != EOF;) - { - if (Chr == '\n') - { - if (Strlen) // eat zero length lines - { - if (Strlen > MLength) - Strlen = MLength; - LineCnt++; // increase string count - Strlen++; // add a \0 for JudySL - - if (aFlag) // for word alignment - StrTot += ROUNDUPWORD(Strlen); - else - StrTot += Strlen; // memory needed to store strings - - if (LineCnt == nStrg) // shorten if required by -n option - break; - - Strlen = 0; - } - } - else - { - Strlen++; - } - } - fclose(fid); - fid = NULL; - nStrg = LineCnt; // adj if necessary - -// get struct to keep track of the strings - StringMemory = sizeof(dt_t) * nStrg; - Pdt = (Pdt_t) malloc(sizeof(dt_t) * nStrg); - if (Pdt == NULL) - MALLOCERROR; - -// get memory to store the strings - StringMemory += StrTot; - PCurStr = (uint8_t *) malloc(StrTot); - if (PCurStr == NULL) - MALLOCERROR; - -// BRING FILE INTO RAM, COUNT LINES and CHECK LENGTH - -//============================================================ -// CALCULATE NUMBER OF MEASUREMENT GROUPS -- points per decade -//============================================================ - -// Calculate Multiplier for number of points per decade - Mult = pow(10.0, 1.0 / (double)PtsPdec); - { - double sum; - Word_t numb, prevnumb; - -// Count number of measurements needed (10K max) - sum = numb = 1; - for (Groups = 2; Groups < 10000; Groups++) - if (NextNumb(&numb, &sum, Mult, nStrg)) - break; - -// Get memory for measurements - Pms = (Pms_t) calloc(Groups, sizeof(ms_t)); - if (Pms == NULL) - MALLOCERROR; - -// Now calculate number of Indexes for each measurement point - numb = sum = 1; - prevnumb = 0; - for (grp = 0; grp < Groups; grp++) - { - Pms[grp].ms_delta = numb - prevnumb; - Pms[grp].ms_mininsert = 10000000.0; // infinity - Pms[grp].ms_minretrive = 10000000.0; // infinity - Pms[grp].ms_Bytes = 0.0; - - prevnumb = numb; - - NextNumb(&numb, &sum, Mult, nStrg); - } - } // Groups = number of sizes - -// print remaining header - - if (Method == M_Hash) - { - printf("# Allocate Hash table = %lu elements\n", HTblsz); - } - if (Method == M_JLHash) - { - if (HTblsz) - printf("# JLHash table virtual size = %lu\n", HTblsz); - else - printf("# JLHash table virtual size = 4294967296\n"); - } - -//======================================================================= -// Read text input file into RAM -//======================================================================= - - if ((fid = fopen(argv[fileidx], "r")) == NULL) - FILERROR; - - for (Strlen = LineCnt = 0; LineCnt < nStrg;) - { - Chr = fgetc(fid); - if (Chr == '\n') - { - if (Strlen) // eat zero length lines - { - if (Strlen > MLength) - Strlen = MLength; - Pdt[LineCnt].dt_string = PCurStr - Strlen; - Pdt[LineCnt].dt_strlen = Strlen; - LineCnt++; - - Strlen = 0; - *PCurStr++ = '\0'; // for JudySL - if (aFlag) // for word alignment - PCurStr = (uint8_t *) ROUNDUPWORD((Word_t)PCurStr); - - if ((Word_t)PCurStr % sizeof(Word_t)) - aCount++; - } - } - else - { - if (Strlen < MLength) - { - Strlen++; - if (Chr == '\0') - Chr = ' '; // for JudySL - *PCurStr++ = (uint8_t) Chr; - } - } - } - fclose(fid); - fid = NULL; - assert(nStrg == LineCnt); - - printf("# %lu (%.1f%%) non-Word_t aligned string buffers\n", - aCount, (double)aCount / (double)LineCnt * 100.0); - - printf("# Ram used for input data = %lu bytes\n", StringMemory); - - printf("# Average string length = %.1f bytes\n", - (double)(StrTot - LineCnt) / LineCnt); - -// Allocate memory for Cached assess to 'Get' (largest delta). This flag -// will put the 'randomized' 'Get' order strings in a sequential buffer. -// Modern processors will 'read ahead' with an access to RAM is sequential -// -- thus saving the 'Get' having to bring the string into cache. - if (CFlag) - { - PdtS_ = (Pdt_t) malloc(TValues * sizeof(dt_t)); - if (PdtS_ == NULL) - MALLOCERROR; - -// now guess how much memory will be needed for the strings - Strsiz_ = ((StrTot / nStrg) * TValues); - Strsiz_ += Strsiz_; // bump %20 - - Strbuf_ = (uint8_t *) malloc(Strsiz_); - if (Strbuf_ == NULL) - MALLOCERROR; - - printf - ("# %lu bytes malloc() for 'cached' strings for Get measurement\n", - Strsiz_); - } - -//======================================================================= -// TIME GETSTRING() from Cache (most of the time) -//======================================================================= - - STARTTm(tm); // start timer - for (LineCnt = 0; LineCnt < nStrg; LineCnt++) - { - GETSTRING(PCurStr, Strlen); - Strlen = Pdt[LineCnt].dt_strlen; - PCurStr = Pdt[LineCnt].dt_string; - - if (strlen(PCurStr) != Strlen) // bring string into Cache - { -// necessary to prevent cc from optimizing out - printf(" !! OOps Bug, wrong string length\n"); - exit(1); - } - } - ENDTm(DeltaUSec, tm); // end timer - - printf - ("# Access Time = %6.3f uS average per string (mostly from Cache)\n", - DeltaUSec / nStrg); - -//======================================================================= -// TIME GETSTRING() + HASHSTR() from Cache (most of the time) -//======================================================================= - - STARTTm(tm); // start timer - for (LineCnt = 0; LineCnt < nStrg; LineCnt++) - { - uint32_t hval; - GETSTRING(PCurStr, Strlen); - PCurStr = Pdt[LineCnt].dt_string; - Strlen = Pdt[LineCnt].dt_strlen; - hval = HASHSTR(PCurStr, Strlen, HTblsz); - if (foolflag) - printf("OOps foolflag is set, hval = %d\n", hval); - } - ENDTm(DeltaUSec, tm); // end timer - - printf - ("# HashStr() Time = %6.3f uS average per string (mostly from Cache)\n", - DeltaUSec / nStrg); - -// randomize the input strings (adjacent strings will not be on same page) - - if (rFlag == 0) - { - Randomize(Pdt, nStrg); // Randomize ALL to be stored - -//======================================================================= -// TIME GETSTRING() from RAM (most of the time) -//======================================================================= - - STARTTm(tm); // start timer - for (LineCnt = 0; LineCnt < nStrg; LineCnt++) - { - GETSTRING(PCurStr, Strlen); - Strlen = Pdt[LineCnt].dt_strlen; - PCurStr = Pdt[LineCnt].dt_string; - - if (strlen(PCurStr) != Strlen) // bring string into Cache - { -// necessary to prevent cc from optimizing out - printf(" !! OOps Bug, wrong string length\n"); - exit(1); - } - } - ENDTm(DeltaUSec, tm); // end timer - - printf - ("# Access Time = %6.3f uS average per string (mostly from RAM)\n", - DeltaUSec / nStrg); - -//======================================================================= -// TIME GETSTRING() + HASHSTR() from RAM (most of the time) -//======================================================================= - - STARTTm(tm); // start timer - for (LineCnt = 0; LineCnt < nStrg; LineCnt++) - { - uint32_t hval; - GETSTRING(PCurStr, Strlen); - Strlen = Pdt[LineCnt].dt_strlen; - PCurStr = Pdt[LineCnt].dt_string; - hval = HASHSTR(PCurStr, Strlen, HTblsz); - if (foolflag) - printf("OOps foolflag is set, hval = %u\n", hval); - } - ENDTm(DeltaUSec, tm); // end timer - - printf - ("# HashStr() Time = %6.3f uS average per string (mostly from RAM)\n", - DeltaUSec / nStrg); - } - -//======================================================================= -// Insert, Get and Delete loops -//======================================================================= - - for (Pass = 0; Pass < Passes; Pass++) - { - printf("# Pass %d\n", Pass); - -// heading of table - Printf - ("# TotInserts DeltaGets DupStrs InsTime GetTime HChainLen Ram/String\n"); - gStored = 0; // number of strings inserted - StrNumb = 0; // number of attempted strings inserted - - STARTmem; // current malloc() mem usage - for (grp = 0; grp < Groups; grp++) - { - PWord_t PValue; - Word_t Begin = gStored; // remember current STOREed - Word_t Delta = Pms[grp].ms_delta; - - switch (Method) - { - case M_Print: - { - STARTTm(tm); // start timer - for (lines = 0; lines < Delta; lines++, StrNumb++) - { - GETSTRING(PCurStr, Strlen); - PCurStr = Pdt[StrNumb].dt_string; - Printf("%s\n", (char *)PCurStr); - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - case M_Hash: - { - STARTTm(tm); // start timer - for (lines = 0; lines < Delta; lines++, StrNumb++) - { - GETSTRING(PCurStr, Strlen); - Strlen = Pdt[StrNumb].dt_strlen; - PCurStr = Pdt[StrNumb].dt_string; - - PValue = HashIns(&HRoot, PCurStr, Strlen, HTblsz); - if ((*PValue)++ == 0) - gStored++; // number of strings stored - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - case M_JLHash: - { - STARTTm(tm); // start timer - for (lines = 0; lines < Delta; lines++, StrNumb++) - { - GETSTRING(PCurStr, Strlen); - Strlen = Pdt[StrNumb].dt_strlen; - PCurStr = Pdt[StrNumb].dt_string; - PValue = JLHashIns(&JLHash, PCurStr, Strlen, HTblsz); - if ((*PValue)++ == 0) - gStored++; // number of strings stored - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - case M_JudySL: - { - STARTTm(tm); // start timer - for (lines = 0; lines < Delta; lines++, StrNumb++) - { - GETSTRING(PCurStr, Strlen); - PCurStr = Pdt[StrNumb].dt_string; - - JSLI(PValue, JudySL, PCurStr); // insert string - if ((*PValue)++ == 0) - gStored++; // number of strings stored - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - case M_JudyHS: - { - STARTTm(tm); // start timer - for (lines = 0; lines < Delta; lines++, StrNumb++) - { - GETSTRING(PCurStr, Strlen); - Strlen = Pdt[StrNumb].dt_strlen; - PCurStr = Pdt[StrNumb].dt_string; - - JHSI(PValue, JudyHS, PCurStr, Strlen); // insert string - if ((*PValue)++ == 0) - gStored++; // number of strings stored - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - -// NOTE: the ADT's below here are so slow, that I did not add much effort -// to clean them up. (dlb) - - case M_Splay: - { - STARTTm(tm); // start timer - for (lines = 0; lines < Delta; lines++, StrNumb++) - { - GETSTRING(PCurStr, Strlen); - PCurStr = Pdt[StrNumb].dt_string; - - splayinsert(&spans, (char *)PCurStr); - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - case M_Redblack: - { - STARTTm(tm); // start timer - for (lines = 0; lines < Delta; lines++, StrNumb++) - { - GETSTRING(PCurStr, Strlen); - PCurStr = Pdt[StrNumb].dt_string; - - redblackinsert(&rbans, (char *)PCurStr); - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - case M_Ternary: - { - STARTTm(tm); // start timer - for (lines = 0; lines < Delta; lines++, StrNumb++) - { - GETSTRING(PCurStr, Strlen); - Strlen = Pdt[StrNumb].dt_strlen; - PCurStr = Pdt[StrNumb].dt_string; - - TernaryIns(&Ternary, PCurStr, Strlen); - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - default: - assert(0); // cant happen - break; - } - ENDmem(DeltaMem); // current malloc() mem usage - - ReadLin = StrNumb; // adjust delta - if (ReadLin > TValues) - ReadLin = TValues; -// if (Delta > TValues) -// ReadLin = Delta; // use the Delta - - Printf(" %11lu", StrNumb); // Total stored - Printf(" %10lu", ReadLin); // Number to read back - Begin = gStored - Begin; // actual STORED - assert(lines == Delta); - Printf(" %8lu", Delta - Begin); // Duplicate strings - -// Average time per line to store (including duplicate strings) - Mult = DeltaUSec / (double)Delta; - - if (Mult < Pms[grp].ms_mininsert) - Pms[grp].ms_mininsert = Mult; - - Printf(" %7.3f", Mult); - -// Bytes allocated thru malloc() - if (TotalJudyMalloc == 0) - Pms[grp].ms_Bytes = (double)DeltaMem; - else - Pms[grp].ms_Bytes = (double)(TotalJudyMalloc * sizeof(Word_t)); - - Pms[grp].ms_Bytes /= (double)gStored; - - fflush(stdout); - -//======================================================================= -// READ BACK LOOP -//======================================================================= - - Pdts = Pdt; // Strings to 'Get' - gChainln = 0; // total chain lengths - - if (rFlag == 0) - { - Randomize(Pdt, StrNumb); // Randomize ONLY those stored - - if (CFlag) - { -// Allocate and make sequencial string buffer - Pdts = BuildSeqBuf(Pdt, ReadLin); - } - } - switch (Method) - { - case M_Print: - break; - case M_Hash: - { - STARTTm(tm); // start timer - for (lines = 0; lines < ReadLin; lines++) - { - GETSTRING(PCurStr, Strlen); - Strlen = Pdts[lines].dt_strlen; - PCurStr = Pdts[lines].dt_string; - - PValue = HashGet(HRoot, PCurStr, Strlen); // get string - assert(PValue != NULL); - assert(*PValue > 0); - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - case M_JLHash: - { - STARTTm(tm); // start timer - for (lines = 0; lines < ReadLin; lines++) - { - GETSTRING(PCurStr, Strlen); - Strlen = Pdts[lines].dt_strlen; - PCurStr = Pdts[lines].dt_string; - - PValue = JLHashGet(JLHash, PCurStr, Strlen); // get string - assert(PValue != NULL); - assert(*PValue > 0); - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - case M_JudySL: - { - STARTTm(tm); // start timer - for (lines = 0; lines < ReadLin; lines++) - { - GETSTRING(PCurStr, Strlen); - PCurStr = Pdts[lines].dt_string; - - JSLG(PValue, JudySL, PCurStr); // get string - assert(PValue != NULL); - assert(*PValue > 0); - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - case M_JudyHS: - { - STARTTm(tm); // start timer - for (lines = 0; lines < ReadLin; lines++) - { - GETSTRING(PCurStr, Strlen); - Strlen = Pdts[lines].dt_strlen; - PCurStr = Pdts[lines].dt_string; - - JHSG(PValue, JudyHS, PCurStr, Strlen); // get string - assert(PValue != NULL); - assert(*PValue > 0); - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - -// NOTE: the ADT's below here are so slow, that I did not add much effort -// to clean them up. (dlb) - - case M_Splay: - { - STARTTm(tm); // start timer - for (lines = 0; lines < ReadLin; lines++) - { - GETSTRING(PCurStr, Strlen); - PCurStr = Pdts[lines].dt_string; - - splaysearch(&spans, (char *)PCurStr); - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - case M_Redblack: - { - STARTTm(tm); // start timer - for (lines = 0; lines < ReadLin; lines++) - { - GETSTRING(PCurStr, Strlen); - PCurStr = Pdts[lines].dt_string; - - redblacksearch(&rbans, (char *)PCurStr); - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - case M_Ternary: - { - STARTTm(tm); // start timer - for (lines = 0; lines < ReadLin; lines++) - { - GETSTRING(PCurStr, Strlen); - Strlen = Pdts[lines].dt_strlen; - PCurStr = Pdts[lines].dt_string; - - if (TernaryGet(Ternary, PCurStr, Strlen) == 0) - { - printf("\n OOps - Ternary Bug at Line = %d\n", - __LINE__); - exit(1); - } - } - ENDTm(DeltaUSec, tm); // end timer - break; - } - default: - assert(0); // cant happen - break; - } - Mult = DeltaUSec / (double)ReadLin; - -// save least value - if (Mult < Pms[grp].ms_minretrive) - Pms[grp].ms_minretrive = Mult; - - Printf(" %7.3f", Mult); // RETRIVE per string - Printf(" %9.6f", (double)gChainln / (double)ReadLin); - -// RAM USED PER STRING TO STORE DATA - - Printf(" %13.1f", (double)Pms[grp].ms_Bytes); - Printf("\n"); - fflush(stdout); - } - if (Method == M_Print) - exit(0); - - Printf("# Total Duplicate strings = %lu\n", nStrg - gStored); - -//======================================================================= -// Delete loop -//======================================================================= - - DeltaUSec = -1.0; // set deleted flag - - if (rFlag == 0) - { - Randomize(Pdt, StrNumb); // Randomize ONLY those stored - } - switch (Method) - { - case M_JudySL: - { - if (DFlag) - { - Printf("# Begin JudySLDel() loop...\n"); - STARTTm(tm); // start timer - for (lines = 0; lines < nStrg; lines++) - { - int Rc; - GETSTRING(PCurStr, Strlen); - PCurStr = Pdt[lines].dt_string; - JSLD(Rc, JudySL, PCurStr); // delete string - assert(Rc != JERR); - } - ENDTm(DeltaUSec, tm); // end timer - } - else - { - Printf("# Begin JudySLFreeArray()...\n"); - STARTTm(tm); // start timer - JSLFA(Bytes, JudySL); - ENDTm(DeltaUSec, tm); // end timer - } - break; - } - case M_JudyHS: - { - if (DFlag) - { - int Rc; - Printf("# Begin JudyHSDel() loop..."); - STARTTm(tm); // start timer - for (lines = 0; lines < nStrg; lines++) - { - GETSTRING(PCurStr, Strlen); - Strlen = Pdt[lines].dt_strlen; - PCurStr = Pdt[lines].dt_string; - JHSD(Rc, JudyHS, PCurStr, Strlen); // Delete string - assert(Rc != JERR); - } - ENDTm(DeltaUSec, tm); // end timer - } - else - { - Printf("# Begin JudyHSFreeArray()...\n"); - STARTTm(tm); // start timer - JHSFA(Bytes, JudyHS); - ENDTm(DeltaUSec, tm); // end timer - } - break; - } - case M_Hash: - { - if (DFlag) - { - Printf("# Begin HashDel() loop...\n"); - STARTTm(tm); // start timer - for (lines = 0; lines < nStrg; lines++) - { - GETSTRING(PCurStr, Strlen); - Strlen = Pdt[lines].dt_strlen; - PCurStr = Pdt[lines].dt_string; - HashDel(&HRoot, PCurStr, Strlen); // Delete string - } - ENDTm(DeltaUSec, tm); // end timer - } - else - { - Printf("# Begin HashFreeArray()...\n"); - STARTTm(tm); // start timer - Bytes = HashFreeArray(&HRoot); - ENDTm(DeltaUSec, tm); // end timer - } - break; - } - case M_JLHash: - { - if (DFlag) - { - Printf("# Begin JLHashDel() loop...\n"); - STARTTm(tm); // start timer - for (lines = 0; lines < nStrg; lines++) - { - GETSTRING(PCurStr, Strlen); - Strlen = Pdt[lines].dt_strlen; - PCurStr = Pdt[lines].dt_string; - JLHashDel(&JLHash, PCurStr, Strlen); // Delete string - } - ENDTm(DeltaUSec, tm); // end timer - } - else - { - Printf("# Begin JLHashFreeArray()...\n"); - STARTTm(tm); // start timer - Bytes = JLHashFreeArray(&JLHash); - ENDTm(DeltaUSec, tm); // end timer - } - break; - } - default: - printf("# Delete not implemented yet, so quit\n"); - Passes = 1; // No, delete, so quit - break; - } -// average time per line to delete (including duplicate strings) - if (Bytes) // Measured freed bytes? - { - Printf("# returned %lu bytes\n", Bytes); - } - if (TotalJudyMalloc) // Any bytes left after free? - { - printf - ("# !!! BUG, %lu bytes not deleted in *Free()\n", - TotalJudyMalloc * sizeof(Word_t)); - } - if (DeltaUSec != -1.0) // Measured how long to free? - { - Printf("# Free %lu strings, %0.3f uSecs Ave/string\n", - gStored, DeltaUSec / (double)gStored); - } - Printf("\n"); - } - - if (Passes != 1) - { - printf("# TotInserts 0 0 InsTime GetTime 0 Ram/String\n"); - StrNumb = 0; - for (grp = 0; grp < Groups; grp++) - { - StrNumb += Pms[grp].ms_delta; - - printf(" %11lu", StrNumb); // Total stored - printf(" 0 0"); // place holder - printf(" %7.3f", Pms[grp].ms_mininsert); - printf(" %7.3f", Pms[grp].ms_minretrive); - printf(" 0"); // place holder - printf(" %7.3f", Pms[grp].ms_Bytes); - printf("\n"); - } - } - exit(0); // done -} // main() diff --git a/libjudy/test/jbgraph b/libjudy/test/jbgraph deleted file mode 100755 index 564b2d8897..0000000000 --- a/libjudy/test/jbgraph +++ /dev/null @@ -1,1022 +0,0 @@ -#!/bin/sh - -# THIS SCRIPT IS A "WRAPPER" FOR: gnuplot -# -# - The data used is in "gnuplot" format to compare and contrast -# - information for analysis in the Judy project. Circa: 05/12/2000. - -# Author: Bob Gobeille, # Original functionality. -# Jer/ Eberhard, # Ongoing maintenance, added functionality. - - RCS_SCRIPT=' -# @(#) $Revision: 2.24 $ $Source: /judy/src/apps/benchmark/jbgraph $ -' - - -# SET VERBOSE TO QUIET, SILENT (DEFAULT): -# -# - then find out if verbose mode is to be set. - - OPT_v="${OPT_v:--q}" # Set verbose off, (default). - v='eval #' # Set verbose off, (quiet). - - VERBOSE="`echo ${*} | tr ' ' '\012' | grep -- -v`" - if [ "${VERBOSE}" = "-v" ]; then # -v verbose mode on. - OPT_v="${VERBOSE}" # Will be "-v". - v="" # Set verbose on. - fi - unset VERBOSE # Unset after last use. - - -# CREATE NAMESPACE: -# -# - Set names of OUTPUT and WORK directories and files. - - C="`basename ${0:-jbgraph}`" # Command name of this script. - C_PATH="${0}" # Called via this path. - C_rc=".${C}.rc" # .rc file, local or ${HOME}. - OUTPUT_DIR=./tmp/`echo ${C} | tr "[a-z]" "[A-Z]"` # output name in caps - - mkdir -p ${OUTPUT_DIR} # Create output directory. - if [ ! -d "${OUTPUT_DIR}" ]; then # Ensure dir exists. - echo "${C}.${0}: ERROR, unable to: mkdir -p ${OUTPUT_DIR}" - exit 3 - fi - - -# UNCOMMENT THE DATE_TIME FORMAT YOU WANT TO USE: - - #DATE_TIME="`date +%y%m`" # Monthly Date/Time stamp. - #DATE_TIME="`date +%y%m%d`" # Daily Date/Time stamp. - DATE_TIME="`date +%y%m%d.%H%M`" # HourMinute Date/Time stamp. - - COMMAND="${OUTPUT_DIR}/${DATE_TIME}" # Output filename date/time stamp. - WORK1="${COMMAND}.WORK1.$$" # Work file 1. - WORK2="${COMMAND}.WORK2.$$" # Work file 2. - WORK3="${COMMAND}.WORK3.$$" # Work file 3. - WORK4="${COMMAND}.WORK4.$$" # Work file 4. - - -# CREATE AND DISPLAY SCRIPT DEFAULTS AND INFO: - - export GNU_CMDFILE="${GNU_CMDFILE:-$COMMAND.GNU_CMDFILE}" # GNU_CMDFILE name - ${v}touch ${COMMAND} # Ensure the output file exists. - # Produce sample monitor and print commands. - INFO="`echo \"${C}: follow output, or print by: - rerun by executing the first commented line in: - ${GNU_CMDFILE} - head -1 ${GNU_CMDFILE} # or - tail -f ${COMMAND} # tail and follow log file or - tail ${COMMAND} # tail log file or print: - fold -80 ${COMMAND} | - pr -f -l66 -h${COMMAND} | - remsh jerslash -l jer lp -odouble -o2\"`" - if [ "${OPT_v}" = "-v" ]; then # -v verbose mode. - echo "${INFO}" - fi - - -# DEFINE DEFAULTS, CONSTANTS, VARIABLES: -# -# - 80 Column line---------------------------------------------------01234567890 - -# Break line: BL is 70 columns of "-". - - BL="----------------------------------------------------------------------" - - EXT_OPT="${EXT_OPT:-}" # Allow external option setting. - -# GNU_GEOMETRY default: -# - Note, this will respect an environment variable, which could be set as: -# - export OPT_JBGRAPH_geometry="600x450+20+20" # 4x3 aspect ratio. - - OPT_JBGRAPH_geometry="${OPT_JBGRAPH_geometry:-1000x750+20+20}" - GNU_GEOMETRY_DEF="1000x750+20+20" # 4x3 aspect ratio, default. - GNU_GEOMETRY="-geometry ${OPT_JBGRAPH_geometry:-$GNU_GEOMETRY_DEF}" - -# GNU_PSFILE name, (default): - - GNU_PSFILE="${OPT_JBGRAPH_psfile:-$COMMAND.GNU_PSFILE}" - - LP_DEV_DEF="${LP_DEV:-pastel}" # Printer device (default). - LP_OPT_DEF="${LP_OPT:--olandscape}" # Printer options (default). - -# PLOT AXIS NAMES: - - XLABEL="${XLABEL:-Population}" # Set default. - YLABEL_MALLOC="${YLABEL:-Bytes}" # Set default. - YLABEL_TIME="${YLABEL:-USec/index}" # Set default. - YLABEL="${YLABEL:-$YLABEL_TIME}" # Set default. - -# ARRAY OF COLUMN NAMES: -# -# - Add column names here (from benchutils.c). -# - These are the column names displayed on "gnuplot". - - CHA[0]="CHA=COLUMN HEADINGS ARRAY" - CHA[1]="index number" - CHA[2]="insert time per index" - CHA[3]="dT/dI insert" - CHA[4]="retrieve time per index" - CHA[5]="dT/dI retrieve" - CHA[6]="bytes used" - CHA[8]="bytes free" - CHA[9]="bytes alloced" - CHA[7]="dM/dI change in memory per index" - CHA[10]="leaf count" - CHA[11]="leaf average size" - CHA[12]="leaf memory used per index" - CHA[13]="branch count" - CHA[14]="branch average size" - CHA[15]="branch memory used per index" - CHA[16]="" - CHA[17]="" - CHA[18]="" - CHA[19]="" - CHA[21]="" - CHA[22]="" - CHA[23]="" - CHA[24]="" - CHA[25]="" - CHA[26]="" - CHA[27]="" - CHA[28]="" - CHA[29]="" - CHA[30]="" - CHA[31]="" - CHA[32]="" - CHA[33]="" - CHA[34]="" - CHA[35]="" - CHA[36]="" - CHA[37]="" - CHA[38]="" - CHA[39]="" - CHA[40]="" - CHA[41]="" - CHA[42]="" - CHA[43]="" - CHA[44]="" - CHA[45]="" - CHA[46]="" - CHA[47]="" - CHA[48]="" - CHA[49]="" - CHA[50]="" - - CMN="0" # Column number for CHA data. - -# -# SET DEFAULT OPTIONS: -# - - OPT_E="-E" # -E use embedded options - OPT_L="-L" # -L set logscale axis - OPT_L_xaxis="x" # -L set logscale x axis - OPT_L_yaxis="y" # -L set logscale y axis - OPT_H="-H" # -H default column headings. - - -# M A I N: MAIN PROGRAM: -# -# - Begin main script, functions first. - -{ - -FUNCTION__getopt() # Use function getopt. -{ -# PARSE THE COMMAND LINE FOR OPTIONS, USING GETOPT: -# -# - define USAGE message. -# - use getopts. -# Note: FUNCTION__getopt is run twice, in order to support: -# FUNCTION_TITLE_COLHEAD() # Set Column headings from file. - - ${v}echo "${C}.${0}: beginning at `date`" # beginning of function - - USAGE="${C} [ -E -G -H -I -M -S -V -i -l -m -q -r -u -v ] - [ -C GNU_CMDFILE ] - [ -D LP_DEV ] - [ -L axis ] - [ -N not option ] (turn off option), Example: -NL - [ -P GNU_PSFILE ] - [ -c COLUMN_NUMBER ] - [ -d differential_type ] - [ -g GNU_GEOMETRY ] - [ -o LP_OPT ] - [ -x xRANGE ] - [ -y yRANGE ] - - ${C}: wrapper for gnuplot - - -c plot column number. This is useful to plot by column number. - -i plot insert; default if no other plots selected. CMN=2 - -r plot retrievals; default if no other plots selected. CMN=4 - -I plot memory used / index. CMN=12 - -m plot memory malloced. CMN=9 - -M plot memory used and free. CMN=8 - -l plot leaf data. CMN=11 - -d plot derivative data. Useful with -i, -r, -m. CMN=2,4,9 - - -x xRANGE, scale range; example: -x [1000:5000] or -x1000:5000 - -y yRANGE, scale range; example: -y [1M:10M] or -y1M:10M - 1[kK] = 1,000; 1[mM] = 1,000,000; 1[gG] = 1,000,000,000. - - -n number plot descriptions; Use column numbers before the description. - -L set logscale axis; default, - Example: Turn off logscale with -NL, then turn on, on only one axis: - \"-NL -Lx\" or \"-NL -Ly\", Turn off both with -NL - -G grid lines on. - -H default column headings. - -g geometry description. - default=\"${GNU_GEOMETRY_DEF}\", # 4x3 aspect ratio. - - -E use embedded options, default, Turn off with -NE. - Sets TITLE, COLHEAD, GETOPT from the FIRST data file encountered. - Example: embedded options in the data file begin in column 1: - # TITLE This is the title to pass to gnuplot - # COLHEAD 1 This is the heading for column 1. - # XLABEL This is the x-axis label - # YLABEL This is the y-axis label - # GETOPT -c2 -c3 -G # These are the options to use. - - -p print the plot. - -o LP_OPT printer option(s); default \"${LP_OPT_DEF}\". - Example: \"-ootray2\" will print on clear slides, emits \"-otray2\" - Example: \"-on2\" will print two copies, emits \"-n2\" - -D LP_DEV printer device; default \"${LP_DEV_DEF}\". - - -C GNU_CMDFILE name; default is generated and removed: - ${OUTPUT_DIR}/{DATE_TIME}.GNU_CMDFILE - Useful to do your own gnuplot command editing and debugging. - -P GNU_PSFILE name. default is generated and removed: - ${OUTPUT_DIR}/{DATE_TIME}.GNU_PSFILE - -S Save files. - Generated and working file names are deleted unless -S or -C is on. - User provided file names are not deleted in any case (-C, -P). - - -q quiet mode, verbose mode off; default. - -v verbose mode on. - - -V vi the plot file. - quit using \"q\" - - -N not option; Turn specified option off. Example: -NL - Note, -N is not available for all options. - -NL Turn off: -L set logscale axis; default - -NH Turn off: -H default column headings. - - -u Usage message. - - Sample usage: - ${C} -i -f data/datafile # -i is the same as -c1. - ${C} -c1 -f data/datafile # -i is the same as -c1. - - " - - ${v}echo "${C}.${0}: OPTIONS=${*}" - -# Parse options, using getopt: -# -# - "a" option, no parameter; "b:" indicates a parameter. -# - Order of options is "man 5 ascii". - - getopt_PARM="?C:D:EGIL:MN:P:SVc:d:g:ilmno:prsuvx:y:" - set -- `getopt ${getopt_PARM} $*` # Place options in argc/argv. - if [ "${?}" != "0" ]; then # If getopt returns an errror. - ${v}echo "${C}.${0}: \${?}=${?}, USAGE message from return code." - echo "${USAGE}" - exit 1 - fi - - while [ ${#} -gt 0 ] # while there are options... - do # ( for vi parenthesis matching - ${v}echo "${C}.${0}: parsing option \"${1}\", then \"${2}\"" - case ${1} in - - -C) - OPT_C="${1}" - OPT_C_PARM="${2}" # GNU_CMDFILE name. - ${v}echo "${C}.${0}: OPT_C=${OPT_C}, # -C GNU_CMDFILE name." - ${v}echo "${C}.${0}: OPT_C_PARM=${OPT_C_PARM}, # GNU_CMDFILE name." - export GNU_CMDFILE="${OPT_C_PARM}" - MSG="# GNU_CMDFILE name." - ${v}echo "${C}.${0}: GNU_CMDFILE=${GNU_CMDFILE}, ${MSG}" - shift - ;; # ( for vi parenthesis matching - - -D) - OPT_D="${1}" - OPT_D_PARM="${2}" # LP_DEV name. - ${v}echo "${C}.${0}: OPT_D=${OPT_D}, # -D LP_DEV printer device." - #${v}echo "${C}.${0}: OPT_D_PARM=${OPT_D_PARM}, # LP_DEV name." - LP_DEV="${OPT_D_PARM}" - ${v}echo "${C}.${0}: LP_DEV=${LP_DEV}, # LP_DEV name." - shift - ;; # ( for vi parenthesis matching - - -E) - OPT_E="${1}" - ${v}echo "${C}.${0}: OPT_E=${OPT_E}, # -E use embedded options" - ;; # ( for vi parenthesis matching - - -G) - OPT_G="${1}" - ${v}echo "${C}.${0}: OPT_G=${OPT_G}, # -G grid lines on." - ;; # ( for vi parenthesis matching - - -H) - OPT_H="${1}" - ${v}echo "${C}.${0}: OPT_H=${OPT_H}, # -H default column headings." - ;; # ( for vi parenthesis matching - - -I) - OPT_I="${1}" - ${v}echo "${C}.${0}: OPT_I=${OPT_I}, # -I Memory used / index." - CMN="12" - COL[$CMN]="${CMN}" - ${v}echo "${C}.${0}: COL[$CMN]=${COL[$CMN]}" - ;; # ( for vi parenthesis matching - - -L) - OPT_L="${1}" - ${v}echo "${C}.${0}: OPT_L=${OPT_L}, -L set logscale axis" - OPT_L_PARM="${2}" # axis name, x or y - if [ ${OPT_L_PARM} = "x" ]; then - OPT_L_xaxis="${OPT_L_PARM}" - elif [ ${OPT_L_PARM} = "y" ]; then - OPT_L_yaxis="${OPT_L_PARM}" - else - MSG="must be either \"x\" or \"y\" axis. exit 5" - echo "${C}.${0}: ERROR, OPT_L_PARM=${OPT_L_PARM} ${MSG}" - exit 5 - fi - OPT_NL="" # -L turn off -NL. - shift - ;; # ( for vi parenthesis matching - - -M) - OPT_M="${1}" - ${v}echo "${C}.${0}: OPT_M=${OPT_M}, # -M Memory used and free." - CMN="8" - COL[$CMN]="${CMN}" - ${v}echo "${C}.${0}: COL[$CMN]=${COL[$CMN]}" - ;; # ( for vi parenthesis matching - - -N) - OPT_N="${1}" - OPT_N_PARM="${2}" # LP_DEV name. - ${v}echo "${C}.${0}: OPT_N=${OPT_N}, # -N not option" - ${v}echo "${C}.${0}: OPT_N_PARM=${OPT_N_PARM}, # Turn option off." - if [ "${OPT_N_PARM}" = "E" ]; then - OPT_E="" # -E use embedded options - OPT_NE="-NE" # -NE turn off -E. - elif [ "${OPT_N_PARM}" = "L" ]; then - OPT_L="" # -L set logscale axis - OPT_L_xaxis="" - OPT_L_yaxis="" - OPT_NL="-NL" # -NL turn off -L. - elif [ "${OPT_N_PARM}" = "G" ]; then - OPT_G="" # -G grid lines on. - OPT_NG="-NG" # -NG turn off -G. - elif [ "${OPT_N_PARM}" = "H" ]; then - OPT_H="" # -H default column headings. - OPT_NH="-NH" # -NH turn off -H. - fi - shift - ;; # ( for vi parenthesis matching - - -P) - OPT_P="${1}" - OPT_P_PARM="${2}" # GNU_PSFILE name. - ${v}echo "${C}.${0}: OPT_P=${OPT_P}, # -P GNU_PSFILE name." - #${v}echo "${C}.${0}: OPT_P_PARM=${OPT_P_PARM}, # GNU_PSFILE name." - GNU_PSFILE="${OPT_P_PARM}" - ${v}echo "${C}.${0}: GNU_PSFILE=${GNU_PSFILE}, # GNU_PSFILE name." - shift - ;; # ( for vi parenthesis matching - - -S) - OPT_S="${1}" - ${v}echo "${C}.${0}: OPT_S=${OPT_S}, # -S save files." - ;; # ( for vi parenthesis matching - - -V) - OPT_V="${1}" - ${v}echo "${C}.${0}: OPT_V=${OPT_V}, # -V vi the plot file." - ;; # ( for vi parenthesis matching - - -c) - OPT_c="${1}" - OPT_c_PARM="${2}" # COLUMN_NUMBER. - ${v}echo "${C}.${0}: OPT_c=${OPT_c}, # -c plot column number." - ${v}echo "${C}.${0}: OPT_c_PARM=${OPT_c_PARM}, # COLUMN_NUMBER." - if [ ${OPT_c_PARM} -ge ${#CHA[*]} ] || - [ ${OPT_c_PARM} -le 0 ]; then - MSG="must be greater than 0 and less than ${#CHA[*]}. exit 6" - echo "${C}.${0}: ERROR, OPT_c_PARM=${OPT_c_PARM} ${MSG}" - exit 6 - fi - CMN="${OPT_c_PARM}" - COL[$CMN]="${CMN}" - ${v}echo "${C}.${0}: COL[$CMN]=${COL[$CMN]}" - shift - ;; # ( for vi parenthesis matching - - -d) - OPT_d="${1}" - OPT_d_PARM="${2}" # DERIVATIVE_TYPE - ${v}echo "${C}.${0}: OPT_d=${OPT_d}, # -d plot derivative type." - ${v}echo "${C}.${0}: OPT_d_PARM=${OPT_d_PARM}, # DERIVITIVE_TYPE" - if [ "${OPT_d_PARM}" = "i" ]; then - OPT_di="${OPT_d_PARM}" - CMN="3" - elif [ "${OPT_d_PARM}" = "m" ]; then - OPT_dm="${OPT_d_PARM}" - CMN="7" - elif [ "${OPT_d_PARM}" = "r" ]; then - OPT_dr="${OPT_d_PARM}" - CMN="5" - else - echo "${C}.${0}: ERROR, ${OPT_d_PARM} must be one of i, m, r." - fi - COL[$CMN]="${CMN}" - ${v}echo "${C}.${0}: COL[$CMN]=${COL[$CMN]}" - shift - ;; # ( for vi parenthesis matching - - -g) - OPT_g="${1}" - OPT_g_PARM="${2}" # Option parameter - ${v}echo "${C}.${0}: OPT_g=${OPT_g}, # -g geometry description." - ${v}echo "${C}.${0}: OPT_g_PARM=${OPT_g_PARM}, # window geometry" - GNU_GEOMETRY="-geometry ${OPT_g_PARM}" # Environment geometry. - MSG="# window geometry" - ${v}echo "${C}.${0}: GNU_GEOMETRY=${GNU_GEOMETRY}, ${MSG}" - shift - ;; # ( for vi parenthesis matching - - -i) - OPT_i="${1}" - ${v}echo "${C}.${0}: OPT_i=${OPT_i}, # -i plot insert." - CMN="2" - COL[$CMN]="${CMN}" - ${v}echo "${C}.${0}: COL[$CMN]=${COL[$CMN]}" - ;; # ( for vi parenthesis matching - - -l) - OPT_l="${1}" - ${v}echo "${C}.${0}: OPT_l=${OPT_l}, # -l plot leaf data." - CMN="10" - COL[$CMN]="${CMN}" - ${v}echo "${C}.${0}: COL[$CMN]=${COL[$CMN]}" - CMN="11" - COL[$CMN]="${CMN}" - ${v}echo "${C}.${0}: COL[$CMN]=${COL[$CMN]}" - ;; # ( for vi parenthesis matching - - -m) - OPT_m="${1}" - ${v}echo "${C}.${0}: OPT_m=${OPT_m}, # -m plot memory malloced." - CMN="9" - COL[$CMN]="${CMN}" - ${v}echo "${C}.${0}: COL[$CMN]=${COL[$CMN]}" - ;; # ( for vi parenthesis matching - - -n) - OPT_n="${1}" - MSG="# -n number plot descriptions." - ${v}echo "${C}.${0}: OPT_n=${OPT_n}, ${MSG}" - ;; # ( for vi parenthesis matching - - -o) - OPT_o="${1}" - OPT_o_PARM="${2}" # Option parameter - MSG="# -o LP_OPT printer option(s)." - ${v}echo "${C}.${0}: OPT_o=${OPT_o}, ${MSG}" - MSG="# -o LP_OPT printer option(s)." - ${v}echo "${C}.${0}: OPT_o_PARM=${OPT_o_PARM}, ${MSG}" - # Check for duplicates, only add to LP_OPT if not a duplicate. - LP_SET="`echo ${LP_OPT} | adjust -m1 | grep -- -${OPT_o_PARM}`" - if [ "${LP_SET}" != "-${OPT_o_PARM}" ]; - then - LP_OPT="${LP_OPT} -${OPT_o_PARM}" - fi - unset LP_SET - ${v}echo "${C}.${0}: LP_OPT=${LP_OPT}, # LP_OPT printer option(s)." - shift - ;; # ( for vi parenthesis matching - - -p) - OPT_p="${1}" - ${v}echo "${C}.${0}: OPT_p=${OPT_p}, # -p print the plot." - ;; # ( for vi parenthesis matching - - -q) - OPT_v="${1}" - v='eval #' # Set verbose off (quiet). - ${v}echo "${C}.${0}: OPT_v=${OPT_v}, # -q quiet mode." - ;; # ( for vi parenthesis matching - - -r) - OPT_r="${1}" - ${v}echo "${C}.${0}: OPT_r=${OPT_r}, # -r plot retrieve." - CMN="4" - COL[$CMN]="${CMN}" - ${v}echo "${C}.${0}: COL[$CMN]=${COL[$CMN]}" - ;; # ( for vi parenthesis matching - - -v) - OPT_v="${1}" - v="" # Set verbose on. - ${v}echo "${C}.${0}: OPT_v=${OPT_v}, # -v verbose mode." - ${v}echo - ;; # ( for vi parenthesis matching - - -x) - OPT_x="${1}" - OPT_x_PARM="${2}" # Option parameter - ${v}echo "${C}.${0}: OPT_x=${OPT_x}, # -x xRANGE, scale range." - #${v}echo "${C}.${0}: OPT_x_PARM=${OPT_x_PARM}, # parameter desc." - xRANGE="${OPT_x_PARM}" - ${v}echo "${C}.${0}: xRANGE=${xRANGE}, # parameter desc." - shift - ;; # ( for vi parenthesis matching - - -y) - OPT_y="${1}" - OPT_y_PARM="${2}" # Option parameter - ${v}echo "${C}.${0}: OPT_y=${OPT_y}, # -y yRANGE, scale range." - #${v}echo "${C}.${0}: OPT_y_PARM=${OPT_y_PARM}, # parameter desc." - yRANGE="${OPT_y_PARM}" - ${v}echo "${C}.${0}: yRANGE=${yRANGE}, # parameter desc." - shift - ;; # ( for vi parenthesis matching - - -u) - OPT_u="-u" - ${v}echo "${C}.${0}: OPT_u=${OPT_u}, # -u Usage message." - echo "${USAGE}" - exit 4 - ;; # ( for vi parenthesis matching - - -a) - OPT_a="${1}" - ${v}echo "${C}.${0}: OPT_a=${OPT_a}, # -a Option description." - ;; # ( for vi parenthesis matching - - -b) - OPT_b="${1}" - OPT_b_PARM="${2}" # Option parameter - ${v}echo "${C}.${0}: OPT_b=${OPT_b}, # -b Option description." - ${v}echo "${C}.${0}: OPT_b_PARM=${OPT_b_PARM}, # parameter desc." - shift - ;; # ( for vi parenthesis matching - - --) - shift # Remove the "--". - break - ;; # ( for vi parenthesis matching - - *) - echo "${C}.${0}: Option not understood. \"${1}\"" - echo "USAGE message follows: " - echo "${USAGE}" # USAGE message - exit 2 - ;; - - esac - shift - done - -# The rest of the command line parameters are files: - - # If FILES is already set, leave it alone, else set it. - # This is necessary due running getopt twice, to support parameters - # embedded in the data files. - if [ "${FILES}" = "" ]; then - FILES="${FILES} ${*}" # May result in a blank, " ". - if [ "${FILES}" = " " ]; then # If blank, " ", make it empty. - FILES="" # Make FILES empty again. - fi - ${v}echo "${C}.${0}: FILES=${FILES}" - fi - -# Set default options, if no applicable plot options were set. - COL_CTR="${#COL[*]}" # Columns were turned on. - ${v}echo "COL_CTR=${COL_CTR}, COL=${COL[*]}" - - if [ "${COL_CTR}" = "0" ]; then # Option not set - ${v}echo "${C}.${0}: Setting default options." - FUNCTION__getopt -c2 -c4 # Set default, if no options set. - fi - if [ "${OPT_C}" = "-C" ] || # If -C or -P, ensure -S. - [ "${OPT_P}" = "-P" ]; then - if [ "${OPT_S}" != "-S" ]; then - FUNCTION__getopt -S # -S save files. - fi - fi - -# Save a shar copy of this script, if -S and -v are both on. -# Turned off, may be useful later. - -# if [ ! -z "${OPT_S}" ] && # -S save files. -# [ "${OPT_v}" = "-v" ]; then # -v verbose mode. -# ${v}echo "${C}.${0}: start of shar of script" -# shar -b ${C_PATH} >>${COMMAND}.shar -# ${v}echo "${C}.${0}: end of shar of script\n" -# fi - - ${v}echo "${C}.${0}: completed at `date`\n" # end of function -} # FUNCTION__getopt() # Use function getopt. - -FUNCTION_gnuplot_init() # Initialize gnuplot command file. -{ -# INITIALIZE GNU_CMDFILE -# -# - Pass options to gnuplot. -# - Some options for gnuplot are set here (logscale, autoscale). - - ${v}echo "${C}.${0}: beginning at `date`" # beginning of function - { - echo "# ${C_PATH} ${*}" - echo "# gnuplot ${GNU_GEOMETRY} ${GNU_CMDFILE}" - if [ "${OPT_L}" = "-L" ]; then # -L set logscale axis - echo "set logscale ${OPT_L_xaxis}${OPT_L_yaxis}" - fi - echo "set autoscale xy" - echo "set data style lines" - if [ ! -z "${OPT_G}" ]; then # Turn on grids. - echo "set grid" - fi - -# Naming convention... build some kind of TITLE name, if none given. - - TITLE="${TITLE:-JUDY BENCHMARK: $CMD_LINE }" # Set default. - - echo "set title \"${TITLE}\" 0,0 " - if [ "${xRANGE}" != "" ]; then - echo "set xrange `FUNCTION_units ${xRANGE}`" - XLABEL="${XLABEL} ${xRANGE}" - fi - if [ "${yRANGE}" != "" ]; then - echo "set yrange `FUNCTION_units ${yRANGE}`" - YLABEL="${YLABEL} ${yRANGE}" - fi - echo "set xlabel \"${XLABEL}\" 0,0" - echo "set ylabel \"${YLABEL}\" 0,0" - echo "set label \"${XLOG}\" at 1,1" - } >> ${GNU_CMDFILE} - - ${v}echo "${C}.${0}: completed at `date`\n" # end of function -} # FUNCTION_gnuplot_init() # Initialize gnuplot command file. - -FUNCTION_gnuplot_plot() # Plot these files. -{ -# FORMAT THE PLOT AND REPLOT COMMANDS -# -# - output to GNU_CMDFILE. - - ${v}echo "${C}.${0}: beginning at `date`" # beginning of function - ${v}echo "${C}.${0}: FILES=${*}" - - Fgp_PARM="${*}" # Save what was passed in. - Fgp_FILES="" # Initialize list of good files. - for i in ${Fgp_PARM} - do - if [ -r "$i" ]; then # Check that files are readable. - Fgp_FILES="${Fgp_FILES} ${i}" # Extend the list of good files. - else - echo "${C}.${0}: WARNING: file: ${i} cannot be read, ignored." - fi - done - - let j=1 - while [ ${j} -lt ${#CHA[*]} ] # For each type of plot. - do - for i in ${Fgp_FILES} # For each file. - do - CMN="${COL[$j]}" - if [ ! -z "${CMN}" ]; then - { - MSG="`basename ${i}`" - if [ "${OPT_H}" = "-H" ]; then - echo "${FIRST}plot \"${i}\" using 1:${CMN} t \"${CHA[${CMN}]} ${MSG}\"" - elif [ "${OPT_NH}" = "-NH" ]; then - echo "${FIRST}plot \"${i}\" using 1:${CMN} t \"${MSG}\"" - fi - } >> ${GNU_CMDFILE} - FIRST="re" - fi - done - let j=j+1 - done - -# A bug in gnuplot sometimes prevents all replots from appearing. -# This particularly happens when xrange is used. -# Doing an extra replot will plot everything. - echo replot >> ${GNU_CMDFILE} - - ${v}echo "${C}.${0}: completed at `date`\n" # end of function -} # FUNCTION_gnuplot_plot() # Plot these files. - -FUNCTION_gnuplot_display() # Plots the datapoints. -{ -# DISPLAY PLOT TO SCREEN: - - ${v}echo "${C}.${0}: beginning at `date`" # beginning of function - - if [ "${OPT_V}" = "-V" ]; then - echo "hpterm -e vi -c \"vi ${GNU_CMDFILE} \"" - hpterm -e vi -cvi ${GNU_CMDFILE} & - fi - - if [ "${OPT_v}" = "-v" ]; then # -v verbose mode. - echo "${C}.${0}: executing command: "; echo "\n\ - gnuplot ${GNU_GEOMETRY} ${GNU_CMDFILE}" - fi - -# Add additional parameters as necessary to setup for printing: - if [ "${OPT_p}" = "-p" ]; then - { - echo set terminal postscript landscape color - echo set output \"${GNU_PSFILE}\" - echo replot - } >> ${GNU_CMDFILE} - fi - - LINE="" # External response - while [ "${LINE}" != "q" ] - do - gnuplot ${GNU_GEOMETRY} ${GNU_CMDFILE} - LINE="q" # Setup for quit. - if [ "${OPT_V}" = "-V" ]; then - echo "Pause: press return to vi again, \"q\" to quit ${C}" - read -r LINE - fi - done - - ${v}echo "${C}.${0}: completed at `date`\n" # end of function -} # FUNCTION_gnuplot_display() # Plots the datapoints. - -FUNCTION_gnuplot_print() # -p print the plot. -{ -# -# PRINT THE PLOT. -# -# - uses gnuplot command "replot". - - ${v}echo "${C}.${0}: beginning at `date`" # beginning of function - ${v}echo "${C}.${0}: OPT_p=${OPT_p}, # -p print the plot." - ${v}echo "${C}.${0}: OPT_P=${OPT_P}, # GNU_PSFILE name." - GNU_PSFILE="${GNU_PSFILE:-$GNU_PSFILE_DEF}" - ${v}echo "${C}.${0}: GNU_PSFILE=${GNU_PSFILE}, # GNU_PSFILE name." - - LP_DEV_PARM="-d ${LP_DEV:-$LP_DEV_DEF}" # Printer device parameter. - LP_OPT_PARM="${LP_OPT:-$LP_OPT_DEF}" # Printer option parameters. - - echo "${C}.${0}: executing command: "; echo "\n\ - echo lp ${LP_DEV_PARM} ${LP_OPT_PARM} ${GNU_PSFILE}" - - lp ${LP_DEV_PARM} ${LP_OPT_PARM} ${GNU_PSFILE} - - ${v}echo "${C}.${0}: completed at `date`\n" # end of function -} # FUNCTION_gnuplot_print() # Print the plot. - -FUNCTION_TITLE_COLHEAD() # Set Column headings from file. -{ -# -# Parse the TITLE and COLUMN HEADINGS (CHA) from the data, if available. -# Also parse other settable parameters, if available. -# - - ${v}echo "${C}.${0}: beginning at `date`" # beginning of function - FTC_FILES="${*}" # Local list of file names. - ${v}echo "${C}.${0}: FTC_FILES=${FTC_FILES}" - - # Choose the first readable file. - unset FTC_FILE # Hold the first readable filename. - for F in ${FTC_FILES} /dev/null # /dev/null ensures there is a file. - do - if [ -r "${F}" ] && # Is this file readable? - [ "${FTC_FILE}" = "" ]; then # We do not have one yet? - FTC_FILE="${F}" # Hold the first readable filename. - fi - done - - # If FTC_FILE got set, use it to find TITLE, COLHEAD, XLABEL, YLABEL, et.al. - if [ "${FTC_FILE}" != "" ]; then # Use this file. - # Grab the FIRST TITLE line (head -1) and use it. - TITLE="`grep '^# *TITLE' ${FTC_FILE} | head -1 | - sed -e 's/^# *TITLE *//g'`" - ${v}echo "${C}.${0}: TITLE=${TITLE}" - - # Grab the FIRST XLABEL line (head -1) and use it. - XLABEL="`grep '^# *XLABEL' ${FTC_FILE} | head -1 | - sed -e 's/^# *XLABEL *//g'`" - ${v}echo "${C}.${0}: XLABEL=${XLABEL}" - - # Grab the FIRST YLABEL line (head -1) and use it. - YLABEL="`grep '^# *YLABEL' ${FTC_FILE} | head -1 | - sed -e 's/^# *YLABEL *//g'`" - ${v}echo "${C}.${0}: YLABEL=${YLABEL}" - - # Find each COLHEAD, and put it in the correct CHA[INDEX]. - let i=0 - while [ ${i} -lt ${#CHA[*]} ] # For each COLHEAD - do - # Grab one COLHEAD line at a time, put it into CHA[]. - # Note, "@" not allowed in COLHEAD string. - LINE="`grep \"^#.*COLHEAD\" ${FTC_FILE} | # Find COLHEAD. - sed -e 's/^#.*COLHEAD*//g' \ - -e 's/^ *//g' \ - -e 's/@//g' | # Remove COLHEAD. - expand | sed -e 's/^0*//g' | # Remove leading zeros. - grep ^${i} | # Find a line matching ${i}. - head -1 `" # Make sure there is only 1. - - # Grab the INDEX number, could do numeric check if problems. - INDEX="`echo ${LINE} | cut -d\" \" -f1`" # field 1 is number. - - # If INDEX is not empty, save this COLHEAD. - if [ "${INDEX}" != "" ]; then - # Grab the rest of the line and save it into CHA. - REMAINDER="`echo ${LINE} | sed -e \"s@^${INDEX} *@@g\"`" - CHA[${INDEX}]="${REMAINDER}" - ${v}echo "${C}.${0}: CHA[${INDEX}]=\"${CHA[${INDEX}]}\"" - fi - - let i=i+1 - done - - # GETOPT, pull in options to be set for this data. - GETOPT="`grep '^# *GETOPT' ${FTC_FILE} | head -1 | - sed -e 's/^# *GETOPT *//g'`" - if [ "${GETOPT}" != "" ]; then - FUNCTION__getopt ${GETOPT} # Parse the options. - fi - unset GETOPT - - fi - - ${v}echo "${C}.${0}: completed at `date`\n" # end of function -} # FUNCTION_TITLE_COLHEAD() # Set Column headings from file. - -FUNCTION_n() # -n number plot descriptions. -{ -# ADD COLUMN NUMBER TO EACH ELEMENT IN CHA: -# -# - This is done for comparing plots, and/or debugging. - - ${v}echo "${C}.${0}: beginning at `date`" # beginning of function - ${v}echo "${C}.${0}: OPT_n=${OPT_n}, # -n number plot descriptions" - - let i=0 - while [ ${i} -lt ${#CHA[*]} ] - do - CHA[${i}]="${i} ${CHA[${i}]}" - ${v}echo "${C}.${0}: CHA[${i}]=\"${CHA[${i}]}\"" - let i=i+1 - done - ${v}echo "${C}.${0}: completed at `date`\n" # end of function -} # FUNCTION_n() # -n number plot descriptions. - -FUNCTION_units() # Resolve units. -{ -# -# Expand units of the form 1K to 1000, 1M to 1000000, et.al. -# Used to format the gnuplot parameters xRANGE and yRANGE. -# gnuplot data format: "set xrange [1:1000000]" -# - - Fu_IN="${1}" # Units in. - echo "["${Fu_IN}"]" | - sed -e "s/[kK]/000/g" | # 1,000 - sed -e "s/[mM]/000000/g" | # 1,000,000 - sed -e "s/[gG]/000000000/g" | # 1,000,000,000 - sed -e "s/^\[\[/\["/g | # Ensure single leading bracket. - sed -e "s/\]\]$/\]"/g # Ensure single trailing bracket. -} - -FUNCTION_a() # -a Option description. -{ -# -# Replace with description of this function. -# - - ${v}echo "${C}.${0}: beginning at `date`" # beginning of function - ${v}echo "${C}.${0}: OPT_a=${OPT_a}, # -a Option description." - ${v}echo "${C}.${0}: completed at `date`\n" # end of function -} # - -FUNCTION_b() # -b Option description. -{ -# -# Replace with description of this function. -# - - ${v}echo "${C}.${0}: beginning at `date`" # beginning of function - ${v}echo "${C}.${0}: OPT_b=${OPT_b}, # -b Option description." - MSG="# -b Parameter description." - ${v}echo "${C}.${0}: OPT_b_PARM=${OPT_b_PARM}, ${MSG}" - - if [ -r "${OPT_b_PARM}" ]; then # Ensure this is a file. - echo ${OPT_b_PARM} | - while read -r FILE; do - ${v}echo "${C}.${0}: FILE=${FILE}" - done - else # Or use elif (form of elseif). - ${v}echo "${C}.${0}: ERROR, ${OPT_b_PARM} is not a readable file." - fi - - ${v}echo "${C}.${0}: completed at `date`\n" # end of function -} # - - -# -# MAIN: Main driver, main processing occurs here. -# - - - ${v}echo " \n${C}: beginning at `date`" # page overflow with each start. - - CMD_LINE="${0} ${*}" # Save command called and options. - - FUNCTION__getopt ${*} # Parse the options. - - if [ -z "${OPT_NE}" ] && # Not E is not turned on and E is... - [ ! -z "${OPT_E}" ]; then # -E use embedded options - FUNCTION_TITLE_COLHEAD ${FILES} # Set Column headings from file. - fi - - FUNCTION__getopt ${*} >/dev/null 2>&1 # Parse the options. - - type banner >/dev/null 2>&1 # Check if banner exists. - RC="${?}" # Save return code. - if [ "${RC}" = "0" ]; then # if RC=0, banner exists. - ${v}banner ${C} - fi - - ${v}echo "${C}: RCS_SCRIPT=${RCS_SCRIPT}" - ${v}echo "${C}: PWD=${PWD}" - - if [ ! -z "${OPT_n}" ]; then - FUNCTION_n # -n number plot descriptions. - fi - - # If GNU_CMDFILE exists, use it, do not create it. - if [ ! -f ${GNU_CMDFILE} ]; then # ! -f = if this is not a file. - if [ "${FILES}" = "" ]; then # If no files available - MSG="and GNU_CMDFILE is not a file exit 7" - echo "${C}: ERROR: no FILES to plot! ${MSG}" - exit 7 - break - fi - FUNCTION_gnuplot_init ${*} # Initialize gnuplot command file. - - FUNCTION_gnuplot_plot ${FILES} # Plot these files. - - echo pause -1 \'Pause: press return to continue.\' >> ${GNU_CMDFILE} - echo # Place blank line in log file. - fi - - FUNCTION_gnuplot_display # Plots the datapoints. - - - if [ ! -z "${OPT_p}" ]; then - FUNCTION_gnuplot_print # -p print the plot. - fi - - -# REMOVE FILES, CLEANUP: -# -# Remove the working files and filenames, unless "-S" is on. - - if [ "${OPT_S}" = "-S" ]; then # -S save files. - echo "${C}: saving ${COMMAND}" - echo "${C}: saving ${GNU_CMDFILE}" - if [ "${OPT_p}" = "-p" ]; then - echo "${C}: saving ${GNU_PSFILE}" - fi - else - rm -f ${COMMAND} # Remove generated log file. - rm -f ${GNU_CMDFILE} # Remove generated command file. - rm -f ${GNU_PSFILE} # Remove generated .ps file. - fi - - rm -fr ${COMMAND}.WORK*.$$ # Remove generated work files. - - ${v}echo "${C}: completed at `date`\n^L" - -# Message if -v (verbose): - - if [ "${OPT_v}" = "-v" ]; then # -v verbose mode. - echo "${INFO}" - fi - -# DONE: -# -# - If a log file needs to be kept, uncomment the corresponding (): - -} 2>&1 | tee -a ${COMMAND} # Use during testing. -#) >>${COMMAND} 2>&1 & # Use for production. diff --git a/libjudy/test/malloc-pre2.8a.c b/libjudy/test/malloc-pre2.8a.c deleted file mode 100644 index 87cfa6c4af..0000000000 --- a/libjudy/test/malloc-pre2.8a.c +++ /dev/null @@ -1,5387 +0,0 @@ -/* - [insert usage description etc here] - - preliminary version 2.8.x -*/ - -/* - WIN32 sets up defaults for MS environment and compilers. - Otherwise defaults are for unix. -*/ - -/* #define WIN32 */ - -#ifdef WIN32 - -#define WIN32_LEAN_AND_MEAN -#include - -/* No-op failure action */ -#define MALLOC_FAILURE_ACTION - -/* Win32 doesn't supply or need the following headers */ -#define LACKS_UNISTD_H -#define LACKS_SYS_PARAM_H -#define LACKS_SYS_MMAN_H - -/* Use the supplied emulation of sbrk */ -#define MORECORE sbrk -#define MORECORE_CONTIGUOUS 1 -#define MORECORE_FAILURE ((void*)(-1)) - -/* Use the supplied emulation of mmap and munmap */ -#define HAVE_MMAP 1 -#define MUNMAP_FAILURE (-1) -#define MMAP_CLEARS 1 - -/* These values don't really matter in windows mmap emulation */ -#define MAP_PRIVATE 1 -#define MAP_ANONYMOUS 2 -#define PROT_READ 1 -#define PROT_WRITE 2 - -/* Emulation functions defined at the end of this file */ - -/* If USE_MALLOC_LOCK, use supplied critical-section-based lock functions */ -#ifdef USE_MALLOC_LOCK -static int slwait(int *sl); -static int slrelease(int *sl); -#endif - -static long getpagesize(void); -static long getregionsize(void); -static void *sbrk(long size); -static void *mmap(void *ptr, long size, long prot, long type, long handle, long arg); -static long munmap(void *ptr, long size); - -static void vminfo (unsigned long*free, unsigned long*reserved, unsigned long*committed); -static int cpuinfo (int whole, unsigned long*kernel, unsigned long*user); - -#endif - - -#include - -/* - Void_t* is the pointer type that malloc should say it returns -*/ - -#ifndef Void_t -#define Void_t void -#endif /*Void_t*/ - -#include /* for size_t */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* define LACKS_UNISTD_H if your system does not have a . */ - -/* #define LACKS_UNISTD_H */ - -#ifndef LACKS_UNISTD_H -#include -#endif - -/* define LACKS_SYS_PARAM_H if your system does not have a . */ - -/* #define LACKS_SYS_PARAM_H */ - - -#include /* needed for malloc_stats */ -#include /* needed for optional MALLOC_FAILURE_ACTION */ - - -/* - Debugging: - - Because freed chunks may be overwritten with bookkeeping fields, this - malloc will often die when freed memory is overwritten by user - programs. This can be very effective (albeit in an annoying way) - in helping track down dangling pointers. - - If you compile with -DDEBUG, a number of assertion checks are - enabled that will catch more memory errors. You probably won't be - able to make much sense of the actual assertion errors, but they - should help you locate incorrectly overwritten memory. The - checking is fairly extensive, and will slow down execution - noticeably. Calling malloc_stats or mallinfo with DEBUG set will - attempt to check every non-mmapped allocated and free chunk in the - course of computing the summmaries. (By nature, mmapped regions - cannot be checked very much automatically.) - - Setting DEBUG may also be helpful if you are trying to modify - this code. The assertions in the check routines spell out in more - detail the assumptions and invariants underlying the algorithms. - - Setting DEBUG does NOT provide an automated mechanism for checking - that all accesses to malloced memory stay within their - bounds. However, there are several add-ons and adaptations of this - or other mallocs available that do this. -*/ - -#if DEBUG -#include -/* #define assert(x) if(!(x)) abort() */ - -#else -#define assert(x) ((void)0) -#endif - -/* - The unsigned integer type used for comparing any two chunk sizes. - This should be at least as wide as size_t, but should not be signed. -*/ - -#ifndef CHUNK_SIZE_T -#define CHUNK_SIZE_T unsigned long -#endif - -#define MAX_CHUNK_SIZE ((CHUNK_SIZE_T)(-1UL)) - -/* - The unsigned integer type used to hold addresses when they are are - manipulated as integers. Except that it is not defined on all - systems, intptr_t would suffice. -*/ -#ifndef PTR_UINT -#define PTR_UINT unsigned long -#endif - - -/* - INTERNAL_SIZE_T is the word-size used for internal bookkeeping - of chunk sizes. - - The default version is the same as size_t. - - While not strictly necessary, it is best to define this as an - unsigned type, even if size_t is a signed type. This may avoid some - artificial size limitations on some systems. - - On a 64-bit machine, you may be able to reduce malloc overhead by - defining INTERNAL_SIZE_T to be a 32 bit `unsigned int' at the - expense of not being able to handle more than 2^32 of malloced - space. If this limitation is acceptable, you are encouraged to set - this unless you are on a platform requiring 16byte alignments. In - this case the alignment requirements turn out to negate any - potential advantages of decreasing size_t word size. - - Implementors: Beware of the possible combinations of: - - INTERNAL_SIZE_T might be signed or unsigned, might be 32 or 64 bits, - and might be the same width as int or as long - - size_t might have different width and signedness as INTERNAL_SIZE_T - - int and long might be 32 or 64 bits, and might be the same width - To deal with this, most comparisons and difference computations - among INTERNAL_SIZE_Ts should cast them to CHUNK_SIZE_T, being - aware of the fact that casting an unsigned int to a wider long does - not sign-extend. (This also makes checking for negative numbers - awkward.) Some of these casts result in harmless compiler warnings - on some systems. -*/ - -#ifndef INTERNAL_SIZE_T -#define INTERNAL_SIZE_T size_t -#endif - -/* The corresponding word size */ -#define SIZE_SZ (sizeof(INTERNAL_SIZE_T)) - - - -/* - MALLOC_ALIGNMENT is the minimum alignment for malloc'ed chunks. - It must be a power of two at least 2 * SIZE_SZ, even on machines - for which smaller alignments would suffice. It may be defined as - larger than this though. Note however that code and data structures - are optimized for the case of 8-byte alignment. -*/ - - -#ifndef MALLOC_ALIGNMENT -#define MALLOC_ALIGNMENT (2 * SIZE_SZ) -#endif - -/* The corresponding bit mask value */ -#define MALLOC_ALIGN_MASK (MALLOC_ALIGNMENT - 1) - - - -/* - REALLOC_ZERO_BYTES_FREES should be set if a call to - realloc with zero bytes should be the same as a call to free. - Some people think it should. Otherwise, since this malloc - returns a unique pointer for malloc(0), so does realloc(p, 0). -*/ - -/* #define REALLOC_ZERO_BYTES_FREES */ - -/* - TRIM_FASTBINS controls whether free() of a very small chunk can - immediately lead to trimming. Setting to true (1) can reduce memory - footprint, but will almost always slow down programs that use a lot - of small chunks. - - Define this only if you are willing to give up some speed to more - aggressively reduce system-level memory footprint when releasing - memory in programs that use many small chunks. You can get - essentially the same effect by setting MXFAST to 0, but this can - lead to even greater slowdowns in programs using many small chunks. - TRIM_FASTBINS is an in-between compile-time option, that disables - only those chunks bordering topmost memory from being placed in - fastbins. -*/ - -#ifndef TRIM_FASTBINS -#define TRIM_FASTBINS 0 -#endif - - -/* - USE_DL_PREFIX will prefix all public routines with the string 'dl'. - This is necessary when you only want to use this malloc in one part - of a program, using your regular system malloc elsewhere. -*/ - -/* #define USE_DL_PREFIX */ - - -/* - USE_MALLOC_LOCK causes wrapper functions to surround each - callable routine with pthread mutex lock/unlock. - - USE_MALLOC_LOCK forces USE_PUBLIC_MALLOC_WRAPPERS to be defined -*/ - -/* #define USE_MALLOC_LOCK */ - - -/* - If USE_PUBLIC_MALLOC_WRAPPERS is defined, every public routine is - actually a wrapper function that first calls MALLOC_PREACTION, then - calls the internal routine, and follows it with - MALLOC_POSTACTION. This is needed for locking, but you can also use - this, without USE_MALLOC_LOCK, for purposes of interception, - instrumentation, etc. It is a sad fact that using wrappers often - noticeably degrades performance of malloc-intensive programs. -*/ - -#ifdef USE_MALLOC_LOCK -#define USE_PUBLIC_MALLOC_WRAPPERS -#else -/* #define USE_PUBLIC_MALLOC_WRAPPERS */ -#endif - - -/* - Two-phase name translation. - All of the actual routines are given mangled names. - When wrappers are used, they become the public callable versions. - When DL_PREFIX is used, the callable names are prefixed. -*/ - -#ifndef USE_PUBLIC_MALLOC_WRAPPERS -#define cALLOc public_cALLOc -#define fREe public_fREe -#define cFREe public_cFREe -#define mALLOc public_mALLOc -#define mEMALIGn public_mEMALIGn -#define rEALLOc public_rEALLOc -#define vALLOc public_vALLOc -#define pVALLOc public_pVALLOc -#define mALLINFo public_mALLINFo -#define mALLOPt public_mALLOPt -#define mTRIm public_mTRIm -#define mSTATs public_mSTATs -#define mUSABLe public_mUSABLe -#define iCALLOc public_iCALLOc -#define iCOMALLOc public_iCOMALLOc -#endif - -#ifdef USE_DL_PREFIX -#define public_cALLOc dlcalloc -#define public_fREe dlfree -#define public_cFREe dlcfree -#define public_mALLOc dlmalloc -#define public_mEMALIGn dlmemalign -#define public_rEALLOc dlrealloc -#define public_vALLOc dlvalloc -#define public_pVALLOc dlpvalloc -#define public_mALLINFo dlmallinfo -#define public_mALLOPt dlmallopt -#define public_mTRIm dlmalloc_trim -#define public_mSTATs dlmalloc_stats -#define public_mUSABLe dlmalloc_usable_size -#define public_iCALLOc dlindependent_calloc -#define public_iCOMALLOc dlindependent_comalloc -#else /* USE_DL_PREFIX */ -#define public_cALLOc calloc -#define public_fREe free -#define public_cFREe cfree -#define public_mALLOc malloc -#define public_mEMALIGn memalign -#define public_rEALLOc realloc -#define public_vALLOc valloc -#define public_pVALLOc pvalloc -#define public_mALLINFo mallinfo -#define public_mALLOPt mallopt -#define public_mTRIm malloc_trim -#define public_mSTATs malloc_stats -#define public_mUSABLe malloc_usable_size -#define public_iCALLOc independent_calloc -#define public_iCOMALLOc independent_comalloc -#endif /* USE_DL_PREFIX */ - - -/* - HAVE_MEMCPY should be defined if you are not otherwise using - ANSI STD C, but still have memcpy and memset in your C library - and want to use them in calloc and realloc. Otherwise simple - macro versions are defined below. - - USE_MEMCPY should be defined as 1 if you actually want to - have memset and memcpy called. People report that the macro - versions are faster than libc versions on some systems. - - Even if USE_MEMCPY is set to 1, loops to copy/clear small chunks - (of <= 36 bytes) are manually unrolled in realloc and calloc. -*/ - -#define HAVE_MEMCPY - -#ifndef USE_MEMCPY -#ifdef HAVE_MEMCPY -#define USE_MEMCPY 1 -#else -#define USE_MEMCPY 0 -#endif -#endif - - -#if (defined(HAVE_MEMCPY)) -#ifdef WIN32 -/* On Win32 memset and memcpy are already declared in windows.h */ -#else -void* memset(void*, int, size_t); -void* memcpy(void*, const void*, size_t); -#endif -#endif - -/* - MALLOC_FAILURE_ACTION is the action to take before "return 0" when - malloc fails to be able to return memory, either because memory is - exhausted or because of illegal arguments. - - By default, sets errno if running on STD_C platform, else does nothing. -*/ - -#ifndef MALLOC_FAILURE_ACTION -#define MALLOC_FAILURE_ACTION \ - errno = ENOMEM; -#endif - -/* - MORECORE-related declarations. By default, rely on sbrk -*/ - - -#ifdef LACKS_UNISTD_H -#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) -extern Void_t* sbrk(ptrdiff_t); -#endif -#endif - -/* - MORECORE is the name of the routine to call to obtain more memory - from the system. See below for general guidance on writing - alternative MORECORE functions, as well as a version for WIN32 and a - sample version for pre-OSX macos. -*/ - -#ifndef MORECORE -#define MORECORE sbrk -#endif - -/* - MORECORE_FAILURE is the value returned upon failure of MORECORE - as well as mmap. Since it cannot be an otherwise valid memory address, - and must reflect values of standard sys calls, you probably ought not - try to redefine it. -*/ - -#ifndef MORECORE_FAILURE -#define MORECORE_FAILURE (-1) -#endif - -/* - If MORECORE_CONTIGUOUS is true, take advantage of fact that - consecutive calls to MORECORE with positive arguments always return - contiguous increasing addresses. This is true of unix sbrk. Even - if not defined, when regions happen to be contiguous, malloc will - permit allocations spanning regions obtained from different - calls. But defining this when applicable enables some stronger - consistency checks and space efficiencies. -*/ - -#ifndef MORECORE_CONTIGUOUS -#define MORECORE_CONTIGUOUS 1 -#endif - -/* - Define MORECORE_CANNOT_TRIM if your version of MORECORE - cannot release space back to the system when given negative - arguments. This is generally necessary only if you are using - a hand-crafted MORECORE function that cannot handle negative arguments. -*/ - -/* #define MORECORE_CANNOT_TRIM */ - - -/* - Define HAVE_MMAP as true to optionally make malloc() use mmap() to - allocate very large blocks. These will be returned to the - operating system immediately after a free(). Also, if mmap - is available, it is used as a backup strategy in cases where - MORECORE fails to provide space from system. - - This malloc is best tuned to work with mmap for large requests. - If you do not have mmap, operations involving very large chunks (1MB - or so) may be slower than you'd like. -*/ - -#define HAVE_MMAP 0 - -#ifndef HAVE_MMAP -#define HAVE_MMAP 1 -#endif - -#if HAVE_MMAP -/* - Standard unix mmap using /dev/zero clears memory so calloc doesn't - need to. -*/ - -#ifndef MMAP_CLEARS -#define MMAP_CLEARS 1 -#endif - -#else /* no mmap */ -#ifndef MMAP_CLEARS -#define MMAP_CLEARS 0 -#endif -#endif - - -/* - MMAP_AS_MORECORE_SIZE is the minimum mmap size argument to use if - sbrk fails, and mmap is used as a backup (which is done only if - HAVE_MMAP). The value must be a multiple of page size. This - backup strategy generally applies only when systems have "holes" in - address space, so sbrk cannot perform contiguous expansion, but - there is still space available on system. On systems for which - this is known to be useful (i.e. most linux kernels), this occurs - only when programs allocate huge amounts of memory. Between this, - and the fact that mmap regions tend to be limited, the size should - be large, to avoid too many mmap calls and thus avoid running out - of kernel resources. -*/ - -#ifndef MMAP_AS_MORECORE_SIZE -#define MMAP_AS_MORECORE_SIZE (1024 * 1024) -#endif - -/* - Define HAVE_MREMAP to make realloc() use mremap() to re-allocate - large blocks. This is currently only possible on Linux with - kernel versions newer than 1.3.77. -*/ - -#ifndef HAVE_MREMAP -#ifdef linux -#define HAVE_MREMAP 1 -#else -#define HAVE_MREMAP 0 -#endif - -#endif /* HAVE_MMAP */ - - -/* - The system page size. To the extent possible, this malloc manages - memory from the system in page-size units. Note that this value is - cached during initialization into a field of malloc_state. So even - if malloc_getpagesize is a function, it is only called once. - - The following mechanics for getpagesize were adapted from bsd/gnu - getpagesize.h. If none of the system-probes here apply, a value of - 4096 is used, which should be OK: If they don't apply, then using - the actual value probably doesn't impact performance. -*/ - -#ifndef malloc_getpagesize - -#ifndef LACKS_UNISTD_H -# include -#endif - -# ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */ -# ifndef _SC_PAGE_SIZE -# define _SC_PAGE_SIZE _SC_PAGESIZE -# endif -# endif - -# ifdef _SC_PAGE_SIZE -# define malloc_getpagesize sysconf(_SC_PAGE_SIZE) -# else -# if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE) - extern size_t getpagesize(); -# define malloc_getpagesize getpagesize() -# else -# ifdef WIN32 /* use supplied emulation of getpagesize */ -# define malloc_getpagesize getpagesize() -# else -# ifndef LACKS_SYS_PARAM_H -# include -# endif -# ifdef EXEC_PAGESIZE -# define malloc_getpagesize EXEC_PAGESIZE -# else -# ifdef NBPG -# ifndef CLSIZE -# define malloc_getpagesize NBPG -# else -# define malloc_getpagesize (NBPG * CLSIZE) -# endif -# else -# ifdef NBPC -# define malloc_getpagesize NBPC -# else -# ifdef PAGESIZE -# define malloc_getpagesize PAGESIZE -# else /* just guess */ -# define malloc_getpagesize (4096) -# endif -# endif -# endif -# endif -# endif -# endif -# endif -#endif - -/* - This version of malloc supports the standard SVID/XPG mallinfo - routine that returns a struct containing usage properties and - statistics. It should work on any SVID/XPG compliant system that has - a /usr/include/malloc.h defining struct mallinfo. (If you'd like to - install such a thing yourself, cut out the preliminary declarations - as described above and below and save them in a malloc.h file. But - there's no compelling reason to bother to do this.) - - The main declaration needed is the mallinfo struct that is returned - (by-copy) by mallinfo(). The SVID/XPG malloinfo struct contains a - bunch of fields that are not even meaningful in this version of - malloc. These fields are are instead filled by mallinfo() with - other numbers that might be of interest. - - HAVE_USR_INCLUDE_MALLOC_H should be set if you have a - /usr/include/malloc.h file that includes a declaration of struct - mallinfo. If so, it is included; else an SVID2/XPG2 compliant - version is declared below. These must be precisely the same for - mallinfo() to work. The original SVID version of this struct, - defined on most systems with mallinfo, declares all fields as - ints. But some others define as unsigned long. If your system - defines the fields using a type of different width than listed here, - you must #include your system version and #define - HAVE_USR_INCLUDE_MALLOC_H. -*/ - -/* #define HAVE_USR_INCLUDE_MALLOC_H */ - -#ifdef HAVE_USR_INCLUDE_MALLOC_H -#include "/usr/include/malloc.h" -#else - -/* SVID2/XPG mallinfo structure */ - -struct mallinfo { - int arena; /* non-mmapped space allocated from system */ - int ordblks; /* number of free chunks */ - int smblks; /* number of fastbin blocks */ - int hblks; /* number of mmapped regions */ - int hblkhd; /* space in mmapped regions */ - int usmblks; /* maximum total allocated space */ - int fsmblks; /* space available in freed fastbin blocks */ - int uordblks; /* total allocated space */ - int fordblks; /* total free space */ - int keepcost; /* top-most, releasable (via malloc_trim) space */ -}; - -/* - SVID/XPG defines four standard parameter numbers for mallopt, - normally defined in malloc.h. Only one of these (M_MXFAST) is used - in this malloc. The others (M_NLBLKS, M_GRAIN, M_KEEP) don't apply, - so setting them has no effect. But this malloc also supports other - options in mallopt described below. -*/ -#endif - - -/* ---------- description of public routines ------------ */ - -/* - malloc(size_t n) - Returns a pointer to a newly allocated chunk of at least n bytes, or null - if no space is available. Additionally, on failure, errno is - set to ENOMEM on ANSI C systems. - - If n is zero, malloc returns a minumum-sized chunk. (The minimum - size is 16 bytes on most 32bit systems, and 24 or 32 bytes on 64bit - systems.) On most systems, size_t is an unsigned type, so calls - with negative arguments are interpreted as requests for huge amounts - of space, which will often fail. The maximum supported value of n - differs across systems, but is in all cases less than the maximum - representable value of a size_t. -*/ -Void_t* public_mALLOc(size_t); - -/* - free(Void_t* p) - Releases the chunk of memory pointed to by p, that had been previously - allocated using malloc or a related routine such as realloc. - It has no effect if p is null. It can have arbitrary (i.e., bad!) - effects if p has already been freed. - - Unless disabled (using mallopt), freeing very large spaces will - when possible, automatically trigger operations that give - back unused memory to the system, thus reducing program footprint. -*/ -void public_fREe(Void_t*); - -/* - calloc(size_t n_elements, size_t element_size); - Returns a pointer to n_elements * element_size bytes, with all locations - set to zero. -*/ -Void_t* public_cALLOc(size_t, size_t); - -/* - realloc(Void_t* p, size_t n) - Returns a pointer to a chunk of size n that contains the same data - as does chunk p up to the minimum of (n, p's size) bytes, or null - if no space is available. - - The returned pointer may or may not be the same as p. The algorithm - prefers extending p when possible, otherwise it employs the - equivalent of a malloc-copy-free sequence. - - If p is null, realloc is equivalent to malloc. - - If space is not available, realloc returns null, errno is set (if on - ANSI) and p is NOT freed. - - if n is for fewer bytes than already held by p, the newly unused - space is lopped off and freed if possible. Unless the #define - REALLOC_ZERO_BYTES_FREES is set, realloc with a size argument of - zero (re)allocates a minimum-sized chunk. - - Large chunks that were internally obtained via mmap will always - be reallocated using malloc-copy-free sequences unless - the system supports MREMAP (currently only linux). - - The old unix realloc convention of allowing the last-free'd chunk - to be used as an argument to realloc is not supported. -*/ - -Void_t* public_rEALLOc(Void_t*, size_t); - -/* - memalign(size_t alignment, size_t n); - Returns a pointer to a newly allocated chunk of n bytes, aligned - in accord with the alignment argument. - - The alignment argument should be a power of two. If the argument is - not a power of two, the nearest greater power is used. - 8-byte alignment is guaranteed by normal malloc calls, so don't - bother calling memalign with an argument of 8 or less. - - Overreliance on memalign is a sure way to fragment space. -*/ -Void_t* public_mEMALIGn(size_t, size_t); - -/* - valloc(size_t n); - Equivalent to memalign(pagesize, n), where pagesize is the page - size of the system. If the pagesize is unknown, 4096 is used. -*/ -Void_t* public_vALLOc(size_t); - - -/* - mallopt(int parameter_number, int parameter_value) - Sets tunable parameters The format is to provide a - (parameter-number, parameter-value) pair. mallopt then sets the - corresponding parameter to the argument value if it can (i.e., so - long as the value is meaningful), and returns 1 if successful else - 0. SVID/XPG/ANSI defines four standard param numbers for mallopt, - normally defined in malloc.h. Only one of these (M_MXFAST) is used - in this malloc. The others (M_NLBLKS, M_GRAIN, M_KEEP) don't apply, - so setting them has no effect. But this malloc also supports four - other options in mallopt. See below for details. Briefly, supported - parameters are as follows (listed defaults are for "typical" - configurations). - - Symbol param # default allowed param values - M_MXFAST 1 64 0-64 (0 disables fastbins) - M_TRIM_THRESHOLD -1 256*1024 any (-1U disables trimming) - M_TOP_PAD -2 0 any - M_MMAP_THRESHOLD -3 256*1024 any (or 0 if no MMAP support) - M_MMAP_MAX -4 65536 any (0 disables use of mmap) -*/ -int public_mALLOPt(int, int); - - -/* - mallinfo() - Returns (by copy) a struct containing various summary statistics: - - arena: current total non-mmapped bytes allocated from system - ordblks: the number of free chunks - smblks: the number of fastbin blocks (i.e., small chunks that - have been freed but not use resused or consolidated) - hblks: current number of mmapped regions - hblkhd: total bytes held in mmapped regions - usmblks: the maximum total allocated space. This will be greater - than current total if trimming has occurred. - fsmblks: total bytes held in fastbin blocks - uordblks: current total allocated space (normal or mmapped) - fordblks: total free space - keepcost: the maximum number of bytes that could ideally be released - back to system via malloc_trim. ("ideally" means that - it ignores page restrictions etc.) - - Because these fields are ints, but internal bookkeeping may - be kept as longs, the reported values may wrap around zero and - thus be inaccurate. -*/ -struct mallinfo public_mALLINFo(void); - -/* - independent_calloc(size_t n_elements, size_t element_size, Void_t* chunks[]); - - independent_calloc is similar to calloc, but instead of returning a - single cleared space, it returns an array of pointers to n_elements - independent elements that can hold contents of size elem_size, each - of which starts out cleared, and can be independently freed, - realloc'ed etc. The elements are guaranteed to be adjacently - allocated (this is not guaranteed to occur with multiple callocs or - mallocs), which may also improve cache locality in some - applications. - - The "chunks" argument is optional (i.e., may be null, which is - probably the most typical usage). If it is null, the returned array - is itself dynamically allocated and should also be freed when it is - no longer needed. Otherwise, the chunks array must be of at least - n_elements in length. It is filled in with the pointers to the - chunks. - - In either case, independent_calloc returns this pointer array, or - null if the allocation failed. If n_elements is zero and "chunks" - is null, it returns a chunk representing an array with zero elements - (which should be freed if not wanted). - - Each element must be individually freed when it is no longer - needed. If you'd like to instead be able to free all at once, you - should instead use regular calloc and assign pointers into this - space to represent elements. (In this case though, you cannot - independently free elements.) - - independent_calloc simplifies and speeds up implementations of many - kinds of pools. It may also be useful when constructing large data - structures that initially have a fixed number of fixed-sized nodes, - but the number is not known at compile time, and some of the nodes - may later need to be freed. For example: - - struct Node { int item; struct Node* next; }; - - struct Node* build_list() { - struct Node** pool; - int n = read_number_of_nodes_needed(); - if (n <= 0) return 0; - pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0); - if (pool == 0) die(); - // organize into a linked list... - struct Node* first = pool[0]; - for (i = 0; i < n-1; ++i) - pool[i]->next = pool[i+1]; - free(pool); // Can now free the array (or not, if it is needed later) - return first; - } -*/ -Void_t** public_iCALLOc(size_t, size_t, Void_t**); - -/* - independent_comalloc(size_t n_elements, size_t sizes[], Void_t* chunks[]); - - independent_comalloc allocates, all at once, a set of n_elements - chunks with sizes indicated in the "sizes" array. It returns - an array of pointers to these elements, each of which can be - independently freed, realloc'ed etc. The elements are guaranteed to - be adjacently allocated (this is not guaranteed to occur with - multiple callocs or mallocs), which may also improve cache locality - in some applications. - - The "chunks" argument is optional (i.e., may be null). If it is null - the returned array is itself dynamically allocated and should also - be freed when it is no longer needed. Otherwise, the chunks array - must be of at least n_elements in length. It is filled in with the - pointers to the chunks. - - In either case, independent_comalloc returns this pointer array, or - null if the allocation failed. If n_elements is zero and chunks is - null, it returns a chunk representing an array with zero elements - (which should be freed if not wanted). - - Each element must be individually freed when it is no longer - needed. If you'd like to instead be able to free all at once, you - should instead use a single regular malloc, and assign pointers at - particular offsets in the aggregate space. (In this case though, you - cannot independently free elements.) - - independent_comallac differs from independent_calloc in that each - element may have a different size, and also that it does not - automatically clear elements. - - independent_comalloc can be used to speed up allocation in cases - where several structs or objects must always be allocated at the - same time. For example: - - struct Head { ... } - struct Foot { ... } - - void send_message(char* msg) { - int msglen = strlen(msg); - size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) }; - void* chunks[3]; - if (independent_comalloc(3, sizes, chunks) == 0) - die(); - struct Head* head = (struct Head*)(chunks[0]); - char* body = (char*)(chunks[1]); - struct Foot* foot = (struct Foot*)(chunks[2]); - // ... - } - - In general though, independent_comalloc is worth using only for - larger values of n_elements. For small values, you probably won't - detect enough difference from series of malloc calls to bother. - - Overuse of independent_comalloc can increase overall memory usage, - since it cannot reuse existing noncontiguous small chunks that - might be available for some of the elements. -*/ -Void_t** public_iCOMALLOc(size_t, size_t*, Void_t**); - - -/* - pvalloc(size_t n); - Equivalent to valloc(minimum-page-that-holds(n)), that is, - round up n to nearest pagesize. - */ -Void_t* public_pVALLOc(size_t); - -/* - cfree(Void_t* p); - Equivalent to free(p). - - cfree is needed/defined on some systems that pair it with calloc, - for odd historical reasons (such as: cfree is used in example - code in the first edition of K&R). -*/ -void public_cFREe(Void_t*); - -/* - malloc_trim(size_t pad); - - If possible, gives memory back to the system (via negative - arguments to sbrk) if there is unused memory at the `high' end of - the malloc pool. You can call this after freeing large blocks of - memory to potentially reduce the system-level memory requirements - of a program. However, it cannot guarantee to reduce memory. Under - some allocation patterns, some large free blocks of memory will be - locked between two used chunks, so they cannot be given back to - the system. - - The `pad' argument to malloc_trim represents the amount of free - trailing space to leave untrimmed. If this argument is zero, - only the minimum amount of memory to maintain internal data - structures will be left (one page or less). Non-zero arguments - can be supplied to maintain enough trailing space to service - future expected allocations without having to re-obtain memory - from the system. - - Malloc_trim returns 1 if it actually released any memory, else 0. - On systems that do not support "negative sbrks", it will always - rreturn 0. -*/ -int public_mTRIm(size_t); - -/* - malloc_usable_size(Void_t* p); - - Returns the number of bytes you can actually use in - an allocated chunk, which may be more than you requested (although - often not) due to alignment and minimum size constraints. - You can use this many bytes without worrying about - overwriting other allocated objects. This is not a particularly great - programming practice. malloc_usable_size can be more useful in - debugging and assertions, for example: - - p = malloc(n); - assert(malloc_usable_size(p) >= 256); - -*/ -size_t public_mUSABLe(Void_t*); - -/* - malloc_stats(); - Prints on stderr the amount of space obtained from the system (both - via sbrk and mmap), the maximum amount (which may be more than - current if malloc_trim and/or munmap got called), and the current - number of bytes allocated via malloc (or realloc, etc) but not yet - freed. Note that this is the number of bytes allocated, not the - number requested. It will be larger than the number requested - because of alignment and bookkeeping overhead. Because it includes - alignment wastage as being in use, this figure may be greater than - zero even when no user-level chunks are allocated. - - The reported current and maximum system memory can be inaccurate if - a program makes other calls to system memory allocation functions - (normally sbrk) outside of malloc. - - malloc_stats prints only the most commonly interesting statistics. - More information can be obtained by calling mallinfo. - -*/ -void public_mSTATs(); - -/* mallopt tuning options */ - -/* - M_MXFAST is the maximum request size used for "fastbins", special bins - that hold returned chunks without consolidating their spaces. This - enables future requests for chunks of the same size to be handled - very quickly, but can increase fragmentation, and thus increase the - overall memory footprint of a program. - - This malloc manages fastbins very conservatively yet still - efficiently, so fragmentation is rarely a problem for values less - than or equal to the default. The maximum supported value of MXFAST - is 64 (also the default). You wouldn't want it any higher than this - anyway. Fastbins are designed especially for use with many small - structs, objects or strings -- the default handles - structs/objects/arrays with sizes up to 16 4byte fields, or small - strings representing words, tokens, etc. Using fastbins for larger - objects normally worsens fragmentation without improving speed. - - M_MXFAST is set in REQUEST size units. It is internally used in - chunksize units, which adds padding and alignment. You can reduce - M_MXFAST to 0 to disable all use of fastbins. This causes the malloc - algorithm to be a closer approximation of fifo-best-fit in all cases, - not just for larger requests, but will generally cause it to be - slower. -*/ - - -/* M_MXFAST is a standard SVID/XPG tuning option, usually listed in malloc.h */ -#ifndef M_MXFAST -#define M_MXFAST 1 -#endif - -#ifndef DEFAULT_MXFAST -#define DEFAULT_MXFAST 64 -#endif - - -/* - M_TRIM_THRESHOLD is the maximum amount of unused top-most memory - to keep before releasing via malloc_trim in free(). - - Automatic trimming is mainly useful in long-lived programs. - Because trimming via sbrk can be slow on some systems, and can - sometimes be wasteful (in cases where programs immediately - afterward allocate more large chunks) the value should be high - enough so that your overall system performance would improve by - releasing this much memory. - - The trim threshold and the mmap control parameters (see below) - can be traded off with one another. Trimming and mmapping are - two different ways of releasing unused memory back to the - system. Between these two, it is often possible to keep - system-level demands of a long-lived program down to a bare - minimum. For example, in one test suite of sessions measuring - the XF86 X server on Linux, using a trim threshold of 128K and a - mmap threshold of 192K led to near-minimal long term resource - consumption. - - If you are using this malloc in a long-lived program, it should - pay to experiment with these values. As a rough guide, you - might set to a value close to the average size of a process - (program) running on your system. Releasing this much memory - would allow such a process to run in memory. Generally, it's - worth it to tune for trimming rather tham memory mapping when a - program undergoes phases where several large chunks are - allocated and released in ways that can reuse each other's - storage, perhaps mixed with phases where there are no such - chunks at all. And in well-behaved long-lived programs, - controlling release of large blocks via trimming versus mapping - is usually faster. - - However, in most programs, these parameters serve mainly as - protection against the system-level effects of carrying around - massive amounts of unneeded memory. Since frequent calls to - sbrk, mmap, and munmap otherwise degrade performance, the default - parameters are set to relatively high values that serve only as - safeguards. - - The trim value must be greater than page size to have any useful - effect. To disable trimming completely, you can set to - (unsigned long)(-1) - - Trim settings interact with fastbin (MXFAST) settings: Unless - TRIM_FASTBINS is defined, automatic trimming never takes place upon - freeing a chunk with size less than or equal to MXFAST. Trimming is - instead delayed until subsequent freeing of larger chunks. However, - you can still force an attempted trim by calling malloc_trim. - - Also, trimming is not generally possible in cases where - the main arena is obtained via mmap. - - Note that the trick some people use of mallocing a huge space and - then freeing it at program startup, in an attempt to reserve system - memory, doesn't have the intended effect under automatic trimming, - since that memory will immediately be returned to the system. -*/ - -#define M_TRIM_THRESHOLD -1 - -#ifndef DEFAULT_TRIM_THRESHOLD - -#define DEFAULT_TRIM_THRESHOLD (-1U) -/* #define DEFAULT_TRIM_THRESHOLD (256 * 1024) */ -#endif - -/* - M_TOP_PAD is the amount of extra `padding' space to allocate or - retain whenever sbrk is called. It is used in two ways internally: - - * When sbrk is called to extend the top of the arena to satisfy - a new malloc request, this much padding is added to the sbrk - request. - - * When malloc_trim is called automatically from free(), - it is used as the `pad' argument. - - In both cases, the actual amount of padding is rounded - so that the end of the arena is always a system page boundary. - - The main reason for using padding is to avoid calling sbrk so - often. Having even a small pad greatly reduces the likelihood - that nearly every malloc request during program start-up (or - after trimming) will invoke sbrk, which needlessly wastes - time. - - Automatic rounding-up to page-size units is normally sufficient - to avoid measurable overhead, so the default is 0. However, in - systems where sbrk is relatively slow, it can pay to increase - this value, at the expense of carrying around more memory than - the program needs. -*/ - -#define M_TOP_PAD -2 - -#ifndef DEFAULT_TOP_PAD -#define DEFAULT_TOP_PAD (0) -#endif - -/* - M_MMAP_THRESHOLD is the request size threshold for using mmap() - to service a request. Requests of at least this size that cannot - be allocated using already-existing space will be serviced via mmap. - (If enough normal freed space already exists it is used instead.) - - Using mmap segregates relatively large chunks of memory so that - they can be individually obtained and released from the host - system. A request serviced through mmap is never reused by any - other request (at least not directly; the system may just so - happen to remap successive requests to the same locations). - - Segregating space in this way has the benefits that: - - 1. Mmapped space can ALWAYS be individually released back - to the system, which helps keep the system level memory - demands of a long-lived program low. - 2. Mapped memory can never become `locked' between - other chunks, as can happen with normally allocated chunks, which - means that even trimming via malloc_trim would not release them. - 3. On some systems with "holes" in address spaces, mmap can obtain - memory that sbrk cannot. - - However, it has the disadvantages that: - - 1. The space cannot be reclaimed, consolidated, and then - used to service later requests, as happens with normal chunks. - 2. It can lead to more wastage because of mmap page alignment - requirements - 3. It causes malloc performance to be more dependent on host - system memory management support routines which may vary in - implementation quality and may impose arbitrary - limitations. Generally, servicing a request via normal - malloc steps is faster than going through a system's mmap. - - The advantages of mmap nearly always outweigh disadvantages for - "large" chunks, but the value of "large" varies across systems. The - default is an empirically derived value that works well in most - systems. -*/ - -#define M_MMAP_THRESHOLD -3 - -#ifndef DEFAULT_MMAP_THRESHOLD -#define DEFAULT_MMAP_THRESHOLD (-1U) -/*#define DEFAULT_MMAP_THRESHOLD (128 * 1024) */ -#endif - -/* - M_MMAP_MAX is the maximum number of requests to simultaneously - service using mmap. This parameter exists because -. Some systems have a limited number of internal tables for - use by mmap, and using more than a few of them may degrade - performance. - - The default is set to a value that serves only as a safeguard. - Setting to 0 disables use of mmap for servicing large requests. If - HAVE_MMAP is not set, the default value is 0, and attempts to set it - to non-zero values in mallopt will fail. -*/ - -#define M_MMAP_MAX -4 - -#ifndef DEFAULT_MMAP_MAX -#if HAVE_MMAP -#define DEFAULT_MMAP_MAX (65536) -#else -#define DEFAULT_MMAP_MAX (0) -#endif -#endif - -#ifdef __cplusplus -}; /* end of extern "C" */ -#endif - -/* - ======================================================================== - To make a fully customizable malloc.h header file, cut everything - above this line, put into file malloc.h, edit to suit, and #include it - on the next line, as well as in programs that use this malloc. - ======================================================================== -*/ - -/* #include "malloc.h" */ - -/* --------------------- public wrappers ---------------------- */ - -#ifdef USE_PUBLIC_MALLOC_WRAPPERS - -/* Declare all routines as internal */ -static Void_t* mALLOc(size_t); -static void fREe(Void_t*); -static Void_t* rEALLOc(Void_t*, size_t); -static Void_t* mEMALIGn(size_t, size_t); -static Void_t* vALLOc(size_t); -static Void_t* pVALLOc(size_t); -static Void_t* cALLOc(size_t, size_t); -static Void_t** iCALLOc(size_t, size_t, Void_t**); -static Void_t** iCOMALLOc(size_t, size_t*, Void_t**); -static void cFREe(Void_t*); -static int mTRIm(size_t); -static size_t mUSABLe(Void_t*); -static void mSTATs(); -static int mALLOPt(int, int); -static struct mallinfo mALLINFo(void); - -/* - MALLOC_PREACTION and MALLOC_POSTACTION should be - defined to return 0 on success, and nonzero on failure. - The return value of MALLOC_POSTACTION is currently ignored - in wrapper functions since there is no reasonable default - action to take on failure. -*/ - - -#ifdef USE_MALLOC_LOCK - -#ifdef WIN32 - -static int mALLOC_MUTEx; -#define MALLOC_PREACTION slwait(&mALLOC_MUTEx) -#define MALLOC_POSTACTION slrelease(&mALLOC_MUTEx) - -#else - -#include - -static pthread_mutex_t mALLOC_MUTEx = PTHREAD_MUTEX_INITIALIZER; - -#define MALLOC_PREACTION pthread_mutex_lock(&mALLOC_MUTEx) -#define MALLOC_POSTACTION pthread_mutex_unlock(&mALLOC_MUTEx) - -#endif /* USE_MALLOC_LOCK */ - -#else - -/* Substitute anything you like for these */ - -#define MALLOC_PREACTION (0) -#define MALLOC_POSTACTION (0) - -#endif - -Void_t* public_mALLOc(size_t bytes) { - Void_t* m; - if (MALLOC_PREACTION != 0) { - return 0; - } - m = mALLOc(bytes); - if (MALLOC_POSTACTION != 0) { - } - return m; -} - -void public_fREe(Void_t* m) { - if (MALLOC_PREACTION != 0) { - return; - } - fREe(m); - if (MALLOC_POSTACTION != 0) { - } -} - -Void_t* public_rEALLOc(Void_t* m, size_t bytes) { - if (MALLOC_PREACTION != 0) { - return 0; - } - m = rEALLOc(m, bytes); - if (MALLOC_POSTACTION != 0) { - } - return m; -} - -Void_t* public_mEMALIGn(size_t alignment, size_t bytes) { - Void_t* m; - if (MALLOC_PREACTION != 0) { - return 0; - } - m = mEMALIGn(alignment, bytes); - if (MALLOC_POSTACTION != 0) { - } - return m; -} - -Void_t* public_vALLOc(size_t bytes) { - Void_t* m; - if (MALLOC_PREACTION != 0) { - return 0; - } - m = vALLOc(bytes); - if (MALLOC_POSTACTION != 0) { - } - return m; -} - -Void_t* public_pVALLOc(size_t bytes) { - Void_t* m; - if (MALLOC_PREACTION != 0) { - return 0; - } - m = pVALLOc(bytes); - if (MALLOC_POSTACTION != 0) { - } - return m; -} - -Void_t* public_cALLOc(size_t n, size_t elem_size) { - Void_t* m; - if (MALLOC_PREACTION != 0) { - return 0; - } - m = cALLOc(n, elem_size); - if (MALLOC_POSTACTION != 0) { - } - return m; -} - - -Void_t** public_iCALLOc(size_t n, size_t elem_size, Void_t** chunks) { - Void_t** m; - if (MALLOC_PREACTION != 0) { - return 0; - } - m = iCALLOc(n, elem_size, chunks); - if (MALLOC_POSTACTION != 0) { - } - return m; -} - -Void_t** public_iCOMALLOc(size_t n, size_t sizes[], Void_t** chunks) { - Void_t** m; - if (MALLOC_PREACTION != 0) { - return 0; - } - m = iCOMALLOc(n, sizes, chunks); - if (MALLOC_POSTACTION != 0) { - } - return m; -} - -void public_cFREe(Void_t* m) { - if (MALLOC_PREACTION != 0) { - return; - } - cFREe(m); - if (MALLOC_POSTACTION != 0) { - } -} - -int public_mTRIm(size_t s) { - int result; - if (MALLOC_PREACTION != 0) { - return 0; - } - result = mTRIm(s); - if (MALLOC_POSTACTION != 0) { - } - return result; -} - -size_t public_mUSABLe(Void_t* m) { - size_t result; - if (MALLOC_PREACTION != 0) { - return 0; - } - result = mUSABLe(m); - if (MALLOC_POSTACTION != 0) { - } - return result; -} - -void public_mSTATs() { - if (MALLOC_PREACTION != 0) { - return; - } - mSTATs(); - if (MALLOC_POSTACTION != 0) { - } -} - -struct mallinfo public_mALLINFo() { - struct mallinfo m; - if (MALLOC_PREACTION != 0) { - struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - return nm; - } - m = mALLINFo(); - if (MALLOC_POSTACTION != 0) { - } - return m; -} - -int public_mALLOPt(int p, int v) { - int result; - if (MALLOC_PREACTION != 0) { - return 0; - } - result = mALLOPt(p, v); - if (MALLOC_POSTACTION != 0) { - } - return result; -} - -#endif - - - -/* ------------- Optional versions of memcopy ---------------- */ - - -#if USE_MEMCPY - -/* - Note: memcpy is ONLY invoked with non-overlapping regions, - so the (usually slower) memmove is not needed. -*/ - -#define MALLOC_COPY(dest, src, nbytes) memcpy(dest, src, nbytes) -#define MALLOC_ZERO(dest, nbytes) memset(dest, 0, nbytes) - -#else /* !USE_MEMCPY */ - -/* Use Duff's device for good zeroing/copying performance. */ - -#define MALLOC_ZERO(charp, nbytes) \ -do { \ - INTERNAL_SIZE_T* mzp = (INTERNAL_SIZE_T*)(charp); \ - CHUNK_SIZE_T mctmp = (nbytes)/sizeof(INTERNAL_SIZE_T); \ - long mcn; \ - if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp %= 8; } \ - switch (mctmp) { \ - case 0: for(;;) { *mzp++ = 0; \ - case 7: *mzp++ = 0; \ - case 6: *mzp++ = 0; \ - case 5: *mzp++ = 0; \ - case 4: *mzp++ = 0; \ - case 3: *mzp++ = 0; \ - case 2: *mzp++ = 0; \ - case 1: *mzp++ = 0; if(mcn <= 0) break; mcn--; } \ - } \ -} while(0) - -#define MALLOC_COPY(dest,src,nbytes) \ -do { \ - INTERNAL_SIZE_T* mcsrc = (INTERNAL_SIZE_T*) src; \ - INTERNAL_SIZE_T* mcdst = (INTERNAL_SIZE_T*) dest; \ - CHUNK_SIZE_T mctmp = (nbytes)/sizeof(INTERNAL_SIZE_T); \ - long mcn; \ - if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp %= 8; } \ - switch (mctmp) { \ - case 0: for(;;) { *mcdst++ = *mcsrc++; \ - case 7: *mcdst++ = *mcsrc++; \ - case 6: *mcdst++ = *mcsrc++; \ - case 5: *mcdst++ = *mcsrc++; \ - case 4: *mcdst++ = *mcsrc++; \ - case 3: *mcdst++ = *mcsrc++; \ - case 2: *mcdst++ = *mcsrc++; \ - case 1: *mcdst++ = *mcsrc++; if(mcn <= 0) break; mcn--; } \ - } \ -} while(0) - -#endif - -/* ------------------ MMAP support ------------------ */ - - -#if HAVE_MMAP - -#include -#ifndef LACKS_SYS_MMAN_H -#include -#endif - -#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) -#define MAP_ANONYMOUS MAP_ANON -#endif - -/* - Nearly all versions of mmap support MAP_ANONYMOUS, - so the following is unlikely to be needed, but is - supplied just in case. -*/ - -#ifndef MAP_ANONYMOUS - -static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */ - -#define MMAP(addr, size, prot, flags) ((dev_zero_fd < 0) ? \ - (dev_zero_fd = open("/dev/zero", O_RDWR), \ - mmap((addr), (size), (prot), (flags), dev_zero_fd, 0)) : \ - mmap((addr), (size), (prot), (flags), dev_zero_fd, 0)) - -#else - -#define MMAP(addr, size, prot, flags) \ - (mmap((addr), (size), (prot), (flags)|MAP_ANONYMOUS, -1, 0)) - -#endif - - -#endif /* HAVE_MMAP */ - - -/* - ----------------------- Chunk representations ----------------------- -*/ - - -/* - This struct declaration is misleading (but accurate and necessary). - It declares a "view" into memory allowing access to necessary - fields at known offsets from a given base. See explanation below. -*/ - -struct malloc_chunk { - - INTERNAL_SIZE_T prev_size; /* Size of previous chunk (if free). */ - INTERNAL_SIZE_T size; /* Size in bytes, including overhead. */ - - struct malloc_chunk* fd; /* double links -- used only if free. */ - struct malloc_chunk* bk; -}; - - -typedef struct malloc_chunk* mchunkptr; - -/* conversion from malloc headers to user pointers, and back */ -#define chunk2mem(p) ((Void_t*)((char*)(p) + 2*SIZE_SZ)) -#define mem2chunk(mem) ((mchunkptr)((char*)(mem) - 2*SIZE_SZ)) - -/* - malloc_chunk details: - - (The following includes lightly edited explanations by Colin Plumb.) - - Chunks of memory are maintained using a `boundary tag' method as - described in e.g., Knuth or Standish. (See the paper by Paul - Wilson ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps for a - survey of such techniques.) Sizes of free chunks are stored both - in the front of each chunk and at the end. This makes - consolidating fragmented chunks into bigger chunks very fast. The - size fields also hold bits representing whether chunks are free or - in use. - - An allocated chunk looks like this: - - - chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Size of previous chunk, if allocated | | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Size of chunk, in bytes |P| - mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | User data starts here... . - . . - . (malloc_usable_space() bytes) . - . | -nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - `foot:' | Size of chunk | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - - Where "chunk" is the front of the chunk for the purpose of most of - the malloc code, but "mem" is the pointer that is returned to the - user. "Nextchunk" is the beginning of the next contiguous chunk. - - Chunks always begin on even word boundries, so the mem portion - (which is returned to the user) is also on an even word boundary, and - thus at least double-word aligned. - - - The P (PREV_INUSE) bit, stored in the unused low-order bit of the - chunk size (which is always a multiple of two words), is an in-use - bit for the *previous* chunk. If that bit is *clear*, then the - word before the current chunk size contains the previous chunk - size, and can be used to find the front of the previous chunk. - The very first chunk allocated always has this bit set, - preventing access to non-existent (or non-owned) memory. If - prev_inuse is set for any given chunk, then you CANNOT determine - the size of the previous chunk, and might even get a memory - addressing fault when trying to do so. - - Note that the `foot' of the current chunk is actually represented - as the prev_size of the NEXT chunk. This makes it easier to - deal with alignments etc but can be very confusing when trying - to extend or adapt this code. - - The two exceptions to all this are - - 1. The special chunk `top' doesn't bother using the - trailing size field since there is no next contiguous chunk - that would have to index off it. After initialization, `top' - is forced to always exist. If it would become less than - MINSIZE bytes long, it is replenished. - - 2. Chunks allocated via mmap, which have the second-lowest-order - bit (IS_MMAPPED) set in their size fields. Because they are - allocated one-by-one, each must contain its own trailing size field. - -*/ - - - -/* - --------------- Operations on size fields --------------- -*/ - - -/* size field is or'ed with PREV_INUSE when previous adjacent chunk in use */ -#define PREV_INUSE 0x1 - -#if HAVE_MMAP -/* size field is or'ed with IS_MMAPPED if the chunk was obtained with mmap */ -#define IS_MMAPPED 0x2 -#else -#define IS_MMAPPED 0 -#endif - -/* extract inuse bit of previous chunk */ -#define prev_inuse(p) ((p)->size & PREV_INUSE) - -/* check for mmap()'ed chunk */ -#define chunk_is_mmapped(p) ((p)->size & IS_MMAPPED) - -/* - Bits to mask off when extracting size - - Note: IS_MMAPPED is intentionally not masked off from size field in - macros for which mmapped chunks should never be seen. This should - cause helpful core dumps to occur if it is tried by accident by - people extending or adapting this malloc. -*/ -#define SIZE_BITS (PREV_INUSE|IS_MMAPPED) - -/* Get size, ignoring use bits */ -#define chunksize(p) ((CHUNK_SIZE_T)((p)->size & ~(SIZE_BITS))) - - -/* Ptr to next physical malloc_chunk. */ -#define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->size & ~PREV_INUSE))) - -/* Ptr to previous physical malloc_chunk */ -#define prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_size) )) - -/* Treat space at ptr + offset as a chunk */ -#define chunk_at_offset(p, s) ((mchunkptr)(((char*)(p)) + (s))) - -/* extract p's inuse bit */ -#define inuse(p)\ -((((mchunkptr)(((char*)(p))+((p)->size & ~PREV_INUSE)))->size) & PREV_INUSE) - -/* set/clear chunk as being inuse without otherwise disturbing */ -#define set_inuse(p)\ -((mchunkptr)(((char*)(p)) + ((p)->size & ~PREV_INUSE)))->size |= PREV_INUSE - -#define clear_inuse(p)\ -((mchunkptr)(((char*)(p)) + ((p)->size & ~PREV_INUSE)))->size &= ~(PREV_INUSE) - - -/* check/set/clear inuse bits in known places */ -#define inuse_bit_at_offset(p, s)\ - (((mchunkptr)(((char*)(p)) + (s)))->size & PREV_INUSE) - -#define inuse_addr_at_offset(p, s)\ - (INTERNAL_SIZE_T*)(&(((mchunkptr)(((char*)(p)) + (s)))->size)) - -#define set_inuse_bit_at_offset(p, s)\ - (((mchunkptr)(((char*)(p)) + (s)))->size |= PREV_INUSE) - -#define clear_inuse_bit_at_offset(p, s)\ - (((mchunkptr)(((char*)(p)) + (s)))->size &= ~(PREV_INUSE)) - - -/* Set size at head, without disturbing its use bit */ -#define set_head_size(p, s) ((p)->size = (((p)->size & PREV_INUSE) | (s))) - -/* Set size/use field */ -#define set_head(p, s) ((p)->size = (s)) - -/* Set size at footer (only when chunk is not in use) */ -#define set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_size = (s)) - - -/* - ---------- Size and alignment checks and conversions ---------- -*/ - - -/* The smallest possible chunk */ -#define MIN_CHUNK_SIZE (sizeof(struct malloc_chunk)) - -/* The smallest size we can malloc is an aligned minimal chunk */ - -#define MINSIZE \ - (CHUNK_SIZE_T)(((MIN_CHUNK_SIZE+MALLOC_ALIGN_MASK) & ~MALLOC_ALIGN_MASK)) - -/* Check if m has acceptable alignment */ - -#define aligned_OK(m) (((PTR_UINT)((m)) & (MALLOC_ALIGN_MASK)) == 0) - - -/* - Check if a request is so large that it would wrap around zero when - padded and aligned. To simplify some other code, the bound is made - low enough so that adding MINSIZE will also not wrap around sero. -*/ - -#define MAX_REQUEST_SIZE ((CHUNK_SIZE_T)(INTERNAL_SIZE_T)(-2 * MINSIZE)) - -#define request_out_of_range(req) \ - ((CHUNK_SIZE_T)(req) >= MAX_REQUEST_SIZE) - -/* pad request bytes into a usable size -- internal version */ - -#define request2size(req) \ - (((req) + SIZE_SZ + MALLOC_ALIGN_MASK < MINSIZE) ? \ - MINSIZE : \ - ((req) + SIZE_SZ + MALLOC_ALIGN_MASK) & ~MALLOC_ALIGN_MASK) - - -#define pad_request(req) \ - (((req) + SIZE_SZ + MALLOC_ALIGN_MASK) & ~MALLOC_ALIGN_MASK) - -/* Same, except also perform argument check */ - -#define checked_request2size(req, sz) \ - if (request_out_of_range(req)) { \ - MALLOC_FAILURE_ACTION; \ - return 0; \ - } \ - (sz) = request2size(req); - - -typedef CHUNK_SIZE_T bin_index_t; -typedef unsigned int bitmap_t; - - -/* - ---------- Overlaid Data types ---------- -*/ - - -/* - "Small" chunks are stored in circular doubly-linked lists, and look - like this: - - chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Size of previous chunk | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - `head:' | Size of chunk, in bytes |P| - mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Forward pointer to next chunk in list | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Back pointer to previous chunk in list | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Unused space (may be 0 bytes long) . - . . - . | -nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - `foot:' | Size of chunk, in bytes | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - Larger chunks are kept in a form of bitwise digital trees (aka tries) - keyed on chunksizes, in which - - * As seen as trees, they contains no duplicates (i.e., no - duplicate sizes). If a chunk with the same size an an existing - node is inserted, it is linked off the existing node using - pointers that work in the same way as fd/bk pointers - of small chunks - - * The decision to go left or right when searching is based on a - sliding bit, starting at the most significant bit distinguishing - sizes in the tree, and sliding right each level. All left - children of a node are smaller than all right children, but not - necessarily smaller than the node. - - The worst case number of steps to add or remove a node is thus - bounded by the number of bits differentiating chunks within - bins. Under current bin calculations, this ranges from 6 up to 21 - (for 32 bit sizes) or up to 53 (for 64 bit sizes). The typical case - is of course much better. - - Tree chunks are overlaid in the same way as small chunks. Because - malloc_tree_chunks are only for free chunks greater than 256 bytes, their - zie doesn;t impose any constraints on user chunk sizes. - - chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Size of previous chunk | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - `head:' | Size of chunk, in bytes |P| - mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Forward pointer to next chunk of same size | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Back pointer to previous chunk of same size | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Pointer to left child (child[0]) | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Pointer to right child (child[1]) | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Pointer to parent | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | bin index of this chunk | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Unused space . - . | -nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - `foot:' | Size of chunk, in bytes | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - -*/ - - -struct malloc_tree_chunk { - INTERNAL_SIZE_T prev_size; /* same as in malloc_chunk */ - INTERNAL_SIZE_T size; - - struct malloc_tree_chunk* fd; /* double links -- used only if free. */ - struct malloc_tree_chunk* bk; - - struct malloc_tree_chunk* child[2]; - struct malloc_tree_chunk* parent; - - bin_index_t index; -}; - -typedef struct malloc_tree_chunk* tchunkptr; - -typedef struct malloc_tree_chunk* tbinptr; - - - - -/* - -------------------- Internal data structures -------------------- - - All internal state is held in an instance of malloc_state defined - below. There are no other static variables, except in two optional - cases: - * If USE_MALLOC_LOCK is defined, the mALLOC_MUTEx declared above. - * If HAVE_MMAP is true, but mmap doesn't support - MAP_ANONYMOUS, a dummy file descriptor for mmap. - - Beware of lots of tricks that minimize the total bookkeeping space - requirements. The result is a little under 1K bytes (for 4byte - pointers and size_t.) -*/ - -/* - SmallBins - - An array of bin headers for free chunks. Most bins hold sizes that are - unusual as malloc request sizes, but are more usual for fragments - and consolidated sets of chunks, which is what these bins hold, so - they can be found quickly. All procedures maintain the invariant - that no consolidated chunk physically borders another one, so each - chunk in a list is known to be preceeded and followed by either - inuse chunks or the ends of memory. - - To simplify use in double-linked lists, each bin header acts as a - malloc_chunk pointing to the real first node, if it exists (else - juct pointing to itself). This avoids special-casing for headers. - But to conserve space and improve locality, we allocate only the - fd/bk pointers of bins, and then use repositioning tricks to treat - these as the fields of a malloc_chunk*. - -*/ - -typedef struct malloc_chunk* mbinptr; - -/* addressing */ -#define bin_at(m, i) ((mbinptr)((char*)&((m)->bins[(i)<<1]) - (SIZE_SZ<<1))) - -/* analog of ++bin */ -#define next_bin(b) ((mbinptr)((char*)(b) + (sizeof(mchunkptr)<<1))) - -/* inverse of bin_at */ -#define bin2idx(m, b) \ - ( ((int) (((char*)(b)) - (char*)(bin_at(m,0)))) / (2 * sizeof(mchunkptr))) - -/* - Indexing - - Bins for sizes < MIN_TREEBIN_SIZE bytes contain chunks of all the - same size, spaced 8 bytes apart. Larger bins are approximately - logarithmically spaced. -*/ - -#define NBINS 32 -#define SMALLBIN_WIDTH 8 -#define MIN_TREEBIN_SIZE 256 -/* bit-shift corresponding to MIN_TREEBIN_SIZE */ -#define TREE_BIN_SHIFT 8 - -#define in_smallbin_range(sz) \ - ((CHUNK_SIZE_T)(sz) <= (CHUNK_SIZE_T)(MIN_TREEBIN_SIZE-1)) - - -#define MAX_SMALL_REQUEST (MIN_TREEBIN_SIZE-(SIZE_SZ+MALLOC_ALIGNMENT)) - -#define smallbin_index(sz) (bin_index_t)((sz) >> 3) - -#define size_for_smallindex(i) ((CHUNK_SIZE_T)(i) << 3) - -#define MIN_SMALLBIN_INDEX (smallbin_index(MINSIZE)) - -#define MIN_SMALLBIN_BIT (idx2bit(smallbin_index(MINSIZE))) - - -/* - There are 2 equally spaced treebins for each power of two from - TREE_BIN_SHIFT to TREE_BIN_SHIFT+16. The last bin holds anything - larger. -*/ - - -static bin_index_t treebin_index(CHUNK_SIZE_T sz) { - unsigned int m; - unsigned int x = sz >> TREE_BIN_SHIFT; - if (x == 0) - return 0; - if (x > 0xFFFF) - return NBINS-1; - - /* On intel, use BSRL instruction to find highest bit */ -#if defined(__GNUC__) && defined(i386) - - __asm__("bsrl %1,%0\n\t" - : "=r" (m) - : "g" (x)); - return (m << 1) + ((sz >> (m + (TREE_BIN_SHIFT-1)) & 1)); - -#else - { - /* - Based on branch-free nlz algorithm in chapter 5 of Henry - S. Warren Jr's book "Hacker's Delight". - */ - - unsigned int n = ((x - 0x100) >> 16) & 8; - x <<= n; - m = ((x - 0x1000) >> 16) & 4; - n += m; - x <<= m; - m = ((x - 0x4000) >> 16) & 2; - n += m; - x = (x << m) >> 14; - m = 13 - n + (x & ~(x>>1)); - /* shift up n and use the next bit to make finer-granularity bins. */ - return (m << 1) + ((sz >> (m + (TREE_BIN_SHIFT-1)) & 1)); - } -#endif -} - -static bin_index_t bit2idx(bitmap_t x) { -#if defined(__GNUC__) && defined(i386) - int r; - __asm__("bsfl %1,%0\n\t" - : "=r" (r) : "g" (x)); - return (bin_index_t)r; -#else - return (bin_index_t)(ffs(x)-1); -#endif -} - - - -#define bin_index(sz) \ - ((in_smallbin_range(sz)) ? smallbin_index(sz) : treebin_index(sz)) - -/* - The most significant bit distinguishing nodes in the tree - associated with a given bin -*/ - -#define CHUNK_SIZE_BITS (sizeof(CHUNK_SIZE_T) * 8) - -#define bitshift_for_index(idx) \ - (idx == NBINS-1)? \ - CHUNK_SIZE_BITS-1 : \ - (((idx) >> 1) + TREE_BIN_SHIFT-2) - -#define tbin_at(m,i) (&((m)->treebins[i])) - -#define minsize_for_treeindex(i) \ - (((CHUNK_SIZE_T)(1) << (((i) >> 1) + TREE_BIN_SHIFT)) | \ - (((CHUNK_SIZE_T)((i) & 1)) << \ - ( ( (i) >> 1) + TREE_BIN_SHIFT - 1))) - - - -#define is_tbin(M, P) ((tbinptr*)(P) >= &((M)->treebins[0]) && \ - (tbinptr*)(P) < &((M)->treebins[NBINS])) - -#define leftmost_child(t) \ - (((t)->child[0] != 0)? ((t)->child[0]) : ((t)->child[1])) - - -/* - Fastbins - - An array of lists holding recently freed small chunks. Fastbins - are not doubly linked. It is faster to single-link them, and - since chunks are never removed from the middles of these lists, - double linking is not necessary. Also, unlike regular bins, they - are not even processed in FIFO order (they use faster LIFO) since - ordering doesn't much matter in the transient contexts in which - fastbins are normally used. - - Chunks in fastbins keep their inuse bit set, so they cannot - be consolidated with other free chunks. malloc_consolidate - releases all chunks in fastbins and consolidates them with - other free chunks. -*/ - -typedef struct malloc_chunk* mfastbinptr; - -#define fastbin_at(m,i) (&((m)->fastbins[i])) - -/* offset 2 to use otherwise unindexable first 2 bins */ -#define fastbin_index(sz) ((((unsigned int)(sz)) >> 3) - 2) - - -/* The maximum fastbin request size we support */ -#define MAX_FAST_REQUEST 64 - -#define MAX_FAST_SIZE (request2size(MAX_FAST_REQUEST)) - -#define NFASTBINS (fastbin_index(MAX_FAST_SIZE)+1) - -/* - FASTCHUNKS_BIT held in max_fast indicates that there are probably - some fastbin chunks. It is set true on entering a chunk into any - fastbin, and cleared only in malloc_consolidate. -*/ - -#define FASTCHUNKS_BIT (2U) - -#define have_fastchunks(M) (((M)->max_fast & FASTCHUNKS_BIT)) -#define set_fastchunks(M) ((M)->max_fast |= (FASTCHUNKS_BIT)) -#define clear_fastchunks(M) ((M)->max_fast &= ~(FASTCHUNKS_BIT)) - -/* - Set value of max_fast. - Use impossibly small value if 0. -*/ - -#define set_max_fast(M, s) \ - (M)->max_fast = (((s) == 0)? SMALLBIN_WIDTH: request2size(s)) | \ - ((M)->max_fast & (FASTCHUNKS_BIT)) - -#define get_max_fast(M) \ - ((M)->max_fast & ~(FASTCHUNKS_BIT)) - - -/* - Top - - The top-most available chunk (i.e., the one bordering the end of - available memory) is treated specially. It is never included in - any bin, is used only if no other chunk is available, and is - released back to the system if it is very large (see - M_TRIM_THRESHOLD). - - Top initially points to a dummy bin with zero size, thus forcing - extension on the first malloc request, so we avoid having any - special code in malloc to check whether it even exists yet. -*/ - - -/* - Binmap - - To help compensate for the large number of bins, a one-level index - structure is used for bin-by-bin searching. `binmap' is a - bitvector recording whether bins are definitely empty so they can - be skipped over during during traversals. -*/ - -/* Conservatively use 32 bits per map word, even if on 64bit system */ - -#define idx2bit(i) ((bitmap_t)(1) << (i)) - -#define mark_smallbin(m,i) ((m)->smallbits |= idx2bit(i)) -#define mark_treebin(m,i) ((m)->treebits |= idx2bit(i)) - -#define clear_smallbin(m,i) ((m)->smallbits &= ~idx2bit(i)) -#define clear_treebin(m,i) ((m)->treebits &= ~idx2bit(i)) - - -/* isolate the least set bit of a bitmap */ - -#define least_bit(x) ((x) & -(x)) - -/* create mask with all bits to left of least bit of x on */ - -#define left_bits(x) ((x<<1) | -(x<<1)) - -/* create mask with all bits to left of or equal to least bit of x on */ - -#define same_or_left_bits(x) ((x) | -(x)) - - -/* - sysctl is a status word holding dynamically discovered - or controlled properties of the morecore function -*/ - -#define MORECORE_CONTIGUOUS_BIT (1U) -#define TRIM_DISABLE_BIT (2U) -#define MMAP_DISABLE_BIT (4U) - -#define contiguous(M) \ - (((M)->sysctl & MORECORE_CONTIGUOUS_BIT)) -#define set_contiguous(M) \ - ((M)->sysctl |= MORECORE_CONTIGUOUS_BIT) -#define set_noncontiguous(M) \ - ((M)->sysctl &= ~MORECORE_CONTIGUOUS_BIT) - -#define disable_trim(M) \ - ((M)->sysctl |= TRIM_DISABLE_BIT) -#define enable_trim(M) \ - ((M)->sysctl &= ~TRIM_DISABLE_BIT) -#define trim_disabled(M) \ - ((M)->sysctl & TRIM_DISABLE_BIT) - -#define enable_mmap(M) \ - ((M)->sysctl &= ~MMAP_DISABLE_BIT) -#define disable_mmap(M) \ - ((M)->sysctl |= MMAP_DISABLE_BIT) -#define mmap_disabled(M) \ - ((M)->sysctl & MMAP_DISABLE_BIT) - - - - -/* - ----------- Internal state representation and initialization ----------- -*/ - -struct malloc_state { - /* The maximum chunk size to be eligible for fastbin */ - CHUNK_SIZE_T max_fast; - - /* Bitmap of bins */ - bitmap_t smallbits; - bitmap_t treebits; - - /* Base of the topmost chunk -- not otherwise kept in a bin */ - mchunkptr top; - - /* Fastbins */ - mfastbinptr fastbins[NFASTBINS]; - - /* Smallbins packed as described above */ - mchunkptr bins[NBINS * 2]; - - /* Treebins */ - tbinptr treebins[NBINS]; - - /* Padding to allow addressing past end of treebin array */ - struct malloc_tree_chunk initial_top; - - /* Tunable parameters */ - CHUNK_SIZE_T trim_threshold; - INTERNAL_SIZE_T top_pad; - INTERNAL_SIZE_T mmap_threshold; - - /* Memory map support */ - int n_mmaps; - int n_mmaps_max; - int max_n_mmaps; - - /* Cache malloc_getpagesize */ - unsigned int pagesize; - - /* Track properties of MORECORE */ - unsigned int sysctl; - - /* Statistics */ - INTERNAL_SIZE_T mmapped_mem; - INTERNAL_SIZE_T sbrked_mem; - INTERNAL_SIZE_T max_sbrked_mem; - INTERNAL_SIZE_T max_mmapped_mem; - INTERNAL_SIZE_T max_total_mem; -}; - -typedef struct malloc_state *mstate; - -/* - There is exactly one instance of this struct in this malloc. - If you are adapting this malloc in a way that does NOT use a static - malloc_state, you MUST explicitly zero-fill it before using. This - malloc relies on the property that malloc_state is initialized to - all zeroes (as is true of C statics). -*/ - -static struct malloc_state av_; /* never directly referenced */ - -/* - All uses of av_ are via get_malloc_state(). - At most one "call" to get_malloc_state is made per invocation of - the public versions of malloc and free, but other routines - that in turn invoke malloc and/or free may call more then once. - Also, it is called in check* routines if DEBUG is set. -*/ - -#define get_malloc_state() (&(av_)) - -/* - Initialize a malloc_state struct. This is called only - in sysmalloc, to avoid it being inlined everywhere else, - which causes useless code bloat. -*/ - -static void malloc_init_state(mstate av) { - int i; - mbinptr bin; - - /* Establish circular links for bins */ - for (i = 0; i < NBINS; ++i) { - bin = bin_at(av,i); - bin->fd = bin->bk = bin; - } - - av->top_pad = DEFAULT_TOP_PAD; - av->n_mmaps_max = DEFAULT_MMAP_MAX; - av->mmap_threshold = DEFAULT_MMAP_THRESHOLD; - av->trim_threshold = DEFAULT_TRIM_THRESHOLD; - -#if MORECORE_CONTIGUOUS - set_contiguous(av); -#else - set_noncontiguous(av); -#endif - - set_max_fast(av, DEFAULT_MXFAST); - - av->top = (mchunkptr)(&(av->initial_top)); - av->pagesize = malloc_getpagesize; -} - -#define ensure_initialization(M) \ - if ((M)->top == 0) sysmalloc(M, 0); - - -/* - Other internal utilities -*/ - -static Void_t* sysmalloc(mstate, CHUNK_SIZE_T); -static int systrim(mstate, size_t); -static Void_t** iALLOc(size_t, size_t*, int, Void_t**); -static void insert_treenode(mstate, tchunkptr, CHUNK_SIZE_T); -#if 0 -static void unlink_treenode(mstate, tchunkptr); -static void unlink_small_chunk(mstate av, mchunkptr p, CHUNK_SIZE_T size); -#endif -static void transfer_tree_links(tchunkptr oldt, tchunkptr newt); -static tchunkptr find_replacement(tchunkptr t); -static void unlink_chained_node(tchunkptr t); -static void insert_small_chunk(mstate av, mchunkptr p, CHUNK_SIZE_T nb); -static void insert_chunk(mstate av, mchunkptr p, CHUNK_SIZE_T nb); -static mchunkptr take_from_smallbin(mstate av, mchunkptr bin, bitmap_t bit); -static void unlink_chunk(mstate av, mchunkptr p, CHUNK_SIZE_T size); -static void malloc_consolidate(mstate); - - -#pragma no_inline(systrim) - - -#if HAVE_MMAP -static mchunkptr mmap_malloc(mstate, INTERNAL_SIZE_T); -#endif - -/* - Debugging support - - These routines make a number of assertions about the states - of data structures that should be true at all times. If any - are not true, it's very likely that a user program has somehow - trashed memory. (It's also possible that there is a coding error - in malloc. In which case, please report it!) -*/ - - -#if ! DEBUG - -#define check_chunk(P) -#define check_free_chunk(P) -#define check_inuse_chunk(P) -#define check_remalloced_chunk(P,N) -#define check_malloced_chunk(P,N) -#define check_malloc_state(M) -#define check_tree(P) - -#else -#define check_chunk(P) do_check_chunk(P) -#define check_free_chunk(P) do_check_free_chunk(P) -#define check_inuse_chunk(P) do_check_inuse_chunk(P) -#define check_remalloced_chunk(P,N) do_check_remalloced_chunk(P,N) -#define check_malloced_chunk(P,N) do_check_malloced_chunk(P,N) -#define check_tree(P) do_check_tree(P) -#define check_malloc_state(M) do_check_malloc_state(M) - -static void do_check_malloc_state(mstate); - -/* - Find x in a treebin. Used in other check functions. -*/ - -static tchunkptr tree_find(tchunkptr x) { - mstate av = get_malloc_state(); - CHUNK_SIZE_T nb = chunksize(x); - bin_index_t idx = treebin_index(nb); - tbinptr* bin = tbin_at(av, idx); - tchunkptr t = *bin; - bin_index_t shift = bitshift_for_index(idx); - CHUNK_SIZE_T allbits = 0; - - if (t == 0) - return 0; - - while (t != 0) { - CHUNK_SIZE_T size; - if (t == x) - return t; - size = chunksize(t); - assert((size & allbits) == allbits); - if (size == nb) { - tchunkptr p = t->bk; - for (;;) { - if (p == x) - return p; - else if (p == t) - return 0; - else - p = p->bk; - } - } - if (((nb >> shift) & 1) == 0) { - t = t->child[0]; - } - else { - t = t->child[1]; - allbits |= 1U << shift; - } - - --shift; - } - return 0; -} - -/* - Properties of all chunks -*/ - -static void do_check_chunk(mchunkptr p) { - mstate av = get_malloc_state(); - CHUNK_SIZE_T sz = chunksize(p); - /* min and max possible addresses assuming contiguous allocation */ - char* max_address = (char*)(av->top) + chunksize(av->top); - char* min_address = max_address - av->sbrked_mem; - - if (!chunk_is_mmapped(p)) { - - /* Has legal address ... */ - if (p != av->top) { - if (contiguous(av)) { - assert(((char*)p) >= min_address); - assert(((char*)p + sz) <= ((char*)(av->top))); - } - } - else { - /* top size is always at least MINSIZE */ - assert((CHUNK_SIZE_T)(sz) >= MINSIZE); - /* top predecessor always marked inuse */ - assert(prev_inuse(p)); - } - - } - else { -#if HAVE_MMAP - /* address is outside main heap */ - if (contiguous(av) && av->top != (mchunkptr)(&(av->initial_top))) { - assert(((char*)p) < min_address || ((char*)p) > max_address); - } - /* chunk is page-aligned */ - assert(((p->prev_size + sz) & (av->pagesize-1)) == 0); - /* mem is aligned */ - assert(aligned_OK(chunk2mem(p))); -#else - /* force an appropriate assert violation if debug set */ - assert(!chunk_is_mmapped(p)); -#endif - } -} - -static void check_all_less(tchunkptr t, CHUNK_SIZE_T nb) { - if (t == 0) - return; - assert(chunksize(t) < nb); - check_all_less(t->child[0], nb); - check_all_less(t->child[1], nb); -} - -static void check_all_greater(tchunkptr t, CHUNK_SIZE_T nb) { - if (t == 0) - return; - assert(chunksize(t) >= nb); - check_all_greater(t->child[0], nb); - check_all_greater(t->child[1], nb); -} - - -static INTERNAL_SIZE_T check_tree_fields(tchunkptr t) { - INTERNAL_SIZE_T size = chunksize(t); - assert(size >= MIN_TREEBIN_SIZE); - do_check_chunk(((mchunkptr)t)); - assert(!inuse(t)); - assert(t->fd->bk == t); - assert(t->bk->fd == t); - assert(t->parent != t); - assert(t->child[0] != t); - assert(t->child[1] != t); - if (t->child[0] != 0 && t->child[1] != 0) { - check_all_less(t->child[0], chunksize(t->child[1])); - check_all_greater(t->child[1], chunksize(t->child[0])); - } - return size; -} - -static INTERNAL_SIZE_T do_check_tree(tchunkptr t) { - tchunkptr p; - tchunkptr h; - INTERNAL_SIZE_T total = check_tree_fields(t); - - /* If t is on a same-sized list, another node on list must have a parent */ - if (t->parent == 0) { - h = t->bk; - while (h != t && h->parent == 0) - h = h->bk; - assert(h != t); - } - else - h = t; - - assert (h->parent->child[0] == h || - h->parent->child[1] == h || - *((tbinptr*)(h->parent)) == h); - - - /* only one node on a same-sized list has parent or children */ - p = h->bk; - while (p != h) { - assert(p->child[0] == 0); - assert(p->child[1] == 0); - assert(p->parent == 0); - assert(chunksize(p) == chunksize(h)); - total += check_tree_fields(p); - p = p->bk; - } - - if (h->child[0] != 0) { - assert(h->child[0]->parent == h); - total += do_check_tree(h->child[0]); - } - - if (h->child[1] != 0) { - assert(h->child[1]->parent == h); - total += do_check_tree(h->child[1]); - } - - return total; -} - -static void do_check_links(mchunkptr p) { - if (in_smallbin_range(chunksize(p))) { - assert(p->fd->bk == p); - assert(p->bk->fd == p); - } - else { - do_check_tree((tchunkptr)p); - } -} - -/* - Properties of free chunks -*/ - -static void do_check_free_chunk(mchunkptr p) { - mstate av = get_malloc_state(); - - INTERNAL_SIZE_T sz = p->size & ~PREV_INUSE; - mchunkptr next = chunk_at_offset(p, sz); - - do_check_chunk(p); - - /* Chunk must claim to be free ... */ - assert(!inuse(p)); - assert (!chunk_is_mmapped(p)); - - /* Unless a special marker, must have OK fields */ - if ((CHUNK_SIZE_T)(sz) >= MINSIZE) - { - assert((sz & MALLOC_ALIGN_MASK) == 0); - assert(aligned_OK(chunk2mem(p))); - /* ... matching footer field */ - assert(next->prev_size == sz); - /* ... and is fully consolidated */ - assert(prev_inuse(p)); - assert (next == av->top || inuse(next)); - - do_check_links(p); - } - else /* markers are always of size SIZE_SZ */ - assert(sz == SIZE_SZ); -} - -/* - Properties of inuse chunks -*/ - -static void do_check_inuse_chunk(mchunkptr p) { - mstate av = get_malloc_state(); - mchunkptr next; - do_check_chunk(p); - - if (chunk_is_mmapped(p)) - return; /* mmapped chunks have no next/prev */ - - /* Check whether it claims to be in use ... */ - assert(inuse(p)); - - next = next_chunk(p); - - /* ... and is surrounded by OK chunks. - Since more things can be checked with free chunks than inuse ones, - if an inuse chunk borders them and debug is on, it's worth doing them. - */ - if (!prev_inuse(p)) { - /* Note that we cannot even look at prev unless it is not inuse */ - mchunkptr prv = prev_chunk(p); - assert(next_chunk(prv) == p); - do_check_free_chunk(prv); - } - - if (next == av->top) { - assert(prev_inuse(next)); - assert(chunksize(next) >= MINSIZE); - } - else if (!inuse(next)) - do_check_free_chunk(next); -} - - -static void do_check_remalloced_chunk(mchunkptr p, INTERNAL_SIZE_T s) { - INTERNAL_SIZE_T sz = p->size & ~PREV_INUSE; - - do_check_inuse_chunk(p); - - /* Legal size ... */ - assert((sz & MALLOC_ALIGN_MASK) == 0); - assert((CHUNK_SIZE_T)(sz) >= MINSIZE); - /* ... and alignment */ - assert(aligned_OK(chunk2mem(p))); - /* chunk is less than MINSIZE more than request */ - assert((long)(sz) - (long)(s) >= 0); - assert((long)(sz) - (long)(s + MINSIZE) < 0); -} - -/* - Properties of nonrecycled chunks at the point they are malloced -*/ - -static void do_check_malloced_chunk(mchunkptr p, INTERNAL_SIZE_T s) { - /* same as recycled case ... */ - do_check_remalloced_chunk(p, s); -#if 0 - do_check_malloc_state(get_malloc_state()); -#endif - - /* - ... plus, must obey implementation invariant that prev_inuse is - always true of any allocated chunk; i.e., that each allocated - chunk borders either a previously allocated and still in-use - chunk, or the base of its memory arena. This is ensured - by making all allocations from the the `lowest' part of any found - chunk. - */ - - assert(prev_inuse(p)); -} - - -static CHUNK_SIZE_T do_check_smallbin(mstate av, int i, mbinptr b) { - mchunkptr p = b->bk; - mchunkptr q; - bin_index_t idx; - INTERNAL_SIZE_T size; - CHUNK_SIZE_T total = 0; - unsigned int empty = (av->smallbits & (1 << i)) == 0; - - if (i >= 2) { - if (empty) - assert(p == b); - if (p == b) - assert(empty); - - if (p != b) - assert(!empty); - } - - for (; p != b; p = p->bk) { - /* each chunk claims to be free */ - do_check_free_chunk(p); - size = chunksize(p); - total += size; - if (i >= 2) { - /* chunk belongs in bin */ - idx = smallbin_index(size); - assert(idx == i); - assert(p->bk == b || - (CHUNK_SIZE_T)chunksize(p->bk) == - (CHUNK_SIZE_T)chunksize(p)); - } - /* chunk is followed by a legal chain of inuse chunks */ - for (q = next_chunk(p); - (q != av->top && inuse(q) && - (CHUNK_SIZE_T)(chunksize(q)) >= MINSIZE); - q = next_chunk(q)) - do_check_inuse_chunk(q); - } - - return total; -} - -/* - Properties of malloc_state. - - This may be useful for debugging malloc, as well as detecting user - programmer errors that somehow write into malloc_state. - - If you are extending or experimenting with this malloc, you can - probably figure out how to hack this routine to print out or - display chunk addresses, sizes, bins, and other instrumentation. -*/ - -static void do_check_malloc_state(mstate av) { - int i; - mbinptr b; - CHUNK_SIZE_T total = 0; - tchunkptr t; - unsigned int empty; - tbinptr* tb; - int max_fast_bin; - mchunkptr p; - - /* internal size_t must be no wider than pointer type */ - assert(sizeof(INTERNAL_SIZE_T) <= sizeof(char*)); - - /* alignment is a power of 2 */ - assert((MALLOC_ALIGNMENT & (MALLOC_ALIGNMENT-1)) == 0); - - /* cannot run remaining checks until fully initialized */ - if (av->top == 0 || av->top == (mchunkptr)(&(av->initial_top))) - return; - - /* pagesize is a power of 2 */ - assert((av->pagesize & (av->pagesize-1)) == 0); - - /* check smallbins */ - for (i = 1; i < NBINS; ++i) { - b = bin_at(av, i); - total += do_check_smallbin(av, i, b); - } - - /* check treebins */ - for (i = 0; i < NBINS; ++i) { - tb = tbin_at(av, i); - t = *tb; - empty = (av->treebits & (1 << i)) == 0; - if (t == 0) - assert(empty); - else if (t != 0) { - assert(!empty); - total += do_check_tree(t); - } - } - - - /* top chunk is OK */ - check_chunk(av->top); - /* top not in tree */ - if (!in_smallbin_range(chunksize(av->top))) - assert(tree_find((tchunkptr)(av->top)) == 0); - - /* max_fast is in allowed range */ - assert(get_max_fast(av) <= request2size(MAX_FAST_SIZE)); - - max_fast_bin = fastbin_index(av->max_fast); - - for (i = 0; i < NFASTBINS; ++i) { - p = av->fastbins[i]; - - /* all bins past max_fast are empty */ - if (i > max_fast_bin) - assert(p == 0); - - while (p != 0) { - /* each chunk claims to be inuse */ - do_check_inuse_chunk(p); - total += chunksize(p); - /* chunk belongs in this bin */ - assert(fastbin_index(chunksize(p)) == i); - p = p->fd; - } - } - - /* sanity checks for statistics */ - - assert(total <= (CHUNK_SIZE_T)(av->max_total_mem)); - - assert(av->n_mmaps >= 0); - assert(av->n_mmaps <= av->n_mmaps_max); - assert(av->n_mmaps <= av->max_n_mmaps); - - assert((CHUNK_SIZE_T)(av->sbrked_mem) <= - (CHUNK_SIZE_T)(av->max_sbrked_mem)); - - assert((CHUNK_SIZE_T)(av->mmapped_mem) <= - (CHUNK_SIZE_T)(av->max_mmapped_mem)); - - assert((CHUNK_SIZE_T)(av->max_total_mem) >= - (CHUNK_SIZE_T)(av->mmapped_mem) + (CHUNK_SIZE_T)(av->sbrked_mem)); -} -#endif - - - -/* - ----------- Operations on trees ----------- -*/ - -/* - Insert chunk into corresponding list or tree -*/ - -static void insert_treenode(mstate av, tchunkptr x, - CHUNK_SIZE_T nb) { - bin_index_t idx = treebin_index(nb); - tbinptr* bin = tbin_at(av, idx); - tchunkptr t = *bin; - - x->child[0] = 0; - x->child[1] = 0; - x->index = idx; - - if (t == 0) { - av->treebits |= idx2bit(idx); - *bin = x; - x->parent = (tchunkptr)bin; - x->fd = x; - x->bk = x; - } - else { - bin_index_t shift = bitshift_for_index(idx); - tchunkptr b; - check_tree(t); - - while (chunksize(t) != nb) { - tchunkptr* pchild = &(t->child[(nb >> shift--) & 1]); - if (*pchild != 0) { - t = *pchild; - } - else { - *pchild = x; - x->parent = t; - x->fd = x; - x->bk = x; - return; - } - } - /* Link in same-sized node */ - b = t->bk; - x->parent = 0; - x->fd = t; - x->bk = b; - b->fd = t->bk = x; - } -} - -static void transfer_tree_links(tchunkptr oldt, tchunkptr newt) { - tchunkptr p = oldt->parent; - newt->parent = p; - - if (p->child[0] == oldt) - p->child[0] = newt; - else if (p->child[1] == oldt) - p->child[1] = newt; - else - *((tbinptr*)p) = newt; - - if ( (newt->child[0] = oldt->child[0]) != 0) - newt->child[0]->parent = newt; - - if ( (newt->child[1] = oldt->child[1]) != 0) - newt->child[1]->parent = newt; -} - -static tchunkptr find_replacement(tchunkptr t) { - /* - Unless t is itself a leaf node, we must replace t with a leaf - node (not merely one with an open left or right, as with binary - search trees), to make sure that lefts and rights of descendents - correspond properly to bit masks. We use the leftmost leaf of - right child, or, if there is no right child, the rightmost leaf - of left child. We could use any other leaf, but these choices - will tend to maintain nicer trees. - */ - tchunkptr* cp; - tchunkptr c; - if ((c = *(cp = &(t->child[1]))) == 0) - if ((c = *(cp = &(t->child[0]->child[1]))) == 0) - c = *(cp = &(t->child[0])); - - assert(c != 0); - for (;;) { - if (c->child[0] != 0) - c = *(cp = &(c->child[0])); - else if (c->child[1] != 0) - c = *(cp = &(c->child[1])); - else { - *cp = 0; /* unlink from parent */ - return c; - } - } -} - -static void unlink_leaf_node(mstate av, tchunkptr t) { - tchunkptr p = t->parent; - if (p->child[0] == t) - p->child[0] = 0; - else if (p->child[1] == t) - p->child[1] = 0; - else { - assert(is_tbin(av, p)); - *((tbinptr*)p) = 0; - av->treebits &= ~idx2bit(t->index); - } -} - -static void unlink_chained_node(tchunkptr t) { - tchunkptr bck = t->bk; - tchunkptr fwd = t->fd; - fwd->bk = bck; - bck->fd = fwd; - /* t's parent is nonnull if t was head of chain */ - if (t->parent != 0) - transfer_tree_links(t, fwd); - check_tree(fwd); -} - - - -/* - ----------- other helper functions ----------- - We expect these to be inlined -*/ - - -static void insert_small_chunk(mstate av, mchunkptr p, CHUNK_SIZE_T nb) { - bin_index_t idx = smallbin_index(nb); - mchunkptr bck = bin_at(av, idx); - mchunkptr fwd = bck->fd; - mark_smallbin(av, idx); - p->fd = fwd; - p->bk = bck; - fwd->bk = bck->fd = p; - - assert(in_smallbin_range(nb)); -} - -static void insert_chunk(mstate av, mchunkptr p, CHUNK_SIZE_T nb) { - if (in_smallbin_range(nb)) - insert_small_chunk(av, p, nb); - else - insert_treenode(av, (tchunkptr)p, nb); -} - - -static mchunkptr take_from_smallbin(mstate av, mchunkptr bin, bitmap_t bit) { - mchunkptr p = bin->bk; - mchunkptr bck = p->bk; - assert(p != bin); - bin->bk = bck; - bck->fd = bin; - if (bck == bin) - av->smallbits &= ~bit; - return p; -} - -static void unlink_chunk(mstate av, mchunkptr q, CHUNK_SIZE_T size) { - mchunkptr fwd = q->fd; - mchunkptr bck = q->bk; - fwd->bk = bck; - bck->fd = fwd; - if (fwd == bck && in_smallbin_range(size)) { - clear_smallbin(av, smallbin_index(size)); - } - else if (!in_smallbin_range(size)) { - tchunkptr t = (tchunkptr)q; - tchunkptr c = (tchunkptr)fwd; - if (c == t) { - if (t->child[0] == t->child[1]) { - unlink_leaf_node(av, t); - return; - } - else { - c = find_replacement(t); - } - } - else { - if (t->parent == 0) { - return; - } - } - - transfer_tree_links(t, c); - check_tree(c); - } -} - -static Void_t* use_treechunk(mstate av, - CHUNK_SIZE_T nb, - tchunkptr bestchunk, - CHUNK_SIZE_T bestsize, - tchunkptr leaf) { - - CHUNK_SIZE_T rsize; - - if (bestchunk->bk != bestchunk) - unlink_chained_node(bestchunk); - else { - unlink_leaf_node(av, leaf); - if (leaf != bestchunk) - transfer_tree_links(bestchunk, leaf); - } - - rsize = bestsize - nb; - if (rsize >= MINSIZE) { - mchunkptr rem = chunk_at_offset(bestchunk, nb); - set_head(bestchunk, nb | PREV_INUSE); - set_head(rem, rsize | PREV_INUSE); - set_foot(rem, rsize); - insert_chunk(av, rem, rsize); - } - else { - set_inuse_bit_at_offset(bestchunk, bestsize); - } - check_malloced_chunk((mchunkptr)(bestchunk), nb); - return chunk2mem(bestchunk); -} - - -/* - ------------------------------ malloc ------------------------------ -*/ - -Void_t* mALLOc(size_t bytes) { - mstate av = get_malloc_state(); - CHUNK_SIZE_T nb; - - checked_request2size(bytes, nb); - - if (nb <= (CHUNK_SIZE_T)(av->max_fast)) { - mfastbinptr* fb = &(av->fastbins[(fastbin_index(nb))]); - mchunkptr fp = *fb; - if (fp != 0) { - *fb = fp->fd; - check_remalloced_chunk(fp, nb); - return chunk2mem(fp); - } - } - - - for (;;) { - if (in_smallbin_range(nb)) { - bin_index_t sidx = smallbin_index(nb); - bitmap_t sbit = idx2bit(sidx); - - if (sbit <= av->smallbits) { - mchunkptr p; - if ((sbit & av->smallbits) != 0) { - p = take_from_smallbin(av, bin_at(av,sidx), sbit); - set_inuse_bit_at_offset(p, nb); - } - else { - bitmap_t nbit = least_bit(left_bits(sbit) & av->smallbits); - bin_index_t nidx = bit2idx(nbit); - CHUNK_SIZE_T psize = size_for_smallindex(nidx); - CHUNK_SIZE_T qsize = psize - nb; - p = take_from_smallbin(av, bin_at(av, nidx), nbit); - if (qsize < MINSIZE) { - set_inuse_bit_at_offset(p, psize); - } - else { - mchunkptr q = chunk_at_offset(p, nb); - set_head(p, nb | PREV_INUSE); - set_head(q, qsize | PREV_INUSE); - set_foot(q, qsize); - insert_small_chunk(av, q, qsize); - } - } - check_malloced_chunk(p, nb); - return chunk2mem(p); - } - - if (av->treebits != 0) { - bitmap_t vbit = least_bit(av->treebits); - bin_index_t vidx = bit2idx(vbit); - tbinptr* vbin = tbin_at(av, vidx); - tchunkptr bestchunk = *vbin; - tchunkptr c = leftmost_child(bestchunk); - CHUNK_SIZE_T bestsize = chunksize(bestchunk); - tchunkptr leaf; - CHUNK_SIZE_T rsize; - - /* Fast path if remainder will replace bestchunk */ - if (c == 0) { - rsize = bestsize - nb; - leaf = bestchunk; - - if (rsize >= minsize_for_treeindex(vidx) && - bestchunk->bk == bestchunk) { - tchunkptr r = (tchunkptr)(chunk_at_offset(bestchunk, nb)); - - set_head(bestchunk, nb | PREV_INUSE); - set_head(r, rsize | PREV_INUSE); - set_foot(r, rsize); - *vbin = r; - r->fd = r; - r->bk = r; - r->child[0] = 0; - r->child[1] = 0; - r->parent = (tchunkptr)vbin; - r->index = vidx; - check_malloced_chunk((mchunkptr)bestchunk, nb); - return chunk2mem(bestchunk); - } - } - else { - do { - CHUNK_SIZE_T csize = chunksize(c); - if (csize < bestsize) { - bestchunk = c; - bestsize = csize; - } - leaf = c; - c = leftmost_child(c); - } while (c != 0); - } - return use_treechunk(av, nb, bestchunk, bestsize, leaf); - } - } - else { - bin_index_t tidx = treebin_index(nb); - bitmap_t tbit = idx2bit(tidx); - - if (tbit <= av->treebits) { - tchunkptr bestchunk = 0; - CHUNK_SIZE_T bestsize = MAX_CHUNK_SIZE; - tchunkptr leaf; - bitmap_t vbit; - - for (;;) { - if ((tbit & av->treebits) != 0) { - tchunkptr t = *tbin_at(av, tidx); - bin_index_t shift = bitshift_for_index(tidx); - for (;;) { - int dir; - CHUNK_SIZE_T tsize = chunksize(t); - leaf = t; - if (tsize >= nb && tsize < bestsize) { - bestchunk = t; - bestsize = tsize; - if (tsize == nb && t->bk != t) - break; - } - - dir = (shift == 0)? 0 : (nb >> shift--) & 1; - t = leaf->child[dir]; - if (t == 0) { - shift = 0; /* if forced right, go leftmost from now on */ - t = leaf->child[1-dir]; - if (t == 0) - break; - } - } - if (bestchunk != 0) - return use_treechunk(av, nb, bestchunk, bestsize, leaf); - } - if (have_fastchunks(av)) - malloc_consolidate(av); - else - break; - } - - vbit = least_bit(left_bits(tbit) & av->treebits); - if (vbit != 0) { - bin_index_t vidx = bit2idx(vbit); - tbinptr* vbin = tbin_at(av, vidx); - tchunkptr c = *vbin; - do { - CHUNK_SIZE_T csize = chunksize(c); - leaf = c; - if (csize < bestsize) { - bestchunk = c; - bestsize = csize; - } - c = leftmost_child(c); - } while (c != 0); - return use_treechunk(av, nb, bestchunk, bestsize, leaf); - } - } - } - - /* - If large enough, split off the chunk bordering the end of memory - (held in av->top). This is called in accord with the best-fit - search rule. In effect, av->top is treated as larger (and thus - less well fitting) than any other available chunk since it can - be extended to be as large as necessary (up to system - limitations). - - We require that av->top always exists (i.e., has size >= - MINSIZE) after initialization, so if it would otherwise be - exhuasted by current request, it is replenished. (The main - reason for ensuring it exists is that we may need MINSIZE space - to put in fenceposts in sysmalloc.) - */ - - if (av->top != 0) { - mchunkptr topchunk = av->top; - CHUNK_SIZE_T topsize = chunksize(topchunk); - - if (topsize >= nb + MINSIZE) { - CHUNK_SIZE_T remainder_size = topsize - nb; - mchunkptr remainder = chunk_at_offset(topchunk, nb); - - av->top = remainder; - set_head(topchunk, nb | PREV_INUSE); - set_head(remainder, remainder_size | PREV_INUSE); - - check_malloced_chunk(topchunk, nb); - return chunk2mem(topchunk); - } - else if (have_fastchunks(av)) { - malloc_consolidate(av); - } - else - break; - } - else - break; - } - return sysmalloc(av, nb); -} - -/* - ------------------------------ free ------------------------------ -*/ - - -void fREe(Void_t* mem) { - mstate av = get_malloc_state(); - - mchunkptr p = mem2chunk(mem); - - if (mem != 0) { - INTERNAL_SIZE_T rawsize = p->size; - CHUNK_SIZE_T size = chunksize(p); - check_inuse_chunk(p); - - /* - If eligible, place chunk on a fastbin so it can be found - and used quickly in malloc. - */ - - if ((CHUNK_SIZE_T)(size) <= (CHUNK_SIZE_T)(av->max_fast) - -#if TRIM_FASTBINS - /* - If TRIM_FASTBINS set, don't place chunks - bordering top into fastbins - */ - && (chunk_at_offset(p, size) != av->top) -#endif - ) { - - mfastbinptr* fb; - set_fastchunks(av); - fb = &(av->fastbins[fastbin_index(size)]); - p->fd = *fb; - *fb = p; - } - - else if ((rawsize & IS_MMAPPED) == 0) { - mchunkptr nextchunk = chunk_at_offset(p, size); - CHUNK_SIZE_T nextsize; - - if ((rawsize & PREV_INUSE) == 0) { - CHUNK_SIZE_T prevsize = p->prev_size; - size += prevsize; - p = chunk_at_offset(p, -((long) prevsize)); - unlink_chunk(av, p, prevsize); - } - - nextsize = chunksize(nextchunk); - if (nextchunk == av->top) { - size += nextsize; - set_head(p, size | PREV_INUSE); - av->top = p; - if (size >= av->trim_threshold) { - systrim(av, av->top_pad); - } - } - else { - if (!inuse_bit_at_offset(nextchunk, nextsize)) { - size += nextsize; - unlink_chunk(av, nextchunk, nextsize); - } - else - set_head(nextchunk, nextsize); - - set_head(p, size | PREV_INUSE); - set_foot(p, size); - insert_chunk(av, p, size); - } - } - else { -#if HAVE_MMAP - int ret; - INTERNAL_SIZE_T offset = p->prev_size; - av->n_mmaps--; - av->mmapped_mem -= (size + offset); - ret = munmap((char*)p - offset, size + offset); - /* munmap returns non-zero on failure */ - assert(ret == 0); -#endif - } - } -} - -/* - ------------------------- malloc_consolidate ------------------------- - - malloc_consolidate tears down chunks held in fastbins. -*/ - -static void malloc_consolidate(mstate av) { - int i; - clear_fastchunks(av); - - for (i = 0; i < NFASTBINS; ++i) { - mfastbinptr* fb = &(av->fastbins[i]); - mchunkptr p = *fb; - - if (p != 0) { - *fb = 0; - do { - mchunkptr nextp = p->fd; - INTERNAL_SIZE_T rawsize = p->size; - CHUNK_SIZE_T size = chunksize(p); - mchunkptr nextchunk = chunk_at_offset(p, size); - CHUNK_SIZE_T nextsize; - - if ((rawsize & PREV_INUSE) == 0) { - CHUNK_SIZE_T prevsize = p->prev_size; - size += prevsize; - p = chunk_at_offset(p, -((long) prevsize)); - unlink_chunk(av, p, prevsize); - } - - nextsize = chunksize(nextchunk); - if (nextchunk == av->top) { - size += nextsize; - set_head(p, size | PREV_INUSE); - av->top = p; - } - else { - if (!inuse_bit_at_offset(nextchunk, nextsize)) { - size += nextsize; - unlink_chunk(av, nextchunk, nextsize); - } - else - set_head(nextchunk, nextsize); - - set_head(p, size | PREV_INUSE); - set_foot(p, size); - - insert_chunk(av, p, size); - } - p = nextp; - } while (p != 0); - } - } -} - - -/* - ------------------------------ realloc ------------------------------ -*/ - - -Void_t* rEALLOc(Void_t* oldmem, size_t bytes) { - mstate av = get_malloc_state(); - - INTERNAL_SIZE_T nb; /* padded request size */ - - mchunkptr oldp; /* chunk corresponding to oldmem */ - CHUNK_SIZE_T oldsize; /* its size */ - - mchunkptr newp; /* chunk to return */ - CHUNK_SIZE_T newsize; /* its size */ - Void_t* newmem; /* corresponding user mem */ - - mchunkptr next; /* next contiguous chunk after oldp */ - - mchunkptr remainder; /* extra space at end of newp */ - CHUNK_SIZE_T remainder_size; /* its size */ - - CHUNK_SIZE_T copysize; /* bytes to copy */ - unsigned int ncopies; /* INTERNAL_SIZE_T words to copy */ - INTERNAL_SIZE_T* s; /* copy source */ - INTERNAL_SIZE_T* d; /* copy destination */ - - -#ifdef REALLOC_ZERO_BYTES_FREES - if (bytes == 0) { - fREe(oldmem); - return 0; - } -#endif - - /* realloc of null is supposed to be same as malloc */ - if (oldmem == 0) return mALLOc(bytes); - - checked_request2size(bytes, nb); - - oldp = mem2chunk(oldmem); - oldsize = chunksize(oldp); - - check_inuse_chunk(oldp); - - if (!chunk_is_mmapped(oldp)) { - - if ((CHUNK_SIZE_T)(oldsize) >= (CHUNK_SIZE_T)(nb)) { - /* already big enough; split below */ - newp = oldp; - newsize = oldsize; - } - - else { - next = chunk_at_offset(oldp, oldsize); - - /* Try to expand forward into top */ - if (next == av->top && - (CHUNK_SIZE_T)(newsize = oldsize + chunksize(next)) >= - (CHUNK_SIZE_T)(nb + MINSIZE)) { - set_head_size(oldp, nb); - av->top = chunk_at_offset(oldp, nb); - set_head(av->top, (newsize - nb) | PREV_INUSE); - return chunk2mem(oldp); - } - - /* Try to expand forward into next chunk; split off remainder below */ - else if (next != av->top && - !inuse(next) && - (CHUNK_SIZE_T)(newsize = oldsize + chunksize(next)) >= - (CHUNK_SIZE_T)(nb)) { - newp = oldp; - unlink_chunk(av, next, chunksize(next)); - } - - /* allocate, copy, free */ - else { - newmem = mALLOc(nb - MALLOC_ALIGN_MASK); - if (newmem == 0) - return 0; /* propagate failure */ - - newp = mem2chunk(newmem); - newsize = chunksize(newp); - - /* - Avoid copy if newp is next chunk after oldp. - */ - if (newp == next) { - newsize += oldsize; - newp = oldp; - } - else { - /* - Unroll copy of <= 36 bytes (72 if 8byte sizes) - We know that contents have an odd number of - INTERNAL_SIZE_T-sized words; minimally 3. - */ - - copysize = oldsize - SIZE_SZ; - s = (INTERNAL_SIZE_T*)(oldmem); - d = (INTERNAL_SIZE_T*)(newmem); - ncopies = copysize / sizeof(INTERNAL_SIZE_T); - assert(ncopies >= 3); - - if (ncopies > 9) - MALLOC_COPY(d, s, copysize); - - else { - *(d+0) = *(s+0); - *(d+1) = *(s+1); - *(d+2) = *(s+2); - if (ncopies > 4) { - *(d+3) = *(s+3); - *(d+4) = *(s+4); - if (ncopies > 6) { - *(d+5) = *(s+5); - *(d+6) = *(s+6); - if (ncopies > 8) { - *(d+7) = *(s+7); - *(d+8) = *(s+8); - } - } - } - } - - fREe(oldmem); - check_inuse_chunk(newp); - return chunk2mem(newp); - } - } - } - - /* If possible, free extra space in old or extended chunk */ - - assert((CHUNK_SIZE_T)(newsize) >= (CHUNK_SIZE_T)(nb)); - - remainder_size = newsize - nb; - - if (remainder_size < MINSIZE) { /* not enough extra to split off */ - set_head_size(newp, newsize); - set_inuse_bit_at_offset(newp, newsize); - } - else { /* split remainder */ - remainder = chunk_at_offset(newp, nb); - set_head_size(newp, nb); - set_head(remainder, remainder_size | PREV_INUSE); - /* Mark remainder as inuse so free() won't complain */ - set_inuse_bit_at_offset(remainder, remainder_size); - fREe(chunk2mem(remainder)); - } - - check_inuse_chunk(newp); - return chunk2mem(newp); - } - - /* - Handle mmap cases - */ - - else { -#if HAVE_MMAP - -#if HAVE_MREMAP - INTERNAL_SIZE_T offset = oldp->prev_size; - size_t pagemask = av->pagesize - 1; - char *cp; - CHUNK_SIZE_T sum; - - /* Note the extra SIZE_SZ overhead */ - newsize = (nb + offset + SIZE_SZ + pagemask) & ~pagemask; - - /* don't need to remap if still within same page */ - if (oldsize == newsize - offset) - return oldmem; - - cp = (char*)mremap((char*)oldp - offset, oldsize + offset, newsize, 1); - - if (cp != (char*)MORECORE_FAILURE) { - - newp = (mchunkptr)(cp + offset); - set_head(newp, (newsize - offset)|IS_MMAPPED); - - assert(aligned_OK(chunk2mem(newp))); - assert((newp->prev_size == offset)); - - /* update statistics */ - sum = av->mmapped_mem += newsize - oldsize; - if (sum > (CHUNK_SIZE_T)(av->max_mmapped_mem)) - av->max_mmapped_mem = sum; - sum += av->sbrked_mem; - if (sum > (CHUNK_SIZE_T)(av->max_total_mem)) - av->max_total_mem = sum; - - return chunk2mem(newp); - } -#endif - - /* Note the extra SIZE_SZ overhead. */ - if ((CHUNK_SIZE_T)(oldsize) >= (CHUNK_SIZE_T)(nb + SIZE_SZ)) - newmem = oldmem; /* do nothing */ - else { - /* Must alloc, copy, free. */ - newmem = mALLOc(nb - MALLOC_ALIGN_MASK); - if (newmem != 0) { - MALLOC_COPY(newmem, oldmem, oldsize - 2*SIZE_SZ); - fREe(oldmem); - } - } - return newmem; - -#else - /* If !HAVE_MMAP, but chunk_is_mmapped, user must have overwritten mem */ - check_malloc_state(av); - MALLOC_FAILURE_ACTION; - return 0; -#endif - } -} - -/* - ------------------------------ memalign ------------------------------ -*/ - -Void_t* mEMALIGn(size_t alignment, size_t bytes) { - INTERNAL_SIZE_T nb; /* padded request size */ - char* m; /* memory returned by malloc call */ - mchunkptr p; /* corresponding chunk */ - char* brk; /* alignment point within p */ - mchunkptr newp; /* chunk to return */ - INTERNAL_SIZE_T newsize; /* its size */ - INTERNAL_SIZE_T leadsize; /* leading space before alignment point */ - mchunkptr remainder; /* spare room at end to split off */ - CHUNK_SIZE_T remainder_size; /* its size */ - INTERNAL_SIZE_T size; - - /* If need less alignment than we give anyway, just relay to malloc */ - - if (alignment <= MALLOC_ALIGNMENT) return mALLOc(bytes); - - /* Otherwise, ensure that it is at least a minimum chunk size */ - - if (alignment < MINSIZE) alignment = MINSIZE; - - /* Make sure alignment is power of 2 (in case MINSIZE is not). */ - if ((alignment & (alignment - 1)) != 0) { - size_t a = MALLOC_ALIGNMENT * 2; - while ((CHUNK_SIZE_T)a < (CHUNK_SIZE_T)alignment) a <<= 1; - alignment = a; - } - - checked_request2size(bytes, nb); - - /* - Strategy: find a spot within that chunk that meets the alignment - request, and then possibly free the leading and trailing space. - */ - - - /* Call malloc with worst case padding to hit alignment. */ - - m = (char*)(mALLOc(nb + alignment + MINSIZE)); - - if (m == 0) return 0; /* propagate failure */ - - p = mem2chunk(m); - - if ((((PTR_UINT)(m)) % alignment) != 0) { /* misaligned */ - - /* - Find an aligned spot inside chunk. Since we need to give back - leading space in a chunk of at least MINSIZE, if the first - calculation places us at a spot with less than MINSIZE leader, - we can move to the next aligned spot -- we've allocated enough - total room so that this is always possible. - */ - - brk = (char*)mem2chunk((PTR_UINT)(((PTR_UINT)(m + alignment - 1)) & - -((signed long) alignment))); - if ((CHUNK_SIZE_T)(brk - (char*)(p)) < MINSIZE) - brk += alignment; - - newp = (mchunkptr)brk; - leadsize = brk - (char*)(p); - newsize = chunksize(p) - leadsize; - - /* For mmapped chunks, just adjust offset */ - if (chunk_is_mmapped(p)) { - newp->prev_size = p->prev_size + leadsize; - set_head(newp, newsize|IS_MMAPPED); - return chunk2mem(newp); - } - - /* Otherwise, give back leader, use the rest */ - set_head(newp, newsize | PREV_INUSE); - set_inuse_bit_at_offset(newp, newsize); - set_head_size(p, leadsize); - fREe(chunk2mem(p)); - p = newp; - - assert (newsize >= nb && - (((PTR_UINT)(chunk2mem(p))) % alignment) == 0); - } - - /* Also give back spare room at the end */ - if (!chunk_is_mmapped(p)) { - size = chunksize(p); - if ((CHUNK_SIZE_T)(size) > (CHUNK_SIZE_T)(nb + MINSIZE)) { - remainder_size = size - nb; - remainder = chunk_at_offset(p, nb); - set_head(remainder, remainder_size | PREV_INUSE); - set_head_size(p, nb); - fREe(chunk2mem(remainder)); - } - } - - check_inuse_chunk(p); - return chunk2mem(p); -} - -/* - ------------------------------ calloc ------------------------------ -*/ - -Void_t* cALLOc(size_t n_elements, size_t elem_size) { - Void_t* mem = mALLOc(n_elements * elem_size); - - if (mem != 0) { - mchunkptr p = mem2chunk(mem); - INTERNAL_SIZE_T* d = (INTERNAL_SIZE_T*)mem; - - if (!chunk_is_mmapped(p)) - { - /* - Unroll clear of <= 36 bytes (72 if 8byte sizes) - We know that contents have an odd number of - INTERNAL_SIZE_T-sized words; minimally 3. - */ - - CHUNK_SIZE_T clearsize = chunksize(p) - SIZE_SZ; - CHUNK_SIZE_T nclears = clearsize / sizeof(INTERNAL_SIZE_T); - assert(nclears >= 3); - - if (nclears > 9) - MALLOC_ZERO(d, clearsize); - - else { - *(d+0) = 0; - *(d+1) = 0; - *(d+2) = 0; - if (nclears > 4) { - *(d+3) = 0; - *(d+4) = 0; - if (nclears > 6) { - *(d+5) = 0; - *(d+6) = 0; - if (nclears > 8) { - *(d+7) = 0; - *(d+8) = 0; - } - } - } - } - } -#if ! MMAP_CLEARS - else - { - /* - Note the additional SIZE_SZ - */ - CHUNK_SIZE_T clearsize = chunksize(p) - 2*SIZE_SZ; - MALLOC_ZERO(d, clearsize); - } -#endif - } - return mem; -} - -/* - ------------------------------ cfree ------------------------------ -*/ - -void cFREe(Void_t *mem) { - fREe(mem); -} - -/* - ------------------------- independent_calloc ------------------------- -*/ - - -Void_t** iCALLOc(size_t n_elements, size_t elem_size, Void_t* chunks[]) { - size_t sz = elem_size; /* serves as 1-element array */ - /* opts arg of 3 means all elements are same size, and should be cleared */ - return iALLOc(n_elements, &sz, 3, chunks); -} - -/* - ------------------------- independent_comalloc ------------------------- -*/ - -Void_t** iCOMALLOc(size_t n_elements, size_t sizes[], Void_t* chunks[]) { - return iALLOc(n_elements, sizes, 0, chunks); -} - - -/* - ------------------------------ ialloc ------------------------------ - ialloc provides common support for independent_X routines, handling all of - the combinations that can result. - - The opts arg has: - bit 0 set if all elements are same size (using sizes[0]) - bit 1 set if elements should be zeroed -*/ - - -static Void_t** iALLOc(size_t n_elements, - size_t* sizes, - int opts, - Void_t* chunks[]) { - mstate av = get_malloc_state(); - INTERNAL_SIZE_T element_size; /* chunksize of each element, if all same */ - INTERNAL_SIZE_T contents_size; /* total size of elements */ - INTERNAL_SIZE_T array_size; /* request size of pointer array */ - Void_t* mem; /* malloced aggregate space */ - mchunkptr p; /* corresponding chunk */ - CHUNK_SIZE_T remainder_size; /* remaining bytes while splitting */ - Void_t** marray; /* either "chunks" or malloced ptr array */ - mchunkptr array_chunk; /* chunk for malloced ptr array */ - unsigned int mprops; /* to disable mmap */ - CHUNK_SIZE_T size; - size_t i; - - ensure_initialization(av); - - /* compute array length, if needed */ - if (chunks != 0) { - if (n_elements == 0) - return chunks; /* nothing to do */ - marray = chunks; - array_size = 0; - } - else { - /* if empty req, must still return chunk representing empty array */ - if (n_elements == 0) - return (Void_t**) mALLOc(0); - marray = 0; - array_size = request2size(n_elements * (sizeof(Void_t*))); - } - - /* compute total element size */ - if (opts & 0x1) { /* all-same-size */ - element_size = request2size(*sizes); - contents_size = n_elements * element_size; - } - else { /* add up all the sizes */ - element_size = 0; - contents_size = 0; - for (i = 0; i != n_elements; ++i) - contents_size += request2size(sizes[i]); - } - - /* subtract out alignment bytes from total to minimize overallocation */ - size = contents_size + array_size - MALLOC_ALIGN_MASK; - - /* - Allocate the aggregate chunk. - But first disable mmap so malloc won't use it, since - we would not be able to later free/realloc space internal - to a segregated mmap region. - */ - - mprops = av->sysctl; /* disable mmap */ - disable_mmap(av); - mem = mALLOc(size); - av->sysctl = mprops; /* reset mmap */ - if (mem == 0) - return 0; - - p = mem2chunk(mem); - assert(!chunk_is_mmapped(p)); - remainder_size = chunksize(p); - - - if (opts & 0x2) { /* optionally clear the elements */ - MALLOC_ZERO(mem, remainder_size - SIZE_SZ - array_size); - } - - /* If not provided, allocate the pointer array as final part of chunk */ - if (marray == 0) { - array_chunk = chunk_at_offset(p, contents_size); - marray = (Void_t**) (chunk2mem(array_chunk)); - set_head(array_chunk, (remainder_size - contents_size) | PREV_INUSE); - remainder_size = contents_size; - } - - /* split out elements */ - for (i = 0; ; ++i) { - marray[i] = chunk2mem(p); - if (i != n_elements-1) { - if (element_size != 0) - size = element_size; - else - size = request2size(sizes[i]); - remainder_size -= size; - set_head(p, size | PREV_INUSE); - p = chunk_at_offset(p, size); - } - else { /* the final element absorbs any overallocation slop */ - set_head(p, remainder_size | PREV_INUSE); - break; - } - } - -#if DEBUG - if (marray != chunks) { - /* final element must have exactly exhausted chunk */ - if (element_size != 0) - assert(remainder_size == element_size); - else - assert(remainder_size == request2size(sizes[i])); - check_inuse_chunk(mem2chunk(marray)); - } - - for (i = 0; i != n_elements; ++i) - check_inuse_chunk(mem2chunk(marray[i])); -#endif - - return marray; -} - - -/* - ------------------------------ valloc ------------------------------ -*/ - -Void_t* vALLOc(size_t bytes) { - mstate av = get_malloc_state(); - ensure_initialization(av); - return mEMALIGn(av->pagesize, bytes); -} - -/* - ------------------------------ pvalloc ------------------------------ -*/ - - -Void_t* pVALLOc(size_t bytes) { - mstate av = get_malloc_state(); - size_t pagesz; - - ensure_initialization(av); - pagesz = av->pagesize; - return mEMALIGn(pagesz, (bytes + pagesz - 1) & ~(pagesz - 1)); -} - - -/* - ------------------------------ malloc_trim ------------------------------ -*/ - -int mTRIm(size_t pad) { - mstate av = get_malloc_state(); - return systrim(av, pad); -} - - -/* - ------------------------- malloc_usable_size ------------------------- -*/ - -size_t mUSABLe(Void_t* mem) { - mchunkptr p; - if (mem != 0) { - p = mem2chunk(mem); - if (chunk_is_mmapped(p)) - return chunksize(p) - 2*SIZE_SZ; - else if (inuse(p)) - return chunksize(p) - SIZE_SZ; - } - return 0; -} - -/* - ------------------------------ mallinfo ------------------------------ -*/ - -/* - Recursive helper function for mallinfo -*/ - -static void count_tree_blocks(tchunkptr t, int* pcount, INTERNAL_SIZE_T* pavail) { - while (t != 0) { - tchunkptr p = t->bk; - do { - (*pcount)++; - *pavail += chunksize(p); - p = p->bk; - } while (p != t); - if (t->child[0] != 0) - count_tree_blocks(t->child[0], pcount, pavail); - t = t->child[1]; - } -} - - - -struct mallinfo mALLINFo() -{ - mstate av = get_malloc_state(); - struct mallinfo mi; - INTERNAL_SIZE_T avail; - INTERNAL_SIZE_T topsize; - int nblocks; - INTERNAL_SIZE_T fastavail; - int nfastblocks; - mchunkptr p; - - if (av->top == 0) { - avail = 0; - topsize = 0; - nblocks = 0; - } - else { - int i; - check_malloc_state(av); - - topsize = chunksize(av->top); - avail = topsize; - nblocks = 1; /* top always exists */ - - /* traverse fastbins */ - nfastblocks = 0; - fastavail = 0; - - for (i = 0; i < NFASTBINS; ++i) { - for (p = av->fastbins[i]; p != 0; p = p->fd) { - ++nfastblocks; - fastavail += chunksize(p); - } - } - - avail += fastavail; - - /* traverse small bins */ - for (i = 2; i < NBINS; ++i) { - mbinptr b = bin_at(av, i); - mchunkptr p; - for (p = b->bk; p != b; p = p->bk) { - ++nblocks; - avail += chunksize(p); - } - } - - /* traverse tree bins */ - for (i = 0; i < NBINS; ++i) { - tchunkptr t = *(tbin_at(av, i)); - if (t != 0) - count_tree_blocks(t, &nblocks, &avail); - } - } - - mi.smblks = nfastblocks; - mi.smblks = 0; - mi.ordblks = nblocks; - mi.fordblks = avail; - mi.uordblks = av->sbrked_mem - avail; - mi.arena = av->sbrked_mem; - mi.hblks = av->n_mmaps; - mi.hblkhd = av->mmapped_mem; - mi.fsmblks = 0; - mi.keepcost = topsize; - mi.usmblks = av->max_total_mem; - return mi; -} - -/* - ------------------------------ malloc_stats ------------------------------ -*/ - -void mSTATs() { - struct mallinfo mi = mALLINFo(); - -#ifdef WIN32 - { - CHUNK_SIZE_T free, reserved, committed; - vminfo (&free, &reserved, &committed); - fprintf(stderr, "free bytes = %10lu\n", - free); - fprintf(stderr, "reserved bytes = %10lu\n", - reserved); - fprintf(stderr, "committed bytes = %10lu\n", - committed); - } -#endif - - - fprintf(stderr, "max system bytes = %10lu\n", - (CHUNK_SIZE_T)(mi.usmblks)); - fprintf(stderr, "system bytes = %10lu\n", - (CHUNK_SIZE_T)(mi.arena + mi.hblkhd)); - fprintf(stderr, "in use bytes = %10lu\n", - (CHUNK_SIZE_T)(mi.uordblks + mi.hblkhd)); - -#if 0 - fprintf(stderr, "n0 = %10u\n", n0); - fprintf(stderr, "n1 = %10u\n", n1); - fprintf(stderr, "n2 = %10u\n", n2); - fprintf(stderr, "n3 = %10u\n", n3); - fprintf(stderr, "n4 = %10u\n", n4); - fprintf(stderr, "n5 = %10u\n", n5); - fprintf(stderr, "n6 = %10u\n", n6); - fprintf(stderr, "n7 = %10u\n", n7); - fprintf(stderr, "n8 = %10u\n", n8); -#endif - - -#ifdef WIN32 - { - CHUNK_SIZE_T kernel, user; - if (cpuinfo (TRUE, &kernel, &user)) { - fprintf(stderr, "kernel ms = %10lu\n", - kernel); - fprintf(stderr, "user ms = %10lu\n", - user); - } - } -#endif -} - - -/* - ------------------------------ mallopt ------------------------------ -*/ - -int mALLOPt(int param_number, int value) { - mstate av = get_malloc_state(); - - ensure_initialization(av); - - switch(param_number) { - case M_MXFAST: - malloc_consolidate(av); - if (value >= 0 && value <= MAX_FAST_SIZE) { - set_max_fast(av, value); - return 1; - } - else - return 0; - - case M_TRIM_THRESHOLD: - av->trim_threshold = value; - return 1; - - case M_TOP_PAD: - av->top_pad = value; - return 1; - - case M_MMAP_THRESHOLD: - av->mmap_threshold = value; - return 1; - - case M_MMAP_MAX: -#if !HAVE_MMAP - if (value != 0) - return 0; -#endif - av->n_mmaps_max = value; - return 1; - - default: - return 0; - } -} - -/* ----------- Routines dealing with system allocation -------------- */ - -#if HAVE_MMAP -static mchunkptr mmap_malloc(mstate av, INTERNAL_SIZE_T nb) { - char* mm; /* return value from mmap call*/ - CHUNK_SIZE_T sum; /* for updating stats */ - mchunkptr p; /* the allocated/returned chunk */ - long size; - INTERNAL_SIZE_T front_misalign; /* unusable bytes at front of new space */ - long correction; - size_t pagemask = av->pagesize - 1; - - /* - Round up size to nearest page. For mmapped chunks, the overhead - is one SIZE_SZ unit larger than for normal chunks, because there - is no following chunk whose prev_size field could be used. - */ - size = (nb + SIZE_SZ + MALLOC_ALIGN_MASK + pagemask) & ~pagemask; - - /* Don't try if size wraps around 0 */ - if ((CHUNK_SIZE_T)(size) > (CHUNK_SIZE_T)(nb)) { - - mm = (char*)(MMAP(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE)); - - if (mm != (char*)(MORECORE_FAILURE)) { - - /* - The offset to the start of the mmapped region is stored - in the prev_size field of the chunk. This allows us to adjust - returned start address to meet alignment requirements here - and in memalign(), and still be able to compute proper - address argument for later munmap in free() and realloc(). - */ - - front_misalign = (INTERNAL_SIZE_T)chunk2mem(mm) & MALLOC_ALIGN_MASK; - if (front_misalign > 0) { - correction = MALLOC_ALIGNMENT - front_misalign; - p = (mchunkptr)(mm + correction); - p->prev_size = correction; - set_head(p, (size - correction) |IS_MMAPPED); - } - else { - p = (mchunkptr)mm; - p->prev_size = 0; - set_head(p, size|IS_MMAPPED); - } - - /* update statistics */ - - if (++av->n_mmaps > av->max_n_mmaps) - av->max_n_mmaps = av->n_mmaps; - - sum = av->mmapped_mem += size; - if (sum > (CHUNK_SIZE_T)(av->max_mmapped_mem)) - av->max_mmapped_mem = sum; - sum += av->sbrked_mem; - if (sum > (CHUNK_SIZE_T)(av->max_total_mem)) - av->max_total_mem = sum; - - check_chunk(p); - - return p; - } - } - return 0; -} -#endif - - -/* - sysmalloc handles malloc cases requiring more memory from the system. - On entry, it is assumed that av->top does not have enough - space to service request for nb bytes, thus requiring that av->top - be extended or replaced. -*/ - -static Void_t* sysmalloc(mstate av, CHUNK_SIZE_T nb) { - mchunkptr old_top; /* incoming value of av->top */ - INTERNAL_SIZE_T old_size; /* its size */ - char* old_end; /* its end address */ - - long size; /* arg to first MORECORE or mmap call */ - char* brk; /* return value from MORECORE */ - - long correction; /* arg to 2nd MORECORE call */ - char* snd_brk; /* 2nd return val */ - - INTERNAL_SIZE_T front_misalign; /* unusable bytes at front of new space */ - INTERNAL_SIZE_T end_misalign; /* partial page left at end of new space */ - char* aligned_brk; /* aligned offset into brk */ - - mchunkptr p; /* the allocated/returned chunk */ - mchunkptr remainder; /* remainder from allocation */ - CHUNK_SIZE_T remainder_size; /* its size */ - - CHUNK_SIZE_T sum; /* for updating stats */ - - size_t pagemask; - - /* - Initialize av if necessary - */ - if (av->top == 0) { - malloc_init_state(av); - /* to allow call solely for initialization */ - if (nb == 0) - return 0; - } - - -#if HAVE_MMAP - /* - If have mmap, and the request size meets the mmap threshold, and - the system supports mmap, and there are few enough currently - allocated mmapped regions, try to directly map this request - rather than expanding top. - */ - - if ((CHUNK_SIZE_T)(nb) >= (CHUNK_SIZE_T)(av->mmap_threshold) && - (av->n_mmaps < av->n_mmaps_max) && - !mmap_disabled(av)) { - Void_t* mp = mmap_malloc(av, nb); - if (mp != 0) - return chunk2mem(mp); - } -#endif - - - pagemask = av->pagesize - 1; - - /* Record incoming configuration of top */ - - old_top = av->top; - old_size = chunksize(old_top); - old_end = (char*)(chunk_at_offset(old_top, old_size)); - - brk = snd_brk = (char*)(MORECORE_FAILURE); - - /* - If not the first time through, we require old_size to be - at least MINSIZE and to have prev_inuse set. - */ - - assert((old_top == (mchunkptr)(&(av->initial_top)) && old_size == 0) || - ((CHUNK_SIZE_T) (old_size) >= MINSIZE && - prev_inuse(old_top))); - - /* Precondition: not enough current space to satisfy nb request */ - assert((CHUNK_SIZE_T)(old_size) < (CHUNK_SIZE_T)(nb + MINSIZE)); - - /* Request enough space for nb + pad + overhead */ - - size = nb + av->top_pad + MINSIZE; - - /* - If contiguous, we can subtract out existing space that we hope to - combine with new space. We add it back later only if - we don't actually get contiguous space. - */ - - if (contiguous(av)) - size -= old_size; - - /* - Round to a multiple of page size. - If MORECORE is not contiguous, this ensures that we only call it - with whole-page arguments. And if MORECORE is contiguous and - this is not first time through, this preserves page-alignment of - previous calls. Otherwise, we correct to page-align below. - */ - - size = (size + pagemask) & ~pagemask; - - /* - Don't try to call MORECORE if argument is so big as to appear - negative. Note that since mmap takes size_t arg, it may succeed - below even if we cannot call MORECORE. - */ - - if (size > 0) - brk = (char*)(MORECORE(size)); - - /* - If have mmap, try using it as a backup when MORECORE fails or - cannot be used. This is worth doing on systems that have "holes" in - address space, so sbrk cannot extend to give contiguous space, but - space is available elsewhere. Note that we ignore mmap max count - and threshold limits, since the space will not be used as a - segregated mmap region. - */ - -#if HAVE_MMAP - if (brk == (char*)(MORECORE_FAILURE)) { - - /* Cannot merge with old top, so add its size back in */ - if (contiguous(av)) - size = (size + old_size + pagemask) & ~pagemask; - - /* If we are relying on mmap as backup, then use larger units */ - if ((CHUNK_SIZE_T)(size) < (CHUNK_SIZE_T)(MMAP_AS_MORECORE_SIZE)) - size = MMAP_AS_MORECORE_SIZE; - - /* Don't try if size wraps around 0 */ - if ((CHUNK_SIZE_T)(size) > (CHUNK_SIZE_T)(nb)) { - - brk = (char*)(MMAP(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE)); - - if (brk != (char*)(MORECORE_FAILURE)) { - - /* We do not need, and cannot use, another sbrk call to find end */ - snd_brk = brk + size; - - /* - Record that we no longer have a contiguous sbrk region. - After the first time mmap is used as backup, we do not - ever rely on contiguous space since this could incorrectly - bridge regions. - */ - set_noncontiguous(av); - } - } - } -#endif - - if (brk != (char*)(MORECORE_FAILURE)) { - av->sbrked_mem += size; - - /* - If MORECORE extends previous space, we can likewise extend top size. - */ - - if (brk == old_end && snd_brk == (char*)(MORECORE_FAILURE)) { - set_head(old_top, (size + old_size) | PREV_INUSE); - } - - /* - Otherwise, make adjustments: - - * If the first time through or noncontiguous, we need to call sbrk - just to find out where the end of memory lies. - - * We need to ensure that all returned chunks from malloc will meet - MALLOC_ALIGNMENT - - * If there was an intervening foreign sbrk, we need to adjust sbrk - request size to account for fact that we will not be able to - combine new space with existing space in old_top. - - * Almost all systems internally allocate whole pages at a time, in - which case we might as well use the whole last page of request. - So we allocate enough more memory to hit a page boundary now, - which in turn causes future contiguous calls to page-align. - */ - - else { - front_misalign = 0; - end_misalign = 0; - correction = 0; - aligned_brk = brk; - - /* - If MORECORE returns an address lower than we have seen before, - we know it isn't really contiguous. This and some subsequent - checks help cope with non-conforming MORECORE functions and - the presence of "foreign" calls to MORECORE from outside of - malloc or by other threads. We cannot guarantee to detect - these in all cases, but cope with the ones we do detect. - */ - if (contiguous(av) && old_size != 0 && brk < old_end) { - set_noncontiguous(av); - } - - /* handle contiguous cases */ - if (contiguous(av)) { - - /* - We can tolerate forward non-contiguities here (usually due - to foreign calls) but treat them as part of our space for - stats reporting. - */ - if (old_size != 0) - av->sbrked_mem += brk - old_end; - - /* Guarantee alignment of first new chunk made from this space */ - - front_misalign = (INTERNAL_SIZE_T)chunk2mem(brk) & MALLOC_ALIGN_MASK; - if (front_misalign > 0) { - - /* - Skip over some bytes to arrive at an aligned position. - We don't need to specially mark these wasted front bytes. - They will never be accessed anyway because - prev_inuse of av->top (and any chunk created from its start) - is always true after initialization. - */ - - correction = MALLOC_ALIGNMENT - front_misalign; - aligned_brk += correction; - } - - /* - If this isn't adjacent to existing space, then we will not - be able to merge with old_top space, so must add to 2nd request. - */ - - correction += old_size; - - /* Extend the end address to hit a page boundary */ - end_misalign = (INTERNAL_SIZE_T)(brk + size + correction); - correction += ((end_misalign + pagemask) & ~pagemask) - end_misalign; - - assert(correction >= 0); - snd_brk = (char*)(MORECORE(correction)); - - if (snd_brk == (char*)(MORECORE_FAILURE)) { - /* - If can't allocate correction, try to at least find out current - brk. It might be enough to proceed without failing. - */ - correction = 0; - snd_brk = (char*)(MORECORE(0)); - } - else if (snd_brk < brk) { - /* - If the second call gives noncontiguous space even though - it says it won't, the only course of action is to ignore - results of second call, and conservatively estimate where - the first call left us. Also set noncontiguous, so this - won't happen again, leaving at most one hole. - - Note that this check is intrinsically incomplete. Because - MORECORE is allowed to give more space than we ask for, - there is no reliable way to detect a noncontiguity - producing a forward gap for the second call. - */ - snd_brk = brk + size; - correction = 0; - set_noncontiguous(av); - } - - } - - /* handle non-contiguous cases */ - else { - /* MORECORE/mmap must correctly align */ - assert(aligned_OK(chunk2mem(brk))); - - /* Find out current end of memory */ - if (snd_brk == (char*)(MORECORE_FAILURE)) { - snd_brk = (char*)(MORECORE(0)); - av->sbrked_mem += snd_brk - brk - size; - } - } - - /* Adjust top based on results of second sbrk */ - if (snd_brk != (char*)(MORECORE_FAILURE)) { - av->top = (mchunkptr)aligned_brk; - set_head(av->top, (snd_brk - aligned_brk + correction) | PREV_INUSE); - av->sbrked_mem += correction; - - /* - If not the first time through, we either have a - gap due to foreign sbrk or a non-contiguous region. Insert a - double fencepost at old_top to prevent consolidation with space - we don't own. These fenceposts are artificial chunks that are - marked as inuse and are in any case too small to use. We need - two to make sizes and alignments work out. - */ - - if (old_size != 0) { - /* - Shrink old_top to insert fenceposts, keeping size a - multiple of MALLOC_ALIGNMENT. We know there is at least - enough space in old_top to do this. - */ - old_size = (old_size - 3*SIZE_SZ) & ~MALLOC_ALIGN_MASK; - set_head(old_top, old_size | PREV_INUSE); - - /* - Note that the following assignments completely overwrite - old_top when old_size was previously MINSIZE. This is - intentional. We need the fencepost, even if old_top - otherwise gets lost. - */ - chunk_at_offset(old_top, old_size )->size = - SIZE_SZ|PREV_INUSE; - - chunk_at_offset(old_top, old_size + SIZE_SZ)->size = - SIZE_SZ|PREV_INUSE; - - /* - If possible, release the rest, suppressing trimming. - */ - if (old_size >= MINSIZE) { - unsigned int mprops = av->sysctl; - disable_trim(av); - fREe(chunk2mem(old_top)); - av->sysctl = mprops; - } - } - } - } - - /* Update statistics */ - sum = av->sbrked_mem; - if (sum > (CHUNK_SIZE_T)(av->max_sbrked_mem)) - av->max_sbrked_mem = sum; - - sum += av->mmapped_mem; - if (sum > (CHUNK_SIZE_T)(av->max_total_mem)) - av->max_total_mem = sum; - - - /* finally, do the allocation */ - - p = av->top; - size = chunksize(p); - - /* check that one of the above allocation paths succeeded */ - if ((CHUNK_SIZE_T)(size) >= (CHUNK_SIZE_T)(nb + MINSIZE)) { - remainder_size = size - nb; - remainder = chunk_at_offset(p, nb); - av->top = remainder; - set_head(p, nb | PREV_INUSE); - set_head(remainder, remainder_size | PREV_INUSE); - check_malloced_chunk(p, nb); - check_malloc_state(av); - return chunk2mem(p); - } - - } - - /* catch all failure paths */ - check_malloc_state(av); - MALLOC_FAILURE_ACTION; - return 0; -} - - -/* - systrim is an inverse of sorts to sysmalloc. It gives memory back - to the system (via negative arguments to sbrk) if there is unused - memory at the `high' end of the malloc pool. It is called - automatically by free() when top space exceeds the trim - threshold. It is also called by the public malloc_trim routine. It - returns 1 if it actually released any memory, else 0. -*/ - -static int systrim(mstate av, size_t pad) { - long top_size; /* Amount of top-most memory */ - long extra; /* Amount to release */ - long released; /* Amount actually released */ - char* current_brk; /* address returned by pre-check sbrk call */ - char* new_brk; /* address returned by post-check sbrk call */ - size_t pagesz; - - ensure_initialization(av); - - if (have_fastchunks(av)) - malloc_consolidate(av); - - if (!trim_disabled(av)) { - -#ifndef MORECORE_CANNOT_TRIM - - pagesz = av->pagesize; - top_size = chunksize(av->top); - - /* Release in pagesize units, keeping at least one page */ - extra = ((top_size - pad - MINSIZE + (pagesz-1)) / pagesz - 1) * pagesz; - - if (extra > 0) { - - /* - Only proceed if end of memory is where we last set it. - This avoids problems if there were foreign sbrk calls. - */ - current_brk = (char*)(MORECORE(0)); - if (current_brk == (char*)(av->top) + top_size) { - - /* - Attempt to release memory. We ignore MORECORE return value, - and instead call again to find out where new end of memory is. - This avoids problems if first call releases less than we asked, - of if failure somehow altered brk value. (We could still - encounter problems if it altered brk in some very bad way, - but the only thing we can do is adjust anyway, which will cause - some downstream failure.) - */ - - MORECORE(-extra); - new_brk = (char*)(MORECORE(0)); - - if (new_brk != (char*)MORECORE_FAILURE) { - released = (long)(current_brk - new_brk); - - if (released != 0) { - /* Success. Adjust top. */ - av->sbrked_mem -= released; - set_head(av->top, (top_size - released) | PREV_INUSE); - check_malloc_state(av); - return 1; - } - } - } - } - } -#endif - return 0; -} - - -/* - -------------------- Alternative MORECORE functions -------------------- -*/ - - -/* - General Requirements for MORECORE. - - The MORECORE function must have the following properties: - - If MORECORE_CONTIGUOUS is false: - - * MORECORE must allocate in multiples of pagesize. It will - only be called with arguments that are multiples of pagesize. - - * MORECORE(0) must return an address that is at least - MALLOC_ALIGNMENT aligned. (Page-aligning always suffices.) - - else (i.e. If MORECORE_CONTIGUOUS is true): - - * Consecutive calls to MORECORE with positive arguments - return increasing addresses, indicating that space has been - contiguously extended. - - * MORECORE need not allocate in multiples of pagesize. - Calls to MORECORE need not have args of multiples of pagesize. - - * MORECORE need not page-align. - - In either case: - - * MORECORE may allocate more memory than requested. (Or even less, - but this will generally result in a malloc failure.) - - * MORECORE must not allocate memory when given argument zero, but - instead return one past the end address of memory from previous - nonzero call. This malloc does NOT call MORECORE(0) - until at least one call with positive arguments is made, so - the initial value returned is not important. - - * Even though consecutive calls to MORECORE need not return contiguous - addresses, it must be OK for malloc'ed chunks to span multiple - regions in those cases where they do happen to be contiguous. - - * MORECORE need not handle negative arguments -- it may instead - just return MORECORE_FAILURE when given negative arguments. - Negative arguments are always multiples of pagesize. MORECORE - must not misinterpret negative args as large positive unsigned - args. You can suppress all such calls from even occurring by defining - MORECORE_CANNOT_TRIM, - - There is some variation across systems about the type of the - argument to sbrk/MORECORE. If size_t is unsigned, then it cannot - actually be size_t, because sbrk supports negative args, so it is - normally the signed type of the same width as size_t (sometimes - declared as "intptr_t", and sometimes "ptrdiff_t"). It doesn't much - matter though. Internally, we use "long" as arguments, which should - work across all reasonable possibilities. - - Additionally, if MORECORE ever returns failure for a positive - request, and HAVE_MMAP is true, then mmap is used as a noncontiguous - system allocator. This is a useful backup strategy for systems with - holes in address spaces -- in this case sbrk cannot contiguously - expand the heap, but mmap may be able to map noncontiguous space. - - If you'd like mmap to ALWAYS be used, you can define MORECORE to be - a function that always returns MORECORE_FAILURE. - - Malloc only has limited ability to detect failures of MORECORE - to supply contiguous space when it says it can. In particular, - multithreaded programs that do not use locks may result in - rece conditions across calls to MORECORE that result in gaps - that cannot be detected as such, and subsequent corruption. - - If you are using this malloc with something other than sbrk (or its - emulation) to supply memory regions, you probably want to set - MORECORE_CONTIGUOUS as false. As an example, here is a custom - allocator kindly contributed for pre-OSX macOS. It uses virtually - but not necessarily physically contiguous non-paged memory (locked - in, present and won't get swapped out). You can use it by - uncommenting this section, adding some #includes, and setting up the - appropriate defines above: - - #define MORECORE osMoreCore - #define MORECORE_CONTIGUOUS 0 - - There is also a shutdown routine that should somehow be called for - cleanup upon program exit. - - #define MAX_POOL_ENTRIES 100 - #define MINIMUM_MORECORE_SIZE (64 * 1024) - static int next_os_pool; - void *our_os_pools[MAX_POOL_ENTRIES]; - - void *osMoreCore(int size) - { - void *ptr = 0; - static void *sbrk_top = 0; - - if (size > 0) - { - if (size < MINIMUM_MORECORE_SIZE) - size = MINIMUM_MORECORE_SIZE; - if (CurrentExecutionLevel() == kTaskLevel) - ptr = PoolAllocateResident(size + RM_PAGE_SIZE, 0); - if (ptr == 0) - { - return (void *) MORECORE_FAILURE; - } - // save ptrs so they can be freed during cleanup - our_os_pools[next_os_pool] = ptr; - next_os_pool++; - ptr = (void *) ((((CHUNK_SIZE_T) ptr) + RM_PAGE_MASK) & ~RM_PAGE_MASK); - sbrk_top = (char *) ptr + size; - return ptr; - } - else if (size < 0) - { - // we don't currently support shrink behavior - return (void *) MORECORE_FAILURE; - } - else - { - return sbrk_top; - } - } - - // cleanup any allocated memory pools - // called as last thing before shutting down driver - - void osCleanupMem(void) - { - void **ptr; - - for (ptr = our_os_pools; ptr < &our_os_pools[MAX_POOL_ENTRIES]; ptr++) - if (*ptr) - { - PoolDeallocate(*ptr); - *ptr = 0; - } - } - -*/ - - -/* - -------------------------------------------------------------- - - Emulation of sbrk for win32. - Donated by J. Walter . - For additional information about this code, and malloc on Win32, see - http://www.genesys-e.de/jwalter/ -*/ - - -#ifdef WIN32 - -#ifdef _DEBUG -/* #define TRACE */ -#endif - -/* Support for USE_MALLOC_LOCK */ -#ifdef USE_MALLOC_LOCK - -/* Wait for spin lock */ -static int slwait (int *sl) { - while (InterlockedCompareExchange ((void **) sl, (void *) 1, (void *) 0) != 0) - Sleep (0); - return 0; -} - -/* Release spin lock */ -static int slrelease (int *sl) { - InterlockedExchange (sl, 0); - return 0; -} - -#ifdef NEEDED -/* Spin lock for emulation code */ -static int g_sl; -#endif - -#endif /* USE_MALLOC_LOCK */ - -/* getpagesize for windows */ -static long getpagesize (void) { - static long g_pagesize = 0; - if (! g_pagesize) { - SYSTEM_INFO system_info; - GetSystemInfo (&system_info); - g_pagesize = system_info.dwPageSize; - } - return g_pagesize; -} -static long getregionsize (void) { - static long g_regionsize = 0; - if (! g_regionsize) { - SYSTEM_INFO system_info; - GetSystemInfo (&system_info); - g_regionsize = system_info.dwAllocationGranularity; - } - return g_regionsize; -} - -/* A region list entry */ -typedef struct _region_list_entry { - void *top_allocated; - void *top_committed; - void *top_reserved; - long reserve_size; - struct _region_list_entry *previous; -} region_list_entry; - -/* Allocate and link a region entry in the region list */ -static int region_list_append (region_list_entry **last, void *base_reserved, long reserve_size) { - region_list_entry *next = HeapAlloc (GetProcessHeap (), 0, sizeof (region_list_entry)); - if (! next) - return FALSE; - next->top_allocated = (char *) base_reserved; - next->top_committed = (char *) base_reserved; - next->top_reserved = (char *) base_reserved + reserve_size; - next->reserve_size = reserve_size; - next->previous = *last; - *last = next; - return TRUE; -} -/* Free and unlink the last region entry from the region list */ -static int region_list_remove (region_list_entry **last) { - region_list_entry *previous = (*last)->previous; - if (! HeapFree (GetProcessHeap (), sizeof (region_list_entry), *last)) - return FALSE; - *last = previous; - return TRUE; -} - -#define CEIL(size,to) (((size)+(to)-1)&~((to)-1)) -#define FLOOR(size,to) ((size)&~((to)-1)) - -#define SBRK_SCALE 0 -/* #define SBRK_SCALE 1 */ -/* #define SBRK_SCALE 2 */ -/* #define SBRK_SCALE 4 */ - -/* sbrk for windows */ -static void *sbrk (long size) { - static long g_pagesize, g_my_pagesize; - static long g_regionsize, g_my_regionsize; - static region_list_entry *g_last; - void *result = (void *) MORECORE_FAILURE; -#ifdef TRACE - printf ("sbrk %d\n", size); -#endif -#if defined (USE_MALLOC_LOCK) && defined (NEEDED) - /* Wait for spin lock */ - slwait (&g_sl); -#endif - /* First time initialization */ - if (! g_pagesize) { - g_pagesize = getpagesize (); - g_my_pagesize = g_pagesize << SBRK_SCALE; - } - if (! g_regionsize) { - g_regionsize = getregionsize (); - g_my_regionsize = g_regionsize << SBRK_SCALE; - } - if (! g_last) { - if (! region_list_append (&g_last, 0, 0)) - goto sbrk_exit; - } - /* Assert invariants */ - assert (g_last); - assert ((char *) g_last->top_reserved - g_last->reserve_size <= (char *) g_last->top_allocated && - g_last->top_allocated <= g_last->top_committed); - assert ((char *) g_last->top_reserved - g_last->reserve_size <= (char *) g_last->top_committed && - g_last->top_committed <= g_last->top_reserved && - (unsigned) g_last->top_committed % g_pagesize == 0); - assert ((unsigned) g_last->top_reserved % g_regionsize == 0); - assert ((unsigned) g_last->reserve_size % g_regionsize == 0); - /* Allocation requested? */ - if (size >= 0) { - /* Allocation size is the requested size */ - long allocate_size = size; - /* Compute the size to commit */ - long to_commit = (char *) g_last->top_allocated + allocate_size - (char *) g_last->top_committed; - /* Do we reach the commit limit? */ - if (to_commit > 0) { - /* Round size to commit */ - long commit_size = CEIL (to_commit, g_my_pagesize); - /* Compute the size to reserve */ - long to_reserve = (char *) g_last->top_committed + commit_size - (char *) g_last->top_reserved; - /* Do we reach the reserve limit? */ - if (to_reserve > 0) { - /* Compute the remaining size to commit in the current region */ - long remaining_commit_size = (char *) g_last->top_reserved - (char *) g_last->top_committed; - if (remaining_commit_size > 0) { - /* Assert preconditions */ - assert ((unsigned) g_last->top_committed % g_pagesize == 0); - assert (0 < remaining_commit_size && remaining_commit_size % g_pagesize == 0); { - /* Commit this */ - void *base_committed = VirtualAlloc (g_last->top_committed, remaining_commit_size, - MEM_COMMIT, PAGE_READWRITE); - /* Check returned pointer for consistency */ - if (base_committed != g_last->top_committed) - goto sbrk_exit; - /* Assert postconditions */ - assert ((unsigned) base_committed % g_pagesize == 0); -#ifdef TRACE - printf ("Commit %p %d\n", base_committed, remaining_commit_size); -#endif - /* Adjust the regions commit top */ - g_last->top_committed = (char *) base_committed + remaining_commit_size; - } - } { - /* Now we are going to search and reserve. */ - int contiguous = -1; - int found = FALSE; - MEMORY_BASIC_INFORMATION memory_info; - void *base_reserved; - long reserve_size; - do { - /* Assume contiguous memory */ - contiguous = TRUE; - /* Round size to reserve */ - reserve_size = CEIL (to_reserve, g_my_regionsize); - /* Start with the current region's top */ - memory_info.BaseAddress = g_last->top_reserved; - /* Assert preconditions */ - assert ((unsigned) memory_info.BaseAddress % g_pagesize == 0); - assert (0 < reserve_size && reserve_size % g_regionsize == 0); - while (VirtualQuery (memory_info.BaseAddress, &memory_info, sizeof (memory_info))) { - /* Assert postconditions */ - assert ((unsigned) memory_info.BaseAddress % g_pagesize == 0); -#ifdef TRACE - printf ("Query %p %d %s\n", memory_info.BaseAddress, memory_info.RegionSize, - memory_info.State == MEM_FREE ? "FREE": - (memory_info.State == MEM_RESERVE ? "RESERVED": - (memory_info.State == MEM_COMMIT ? "COMMITTED": "?"))); -#endif - /* Region is free, well aligned and big enough: we are done */ - if (memory_info.State == MEM_FREE && - (unsigned) memory_info.BaseAddress % g_regionsize == 0 && - memory_info.RegionSize >= (unsigned) reserve_size) { - found = TRUE; - break; - } - /* From now on we can't get contiguous memory! */ - contiguous = FALSE; - /* Recompute size to reserve */ - reserve_size = CEIL (allocate_size, g_my_regionsize); - memory_info.BaseAddress = (char *) memory_info.BaseAddress + memory_info.RegionSize; - /* Assert preconditions */ - assert ((unsigned) memory_info.BaseAddress % g_pagesize == 0); - assert (0 < reserve_size && reserve_size % g_regionsize == 0); - } - /* Search failed? */ - if (! found) - goto sbrk_exit; - /* Assert preconditions */ - assert ((unsigned) memory_info.BaseAddress % g_regionsize == 0); - assert (0 < reserve_size && reserve_size % g_regionsize == 0); - /* Try to reserve this */ - base_reserved = VirtualAlloc (memory_info.BaseAddress, reserve_size, - MEM_RESERVE, PAGE_NOACCESS); - if (! base_reserved) { - int rc = GetLastError (); - if (rc != ERROR_INVALID_ADDRESS) - goto sbrk_exit; - } - /* A null pointer signals (hopefully) a race condition with another thread. */ - /* In this case, we try again. */ - } while (! base_reserved); - /* Check returned pointer for consistency */ - if (memory_info.BaseAddress && base_reserved != memory_info.BaseAddress) - goto sbrk_exit; - /* Assert postconditions */ - assert ((unsigned) base_reserved % g_regionsize == 0); -#ifdef TRACE - printf ("Reserve %p %d\n", base_reserved, reserve_size); -#endif - /* Did we get contiguous memory? */ - if (contiguous) { - long start_size = (char *) g_last->top_committed - (char *) g_last->top_allocated; - /* Adjust allocation size */ - allocate_size -= start_size; - /* Adjust the regions allocation top */ - g_last->top_allocated = g_last->top_committed; - /* Recompute the size to commit */ - to_commit = (char *) g_last->top_allocated + allocate_size - (char *) g_last->top_committed; - /* Round size to commit */ - commit_size = CEIL (to_commit, g_my_pagesize); - } - /* Append the new region to the list */ - if (! region_list_append (&g_last, base_reserved, reserve_size)) - goto sbrk_exit; - /* Didn't we get contiguous memory? */ - if (! contiguous) { - /* Recompute the size to commit */ - to_commit = (char *) g_last->top_allocated + allocate_size - (char *) g_last->top_committed; - /* Round size to commit */ - commit_size = CEIL (to_commit, g_my_pagesize); - } - } - } - /* Assert preconditions */ - assert ((unsigned) g_last->top_committed % g_pagesize == 0); - assert (0 < commit_size && commit_size % g_pagesize == 0); { - /* Commit this */ - void *base_committed = VirtualAlloc (g_last->top_committed, commit_size, - MEM_COMMIT, PAGE_READWRITE); - /* Check returned pointer for consistency */ - if (base_committed != g_last->top_committed) - goto sbrk_exit; - /* Assert postconditions */ - assert ((unsigned) base_committed % g_pagesize == 0); -#ifdef TRACE - printf ("Commit %p %d\n", base_committed, commit_size); -#endif - /* Adjust the regions commit top */ - g_last->top_committed = (char *) base_committed + commit_size; - } - } - /* Adjust the regions allocation top */ - g_last->top_allocated = (char *) g_last->top_allocated + allocate_size; - result = (char *) g_last->top_allocated - size; - /* Deallocation requested? */ - } else if (size < 0) { - long deallocate_size = - size; - /* As long as we have a region to release */ - while ((char *) g_last->top_allocated - deallocate_size < (char *) g_last->top_reserved - g_last->reserve_size) { - /* Get the size to release */ - long release_size = g_last->reserve_size; - /* Get the base address */ - void *base_reserved = (char *) g_last->top_reserved - release_size; - /* Assert preconditions */ - assert ((unsigned) base_reserved % g_regionsize == 0); - assert (0 < release_size && release_size % g_regionsize == 0); { - /* Release this */ - int rc = VirtualFree (base_reserved, 0, - MEM_RELEASE); - /* Check returned code for consistency */ - if (! rc) - goto sbrk_exit; -#ifdef TRACE - printf ("Release %p %d\n", base_reserved, release_size); -#endif - } - /* Adjust deallocation size */ - deallocate_size -= (char *) g_last->top_allocated - (char *) base_reserved; - /* Remove the old region from the list */ - if (! region_list_remove (&g_last)) - goto sbrk_exit; - } { - /* Compute the size to decommit */ - long to_decommit = (char *) g_last->top_committed - ((char *) g_last->top_allocated - deallocate_size); - if (to_decommit >= g_my_pagesize) { - /* Compute the size to decommit */ - long decommit_size = FLOOR (to_decommit, g_my_pagesize); - /* Compute the base address */ - void *base_committed = (char *) g_last->top_committed - decommit_size; - /* Assert preconditions */ - assert ((unsigned) base_committed % g_pagesize == 0); - assert (0 < decommit_size && decommit_size % g_pagesize == 0); { - /* Decommit this */ - int rc = VirtualFree ((char *) base_committed, decommit_size, - MEM_DECOMMIT); - /* Check returned code for consistency */ - if (! rc) - goto sbrk_exit; -#ifdef TRACE - printf ("Decommit %p %d\n", base_committed, decommit_size); -#endif - } - /* Adjust deallocation size and regions commit and allocate top */ - deallocate_size -= (char *) g_last->top_allocated - (char *) base_committed; - g_last->top_committed = base_committed; - g_last->top_allocated = base_committed; - } - } - /* Adjust regions allocate top */ - g_last->top_allocated = (char *) g_last->top_allocated - deallocate_size; - /* Check for underflow */ - if ((char *) g_last->top_reserved - g_last->reserve_size > (char *) g_last->top_allocated || - g_last->top_allocated > g_last->top_committed) { - /* Adjust regions allocate top */ - g_last->top_allocated = (char *) g_last->top_reserved - g_last->reserve_size; - goto sbrk_exit; - } - result = g_last->top_allocated; - } - /* Assert invariants */ - assert (g_last); - assert ((char *) g_last->top_reserved - g_last->reserve_size <= (char *) g_last->top_allocated && - g_last->top_allocated <= g_last->top_committed); - assert ((char *) g_last->top_reserved - g_last->reserve_size <= (char *) g_last->top_committed && - g_last->top_committed <= g_last->top_reserved && - (unsigned) g_last->top_committed % g_pagesize == 0); - assert ((unsigned) g_last->top_reserved % g_regionsize == 0); - assert ((unsigned) g_last->reserve_size % g_regionsize == 0); - -sbrk_exit: -#if defined (USE_MALLOC_LOCK) && defined (NEEDED) - /* Release spin lock */ - slrelease (&g_sl); -#endif - return result; -} - -/* mmap for windows */ -static void *mmap (void *ptr, long size, long prot, long type, long handle, long arg) { - static long g_pagesize; - static long g_regionsize; -#ifdef TRACE - printf ("mmap %d\n", size); -#endif -#if defined (USE_MALLOC_LOCK) && defined (NEEDED) - /* Wait for spin lock */ - slwait (&g_sl); -#endif - /* First time initialization */ - if (! g_pagesize) - g_pagesize = getpagesize (); - if (! g_regionsize) - g_regionsize = getregionsize (); - /* Assert preconditions */ - assert ((unsigned) ptr % g_regionsize == 0); - assert (size % g_pagesize == 0); - /* Allocate this */ - ptr = VirtualAlloc (ptr, size, - MEM_RESERVE | MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE); - if (! ptr) { - ptr = (void *) MORECORE_FAILURE; - goto mmap_exit; - } - /* Assert postconditions */ - assert ((unsigned) ptr % g_regionsize == 0); -#ifdef TRACE - printf ("Commit %p %d\n", ptr, size); -#endif -mmap_exit: -#if defined (USE_MALLOC_LOCK) && defined (NEEDED) - /* Release spin lock */ - slrelease (&g_sl); -#endif - return ptr; -} - -/* munmap for windows */ -static long munmap (void *ptr, long size) { - static long g_pagesize; - static long g_regionsize; - int rc = MUNMAP_FAILURE; -#ifdef TRACE - printf ("munmap %p %d\n", ptr, size); -#endif -#if defined (USE_MALLOC_LOCK) && defined (NEEDED) - /* Wait for spin lock */ - slwait (&g_sl); -#endif - /* First time initialization */ - if (! g_pagesize) - g_pagesize = getpagesize (); - if (! g_regionsize) - g_regionsize = getregionsize (); - /* Assert preconditions */ - assert ((unsigned) ptr % g_regionsize == 0); - assert (size % g_pagesize == 0); - /* Free this */ - if (! VirtualFree (ptr, 0, - MEM_RELEASE)) - goto munmap_exit; - rc = 0; -#ifdef TRACE - printf ("Release %p %d\n", ptr, size); -#endif -munmap_exit: -#if defined (USE_MALLOC_LOCK) && defined (NEEDED) - /* Release spin lock */ - slrelease (&g_sl); -#endif - return rc; -} - -static void vminfo (CHUNK_SIZE_T *free, CHUNK_SIZE_T *reserved, CHUNK_SIZE_T *committed) { - MEMORY_BASIC_INFORMATION memory_info; - memory_info.BaseAddress = 0; - *free = *reserved = *committed = 0; - while (VirtualQuery (memory_info.BaseAddress, &memory_info, sizeof (memory_info))) { - switch (memory_info.State) { - case MEM_FREE: - *free += memory_info.RegionSize; - break; - case MEM_RESERVE: - *reserved += memory_info.RegionSize; - break; - case MEM_COMMIT: - *committed += memory_info.RegionSize; - break; - } - memory_info.BaseAddress = (char *) memory_info.BaseAddress + memory_info.RegionSize; - } -} - -static int cpuinfo (int whole, CHUNK_SIZE_T *kernel, CHUNK_SIZE_T *user) { - if (whole) { - __int64 creation64, exit64, kernel64, user64; - int rc = GetProcessTimes (GetCurrentProcess (), - (FILETIME *) &creation64, - (FILETIME *) &exit64, - (FILETIME *) &kernel64, - (FILETIME *) &user64); - if (! rc) { - *kernel = 0; - *user = 0; - return FALSE; - } - *kernel = (CHUNK_SIZE_T) (kernel64 / 10000); - *user = (CHUNK_SIZE_T) (user64 / 10000); - return TRUE; - } else { - __int64 creation64, exit64, kernel64, user64; - int rc = GetThreadTimes (GetCurrentThread (), - (FILETIME *) &creation64, - (FILETIME *) &exit64, - (FILETIME *) &kernel64, - (FILETIME *) &user64); - if (! rc) { - *kernel = 0; - *user = 0; - return FALSE; - } - *kernel = (CHUNK_SIZE_T) (kernel64 / 10000); - *user = (CHUNK_SIZE_T) (user64 / 10000); - return TRUE; - } -} - -#endif /* WIN32 */ - -/* ------------------------------------------------------------ -History: - V2.8.0 (not yet released) - * Use trees for non-small bins - Also requiring different size->bin algorithm - - V2.7.1 Thu Jul 25 10:58:03 2002 Doug Lea (dl at gee) - * Allow tuning of FIRST_SORTED_BIN_SIZE - * Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte. - * Better detection and support for non-contiguousness of MORECORE. - Thanks to Andreas Mueller, Conal Walsh, and Wolfram Gloger - * Bypass most of malloc if no frees. Thanks To Emery Berger. - * Fix freeing of old top non-contiguous chunk im sysmalloc. - * Raised default trim and map thresholds to 256K. - * Fix mmap-related #defines. Thanks to Lubos Lunak. - * Fix copy macros; added LACKS_FCNTL_H. Thanks to Neal Walfield. - * Branch-free bin calculation - * Default trim and mmap thresholds now 256K. - - V2.7.0 Sun Mar 11 14:14:06 2001 Doug Lea (dl at gee) - * Introduce independent_comalloc and independent_calloc. - Thanks to Michael Pachos for motivation and help. - * Make optional .h file available - * Allow > 2GB requests on 32bit systems. - * new WIN32 sbrk, mmap, munmap, lock code from . - Thanks also to Andreas Mueller , - and Anonymous. - * Allow override of MALLOC_ALIGNMENT (Thanks to Ruud Waij for - helping test this.) - * memalign: check alignment arg - * realloc: don't try to shift chunks backwards, since this - leads to more fragmentation in some programs and doesn't - seem to help in any others. - * Collect all cases in malloc requiring system memory into sysmalloc - * Use mmap as backup to sbrk - * Place all internal state in malloc_state - * Introduce fastbins (although similar to 2.5.1) - * Many minor tunings and cosmetic improvements - * Introduce USE_PUBLIC_MALLOC_WRAPPERS, USE_MALLOC_LOCK - * Introduce MALLOC_FAILURE_ACTION, MORECORE_CONTIGUOUS - Thanks to Tony E. Bennett and others. - * Include errno.h to support default failure action. - - V2.6.6 Sun Dec 5 07:42:19 1999 Doug Lea (dl at gee) - * return null for negative arguments - * Added Several WIN32 cleanups from Martin C. Fong - * Add 'LACKS_SYS_PARAM_H' for those systems without 'sys/param.h' - (e.g. WIN32 platforms) - * Cleanup header file inclusion for WIN32 platforms - * Cleanup code to avoid Microsoft Visual C++ compiler complaints - * Add 'USE_DL_PREFIX' to quickly allow co-existence with existing - memory allocation routines - * Set 'malloc_getpagesize' for WIN32 platforms (needs more work) - * Use 'assert' rather than 'ASSERT' in WIN32 code to conform to - usage of 'assert' in non-WIN32 code - * Improve WIN32 'sbrk()' emulation's 'findRegion()' routine to - avoid infinite loop - * Always call 'fREe()' rather than 'free()' - - V2.6.5 Wed Jun 17 15:57:31 1998 Doug Lea (dl at gee) - * Fixed ordering problem with boundary-stamping - - V2.6.3 Sun May 19 08:17:58 1996 Doug Lea (dl at gee) - * Added pvalloc, as recommended by H.J. Liu - * Added 64bit pointer support mainly from Wolfram Gloger - * Added anonymously donated WIN32 sbrk emulation - * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen - * malloc_extend_top: fix mask error that caused wastage after - foreign sbrks - * Add linux mremap support code from HJ Liu - - V2.6.2 Tue Dec 5 06:52:55 1995 Doug Lea (dl at gee) - * Integrated most documentation with the code. - * Add support for mmap, with help from - Wolfram Gloger (Gloger@lrz.uni-muenchen.de). - * Use last_remainder in more cases. - * Pack bins using idea from colin@nyx10.cs.du.edu - * Use ordered bins instead of best-fit threshhold - * Eliminate block-local decls to simplify tracing and debugging. - * Support another case of realloc via move into top - * Fix error occuring when initial sbrk_base not word-aligned. - * Rely on page size for units instead of SBRK_UNIT to - avoid surprises about sbrk alignment conventions. - * Add mallinfo, mallopt. Thanks to Raymond Nijssen - (raymond@es.ele.tue.nl) for the suggestion. - * Add `pad' argument to malloc_trim and top_pad mallopt parameter. - * More precautions for cases where other routines call sbrk, - courtesy of Wolfram Gloger (Gloger@lrz.uni-muenchen.de). - * Added macros etc., allowing use in linux libc from - H.J. Lu (hjl@gnu.ai.mit.edu) - * Inverted this history list - - V2.6.1 Sat Dec 2 14:10:57 1995 Doug Lea (dl at gee) - * Re-tuned and fixed to behave more nicely with V2.6.0 changes. - * Removed all preallocation code since under current scheme - the work required to undo bad preallocations exceeds - the work saved in good cases for most test programs. - * No longer use return list or unconsolidated bins since - no scheme using them consistently outperforms those that don't - given above changes. - * Use best fit for very large chunks to prevent some worst-cases. - * Added some support for debugging - - V2.6.0 Sat Nov 4 07:05:23 1995 Doug Lea (dl at gee) - * Removed footers when chunks are in use. Thanks to - Paul Wilson (wilson@cs.texas.edu) for the suggestion. - - V2.5.4 Wed Nov 1 07:54:51 1995 Doug Lea (dl at gee) - * Added malloc_trim, with help from Wolfram Gloger - (wmglo@Dent.MED.Uni-Muenchen.DE). - - V2.5.3 Tue Apr 26 10:16:01 1994 Doug Lea (dl at g) - - V2.5.2 Tue Apr 5 16:20:40 1994 Doug Lea (dl at g) - * realloc: try to expand in both directions - * malloc: swap order of clean-bin strategy; - * realloc: only conditionally expand backwards - * Try not to scavenge used bins - * Use bin counts as a guide to preallocation - * Occasionally bin return list chunks in first scan - * Add a few optimizations from colin@nyx10.cs.du.edu - - V2.5.1 Sat Aug 14 15:40:43 1993 Doug Lea (dl at g) - * faster bin computation & slightly different binning - * merged all consolidations to one part of malloc proper - (eliminating old malloc_find_space & malloc_clean_bin) - * Scan 2 returns chunks (not just 1) - * Propagate failure in realloc if malloc returns 0 - * Add stuff to allow compilation on non-ANSI compilers - from kpv@research.att.com - - V2.5 Sat Aug 7 07:41:59 1993 Doug Lea (dl at g.oswego.edu) - * removed potential for odd address access in prev_chunk - * removed dependency on getpagesize.h - * misc cosmetics and a bit more internal documentation - * anticosmetics: mangled names in macros to evade debugger strangeness - * tested on sparc, hp-700, dec-mips, rs6000 - with gcc & native cc (hp, dec only) allowing - Detlefs & Zorn comparison study (in SIGPLAN Notices.) - - Trial version Fri Aug 28 13:14:29 1992 Doug Lea (dl at g.oswego.edu) - * Based loosely on libg++-1.2X malloc. (It retains some of the overall - structure of old version, but most details differ.) - -*/ - - diff --git a/libjudy/test/simple.c b/libjudy/test/simple.c deleted file mode 100644 index 477e156ad5..0000000000 --- a/libjudy/test/simple.c +++ /dev/null @@ -1,24 +0,0 @@ -#include - -int main() -{ - int Rc_int; - - int i; - - // Judy array to hold cached addresses - Pvoid_t addrArray = (Pvoid_t) NULL; - - for(i = 0; i < 100000; i++) - J1S(Rc_int, addrArray, (Word_t) i); - - for(i = 0; i < 100000; i++){ - J1T(Rc_int, addrArray, (Word_t) i); - if(!Rc_int){ - printf("Something bad happened\n"); - return -1; - } - } - - return 0; -} diff --git a/libjudy/test/testjbgraph b/libjudy/test/testjbgraph deleted file mode 100755 index a6bc84a359..0000000000 --- a/libjudy/test/testjbgraph +++ /dev/null @@ -1,22 +0,0 @@ -# run timing program to measure Judy1, JudyL and JudyHS performance -# use jbgraph script to format output suitable for 'gnuplot' -echo -echo "This script takes 1 Minute to plot output on a 3.2Ghz Pentium P4C" - -# On Linux, higher resolution of times with -DCPUMHZ=3200 on 3.2Ghz -# cc -O2 -DCPUMHZ=3200 Judy1LHTime.c -lJudy -lm -o Judy1LHTime - -# up to 1000000 population of random numbers with Judy1, JudyL, JudyHS -./Judy1LHTime -n 1000000 -1 -L -H > Judy1LHTime.plot - -# Plot the results: y-axis == uSec per Index, x-axis == number of Indexes -# -NL == Plot No Log axis -# -Lx == Plot Log in x axis -# -y:1 == default min scale, 1 microsecond max scale -# -x100: == 100 min scale, default max scale -# -c6 -c7 -c8 == plot column 6,7,8 (J1T, JLG, JHSG) -# Judy1LHTime.plot == file to plot -./jbgraph -NL -Lx -y:1 -x100: -c6 -c7 -c8 Judy1LHTime.plot - -# Performance of other ADT's can be explored with StringCompare.c, -# but you should have a very large (>100MB) text file to input. diff --git a/libjudy/test/timeit.c b/libjudy/test/timeit.c deleted file mode 100644 index 4c548e6caa..0000000000 --- a/libjudy/test/timeit.c +++ /dev/null @@ -1,311 +0,0 @@ -// @(#) $Revision: 4.12 $ $Source: /judy/judy/src/apps/benchmark/timeit.c,v $ -// -// Timer functions. -// -// YOU MUST COMPILE THIS WITH ONE OF THESE DEFINED: -// -// JU_HPUX_PA -// JU_HPUX_IPF -// JU_LINUX_IA32 -// JU_LINUX_IPF -// JU_WIN_IA32 -// -// If NONE of these are defined, this whole code section is ifdef'd out to -// avoid compile/link errors due to usage here of objects not defined in -// timeit.h. See end of file. -// -// TBD: Improve on this; possibly it's OK now not to ifdef this out, and get -// default, low-res timing behavior; see timeit.h. -// -// Compile with -D_TIMEIT_TEST to include a main program for testing; see -// main() below. - -#if (JU_HPUX_PA || JU_LINUX_IA32 || JU_LINUX_IPF) -#define _TIMEIT_HIGHRES -#endif - -#ifdef _TIMEIT_HIGHRES - -#include // Win32 uses a whole different paradigm. -#include // for getopt(), which Win32 lacks. -#include -#include "timeit.h" - -double USecPerClock; // usec per control register count. - - -// **************************************************************************** -// F I N D C P U S P E E D -// -// Return microseconds per control/timer register count. Examples: -// -// 0.002 for 500 MHz processor -// 0.001 for 1 GHz processor - -double find_CPU_speed(void) -{ - double DeltaUSec; // Timing result in uSec. - TIMER_vars(tm); // creates __TVBeg_tm, ... - // (used for consistency with __START_HRTm) - - gettimeofday(&__TVBeg_tm, NULL); // get low-res time. - __START_HRTm(tm); // get __start_tm (high-res). - sleep(1); // time passes; 1 sec suffices. - __END_HRTm(tm); // get __stop_tm (high-res). - gettimeofday(&__TVEnd_tm, NULL); // get low-res time. - -// gettimeofday() returns usec; compute elapsed time: - - DeltaUSec = (((double) __TVEnd_tm.tv_sec * ((double) 1E6)) - + (double) __TVEnd_tm.tv_usec) - - (((double) __TVBeg_tm.tv_sec * ((double) 1E6)) - + (double) __TVBeg_tm.tv_usec); - -// Control register returns ticks, and the ratio can now be computed: - - return (DeltaUSec / ((double) (__stop_tm - __start_tm))); - -} // find_CPU_speed() - -#else // _TIMEIT_HIGHRES -void dummy() {} // avoid "empty source file" warnings when no _TIMEIT_TEST. -#endif - - -// **************************************************************************** -// -// Ifdef the test main() separately, including #includes, for platforms that do -// not define find_CPU_speed() above. - -#ifdef _TIMEIT_TEST - -#include // Win32 uses a whole different paradigm. -#include // for getopt(), which Win32 lacks. -#include -#include -#include -#include -//#include // for MAXDOUBLE -#define MAXDOUBLE (10e99) -#include "timeit.h" - - -// **************************************************************************** -// M A I N -// -// Example code for timeit: -// -// To compile and test this program on HP-UX, run the next lines as commands. -// -// cc -Wl,-a,archive -DJU_HPUX_PA -D__HPUX__ -D_TIMEIT_TEST -o timeit timeit.c -// timeit # run test program. -// rm -f timeit # clean up after test. - -int main(int argc, char **argv) -{ - int i = 0; // loop index. - long i_max = 10; // number of loops. - int preload = 1; // loops to throw away (preload cache). - double ztime; // timer overhead. - double usec[4]; // for early timing tests. - double DeltaUSec; // timing result in usec. - double prevtime; // from previous loop. - double mintime; // minimum event time. - struct timeval tmjunk; // for throw-away syscall. - TIMER_vars(tm1); // overall timer variables. - TIMER_vars(tm2); // misc + loop timer variables. - - -// INITIALIZE: - - STARTTm(tm1); // whole program timer. - - i_max += preload; - -// The first arg is the number of iterations (default is i_max): - - if (argc > 1) - { - i = atoi(argv[1]) + preload; - if (i > 0) i_max = (long)i; - } - -// Calculate timer overhead (ztime): - -#ifdef _TIMEIT_HIGHRES - (void) puts("Possible slight delay here due to find_CPU_speed()..."); -#else - (void) puts("No high-res clock or find_CPU_speed() for this platform."); -#endif - - ztime = 0.0; - - for (i = 0; i < 100; ++i) // average many runs. - { - STARTTm(tm2); - ENDTm(DeltaUSec, tm2); - ztime += DeltaUSec; - } - ztime = ztime / ((double) i); - - -// SIMPLE TESTS OF TIMER OVERHEAD: -// -// Make two passes at both the high-res (if any) and slower timers. - - (void) puts("\nTiming timers themselves: start, end, end"); - -#define PRINTPASS(Desc,Pass) \ - (void) printf("%-8s pass %d: %f - %f = %f usec\n", Desc, Pass, \ - usec[((Pass) * 2) - 1], usec[((Pass) * 2) - 2], \ - usec[((Pass) * 2) - 1] - usec[((Pass) * 2) - 2]) - -#ifdef _TIMEIT_HIGHRES - START_HRTm(tm2); - END_HRTm(usec[0], tm2); // throw away in case of sleep(1) here. - - START_HRTm(tm2); - END_HRTm(usec[0], tm2); - END_HRTm(usec[1], tm2); - - START_HRTm(tm2); - END_HRTm(usec[2], tm2); - END_HRTm(usec[3], tm2); - - PRINTPASS("High-res", 1); - PRINTPASS("High-res", 2); -#endif - - STARTTm(tm2); - ENDTm(usec[0], tm2); // throw away in case of sleep(1) here. - - STARTTm(tm2); - ENDTm(usec[0], tm2); - ENDTm(usec[1], tm2); - - STARTTm(tm2); - ENDTm(usec[2], tm2); - ENDTm(usec[3], tm2); - - PRINTPASS("Non-HR", 1); - PRINTPASS("Non-HR", 2); - - -// PRINT INITIAL INFO: - -#ifdef _TIMEIT_HIGHRES - -// Print the CPU speed: -// -// Note: USecPerClock is a global set by the first instance of STARTTm. You -// can also get this number by calling find_CPU_speed(). - - (void) printf("\nClock step = %.3f nsec => %.1f MHz.\n", - USecPerClock * 1000.0, 1.0 / USecPerClock); -#endif - -// Print timer overhead even though it's been subtracted from the reported -// results. - - (void) printf("Timer overhead subtracted from the times below = %f " - "usec.\n", ztime); - - -// DO A FAST TIMER CHECK: - - (void) puts("\nCheck timer precision by repeating the same action:"); - (void) puts("Times in each group should be close together."); - (void) puts("\nTiming something very fast: \"++i\":"); - - mintime = MAXDOUBLE; - - for (i = 1; i <= i_max; ++i) - { - prevtime = DeltaUSec; - STARTTm(tm2); // start the timer. - ++i; // statement to time. - ENDTm(DeltaUSec, tm2); // stop the timer. - DeltaUSec -= ztime; // remove timer overhead. - -// Throw away the first loop iteration to warm up the cache: - - if (--i > preload) - { - if (mintime == MAXDOUBLE) mintime = DeltaUSec; - - (void) printf("%3d. %8.3f nanosec,\tmintime diff %8.1f %%\n", - i - preload, DeltaUSec * 1000.0, - ((DeltaUSec - mintime) * 100) / mintime); - - if (DeltaUSec < mintime) mintime = DeltaUSec; - } - } - - -// TIME A FUNCTION CALL: - - (void) puts("\nTiming a function: \"gettimeofday()\":"); - mintime = MAXDOUBLE; - - for (i = 1; i <= i_max; ++i) - { - prevtime = DeltaUSec; - STARTTm(tm2); // start the timer. - gettimeofday(&tmjunk, NULL); // burn some cycles. - ENDTm(DeltaUSec, tm2); // stop the timer. - DeltaUSec -= ztime; // remove timer overhead. - -// Throw away the first loop iteration to warm up the cache: - - if (i > preload) - { - if (mintime == MAXDOUBLE) mintime = DeltaUSec; - - (void) printf("%3d. %8.3f usec,\tmintime diff %8.1f %%\n", - i - preload, DeltaUSec, - ((DeltaUSec - mintime) * 100) / mintime); - - if (DeltaUSec < mintime) mintime = DeltaUSec; - } - } - - -// TIME SOMETHING SLOW: - - (void) puts("\nTiming something slow: \"sleep(1)\":"); - mintime = MAXDOUBLE; - - for (i = 1; i <= i_max; ++i) - { - prevtime = DeltaUSec; - STARTTm(tm2); // start the timer. - sleep(1); - ENDTm(DeltaUSec, tm2); // stop the timer. - DeltaUSec -= ztime; // remove timer overhead. - -// Throw away the first loop iteration to warm up the cache: - - if (i > preload) - { - if (mintime == MAXDOUBLE) mintime = DeltaUSec; - - (void) printf("%3d. %8.3f sec,\tmintime diff %8.1f %%\n", - i - preload, DeltaUSec/1E6, - ((DeltaUSec - mintime) * 100) / mintime); - - if (DeltaUSec < mintime) mintime = DeltaUSec; - } - } - - -// FINISH UP: -// -// Print program execution time: - - ENDTm(DeltaUSec, tm1); - (void) printf("\nProgram execution time: %.3f sec\n", DeltaUSec / 1E6); - return(0); - -} // main() - -#endif // #ifdef _TIMEIT_TEST diff --git a/libjudy/test/timeit.h b/libjudy/test/timeit.h deleted file mode 100644 index 4e27c04800..0000000000 --- a/libjudy/test/timeit.h +++ /dev/null @@ -1,221 +0,0 @@ -#ifndef _TIMEIT_H -#define _TIMEIT_H - -// @(#) $Revision: 4.14 $ $Source: /judy/src/apps/benchmark/timeit.h $ -// -// Timing and timers header file with example program. -// -// You should compile with one of these defined: -// -// JU_HPUX_PA # control register available (via asm()). -// JU_HPUX_IPF # TBD, see below. -// JU_LINUX_IA32 # control register available (via get_cycles()). -// JU_LINUX_IPF # control register available (via get_cycles()). -// JU_WIN_IA32 # uses clock(). -// -// Otherwise default (low-res) timing code using gettimeofday() results. This -// mode is only accurate to usecs, and fuzzy due to syscall overhead. -// -// Public macros; the *_HRTm() forms are much faster than the others: -// -// TIMER_vars(T) - declare variables to use for timers -// STARTTm(T) - start the timer with variable T -// ENDTm(D,T) - compute usec from last STARTTm(T), save result in double D -// START_HRTm(T) - high-res for short intervals (< 2^32[64] clock ticks) only -// END_HRTm(D,T) - high-res for short intervals (< 2^32[64] clock ticks) only -// -// Private macros: -// -// __START_HRTm(T) - read high-res control register, save in T -// __END_HRTm(T) - read high-res control register, save in T -// __HRONLY(D,T) - use high-res clock only -// -// Note: The __*_HRTm and __HRONLY macros are only available on platforms with -// control registers for high-res clocks. On hpux_pa this is a 32-bit register -// and gettimeofday() must be used to handle rollover; on linux_* this is a -// 64-bit register. - -#ifndef JU_WIN_IA32 -#include // Win32 uses a whole different paradigm. -#include // for getopt(), which Win32 lacks. -#endif - -#include - -// Public variables: - -extern double USecPerClock; // defined in timeit.c. - -// __HRONLY is used for multiple platforms, but only in cases where there is a -// high-res clock and find_CPU_speed() is available from timeit.c: - -#define __HRONLY(D,T) \ - { \ - if (USecPerClock == 0.0) USecPerClock = find_CPU_speed(); \ - (D) = ((double) (__stop_##T - __start_##T)) * USecPerClock; \ - } - - -// TIMING ROUTINES: - - -// ********************* HPUX PA **************************** -// -// Define __START_HRTm and __END_HRTm only, and let later common code add -// STARTTm and ENDTm. -// -// TBD: On hpux_pa or hpux_ipf 64-bit, is CR_IT a 64-bit register? If so, it's -// unnecessary and wasteful to use gettimeofday() later to watch for rollover. -// -// TBD: JU_HPUX_IPF does not recognize CR_IT ("Undeclared variable 'CR_IT'"), -// so for now treat that platform as having no high-res clock and do not -// included it in this section. - -#if (JU_HPUX_PA) -#include -#include - -double find_CPU_speed(void); - -// Note: On hpux_*, at least older compilers, it is neither necessary nor even -// allowed to mark the __start_* and __stop_* variables as volatile; the -// compiler does not optimize out the code even without it: - -#define TIMER_vars(T) \ - register unsigned long __start_##T, __stop_##T; \ - struct timeval __TVBeg_##T, __TVEnd_##T - -#define __START_HRTm(T) _asm("MFCTL", CR_IT, __start_##T) -#define __END_HRTm(T) _asm("MFCTL", CR_IT, __stop_##T ) - -#endif // (JU_HPUX_PA) - -// ********************* LINUX IA32 ************************** -// -#ifdef JU_LINUX_IA32 -#include - -double find_CPU_speed(void); - -#define TIMER_vars(T) \ - register unsigned long __start_##T, __stop_##T; \ - struct timeval __TVBeg_##T, __TVEnd_##T - -#define __START_HRTm(T) rdtscl(__start_##T) -#define __END_HRTm(T) rdtscl(__stop_##T) - -#endif // JU_LINUX_IA32 - -// ********************* LINUX_IPF ************************** -// -// Define __START_HRTm and __END_HRTm, and also STARTTm and ENDTm in terms of -// the former (no need for gettimeofday()). - -#ifdef JU_LINUX_IPF - -#include - -double find_CPU_speed(void); - -// Using cycles_t rather than unsigned long [long] should be more portable; -// and, it appears necessary to mark __start_* and __end_* as volatile so the -// gcc compiler does not optimize out the register access: - -#define TIMER_vars(T) \ - register volatile cycles_t __start_##T, __stop_##T; \ - struct timeval __TVBeg_##T, __TVEnd_##T - -// This seems required for linux_ia32: - - -// Older code (see 4.13) used rdtscl(), but this is not portable and does not -// result in a 64-bit value, unlike get_cycles(), which apparently takes -// advantage of a 64-bit control register on both IA32 and IPF => always -// high-res timing with no rollover issues. Note, cycles_t is unsigned, so the -// math works even in case of a rollover. - -#define __START_HRTm(T) __start_##T = get_cycles() -#define __END_HRTm(T) __stop_##T = get_cycles() - -#define STARTTm(T) __START_HRTm(T) -#define ENDTm(D,T) { __END_HRTm(T); __HRONLY(D,T); } - -#endif // JU_LINUX_IPF - - -// ********************* WIN IA32 ***************************** -// -// WIN IA32 has no way to access the control register (?), so define STARTTm -// and ENDTm directly using clock(): - -#ifdef JU_WIN_IA32 - -clock_t TBeg, TEnd; - -#define TIMER_vars(T) struct timeval __TVBeg_##T, __TVEnd_##T - -#define STARTTm(T) __TVBeg_##T = clock() -#define ENDTm(D,T) { __TVEnd_##T = clock(); \ - (D) = ((double) (__TVEnd_##T - __TVBeg_##T)); } - -#endif // JU_WIN_IA32 - - -// ********************* OTHER ***************************** -// -// Default to using the low-res, slow-access clock only. - -#ifndef TIMER_vars - -#define TIMER_vars(T) struct timeval __TVBeg_##T, __TVEnd_##T - -#define STARTTm(T) gettimeofday(&__TVBeg_##T, NULL) - -#define ENDTm(D,T) gettimeofday(&__TVEnd_##T, NULL); \ - (D) = (((double) __TVEnd_##T.tv_sec * ((double) 1E6)) \ - + (double) __TVEnd_##T.tv_usec) \ - - (((double) __TVBeg_##T.tv_sec * ((double) 1E6)) \ - + (double) __TVBeg_##T.tv_usec) -#endif // ! TIMER_vars - - -// COMMON CODE FOR SYSTEMS WITH HIGH-RES CLOCKS (CONTROL REGISTERS): - -#ifdef __START_HRTm - -// Platforms that define __START_HRTm but not STARTTm (presently only hpux_pa) -// use gettimeofday() for the low-res clock and __START_HRTm/__END_HRTm for -// the high-res clock. If the low-res clock did not "roll over", use the -// high-res clock; see __HRONLY. -// -// Note: Rollover is defined conservatively as 1E5 usec (= 1/10 sec). This -// would require a 40 GHz 32-bit system to be violated. - -#ifndef STARTTm -#define STARTTm(T) \ - { \ - gettimeofday(&__TVBeg_##T, NULL); __START_HRTm(T); \ - } - -#define ENDTm(D,T) \ - { \ - __END_HRTm(T); gettimeofday(&__TVEnd_##T, NULL); \ - \ - (D) = (((double) __TVEnd_##T.tv_sec * ((double) 1E6)) \ - + (double) __TVEnd_##T.tv_usec) \ - - (((double) __TVBeg_##T.tv_sec * ((double) 1E6)) \ - + (double) __TVBeg_##T.tv_usec); \ - \ - if ((D) < 1E5) __HRONLY(D,T); \ - } -#endif // ! STARTTm - -// Faster forms for heavy/frequent use in code loops where intervals are less -// than 2^32[64] clock ticks: - -#define START_HRTm(T) __START_HRTm(T) -#define END_HRTm(D,T) { __END_HRTm(T); __HRONLY(D,T); } - -#endif // __START_HRTm - -#endif // #ifndef _TIMEIT_H diff --git a/libjudy/tool/Makefile.am b/libjudy/tool/Makefile.am deleted file mode 100644 index 33d218aad4..0000000000 --- a/libjudy/tool/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -INCLUDES = -I. -AM_CFLAGS = @CFLAGS@ @WARN_CFLAGS@ - -noinst_PROGRAMS = jhton - -jhton_SOURCES = jhton.c - -DISTCLEANFILES = .deps Makefile diff --git a/libjudy/tool/Makefile.in b/libjudy/tool/Makefile.in deleted file mode 100644 index 59fd89b000..0000000000 --- a/libjudy/tool/Makefile.in +++ /dev/null @@ -1,439 +0,0 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -noinst_PROGRAMS = jhton$(EXEEXT) -subdir = tool -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) -am_jhton_OBJECTS = jhton.$(OBJEXT) -jhton_OBJECTS = $(am_jhton_OBJECTS) -jhton_LDADD = $(LDADD) -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(jhton_SOURCES) -DIST_SOURCES = $(jhton_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FLAVOR = @FLAVOR@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -VERSION_INFO = @VERSION_INFO@ -WARN_CFLAGS = @WARN_CFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -INCLUDES = -I. -AM_CFLAGS = @CFLAGS@ @WARN_CFLAGS@ -jhton_SOURCES = jhton.c -DISTCLEANFILES = .deps Makefile -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tool/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu tool/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -jhton$(EXEEXT): $(jhton_OBJECTS) $(jhton_DEPENDENCIES) - @rm -f jhton$(EXEEXT) - $(LINK) $(jhton_OBJECTS) $(jhton_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jhton.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) - -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 clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -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 - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/libjudy/tool/README b/libjudy/tool/README deleted file mode 100644 index 1bd48ea46d..0000000000 --- a/libjudy/tool/README +++ /dev/null @@ -1,134 +0,0 @@ - -# @(#) $Revision: 4.2 $ - -# CHECK README FILES AGAINST DIRECTORIES. - -# Usage: